DavidB 44 Junior Poster

Hello, "starlight849".

Welcome to the DaniWeb forums. You'll probably find this a good place to be; lots of good information shared here.

I happen to be interested in the aerospace industry, but don't work in the field. Is that the industry you want to be in? Or are you flexible, just glad to find work as a computer scientist when you finish your schooling?

DavidB 44 Junior Poster

If I could at least get my foot in the door and show my skills and willingness/ability to learn I'm sure I could become a valuable asset for any company willing to give me the chance. Unfortunately, I never get past the application to even an interview.

I am sure that applies to many people out there; it certainly applies to me too.

However, even if you get hired by somebody, perhaps you will soon get tired of relying on other people for your money. Once people know they control your rent and grocery money, they take advantage of you somewhat. So perhaps you should not make your ultimate goal employment. Use it as a stepping stone to a career as your own boss, either as a consultant, or a contract worker, etc. If you have the creativity and initiative that you seem to, I think working for yourself is the goal you should be working toward. In the meantime, use the time, and any employment periods, as opportunities to learn skills and gain experience that make you a better professional.

While you are unemployed, work on your website and blog as much as possible. Perhaps learn more web technologies and programming languages. And feature them on your website, which can be a real-time exhibit of your skills.

Myself, I never applied for writing jobs; however, after writing on my blog for a few years, I decided that I have enough of an online portfolio to apply …

DavidB 44 Junior Poster

People use short URLs for twitter because there is a low character limit and in most cases full URLs are too long to fit. If you care about SEO, make sure that you use a URL shortener that does a 301 Permanent Redirect to the full URL so that "seo juice" gets passed appropriately. I like the bit.ly service because it has nice performance tracking tools.

Hmmnnn . . . I have never tried bit.ly. This is good advice.

Have you ever tried snipurl.com? I am curious to know how the two services compare.
There is also a Plug-in for WordPress blogs that allows you to base a shortened URL on your own domain. However, if you are using Twitter, and are sensitive about character limit, I suppose site names don't get much shorter than bit.ly.

DavidB 44 Junior Poster

Hi, Sharon.

Welcome to Daniweb; glad you joined.

Excellent, thorough, introduction. It is always good to learn a little about new members instead of just reading a generic, "Hello, I am new here." introduction.

DavidB 44 Junior Poster

Hi, Bariby.

Glad you decided to join Daniweb; it is a pretty good place.

I took a look at your website and your CV. Are you still in the Vancouver area?
I am in a similar boat; although employed, it is not my preferred job. For everything half appealing to me, I am either underqualified or overqualified. Have you posted a resume on all the job sites? I know the odds are against you on these sites, but it is good to cover all the bases. And you have nothing to lose. Good luck.

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

Unless you have access to MATLAB's source code for this task, you wouldn't really be converting MATLAB's specific function to C++.

If you just want a function for computing the determinant of a matrix, why not try the NETLIB repository? Or the book "Numerical Recipes"? I am sure there are many other sources of code for this task.

DavidB 44 Junior Poster

(Yes, I am behind the times, but bear with me.)

I finally picked up an Ipod and have started loading it with music. However, I have one question: Is there a way to delete music from Itunes without having it deleted from the iPod the next time it synchs? It is an Ipod Touch with 64 GB and I really don’t want to have 64 GB of the computer filled up with music; I would rather just delete it once it is loaded onto the Ipod. Is there a way around this?

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

When you declare a variable to be a constant, it causes the compiler to spit out an error if the code ever tries to change it. Basically, it is another tool to prevent errors.

Perhaps you are thinking of static variables?
A static variable retains its value between function calls. A static local variable is known only within the function in which it is defined, like all local variables. However, the benefit is that in the case of computationally expensive calculations (like a sinudoidal function, which is an infinite series) it only gets computed once. If you are certain the variable does not change later in the program, you could avoid re-computing the same quantity every time the function is called.

DavidB 44 Junior Poster

Do you need eigenvectors and eigenvalues?
Is your matrix real?
I translated some code into C++. It takes a real symmetric matrix and computes eigenvalues only. It uses the old method of creating dynamic arrays, checking for NULL, which is not the latest and greatest technique, but otherwise the program works:

Eigensystem Solver Code for Real Symmetric Matrix

Alternately, you might want to check out the Boost and NIST TNT
libraries.

DavidB 44 Junior Poster

How do you search for a string in the forums?

For example, say I want to search for discussions of free online television. Simply going to the search page and entering "free online television" returned every occurrence of the separate terms free, online, and television.

So I tried a Boolean approach. I used the search phrase free AND online AND television. Same results.

Okay. So how do I search for a multi-word string in the forums?

DavidB 44 Junior Poster

Alternately, you could also download WinRAR right from the WinRAR home page:

WinRAR Home Page

DavidB 44 Junior Poster

I don't like the idea of everything being in the cloud, but it does have some appeal.

A couple nice things:
(i) you don't have to install software, and
(ii) I assumed the service provider took measures to back up documents, etc. So I don't have to worry about my hard drive crashing, house burning down, laptop being stolen, etc. The online service has back ups.

Aspects of cloud computing I don't like:
(i) you give up control of your work because you really don't know for sure what kind of security is in place to restrict access to your work, or simply whether the provider will exist next year or go bankrupt, etc.
(ii) your documents might be deleted for no reason, or access to the service abruptly restricted. Or a free service might later require a payment. etc.

DavidB 44 Junior Poster

It seems like a risky set up for a problem. You are really counting on no hiccups within the system. I read matrices from text files quite often, and I like to have the matrix dimension entered in the file as the very first entry. It might not create the perfect set up, but it provides one more level of redundancy for checking the system. I mean, if the user enters a 2 for the matrix dimension, but the file has 23 entries, that indicates that perhaps a typo has been made, or the file is wrong, or something, so I output an error message and prompt the user to re-check the data. If the user is up at 3 am and they are getting absent-minded, forcing them to give the data file a second look can't hurt.

DavidB 44 Junior Poster

Right now you define "i" on the fly, within the for-loop.

Why not just define it outside the loop, say, at the beginning of the subroutine where you define the rest of the variables.

DavidB 44 Junior Poster

Where is the main program?

DavidB 44 Junior Poster

Thank-you.

That looks simple enough.

I was afraid I might have to play with settings on the server and possibly mess things up.

DavidB 44 Junior Poster

Some sites seem to customize their pages depending upon where they detect you are from (i.e. - U.S., Canada, UK, France, etc.).

How do they do that?

It would be nice to do something similar. My site is pretty simple, but I would like to avoid the risk of having a family member click on my AdSense ads and getting me kicked out of the program. So now I am wondering if there is some way to have a non-ad page served to my IP address, and a page with the ad on it served to everybody else. How would I go about doing this?

DavidB 44 Junior Poster

I recently installed WordPress 2.9 on one of my web sites. Then I found a theme that I think fits the site very well. However, after uploading the files to the folder according to the instructions, it doesn’t seem to be working:

Neptune Theme for WordPress

The theme was written around 2006, so it might have some issues with WordPress 2.9. However, I would really like to get it working. I am not a WordPress or PHP coder, so I don’t know the bits and bytes of it, but a theme can’t be much more than a few pointers to support files and style sheets, can it?

Any tips for what I can do to try to get this theme working?

DavidB 44 Junior Poster

If i also use Adsense, can i make $1000 per month . . .

You would need a LOT of traffic to make $1000 per month with AdSense. Even if you are getting 1000 visitors per day to your site, you will be lucky to get a $100 cheque from Google every six months.

DavidB 44 Junior Poster

I doubt it would be a bad thing for your web site; however, it probably won't create a dramatic boost in terms of PR and traffic. If you sign up on many social bookmarking sites and book mark your site on all of them, you might get a little extra traffic. But don't expect much more than what you are already getting from directory submission.

DavidB 44 Junior Poster

. . .
else if ((addteam.teamamanger.value.length < 3) || (addteam.teammanager.value.length > 20))
. . .

Misspelling "manager" probably doesn't help.

DavidB 44 Junior Poster

Have you made a start coding this program? Post your source code to show that you have made some effort.

Getting the polynomial degree and the coefficients in is pretty straightforward. Then it is just a matter of evaluating the polynomial. Simple evaluation is possible, but not the best. Horner's method is better. Even better methods are also available.

DavidB 44 Junior Poster

Code Guru is good too.

DavidB 44 Junior Poster

I've tried making the void abc(ofstream x) loop, but it still won't work
what should I include, in order to output to a file?

Does the input and output routine have to be in a sub-routine? If not, why not have the loop in the main program. Then you could do the file output loop the same way you output Name on line 41 (and eliminate sub-routine abc).

DavidB 44 Junior Poster

I notice you open the output file twice: once at line 20 and then again at 33. Perhaps delete line 20.

And your sub-routine abc uses cout to output to the console, but does not output to the output file. In fact, I see no output to the output file other than the name.

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 recently upgraded to the latest version of Firefox (3.5.1) and now my highlighting is all messed up.

To speed up finding a term in a web page, I usually do a Control-F, enter the term for highlighting, and click the "Highlight All" button, so that the term is highlighted in yellow throughout the page.

However, since doing the upgrade, highlighting seems to use a variety of different colors: blue, green, purple, etc.

How do I get the highlighting to be done in yellow only?

DavidB 44 Junior Poster

Hello, all.

The company that hosts my web site does no filtering of spam or viruses whatsoever. Whatever is sent to me, I get. They have indicated that most of their clients are companies that deal with those matters at their end.

Previously, this was not a problem, because I hardly got any emails. However, lately I have been getting a thousand spam emails a day. I am now spending hours of my time pulling the good emails out from among all the spam, instead of getting productive work done.

So now I am wondering, what are my options for dealing with spam? Is there a favored software product for dealing with spam (ideally, something that can stop spam at the server, so nothing gets downloaded to my computer)? I will be doing my own search, but I would still like to hear your recommendations for how to best deal with spam.

DavidB 44 Junior Poster

I use rand() to generate random numbers between 0-50.
However when I use the code, as I have seen it, rand() doesn´t truly generate random numbers.
It seems that everytime I restart the application, it generates the same random numbers everytime.

True. That is so results can be repeated. For example, if you are using random numbers to fill a matrix for some program you are debugging, you would like the data to be the same each time you re-run the program.

To get more random numbers, you could always use a random number generator that accepts a seed value, and then feed the routine a different seed value each time you re-run it. Or you could use one that creates its own initial value based on ambient temperature, your typing speed, the computer clock, etc.

DavidB 44 Junior Poster

To be thorough, you should also wrap the allocation in a try-block and have a catch-block so that, if an exception occurs, it can be properly dealt with.

DavidB 44 Junior Poster

What, exactly, doesn't work? The input portion?
Once you input the data, have you outputted it to check if it is wrong or right?

Perhaps you could post the code you have already written, to give us something to work with.

DavidB 44 Junior Poster

Tonight (Thursday, November 27) I noticed most lounges are missing.

The only one I see listed is the Geeks' Lounge. However, at the top of the page, I still saw a reference to the other lounges:

"Our Geeks' Lounge forum is the place to chat about anything. Have fun and relax in this forum.
If you'd like to hang out with other community members within your industry to discuss more relevant (non-support) topics,
you can participate in the Software Developers' Lounge, Web Developers' Lounge,
Internet Marketers' Lounge, Techies' Lounge, or IT Professionals' Lounge."

However, if I click on the "Software Developers' Lounge" link, the following message pops up:

"Invalid Forum specified. If you followed a valid link, please notify the administrator."

(I didn't check out the other links.)

What's happening?

DavidB 44 Junior Poster

In my web surfing, I often come across mention of SourceForge in the Geek Community. I am wondering: what exactly is SourceForge and why is it so popular?

I back up important documents on a USB drive, and I use some online storage services (in case my computer crashes, house burns down, etc.). Is SourceForge just another online storage service, specifically for the saving of source code and/or executables? If so, I still don't understand why it is so popular. Anybody proficient enough with a computer to produce some of the offerings I have browsed there should be knowledgeable enough to post right on their own website. Why bother posting elsewhere?

What's the appeal of SourceForge?

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 reckon it possible as long as you specify an initial starting point for the complex part of the solution.

I stand corrected.

Previously, I had only seen Newton's Method covered in sections of textbooks dealing with finding real roots. However, I have since done some further investigating, and found out that Newton's Method can, indeed, be used to find complex roots (as long as the initial guess is complex; otherwise the algorithm would not leave the real axis).

DavidB 44 Junior Poster

I can't understand your troubles. Evidently it's 0.25*sqrt(x) or sqrt(sqrt(x)) . Or what else? What's a problem?

I agree: the fourth root of a number, x, is sqrt(sqrt(x)), or pow(x, 0.25).

DavidB 44 Junior Poster

Hi, everybody.

I have noticed that there are a lot of forums on the Internet. Many of them have the same themes and cover the same material that is covered on bigger sites (like DaniWeb). So now I am wondering if there is any benefit, in terms of marketing, to creating a forum on a web site. Why would a webmaster want to create a new forum from scratch when most if not all of the material is already covered on larger forums?

Or is it simply a matter of being a learning process, so that when the site admin applies to webmastering jobs he can say, "Yes, Potential Employer, I DO have experience running a forum on a web site."?

DavidB 44 Junior Poster

I don't think Newton's Method can be used to find complex roots. The same goes for the Bisection Method and the Secant Method--all these methods are only applicable for finding roots that you know ahead of time will be real. If you do not know ahead of time that roots will be real, more sophisticated techniques are required, for example, the Companion Matrix technique, Laguerre's Method, or the Jenkins-Traub Method (used on my website, see signature).

DavidB 44 Junior Poster

What functions would you like to convert? Numerical programming is one of my hobbies; I might be able to refer you to some relevant resources.

DavidB 44 Junior Poster

Hi, folks.

For those of you whose websites get significant traffic, I am wondering if there was one particular event that you consider to be a breakthrough? For example, was it a mention in a popular blog, in a community newspaper, radio, etc.

What do you consider to be the breakthrough for your website?

DavidB 44 Junior Poster

I usually code all my Javascript in a single external file that accepts the data from a form in the main page's HTML textarea box.

Now I would like to break up this single Javascript file into separate files.
For example, I'd like to have main.js as the main controlling program which calls, say, input.js, do-computations.js, and output-results.js.

I would simply like to have main.js feed the textarea contents into input.js to parse the contents and assign all the data properly, to be passed back out to main.js.

Can this be done (is it simply a matter of feeding this.form from sub-routine, to sub-routine, to sub-routine, etc.)? Is there a limit to how deep into sub-routines a form element can be passed?

DavidB 44 Junior Poster

I would think that registering in forums just to create a profile with a hyperlink and then not posting in the forums would not be worth the effort.

Nobody would even know you exist on a forum unless you make the occasional post, so nobody would look at your profile and, hence, the URL in your profile.

Ideally, you make some posts that contribute something, people get curious about your background, and then a few people might check out the URL in your signature, even fewer would be curious enough to go further and check out a person's profile.

Or am I missing something?

DavidB 44 Junior Poster

Man's character is his fate.
--Heraclitus


--------------------------------


"I can but suppose they are trusting to the fact that what goes on in
a muddy stream is less easily detected."

by Livy
"The Early History of Rome"
Books I - V of The History of Rome from its Foundations

(This statement Livy attributed to Lucius Cornelius Maluginensis during
a debate)


--------------------------------


A mind all logic is like a knife all blade. It cuts the hand that wields it.
-- Rabindranath Tragore

DavidB 44 Junior Poster

Hi, everybody.

I am thinking about upgrading from my existing DVD player to a new Blu-ray disc player. However, I am wondering if it is as simple as just purchasing the player. I don't want to purchase the player and then find out my TV doesn't support the connections, etc.

Are there any tricks or traps I have to be aware of when going to a Blu-ray system?

DavidB 44 Junior Poster

Hi, everybody.

A question I have had for a while regarding forums is if there is some way to configure an alert to be e-mailed to me for specified keywords.

I don’t know everything about everything. I might read a few threads covering topics of personal interest, or simply out of curiosity, without logging in. When I see a thread I feel qualified to answer, I log in and post. However, finding these threads involves going through many sub-forums and browsing the threads individually, which can be quite time-consuming. If there was some way to configure an alert for, say, the terms “Javascript forms”, it would save me the time of surfing the forums every day.

Does a feature like this already exist, which I don’t know about? It would sure be a real convenient option.

DavidB 44 Junior Poster

I want to know a small c code to generate random numbers.It could be within a certain range.
I want to know if rand() function will generate a random number

For what purpose will these numbers be used?

If they are just going to be dummy numbers to fill an array for the testing of a program, rand() should do fine. If you want numbers within a certain range, or a certain distribution, etc., you will have to do some scaling.

DavidB 44 Junior Poster

Actually, to produce a table of all the primes < 100000 (or, for that matter, of 1 million or ten million) there's a much better way called the sieve of Eritosthenes. (I think I spelled that all wrong). You can find it in many books. It's blindingly fast, using no divisions and a short code does the trick. Maybe this is what your instructor really wanted.

The Sieve of Erastothenes:

http://en.wikipedia.org/wiki/Sieve_of_Eratosthenes

http://mathworld.wolfram.com/SieveofEratosthenes.html

The Wikipedia page includes pseudocode.

DavidB 44 Junior Poster

Hello, everybody.

Out of the blue I recently received an e-mail from somebody who would like to put a text ad on my website. This is the first such offer I have received, and I have no idea how to price an ad.

Is it based on the PR of the page on which I place it? Is it based on the traffic the page receives (less than 500 visitors per day)?

Off the top of my head, I am tempted to base the rate on my monthly hosting rate; that way, I'd finally have a way to make the website at least pay for its own hosting charges.

Anybody else in these forums have to make the same decisions? I am curious to hear how you determined an advertising rate.