Win a copy of Spring Boot in Practice this week in the Spring forum!

jing hu

Ranch Hand
+ Follow
since Jun 30, 2009
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by jing hu

Now I have a text file.
The text file have traditional and simplified chinese.
the text file encoding is utf-8.

In Linux, How can i convert all text to simplified text.

If the sulation can be implemented with c++, it will be better.

Thanks for any reply

10 years ago
I am using suse 11.

I have 3 hard disks. 3 SATA. I installed suse 11 in one SATA. the other hard disk is for data storegy.
I find they will change the order in which they recognise my disks when insert a new STAT hard disk . I used "sudo fdisk -l".
The order will be 1:
/dev/sda <---suse 11
/dev/sdb <---data1
/dev/sdc <---data2

NOW, I insert a new hard disk, the order will be

/dev/sda <---suse 11
/dev/sdb <---new hard disk
/dev/sdc <---data1
/dev/sdd <---data2

I don't want the order will change when I insert a new hard disk.
can I set the hard disk recognition order? or the new hard disk will be added the last. like this :

/dev/sda <---suse 11
/dev/sdb <---data1
/dev/sdc <---data2
/dev/sdd <---new hard disk.

Thanks for any reply.
11 years ago
The operation system is suse 11. I just think there should not have so big difference between the two values
11 years ago
for example
I want to watch a process memory info which pid is 5745.
So I typed the command:
top -p 5745
And top show that the process RES is 700m, VIRT is 848m

now I view the /proc/5745/statm, the file content is :
217088 179228 2251 59 0 207252 0

I want to know whether or not the column 2 of file statm is the process 5745 RES. why the two values have so big difference?

Thanks for any reply.
11 years ago
yeah, This is a very smart method. But I need to delete the dir A.
11 years ago
Now I have many Symbolic link files.
for example there are two dirs named A and B. Dir A has many config file,
And Dir B has the sysmbolic link files to the config files in A.

Now I want to rename dir A to C. So the link file in B will be not valid.
In dir B, use command "ls -al", the output will be :

I want to modify all link files in B to link the config files in dir C, and the output will be:

How can I implement this easily?
Thanks very much.
11 years ago
when writing code, I don't know whether or not to write logo info in some place.

For exmaple, should I write "enter f()" in function "f()"?
I don't know which detail degree should be the log info.

Can somebody tell me the the strategy of writting log info.
Some articles about writting log info will be better.

Thanks very much.
11 years ago
Marimuthu Madasamy,Thanks your detail reply.
I have read you code carefully. And I have understood the code.
But I have a question.

the rules which process class is need to process the class A is in a config file. I need to read the rules from a config file.
after loading the rules, In Java I know I can user class.forName("process1") to get a instance to process A.
But My code is based on c++, I can't use class.forName("process1") to create a object just by className in runtime.
the rules which class is need is in the config file.

So I want to know How can i create the wanted class to process A in runtime after loading the config file.

Thanks very much!!!
11 years ago
Now I have a class A.
I need to procee A with different method on the basis of some attributes of A. for example

And I have five method,
A process1(A&)
A process2(A&)
A process3(A&)
A process4(A&)
A process5(A&)

when A attribute key is "a", I need to process A with {process1, process2, process5};
when A attribute key is "b", I need to process A with {process1, process2};
when A attribute key is "e", I need to process A with {process1, process3, process5};
when A attribute key is "f", I need to process A with {process1, process4, process5};

And I have a config file to record these rules.

So I want to know which design pattern is suit my question? I want to write elegant program ^__^

Thanks very much.

11 years ago
Thanks Tim Holloway very much!

I will try you method.
11 years ago
what library can read a .zip file?

if the library is portable, it will be best!

Thanks very much.
11 years ago
When I try to access the SCA component via Web Service. The Axis2/c HTTP server will have a segmentation fault and exit!

I also try SCA Java Component. It will be ok. I can access the sca component via Web Service.

I will read the resource you recommend with reserve.

Thanks very much.
12 years ago
Now I have a simple SCA C++ component named Calculator. I just can access the simple component locally.

I want to define the SCA component binding with web service, so I add the below code in the Calculator.composite.

And then I start the Axis2/C HTTP server, I have set all the environment variables,such as

but when I type the address:http://localhost:9090/axis2/services in the web browser, I find the numbers of service in the axis2 doesn't changed(the port of axis2 is 9090).

So My question is :
1: can the above code define Calculator component with web service?
2: should I need to make a dir named Calculator in the axis2/services directory. if this, the code "<> " has no function.
in the axis2/services directory, I just need a service.xml and .dll or .so file. And I don't need any *.composite or *.componentType file any more.
3. whethr or not the address(http://localhost:9090/axis2/services) can display the sca component services? because I don't find any clue about how to deploy the Calculator component in axis2.

I am a new hand of SCA and Axis2/c. Any comment will be welcome! Thanks very much!
12 years ago
Now I want to process some email automatically.
So I use fetchmail to fetch mail per second. And use procmail to filter some email message.
My procmail configuration procmailrc is like below

I want to call perlout to create a new file test.cpp
the source code perlout is below

I use the command : fetchmail -akv -m "/usr/bin/procmail -d %T" to call fetchmail and call the procmail.
ButI find the perlout won't run out of my expectation.

and the procmail show that *procmail: Error while writing to "/home/max/perlout
so I think the perl script are not called.
I am sure the perlout path is correct.
Any comments will be welcome.
Thanks in advance.
12 years ago