Call graph for a turbo pascal program - pascal

I am doing some maintenance to a 18 year old pascal program. To help me understand how everything fits together I want to draw a call graph. However I cant find any software that can draw a call graph for pascal source. I am currently using Turbo Pascal 7 and have no idea about the abilities of other pascal compilers.

Pascal analyser from Peganza maybe?
http://www.peganza.com/products_pal.htm
Commercial though, but description has "call tree" in it.
New URL:
https://www.peganza.com/products.html#PAL

Code Visual to Flowchart can help you visualize Pascal logic. Demo is free to try.

Related

What language would be more efficient to implement a graph library?

Brief Description
I have a college work where I have to implement a graph library (I'll have to give a presentation about this work later)
The basic idea is to write all the code of the data structures and their algorithms from scratch, using the tools provided by some programming language, like C/C++, Java, Python, doesn't really matter which one of them I'll pick at first.
But I should not use any built-in graph libraries in the language: the goal of the work is to make the students learn how these algorithms work. There are some test cases which my program will be later submitted to.
It is not really necessary but, if you wanna take a look, here is the homework assignment: http://pastebin.com/GdtvMTMR (I used Control-C Control-V plus google translate from a LaTeX text, this is why the formatting is poor).
The Question
So, my question is: which programming language would be more time efficient to implement this library?
It doesn't really matter if the language is functional, structured or object oriented. My priority is time efficiency and performance.
The better language is the one you know more.
But if you're looking for some performance, take a look at compiled languages with optimisations. Keep in mind that the code you write is the major component responsible in final performance, the language itself cant do miracles.
A more low level language give to you controls but requires deeply knowledge of the language and the machine you're running your code, so it's a tradeoff.
By a personal choose I would recommend C/C++ to implement a graph library. I've already done this in the past and I used vanilla ANSI C and the performance was awesome.
The one you feel more passionate about and feel more comfortable coding with.
This way you will rock your project.
Myself would pick Java.

ajax and asp classic

i'm newbie in programming and i as a marketing executive so i dont know anything about programming but i very excited to learn programming so now i learn independently.My friend said to me,better for beginner learn C++ first then go to ASP clssic then ASP.NET+PHP+CI..now i in ASP stage.
Question 1 : it is correct suggestion from my friend?
search suggestion
I stack on this problem
how to create live search same as this link http://www.w3schools.com/php/php_ajax_livesearch.asp
this is my db code
Set rsGuestbook = Server.CreateObject("ADODB.Recordset")
strSQL = "SELECT staff_name FROM master WHERE staff_name like '" & Request("s") & "%'"
rsGuestbook.Open strSQL, oConn
livesearch.php?q="+str,true = livesearch.php?q="+str,true
please help
First off, if you're only starting out, then don't worry overly about any particular language (unless you have a specific need to learn it). You'd be better off learning the core tenets of programming from a generic tutorial such as:
http://lifehacker.com/#!5401954/programmer-101-teach-yourself-how-to-code
Once you've got a grasp on the basics then try to learn a language suited to your goal. If that's web development then PHP/ASP.NET/RUBY etc. If it's desktop/mobile then look at C/C++/C#/Obj-C/VB.NET according to whatever the platform you are working on needs/offers.
Take a look at W3Schools for web-based languages tuts:
http://www.w3schools.com/
As to the second part of your question, there is so much wrong with your snippet of code on so many levels that I would just put it quietly aside in the cupboard, and re-visit it once you've got a better handle on the basics, and you'll see why it's wrong.
Learning C++ is quite 'advanced' and not what I'd recommend for someone who's not studying a computer science degree course or working as a professional programmer. It's a very big and complex language that requires a lot of other skills, not least object orientation and general computer science knowledge.
It would be far more appropriate for you to start with something far more simple, such as classic ASP or PHP. Choose one only! Then buy a book. Then play for a bit. Then build a simple website about your cat/hamster/car/boat/ear-wax. Then build another one using the lessons learned from the first website. I'd suggest looking at several months to hone your skills, particularly as you're doing it part time.
Learning to program is about as simple as learning to play a musical instrument. The more you practice the better you get. Some people are naturally good at it, but, alas, most aren't and have to work very hard.
When your first starting out the language isn't to important (of course go for an easier language). For the most part many of the larger languages are interchangeable (for example a cout in C++ is the pretty much the same as a System.out.print in JAVA). The more important thing you need to grasp is program structure, Object Oriented Programming principles, and the other basic "do's" and "dont's" of programming. These ideas will apply to just about every programming language you use.
IMO (and this may be wrong) the language you learn is the least important aspect when you are a beginner. Most programmers will have to use many languages in their career and spending the time to learn every in and out of each language would be a waste. For example I started out learning Visual Basic in highschool. After a few months I was switched to C++. Once I went to college I had to learn JAVA for 6 months, then switched to Ruby, then C, CSS, HTML, Android SDK and Javascript. After that I got a job and had to learn C# and how to use AJAX, .Net, facebook API and other languages. Moral of the story is the principles are more important than the languages.
My advice: First find out what you want to program. Ira Rainey has some good suggestions as to where to go and what to learn if you look at his answer (though I would include JAVA for a desktop/mobile language)
C++ shouldn't be to advanced if you have the right material to learn it. I would recommend working with C++ to make a few very basic programs. Start by trying to make a basic calculator that will send all input to command line. Once you got the basics down (+,-,*,/) then you can slowly evolve it to be more and more complex (^,%,!). This will give you a platform to build off and a goal to obtain.
Here is a site to help you learn C++

Do you have examples of push-the-envelope programming usage of VB6?

VB6 had a reputation for being too forgiving (and thereby allowing bad practices) and hiding complexities that perhaps developers would be better off needing to know. But I found that, say, 90% of applications could be done in VB6.
But I'd like to see more examples of pushing-the-envelope to work round VB6's limitations. For example, I once found some code for using pointers in VB6 by making calls to the Windows OS. The result was that some string manipulation on largish documents (about 2MB) was brought down from 30 minutes to just over 3 seconds. Does anyone have other examples of going past the limits of VB6?
N.B. not VB.Net.
One nasty trick was to abuse CallWindowProc to call arbitrary code by passing a pointer to it. This is technically breaking that function's contract, since it's only supposed to be used with handles (not direct code pointers) obtained via GetWindowLong; but in practice so few people actually know this that the implementation is forced to allow arbitrary code pointers. This lets you call any function pointer, so long as it's stdcall, and takes 4 arguments of the same sizes as WndProc arguments.
One even nastier trick that is a consequence of the above is that you can dynamically generate code that way - just stick it in a byte array, and use CallWindowProc to jump to it. This way you can embed non-VB6-produced native code into a VB6 application without any external DLLs. Of course, in this age of NX bit enabled by default, it's probably not such a good idea anymore (if it ever was, that is)...
Joel said some good stuff about VB6 back in 2001.
Many VB6 programs are spaghetti,
either because they're done as quick
and dirty one-offs, or because they're
written by hack programmers without
training in object oriented
programming, or even structured
programming.
What I wondered was, what happens if
you take top-notch C++ programmers who
dream in pointers, and let them code
in VB6. What I discovered at Fog Creek
was that they become super-efficient
coding machines. The code looks pretty
good, it's object-oriented and robust,
but you don't waste time using tools
that are at a level lower than you
need. I've spent years writing code
for C++/MFC and years writing code in
Visual Basic, and let me tell you, VB6
is just much, much more productive...
One of the things about Visual Basic 6
is that it doesn't always give you
access to the full repertoire of
Windows goodies that you need to make
a polished application. But what it
does do, better than almost any other
programming environment, is let you
drop into C++ code (or call C APIs)
when you're desperate or when you need
that extra speed.
That was written in 2001: when creating a new Windows program today, IMHO the obvious choice for best productivity is VB.Net or C#. (JOKE: C# is just Visual Basic with semicolons.)
Getting back to VB6: there are many good examples of how to call C APIs to do something special or just to run faster. Here's some of my favourite links:
Karl E Peterson's One Stop VB Shop - his StringBuilder sounds like your example, although it doesn't use API calls
Steve McMahon's VBAccelerator
And I give +10 for OneDayWhen for listing Matthew Curland's Advanced Visual Basic 6. Probably pushed the envelope further than anyone (and didn't quite burst it).
I'm not sure what he puts in his sandwiches but pretty much everything found in Matthew Curland's Advanced Visual Basic 6 is push-the-envelope programming usage of VB6. Truly great stuff.
Can't let this question go by without an answer mentioning Bruce McKinney's Hardcore Visual Basic, which is now (wonderfully) available online:
http://vb.mvps.org/hcvb.asp
It's a great read by an author who clearly loves the spirit of Basic.
Realizing that most of the Gang of Four design patterns rely on implementing an interface, not inheritance and thus can be easily used in Visual BASIC 6.
Being able to do so greatly improved the design of my CAD/CAM application.
How about an full XML parser in VB6.
Pixel based automatically-drawn
irregular forms.
Paul Caton's Subclassing, continued by LaVolpe (http://www.planet-source-code.com/vb/scripts/ShowCode.asp?txtCodeId=68737) allows you to do whatever you need, hooking into windows events, with no IDE crashing.
With this you can implement whatever is necessary in Windows.
The samples have crazy things that you may never thought could be possible.

When should I break into GUI/game development?

I am a hobbyist console C++ developer. I have worked with pointers, arrays, std::vectors, std::strings, classes, and several data structures, including stacks and binary trees. I have some experience in linear algebra and geometry, and know the basics of physics. I do NOT have experience with win32, QT, openGL, DX9, OGRE, etc. I am still learning about the more valuable parts of OOP, like polymorphism.
I started C++ as a first language, and do not have experience with other languages. I could probably work with C, but I'd need to get used to manipulating char*'s and regular arrays (and not initing variables).
My question is, with my experience, when should I break into the development of GUI applications/game applications? Do I need to ground myself more firmly in certain areas of math, become comfortable with win32, get used to SDK?
If this question is too subjective for you to comfortably give advice, then when did you break into GUI/game development, and what steps did you take to make yourself comfortable with it?
Editing this so it will get bumped. Does anyone else have any opinions?
Caveat: I am a very "learn-by-doing" type of person, so take this with a grain of salt.
Sounds like you know enough programming basics to jump into something more realistic, and have enough background to justify that realistic project being a game.
I'd recommend downloading Visual C# Express and Microsoft's XNA Game Studio 3.0.
XNA is a game framework that has a lot of stuff done for you (sound, sprites, 3D support, etc.) built on a professional-quality C# platform and it would be a good starting point. Create a new XNA project and play around. Get some stuff to appear on the screen, then learn to manipulate it with user input. If you are interested in 3D, make a 3D shape such as a triangle. Then, make it spin. Then, make it spin based on user input. Then, add other objects and collisions.
Surely, there will be things in the framework that you don't understand. Tackle them as they come - use Google and ask questions here until you do understand them. Take it one step at a time and you should be just fine.
I'd personally recommend you to start out with Win32; try creating a basic window & move on from that point. Try making a simple 2D game engine in which you are able to make a game like chess or so. This could also serve as project for which you could write an AI; which is another part of Game Development!
After you finish that, the next step should be 3D. You could use the engine you wrote before and modify it from 2D to 3D. Pick a 3D API; OpenGL or DirectX. Once you have a basic engine, start writing a game. Need extra functionality? Then add it to the engine!
Math-wise you should know what matrices are. Trigonometry can come in handy as well.
I wouldn't waste my time with Xna, it's just a hype. :P
It seems you already have gained the basic knowledge of a programming language to start game programming. I'm with you in building on what you have already gained, such as learning OOP, and practicing more with pointers. I recommend you move on and don't turn to learning another tool "programming language" to achieve your goals.
So if you are interested in game programming, I recommend you pick a C++ framework and work on it, you'll definitely learn more advanced programming by just using it.
I recommend Gosu. It's not full of advanced features, which can be an advantage, but it has a very clean design and uses C++ in an elegant and modern way. Which makes it very friendly especially for beginners.
Also HGE is another good 2D engine.
To sum up, dive into programming more by actually "doing it" with what you have now. That's how you'll progress, and you'll be amazed with the results. And when "doing it" don't get disturbed with other languages and tools you already know something similar to it, and at the same time when learning a tool that helps you to build on your current knowledge, in your case I mean the C++ engine, don't choose very complicated ones (IMO, like OpenGL, DirectX, Win32...etc) because you'll end up spending time on learning the tool not using it and there is a great chance you'll get frustrated. You can always learn the low level things later, and it will make a lot more sense then.
as this question is kind of subjective, because every programmer has a favourite library to start with, I will recommend SDL as it is simple, well structured, and very complete, there are a lot of tutorials out there to guide you step-by-step from making a simple window to complex 3D manipulation. Everything can be implemented with ease.
As a side note, if you want to start programming games, I would recommend, also, that you read some tuts or books about a Game basics (initialization, game loop, update cycles), so that you know how to put your knowledge to the good work.

What does Wolfram Mathematica 7 offer for CS/CEN students?

Wolfram Mathematica 7 has an increasing popularity among computer science and computer engineering students, but what are the main benefits and features it offers?
Here are a few:
Symbolic math
Numerical methods
All the statistical and math functions you'll ever need
An API and programming language to tie them all together
Since CS students sometimes have to help solve real problems in physics and engineering, Mathematica can help.
It is beautiful and strange.
For computer engineering (and engineering in general, I suppose) I would say that MATLAB is more relevant. Maybe it doesn't do symbolic math quite as well as Mathematica (though there is a symbolic math toolbox that works quite well) but in engineering you are mostly looking for a numeric approximation anyway, so it won't matter.
MATLAB is insanely good for solving anything that has to do with matrices (and, incidentally, everything seems to be ;)) and has a toolbox for anything you might want to do from signal processing, automatic control, LEGO Mindstorms programming.
I am soon finished with my Masters in Computer engineering and I have never used Mathematica in any course, even though it is installed on quite a lot of the machines at the university. MATLAB, on the other hand, is used frequently in all sorts of engineering courses.
I use Mathematica and C++ for my work.
I love to work in Mathematica because I think programming in it is like casting spells (lisp comes to mind). Within a a few lines you can pack so many ideas that, after a while when you move to a lang like C++ or java, its like somebody has tied your hands.
But I still do go back to C++ to get my programs to work fast. However quickly prototyping everything in Mathematica simplifies my life greatly because i at-least know what exactly i need to do. Hence I can just focus on the craziness of C++ language.
FWIW even though Mathematica and Matlab seem to use most of the same *PACK libraries Mathematica runs faster for most numerics tasks.

Resources