636 Posted Topics
Re: Take a look at [URL="//http://www.gnu.org/software/plotutils/plotutils.html"]GNU plotutils[/URL]. | |
Re: Did you look [URL="http://support.microsoft.com/kb/323809/en-us"]here[/URL]? | |
Re: AFAIK, it comes from the Cold War times. Then there were superpowers (USA and USSR), developed countries, and the third world. | |
Re: Upon expanding $(SHELLVAR}, the awk invocation becomes [CODE]awk -v awkvar=No error '{print awkvar}'[/CODE] That is [ICODE]awkvar[/ICODE] is set to [I]No[/I], [ICODE]error[/ICODE] is considered a program (and it is a valid program, a pattern without the action), and the rest becomes a filename to be processed. Quoting ([ICODE]awkvar="${SHELLVAR}"[/ICODE]) should help. | |
Re: [QUOTE=Narue;1623607] Ideas? Sure. There are a number of ways to implement a library interface such that it's easy to use, understand, and maintain. While not perfect (is that ever the case?), here's one such library I have on hand at the moment to show you. [/QUOTE] Questions and nitpicking: 1. … | |
Re: [CODE] char buff[sk.sz]; fread(buff, sizeof(buff), 1, fp);[/CODE] You seem to believe that [ICODE]sizeof(buff)[/ICODE] equals to [ICODE]sk.sz[/ICODE]. It is not. As a side note, always convert your longs with htonl() prior to transmission. | |
Re: [QUOTE=Fbody;1622252]I don't know. I'm starting to think I may have imagined something[/QUOTE] I think the confusion comes from the overcommit feature of some OSes. Indeed, memory allocation routine may just reserve the address space, and postpone actual mapping until the first access. So an object with the trivial constructor may … | |
Re: [QUOTE=Xploit_;1622486] [CODE].PHONY: backup backup: @mkdir -p ./backup/include #make folder (don't complain if it already exists) @mkdir -p ./backup/src #make folder (don't complain if it already exists) @mv -fu *.h~ ./backup/include #move header file backups into desired folder @mv -fu *.cpp~ ./backup/src #move source file backups into desired folder[/CODE] [B]Problem:[/B] This … | |
Re: You seem to be working with linux. If so, the best way is to avoid outb() and friends. Open /dev/ttyS0, and write to it just like to a regular file. Do not forget to configure the protocol (baud rate, parity, stop bits, etc) with tcsetattr. See details [URL="http://en.wikibooks.org/wiki/Serial_Programming:Unix/termios"]here[/URL]. | |
Re: You are correct about the regular expression. However, the OP doesn't match any particular string from the list. He needs to read the list "vertically", top to bottom, extracting exactly one letter from each string, in such a way that the resulting string would match the pattern. That is how … | |
Re: At line 42 you call matrixCofact as if it returns the minor's determinant. I recommend to (a) make matrixCofact return double, (b) get rid of its third parameter (you don't use it anyway), and (c) change line 50 to [ICODE]return det[/ICODE]. Of course, det should be just double (not a … | |
Re: It is practically the same design as [URL="http://en.wikipedia.org/wiki/Multiplexer"]4-to-1[/URL], with 8 data lines and 3 control lines. | |
Re: One fairly obvious problem is at lines 14-15. The way it is written it means that a (phony) target [ICODE]classes[/ICODE] depends on nothing, and the recipe is a very strange command. You want classes to depend on the list of class files with no recipe. Join those two lines together. | |
Re: [QUOTE=shanki himanshu;1616099] [CODE]int a[10000]={0};[/CODE] [/QUOTE] [QUOTE]Constraints : 1 <= N <= 100000[/QUOTE] Most likely the fault is when N exceeds 10000 you've allocated. | |
Re: [QUOTE=Momerath;1614617]Not sure what you are saying here.[/QUOTE] Neither do I. Where does SpecialSum() came from? | |
Re: The check is not unnecessary (*), but it is plain wrong. An address field of the EOF record is not necessarily all zeroes, so the checksum is not necessarily FF. (*) This check helps to determine the integrity of the file. However it only makes sense if every other record … | |
Re: The normal java program and an applet have different privileges. The security manager forbids applet's getLocalHost() to return anything but a loopback address. | |
Re: > if I understood C-Pointers correctly, I just create a reference to the Memory Area where the msg->rcv.src_ip is stored Your understanding is correct. However, an addr field may only store a reference. If the msg is transient, you need to create a permanent copy of src_ip, for example, [CODE] … | |
Re: As a good exercise implement basic coreutils commands (cat, head, tail, cut, paste, etc) using bash builtins. | |
Re: [QUOTE=sergent;1601010]People drink it to only get drunk.[/QUOTE] No. A real no. I mean, NO! There are certain foods which is a crime to consume without vodka. Most Russian appetizers are specifically optimized for it. Make for example a bite-size piece of a Russian dark rye bread topped with spicy herring … | |
Re: The description is fairly vague; if I understand it correctly, you want to match space or a start-of-line, followed by a sequence of anything but a backslash, followed by 'e'. Which translates directly to [ICODE](^| )[^\\]*e[/ICODE]. For example, [CODE]nezachem@home> cat junk \aaaebb \aaa bbbe aaae aaa nezachem@home> grep -E '(^| … | |
Re: For execv, the args[0] is a process name. You need to initialize it as [CODE]char *args[] = ["chrome", "--user-agent=blah", 0];[/CODE] The actual value of process name is highly irrelevant, but it must be there. | |
Re: The best way to understand this is to take a pencil and paper, and follow the code step by step. Next, run it under a debugger control. | |
Re: [B]> Bit 31 in lparam tells whether a key is down.[/B] What gives you such idea? Try an experiment: set a breakpoint at line 6. Press buttons few times. Pay attention to lparam. Be surprised that it doesn't change. Then read [URL="http://msdn.microsoft.com/en-us/library/ms644985%28v=vs.85%29.aspx"]documentation[/URL], and realize that lParam is a pointer is … | |
Re: First of all, I don't believe you. The code you gave may not possibly produce more than one line of output (because of break at line 15). That said -- line 11 means (a) test "$line" -gt 100 (b) if (a) returns success (exit code 0), execute the command "$line" … | |
Re: It is a standard logic based on a Newton-Raphson method. Here is how it works: We are trying to solve an equation x^2 - n = 0 Given an iteration X0, the next iteration X1 is an x-intercept of a tangential at X0. In a general form the tangential is … | |
Re: I suspect that by "not execute" you mean "crashes before reaching that point". The reason is that at some point the recursion reaches the leaf node. Such node passes the [ICODE]tree != NULL[/ICODE], after which you dereference [ICODE]tree->left[/ICODE], which is NULL (and never tested against). | |
Re: Can you outline an authentication protocol based on one-way hashes? | |
Re: There is one major design flaw here. Player shall just make a guess. The decision on the guess correctness does not belong to Player; it belongs to GuessGame itself. | |
Re: I am not sure what kind of trouble you have. Handler id is an opaque value returned when the signal was connected: [CODE]id = gtk_signal_connect(obj, name, func, data); ... gtk_signal_disconnect(obj, id);[/CODE] | |
Re: You have few problems here. First and foremost, the loop at lines 44-46 does not shift a queue, but rather replicates the leading element. You need to run the loop in other direction, that is shift the last element, then one before last, etc. Funny enough, the typo at line … | |
Re: [QUOTE=N1GHTS;1586238]They are the most efficient I could possibly make them. Any more efficient and i'd have to write it in assembly.[/QUOTE] To begin with, both functions make library calls, which are totally uncalled for. A standard technique here is [CODE] while(*in_BinaryString) Result = (Result << 1) | (*in_BinaryString++ == '1')[/CODE] … | |
Re: [QUOTE=David_Omid;1593002]checking if the king can be taken by an enemy piece[/QUOTE] ... shall not be tested for pins. You need a separate method to test for square exposure (instead of generic CanOtherPieceBeTakenAfterPieceMoving). | |
Re: Good for you. Gdb is a way to go. Your problem is that you equate a 2-dimensional array to a double indirection. They are different creatures. That's why the compiler warned you, so that you ended up with explicit cast on lines 197 and 199. When your function sees a … | |
Re: Your programs work fine (you may observe that by decreasing an usleep() timeout to a reasonable value). The problem is that a pipeline IO is fully buffered, and for [ICODE]n[/ICODE] to obtain any input, [ICODE]m[/ICODE] shall produce 4K of data. Be patient... data will come... slowly... | |
Re: [QUOTE=Ancient Dragon;1584993]MS-Windows does not support shared memory segments[/QUOTE] In fact, it [URL="http://msdn.microsoft.com/en-us/library/ms686958(v=vs.85).aspx"]does[/URL], since at least XP. | |
Re: [QUOTE=ravenous;1586133]In Ubuntu, for example, you can do something like: [icode]sudo apt-get install g++[/icode][/QUOTE] Don't forget [ICODE]sudo apt-get install build-essential[/ICODE] | |
Re: I do not. Making a good compiler is very difficult indeed, but I can name few tasks much more difficult. | |
Re: I suspect the OP problem is much simpler; it is a purely logical error. Opon the first loop completion, classInfo is the value of the last qualifying trainClassInfo. The second loop always runs all the way through, and the last comparison always evaluates to True. Solution: exit the second loop … | |
Re: flex and bison generate C code from their respective sources (.l and .y). You have to compile them and link resulting objects with the rest of your application. At some point the application calls yyparse() (which is the entry point to the parser). If you have more specific question, please … | |
Re: Pascal and C deetct end-of-file in a different way. Not getting into details, a [ICODE]while(!feof())[/ICODE] idiom is unsafe in C. A correct way to read a file is [ICODE]while(fgets() != 0)[/ICODE] | |
Re: .wav takes a little more than shoveling it onto a sound card. A starter overview is [URL="https://ccrma.stanford.edu/courses/422/projects/WaveFormat/"]here[/URL], for example. So, what you need to do is to read and validate the chunk descriptor; read a subchunk 1, which gives you, among other things, a "byte rate"; multiply the byte rate … | |
Re: [B]> when I have a file that I am trying to convert line by line[/B] You need two passes. At pass 1, when a forward jump is encountered, create a relocation record of branch location and a target symbol. Also during the first pass build a symbol table (a map … | |
Re: A google search on [URL="http://www.google.com/search?q=alsa+api+tutorial"]alsa api[/URL] returns many useful links. I am not familiar with Windows/C# audio model, so I don't know how well it is mapped onto alsa. Regarding joystick, it is seen by the system as a serial device; you need to open it, query it with some … | |
Re: There's no boolean in C. Any incarnation of zero resolves to false; everything else resolves to true. [ICODE]!fork()[/ICODE] is therefore synonymous to [ICODE]fork() == 0[/ICODE] | |
Re: I am not sure if this is related to your problem, but the receiving loop (lines 7 - 13) looks very suspicious. Is it a copy-paste or you typed it in? | |
Re: 1. Error reporting. The message at line 32 is not informative. Failure to open file doesn't mean that the file doesn't exist. Use strerror(errno) to get a real cause. It is also a common courtesy to include the filename in the error message. 2. An unnecessary copy of a (fairly … | |
Re: 1. Sed can address lines by numbers: [CODE]sed 1,3d[/CODE] will do the job of your greps. 2. When inserting the comment, watch for an existing sharp: [CODE]/^[^#].*Watchdog/s/^/#/[/CODE] 3. You can issue multiple commands to a single sed invocation: [CODE]sed -e '1,3d' -e '/^[^#].*Watchdog/s/^/#/'[/CODE] So, finally: [CODE]crontab -l | sed -e … | |
|
The End.