Friday the 13th with Joda Time

I’ve always wanted to try Joda Time and in this post I’d like to present some code that finds Friday the 13th dates. Wouldn’t it be interesting to know when the next Friday the 13th is or which year has got the most occurrences of this particular day?

The Eclipse project with the code for this post can be downloaded as tar.gz or zip. You can browse the code online here.

Continue reading →

Building a simple proxy checker tool

In case you’re trying to change the configuration of your proxy server you might want to check what appears in the logs of a web server returning data to your proxy. Maybe you want to suppress certain HTTP header fields or make sure that the browser’s user agent is forged correctly.

This post discusses a PHP script which tries to display helpful information from the web server’s perspective. Although it may not be complete you can easily extend it to suit your needs.

Continue reading →

OpenGL: triangle with white center

Just recently I’ve learned how to create a triangle with OpenGL that has a white center and colored corners. Since I haven’t found a site explaining how to do this I thought about sharing my solution here.

It’s pretty easy as soon as you know that OpenGL blends the color between vertexes horizontally. Just setting the corners of the triangle to the three fundamental colors (RGB) hoping that the center gets white won’t cut it.

Continue reading →

PHP: Using cURL if allow_url_fopen is not enabled

In case you’re using PHP to retrieve data from a certain server you probably came across the problem that it may work for you but a client complained about lots of errors. It’s pretty likely that you’ve relied on the fact that allow_url_fopen is set to true. This way you can put pretty much anything – local path or a URL – into function calls like include or maybe simplexml_load_file.

Continue reading →