- Strength to Increase Rep
- +11
- Strength to Decrease Rep
- -2
- Upvotes Received
- 217
- Posts with Upvotes
- 187
- Upvoting Members
- 112
- Downvotes Received
- 11
- Posts with Downvotes
- 11
- Downvoting Members
- 9
636 Posted Topics
Re: [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 … | |
Re: 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. | |
Re: [B]> gcc filename.c -lpthread[/B] is not enough. You also need [COLOR="Red"]-lrt[/COLOR] | |
Re: [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. | |
Re: This is no GoExpert, yet we do "have a clue". So, what is your question? | |
Re: Take a close look at line 25. Are you sure you [I]want[/I] a shift to be logical? | |
Re: What does mkNode return? Or, to put it other way around, why mkNode returns nothing? | |
Re: Notice that sleep() delays the whole process (that is all threads are sleeping). It kind of defeats the purpose, don't you think? | |
Re: 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. | |
Re: 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(). | |
Re: 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] | |
Re: 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 … | |
Re: You are on Solaris, right? Add `-lsocket -lnsl` to the command line. That will pick up the necessary libraries. | |
![]() | Re: 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... |
Re: Python QA automation these days is centered around [nosetest](http://nose.readthedocs.org). Their site is a good starting point. | |
Re: 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 … | |
Re: Line 31 is sort of funny. You need to switch on wParam instead. | |
Re: 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. | |
Re: 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 … | |
Re: 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. | |
Re: 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. | |
Re: The way you wrote it, checkurl() is not a method of Ui_MainWindow class, but a standalone function. Give it a proper indentation. | |
Re: 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] | |
Re: 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. | |
Re: 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 … | |
Re: 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 … | |
Re: 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 … | |
Re: > str = ("cat %s >> combinedObjects.o", argv[i]); What in your opinion this line is doing? | |
Re: It means that Horse.cpp is not present (at least, in the directory where you run make). What does the ls output look like? | |
Re: [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"? | |
Re: [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 … | |
Re: I don't think it is possible. What exactly are you trying to achieve? I mean, is using signals a requirement? | |
Re: [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? | |
Re: You entered 4 elements. How many elements are you actually sorting? | |
Re: 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 … | |
Re: 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. | |
Re: 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. | |
Re: Great [URL="http://www.microsoft.com/msj/0197/exception/exception.aspx"]article[/URL]. A bit old, but still valid. | |
Re: [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. | |
Re: 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 … | |
Re: 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 … | |
Re: 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? | |
Re: Of course not. stosb increments EDI automatically. | |
Re: [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. | |
Re: 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". | |
Re: 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 … | |
Re: [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 … | |
Re: 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. |
The End.