Posts
 
Reputation
Joined
Last Seen
Ranked #78
Strength to Increase Rep
+11
Strength to Decrease Rep
-2
94% Quality Score
Upvotes Received
217
Posts with Upvotes
187
Upvoting Members
112
Downvotes Received
11
Posts with Downvotes
11
Downvoting Members
9
70 Commented Posts
0 Endorsements
Ranked #109
~463.09K People Reached
Favorite Tags

636 Posted Topics

Member Avatar for john10

[QUOTE=LaMouche;1669197]You're writing the entire array writePlanet each time you call save().[/QUOTE] No. OP is writing a same nonsensical pointer multiple times. Here is the essential code: [CODE]void save(planet_t writePlanet[], int totalSize){ for(count = 0; count<PLANET_SIZE; count++){ /**/ fwrite( &writePlanet, sizeof(writePlanet), 1, outFile); printf("\n%s", writePlanet[count].name); /* Test to see if its …

Member Avatar for jimmichaels29
0
3K
Member Avatar for gonzi.p12

There must be a load of open source WAV readers around. In case you don't want to dig into other people's code, [URL="http://www.ringthis.com/dev/wave_format.htm"]here[/URL] is a brief description of a WAV format. I guess that's enough to start with. If you have more specific questions, do ask.

Member Avatar for iranano
0
2K
Member Avatar for sciprog1

[B]> gcc filename.c -lpthread[/B] is not enough. You also need [COLOR="Red"]-lrt[/COLOR]

Member Avatar for charlottegracie
0
4K
Member Avatar for Sudo Bash

[QUOTE=firstPerson;1612554]Waiting for I/O counts as it constitute to time used by processor for waiting[/QUOTE] Waiting for IO uses no processor time. The processor is busy running other processes.

Member Avatar for Yangang
0
4K
Member Avatar for Krysis
Member Avatar for chrjs
Member Avatar for mbelenske
0
3K
Member Avatar for JJHT7439

What does mkNode return? Or, to put it other way around, why mkNode returns nothing?

Member Avatar for James_41
0
3K
Member Avatar for John Linux

Notice that sleep() delays the whole process (that is all threads are sleeping). It kind of defeats the purpose, don't you think?

Member Avatar for Sergio_1
0
513
Member Avatar for akhilchandranms

Short answer: [ICODE]system("cmd /c dir")[/ICODE] Long answer: [ICODE]system()[/ICODE] expects an executable. [ICODE]dir[/ICODE] is not, it is a builtin.

Member Avatar for deceptikon
0
1K
Member Avatar for some

Error code 2 is ERROR_FILE_NOT_FOUND. If the path you entered contains spaces, the statement [QUOTE][CODE] cin >> way[50];[/CODE][/QUOTE] will only read the first "word" of the path. Use getline().

Member Avatar for Lucaci Andrew
-1
226
Member Avatar for boiishuvo

I don't see anything wrong with the line 9. Can you post an error message? I do see however an error at line 10 - missing parameter for the second [icode]%d[/icode]

Member Avatar for rakeshbiswal
0
4K
Member Avatar for Niketh

I don't think a linked list is a right approach. You need a dependency graph, along the lines of [CODE]struct gate { bool result; bool resolved; gate * dep1; gate * dep2; };[/CODE] To calculate the output, you just simply traverse the graph starting from the output gate (remember, pull …

Member Avatar for hactor
0
573
Member Avatar for zychos

You are on Solaris, right? Add `-lsocket -lnsl` to the command line. That will pick up the necessary libraries.

Member Avatar for zychos
0
192
Member Avatar for BobTheLob

You didn't initialize [ICODE]buf.priority[/ICODE] (mtype in the msgsnd terms). msgsnd requires it to be positive, thus EINVAL. Adding [CODE] buf.priority = 2; [/CODE]at around line 43 heals everything. PS: Why 2? Because of 2 at line 76...

Member Avatar for allyson
0
2K
Member Avatar for ryantroop

Python QA automation these days is centered around [nosetest](http://nose.readthedocs.org). Their site is a good starting point.

Member Avatar for ryantroop
-1
130
Member Avatar for newbie14

The problem with signal is that there's not much you can do in a handler. The list of signal-safe functions is quite limited (man 7 signal), and printf is not one of them. I don't know what exactly your sql querying involves, but the gut feeling says that signal handler …

Member Avatar for newbie14
1
2K
Member Avatar for DeeperShade
Member Avatar for Gaiety

To begin with, the `attr` object is not initialized, so calling `pthread_attr_getschedpolicy` on it is meaningless (thus your output of question marks). > As to scheduling, the shecduler is not deterministict. Not so.

Member Avatar for Gaiety
0
215
Member Avatar for sorin.oltean87

Step 1: form a sed script based on the csv file Step 2: apply sed to all the files you need to modify Assuming csv (that is, columns are separated with comma, and comma doesn't appear anywhere neither in old nor in new values), the sed script can be trivially …

Member Avatar for sorin.oltean87
0
2K
Member Avatar for brunoccs

In this context the process usually means the manufacturing process, as at TSMC. Next generation of the process is switching, for example, from 40 to 28 nanometers.

Member Avatar for nezachem
0
93
Member Avatar for iamthesgt

In the ChanNameVAlign case you want to split at the transition from lowercase to uppercase: `s/\([a-z]\)\([A-Z]\)/\1 \2/g` In the OSDSettings, I don't see a non-contradictory criteria.

Member Avatar for iamthesgt
0
2K
Member Avatar for memomk

The way you wrote it, checkurl() is not a method of Ui_MainWindow class, but a standalone function. Give it a proper indentation.

Member Avatar for memomk
0
2K
Member Avatar for rasizzle

PIL does not support alpha in BMP files. You need to strip it yourself. Something like (warning: untested): [CODE]img = Image.open("file.png") r, g, b, a = img.split() img = Image.merge("RGB", (r, g, b)) img.save("file.bmp")[/CODE]

Member Avatar for Gribouillis
0
28K
Member Avatar for mohan_saini

Please explain what "not working" means in your situation. Through the crystal ball I can see that you need to pace out the sampling. A single pin IO usually implies a time-based protocol.

Member Avatar for Ab000dy_85
0
130
Member Avatar for DeanMSands3

This is the linker command your gcc generated (I just broke it up into few lines for clarity: > c:/mingw/bin/../libexec/gcc/mingw32/4.6.2/collect2.exe -Bdynamic -u ___register_frame_info -u ___deregister_frame_info -o Pascal.exe c:/mingw/bin/../lib/gcc/mingw32/4.6.2/../../../crt2.o c:/mingw/bin/../lib/gcc/mingw32/4.6.2/crtbegin.o -Lc:/mingw/bin/../lib/gcc/mingw32/4.6.2 -Lc:/mingw/bin/../lib/gcc -Lc:/mingw/bin/../lib/gcc/mingw32/4.6.2/../../../../mingw32/lib -Lc:/mingw/bin/../lib/gcc/mingw32/4.6.2/../../.. -L/mingw/lib -lgmpxx -lgmp C:\DOCUME~1\DMS40\LOCALS~1\Temp\ccKxmt7C.o -lstdc++ -lmingw32 -lgcc_s -lgcc -lmoldname -lmingwex -lmsvcrt -ladvapi32 -lshell32 -luser32 -lkernel32 -lmingw32 -lgcc_s …

Member Avatar for DeanMSands3
0
623
Member Avatar for Labdabeta

First of all, you cannot manipulate names. A name is a property of a computer, and it should stay intact. What you need is to allocate a port over which the game communications would occur. This port number is to be known for all participating computers in advance. In the …

Member Avatar for Labdabeta
0
224
Member Avatar for mrnutty

Objection! This solution presumes architectural details not mentioned in the problem statement (32-bit values). Here's another log-time solution, which scales for any width: for (shift = 1; shift < sizeof(challenge); shift <<= 1) challenge |= challenge >> shift; answer = challenge & ~(challenge >> 1)); Of course in reality, such …

Member Avatar for nezachem
1
675
Member Avatar for Dewey1040

> str = ("cat %s >> combinedObjects.o", argv[i]); What in your opinion this line is doing?

Member Avatar for kings_mitra
0
102
Member Avatar for mstashev

It means that Horse.cpp is not present (at least, in the directory where you run make). What does the ls output look like?

Member Avatar for mstashev
0
250
Member Avatar for Ricky65

[QUOTE] It is only copying the file buffer up to the null char into the http request. [CODE] sprintf(Post_Request, "%s%s\r\n", Post_Request, ReadBuffer);[/CODE][/QUOTE] Sure. What else would you expect from "%s"?

Member Avatar for bakri
0
1K
Member Avatar for pjh-10

[QUOTE=Moschops;1764113]Now that I've gone back to look at my equation, I realise that this is just the "Birthday Paradox" with a year of 1000 days, so to speak :) Wikipedia has a good explanation and a number of equations that come out with the answer I got earlier, which is …

Member Avatar for pjh-10
0
442
Member Avatar for vedro-compota

I don't think it is possible. What exactly are you trying to achieve? I mean, is using signals a requirement?

Member Avatar for vedro-compota
0
379
Member Avatar for jbennet

[QUOTE]My simple Serial Port code doesnt work.[/QUOTE] Can you be more specific? I see a problem at lines 71/72 (buff is not initialized nor allocated); does your program reach that far?

Member Avatar for jbennet
0
243
Member Avatar for t_daniweb
Member Avatar for t_daniweb
0
247
Member Avatar for triumphost

I believe your C++ code does fall under GPL. [INDENT]A "derivative work" is defined in the Copyright Act, 17 USC 101, as a: ""work based upon one or more preexisting works, such as a [B]translation[/B], [...] or other modifications which, as a whole, represent an original work of authorship, is …

Member Avatar for mike_2000_17
0
103
Member Avatar for rfrapp
Member Avatar for jaskij

If I understand your problem correctly, you need a symbol table, which maps expression name to expression instance. std::map would do it just fine.

Member Avatar for jaskij
0
114
Member Avatar for livinFuture

In the valueAt, if the very first comparison fails you immediately enter the else clause and return 0. Get rid of [ICODE]else[/ICODE] and move [ICODE]return 0.0[/ICODE] out of the loop.

Member Avatar for livinFuture
0
203
Member Avatar for Traps

Great [URL="http://www.microsoft.com/msj/0197/exception/exception.aspx"]article[/URL]. A bit old, but still valid.

Member Avatar for Rashakil Fol
0
371
Member Avatar for sridhar.selva
Member Avatar for stereomatching

[URL="http://en.wikipedia.org/wiki/Comeau_C/C%2B%2B"]Comeau[/URL] [I]may[/I] help. I never looked at the generated C code; it may well be unreadable by a human being.

Member Avatar for jaskij
0
246
Member Avatar for rfrapp

There is a number of problems with the code. I don't know where to start. To address your immediate question (my code will always make the new generation blank), check with the debugger (or just print out) the value of nCount. You will be surprised. Second, your display() function is …

Member Avatar for StuXYZ
0
262
Member Avatar for linezero

Let's pretend that the phonebook has 3 entries: e0, e1 and e2. counter is 3. Then you delete e0. Counter becomes 2. Now when you try to print them, you printing e0 (which is zeroed out) and e1, instead of desired e1 and e2. There are numerous ways out. You …

Member Avatar for savoie
1
23K
Member Avatar for java_programmer

The only reason I can think about is that the shells are different. What is in the #! line of the script, and what system you are running at?

Member Avatar for java_programmer
0
193
Member Avatar for huh
Member Avatar for shaffatshah

[QUOTE=deceptikon;1764893]Return from the function with a return statement and the program will continue to run from that point on[/QUOTE] This is quite hard to do considering that "some error" can be a segfault. The OP goal is achieved via setjmp in the caller and longjmp from the signal handler.

Member Avatar for deceptikon
0
178
Member Avatar for timkunce

This is a very naive way to calculate power series. I bet you overflow the integer factorial much earlier. If you look closely, the series can be rewritten as 1 + x*(1 + (x/2)*(1 + (x/3)*(..... *(1 + (x/n))))...))) Now calculate it "from inside".

Member Avatar for Se7Olutionyg
0
4K
Member Avatar for Graphix

Something tells me you are on a Windows system. There is a distinction between a text mode and a binary mode. In the first case the ^Z character does serve as an end-of-file marker. Open your files in a binary mode: pass "rb" as a second argument to fopen. Same …

Member Avatar for Graphix
0
2K
Member Avatar for pattmorter

[QUOTE]Second, what does this code equal? I believe it equals 19 but our teacher says it is 20.[/QUOTE] Run away from that teacher as fast as you can. [CODE]y = 2*y++ + --x;[/CODE] modifies y twice (by means of postincrement, and by means of assignment) with no sequence point in …

Member Avatar for Ali_2101
0
194
Member Avatar for madhusushmi

Correction. read() and write() are POSIX compliant system calls; they do not belong to a C library; their presence is not covered by the Standard. Indeed, a Microsoft compiler doesn't provide them. A compliant C library does provide fread() and fwrite() though.

Member Avatar for MasterHacker110
0
2K

The End.