- Strength to Increase Rep
- +12
- Strength to Decrease Rep
- -3
- Upvotes Received
- 205
- Posts with Upvotes
- 180
- Upvoting Members
- 127
- Downvotes Received
- 10
- Posts with Downvotes
- 10
- Downvoting Members
- 9
Computer engineer constantly trying to overcome his lack of natural talent.
- Interests
- Bowling. Construction. Family. Not necessarily in that order.
- PC Specs
- Various machines of differing levels of power. Linux mostly with some Mac and Windows thrown in for…
825 Posted Topics
Re: CSV format will end a line with `,` if the last field is empty. If you use a standard CSV parser you would just be able to select all but the last column (through the API of the library). Search for `C++ CSV parser` and you will get plenty of … | |
Re: You will need to code a way to listen for mouse clicks (most systems provide an interface to this functionality) and then report the values accumulated over time. Look at your system documentation for where to begin. | |
Re: C'mon, lets address the aspect ratio. [code]#include <iostream> int foo(double a, double b, double x, double y) { return ((x*x)/(a*a) + (y*y)/(b*b)); } int main () { int b = 4, a = 10; const int min = -15, max = 15; int x = min, y = min; for … | |
Re: If you need a quick-and-dirty approach to controlling several machines in parallel (provided the number of machines is fairly small) you can use `tmux`. With a separate pane hosting an `ssh` session to a unique host you can enable `synchronize-panes` in `tmux` to have commands echoed to each host at … | |
Re: It seems you are making some assumptions that you have not verified yourself. The ones **Hiroshe** point out are good examples: Python, if used correctly, fits very nicely into an analysts toolbox regardless of scale. Have you had a *specific* example where this is not the case? R has some … | |
Re: When `sendto` fails, you can check the value of `errno` to know the reason. For example: if (-1 == nb) { fprintf (stderr, "sendto failed. Reason: '%s'\n", strerror (errno)); ... } | |
Re: If I understand your request correctly, you want to create an environment that makes it easy to defend your position by generating results you expect to be correct? I'm not sure that is the proper approach. What exactly are you 'fuzzing'? What do you expect your fuzz to produce when … | |
Re: Most important: *curiosity*. You can have all the skills in the world but if you are not curious about why that bump is there or what caused that little blip you will only ever be 'run-of-the-mill.' That being said, I'd say you should have a strength in all of these … | |
Re: You key is ambiguous considering your array. If you concatenate the first two elements (as text) you get "0001", your key leads with "001". Did you use "0" + "01" or "00" + "1"? In addition, are you guaranteed that the last value is 3 digits? What about the others … | |
Re: In general, these things are highly coupled with your OS - what OS are you using? | |
Re: What output are you expecting? What are you getting? What is your thoughts on why they may not be the same? | |
Re: If you are dealing with a variable size input you have a few options: 1. If you know the maximum size of the input you can create a static array that is on the stack (heed **Moschops**' warning about stack size). Then you fill in the elements as you read … | |
Re: How will what you are doing compare (or be distinct from) existing anti-virus software packages? There is an entire industry built around this - presumably using more user friendly tools/languages than direct assembly. Why not start there and see what you can leverage? | |
Re: This is highly dependent on the environment, logs, and the filtering you'd like to do. Limititng yourself to not using existing libraries makes for a difficult journey. How are you getting these logs? Individually over a socket connection? As a single file with all server logs aggregated in one place? … | |
Re: You could use environment variables. In C/C++ you can access your environment either by the `envp` to main or through the `getenv` call. For `getenv` you might do something similar to the following pseudocode: for arg in argv: if arg[0] == '$': char * variable = getenv(arg[1..-1]) You'd obviously need … | |
Re: A shell script is simply a sequence of commands issued to the shell in bulk for convenience. You place commands into a shell script exactly as you would type them on the command line. For example, to execute `ls` you do: #!/bin/bash ls Simple as that. | |
Re: Depends on how your system (i.e. `UDP server`) logs these things. For example, you might look at the `last` command in Linux for some of the information you seek but it does not contain the IP or transaction ID (whatever that is). I assume there is some built-in log support … | |
Re: What problems are you having? We wont just do the problem for you but we'd be happy to help you along with any issues you have. I'd suggest you make a separate function that handles inserting into a list. That way, in that function, you can manage how items are … | |
Re: There are functions that will check this for you: `isalpha`, `isdigit` both from `#include <cctype>` From there you can either read a string or convert to number (via `strtol`). | |
Re: If this is an academic exercise you should solve it yourself. The process of solving hard problems is what education is all about; having others provide a simple solution (that you fail to understand) breaks that process. If you are a professional and are directly asking others to do your … | |
Re: `printf` will allow you to format output as you'd like. double area = ...; printf ("Area: %0.2f\n", area); | |
Re: You can do this with `screen`. For example: screen -d -m nautilus . Will start a screen session to host the `nautilus` process (without attaching to it) and will exit the session once the `nautilus` process exits. The net effect is that you will get a GUI that will stay … | |
Re: Considering you can write your own that list would be quite large. | |
Re: EMD is a mechanism to compare probability distributions - usually in multiple dimensions (*e.g.* image comparison). How would you look to apply that to ECG signals? What *features* are you expecting to extract with this method? The EMD will tell you how similar two normalized histograms are (*i.e.* it will … | |
Re: You may want to look into `<cctype>` which provides facilities for this type of thing. For example: #include <string> #include <cctype> std::string make_upper (const std::string& in) { std::string out(in); for (::size_t i = 0; i < in.size (); ++i) { out[i] = ::toupper(out[i]); } return out; } You can find … | |
Re: I'd suggest you look into a salary comparison tool that can adjust for cost of living and wages local to your area. It is highly dependent on where you live, your experience, and your education[1]. There are also [labor statistics](http://www.bls.gov/bls/blswage.htm) available if you can learn to navigate them. Unfortunately, there … | |
Re: In the header `<cctype>` you will find `isalpha` and `isalnum` among [others](http://www.cplusplus.com/reference/cctype/) | |
Re: If you've already established the connection, you can just use the existing socket to send messages between the two machines. What that means, specifically, depends on the client/server setup. If you have a command-oriented set where one machine issues commands to the other (or there is some other well know … | |
Re: To expand on what **Duoas** mentioned about `TIOCGWINSZ`, here is an example: #include <stdio.h> #include <unistd.h> #include <ioctl.h> #include <termios.h> int main () { struct winsize ws; ioctl (STDOUT_FILENO, TIOCGWINSZ, &ws); printf ("Window width: %zd\n", ws.ws_col); return 0; } | |
Re: It really depends on the software. In general, software packages are maintained for you and you use `apt-get` to install, update and/or remove packages. When you need to install by hand (if the package repository doesn't contain your software) you need to follow the instructions of that particular software. How … | |
Re: That error is not related to insert mode it appears during edit mode. Try using `vim` instead of `vi` (you may have to install a package) and then you should see when you are in insert mode by the status at the bottom of the edit window (you should see … | |
Re: What is your question? How much have you tried so far? | |
Re: > Part of the problem is that writing parsing rules is not trivial I think that is the crux of the matter. `lex` and `yacc` are fine tools for writing a parser/generator. The nature of languages and their compilation is that they are largely static don't often change. > any … | |
Re: What error are you getting - compiler/runtime? I can see that `scanf` might be an issue as you don't include `<cstdio>` (I'm unclear if `<conio.h>` does that for you). Also, you are mixing input mechanisms (`cin` and `scanf`) - it is best to pick one and be consistent. Also, you … ![]() | |
Re: Are you expected to provide code for this or some sort of pseudocode describing how you would implement such a thing? Have you been given any example cod eto build from or are you to complete this from scratch? In general, we do not provide free homework answers. Show that … | |
Re: That code wont compile. Do you have a working example (that was copied incorrectly) or are you asking how to get the current example to compile? | |
Re: What do you expect to be returned from `toBinary`? What *is* being returned? Do you get warnings when you compile? What are they? As an aside, when I see: > I have all of the needed includes so do not worry about them. followed by: > I am some what … | |
Re: Well, knowing how it works and *using* it are entirely different. I agree with **Schol-R-LEA** in that you should never use this function. However, if you want to learn how it works internally to better understand it and *why* you should avoid it - that is a good thing. Look … | |
Re: There aren't many `c++` elements that need changing. Look at `cin`, `cout`, the use of `static_cast<>`, and the `#include` directives and you should be good. | |
Re: The `argv` parameter passed to main contains the arguments passed to the program. So, for example, if you'd like to use the argument to the program as the file name instead of the hard-coded `D:\photo\sab.jpg` you would do something like: image = imread(argv[1], CV_LOAD_IMAGE_COLOR); | |
Re: This looks like a very simple grammar would do the job. Unfortunately, generating a parser from a grammar will only give you strings, you need to interpret that data individually and that requires knowledge of what this data *means*. For example, what is the difference between a string that has … | |
Re: The `while` loop you have is the code executed after the `if` condition is evaluated. Are you saying that you want it to be executed when the `if` condition is true (or false)? I'm unclear on what you mean by combining an `if` statement with a `while` loop. | |
Re: There are times when this does matter. If I recall correctly Windows will translate `\n` to `\r\n` automagically unless you specify binary mode. I can't remember the exact order of events to tickle this situation but if you expect to produce accurate cross-platform content binary mode is one step you … | |
Re: Those seem like pretty explicit rules. What have you accomplished so far? What do you need help with? | |
Re: To add to what **Moschops** mentions, you can either assign `total = numdQuotes` or just output `numdQuotes`. | |
Re: I find the best way to describe a protocol is through a state machine. A state machine can be represented in a variety of ways (directed graph, UML, a formal grammar) so what you get *handed* varies. However, the process of adhering to a protocol boils down to following the … | |
Re: I see a definition for `tellStory` and `askText` but not for `askNumber`. Just define the funciton (like you did for the other two) and the compiler will be happy. | |
Re: OT: I'm curious, mike_2000_17, what is it about the LLVM codebase that annoys you? I've have the opposite experience - adopting some of the style I found there. | |
Re: `tshark` is the command line version of `wireshark`. You can also use `tcpdump` depending on the platform. Each of these is easy to wrap around a script interface. | |
|
The End.