If you have ever wondered what the nice color names from the .NET Color structure in namespace System.Drawing.Color actually mean, you will find this page very useful.
They present a listing of the named colors in .NET, show how they look like and also specify the corresponding hexadecimal values.

When designing or coding a website, there is an easy method for including favicons next to the links. You cannot assume that a favicon is always at /favicon.ico of the URL, as there are different ways to specify which favicon a browser should display!

Read more…

Using Ruby On Rails and the find method with conditions, it is also to possible to use the LIKE statement of SQL without having to escape variables or using raw SQL:

Read more…

Today I want to introduce my new project Cloud42, an Open Source management framework for Cloud Computing with Amazon EC2.
This is not intended to be a dumb advertisement. Instead, the main cause for this post here is that Cloud42 is very interesting for developers and therefore can be of value for you, too.

Cloud42 is a web application written in Java. It provides both a AJAX-enabled GUI and an extensive Web service interface, allowing you to invoke its functionalities from your own application or from within BPEL processes.

Besides the basic functionalities like starting, stopping and monitoring EC2 AMI instances, Cloud42 offers some enhanced functions like transferring files and bundling new AMIs. Furthermore, it is possible to control your instances remotely by sending arbitrary commands through the Web service interface (or by using the GUI). A notification mechanism following the publish/subscribe pattern allows you to subscribe any endpoint to events that occur on an AMI instance.

This sounds interesting? Then visit the website at cloud42.net!
And don’t forget to drop a comment here!

While YouTube has an API to get thumbnails of its videos, there is also the possibility to construct the URLs of the thumbnails out of the URL of the video.

Read more…

If you are getting the following exception on a migration on Darwin / OS X:

SQLite3::SQLException: near "ADD": syntax error: ALTER TABLE "xxx" ADD "yyy" varchar(255)

then you can try the following:

  1. sudo gem uninstall sqlite3-ruby
  2. Install the latest sqlite3 from sources from sqlite.org
  3. sudo gem install sqlite3-ruby

For those of you who want to display a progress panel or a progress bar whenever some loading on your page is required, the JBoss Wiki contains a really good tip: RichFacesPleaseWaitBox.

This sample can be enhanced very easily to bring in some dynamic: within the rich:modalPanel, just use an animated gif, for instance from this cool page.

This has been originally published on tomcat.ranta.info on May 21, 2008.

I know I should be hard at work, but… it took only 10 minutes! :) And sometimes I should really scratch that programming itch when it comes along…

Yesterday I did some reading and talking on the Debian OpenSSL desaster. guruz brought in an interesting website on random number visualization.

I don’t know about you, but I couldn’t help but think that PRNGs can’t be that bad. Or at least they wouldn’t be this bad in Linux, where timing and attributes of mouse and keyboard activity, disk I/O operations and specific interrupts are used as entropy sources.

Read more…

The following has been originally posted here and here on June 13th and 14th, 2005.

There are two things I want to say about this shot.

Read more…

There are many scenarios where a web application must serve a file instead of a response containing HTML output to be rendered by the browser.

This little tip illustrates how to cause the browser to display a file download dialog instead of trying to display the data directly (which fails in most cases, especially with binary data).

As you will see, the whole magic concentrates on a special HTTP header, so this tip can be used with any technology and framework, ranging from Java Server Faces (JSF) and the Seam framework to PHP and even ASP or ASP.NET.

A common way to realize file download is to simply write the file data into the HTTP response.

However, if you have to handle arbitrary files, you are not able to set a specific Content-Type header like text/plain or something else.

So the client (namely the browser) has no idea what kind of data it actually receives and what to do with it.

Here is where the HTTP header Content-Disposition comes into play. Setting this header tells the client that an attachment is received and therefore causes the browser to display a file download dialog.
Now it’s the user’s responsibility to save the file and to open it with a corresponding application.

The Content-Disposition header consists of two values: the string “attachment” indicating an attachment and a “filename” property specifying a filename for the attachment. Usually, the browser takes this value as proposed filename in the download dialog.

The following line is an example extract from an HTTP response containing a Content-Disposition header:

Content-Disposition: attachment; filename="myFile.exe"