DavidB 44 Junior Poster

Everybody is going to have their favorite.

Historically, FORTRAN has always been the language favored for hardcore scientific/math programming, and there is such a large code base out there, I doubt you will get away from it completely for a long time.

Alternately, people like the language they happen to know. I know C, C++, and Javascript, so I like writing code in those languages. Speed isn't an issue for me, and I am happy with the 16 or so decimal places of accuracy these langauges give me.

I suppose it depends on the application and intended audience. For example, if your boss tells you to program in, say, Java, that would become your favorite language.

DavidB 44 Junior Poster

. . . but i dont think its reading from the file because its not finding any numbers in the tier

Right after you input the file, echo it to the console, as a check. Then you know for sure.

You also might want to cut your program waaaay down, get a section working, then slowly add sections.

Here is what I do:
Always keep a plaintext editor (like Notepad) running. Copy and paste your entire program to a plaintext document and save it as a back up. Now cut most of your code out of the program. Leave just enough to run and test the file entry section. Once you have got that section working properly, copy and paste additional code from the Notepad file back into your program. Add and test a small section of code at a time. That way you don't have a whole bunch of things to wonder about. You can build and fix one small thing at a time.

jonsca commented: Great advice +14
DavidB 44 Junior Poster

Don't overlook including your blog URL on your resume. If you have your resume posted on some of the big job posting boards you should draw in some more visitors too. It might get you a job and, even if it doesn't, the fact that a potential employer did a search for somebody with your credentials and came across your posted resume is a good sign. I think that is well-targetted traffic. And the blog serves as a showcase of your talent--your web design skills, your writing ability, etc.--so that potential employers know you are not joking; you have results to display to back you up.

In any case, it should bring in a few extra visitors per week.

DavidB 44 Junior Poster

I agree with "Ancient Dragon": you generally use for loops when you know ahead of time exactly how many loops will be executed.

However, I would like to add another couple aspects you might want to consider.

1) If the body of the loop is small, and you want to be really anal about speeding up code execution, loop unrolling might be worthwhile. By reducing the number of condition checks, that code block executes faster.

2) I have read a few times that turning a for loop into a reverse while loop makes the program execute faster (but I haven't done any software timing experiments to test it myself).

Say you have a loop you know will execute 10,000 times.
Normally, you'd code it as a for loop:

for (i = 0; i < 10000; i++){
  do something;
} // End for loop

However, you could also code it as a reverse while loop:

i = 10000;
while (i){
  do something;
  i--;
} // End while loop

Keep in mind that if you are using the loop variable, i, to also serve as a index to a variable you are working with, like a matrix, it might not work in the while loop. So you'd have to use another variable.

Anyhow, it is something else to think about.

DavidB 44 Junior Poster

I am not much for sports; I might go to a few sporting events throughout the year, mainly as an outing rather than because I follow a particular sport or team. However, I did manage to attend one Olympic hockey game: Sweden versus Belarus. It was good and I am glad I went. I also spent a couple days walking around, looking at the various venues, trying some of the international food that the various countries set up, etc. It was an awesome experience. The atmosphere was positive, electric, and emotional. It was like one big party. Like being at a big concert with friends, the music is good, everybody is singing along, and holding up their lighters, etc. Hard to describe. But I had many moments when I had goosebumps and my eyes started welling up. Not like me at all. So many people. So many people from different countries speaking different languages all in one area. What an experience!

DavidB 44 Junior Poster

MATLAB has an "area" function, but I think it requires a known function, which doesn't help you, since your data is experimental.

I am not aware of MATLAB having the sort of function you want, unless they have added this capability recently.

You might want to check out PCHQA:

http://www.ewp.rpi.edu/hartford/~ernesto/ernesto/Courses/C_S97/nc/NMS/CH04/pchqa.f

It accepts experimental data, and does a numerical integration on it, creating an interpolating spline wherever data is needed in order to give the results meaning. (If the integration used only the data points, the results would probably be meaningless, so the algorithm must interpolate at certain points in order to give the results meaning.)

However, there is one drawback: PCHQA is written in FORTRAN

DavidB 44 Junior Poster

I haven't done much looking, Computational Fluid Dynamics is a pretty specialized topic; however, off the top of my head, I would suggest you check out CFD Online.

It looks like a pretty good starting point.

PoovenM commented: Thanks for the link :) +3
DavidB 44 Junior Poster

I remember them and used to be quite a comic collector. In fact, I still have about 5000 comics (literally) stored at my parents' place. I liked Marvel comics better than DC comics because the story lines were more mature, and the art was great. Among my favorites: The X-Men and Spiderman.

However, then the storylines started to get too complicated, sub-plots within sub-plots within sub-plots. They started to feel too much like soap operas. So I stopped buying years ago. Now, I take a look at the comic line-ups just to see what's available, but I haven't seen anything to turn me into a purchaser again. And the prices have sure gone up (Ouch!)


David

maravich12 commented: Awesome fan list. +2
DavidB 44 Junior Poster

Do you know some conditions ahead of time? For example, will the denominator always be a linear term, such as (x- a)? If so, it would make the program a lot simpler.

You might find something by doing a search on the term "synthetic division".

It is often used for solving the roots of polynomials (deflating them).
Say you have the polynomial P(x) = 0 and you know one root is x = a. You then know P(x) = (x-a)*Q(x) = 0. Q(x) is found by synthetic division, removing the root you already know so that the remaining equation, Q(x), is simpler to solve.

For example, check out sub-routine quadsd on the following page:

http://www.crbond.com/download/misc/rpoly.cpp

You may not be solving for the roots of polynomials, but the synthetic division procedure, itself, might be applicable to your problem. "Numerical Recipes" also provides some code.

Hope this gives you some ideas.


David

DavidB 44 Junior Poster

Hi, John.

Glad to see you here. I browse the SP forums occassionally, but have really not been active. After reading about directory submission, forums, article submission, SEO techniques, etc., reading the same questions (posted by people new to the field) gets kind of boring, so my visits to SP are down to one quick browse per day, if that.

Good introduction! Very thorough. One question (curiousity): Why did you pick the "stymiee" handle? Does it have any particular meaning?

Regards,


David

Mike555 commented: -Mike555 +1