If you work with mono and use Process.ProcessName you may get wrong results on some computers. For example instead of the process name “kwrite” you may get “kdeinit4” (seen on SUSE). On Ubuntu I have even seen complete bullshit like “kdeinit4;5535948c (deleted)” instead of …
Tag: linux
Executable file didn’t work correctly [Linux]
I write a program on Qt C++ GUI, that from given user input generates three .cpp files with proper syntax (C++). When I start my program from Qt Creator directly or run it from console like a script its creates the files in executable directory correctly: When I double click executable file, the program start…
Permission denied in Linux when accessing a file I created using the same app
I’m working on a program that needs to store some information and I’ve decided to use a simple file for it. When the program starts it executes the following code, which should result in a file opened in append mode if it exists, or created if it doesn’t (The first time the program loads it …
How to interact between webpage and an actual program
What I have: A program (c++) on a server (linux) The program can be executed with command line parameters The program finishes after a while and produces continously output (“log.txt”) What I want: My idea is to have some kind of user interaction with that program: The user opens a website which s…
write/read contents from a file in Linux FS using java script
I have installed node.js and running a project(with all js files) on Apache Knox. I need to save some data to a file(HOME/Job_State.txt) in Linux FS and read its contents when needed to do some checksums. Iam new to js and looking for example code that does this. Kindly help me by providing some suggestions/p…
Auto Update SVN after Commit and Export it to zip
Me and my friends are developing android Custom ROMS, the problem is we immediately update when there is something need to update. i use google code trunk to upload our custom roms for now and i need to zip it and upload it, is there is a way for a better proccess that our server automatically svn update when…
Make a variable containing all digits from the stdout of the command run directly before it
I am trying to make a bash shell script that launches some jobs on a queuing system. After a job is launched, the launch command prints the job-id to the stdout, which I would like to ‘trap’ and then use in the next command. The job-id digits are the only digits in the stdout message. and then I w…
Unable to get the accurate value of shell variable set inside a pipe
I am trying to set a variable, based on the execution result of a MySQL statement like this: As you can see, due to pipe I am unable to get the value of the variable outside the loop (as the variable inside pipe, is basically set forking a different process) Is there any way i can extract the actual value
How to get the lines in one file which contain a string(with repetition) in another file?
File 1: File 2: My desired output: I am trying to implement this using bash or Python. In python I tried: In bash I tried: But this does not consider repetitions. It will give the output Any ideas? Answer Here’s one way you could do it using awk: Read the key-value pairs from the second file into the ar…
C: finding longest line
I am trying to run this example from (dennis ritchie book), however it does not find the longest line, any idea? main.c other.c other.h Using debugger: looks like i in copyL function does not increment… any ideas why? FIX: Answer I think you incorrectly transcribed the code. This line: is probably incor…