Programming :: Same Program Runs Multiple Times But Get Very Different Results?
Dec 7, 2010
I used wait4 to time a child process. but the results differ each other dramatically. why?my core source code lists as below.to the point: in linux 2.6 kernel, how to time a process with a high precision. and, only its user-time rather than the elapsed time???
static struct rusage ruse;
static pid_t u_pid;
int main(int argc, char *argv[])
{
int i;
code....
View 14 Replies
ADVERTISEMENT
Oct 20, 2010
A bash script that runs a program N times, takes the numbers program produces (each time different) and calculates the average of those numbers.
View 2 Replies
View Related
Aug 3, 2010
I am trying to implement a corba program (client) to retrieve customerinformation from the server. Since the server allow to login once andperform your operations until the lifetime experies, i want the client to use already login connection to perform the retrieve function withoutlogin in to the server for every request.Suppose retrieve has three functions, logon(), perform() and logoff()Pseudo code;Quote:
1. User runs a client application
./retrieve <URI> <customerID>
2. if the client program has already login, donot login, go to 4
[code]....
View 3 Replies
View Related
May 9, 2011
I am having trouble with encryption/ decryption program. The program goes out and finds the file I want it to, encrypts it into a continuing series of a single repeated negative number, then generally decrypts(or should i say re-encrypts)it into a widely repeated character, different but same results every time.
[Code]....
View 3 Replies
View Related
Jul 15, 2011
I'm porting C++ application from ARM to MIPS platform. It works now, but I see some strange timing problems. I've seen now that My app process is called multiply time. Here is "top" output:
Mem: 24592K used, 102084K free, 0K shrd, 0K buff, 16864K cached
CPU: 0% usr 99% sys 0% nice 0% idle 0% io 0% irq 0% softirq
Load average: 4.02 2.17 0.95
PID PPID USER STAT VSZ %MEM %CPU COMMAND
1888 1875 admin R 12096 10% 98% ./my_app.exe
code....
I don't see something like this when I compile it for x86, nor ARM.On MIPS I use uClibc instead of glibc.
View 6 Replies
View Related
Mar 11, 2010
Is it possible to make an AWK script that goes over the file multiple times, every time doing something different to it?
View 19 Replies
View Related
Jun 7, 2010
I'm trying to do a shell script which are suppose to run a program as a specific user at system boot up. The problem is that I don't know for sure how to make the script add the users password to the prompt when it's necessary.
Basically the program would be run like this:
sudo -u extrema program_name -r /srv/program_name -d
and in this example the password is, "hidden".
How would I make this script run this program as user extrema with the password "hidden" at boot-up? I know how to put the script in the rc.X directory and so on, its more the syntax of the code.
View 4 Replies
View Related
Dec 14, 2010
I'm programming some skript to get statistical information about some texts. This includes calculating the mean of word lengths.Unfortunately, Umlauts count as two characters. In the example below the output is 9, it should be 6.
sincercly, Max
Code:
#!/usr/bin/perl
use POSIX;
use locale;
my $test = length("ABC���");
print $test;
View 4 Replies
View Related
Feb 27, 2010
I have a string problem with a function I am writing and I cant figure it out. I am trying to write unit test which will verify it works as expected. As I need to make use of it elsewhere and obviously robust and correct enough that I can rely on it. Okay first of all I define the following structure
Code:
typedef struct strarray {
int size;
char **elements;
} strarray;
code....
My problem is that upon the 4th iteration in the loop realloc fails in strarray_add. glibc reports invalid next size.
View 6 Replies
View Related
Feb 8, 2011
I'm playing around with a bash script to pass files to a program (such as VLC). I thought something like this would work:
vlc $( ls | sed 's/ /\ /g' | tr '
' ' ' )
ls shows the files in the current directory, then sed changes spaces to " " (to escape them) and finally tr removes the line breaks. I end up changing:
01 - Music Track.mp3
02 - Another Track.mp3
to
01 - Music Track.mp3 02 - Another Track.mp3
"vlc 01 - Music Track.mp3 02 - Another Track.mp3" works if I type it manually but my script reports a problem with `-'
It seems it's not escaping the spaces.
View 4 Replies
View Related
Dec 17, 2009
I have 3 c++ files, classdef.h (header file with class definition), methods.cpp (class methods) and program.cpp - the program itself. Both .cpp files have
Code:
#include "classdef.h"
in files. How I can link the files together and compile them in one executable program? I am using Geany IDE for coding.
View 4 Replies
View Related
Jul 19, 2010
when i give service postgresql status command. i get the following.ostmaster (pid xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx) is running...The issue is my postmaster service is running in multiple process ids.As a result my cpu usage becomes high.How to resolve this. my postmaster service need to be run under only one process id
View 3 Replies
View Related
Sep 2, 2010
I have tried multiple times to report a bug, but can't. All I can find is this USELESS guide: [URL]Is this seriously the ONLY way to report a bug? I can't just fill out a form somewhere without running software to do it? When I try to do it the way explained in the guide, it tells me that I'm using a stable version of Xubuntu, and that only people running dev versions (like 11.10) can report bugs.Are they saying that all stable releases are perfect in every way? Surely one must be able to report a bug for them...?
View 5 Replies
View Related
May 1, 2011
Is there a diary program for Linux that runs in the terminal?
View 1 Replies
View Related
Mar 14, 2010
I have a strange effect here, where konqueror is started multiple times. It is no problem to start it from the K-Menu. But konqueror seems to be associated with different actions in applications, e.g. many "help" entries; among others e.g. Inkscape: "Hilfe/Inkscape Handbuch" (~ Help/Inkscape handbook") If I'm unfortunate enough to hit such an item, the konqueror items start flooding my task bar, while the mouse cursor - changed to the konqueror icon - is flickering like wild, while konqueror is starting again and again. None of the windows really open and all icons disappear after some time. (due to some resource overflow, but unfortunately I can't find the relevant log entry this time) How can I prevent this ? (Or debug this, if the cause is unclear)
View 7 Replies
View Related
Oct 12, 2010
[Staff Note: This thread was spun off from here: HOWTO: Purge and Reinstall Grub 2 from the Live CD This solved the Grub problem but the crashes continue.]
Just as I get up and running again my 10.04 (64 bit) either freezes up totally, closes all windows that are open, fails to restart or shut down forcing a restart.
There's no pattern to it, i might be using the gimp or checking thunderbird emails, possibly just surfing or running bluefish. Nothing major and I'm not one to go delving under the bonnet so to speak and start tweaking things. I have the AWN dock installed and run a dual monitor setup.
Everytime it's crashed, the damn thing doesn't reboot, I get the init =bootarg message I've been reading a lot about and once again I have to run the liveCD and spend several minutes farting about purging and reinstalling grub.
I despise Windows, overall I am enjoying my ubuntu experience but things like this stop me getting any work done.
My PC ran fine for the last 2 days then suddenly it's playing up again. It's not an old machine, quad core processor, plenty of RAM.
I am having to back stuff up as soon as I do it due to so many crashes per day. I have reinstalled the OS and started again from scratch 4 times now in the last month.
The last thing I want to do is go back to Windoze but I am seriously running out of patience with ubuntu.
Boot Info Script Results:
Code:
# Boot Info Script 0.55 dated February 15th, 2010
============================= Boot Info Summary: ==============================
=> Grub 2 is installed in the MBR of /dev/sda and looks on the same drive in
partition #1 for /boot/grub.
code....
View 7 Replies
View Related
Jun 26, 2011
I have Ubuntu 11.04 on a disk, and installed it on an empty hard drive. When I start my desktop my screen is black with a flashing "_" in the top left corner... Nothing happens. I usually have to restart the computer multiple times before it will actually work. I tried running Ubuntu in recovery mode and fixing any broken packages, but no luck.
View 1 Replies
View Related
Mar 13, 2011
how can I rotate logfiles multiple times a day? I notice that the configuration for the logrotate-command is hourly, daily, weekly,.I notice that I can create a cron job where I specify the different times the log rotation need to be done:15 0,8,12,17 * * *But how do I combine these two ?
View 7 Replies
View Related
Jul 12, 2010
My 5.5 server has crashed on my multiple times over the past few weeks. I have 2 terabyte drives mirrored.It automatically reboots and seems to run fine after rebooting.I've attached a copy of the /var/log/message to this post.I was unable to paste file.I'm not if a bad disk is causing the problem or not.
View 4 Replies
View Related
Sep 2, 2011
I am having a problem with a simple program I wrote in Fortran (gfortran). This program basically reads a long list of numbers and makes some operations with them. Double precision is used in the variables and functions, and AFAIK everything is in order with the program. The thing is that I accidentally noticed that said program yields different results, and I am talking about integers being different, something noticeable. Apparently the offending chunk of code might be:
Code:
DOUBLE PRECISION FUNCTION tamano (x1,y1,z1)
DOUBLE PRECISION x1,y1,z1
tamano=dsqrt((x1)**2+(y1)**2+(z1)**2)
[code]....
One of the involved machines has F15 x86_64 and the other one F15 i686. My first guess is that this has something to do with how Fortran handles precision (which I supposed was the same for 32 and 64 bits). To compile the program I use:
Code:
gfortran --free-form -fno-whole-file program.f90
Is there another option I should pass the compiler to make sure the same precision is used in both cases? Or what can I do here?
View 3 Replies
View Related
Oct 3, 2010
I have experienced amarok crash after which i am not able to bring it back to working state. I tried to reinstall it multiple times from standart playground and kde KDE:UpdatedApps repositories. Every time. i start amarok it hangs on splash screen consuming 49% of CPU with no signs to load completely. I guess i need to clean reinstall with deleting all tracing info form previous install?
here's output from console:
Code:
InnoDB: The log sequence number in ibdata files does not match
InnoDB: the log sequence number in the ib_logfiles!
101003 11:21:54 InnoDB: Database was not shut down normally!
InnoDB: Starting crash recovery.
InnoDB: Reading tablespace information from the .ibd files...
InnoDB: Restoring possible half-written data pages from the doublewrite
[Code]...
View 6 Replies
View Related
Oct 15, 2010
I've reinstalled Grub2 multiple times before, but Ubuntu was on /dev/sda1, now it is not. Here is my partition table:
/dev/sda1 - 105GB - Windows
/dev/sda2 - 200GB - Extended
/dev/sda5 - 110GB - Media
[code]....
View 4 Replies
View Related
May 2, 2011
On Ubuntu 10.04 I would like to setup udev to execute a backup script when a specific USB drive is inserted. Udev detects the USB drive, but my script is executed 7 times instead of just once. Can't figure out what's wrong.
My udev rules file:
Code:
/etc/udev/rules.d# cat 20-stick.rules
ACTION=="add", ATTRS{vendor}=="Kingston", ATTRS{model}=="DataTraveler G2 ", RUN="/usr/local/bin/sync.sh"
Dummy backup script: connecting USB drive results in 7 times date written to /tmp/test
code....
View 2 Replies
View Related
May 18, 2011
I am running 11.04 with the Unity environment from a USB stick. With "Ubuntu Classic", I can open up my Home folder multiple times and thus copy files from one location to another with drag and drop. In Unity, it seems I can only open up one occurrence of the Home folder. Does anyone know if multiple Home folders can be opened up?
View 1 Replies
View Related
Aug 19, 2010
I just don't get it? I've attempted multiple times to get the knetworkmanager to connect to an unencrypted network, yet it keeps asking for a wep key. However the networkmanager in the Gnome version connects to unencrypted networks just fine. Why won't knetwork manager do the same?
View 9 Replies
View Related
Nov 9, 2010
It's been awhile since I've been on here. I suppose that can be considered a good thing, since I made the completely transfer to Ubuntu three months ago and everything's been running completely smoothly. Anyway, security is a pretty big thing to me. I usually change the root password, take sudo off (and default gksu, not gksudo), encrypt my hard drives, etc... One thing I also do is create a separate password for my login keyring. I don't mind having to enter one extra password at login, but it started prompting two times, and now three. It's the same password every time, so my question is..
View 4 Replies
View Related
Mar 23, 2011
I have the follwoing fenomenan. In my /etc/fstab I have an entry to automatically mount my NAS. Here is my entry:
192.168.1.10:/mnt/array1/My_NAS /media/My�40NAS nfs _netdev,
auto,rw,hard,users,intr 0 0
When my laptop boots it successfully mounts the NFS NAS and I get an icon "My NAS" on my dekstop that points to the NAS. If I double click on the icon it opens my file browser and I can browse thru my NAS fodlers.
What I see on the left hand side of the file browser is that I have to entries for My NAS. One of it has a button to shows that it is mounted and the other does not.
If I go to Places I also see 2 entries for "My NAS". One of it takes me to browsing the NAS and if I click on the other it says "Unable to mount ... busy or already mounted". Which makes sense.
View 4 Replies
View Related
Jul 27, 2011
what program runs the Session lock and the screen saver for gnome and KDE on centos 5.5. But most importantly id like to know what the config file for the screensaver/session lock is called and where its most likely located.
View 4 Replies
View Related
Apr 10, 2010
I'm using ubuntu 8.04, and when I load some things, like some games, it tells me I need flash player 10. I have downloaded it multiple times and installed it multiple times but nothing is working as it should. Is it because I'm still on 8.04?
View 5 Replies
View Related
Feb 28, 2011
Evolution downloads the same email message multiple times from Hotmail
How can I fix this?
View 2 Replies
View Related