1,684 Posted Topics

Member Avatar for winrawr

Learn Scheme, C++, Haskell, and C#. That will take some time. You have to actually do projects in them, of course. The languages you've listed, and most other languages, are not worth learning if you have those four and are interested in generally improving your coding ability, but they may …

Member Avatar for Rashakil Fol
0
117
Member Avatar for BMPaul

3 and 2 are integers (in C++, they have the 'int' type), so the division sign in [icode]3/2[/icode] refers to integer division, which produces an int return value, which must be truncated. If you write 3.0/2 or 3/2.0, one of the values will be a double, thus forcing the other …

Member Avatar for BMPaul
0
77
Member Avatar for Lightninghawk
Member Avatar for mrnutty

A way to make this really easy is to get the GMP library (it comes with C++ bindings, right?) and use that. It's silly to output the number to a file and then read the file back in. Since you don't have enough precision in the built in numerical types, …

Member Avatar for Rashakil Fol
0
141
Member Avatar for Clockowl
Member Avatar for cake

You shouldn't think about the average pay level, you should think about what [i]you'll[/i] be paid.

Member Avatar for Salem
0
219
Member Avatar for midimatt

The dot product of two vectors is equal to the cosine of the angle between them divided by the vectors' magnitudes. For example: The dot product of <1, 2> and <3, 4> is 1*3 + 2*4, i.e. 11. The magnitudes of the vectors are sqrt(1*1+2*2) and sqrt(3*3+4*4), i.e. sqrt(5) and …

Member Avatar for ddanbe
0
133
Member Avatar for k59smooth

You can't use commas that way. You want to write [icode]again == 'Y' || again == 'y'[/icode]. The comma operator behaves in the following way. The left side of the comma operator is evaluated first, and then the right side is evaluated, and the expression's return value will be the …

Member Avatar for dr.eu
0
95
Member Avatar for bobi1234

Actually it's impossible, if you're using integers, because the size of the solution is n*log_2(x) + O(1).

Member Avatar for bobi1234
0
110
Member Avatar for kazman
Member Avatar for Salem
0
54
Member Avatar for beaute

[quote]F(N) = O(G(N)) reads that F of N is Big O of G of N[/quote] That's not a "solid definition", that's a description of how you read the notation out loud. [quote]F(N) = O(G(N)) if there exist two constants c and k such that F(N) <= cG(N) for all n …

Member Avatar for Rashakil Fol
0
221
Member Avatar for nakias

Sort them by the kind of terms they have, and then group the similar terms together. Alternately, don't use letters at all in your representation of polynomials -- but this only works if you limit yourself to polynomials of a single variable.

Member Avatar for nakias
0
325
Member Avatar for mayo_tech11
Member Avatar for techbound
0
2K
Member Avatar for jamshid
Member Avatar for Rashakil Fol
0
112
Member Avatar for Terry McKenna
Member Avatar for pervane

I'm pretty sure you want something that works like the following: [code](transform '(+ - + - / + - + - + + + / + + + - - - / + + + - - - - +))[/code] It would make no sense to make transform into a …

Member Avatar for Rashakil Fol
0
30
Member Avatar for frencheneesz

[code] void getline(char* line) { int n=0; while((line[n]=getchar()) != '\n') { n++; } line[n]=0; } [/code] You shouldn't use broken code examples. [code] parse ws [ anychar[] Wo anyindex an -> Wo Wo[ Wo[an]==' ' || Wo[an]=='\t' || Wo[an]=='\n' ] [ return true; ] ] [/code] This is _extremely_ verbose …

Member Avatar for Rashakil Fol
0
165
Member Avatar for tech291083
Member Avatar for mackone
0
152
Member Avatar for Nina 4 Ever

Lex and yacc are obsolete (because they use C); use something more like ANTLR... for parsing. But this is just in reply to ithelp's post, obviously it has nothing to do with your problem.

Member Avatar for Nina 4 Ever
0
360
Member Avatar for shraddha24
Member Avatar for spool

This code only works on one column, that's why you see the radix function called four times. And it's not working on the ones, tens, hundreds columns, it's working on the first, second, third, and fourth bytes. 0xff is the number 255, and & does a bitwise 'and' operation. Look …

Member Avatar for rezzy1
0
809
Member Avatar for Creation34

[QUOTE=Ancient Dragon;741846]Why not put your music degree to work in the IT field. I should think you could get a job at one of the big game houses providing and/or writing music for the games.[/QUOTE] It's probably quite hard to get a job like that. And the idea that such …

Member Avatar for Denniz
0
138
Member Avatar for zyaday
Member Avatar for samishunk
Member Avatar for Dani

If you're going to make a blog, why would you make one on Daniweb, as opposed to some other blogsite or your own site? There is no reason for people to do this. I would focus more towards tutorials done in a wiki-like fashion.

Member Avatar for Dave Sinkula
0
140
Member Avatar for cherryteresa

You can figure out your first problem just by looking at your results. You're not printing the last 1 of each row. Why? Well, you're stopping too early in your loop that prints out the row's numbers. For your second problem, if you temporarily added a few cout statements that …

Member Avatar for cherryteresa
0
293
Member Avatar for noktasizvirgul
Member Avatar for Salem
0
174
Member Avatar for drkessence

[QUOTE=skatamatic;743643]ummm....lol. What a rediculous objective. Is this to be console based? No graphics whatsoever? If it is console based, I'd say that the contest is much too easy and find it hard to believe that an award is really being offered.[/QUOTE] Then why don't you cry about it? Oh wait, …

Member Avatar for drkessence
0
203
Member Avatar for Proseidon
Member Avatar for Awaivadrailla
Member Avatar for LightSystem

message_to_network should already be a function that waits for a new message to reach the socket. I'm guessing about its implementation, but you should just need to call that function -- it will return as soon as the message arrives, or when the connection times out. Obviously, it makes no …

Member Avatar for LightSystem
0
89
Member Avatar for Bylsma89

Who are these people who've put you through such a ridiculous assignment? Off with their heads! You should be writing code!

Member Avatar for Rashakil Fol
0
109
Member Avatar for minas1
Member Avatar for minas1
0
164
Member Avatar for daviddoria

Yes. One easy way is to use two maps, one map<int, double*> and one map<double*, int>. You need to make sure that you only have one index per color, though. If you want to be able to have a color appearing at multiple indices, use a multimap<double*, int> instead of …

Member Avatar for daviddoria
0
488
Member Avatar for koushal.vv

[code]int getUnique() { static int n = 0; return ++n; }[/code] This function is not multithreading safe.

Member Avatar for ArkM
0
146
Member Avatar for ming97

Not unless you explain what "H" or "HD" or "WSO" or "[;g(n-1)]" are supposed to me.

Member Avatar for ming97
0
298
Member Avatar for CoolGamer48
Member Avatar for ArkM
0
139
Member Avatar for sivak

You can use the Distinct extension method. [code]public string[] GetUniqueStrings(string[] input) { return input.Distinct().ToArray(); }[/code] You can do the same for a [icode]List<string>[/icode], only use [icode]ToList()[/icode] instead of [icode]ToArray()[/icode].

Member Avatar for Rashakil Fol
0
91
Member Avatar for deathnote
Member Avatar for davids2004

Initialize the salary at 1 and, each time through some look that runs 'days' times, double it. Or you could just use [icode]1 << (n - 1)[/icode] to compute the amount paid on the nth day, or [icode](1 << n) - 1[/icode] will give you the cumulative amount paid after …

Member Avatar for VernonDozier
0
151
Member Avatar for brechtjah

Your second method is broken -- you forgot isdigit. Your third method is not radical. Negative values will fail when a lookup table is used to implement the function -- they point in memory outside the lookup table.

Member Avatar for brechtjah
0
169
Member Avatar for Hannah Wallace

I have never heard of "SAP," other than as the name of a company whose U.S. headquarters are in Newtown Square, PA, so I would just ignore whatever punjabivirsa3 is trying to say.

Member Avatar for Hannah Wallace
0
114
Member Avatar for whitestream6
Member Avatar for BobLewiston

csc is not in your path. Add the directory in which csc lives to your PATH environment variable.

Member Avatar for bondo
0
240
Member Avatar for dankbc1

Ya think? Looking at your code, how could you expect it to do anything different? I don't see any attempt to maintain a board's state, and your program does not even deserve to be called an attempt at a checkers program; except upon the rare click, it just calls GamePaint …

Member Avatar for dankbc1
0
95
Member Avatar for Shanuka

People here get really grumpy when folks ask about final project ideas, because it happens so often.

Member Avatar for Rashakil Fol
0
133
Member Avatar for mabpest

It looks like a zip file; why don't you just post the flow chart?

Member Avatar for Nick Evan
0
272
Member Avatar for mpCode

No no no no no don't do that, then you have no hope of disabling RTTI :D. There are other, more serious downsides, like the fact that if you ever change your code to include another subclass, all your code that uses typeid becomes broken. There is something known as …

Member Avatar for mrboolf
0
154
Member Avatar for k59smooth
Member Avatar for Nick Evan
0
287
Member Avatar for glecymay

[quote]I would like to compute the main() alone of the file.[/quote] It's hard to understand what you mean, due to your difficulties with English. Could you try rewording this sentence? That might make your desire more clear.

Member Avatar for dmanw100
0
61

The End.