506 Posted Topics

Member Avatar for narlapavan

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.

Member Avatar for thekashyap
0
66
Member Avatar for tikoti
Member Avatar for thekashyap

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 …

Member Avatar for thekashyap
0
201
Member Avatar for empyrean

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

Member Avatar for thekashyap
0
296
Member Avatar for chintan_1671

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

Member Avatar for thekashyap
0
1K
Member Avatar for thekashyap

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 …

Member Avatar for thekashyap
3
580
Member Avatar for thekashyap

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 …

Member Avatar for thekashyap
0
386
Member Avatar for ajwest85

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

Member Avatar for thekashyap
0
150
Member Avatar for keeda

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.

Member Avatar for thekashyap
0
115
Member Avatar for rkumra

Did you check details using -d option? clearmake -d "whatever other options/params you used"

Member Avatar for thekashyap
0
70
Member Avatar for tubby123

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 …

Member Avatar for rubberman
0
139
Member Avatar for Tinee

Can you post the exact command line you're using to compile along with compiler errors exactly as reported?

Member Avatar for Akill10
0
4K
Member Avatar for Inevitable x7

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?

Member Avatar for thekashyap
0
108
Member Avatar for tofugames

Arrays are passed by reference. Your problem should be with the second function (not passing the single object by ref/ptr).

Member Avatar for thekashyap
0
245
Member Avatar for shroomiin

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.

Member Avatar for thekashyap
0
166
Member Avatar for inzombiak

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

Member Avatar for thekashyap
0
132
Member Avatar for Kprosser1029

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 …

Member Avatar for thekashyap
0
260
Member Avatar for techie929

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.

Member Avatar for thekashyap
0
56
Member Avatar for thekashyap

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

Member Avatar for thekashyap
0
197
Member Avatar for thekashyap

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 …

Member Avatar for thekashyap
0
104
Member Avatar for thekashyap

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 …

Member Avatar for thekashyap
0
2K
Member Avatar for coding101

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 …

Member Avatar for masijade
0
217
Member Avatar for konefsta

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.

Member Avatar for thekashyap
0
121
Member Avatar for thekashyap

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). [*] …

Member Avatar for ~s.o.s~
0
226
Member Avatar for kodera
Member Avatar for kodera
0
111
Member Avatar for 2himioweme
Member Avatar for MarginOfBuffett

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

Member Avatar for Narue
0
260
Member Avatar for san man

You can [URL="http://www.daniweb.com/forums/search.php?searchid=15770387"]start here[/URL].

Member Avatar for rubberman
0
2K
Member Avatar for CorruptionInc

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.

Member Avatar for CorruptionInc
0
1K
Member Avatar for Aepexx

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

Member Avatar for FRGT/10
0
230
Member Avatar for nemoo

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 …

Member Avatar for thekashyap
0
172
Member Avatar for arthurav

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 …

Member Avatar for thekashyap
0
303
Member Avatar for j_kathiresan

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

Member Avatar for thekashyap
0
233
Member Avatar for Galois77

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.

Member Avatar for thekashyap
0
198
Member Avatar for smidhunraj
Member Avatar for smidhunraj
0
142
Member Avatar for goocreations

Interesting.. Can you post full code? With main()? so I can run it in my CodeBlocks..

Member Avatar for mike_2000_17
0
124
Member Avatar for MagnetoM

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

Member Avatar for MagnetoM
0
102
Member Avatar for Shaabangbang

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

Member Avatar for thekashyap
0
131
Member Avatar for bufospro

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

Member Avatar for thekashyap
0
81
Member Avatar for tomtetlaw

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.

Member Avatar for mitrmkar
0
171
Member Avatar for lochnessmonster

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.

Member Avatar for thekashyap
0
109
Member Avatar for harish.tiruvile

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

Member Avatar for thekashyap
0
108
Member Avatar for AhmedGhazey

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

Member Avatar for AhmedGhazey
0
144
Member Avatar for otttt

[quote][CODE]typedef struct { char word1[]={"AND"}; char word2[]={"OR"}; char word3[]={"NOT"}; }words;[/CODE][/quote] What's the use of this?

Member Avatar for thekashyap
0
465
Member Avatar for wombomatt

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

Member Avatar for dkalita
0
260
Member Avatar for sidrules1984

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

Member Avatar for thekashyap
0
186
Member Avatar for titosd
Member Avatar for gmdune

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

Member Avatar for gmdune
0
136
Member Avatar for bufospro

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 …

Member Avatar for bufospro
0
104
Member Avatar for abhimanipal

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

Member Avatar for nezachem
0
142

The End.