- Strength to Increase Rep
- +0
- Strength to Decrease Rep
- -0
- Upvotes Received
- 25
- Posts with Upvotes
- 20
- Upvoting Members
- 15
- Downvotes Received
- 0
- Posts with Downvotes
- 0
- Downvoting Members
- 0
Software Engineer
- Interests
- Coffee roasting
317 Posted Topics
Re: I saw your ad in the Marin IJ, and had to join! There are a lot of homework questions in the language sections, are the students from all over, or is there a 'main college' folks come from? FWIW, software engineering is, I hope, still in its infancy. There was … | |
Re: I worked for Intuit for four years working on QuickBooks. Man, that was a huge program! And the hard part was that they had so many users and the new versions had to be better/cleaner/faster than the older versions. When the app loaded in Windows, 135 DLLs would load! about … | |
Re: What you have written as an example looks correct. Your error message suggests a different issue at work? Perhaps the function find_keyword does not take a const string? find_keyword( char* keyword ) if you said: find_keyword( "123456" ); you would likely get the error you mention, because "123456" is a … | |
Re: This could be 3 bytes: struct AThreeByteDatatype { char s[3]; }; but on Windows the compiler is usually set to an alignment of 2 or 4, meaning that an array of these things will be a multiple of 4 not a multiple of 3. struct AThreeByteDatatype twoOfThem[2]; sizeof(toOfThem) will likely … | |
Re: How about: int is_prime_helper( int n, int test ) { if (test < 2) return 1; if (!(n%test)) return 0; return is_prime_helper(n,test-1); } int is_prime(int n,int p) { return is_prime_helper(n,n-1); } This is using your existing code as a template for the algorithm. There are better ways of finding tests … | |
Re: Did you try google? I typed into google "minimum weight perfect matching" and got a ton of answers, including this one which looks like what you want. Keep Google as one of your best tools for research! [url]http://www.algorithmic-solutions.info/leda_guide/graph_algorithms/weighted_perfect_matching.html[/url] | |
Re: like you said, "int z = x % y" gives the remainder of x / y int z. Just turn your expression around. | |
Re: Purchase a book for beginners in c++ Take a class in beginning c++ Look in Google for tutorials about c++ Did you have a specific c++ question, or do you just want to learn? | |
Re: Why does it need to be recursive? Just because that's the assignment? Non-recursive binary searches are one of life's simple beauties. In this case, stepping through a debugger would be helpful, but you don't return the value when its found because you test for < num but not == num. … | |
Re: You are forgetting Einstein! Einstein said that as you go faster, time seems to slow down for you so that those at 'normal speed' think an hour has gone by but to the faster ones it only seems like a few seconds has gone by. Clearly, then, what Santa is … | |
Re: Sure you can access the private members if you know how they're layed out and you are determined to be a hacker. In that case why bother with a new class anyway, why not just use a regular pointer? But, why? What if someone adds a virtual function to your … | |
Re: Check out 'strtok()'; it will parse a string, stopping on one or more tokens; in this case your ':'. The strings you parse could be referenced by an array of string pointers: [code] const char* foundThings[30]; // or however big while (going) { foundThings[n] = strtok( inputString, ":" ); if … | |
Re: [humor] keep accessing array elements from 0 until the program segfaults, then back up one and that's your limit. [/humor] | |
Re: You asked about loops and if's. Here's some: LOOPS for (int i = 0; i < 10; i++) - vs - for (int i = 0; i < 10; ++i) no effective difference. for (int i = 0; ++i < 10; ) - vs - for (int i = 0; … | |
Re: Imagine something like: [code] . . . set Suit = random value 1..4 set Card = random value 1..13 // ace, 2..10, j, q, k set input-suit to 0 while Suit != input-suit ask for suit as input-suit [/code] expand that to the whole problem and *poof* ... pseudocode. Remember … | |
Re: In the case you describe, delete p and delete [] p are the same as far as free() goes, but some runtimes would complain if you dont put in []. The [] means that the compiler should call the 'vector delete' destructor, which calls the destructor on each element of … | |
Re: As a side note, if you think your program has an infinite loop, use the compiler's optimizer switches. That way the infinite loop will run 2-4 times faster! | |
Re: if the set of tv stations you receive is {2,4,5,7,9,13}, what's the probability that ALL of those stations are showing a commercial at any given time? (hint: 9 is a pbs station, so they're doing a pledge break) | |
Re: How about analyzing the risks to homeowners when wireless networks are ubiquitous (sp?) and folks like your mother depend on them every day. What are the risks? how do you educate customers? If it were my mother, she would have NO IDEA what the wireless network was doing. How is … | |
Re: or, in C++, [code] int sumFirstLast( int n ) { char s[32]; return ((n % 10) + (*itoa(n,s,10) - '0')); // itoa converts an int into a string } [/code] | |
Re: Huh, so you want to learn how to code - an operating system like linux - FTP servers and their ilk - compression algorithms - browser extensions - email clients - email servers (pop? exchange? IMAP?) but you say you can only learn one language? Sounds like you have three … | |
Re: Well, printf() will print to 'standard out' which can be directed to a text file. fprintf() is what you want, though. fopen() opens the file, fprintf() writes text to it, and fclose() will close it. If you look up those routines you'll have all that you need. Good luck! | |
Re: Could it be as simple as: [code] series = 0; for (int i = 1; i <= n; i++) for (int j = 1; j <= i; j++ series += i; [/code] ? | |
Re: I think it has a lot more to do with who is in charge of the project technically. People have preferences and they tend to go with what they like. Being good at both is a good way to go to AN job. | |
Re: [url]http://www.google.com/search?hl=en&q=%22space+complexity%22[/url] 71,000 answers there! | |
Re: Wow! Class # 14 already! Fantastic! How time flies. . . Good luck on this assignment! If you have some code snippets you need help on, feel free to post them and we can try to help. Not using arrays just means, I think, that you keep running totals on … | |
Re: Although it seems pretty clear that the compiler you are using follows the normal "_cdecl" rules; it pushes parameters from right to left onto the stack, so it pushes the rightmost i, increments i, then the next i from the right, increments i, and then the next i from the … | |
Re: Just to tag on here, generally a tree is a collection of records (usually called 'nodes' when in a tree) that have a 'parent' and one or more 'children'. Practical examples of trees include organizational charts (President, VP's, Workers), species charts, and anything you can specify as an outline. | |
Re: Since Google is a programmer's best friend, a search there yielded a bunch-o-sites (of course), and this one claims to have some source code: [url]http://www.icsi.berkeley.edu/ftp/global/pub/speech/papers/icslp02-gabor/[/url] | |
Re: Huffman was a guy who realized that letters do not occur statisticly randomly; 'e' is used a lot more than 'j'. He figured you could build a balanced tree of letters (or anything else that occurs non-randomly, like words) and using that tree, represent letters in a minimal number of … | |
![]() | Re: Try: cout <<(*sum+i) << endl; You want the asterisk in front of the pointer you want to dereference, not in front of the expression. What you were saying was: "print out the contents of the int pointer at location (sum + i)" which is the same as saying cout << … |
Re: Hot Fudge Sauce Well, Naru contributed breakfast, Kc dinner. Here's dessert.... [code] class AHotFudgeSauce : public ARecipe { protected: // ingredients EvaporatedMilk m_milk; // NOT sweetened condensed Sugar m_sugar; Chocolate m_chocolate; Vanilla m_vanilla; Salt m_salt; Butter m_butter; public: // although, private might be the way to keep your friends coming … | |
![]() | Re: In C/C++, another valuable use of pointers is to point to an array of charactors. C doesn't have a string type, and instead you can use an array of char like this: char name[20]; but to do any operations on that name, you need to refer to the array of … |
Re: Ya, sorta, but you want Base( theObject ) between the declaration and the brace: Derived:: Derived( const Derived& theObject ) : Base( theObject ) { <further initialization> } (watch those &'s, they should be in the declaration, but not in the call) | |
Re: Sounds like you need to invalidate the text box so it will display itself. Try calling textBox1->Invalidate(). | |
![]() | Re: Ideas... 1) You could create the words.txt file in some editor with one word per line, like this: [code] elephant apple cranberry stick [/code] Then use the standard c file library (as lordofthisworld suggested) to open it, read lines, and close it. Note that fgets() returns a whole text line, … |
Re: Yes, cash is dead. Please send your cash to me so I can dispose of it properly. I like the option of debit cards and gift cards everywhere, but I also like to pay cash. Heck, I avoid grocery stores that discount purchases with their cards; it's too Orwellian for … | |
Re: Along similar lines, maybe 'ethics' in computer use. IT departments are usualy a form of 'big brother' watching everything the unwashed masses do. How much is fair protection for the employers and when do you step over the line? How much do you disclose to the employees/users that you watch? … | |
Re: You mean, like how do you write a compiler? Well, there are many good books and such on the topic; Google can be very helpful there. But generally the hardest part is to define the language in a rigourous way. If you can write a BNF for your language, you … | |
Re: I'm sorry, but I can't resist: "I like a woman who's into LaTeX" :-) | |
Re: Have them enter data in a real spreadsheet and export it to a text file? Building a spreadsheet-like interface isn't easy; there are VC products that give you the code for this, I think, for a price. | |
Re: On Windows, you can get the number of milliseconds since the processor started (GetTickCount()), and there are 'high resolution timers' (see "multimedia timer" or "high resolution timer" in VC help) that are higher resolution than that, but you won't get an accurate number of nanoseconds. Besides, by the time the … | |
Re: Is the class 'Car' meant to represent a single car, or a a kind of car in inventory? i.e., if there are 2 Acura's are there 2 Car instances or one that says 'I have 2 Acuras'? What questions do you want to answer once you have this data in … | |
Re: How about a sort class? You provide the sort, and to use it someone declares a SUBCLASS of your sort and has to define the COMPARE and SWAP methods. sort of like qsort() in the standard library except that instead of passing IN a compare proc it is an overrided … | |
Re: node_number is not initialized to anything, only ++'d in the constructor with the string. Maybe just say "node_number = node_counter"? I'd also initialize node_counter where you declare it rather in the default constructor for the QueueItem. RemoveItem() deletes the item and then refers to it! You should have another var … | |
Re: Taking a clue from my managers at work, you should tell the compiler to work SMARTER, not HARDER. That will help. Oh, gee, I guess it doesn't help employees either. | |
Re: If you are using VC, look in help for #pragma and there's a nice list. For other compilers, their help system should also have a list of all the pragmas. Generally pragmas help direct the compiler how to compile your code. For example, there will be pragmas to control the … | |
Re: There is at least one KIND of special member function that you cannot use inheritance on. Hin't: it doesn't have a '~' in it. |
The End.