825 Posted Topics
Re: You are going to have to be more specific. What are you trying to test, exactly? If all you want to do is write some socket code then there are plenty of libraries wrapped around the interface to that. If you are familiar with C++ google for C++ network wrapper … | |
Re: Depending on your need, you may also want to look at `strtol` which has better error-checking support than `atoi` and can handle a larger variety of input. | |
Re: If you depend on the network I don't know of a way to guarantee any real-time constraints. A network is a shared medium and, with intermediate machines responsible for acting on the behalf of other, you are at the mercy of the load of the network. In the most simplistic … | |
Re: I think this is an excellent use case for `strtol`. It allows you to provide an *end marker* that indicates where the last translation ended. For a well-formed (see note below) IP string, that is always going to be a period. Given that, you can construct something like: #include <cstdio> … | |
Re: I'm not sure I understand your question. Do you want programs that are written in C and are of substantial size? Or, do you want problems that are hard to solve so that you may practice developing C programs? | |
Re: If you now understand what rot13 is you can implement it programmatically simply by writing out the process in simple steps and writing code for each of those steps, in turn. How would you write this out, in the simplest form, so that someone three generations older than you (i.e. … | |
Re: This sounds very much like homework. What have you tried and how have you failed? | |
Re: @Banfa: That will *wrap* a value like 256 to 0 where I beleve the op wants to have it be 255 for all values over 255. @tinstaafl: Why require `cmath` for specific versions of `min`/`max` which have an already templated form? Building from **tinstaafl**s approach: `val = std::min ( 255, … | |
Re: *Big Data* is simply a newly popular term - much like *The Cloud* was a few years ago. In order to do anything relevant you will need (at least): * a purpose * a source for your data (it is not easy to come by terabytes worth of data) Without … | |
Re: I would suggest something other than `grep` in this case. If you know the the delimeter is *definitely* a single space, you may use `cut`, otherwise use `awk`. Example input (`t.t`): one two three four five six one two three four five six one two three four five six one … | |
Re: You will want to add the `-ggdb` flag to aide both `gdb` and `valgrind`. | |
Re: Unless your CSV file came from a MySQL database with the same structure it is likely that you will need to write a transform to get the data in a format that is what you expect. Although, if you are going to that length you might as well just write … | |
Re: I'm assuming that by **whole packet** as hex means that you get an Ethernet frame as a sequence of hex values. In order to get to higher layer headers you have to parse the lower layer headers first. While doing this keep in mind that there are variable width headers … | |
Re: Have you tried `pthread_kill (pthread_self (), sig)` ? | |
Re: Algorithm for what - data plane? control plane? What is the focus of the algorithm? Will Matlab be sufficient to represent all the artifacts that will influence your algorithm? | |
Re: The idiomatic way to do this through pipes. As an example, consider the two following scripts: `a.sh` for arg in $@; do echo `pwd`/${arg} done `b.sh` while read line; do echo "New entry: ${line}" done If the output of `a.sh` was: /tmp/foo/1 /tmp/foo/2 /tmp/foo/3 and you *piped* that to `b.sh` … | |
Re: I've [answered](http://www.daniweb.com/software-development/cpp/threads/425644/some-basic-c-questions-about-processes-#post1820083) a similar question before. It contains a diagram that may prove useful for you understanding of control flow. | |
Re: You may be able to combine the output of `w` or `who` - both list the `TTY` and connection - with the output of `ps` (which shows the `TTY`) to figure out which `bash` process is yours. EDIT: Looks like `bash` has a built-in variable for just this purpose: `$$` … | |
Re: Media doesn't compose a network, it flows within it. As far as topologies, are you looking for theoretic type of topologies or realizations of real networks? If it is the latter you should design a business case first. In general, the layout of a network and its subnets/vlans is driven … | |
Re: Personally, I feel the best way to improve your skills is to use them. In the programming world that means two things: **read** code and **write** code. Find and/or join an open source project and start exploring. Add your own components. Understand how the code is put together. You will … | |
Re: According to `man 7 signal` the default action for `SIGCHLD` is to ignore the signal so `SIG_IGN` and `SIG_DFL` seem to invoke the same bahavior. However, there is a stipulation earlier in the text that states: A child created via fork(2) inherits a copy of its parent's signal dis‐ positions. … | |
Re: Reading the output of another terminal is a non-trivial task. What level of experience do you have? Are you able to start the tshark program yourself instead of trying to read another terminal? What is the timeframe for number of packets? 500 per second, per minute, per hour, per 8-6 … | |
Re: Hacking is a term open to interpretation. In recent years, it is mostly associated with illegal or inappropriate behavior. In general, it can refer to playing with things to see how they work or just plain tinkering. What is your definition of hacking? | |
Re: I'm not sure I understand your question. Does the following accomplish what you want? d <- data.frame( cbind( Name=c('xy','yz','zx','vx','vt'), marks1=c(10,20,30,20,10), marks2=c(30,40,40,20,20) ) ) d$marks1 <- as.numeric(as.character(d$marks1)) d$marks2 <- as.numeric(as.character(d$marks2)) plot(0,type='n',xlim=c(1,5),ylim=c(0,50),axes=FALSE,xlab=NA,ylab=NA) points(d$marks1 ~ d$Name,cex=1.5) points(d$marks2 ~ d$Name,pch=19) axis(1,at=1:5,labels=levels(d$Name)) axis(2) It is very specific to your dataset so you would have to … | |
Re: While that may not have chnaged things recursively, your original claim of an isolated location is now invalid. That directory is open to all for reading/writing/executing. I'm not sure that matters in your case but you should be aware. | |
Re: The representation is clearly described in the wikipedia articles: `sign` | `exponent` | `fraction` The `sign` is always a single bit. The `exponent` is a fixed size, but different for each of the precisions. The `fraction` also has a fixed size (different for each precision). Using the double precision as … | |
Re: So a basic layout could be: Thread1 -> populating Queue1 at random interval This represents people waiting at the stadium. When a passenger arrives and the queue is empty the thread signals a NonEmptyQueue1 condition Thread2 -> populating Queue2 at random interval Same as the stadium, but for the city … | |
Re: Wireshark will allow you capture on an interface. Just start the program with no arguments and select the interface you want to capture on. Once you are capturing packets you can set a filter to limit those packets that you are viewing. From there, you can save just the selected … | |
Re: RoR is a web framework. Ruby, itself, is a scripting language. You can create anything you like in Ruby. The nice thing about Ruby is that it is fairly easy to pick up. Since the language is interpreted it will run slower than compiled languages but for the majority of … | |
Re: Your code is not indicative of what you are trying to do. I'm unclear on the problem you are having. Are you suggesting that the file size is incorrect on the client side or that the file is never properly sent? Can you elaborate and perhaps provide examples of the … | |
Re: You don't have to double post. If people were here and didn't reply they have nothing to say. If they weren't yet here and now see two posts from you they may be put off. It isn't as if your post had fallen off the front page of this forum... | |
Re: What part are you having trouble with? The details are all there in order that you need to do them. If you simply follow directions you will get through. | |
Re: It's fairly simple to just compile that and find out yourself. If you don't have a compiler you can translate the macro yourself to get the following source: void main() { int x=5,y=10; x=x+y;y=x-y;x=x-y;; printf("%d%d",x,y); } From that point it's just straight addition and subtraction. You should be able to … | |
Re: The scaling option is used internally by the protocol to decide how many bytes can be sent out on the wire at a time. Without scaling, you are confined by the size of the window field which is 16 bits. With only 16 bits you get 2^16 or 65535 bytes. … | |
Re: Two things: 1) I'm pretty sure you meant **python** and not pyhon 2) Supposing you are using Bash, you must be precise about whitespace so that assignment should look like: `export PATH=${PATH}:/scripts/python` Notice that the example above contains no spaces around the **=** operator. Also, be sure that the path … | |
Hello. This code snippet is a basic calculator. The general concept is that the calculator accepts infix expressions as strings, converts them to reverse polish notation by way of the shunting-yard algorithm and then evaluates the resulting expression. I tried to encapsulate the functionality of each piece so that, in … | |
Re: My personal experience is that choosing a random project will serve me little in the long run. I do a little design work, start coding and quickly run out of steam. What I've found useful is to attack problems relevant to *me*. Find some thing that you want but dont … | |
Re: 1. Show some effort of your own. 2. We will help you work out any issues with your solution. | |
Re: From the man pages: > int vfprintf(FILE *stream, const char *format, va_list ap); int vsprintf(char *str, const char *format, va_list ap); The two functions take differenet argument types for the first argument. I don't know what **file** is in your example but it certainly can not be pointer to both … | |
![]() | Re: [There are several approaches](http://en.wikipedia.org/wiki/Maze_solving_algorithm) to this problem. Wall follow is fairly straightforward; what questions do you have? |
Re: That example will not even compile. Furthermore, you should show what you have tried so far before blatanly requesting answers to problems you have. | |
Re: **ravenous** raises some good points; building your own portfolio and making it publically accessible (github, etc) is very important. However, I would suggest that you can get everything you are looking for and more by choosing an open-source project and jumping in to the bug tracker. Some benefits of an … | |
Re: It really depends on what you want to change. You will have to be more specific. In general, you find the source code for the part that you want to change, modify it to suit your needs, recompile and deploy. | |
Re: We will not do your work for you. The breakdown there is straightforward - what have you attempted so far? | |
Re: **(gdb)** *help s* Step program until it reaches a different source line. Argument N means do this N times (or till program stops for another reason). **(gdb)** *help n* Step program, proceeding through subroutine calls. Like the "step" command as long as subroutine calls do not happen; when they do, … | |
Re: Is this a request for help or a blatant attempt to have someone do the work for you? If it is the former you will need to show some initial effort before you get what you are after. | |
Re: It might be [NAT related](http://www.cyberciti.biz/faq/linux-kvm-disable-virbr0-nat-interface/) | |
Re: Smells like homework. Instead of giving you a direct answer I will give you some information. TCP is a protocol. It is defined [mostly] by an RFC. If you want to communicate with other TCP implementations you must adhere to at least the bare minimum of supported functionality. However, there … | |
Re: In general, Ethernet is the medium over which your relevant data is carried (there is a protocol for this that includes frames). You write a protocol that is carried over Ethernet and use that to communicate your data. IP is a natural way to do this since most applications support … |
The End.