linux

If 256 threads give better performance than 8 have I likely got the wrong approach?

I've just started programming with POSIX threads on dual-core x86_64 Linux system. It seems that 256 threads is about the optimum for performance with the way I've done it. I'm wondering how this could be? And if it could mean that my approach is wrong and a better approach would require far fewer threads and be just as fast or faster? ...

How to make program the default "handler" of a certain protocol?

I have a program that I would like to be launched whenever a url with the protocol "sample://" is clicked/launched. For example, a user clicks on a link in IE/Firefox with the following href: sample://test.txt. My program should then be invoked with the url as an argument. I would like a solution for Windows and linux if possible, though...

Saving V4L2 video camera output

What video format would be the easiest when saving the output of a camera using V4L2 if I capture it in bitmap format? Getting mpeg directly could be, of course, nice, but I can't unfortunately count on that. I have managed to capture the frames, now I need to somehow view the video. Can I simply convert those frames using some Linux t...

Linux-alternative to Fiddler2

I have used Fiddler2 with great results on windows before, but now I have moved to using linux for development. The problem I have, is that I have not been able to find a decent replacement for Fiddler2 that will run on linux. I have tried Wireshark, but it is perhaps too generic in what it does, and I can never really make any sense of...

Linux: multiple-SIGIO problem (async serial communication)

Hi all. I'm esperiencing a SIGIO-related problem in a C++ program I'm working on. Platform: Linux 2.6.30, x86 Arch Scenario: async serial communication. I followed this async-communication example from the Linux Serial Programming HowTo and it worked flawlessy. Then I removed the "sleep+check wait_flag" thing and now I handle the r...

is there a web agent that can click and extract text from flash apps ?

is there a program for linux or some librayr package that can click and extract text from flash apps ? ...

Regarding threads in Linux

How many threads a single process can handle in Linux(RHEL-5)? Once threads are created how much stack an each thread can get ? ...

Migration from MSXML to Xerces

I am planning to port my application from Windows to Linux, currently my application uses MSXML for XML parsing. I have decided to use Xerces XML parser to provide a cross platform solution. My code size is too big and I do not want to touch all the internal part of the code for this porting purpose as it might break some of the function...

BadAlloc and crash in wxWidgets program. How to find the error?

Hello, We have a fairly large cross-platform C++ program running on wxWidgets. Recently a big chunk of code was ported over from windows to linux, and since then the program crashes upon the display of a pop-up dialog. The error message printed to the console is: The program 'program name' received an X Window System error. This probab...

rpmbuild spec file ignore file that does not exist

Is it possible to tell an rpmbuild spec file to ignore a file in the files list if it doesn't exist? Something like: %files %{existingfile} if [ -f %{dtdfile} ]; then %{dtdfile} fi ...

Getting pid and details for topmost window

Does anyone know how to get the PID of the top active window and then how to get the properties of the window using the PID? I mean properties like process name, program name, etc. I'm using Qt under Linux (Ubuntu 9.10). ...

How would you do a search from the unix shell with both constraints on the filename and the file content?

Can find perform full-text search? How would you do a search with both some constraints on the filename and the file content? ...

How to install a Linux application in cases when parallel startup scripts running is enabled or disabled?

Hi! We develop a Linux application to work on different RedHat/SUSE distributions. This application (namely, daemon) is expected to be automatically run at startup so we place our startup script in /etc/init.d/ directory and create symlinks in runlevel directories (../rc.d/rc5.d/, for instance). If a user removes our application, our u...

IOException: Too many open files

I'm trying to debug a file descriptor leak in a Java webapp running in Jetty 7.0.1 on Linux. The app had been happily running for a month or so when requests started to fail due to too many open files, and Jetty had to be restarted. java.io.IOException: Cannot run program [external program]: java.io.IOException: error=24, Too many open...

learning linux drivers

Hello all I am learning now days programming drivers. I am doing my learning from this book Linux Device Drivers But I am little bit lack of practice. Can you recommend me some simple projects that I can get started with. Or some open source project that newbie can understand what is going on. Additional examples and tutorials w...

How can I get the filesystem page size from unix/linux/osx and windows?

I want to be able to determine at runtime what the sector size is for a give filesystem. C code is acceptable. for example I format my Data partitions with a 32k sector size that have lots of large video files. I want to be able to get this value at runtime. ...

Mono(non-Windows) Report Writing?

Hello, we are making an application to run on both Mono and .Net. The application is web based, so it uses ASP.Net. We are now trying to find some kind of reporting software. We would prefer if there was a designer that end users(non-programmers) would be able to use like Crystal Reports. Currently, we are not finding anything that lo...

compiling various header files in c using autotools in arch linux

i would like to know how can i compile a number of header files by just one command using autotools in arch linux ...

Script in udev rule doesn't run

I'm running Ubuntu 9.10 (Karmic Koala) on a laptop and would like NumLock to automatically toggle depending on whether my USB keyboard is plugged in (numlock on) or unplugged (numlock off). To accomplish this, I first installed the "numlockx" package. numlockx on and numlockx off works fine. To hook into the device system, I thought I'...

Profile a C shared library called by Ruby program

I have a program written in Ruby and C. The C portion is a shared library, which is an extension for the Ruby program. I want to profile the C shared library I wrote, using gprof. I compile the shared library like this: gcc -I. -I/usr/lib/ruby/1.8/i486-linux -I/usr/lib/ruby/1.8/i486-linux -I. -D_FILE_OFFSET_BITS=64 -fPIC -fno-strict-al...