636 Posted Topics

Member Avatar for Simplified

Take a look at [URL="//http://www.gnu.org/software/plotutils/plotutils.html"]GNU plotutils[/URL].

Member Avatar for Simplified
0
158
Member Avatar for shadowscape
Member Avatar for shadowscape
0
806
Member Avatar for Netcode

AFAIK, it comes from the Cold War times. Then there were superpowers (USA and USSR), developed countries, and the third world.

Member Avatar for Netcode
-1
102
Member Avatar for kristo5747

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.

Member Avatar for Fest3er
0
236
Member Avatar for stereomatching

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

Member Avatar for nezachem
0
1K
Member Avatar for Eternal49

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

Member Avatar for WaltP
0
601
Member Avatar for Muralidharan.E

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

Member Avatar for Fbody
0
596
Member Avatar for Xploit_

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

Member Avatar for nezachem
0
354
Member Avatar for Kerlix

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

Member Avatar for nezachem
0
148
Member Avatar for ssai

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 …

Member Avatar for ssai
0
200
Member Avatar for keshvari

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 …

Member Avatar for keshvari
0
1K
Member Avatar for blackcathacker

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.

Member Avatar for faroukmuhammad
0
123
Member Avatar for darangho

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.

Member Avatar for darangho
0
373
Member Avatar for shanki himanshu

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

Member Avatar for shanki himanshu
0
179
Member Avatar for hqt

[QUOTE=Momerath;1614617]Not sure what you are saying here.[/QUOTE] Neither do I. Where does SpecialSum() came from?

Member Avatar for TrustyTony
0
493
Member Avatar for DesignGhosts

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 …

Member Avatar for DesignGhosts
0
239
Member Avatar for Mona Ali

The normal java program and an applet have different privileges. The security manager forbids applet's getLocalHost() to return anything but a loopback address.

Member Avatar for Mona Ali
0
503
Member Avatar for mhirschb

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

Member Avatar for nezachem
0
183
Member Avatar for braintwister17

As a good exercise implement basic coreutils commands (cat, head, tail, cut, paste, etc) using bash builtins.

Member Avatar for IIM
0
145
Member Avatar for libathos
Member Avatar for Sadun89

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

Member Avatar for Aramant Coral
-3
174
Member Avatar for Xcelled194

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 '(^| …

Member Avatar for nezachem
0
84
Member Avatar for cemali_ys

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.

Member Avatar for cemali_ys
0
143
Member Avatar for tubby123

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.

Member Avatar for nezachem
0
78
Member Avatar for ktsangop

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

Member Avatar for ktsangop
0
1K
Member Avatar for SakuraPink

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

Member Avatar for SakuraPink
0
246
Member Avatar for tubby123

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 …

Member Avatar for nezachem
0
178
Member Avatar for Nexgr

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

Member Avatar for Nexgr
0
152
Member Avatar for VernonDozier
Member Avatar for VernonDozier
4
193
Member Avatar for newcoder310
Re: OOP

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.

Member Avatar for JamesCherrill
0
109
Member Avatar for the_kitoper

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]

Member Avatar for nezachem
0
61
Member Avatar for CodeAerial

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 …

Member Avatar for nezachem
0
165
Member Avatar for cesione

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

Member Avatar for N1GHTS
0
2K
Member Avatar for David_Omid

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

Member Avatar for David_Omid
0
168
Member Avatar for Manske

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 …

Member Avatar for Manske
0
155
Member Avatar for KAY111

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

Member Avatar for L7Sqr
0
173
Member Avatar for GregMalick

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

Member Avatar for GregMalick
0
469
Member Avatar for Thisisnotanid

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

Member Avatar for Moschops
0
238
Member Avatar for programing

I do not. Making a good compiler is very difficult indeed, but I can name few tasks much more difficult.

Member Avatar for rubberman
0
245
Member Avatar for gingerfish

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 …

Member Avatar for gingerfish
0
921
Member Avatar for fantasma

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 …

Member Avatar for fantasma
0
313
Member Avatar for Troilk

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]

Member Avatar for nezachem
0
308
Member Avatar for jbennet

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

Member Avatar for raptr_dflo
0
3K
Member Avatar for goyofoyo

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

Member Avatar for TrustyTony
0
264
Member Avatar for jbennet

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 …

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

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]

Member Avatar for vedro-compota
0
176
Member Avatar for thierrypin

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?

Member Avatar for thierrypin
0
190
Member Avatar for TrustyTony

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 …

Member Avatar for Narue
0
1K
Member Avatar for egmik3

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 …

Member Avatar for gunasek12
0
7K
Member Avatar for jimJohnson

The End.