Posts
 
Reputation
Joined
Last Seen
Ranked #1K
Strength to Increase Rep
+7
Strength to Decrease Rep
-1
100% Quality Score
Upvotes Received
18
Posts with Upvotes
15
Upvoting Members
7
Downvotes Received
0
Posts with Downvotes
0
Downvoting Members
0
6 Commented Posts
0 Endorsements
Ranked #977
~46.2K People Reached
Favorite Tags
Member Avatar for Shane_Warne

[code] #!/bin/bash # we want to copy from path1 to path2 # step 1 make all the subdirectories find /path1 -type d | \ while read dir do mkdir /path2"${dir#/path1}" done # step 2 cp the files find /path1 -type f | \ while read $file do cp "$file" /path2"${file#/path1}" …

Member Avatar for davidchengnoc
2
3K
Member Avatar for gemni7

DOS network programming is not directly supported by TURBO C. If someone assigned this task to you then that person must have some linkable files to supply TCP/IP support. This stuff is VERY old. TURBO C should be banned from classrooms. IMO. There were some network support libraries here: [url]http://alumnus.caltech.edu/~dank/trumpet/[/url]

Member Avatar for dhanupatil
0
653
Member Avatar for Mayank Mathur

Use [code] mailx -r '<from name>' -s '<subject here>' john@somewhere.com < message_text_file [/code]

Member Avatar for sftranna
0
624
Member Avatar for sandip.bhoi

shell programming and C/C++ are not the same thing. maybe a moderator will move your post for you. Anyway, in shell there is no way without writing code (the ncurses library provides calls to do this) without resorting to C/C++ code. Plus you have to be in graphics mode.... see …

Member Avatar for dethrophes
0
195
Member Avatar for natnit

You will need 5 million different hash tables. Which meanns that if you are lokking for a given value, say -4, across all of your arrays you will have to consult each hash to see if -4 is in the array and which element it is. This will result in …

Member Avatar for Adak
-1
3K
Member Avatar for Asif_NSU

Have you tried running it in a debugger? If you do a stack dump (backtrace) it will show exactly where it bombed.

Member Avatar for blackcloudbd
0
627
Member Avatar for winbatch

Can I make a suggestion before you spend six months learning this on your own? It may save your spouse, children, and pets endless hours of anxiety watching you bash your head into a doorframe. :) Richard Stevens book 'Advanced Programming in the UNIX Environment' spends about 90 pages on …

Member Avatar for anurag.kyal
1
242
Member Avatar for captor

Sounds like a class asignment. try a here document [code] oldpw="$1" newpw="$2" passwd <<EOF "$1" "$2" "$2" EOF [/code]

Member Avatar for milanshentu
0
2K
Member Avatar for moroccanplaya

All of the UNIX OS is written and maintained in C - well some asm. GLIBC, all of the the Linux stuff as well. What was your sample size when you came to this conclusion?

Member Avatar for griswolf
0
356
Member Avatar for Iqbal_h_a

[code] cat /proc/meminfo [/code] shows the current state of memory. The format varies somewhat with Linux distributions. My version of Linux has what you want in the 4 th column on the second line. So, you will need to get the awk statement working for you. Then put it in …

Member Avatar for wsgeek
-1
451
Member Avatar for ashokkumarrsp

Are you talking about using NFA regexp in a DFA environment? Start with a DFA tool is the simple answer. There really is no code to convert from one to another, because it doesn't make much sense to do so. C and C++ have regexp libraries available for them. Pick …

Member Avatar for Nick Evan
0
2K
Member Avatar for SamY
Member Avatar for Pokeking
0
218
Member Avatar for Iam3R

You can pass the value to another function - and name the variable something else. But you are not gaining anything by doing that. [code] void refoo(int newname) { printf("variable newname=%d\n", newname); } void foo(void) { int oldname=13; printf(" variable oldname=%d\n", oldname); refoo(oldname); } [/code] As long the variable is …

Member Avatar for Iam3R
0
87
Member Avatar for ice_tea_lemon

C version: returns pi/4 [code] #include <stdlib.h> double pi_over_4(int n) { double iter=3; int eveodd=1; double pi=0.; for(pi=1.; n>0; n--, iter+=2., eveodd=!eveodd) { if(eveodd) pi-=1./iter; else pi+=1./iter; } return pi; } [/code]

Member Avatar for nekomata
0
164
Member Avatar for rinque

If you don't want the user to notice the script running: [code] nohup script.sh <parameters> 2>&1 > ./logfile & [/code] As long as your script does not ask for user input this will work. Otherwise you will have to resort to nohup and an expect script or nohup and a …

Member Avatar for rashshell
0
135
Member Avatar for srishekh

If you are in Unix: setitimer() and getitimer() have microsecond resolution on POSIX-compliant systems. Do you know about profiling and profilers?

Member Avatar for WaltP
0
590
Member Avatar for champ80

IF you're on unix: [code] sort -t ',' k- 1,1 -o newfile.csv oldfile.csv [/code] will sort the file the way you want - outside C++.

Member Avatar for emotionalone
0
585
Member Avatar for nihao

Choices 1. install GNU date (the linux version) so you can use the --date option. Also check the man page for your current version of date - it may be a GNU variant. 2. use C's strptime() function and strftime() function in a small C program 3. install the DATE …

Member Avatar for dklima
0
555
Member Avatar for modaslam

I have no idea why the original coder wrote that stuff, except it appears the s/he did not know about the standard C library date/time functions. date arithmetic is best done with that library - convert a date/time to a struct tm, convert the struct tm to epoch seconds. Do …

Member Avatar for modaslam
0
146
Member Avatar for tigrfire

the functions count_char and test_letter_content are from something else, but they provide: an example of changing case a way to compare the letter content of two char arrays I put a "main()" on the code so you can see how it works. You will have to find a way to …

Member Avatar for mprice
0
252
Member Avatar for nehamore

[QUOTE=nehamore;525444]hey thanks for ur help but can u please elaborate on this...what should i add to my code so that it works the way i want it to work?[/QUOTE] It sounds like you are coding UNIX. From the man page for system: [quote] If the return value of system() is …

Member Avatar for jim mcnamara
0
398
Member Avatar for dave_nithis

date -u causes UTC date/time to be displayed - FYI. If you format date like this: today=$(date +%Y%m%d) you get a value like 20080111, this is a number - an integer. When you split the input reformat it: newdate="$cyear$cmonth$cday" then compare integers: if [[ $today -ne $newdate ]] then echo …

Member Avatar for jim mcnamara
0
110
Member Avatar for Joncamp

FWIW - Oracle is as good as it gets on sorting. If the fields being sorted are indexed, you get maximum speed. We sort 200,000,000 records in 10-12 minutes - but that doesn't mean anything - performance is relative to the database schema and the available hardware. Sybase and DB2 …

Member Avatar for debasisdas
0
3K
Member Avatar for sandy_b76

[url]http://www.freebsd.org/cgi/man.cgi?query=sysexits&apropos=0&sektion=0&manpath=FreeBSD+4.3-RELEASE&format=html[/url]

Member Avatar for sandy_b76
0
167
Member Avatar for math_man

What narue meant - flags were set so the compiler put symbol names in the image file. When flags are set NOT to output symbols, then you get assembler.

Member Avatar for thekashyap
0
136
Member Avatar for pichels

Date arithmetic in shell is a pain. This link gives you several good scripts that do date compares and date arithmetic: [url]http://www.unix.com/showthread.php?t=13785[/url]

Member Avatar for dsmall
0
602
Member Avatar for stanats

Consider calling stat() to get the filesize first. Open the file, then move the file pointer forward to some arbitrary place. If you assume no last line is ever longer than say, 200 characters, then fseek() to within 200 character size units of the end of the file. fread in …

Member Avatar for echobase
0
2K
Member Avatar for mnmustafa
Member Avatar for jlb_2_99

Short answer would be to have a while loop controlled by the totalinsert and money variables [code] while( totalinsert < money) { /* ask for money here, add it to total insert */ } /* you get here when you have enough totalinsert */ [/code]

Member Avatar for jim mcnamara
0
144
Member Avatar for bergy_nj

[code] for i in $(cut -f 1,3 -d: /etc/passwd) do echo "${i#*:}" "${i%:*}" done [/code] This lets you see what is going on. [code]${i#*:}[/code] is parameter substitution- returns the value just before the colon - a number that is the user id. [code]${i%:*}[/code] returns the username, so: arr[number] = name …

Member Avatar for ghostdog74
0
122