825 Posted Topics

Member Avatar for ravi_14

@David W: The code you provided doesn't address the OPs concerns and the relative use of `inline` compared to the example size is very small. It might be helpful if you condensed the example to a very small class and taylored the code to address the 'multiple files' problem the …

Member Avatar for David W
0
209
Member Avatar for ravi_14

To fully understand this you need to understand how stages of compilation work over several files. However, conceptually, you can think of this using the following example: File: `main.c` int add (int x, int y) { return x + y; } int main () { int i = 3, j …

Member Avatar for L7Sqr
0
207
Member Avatar for srivardhanms

NOTE: This might be better in the Linux/Unix forum - maybe a moderator can move it as appropriate. Traditionally, a *sniffer* intercepts network traffic from a device; usually a network interface card (NIC). Sniffing can also be done with a network tap/bridge that sits between two machines on a network. …

Member Avatar for srivardhanms
0
1K
Member Avatar for pheonixkid

Generally, when you have to parse input that must adhere to some constraints (a language, for example) you use a grammar. The grammar can be built up in a variety of ways: using tools like `yacc`/`bison` or in code ala `llvm`. In the former, you usually have a parser generator …

Member Avatar for L7Sqr
0
377
Member Avatar for Jsplinter

Just rewrite the serialization routines to write the first byte (or 32-bit chunk) as the size. On the read side, read the size first and then read however many bytes it indicates.

Member Avatar for Ancient Dragon
0
2K
Member Avatar for kid.coder

The next time you loop through you are calling `listen` and `accept` again. First, I would move the `listen` outside of the loop. Second, `accept` is a blocking call - that is, if no other connection attempts are made it will wait there indefinitely. A general approach to this situation …

Member Avatar for L7Sqr
0
639
Member Avatar for happygeek

I doubt autonomous systems will ever be more than a pet project - at least over the next 20 or so years. A very real problem is that the 'real world' is messy; it is dominated by things that trigger false positives and heuristics can only get you so far …

Member Avatar for Hiroshe
2
428
Member Avatar for tomeika.griffith

And what, exactly, have you tried so far? What is it you are having trouble with?

Member Avatar for Suzie999
-1
214
Member Avatar for shahzrinsaid

@shahzrinsaid: What have you tried? What problems have you encountered? There is plenty of information there to make an honest attempt at the assignment - you have the formulae; all you need to do is construct functions that implement them. @Sarkurd: It is obvious this is some sort of assignment …

Member Avatar for <M/>
0
5K
Member Avatar for lewashby

Why not search for tools that can read the metadata directly and use that API? If not, look at the MP3 *file format* and write a program that will parse that. Any open source tool that plays MP3s will have the logic to extract the information you seek - you …

Member Avatar for JasonHippy
0
247
Member Avatar for tania2011

What is your question? Also, why would you use a text file to do this? It seems more natural to use an IPC mechanism more suited to such an operation - pipes, for example.

Member Avatar for L7Sqr
0
150
Member Avatar for elshaday

If you are the least experienced at an already established financial institution I would suggest you first consult the more serior staff about where to look. Presumably there are internal documents detailing the layout, configuration, and operation of your system. The work that has been done will guide your research …

Member Avatar for Jason Statham
0
232
Member Avatar for boka123

Inserting a node that is the sum of the next two nodes creates an infinite process. Consider: Original: 1 -> 2 -> 3 -> 4 Iteration 1: 1 -> 2 -> 3 -> 4 ^ (add 2 + 3, insert node) 1 -> 5 -> 2 -> 3 -> 4 …

Member Avatar for Akash_Soni
0
172
Member Avatar for nahashon

You need a few pieces: * Input routine to collect user number * Process to split that number into individual digits * Recursive call that takes the result of the above operation as input and returns a digit in the terminating case

Member Avatar for David W
0
177
Member Avatar for Avishek_1

If your school has a bus lot consider building a program that simulates (and potentially optimizes) the bus loading process. You can sample (by observing) how long it usually takes to load/unload a bus how long busses usually wait in the lot after having loaded or unloaded the students. This …

Member Avatar for Avishek_1
0
237
Member Avatar for XodoX

A local hash table and a DHT are fundamentally different; it is a non-trivial process to convert one to another. Perhaps you could explain why there is a need to move to a distributed design.

Member Avatar for L7Sqr
0
175
Member Avatar for Rok_1

When you say it doesn't work, could you be more presise? Is there no output, incorrect output, a crash?

Member Avatar for L7Sqr
0
788
Member Avatar for Stefan_2

Why not just store the name in the `player` struct itself? Something like: typedef struct plist_ { int atc, def; char *name; struct plist_ *next; } PlayerList;

Member Avatar for Stefan_2
0
325
Member Avatar for ObSys

Most shells provide the `EDITOR` environment variable (or you can set to have it exported in your rc file). If that is set the way you want you can use that. For example: `${EDITOR} &` would open Emacs if the environment had `EDITOR` exported as `emacs`. Another way you might …

Member Avatar for JasonHippy
0
259
Member Avatar for Fatma_2
Re: help

You probably shoud have started earlier than now. What have you accomplished so far? Which one do you need help with?

Member Avatar for deceptikon
0
238
Member Avatar for Ahmed_51

What do you plan to do about inputs that match multiple words? For example if I input `ewst` that should match any of `west`, `wets` or `stew`. Since you have ambiguity in the matching for a scrambled input why have the overhead of iterating all permutations of the input string …

Member Avatar for L7Sqr
1
561
Member Avatar for coding101

If the format is consistent enough, you can just match the surrounding pieces. For example: sed 's;Report name=".* - Report";Report name="'"`date +"%D %I:%M:%S %p"`"' - Report";' which results in: [ezpz@mercury (tmp)]$ cat t.t <Report name="05/14/14 05:05:53 AM - Report"> [ezpz@mercury (tmp)]$ sed 's;Report name=".* - Report";Report name="'"`date +"%D %I:%M:%S %p"`"' …

Member Avatar for L7Sqr
0
152
Member Avatar for Jurdmie15

This sounds very much like an asignment *you* should be completing. What have you tried so far?

Member Avatar for L7Sqr
0
61
Member Avatar for Garidius

You can get the keys of a hash with `hash.keys`. puts hash.keys.join ',' hash.keys.size.times do |i| s = hash.collect { |h| # fill the entry (h[1]) as you'd like h[1][i] }.join ',' puts s end

Member Avatar for Taywin
0
407
Member Avatar for changeworld4u

You are using single quotes in the `awk` expression. That terminates the expression prematurely. Try using double quotes; something like: awk '{ if((substr($1,12,2)==84) && (substr($1,26,2)=="CC" || substr($1,26,2)=="CA")) print $4; else print "0" }' Should work out for you.

Member Avatar for changeworld4u
0
288
Member Avatar for Curious Gorge

Probably more of a boredome thing. Documentation is boring. Documentation maintenance is even worse. Part of the thrill of programming is getting something to work. Once it works there are other challenges like extending what you have just created; supporting others' interest in your technology; refactoring out the nasty parts. …

Member Avatar for L7Sqr
0
199
Member Avatar for it@61@sec

I'm not familiar with TS or VU+ formats but, in general, you can not simply rename files and expect that they will be interpreted differently. Is Avidemux capable of handling TS files?

Member Avatar for it@61@sec
0
738
Member Avatar for Garidius

A little late to the game but hopefully this helps the situation for 3 or more lists: require 'matrix' m = Matrix[ [1,2,3], [2,3,4], [3,4,5], [4,5,6] ] # transpose will get the order you want m.transpose.to_a.each do |xs| puts xs.join "-" end # => 1-2-3-4 # => 2-3-4-5 # => …

Member Avatar for Garidius
0
447
Member Avatar for brakeb

You can easily do this in a shell. If your file is named `foo.in` then you would get what you want with: sort foo.in | uniq -c | awk '($1 == 1) {print $2}' This gives you the entries that occur exactly once in the input file. Now, depending on …

Member Avatar for brakeb
0
196
Member Avatar for August AlieN

'Cloud' computing is a rather large space. In the most generic sense it means having computations run elsewhere. What, specifically, are you looking to research?

Member Avatar for L7Sqr
0
75
Member Avatar for Vikram Sehgal

Enum is a way to provide clarity (and type information) to your code. The underlying type is simply some integral type so you could just get rid of the `enum` altogether and replace with numeric values (by default, `enums` values begin at 0). The consequence of that is when you …

Member Avatar for L7Sqr
0
268
Member Avatar for Netcode

`gets` is [bad](http://stackoverflow.com/questions/4346598/gets-function-in-c/4346650#4346650). And, yes, `strcpy` fails to do bounds checking.

Member Avatar for Netcode
0
299
Member Avatar for davy_yg

Well, in general, *nix usually has a forward slash (/) delimeter, not a backslash (\\). From your current position you would do: mkdir /red5/webapps/openmeetings/uploadtemp/files Of course, you need permision to create that directory. If you do not have permissions you need to do the action as `root` or with elevated …

Member Avatar for JasonHippy
0
476
Member Avatar for Jake_4

It is illegal to convert from type `double` to a pointer to type `float`. You may want to declare `value` as `float value;` (rather than `float *value`). Do note, however, that `double` to `float` is a lossy transformation. Is there any reason that you dont make `value` a `double` as …

Member Avatar for StuXYZ
0
4K
Member Avatar for inspire_all

To append to strings in C you use `strcat`. To copy from another string you use `strcpy`. (There are variants of these that allow you to specify a length - check your documentation). It is unclear to me which you need. Below is an example that shows how to use …

Member Avatar for naveen1993
0
213
Member Avatar for moaz.amin.37

`std::string` maintains memory (and various other operators) for you. Everything you do with a `char` array must be handled by you explicitly: memory management, copy, appending, length checking, and so on.

Member Avatar for moaz.amin.37
0
366
Member Avatar for Vikram Sehgal

Well, you cannot expect that you are going to learn something by osmosis - you have to experiment and try for yourself. That does not excuse an incompetent teacher, of course. Otherwise, you still have not mentioned a system. Linux? Windows? Are you provided any existing code (or libraries)? Suggestions …

Member Avatar for Vikram Sehgal
0
254
Member Avatar for COKEDUDE

You do not assign anything to `input`; it is a raw pointer (in your example). If you try to read from an arbitrary location in memory the best you are going to get are strange characters in your output. Try reading from `stdin` or opening a file stream with `fopen`.

Member Avatar for L7Sqr
0
187
Member Avatar for COKEDUDE

Decimal and Hexidecimal are encodings of some *value*. The *value* itself doesn't change. So do the math in whatever encoding is most comfortable for you then convert the result to desired encoding. For example, with the values your provided: `15 + 17 = 32` `32 decimal is 20 hex`

Member Avatar for JasonHippy
0
297
Member Avatar for kal_crazy

If this is `C++` why not use `std::string`? Something like: #include <iostream> #include <string> int main () { std::string src, dst; src = "C:\\Windows"; dst = src.substr (0, src.find_first_of ("\\") + 1); std::cout << "Original: " << src << std::endl; std::cout << "Modified: " << dst << std::endl; return 0; …

Member Avatar for Kristian_2
0
216
Member Avatar for bokizss

We don't give out code here. You need to show some effort of your own and we can help you along the way.

Member Avatar for Bendez Thyna
0
166
Member Avatar for davy_yg

What do you want to secure shell connect *to*? In general, to connect to a remote location (somehost.net, for instance) you would do the following: `ssh user@somehost.net` That would try to connect (and log in) as user `user` on host `somehost`. To know more, open a terminal and type `man …

Member Avatar for rubberman
0
215
Member Avatar for logicslab

By 'Multicasting' are you referring to something like IP Multicast or something simpler such as basic medium broadcast with efficient pruning? What, then, do you want to secure about it? The data, source/destination pairs, the control information, the fact that you are even using multicast?

Member Avatar for L7Sqr
0
183
Member Avatar for mini programmer

For your original example, your script gives the answer 9, not 7 as you requested. The command you show does not handle punctuation and capitalization. You probably want to add some `sed`-like functionality to remove punctuation and address capitalization. After that you can consider the encoding.

Member Avatar for mini programmer
0
329
Member Avatar for dinamit3

It seems to be the difference between UTF-8 hex and UTF-16 hex ([See encodings section here](http://www.fileformat.info/info/unicode/char/21b/index.htm))

Member Avatar for L7Sqr
0
294
Member Avatar for Alan_4

Are you asking for *help* or just the answer? If it is the former please explain what you've tried and how you are stuck.

Member Avatar for cmk001
0
399
Member Avatar for shaneetra.graham

There are a few problems with your code: * You don't have a `main` function * The `Command` structure seems to be keeping the history? Idealy, the history should keep a list of `Commands`. * The `if` condition in your `while` needs `{` and `}` or you will *always* break …

Member Avatar for L7Sqr
0
2K
Member Avatar for overwraith

[This](https://github.com/sam-github/libnet/releases) repo goes back as far as libnet-1.1.3 (2008). The sourceforge page looks as if it ends releases libnet-0.10.11 (2003). Searching for specific versions turns up other resoures. What exactly have you tried in your searches?

Member Avatar for L7Sqr
0
112
Member Avatar for shaneetra.graham

A `switch` works on integral types. The best you could do (to keep some sembelance of the command name) is to use an `enum` type - but you would still need to map strings to that.

Member Avatar for shaneetra.graham
0
119
Member Avatar for Sara Masri

What have you tried so far? Even if we wanted to help at this point we would be unable. What format is the FSM in, for example? To properly read and build a FSM in memory is a non-trivial task so you need to provide some more detail (and evidence …

Member Avatar for rubberman
0
314

The End.