I need to get similar information on the current windows and virtual desktops as that provided by the command-line app wmctrl. I s there some (C/C++) API header & lib-files that I can use? Answer Download the source code of wmctrl and study it. If you are making some free software with the same or compatible GPLv2 license you could
LAMP error: session_start() failed: No space left on device (28), but
Ubuntu server 10.04, Apache 2.2.14, PHP 5.3.2, MySQL. For the drive where session files are stored: df -h: df -ih: Any ideas? Answer Finally remembered to answer with the solution! Turns out there were too many files in one directory. Had to start hashing the session files into subdirectories.
Getting cpu cycles using RDTSC – why does the value of RDTSC always increase?
I want to get the CPU cycles at a specific point. I use this function at that point: (editor’s note: “=A” is wrong for x86-64; it picks either RDX or RAX. Only in 32-bit mode will it pick the EDX:EAX output you want. See How to get the CPU cycle count in x86_64 from C++?.) The problem is that it
split for words separated with semicolon
I have some string like 1;2;3;4;5 I want to be able to iterate over this string taking each word one by one. For the first iteration to take 1 the next to take 2 and the last 5. I want to have something like this but I do not know how to fill the myvar Answer
How do I get my CUDA specs on a Linux machine?
I’m accessing a remote machine that has a good nVidia card for CUDA computing, but I can’t find a way to know which card it uses and what are the CUDA specs (version, etc.). I used the “lspci” command on the terminal, but there is no sign of a nvidia card. I’m pretty sure it has a nVidia card, and
What is the difference between NPTL and POSIX threads?
What is the basic difference between NPTL and POSIX threads? How have these two evolved? Answer POSIX threads (pthread) is not an implementation, it is a API specification (a standard, on paper, in english) of several functions whose name starts with pthread_ and which are defined in <pthread.h> header. POSIX is also a set of specifications. NPTL is now inside
wget: downloaded file name
I’m writing a script for Bash and I need to get the name of the downloaded file using wget and put the name into $string. For example, if I downloading this file below, I want to put its name, mxKL17DdgUhcr.jpg, to $string. Answer Use the basename command to extract the filename from the URL. For example:
Permanently Change Disassembly Flavor in GDB
How can I permanently change the disassembly flavor in GDB. I tried:set disassembly-flavor intel in GDB, but when I fire up GDB later it still has the att flavor. Answer gdb executes a ~/.gdbinit file when it starts, if present; you should be able to add the line to it.
questions about implementing pyinotify instance to monitor directory
I have some basic questions about pyinotify that I can’t seem to find the answers to elsewhere. 1) For a continuous directory monitor (and event processor) is it necessary to have a while( True ) loop or is the continuous event ‘loop’ handled by the notify watch and ended when I remove the watch? 2) What happens if files are
Tomcat is running but 8080 port is not responding
I have installed sun jdk 1.6 x64 and tomcat in a linux x64 machine through ssh, I don’t have root privileges so I installed both in my home dir. I managed to successful run tomcat but if I try to enter mydomain.com:8080 there’s no answer from the server. With this command: I checked the port and it is LISTENING Any