Search Results

Showing results 1 to 36 of 36
Search took 0.01 seconds.
Search: Posts Made By: lehe
Forum: C++ Aug 11th, 2009
Replies: 0
Views: 239
Posted By lehe
Hi,
Here are my two questions:

1. I am now learning to manage my code with CVS, and I just want to make a repository for my C++ files, Makefile and bash and python scripts only, not the object...
Forum: Shell Scripting Jul 29th, 2009
Replies: 3
Views: 495
Posted By lehe
same machine. I submitted my jobs background one after the other so that they can run in parallel. All the jobs running the same executable with different commandline argument.
Forum: Shell Scripting Jul 28th, 2009
Replies: 3
Views: 495
Posted By lehe
Hi,
I call "set -o notify" to notify me when my background jobs finish. I find that the messages upon finishing are different: for some job, it starts sometimes with "[jobID]", sometimes with...
Forum: Shell Scripting Apr 10th, 2009
Replies: 1
Views: 939
Posted By lehe
More info:
The reason why I don't use "$@" is that the arguments to the bash script is not completely those for the executable. Some of them are just arguments only to the bash script. So actually...
Forum: Shell Scripting Apr 9th, 2009
Replies: 1
Views: 939
Posted By lehe
Hi,
I'd like to pass arguments with space inside to a bash script and further into an executable called inside the script. My bash script looks like:

#!/bin/bash
ARG_OPTS=""
while [[ -n "$1"...
Forum: Shell Scripting Apr 2nd, 2009
Replies: 2
Views: 783
Posted By lehe
Hi,
Here is my code,

ids=(1 5 10 15 20 25 30 35 40 45 50 55 60 65 70 75 80 90 100 110 120)
for ((i=0;i<${#ids};i++)); do
awk '{ print ${ids[${i}]}" "$1; }' > ${TMP} <...
Forum: C++ Mar 31st, 2009
Replies: 2
Views: 549
Posted By lehe
Hi,
I was wondering:
if the memory allocation in the following codes is static or dynamic,
why the upper limits on their sizes are different,
why some of them would cause segment fault?
what ...
Forum: C++ Mar 27th, 2009
Replies: 3
Views: 624
Posted By lehe
I perhaps have to resort to multiple thread programming to reduce computational time. I am now studying how to use POSIX library.
I can access a cluster with 8 CPUs, each of which has one core. I...
Forum: C++ Mar 20th, 2009
Replies: 1
Views: 409
Posted By lehe
Hi,
I am using copy_n from GNU C++ Library under Ubuntu 8.10. My code is like this:

#include <ext/algorithm>
using namespace std;

void myfun(char * flags ) {
char * flags_new = new...
Forum: C++ Mar 13th, 2009
Replies: 2
Views: 523
Posted By lehe
Hi,
I am goint to create a very large array but have this error when running this code

#include <iostream>
#include <limits.h>
#include <cstddef>
#include <cmath>
using namespace std;

int...
Forum: Shell Scripting Mar 9th, 2009
Replies: 3
Views: 1,021
Posted By lehe
Hi Mike,
Removing "exec" works! Thanks a lot! Sorry for a little late, for I can come back to my office only on working days to have a try.
It seems that log out twice doesn't happen to me? I...
Forum: Shell Scripting Mar 6th, 2009
Replies: 3
Views: 1,021
Posted By lehe
Hi,
These days I have to install a higher version of bash under my $HOME on my office server. I hope to make the new bash automatically run both when I ssh to my server and when I boot into my...
Forum: C++ Mar 2nd, 2009
Replies: 0
Views: 362
Posted By lehe
Hi,
How to get declaration in C mode with tags in Emacs. I only know how to get definition of self defined functions. But how to jump to their declarations and also how to get the declarations of...
Forum: Shell Scripting Feb 26th, 2009
Replies: 0
Views: 352
Posted By lehe
Hi,
I am beginning to use bashdb to debug my shell script. Here are my questions:
1. With "bash --debugger ./myscript.sh" it will run to finish without stop, while with "bashdb ./myscript.sh" would...
Forum: Shell Scripting Feb 26th, 2009
Replies: 2
Views: 373
Posted By lehe
Forum: Shell Scripting Feb 26th, 2009
Replies: 2
Views: 373
Posted By lehe
Hi,
I am trying to debug my shell script by bashdb. My script take as argument "--gdb", so I wrote

However, this way it will produce error that bashdb:


If I quote --gdb as

then I will...
Forum: Python Feb 20th, 2009
Replies: 2
Views: 624
Posted By lehe
Hi,
I was wondering how to debug python script without adding pdb module to the script file. Say, I have a script test.py without adding "import pdb" and "pdb.set_trace()". Can I debug it in Python...
Forum: C++ Jan 29th, 2009
Replies: 5
Views: 349
Posted By lehe
Please comment if you have some. Any help is appreciated.
Forum: C++ Jan 28th, 2009
Replies: 5
Views: 349
Posted By lehe
The Makefile is something like:

LDFLAGS=-static -lm -ljpeg -lpng -lz
OPTIMIZE_FLAG = -ggdb3 -DDEBUG
CXXFLAGS = -Wall $(OPTIMIZE_FLAG)
absurdity: xxx.o
$(CXX) $(CXXFLAGS) -o $@ $^ $(LDFLAGS)...
Forum: C++ Jan 28th, 2009
Replies: 5
Views: 349
Posted By lehe
What does "inlined code" mean?
The snippet of code is in main function and does not have anything specified as "inline".
Forum: C++ Jan 28th, 2009
Replies: 5
Views: 349
Posted By lehe
In the following code:

for(int i = 0; i < argc; i++)
cout << (i > 0 ? " " : "") << argv << (i < argc - 1 ? " \\" : "")
<< endl;

I try to use "next" to step over, but always...
Forum: C++ Jan 27th, 2009
Replies: 1
Views: 248
Posted By lehe
Hi,
I am new to using C and C++ libraries. So my questions might seem to be naive.

1. When installed, will the source files ( .c or .cpp) of a library be placed into some system directory like...
Forum: Shell Scripting Jan 24th, 2009
Replies: 1
Views: 559
Posted By lehe
Hi, I am now trying to install a C library zlib to be /usr/local/include/zlib, /usr/local/lib/zlib and /usr/local/share/man. Here is the relevent part in the configure file of the library:


...
Forum: Shell Scripting Jan 19th, 2009
Replies: 3
Views: 639
Posted By lehe
I think it is not a newline. Here goes the context:

if [[ -d ${RESULT_DIR} ]]; then
echo "Directory ${RESULT_DIR} already exists."
exit 1
fi

...
Forum: Shell Scripting Jan 19th, 2009
Replies: 3
Views: 639
Posted By lehe
Hi,
I read something like "\mkdir ${RESULT_DIR}". Just curious about why "\" is added before the command? Thanks for help!
Forum: Shell Scripting Jan 16th, 2009
Replies: 4
Views: 1,022
Posted By lehe
Thanks! Now I understand \1 and \(some match inside\).
But still, what doest "^[^=]*" mean? Why there are two ^s?
In the reply, what does"Erase any thing from the beginning of a line to the = sign...
Forum: Shell Scripting Jan 16th, 2009
Replies: 4
Views: 1,022
Posted By lehe
Hi,
I am reading a command in shell script using sed:
echo $1 | sed -e "s/^[^=]*=\(.*\)$/\1/"

what I don't understand is the sed command. I only know it tries to substitute "^[^=]*=\(.*\)$/"...
Forum: C Dec 19th, 2008
Replies: 5
Views: 913
Posted By lehe
can any function, for example printf, restart from beginning of the same line? So we will not have multiple lines of output
Another question, any way to retrieve the previous ouput that have been...
Forum: C Dec 5th, 2008
Replies: 1
Views: 509
Posted By lehe
Hi,
I am sorting an double array, using qsort()

#include<stdio.h>
#include<stdlib.h>
...
int compar( const void *arg1, const void *arg2 )
{
return ( * ( double **) arg1 >= * (double** )...
Forum: C Nov 20th, 2008
Replies: 2
Views: 1,162
Posted By lehe
Forum: C Nov 20th, 2008
Replies: 2
Views: 1,162
Posted By lehe
Hi,
I have an array. I put its definition in a .c file and externally delare it in a .h file like this:
//.c file
unsigned char jetmap[][]={
{0, 207, 255},
{0, 223, 255},
...
Forum: C Nov 20th, 2008
Replies: 6
Views: 981
Posted By lehe
Forum: C Nov 20th, 2008
Replies: 6
Views: 981
Posted By lehe
Hi,Thanks!
I still have the same questions:
Since an unsigned char can hold a value as large as 255, why bother to use integer as intermediate?
Is there something else wrong? Is it correct to use...
Forum: C Nov 19th, 2008
Replies: 6
Views: 981
Posted By lehe
Thanks.

In fact I just made up the "test.txt" file. In my real case, I have to read in data ( each is an integer and ranges from 0 to 255) from a file into an unsigned char array that are...
Forum: C Nov 19th, 2008
Replies: 6
Views: 981
Posted By lehe
Hi,
I got this message "Windows has triggered a breakpoint in inout.exe. This may be due to a corruption of the heap, and indicates a bug in inout.exe or any of the DLLs it has loaded. The output...
Forum: C Jul 25th, 2008
Replies: 2
Views: 1,122
Posted By lehe
Hi,
When using "..printf Functions" with Conversion specifier type "%g", it gives different results under different environment. For example, "sprintf(string,"%g",1e-6);" gives "1e-006" in Windows...
Showing results 1 to 36 of 36

 


About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC