This short piece of code below captures a frame from a web cam and shows it in a window. Some simple transformations can be applied. #include #include int main(void) { //we assume, that there is only one camera CvCapture* capture= cvCaptureFromCAM(-1); IplImage* img; int loop; while(loop++width; int height = img->height; int nchannels = img->nChannels; int… Continue reading Simple OpenCV video input/output sample
Category: Software
Set URL of Tomcat Webapplication to ROOT in Eclipse
When you create a Dynamic Web Application in Eclipse and run it on Tomcat, the Website will be available trought http://localhost:8080/[PROJECT_NAME]. To “move” the application in the root (making it accessible on http://localhost:8080), go into the project’s properties, go to “Web Project Settings” and just enter “/” in the Context Root textbox. Done.
Simple multithreaded Java Webserver
The following code (estimated 150 lines of code) implements a simple multithreaded Web Server in Java. The code is easy to read and contains no (really) complicated stuff. There are 5 classes: HTTPException.java This class extends Exception and overrides the getMessage(String) Methode, which is responsibe for example for the Error 404 Not Found message. MimeTypeResolver.java This… Continue reading Simple multithreaded Java Webserver
program AT90S8515 with AVRISP mkII
The AVR ISP mkII does not support the AT90S8515 by default for programing. There s a simple workaround for that: Go to the path where your Atmel stuff is installed. In my case it is: C:Program Files (x86)atmelAVR ToolsPartdescriptionfiles Look for the file AT90S8515.xml Locate the <ICE_SETTINGS> part and change the <MODULE_LIST> to [SIMULATOR:STK500:STK500_2:AVRISPmkII] and… Continue reading program AT90S8515 with AVRISP mkII
domain forwarding with Apache mod_rewrite
You might have the domain domain1.com which should redirect visitors to domain2.com. You could set up a virtual host, pointing to /path where an index.php file resides which forwards the user, e.g. with: <?php header(“Location: http://domain2.com”); ?> The easier way is to create a virtual host, e.g. by creating /etc/apache2/sites-available/domainForwarding with the following content: <VirtualHost… Continue reading domain forwarding with Apache mod_rewrite
embedded stack collision with the variable-memory
There was a strange bug I found which took me ages to find. I was implementing some stuff on a Atmel A90S8515 microcontroller. This device is quite old and has very limited memory. Both Flash and RAM. The problem occurred when sprintf from the standard library was called. When called, any internal variables were changed… Continue reading embedded stack collision with the variable-memory
my atmel microcontroller is continuously reseting
A problem I had multiple times was: I reuse software from the internet, but when i use the software / simulate it, it is constantly resetting! The reason why this is happening is (or can be) undefined reset vectors. This means, the hardware raises an interrupt, which is not hadled by your software. Therefore, make… Continue reading my atmel microcontroller is continuously reseting
Run processes when not logged-in with SSH
Scenario: I want to run a process on a remote computer, but don’t want to keep the SSH connection open during its execution. Even using the & after a command does not make a running process presist / survive a SSH disconnect. For these cases you can use screen. When logged-in in a remote computer,… Continue reading Run processes when not logged-in with SSH
distribute shared library with your binary (set rpath)
When a Linux binary is started, the run-time linker uses three sources for finding the needed libraries. First it is possible to set the LD_LIBRARY_PATH environment variable, second the “rpath” (this is a path encoded into the binary while compile time) and last but not least the systems’ default directory like /usr/lib. Now consider the… Continue reading distribute shared library with your binary (set rpath)
Subversion: revert file to older revision
Who doesn’t know the following situation: The file somestuff.c is in the HEAD revision, but it is not working anymore. Now you want to revert it to the revision 10 (which is may be HEAD-1). One way doing that is to update to the files correct version by: svn up -r 9 somestuff.c Then copy… Continue reading Subversion: revert file to older revision