We have developed a web-based source code browser.

Your source code is analyzed for its symbols and dependencies. A generator will then create an annotated version of your code as a HTML+Javascript website. The website has fancy tooltips and IDE-like functionality.

Check out the sources or a sample website with a lot of browsable code.

Olivier explains how to use C++ to have property bindings: Change one property and all its dependant properties change their value too.

Olivier has written a nice introduction to lock-free programming. Check out his post at the woboq.com blog.

EDIT: Fixed wrong URL.

If you are using MySQL and Hibernate, maybe you are familar with an exception like this one:

com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: The last packet successfully received from the server was79095 seconds ago.The last packet sent successfully to the server was 79095 seconds ago, which is longer than the server configured value of 'wait_timeout'. You should consider either expiring and/or testing connection validity before use in your application, increasing the server configured values for client timeouts, or using the Connector/J connection property 'autoReconnect=true' to avoid this problem.

To me, this problem occurred whenever my web application was not used for a certain amount of time. For some reason, Hibernate (?) does not close the connection properly, but the database system does after the wait_timeout has passed. Now Hibernate wants to use a connection that is not valid any more.

It took me some effort to overcome this problem, but I figured out a clean solution (setting the ‘wait_timeout’ setting of mysqld to days or weeks is NOT a good approach ;)).

The trick is to use connection pooling with c3p0. This way, you can make sure that a connection is revalidated after being idle for a long time. Configuration is quite easy. Just add the following properties to your Hibernate configuration (persistence.xml or hibernate.cfg.xml):

<property name="hibernate.c3p0.min_size" value="3" />
<property name="hibernate.c3p0.max_size" value="50" />
<property name="hibernate.c3p0.timeout" value="1800" />
<property name="hibernate.c3p0.max_statements" value="50" />
<!– this property forces the revalidation of a connection after the given amount of time (in secs) –>
<!– it must be set to LESS than the wait_timout setting for the mysql server (this setting defaults to 28800 secs (8 hours)) –>
<property name="hibernate.c3p0.idle_test_period" value="28680" />

Furthermore, you have to add the c3p0 jar to the classpath of your application.

Today, a good user interface must have a nice look, too. As the iPhone shows, using an application must be some kind of fun.

In order to create such GUIs, the controls provided by the .NET Compact Framework are lacking a lot of functionality. However, the MSDN gives us some hints: in this article, they show us how to create a button filled with a gradient background.

When using gradients from RGB(238, 238, 238) to RGB(128, 128, 128) one can reach pretty nice results. Furthermore, it is possible to only fill the upper 10 pixels of a black button with a gradient from black to white using the StartOffSet and EndOffSet property. This way, you get buttons similar to the ones currently used by HTC for their TouchFlo user interface.

Well, what about adding rounded corners to the gradient filled buttons? This is far more easy that you might think. I have added a code example on my community pda-dev.de: Gradient Button Code.
Simply copy the code located in the linked topic. It must be inserted at the end of the function DrawImage from the original example out of the MSDN.
The idea is to draw the border manually instead of just adding a rectangle around the button. At each corner, we “dash” the border by one pixel to achieve the look of a rounded corner. That’s all the trick!

Well, currently I’m working on my project filesio, a platform for distributing large files via web interface instead of FTP.

One of the core abilities of my application is to provide widgets for third-party sites, allowing my users to include download-links to their files in their own web pages. These widgets are simple iframes that load content from my domain.

However, when implementing my app I struggled with the problem that Microsoft Internet Explorer per default blocks cookies set from within an iframe (of course, all other browsers don’t do this).

Lucklily, I found a really ..hm…interesting solution for this problem:

Read more…

There are a lot of commercial stress and load testing tools available, but in general they are really expensive, so buying one is probably not the best idea if you just want to stress-test a single web application for one time, like I did.

Instead, I checked out some Open Source tools and found Webload, an Open Source variant of a more comprehensive tool developed by Radview. The download can be found here (it’s not available on the official website any more).

The tool comes with a graphical user interface both for creating test scripts (Webload IDE) and for launching and monitoring tests (Webload console).

Scripts can be recorded by simply clicking links in your browser. Afterwards, the script can be used to create the actual test, consisting of an arbitrary number of virtual users that follow the actions defined in the script. Webload allows monitoring of any values you can think of, ranging from the number of executed requests to throughput in bytes per second.

Because of all those features that seem unique for an Open Source stress test tool, Webload is really worth a tip here at codingclues :)

Well, the following post does not cover a typical programming topic, but maybe even as a software engineer you might have to deal with (web) design from time to time. At least I did when developing a new website for a customer (http://heilmann-software.de).

While creating shiny and glossy effects seems to be a trivial task for the experts using Photoshop, I tried a lot until I got some good results with Gimp, the Open Source image editor.

My goal was to develop a “shiny table” effect from a screenshot that was rotated into the view. Below you can see an example (of the result, of course ;))

Read more…

Here’s a little trick that seems to work with OpenGL/GLSL on NVIDIA cards. When you have a geometry shader that outputs some primitives (in my case GL_POINTS) inside a loop and the number of iterations is not known at link time you’d normally write something like this:

for (int i = 0; i < pointCount; i++) {

If the total number of emitted vertices is always the same and doesn’t depend on pointCount (pointCount * shaderCalls = const) then you will still get a drastic slowdown when pointCount is higher then 1. If you replace pointCount with a constant number this doesn’t happen until the number is higher then some limit (8 in my case). The following code would do exactly the same as above for pointCount <= 8 but doesn't suffer from any performance loss:

for (int i = 0; i < 8; i++) {
   if (i < pointCount) {