Search Results

Search: Posts Made By: odys
Forum: Programming 03-06-2011
4,802
Posted By odys
This code does not look like Tcl. It looks more...
This code does not look like Tcl. It looks more like Perl to me.
Anyway, the operation shift removes first entry from array, something like:
A[1]=A[2]; A[2]=A[3]; ...
so the code indeed can...
Forum: Programming 03-06-2011
1,228
Posted By odys
I would suggest to have array of integers to...
I would suggest to have array of integers to permute. It can be initialized with A[i]=i
so no need to sort strings.
Then use permuted indexes to access strings.
Forum: Programming 03-06-2011
2,816
Posted By odys
Simple reason for SEGV on delete can be ptr is...
Simple reason for SEGV on delete can be ptr is not obtained with 'new' -- like automatic array.
Or you should have delete[] instead?

Otherwise, what is the type of 'ptr'? If it's pointer to...
Forum: Linux 02-14-2009
3,138
Posted By odys
If you know/suspect place where fonts appear...
If you know/suspect place where fonts appear then script should do
rm -rf /some/directory
If not, then use find for locating them: find -name '*ttf' -exec rm {} \;
1,651
Posted By odys
Try to split second argument (with respect to '_'...
Try to split second argument (with respect to '_' or space)
and grep their occurence within arg1 individually.
The answer can depend on how many splitted words occured in input
(e.g. 50%).
2,657
Posted By odys
I have no experience in using 'screen' for...
I have no experience in using 'screen' for logging but you may consider 'script' for that.
Forum: Programming 02-14-2009
1,928
Posted By odys
At detail level diagram of the flow can be used....
At detail level diagram of the flow can be used. But since C is so widely known, C notation is probably better for this.

At broader level you can consider pseudocode.

For bigger programs you...
Forum: Programming 02-14-2009
4,661
Posted By odys
Try functions like 'mbtowc' that are C99...
Try functions like 'mbtowc' that are C99 conformant or 'iconv' (POSIX).
Former need correct setting of LC_CTYPE, latter also needs to specify conversion details.

In my case, when I obtained...
4,924
Posted By odys
Hi, you need to set SO_BROADCAST option for the...
Hi, you need to set SO_BROADCAST option for the socket with 'setsockopt' function.
And you need suitable server to respond...
Forum: Programming 11-04-2008
14,063
Posted By odys
Hello, My suggestions: 1. sysconf() and...
Hello,

My suggestions:
1. sysconf() and _SC_PHYS_PAGES, not quite what you want and may be nonportable
2. /usr/bin/free or /proc/meminfo or equivalent to cut total memory from. I think you can...
Forum: Programming 03-25-2008
4,433
Posted By odys
I think you can use argv[] for specifying...
I think you can use argv[] for specifying arguments and it can be read by 'ps' and equivalent methods.

If you really need to use ENV then the program can copy suitable information to argv[1]...
Forum: Programming 03-25-2008
1,868
Posted By odys
I would suggest starting with simplified...
I would suggest starting with simplified code/data for
keeping text in memory. Maybe fixed array (requiring plenty of copying when inserting/deleting characters) or linked list
of buffers with...
Forum: Programming 03-19-2008
4,914
Posted By odys
Hi, My suggestion: check for ECONREFUSED...
Hi,

My suggestion: check for ECONREFUSED error in client.
I think the old connections can affect newly relaunched server
and maybe they overflow listen specified queue length.
Forum: Programming 03-18-2008
4,914
Posted By odys
Dont you need a loop with read() after accept()?
Dont you need a loop with read() after accept()?
Forum: Programming 03-18-2008
6,000
Posted By odys
I am using Slackware Linux 10.2 / glibc 2.3.5 (PC...
I am using Slackware Linux 10.2 / glibc 2.3.5 (PC machine).

From the 'info' documentation:

>`FTW_PHYS'
>While traversing the directory symbolic links are not
...
Forum: Programming 03-18-2008
6,000
Posted By odys
ftw/nftw -- filesystem tree walk
Hi,

I recently experimented with ftw() and nftw(). These are function for calling some function for every
file in a subtree.
I need to get full information about type of file.
Almost everything...
Forum: Programming 03-17-2008
3,733
Posted By odys
Maybe you are doing pop() on empty stack?
Maybe you are doing pop() on empty stack?
Forum: Programming 03-17-2008
2,834
Posted By odys
I dont know the details of your task but I would...
I dont know the details of your task but I would definitely
use an .txt format instead of XML for research stage.

If you are using Perl or another dynamic language, and if your rules need to be...
Forum: Programming 03-17-2008
7,224
Posted By odys
Maybe you have duplicate global variables defined...
Maybe you have duplicate global variables defined in header file (e.g. "a.h"). Make sure the all global are declared with "extern" keyword.
Forum: Programming 03-17-2008
8,619
Posted By odys
Hello, I think you need to replace [in...
Hello,

I think you need to replace [in Player::Player()]:
pname = "\0";
to something like this:
pname[0]='\0';
etc.

Miroslaw
Forum: Programming 03-17-2008
3,799
Posted By odys
Right, fflush().
Right, fflush().
Forum: Programming 03-17-2008
13,647
Posted By odys
Yes, 'readdir' in 2nd chapter of man pages.
Yes, 'readdir' in 2nd chapter of man pages.
Forum: Programming 03-17-2008
4
3,717
Posted By odys
Hello, I can agree with Jim. I used...
Hello,

I can agree with Jim.

I used Common Lisp and other dialects, did some projects.
If you need sockets, regexps and other 'modern' stuff you need to choose suitable implementation. I...
Forum: Programming 03-17-2008
13,647
Posted By odys
struct dirent variances
Hello,

Recently I need to create a filesystem related code.
I noticed lot of inconsistent documentation regarding
struct dirent:

1. 'd_namlen' field
info libc in chapter ''File System...
Forum: Programming 03-07-2008
3,799
Posted By odys
Hi, You are right, this is due to buffering....
Hi,

You are right, this is due to buffering.
Add flush(stdout) before fork() to see the same results.

Also consider parent PID is 1.
Add sleep(1) before 'return' to see the true PPID.
...
Showing results 1 to 25 of 62

 
All times are GMT -4. The time now is 04:12 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy