789 Posted Topics

Member Avatar for mattyd

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

Member Avatar for rkamin1
0
243
Member Avatar for maui_mallard
Member Avatar for sakura_fujin

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); …

Member Avatar for Lerner
0
221
Member Avatar for mattyd

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.

Member Avatar for hbk619
0
86
Member Avatar for fulyaoner

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.

Member Avatar for fulyaoner
0
407
Member Avatar for tech291083

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 ;)

Member Avatar for ~s.o.s~
0
141
Member Avatar for scotty_123

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...

Member Avatar for Infarction
0
76
Member Avatar for kishore5001

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 …

Member Avatar for Narue
0
92
Member Avatar for Savage221

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

Member Avatar for Lazaro Claiborn
0
134
Member Avatar for Debadipta

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 …

Member Avatar for Debadipta
0
111
Member Avatar for Elfshadow

[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 …

Member Avatar for jbennet
0
116
Member Avatar for mapaputsi

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 …

Member Avatar for ~s.o.s~
0
161
Member Avatar for tikal777

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 …

Member Avatar for tikal777
0
140
Member Avatar for Monyet

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 …

Member Avatar for Monyet
0
113
Member Avatar for rostom99

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. …

Member Avatar for Infarction
0
78
Member Avatar for notfornothing21

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.

Member Avatar for Infarction
0
192
Member Avatar for Infarction

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 …

Member Avatar for Infarction
0
125
Member Avatar for Duki

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...

Member Avatar for John A
0
188
Member Avatar for jbennet

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.

Member Avatar for WaltP
0
530
Member Avatar for JJ___

haiku is not weird but this is not a haiku this is a senryu [url]http://en.wikipedia.org/wiki/Senryu[/url]

Member Avatar for mattyd
0
106
Member Avatar for SkateJerrySkate

my guess would be that the drivers aren't compatible with WinXP64, but can't say for sure...

Member Avatar for DemonicGoldfish
0
287
Member Avatar for MiloTN

[quote=iamthwee;321896]Better no, easier perhaps...[/quote] Are you saying that it's worse, or that easier isn't better?

Member Avatar for MiloTN
0
181
Member Avatar for virsa

maybe use get and set functions? If you're doing it without friends, it seems like making main a friend is not allowed...

Member Avatar for Laiq Ahmed
0
141
Member Avatar for >shadow<

[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

Member Avatar for paramasivan
1
150
Member Avatar for ammochck21

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 …

Member Avatar for John A
0
121
Member Avatar for The Dude
Member Avatar for christina>you
0
80
Member Avatar for BleedingEdge

[quote=BleedingEdge;319235]D. play 3 word games on internet message boards.[/quote] :lol::lol: QFT

Member Avatar for christina>you
-1
87
Member Avatar for emmagreen

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 …

Member Avatar for cecil.vera
0
135
Member Avatar for cassyjack

Use < rather than <=. I didn't really read the code, except for that bit.

Member Avatar for Infarction
0
139
Member Avatar for Soral 3.0

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.

Member Avatar for Soral 3.0
0
282
Member Avatar for Dani

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 …

Member Avatar for altergrave
1
587
Member Avatar for The Dude

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?"

Member Avatar for GreenDay2001
0
380
Member Avatar for Duki

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.

Member Avatar for Infarction
0
169
Member Avatar for ajay kandari

and is there a logical problem with your code...? By the way, main should return a type int ;)

Member Avatar for Salem
0
403
Member Avatar for The Dude
Member Avatar for Infarction
0
156
Member Avatar for ikix

[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. ;)

Member Avatar for John A
0
128
Member Avatar for kansmish82

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 …

Member Avatar for WaltP
0
152
Member Avatar for DummyChuck

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 …

Member Avatar for John A
0
123
Member Avatar for jan1024188
Member Avatar for soultron

<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 …

Member Avatar for jwenting
0
149
Member Avatar for mattyd
Member Avatar for Monyet

[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...

Member Avatar for Monyet
0
93
Member Avatar for jobra

> 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 …

Member Avatar for John A
0
136
Member Avatar for mesmo

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 …

Member Avatar for Infarction
0
167
Member Avatar for Joe689

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; …

Member Avatar for Joe689
0
2K
Member Avatar for Mrato

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 …

Member Avatar for Infarction
0
85
Member Avatar for im4tion

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...

Member Avatar for Infarction
0
156
Member Avatar for raydogg57

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 …

Member Avatar for John A
0
2K
Member Avatar for SHWOO

[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 …

Member Avatar for iamthwee
0
249
Member Avatar for himanjim

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.

Member Avatar for Ancient Dragon
0
251

The End.