506 Posted Topics
Re: You can - do rsh/ssh/telnet to execute the ls/stat command and get it's output. - do cp/rcp/scp to get the file itself to local machine and find out the size. | |
Re: What is the problem?! Any errors you're getting.. | |
Hi, I wrote [URL="http://www.daniweb.com/software-development/cpp/code/363562"]this C++ article[/URL]. 1. At first I thought of making it a tutorial, but when I create a new post there is no option in the combo to say it's a tutorial. Only options available were discussion thread and code snippet. I was hoping to get an … | |
Re: You can use sed or awk. Perhaps awk is more readable if you're new to shell scripting. Create one RE each for ID, PA, PT and Sequence. And in the body print the output. something like: [CODE]awk ' /^ID / { print $2,";" } /..../ { print ... } '[/CODE] … | |
Re: [quote]error C2440: 'static_cast' : cannot convert from 'void (__thiscall CChatView:: * )(LPARAM,WPARAM)' to 'LRESULT (__thiscall CWnd:: * )(WPARAM,LPARAM)' [/quote] It's been 10 years since I did some MFC so don't really remember. But from teh error msg itself you can deduce this: Your declaration translates to: [iCODE]void (__thiscall CChatView:: * … | |
This article shows you how to optimize memory allocations in C++ using placement new. Applicable especially to usecases dealing with creation of large number of objects. [COLOR="Red"][B]A brief on problem:[/B][/COLOR] Lets take example problem for simplicity: - I have a GSM network with a cell in it. - Cell's coverage … | |
Hi, I have a problem where I need to generate hash for ~10e9 (1 bio) keys. I tried creating a hash of my own but after all the research I realized that I can as well (or even should) use one of existing functions. I narrowed down on SHA-1, which … | |
Re: [CODE]for (i in name) { printf("%15s %21.2f\n", name[i], sales[i]) | "sort -nr" }[/CODE] In this i is set to each "value" of the array element and not the index. There is no simple way to find the array size in awk. Some newer versions of gawk, nawk support it. So … | |
Re: What if you hardcode the key inside the script and then [URL="http://linux.koolsolutions.com/2009/01/20/howto-encrypting-a-shell-script-on-a-linux-or-unix-based-system/"]encrypt the script itself[/URL]? Given that shell script itself is not human readable anymore, your key is safe. Downside is that every change in script would need to you to re-encrypt it. | |
Re: Did you check details using -d option? clearmake -d "whatever other options/params you used" | |
Re: Problems are not related to the variable being global. It's the size if it and whether it's null terminated or not. read the documentation of gets() to see what it expects as the argument and what happens when user gives more chars than the size allocated for the string passed … | |
Re: Can you post the exact command line you're using to compile along with compiler errors exactly as reported? | |
Re: What kinda application is this? JSP/Applet/..? When / where do you want to show the tally? On some button click as a msg box or continuously updated in some text area in the UI? | |
Re: Arrays are passed by reference. Your problem should be with the second function (not passing the single object by ref/ptr). | |
Re: Also line 7: don't use variable names that sound like proper commands.. by default make it a habit to prefix/suffix "my" or something else to all your variables.. "file" is a command. | |
Re: [CODE]void sort(int arr1[], int arr2[], int k) { int i = 0, j=0, temp=0; for (i = 1; i <= k; i++) { for (j = 0; j < k - 1; j++) { if (arr1[j+1] > arr1[j]) { printf("swapping: %d and %d\n", arr2[j], arr2[j+1]); temp = arr2[j]; arr2[j] = … | |
Re: What's the problem? I don't see where are you attempting to print the contents as hex. You should probably not use readLine(). Use any variant of read() instead it returns a single char (or specified number which can be 8 or 16 or 32 depending on how you want to … | |
Re: Works fine for me.. with GNU Make 3.81 Two guesses: 1. You have spaces instead of tabs. 2. Your new-lines in Makefile are in wrong format (DOS or Unix). Run dos2unix or unix2dos. | |
Referring to teh [URL="http://www.daniweb.com/techtalkforums/announcement55-4.html"]announcement: [/URL]What are teh possible values for syntax in code tags? I just posted some shell script and code=sh or code=shell didn't seem to work. Would be nice if the announcement itself can be updated with this info a link to this info is added there... | |
Hi, I was implementing the Exampler / Prototype pattern just to brush up on C++. Couldn't figure out how to do the cleanup at the end. Problem is deleting all the prototypes from the map in base class at the end. I.e. deleting all stored pointers in [ICODE]Animal::examplesPtr[/ICODE], which is … | |
Hi, I want to get the count(*) from all tables under a schema. How to can do this using a loop? I'm a noob at PL/SQL. I'm unable to find how to use the loop variable in the select statement. Here is what I've tried so far: [CODE]spool $DD/get_oid_dump.log; SET … | |
Re: Use rm -f instead.. To check whether rm is aliased or not use [ICODE]which rm[/ICODE]. To stop shell from resolving aliases use "\" at front, i.e. [ICODE]\rm[/ICODE] would not resolve an alias if rm is aliased. Also the following works (not a good idea in this case but you learn … | |
Re: Don't use [URL="http://www.google.com/search?q=csh+bad+scripting"]csh for scripting[/URL]. If you're using sh or bash, syntax is available in [iCODE]man test[/iCODE]. PS: There is no difference between a char and a string in shell. So forget the single quote for single char. It's always double quote. | |
Hi, I'm looking for a good [Feed] Reader application/software to keep up to date abt new / updated posts in say Daniweb C-Forum. Any good app you know? I'm currently using [URL="http://www.feedreader.com/"]FeedReader 3.14[/URL]. Seems decent enough but it doesn't: [LIST] [*] Show me full thread (only the original post/question). [*] … | |
Re: Initialize [iCODE]private char[] key; private char[] answers;[/iCODE] | |
Re: [QUOTE=firstPerson;1527787]What are the errors exactly? Make sure you include safe guards in the header file. For example : [code] #ifndef SONG_H #define SONG_H class Song{...} #endif [/code][/QUOTE] Why not [ICODE]$pragma once[/ICODE] instead? @OP: Most probably the issue is you're not linking your client's .o file with Song.o while linking. If … | |
Re: You can [URL="http://www.daniweb.com/forums/search.php?searchid=15770387"]start here[/URL]. | |
Re: Can you post the imports you used in each class? Given that Quiz implements Measureable there should not be an error unless you've got 2 Measureable classes in your project. | |
Re: Implement a new function that takes teh float and gives you back a string! If you're unable to post the function's code with questions.. | |
Re: You've posted the question in C forum so I guess you're using a C program. The code shouldn't have compiled in the first place as the symbol has namespace in it, viz not supported in C. The symbol [URL="http://www.google.com/search?q=std%3A%3Alocale%3A%3Afacet"]seems to be[/URL] part of libstdc++, which should be part of hte … | |
Re: I don't have hash_map & hash so I replaced hash_map with map and removed hash. It seems to work though there seems to be a small problem with printf(). What I suggest (to debug this further) is to create default and copy c'tor for your struct (or change it to … | |
Re: I doubt that using RegEx would improve the performance. If you're on ?nix, why don't you use grep? You can find what you're looking for [URL="http://www.google.com/search?q=java+regular+expression+with+a+code+snippet"]here[/URL]. | |
Re: 1. Although the option 2 is better from performance point of view as YOU decide exactly which statements within the method are synch'd. 2. Even the statements that access the data from underlying storage need to be synch'd. | |
Re: Why don't you type help at the ftp command line. Or do a "man ftp"??!! | |
Re: Interesting.. Can you post full code? With main()? so I can run it in my CodeBlocks.. | |
Re: Did you already do a clean and build? There are some options related to pchs (pre-compiled headers) in build options. -- Uncheck them (do not use pchs), clean, build -- Check them, clean, build | |
Re: What's teh problem with: [CODE]typedef const std::iterator<std::forward_iterator_tag, T, void> Iter; Iter my_const_iter;[/CODE] In any case post the problems you have.. | |
Re: [quote]is it possible to become with only one regular expression ?[/quote] Yes. :) Did you check the "n" command in sed? It basically loads the next line into buffer. Would be useful here. Google for "sed one liners" you should find some examples you can use. | |
Re: Can you post the linker errors? Also the command lines (from the VS build logs). --edit-- And certainly DO NOT use stdlib as the name!! As already said by Ed.. Don't post the errors unless you've changed the name. | |
Re: Try compiling code similar to case 2 in java. You'll get a warning from compiler saying "static methods should be invoked on class instead of object". As Mike pointed out the obvious overhead is the instantiation. | |
Re: [iCODE]sed "p;s/^\(\([ (]*'[^',]*', \)\{6\}\)' '/\1'X'/g" filename[/iCODE] assumes number of spaces etc is fixed, if not put a few +s and *s appropriately. | |
Re: In trying not to answer the question jon already gave good enough hints.. post what you've done so far and you'll get the answers.. | |
Re: [quote][CODE]typedef struct { char word1[]={"AND"}; char word2[]={"OR"}; char word3[]={"NOT"}; }words;[/CODE][/quote] What's the use of this? | |
Re: #include "savingsAccount.h" in customer.h Line 6 in customer.h is a forward declaration. It works only if the usage following declaration is by-reference/pointer. | |
Re: [QUOTE=dkalita;1521458]read the information using scanf/cin and then create the command using them.[/QUOTE] There is no cin in C. Use scanf to read user input as dkalita suggested. Use sprintf to create the execution string based on user input. | |
Re: can you describe what "does not work correctly." means? | |
Re: [CODE] #!/bin/bash # does this help? # Make a list of files to process: # it is ls -"one" not -"el" ls -1 >> list_of_files.txt find /xxx/yyy -name *.txt >> list_of_files.txt for file_name in `cat list_of_files.txt` do # process the file e.g. [ ! -f $file_name ] && echo "$file_name … | |
Re: Syntax of your xml is wrong. You can't have the outermost tag twice in a file. So modified it a bit and assume that's what you want. [CODE] <xml> <entry> <name>aaaa</name> <surname>bbbb</surname> </entry> <entry> <name>eeee</name> <surname>ffff</surname> </entry> </xml> [/CODE] Given that you already have code ([ICODE]{print /uid=/?$4:(/^telephoneN/)?$2:$3}[/ICODE]) that can print … | |
Re: [CODE]// it doesn't matter what's the pointer, you've requested the printf to treat it as an integer. printf("The number is %d",*(char*)p1); [/CODE] [CODE] // You'll see the difference if you instead do this: int main() { int *p1 = (int*)malloc(sizeof(int)); *p1 = 60; printf("The number is -%d-\n",*(char*)p1); printf("The char is … |
The End.