789 Posted Topics
Re: I just posted a bunch on page 3 of the [url=http://www.daniweb.com/techtalkforums/thread7712-3.html]aforementioned thread[/url] and I'm too lazy to repost them :P ![]() | |
Re: 20, but it'll probably go to someone 12 or 13... | |
![]() | Re: This line looks weird to me: [code]while(inWordFile>>(fgets(line, 100, stdin))){//read the file a line[/code] If you were using the std::string class instead of c-strings (char*), you could just do something along these lines: [code]string word; while(inWordFile >> word) { if(!notWord(word)) // though I'd change it to if(isWord(word)) root = insert(root, word); … |
Re: I'd like a setup like that, except turning my head that much might tire the neck muscles. And it needs more ambient light so's I don't go blind. | |
Re: To summarize the algorithm provided by Lazarus, you just add as many of the biggest coin you can. Then repeat for the next biggest until you have the amount. | |
Re: And high quality tutorials are fairly hard to come by, I imagine. I've plenty of people trying to show off what they know through horribly inaccurate or poor quality tutorials. I'm glad DaniWeb has high standards ;) | |
Re: what about something like this: [code]#!/bin/bash for file in `find ./ -iname $1` do rm $file done [/code] Not tested, but I think it'll work. You'll have to give different flags to rm if you want it to remove directories as well... | |
Re: As mentioned, destructors are for freeing resources when an object is being deleted. If the object only uses non-dynamically assigned resources, the destructor will do nothing (this is also the default if you don't explicitly code one). If you do use dynamic allocation for any member data, those need to … | |
Re: You could also do something like this: [code]printf("%4d", (int)ceil(solution - 0.5));[/code] This'll print the rounded value without actually changing the double, so your other numbers should be fine. #include <math.h> for the ceil function | |
Re: This looks a lot like homework, but what the hell.... [quote=Debadipta;318322]3.As the Unix OS is entirely made up of C prog.language,is there any OS entirely made up of Java? [/quote] There was [url=http://en.wikipedia.org/wiki/JavaOS]JavaOS[/url] by Sun, but it's already considered legacy. Pretty much a microkernel with a JVM looks like. There's … | |
Re: [url=http://www.opensource.org/licenses/]This page[/url] has several open source licenses you can look through. They do mostly apply to source code and/or distributed binaries, though, so you might look into maybe the Creative Commons license. I don't think this will protect you from anyone implementing your idea in actual software, however, so if … | |
Re: Pretty much, you're trying to give a rough approximation of how much work you'll have to do with respect to the number of items you have. Generally, small overheads or statements that only execute one are ignored. Here's some examples: [code]int multiply(int a, int b) { return a*b; } int … | |
Re: A switch is basically a nice clean version of an if-elseif-else chain. Consider the following: [code=c] switch(youVar) { case 0: foo(); // do some more stuff break; case 1: // do stuff break; case 2: // do more stuff break; default: // handle accordingly break; // not so important for … | |
Re: Here's two ways to do it: 1) Before you print a value, iterate over the list from beginning to that value and check if it's a duplicate. If it is, skip it. This will make your print loop run in O(n^2) time worst case. 2) Create a hash table. Before … | |
Re: Surely you've been covering loop constructs in class. Now your teacher wants you to use what you've been taught. Clue: for loops are very handy. We won't do your homework for you, but post a reasonable attempt and explain what doesn't work and then we'll try to fix it up. … | |
Re: Lazaro, please do everyone else a favor and don't quote hugely long threads for a one line reply. Or, if you're quoting to that your reply has context, please trim the quoted part as much as possible. Thanks. | |
A project I'm working on has this awful problem wherein the JFrame refuses to resize in Linux. I've tried the [inlinecode]setResizable(true)[/inlinecode] method, both in the constructor and outside of it, but no go. It works fine on Windows. And I'm using Java 1.6 if that makes any difference. Am I … | |
Re: My guess would be RAM, but I've not ever had a server undergoing a heavy load. Seems like it'd have more of a dependence on disk I/O than on processor time though... | |
Re: This is a common trend on all forums, like joeprogrammer said. Assuming most of them are not spam, it could be a situation wherein they come, sign up, find their answers, and leave. | |
Re: haiku is not weird but this is not a haiku this is a senryu [url]http://en.wikipedia.org/wiki/Senryu[/url] | |
Re: my guess would be that the drivers aren't compatible with WinXP64, but can't say for sure... | |
Re: [quote=iamthwee;321896]Better no, easier perhaps...[/quote] Are you saying that it's worse, or that easier isn't better? | |
Re: [quote=jwenting;319937]I've this feeling of not being quite alive rather a lot, so who knows...[/quote] Either you've stayed up too late too many times with the coffee pot, or you just need some more coffee to drink :p | |
Re: Try running through your code on paper, as though you were the computer. You'll see that you're not using the left variable for anything, except the +1 before recursing. And you'll recurse infinitely unless a and b are different. Which they almost always will be, unless you're comparing an array … | |
| |
Re: [quote=BleedingEdge;319235]D. play 3 word games on internet message boards.[/quote] :lol::lol: QFT | |
Re: You'd know better than we what colors she likes... besides it's the thought (and perhaps the item) that counts, color takes a fairly distant third. ;) If it was for myself, I'd probably get either blue or silver (or black if that was an option), but only due to color … | |
Re: Use < rather than <=. I didn't really read the code, except for that bit. | |
Re: I think if you boot into your rescue mode and then mount and chroot to your install, then you'll be able to use dmesg and syslog. I can never remember how to chroot though, so you'd have to look around for instructions on that. | |
Re: I find the forums quite easy to use. The layout's really nice, and the 'Posts since last visit' feature makes it really easy to tell where I left off on my last visit. The site is very clean (especially with ad-blockers :o) and gets relatively little spam. And I've no … | |
Re: I do not own an iPod either. Instead I have a Toshiba something-or-other featuring a 60GB hard drive, 15.4" screen for movies, and no DRM restrictions. It's silver. :p [edit:] rofl at the results so far... 4 people with "what iPod?" ![]() | |
Re: Actually, I've heard Fedora has a new way of configuring X11 without an xorg.conf, but I don't know if it's out in FC6 or not (I think it's an optional package, or perhaps still in beta). FC7 will likely not have an xorg.config though, IIRC. | |
Re: and is there a logical problem with your code...? By the way, main should return a type int ;) | |
Re: hm, answers are a bit out of date (altavista? rofl)... anyways, 113 here | |
Re: [quote=jbennet;320917]yes i just do using namespace std then im like cout << "Hello"; cin >> variablex;[/quote] Then you haven't run into the scoping issues associated with that yet. ;) | |
Re: Since you're using non-standard headers, I think most people will have a hard time running your code. And without proper indentation, they'll have a hard time reading it. To see if I'm understanding the code correctly, I'll repost part of it with comments: [code] // don't know what the loop … | |
Re: Just to nitpick a li'l: a char and a character string are very different. For a character string, you'll need to do like joeprogrammer says, which would be correct for your example. You can also add the value of a single character (char) to an integer, but remember that a … | |
Re: Look into the Runtime.exec methods, as masijade suggested | |
Re: <iostream.h> is a deprecated header, and was never part of standard C++. I'm assuming you're using VC++6.0 or a similarly older version of Borland. The standard header is <iostream> so you may have to change it between school and home. You may consider raising the issue with your teacher, but … | |
Re: [url=http://www.churchillobjects.com/c/11012c.html]linky[/url] If that doesn't help, google around on how to use exceptions. It's really pretty straightforward... | |
Re: > Hi > > Sorry about that. I tried to change few things and now I dont get any error while compiling but when I run the program, I get 'Segmentation fault'. > vector<SampleMarketDataClient *> clients; SampleMarketDataClient *temp; while (!cin.eof()) { if(cin.good()) { // Read in the next line of … | |
Re: I don't know if I'm right, but I think it's because you've not defined a constructor for ExeccutionStackDemo. IIRC, the default constructor in Java is something like [code]Classname() { super(); }[/code] and since Something doesn't have a blank constructor, the default one in ExecutionStackDemo is screwing up. Why do you … | |
Re: I don't know if my computer is just being finnicky or what, but Clinton's code didn't work right for me. Here's some code and output (trivial changes to the code): [code] int main() { //Declare a 3D array int myarray[5][10][20]; //Populate the array for(int i=0; i<5; i++) for( int j=0; … | |
Re: Congratulations on copying your homework assignment. The part you copied is pretty much what you have do, except replace the arrows with = and the mod with %. If you want more explicit help, be more explicit with your question and show that you've put some effort forth already. And … | |
Re: Yes, we can give you a hand. You'll find many members reluctant to throw in an arm with that deal unless you put in just as much. That said, post some code and explain what you've tried and how it's not working and we'll see how it goes... | |
Re: It looks an awful lot like you've just posted the assignment boilerplate code. How much work have you put into this yet? Most of your class' functions are pretty basic. The constructor initializes things, the destructor probably doesn't need to do anything for this, isfull and isempty just compare the … | |
Re: [quote=iamthwee;316899]hmm, no compiler here to test... I wuda personally done: personType(string first, string last) { first = ""; last = ""; } Again no idea if that's legal, no compiler to test it with.[/quote] Your code is completely different from his and definitely not what he's trying to do. Default … ![]() | |
Re: The reason that it's -128 and 127 breaks down like this: You have 8 bits. One of them is for sign. That leaves 7 bits for the value, or 128 values. One side is 0 to 127. Since you already have 0, the other half is -1 to -128. |
The End.