Rashakil Fol 978 Super Senior Demiposter Team Colleague

What if he fails in a leap year?

Rashakil Fol 978 Super Senior Demiposter Team Colleague

GIMP doesn't have a limitation of 256 colors....

I've found the Linux version better than the Win32 port.

It's great for me, since I'm a hobbyist (sub-hobbyist, really) with no money.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

I have an idea. Try testing the functions.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

Assuming that upkeypressed and downkeypressed are booleans or integers that only have values 0 or 1,

yPos += downkeypressed - upkeypressed;
Rashakil Fol 978 Super Senior Demiposter Team Colleague

Yah, it's time to get used to the idea that the natural log is called both "ln" and "log", and that the common logarithm is called "log" and "log10". For extra fun, find a teacher that writes "ln" while speaking "log"!

Rashakil Fol 978 Super Senior Demiposter Team Colleague

Gates would have some assistant do the search for him, and Yang would already know the answer.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

It's not a good idea to try to learn calculus without having learned algebra.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

Juls, your real problem is that the Location HTTP header must use an _absolute_ path. E.g. "Location: http://www.example.com/path/file.html" instead of "Location: ../file.html"

Rashakil Fol 978 Super Senior Demiposter Team Colleague

Maybe it's just that more people need help with C++ than need help with Java :-)

Rashakil Fol 978 Super Senior Demiposter Team Colleague

That's such a SAAD holiday.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

Bah namespaces. Use std::log instead of log.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

Try x/(150*log((double)(pl/1.5))); since log takes a double as its argument.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

Surely you meant

x/(150*log(pl/1.5));

I removed the multiplication sign after 'log' (which made it treated like a variable instead of a function name).

Also, as you wrote it, log(pl/1.5) would have been on the top of the fraction, so I added parentheses to put it on the bottom. (Which by your original post's ASCII art I assumed you wanted.)

Rashakil Fol 978 Super Senior Demiposter Team Colleague
#include <cmath>

Use the 'log' function (which computes the natural logarithm).

Rashakil Fol 978 Super Senior Demiposter Team Colleague

Do you know the general idea of the algorithm? That comes first.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

I'm sure it's perfectly fine to
- use i and j without having declared them first,
- use the mystical !! binary operator,
- fill values of 1 into the triangle where values of 1 do not belong,
- print the contents of your datastructure without putting spaces in between numbers,
- wonder why people think your code has problems without ever having tested it.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

My crystal ball is in the repair shop, unfortunately, so I don't know whether any solution I might come up with is shorter or longer than yours.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

Yes, Christian has yelled at me enough for not paying attention to the 800x600 users in the previous layout! :)

That's interesting. I'm not an 800x600 user. But whatever.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

What's the point? Your code doesn't even look at the array at all...

Oh man, I really missed that...

Rashakil Fol 978 Super Senior Demiposter Team Colleague

The first element of an array is at index zero. That is, myArray[0] contains 1, and myArray[10] contains 11. Right now, your for loop iterates i from 1 to 9, and you probably want to iterate from 0 to 9.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

The main good feature of this design is that I don't have to scroll right every time I load a page. But I would prefer the old one with the navigation flipped to the right side.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

Do you even know what "downloading" is? (Sorry for being abrasive.) It is impossible for a user's computer to play the music that is on your server without having downloaded it first.

What you want is impossible.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

Generally speaking, the more you learn about and think about algorithms (of any kind), the better programmer/problem solver you become. Sorting algorithms are one prevalent example, but in general, it's always a good idea to learn how things work. That way you'll end up thinking, "I need this done, and I can write function X to do it," instead of, "Where can I find function X to do this for me?" (Not that code reuse is bad, just that if I ever see another PHP coder (just to stereotype) ask, "How do I find if a given string is in an array?" I'm going to have to reconsider suicide for the 3rd time.)

Rashakil Fol 978 Super Senior Demiposter Team Colleague

atoi expects a pointer to a nul-terminated array of characters, that is, a "c-style string".

You're passing it a character, not a pointer to an array of characters. When a character gets interpreted as a pointer, it ends up refering to some arbitrary address of memory that the program has no right to access. Accessing memory it's not allowed to access gives your program the segmentation fault.

If you want to convert a character such as '1' to an integer value of 1, all you need to do is subtract '0'. I.e. char x = '5'; int y = x - '0'; /* y == 5 now */

Rashakil Fol 978 Super Senior Demiposter Team Colleague

Use Mozilla Composer then.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

I really like Ruby. Who here has looked at it? What do you think of it?

Rashakil Fol 978 Super Senior Demiposter Team Colleague

You have not yet described the format that your text documents follow. What do your text files look like? This matters.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

Here's the hello world program in Rain:

Hello, world!

In Boolfuck:

;;;+;+;;+;+;
+;+;+;+;;+;;+;
;;+;;+;+;;+;
;;+;;+;+;;+;
+;;;;+;+;;+;
;;+;;+;+;+;;
;;;;;+;+;;
+;;;+;+;;;+;
+;;;;+;+;;+;
;+;+;;+;;;+;
;;+;;+;+;;+;
;;+;+;;+;;+;
+;+;;;;+;+;;
;+;+;+;
Rashakil Fol 978 Super Senior Demiposter Team Colleague

One good reason for not allowing HTML is that many of these sorts of forums offer HTML help -- and when giving HTML help, it's not good to have your HTML code examples get left as HTML instead of being converted to &lt; and &gt;.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

Use #include <cstdlib> at the top of your program, and then use srand once to seed the random number generator. Then use rand() to produce a random number between zero and RAND_MAX. Use some math to scale the random number to the range you want.

You might want to try to get larger initial random integers by using (rand() * RAND_MAX + 1)) + rand() and scale those numbers to the range of doubles that you want.

Then use cout with setprecision to output the values. Here's a link to the functions described in a reference.

http://www.fortran-2000.com/ArnaudRecipes/Cstd/2.13.html#rand

Rashakil Fol 978 Super Senior Demiposter Team Colleague

Croft: Web design only needs a text editor, such as Notepad (or Vim or jEdit or ...), because HTML is a textual language. There are many of them, and you can figure out how to use a search engine.

Also useful may be an image editor -- The GIMP is one option there.

Learn HTML and learn CSS. You could also buy some big expensive program, but if you don't learn HTML and CSS, it will just be a pigpen in which you wallow in incompetence. And once you learn HTML and CSS, they aren't particularly useful.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

It seems that alot of forums are too afraid to allow HTML, are people just being paranoid?

It seems that alot of computer users are too afraid to open attachments sent to them from random addresses, are people just being paranoid?

Daniweb _could_ allow a limited subset of HTML, but it would provide no more functionality than the bbcode*. And bbcode is much less verbose. The focus of a forum is discussions, not colors and other crapulence; consider yourself lucky to have any formatting at all.

* Oh I'm sorry, is it not really called bbcode on vbulletin forums? :-) ~looks at bottom~ Ah, it's "vB" code. Way to reuse an initialism, vBulletin guys.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

You can't use initializers with vectors. You need to use something like

vector<int> ray;
ray.reserve(7); // Not necessary -- this just prevents extra reallocations.
ray.push_back(3);
ray.push_back(431);
ray.push_back(4);
ray.push_back(123);
ray.push_back(4);
ray.push_back(52);
ray.push_back(52);

Another option is to make an array with the initializer and use some kind of loop to push back elements (if you don't like writing all these push_backs). Another option is to wait for a later version of C++, which should allow this kind of thing.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

To find a duplicate in the array, you have a few options.

One way is, make a for loop, looping the variable I from 0 to N. Then, inside that, make a loop that moves the variable J from I + 1 to N. Inside that, see if the I'th and J'th elements of the array are equal.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

What rules do you want to use for generating the HTML? How is your text file formatted? Do you just want empty lines to divide paragraphs?

Rashakil Fol 978 Super Senior Demiposter Team Colleague

Don't wait. The PPC platfom will remain supported for years -- developers won't just suddenly abandon a chip when 99% of users are still using it. Also, it's not as if creating cross-processor software will be that difficult -- Apple has been doing this with an entire operating system, after all. So even as developers begin making apps that run on Intel, they'll still be available for PPC.

Look back at the 68k-PPC transition.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

Nah, see Narue's avatar and you'll get the joke.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

Content content content. Put stuff on your site that is informative and accessible. Your site does have a focus, right?

Content is king.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

Why is it any of my business?! Because IT'S MY JOB to make it my business, that's why. Most web masters don't have a problem correcting bad links on their site, since dead links on their site make them look bad too.

I'm not going to go into a back and forth about putting up a redirect. It won't work in this case and your answer doesn't address my original question.

So if anyone can answer my original question, THANKS!

Your original question did not even adequately explain what you intend to do when somebody is writing a bad link. The best way to catch bad links is through your server's error logs.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

I've got a bit of a problem that I could use some help with. There appear to be an extensive number of sites that are linking to mine, but are using an incorrect link to do so. Aside from searching Google, Yahoo, etc. with the phrase "link:www.mysite.org" and then checking each site in the results, which will take FOREVER and is not productive in the least, there has to be another way.

Does someone out there know of another method? If so I'd be very grateful for some insight! I'm the solitary developer of a non-profit web site and don't have the resources/manpower to tackle the task of visiting each site to see if they've linked to us correctly.

Many, many thanks in advance for your help!

Melissa

Why is it any of your business how others are linking to you? If they are linking to a URL that you removed, then you shouldn't have removed that URL. Put up a redirect if they're pointing at the wrong location.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

Perhaps ankara didn't know how to use a text editor for typing in C code.

Then again, I also know quite a few who would churn out several versions including recursive, non-recursive, dynamic recursive, and heuristic formula without breaking a sweat and then dare you to find a bug. ;)

You've got to stop talking about yourself in the third person. ;)

Rashakil Fol 978 Super Senior Demiposter Team Colleague

the ERROR message is

--------------------Configuration: main - Win32 Debug--------------------
Compiling...
CComplex.cpp
C:\cworkSUMMER\COMPLEX\CComplex.cpp(8) : error C2011: 'CComplex' : 'class' type redefinition

You gave the class definition already in CComplex.h, which got #included into the file. You don't need to define it again.

C:\cworkSUMMER\COMPLEX\CComplex.cpp(115) : error C2679: binary '*' : no operator defined which takes a right-hand operand of type 'const int' (or there is no acceptable conversion)

You overloaded the '*' operator for Complex types, but not for 'const int' types.

C:\cworkSUMMER\COMPLEX\CComplex.cpp(119) : error C2228: left of '.real' must have class/struct/union type

doubles don't have data members.

Rashakil Fol 978 Super Senior Demiposter Team Colleague
printf("INK SON ROB JAC");

What I don't understand is how JACK ROBINSON becomes INK SON ROB JAC. How does the K end up placed in INK?

Rashakil Fol 978 Super Senior Demiposter Team Colleague

Well how advanced do you want it to be. When somebody types,

What is the reason for OO design?

do you want the program to give an opinionated, zealoted reply?

Or do you just want to search for "hello", "how are you" and if there's a match reply then?

Rashakil Fol 978 Super Senior Demiposter Team Colleague

You don't need old hardware and you don't need a serious understanding of Unix in general or Linux in particular. But you do need (c) -- if you need a _particular_ application that does not run on Linux, then obviously Linux is not for you.

Rashakil Fol 978 Super Senior Demiposter Team Colleague
int main();
Rashakil Fol 978 Super Senior Demiposter Team Colleague

You can assign Persons, but you're trying to assign a pointer to a person.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

An alternating series is one in which the sign flip-flops. For example,

4 + 4/3 + 4/5 + 4/7 + 4/9 + 4/11 + 4/13

is not an alternating series. But the following is:

4 - 4/3 + 4/5 - 4/7 + 4/9 - 4/11 + 4/13

I think the original poster wants to take a vector containing

[ a b c d e f g h ... ]

and compute

a - b + c - d + e - f + g - h + ...

Rashakil Fol 978 Super Senior Demiposter Team Colleague

The only good way to do this is to figure it out yourself. You've thought about using an "array," but didn't you just mention "vectors"? You might have correctly described your algorithm; now you just need to implement it.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

You can do this with a simple bit of spreadsheet manipulation. Just sort by whatever column you're checking for duplicates. Then, next to that column, insert a new blank one. Suppose that column you've sorted by is D, and the blank column is C. Suppose the data starts at the fifth row, or D5 (just to pick a number). Then in the blank column, in position C6, just type in the formula, =D5=D6. This will evaluate to TRUE if D6 is a duplicate of D5..

Then, with square C6 selected, click the bottom right corner of the bold rectangle (surrounding C6) and drag the selection down the entire column. The formula will copy itself, instead with =D6=D7, then =D7=D8, and so on.... You will see 'TRUE' wherever there is a duplicate, and you could find them quickly via Edit > Find....

If your definition of "duplicate" involves more than one equal column, you can make a trivial modification to your formula, something like =D6=D7 and E6=E7, or whatever syntax Excel uses.

You could also save the spreadsheet as a CSV file (comma separated values), write a CSV parser in Perl (or C++, but if you're familiar with Perl or Python or Ruby or ...., life is much easier), and search for duplicates in a small program. But it won't be as easy. I just had to do this exact thing at work (parse CSV files, find duplicates, but a bit trickier), and if you're willing to wait …