linux

Trying to make SDL widget in QT4 using SDL_WINDOWID, but can't get widget to show

Hi all! I'm trying to create an SDL drawing canvas inside of a simple QT4 window, following the information provided in the SDL wiki and in another question on this site. The project is an NES emulator using QT and SDL that a friend and I decided we wanted to try creating. Currently, I have a main_window class that will contain the SDL...

How to improve performance of file reading by multiple threads?

I need to read a single file using multiple threads under Linux. There are reading operations only and no need of writing. The file reading don't need read the whole file every time. It need read one or more portions of a file every time. I store the offset of each portion beforehand. The file is too large to put into main memory. So ...

How to combine cdt,pdt, dltk in eclipse in linux?

1. Okay this is probably lame question, but I haven't found good result searching the web. I want to combine cdt,pdt,dltk in eclipse. I dont plan to code java though,lol.But because eclipse primarily act as java IDE at the 1st place, java capabilities is just a bonus for me. Now,What to download? Do you know any good guide to do this?...

Whereto put "plugins" in linux

I am currently developing/hacking an image analyzing/transforming tool. The filters therein will be loaded at runtime using dlopen&co. My question is where do *nix tools usually put plugins (*.so files) when installed? bin/program lib/program/plugins/thisandthat.so maybe? Secondly how do I use it and where do I put it during develop...

Recently, I need a memory-file swapping algorithm

My boss asked me to find some algorithms or existed libraries. coz our application runs on linux, and it need lots of files, maybe over 5G-20G....but we dont need to load the files at one time, but at anytime when the file is needed. btw, we have maybe over 100-1000 files stored in our drive. However, this application is kinda realtime,...

Commons VFS and Java.net.URL - Adding support for "sftp://" protocol

We're trying to use Apache Commons VFS to access something over SFTP. It claims to support SFTP, however we're getting a MalformedURLException when it starts. Digging around I see that apache vfs is using java.net.URL. However the documentation tells me that it doesn't actually support sftp:// URLs. Protocol handlers for the followin...

Euronext - Market Message Transfer Protocol (MMTP) / Linux

Has somebody mmtp libraries / code snippets used under Linux enviroment ? ...

Hardware recognition in user space Linux

I want to be able to inspect my Linux machine hardware in C. How do I get the information that appear in dmesg in C ? For example, for keyboard the message is input: AT Translated Set 2 keyboard as /devices/platform/i8042/serio0/input/input0 I want to get in my program the label, AT Translated Set 2, and the path, /devices/platform/i8042...

If we could rewrite ALSA from scratch, what would it look like?

Many people agree that ALSA is probably the biggest weakness of the GNU/Linux operating system. ALSA is massive, poorly understood, and badly documented. Some design decisions that it took early on also proved to be fatal. The reason is simple: historically, soundcards didn't behave predictably (in fact, some of them included hardware mi...

Synchronize shell script execution

A modified version of a shell script converts an audio file from FLAC to MP3 format. The computer has a quad-core CPU. The script is run using: ./flac2mp3.sh $(find flac -type f) This converts the FLAC files in the flac directory (no spaces in file names) to MP3 files in the mp3 directory (at the same level as flac). If the destinatio...

Cron API: is there such a thing?

Is there such a thing as a Cron API? I mean, is there a programmatic way of adding/removing Cron jobs without stepping onto Cron's toes? ...

Monitoring/Resumption for Complex Task Graph for Batch Processing

I have a set of batch-processing tasks that need to be run in an automated way on a weekly basis. The weekly basis part isn't hard: I'm using cron to kick things off. The tasks are basically anything that can be initiated with a shell script. The tricky part is that my tasks have a non-trivial dependency graph (B depends A, C depends ...

Best way to interface between Windows dev platform and Linux test platform?

Hi, my project is a PHP web application. This applies to my test server (local), not production server! I am also the solo developer on this project (however, that may change in the very far future). Also, all my source code is committed to a repository and the production server gets the source code from the repository. I do my develo...

Java memory mystery (do I have a leak)?

I have a standalone Java problem running in a linux server. I started the jvm with -Xmx256m. I attached a JMX monitor and can see that the heap never really passes 256Mb. However, on my linux system when I run the top command I can see that: 1) First of all, the RES memory usage of this process is around 350Mb. Why? I suppose this is be...

Linux Process States

In Linux, what happens to the state of a process when it needs to read blocks from a disk? Is it blocked? If so, how is another process chosen to execute? ...

Merge results from uniq -c

I have many files with results of command: uniq -c some_file > some_file.out For example: 1.out: 1 a 2 b 4 c 2.out 2 b 8 c I would like to merge these results, so I get: 1 a 4 b 12 c I thought that sort or uniq could handle it but I don't see any option related to it. Writing some ruby/perl script is one of way to go...

Identifying I-Frame in a video container

Hi, i'm developing a video server in C on GNU/Linux, and i'm using ffmpeg to manage data of each video file. So, i open the file, get all the information about its container, then do the same with its codec and start reading frames one by one. Unfortunately, ffmpeg and more precisely avcodec is not very well documented. I need to know w...

Dbus: is there such a thing as a "Dbus sniffer" ?

Is there such a thing as a "Dbus sniffer" ? I would like to "sniff" all (or part) of the messages transiting on Dbus. ...

Trying to locate a leak! What does anon mean for pmap?

I'm trying to locate where my memory has gone for a java process running in linux. Someone suggested I use pmap -x to see exactly what the memory is doing. The output is really long but basically a good portion of it is a repeat of this: 00007fbf75f6a000 1016 - - - rwx-- [ anon ] 00007fbf76068000 12 ...

How do I play a sound in Octave?

Octave appears to assume that a specific sound playing utility will be available on a system but doesn't seem to provide the ability to specify an alternate. In the error below, Octave is looking for ofsndplay, which is not a utility available on all systems. octave:38> sound(beamformed_20) sh: ofsndplay: command not found I...