Sunday, April 27, 2008

Citat IV



  • "The prize was not US$1000. it started out very small. Knuth did indeed pay out, and indeed doubled it, several times. From wikipedia: "The award per bug started at $2.56 (one "hexadecimal dollar"[24]) and doubled every year until it was frozen at its current value of $327.68. This has not made Knuth poor, however, as there have been very few bugs claimed. In addition, people have been known to frame a check proving they found a bug in TeX instead of cashing it."


Sunday, April 20, 2008

Blogspot customization and tools

It has been more then 8 months, since I published my first post here. During that time, I've made some changes to how things work here on my blog, added some widgets, and changed layout. I want to summarize all of the changes, so anybody can replicate them on any other blogspot blog. In addition, I will publish my template to the open, as a source of examples.

JavaScript

The first major hurdle to overcome is how to get JavaScript frameworks on your blog. You cannot just copy the files you need over to the server. There are several solutions:

  • source the needed library from a CDN: 'big' JavaScript libraries like YUI are hosted on CDN networks, so you don't need them locally.

  • use JSLoader: dynamically download the needed libraries from JSLoader's web

Colored syntax
With JavaScript libraries on-board, we can add some functionality. One of the first things I needed was code syntax highlighting. I'm using google-code-prettify, and it works quite well. Here is a brief description.

Widgets

Ohloh.net metrics

If you're a developer, or just a fan of some open-source project, great way to link to it is an ohloh widget. You can choose from a variety of options.
Google Reader
Another nice addition if you use Google Reader, is a feed of your shared links.

Tools

Google Analytics
A great free service to measure the number of visitors that read your blog, see the trends, or know the most used google keywords people used to get to your blog. Only one negative point: it uses Flash to render the graphs.
Feedburner
Your RSS feed can be measured in much the same way as your site. Just burn the feed with feedburner, and get lots of interesting stats on your RSS feed usage. In addition, you can use feedburner to show number of comments your post has, add ads, or embed amazon affiliate codes automatically.


Layout and styles

Wide layout
From the very start, I felt that the space for the posts is too narrow. I used to trim the code examples I was publishing in various ways, until I decided that the layout must be widened. I am not very good at CSS, so I just googled and applied a ready-made solution.

Multi-language content

As I publish content in two languages, I wanted to distinguish links to Slovak and English content. Using standard hreflang attribute on links, and some CSS, it turned out to be quite easy. First, the anchor has to include the target page language:

/* include hreflang attribute */
<a hreflang="en" href="http://www.google.com/">Google</a>


And in the template, include this easy CSS fragment:
/* include a url for a flag for every used language */
[hreflang=en]:after {
content: URL(uk-flag.gif);
margin-left: 5px;
}

Detailed description can be found here.

Template Source

As promised, here is my customized template on github. I will push further changes to this repository as well.

Monday, April 14, 2008

How to get really social

I have decided to start sharing my bookmarks. I already share some of them via Google Reader, but there are other links I would like to share, not only from my RSS channels. I was recommended to try Diigo, and it looked quite good, so I created an account there.

I was asked for all the usual stuff to set up my profile, and then, I was able to import my contacts from gmail to look whether somebody I know is already on Diigo. Success! Your 2 contacts are already on Diigo, click here to make them friends! I confirmed that, and then...I realized what have I done. I have 240 contacts in gmail, lots of them are nonexistent or old addresses, some of them are mailing lists, and there are also lots of people I don't know :) Diigo was sooo kind and helpful, and helped me to become really, really social, by letting all the contacts pre-checked, so it sent them my kind invitation to Join My Network. Not only those it could find already on Diigo, all of them :)

Today, I already received about 40 emails, lots of them from various mailing-lists robots. Up until now, I have 4 people as friends on Diigo, who have registered only because of my invitation email. Two people I haven't heard from for years have sent me an "how do you do" email.

Well, not a tragedy at all, it ended up quite nice, except for some conferences where people think I'm crazy, or a spamer, or both :) Thank you Diigo :)

Come Join My Network.

Saturday, April 12, 2008

Google AppEngine and the tutorial code

Google has created yet another amazing service: Google App Engine. It's currently in a limited beta, so hurry up to get an invite.

App Engine is a web application runtime built on Google's massive geo-distributed infrastructure. It's an application hosting service designed to help you with all the boring stuff you need to go through when preparing for a deployment of a web application: setting up the hardware boxes, setting up the servers, configuring the database, ensuring security, etc. It's goal is to ease the pain for the average developer to publish even the smallest of apps, without worrying how to scale when it's needed because of the app's popularity.

The language of choice used to create web applications is Python, and you can use any Python web application framework compatible with the WSGI standard to construct your app. Nevertheless, Google also provides its own easy web framework, called simply 'webapp'. Webapp's data modeling interface is based on Django's, and the templating engine is right from Django, so that should make all the Djangoers out there quite happy, and also should make porting of Django apps to App Engine quite easy. I say 'should', because I haven't tried yet; all I tried was the nice and easy tutorial Google provides.

The development of your application is done completely locally. You can download an SDK that simulates all the services provided to your application by the real runtime, including authentication, data store, and web server, to help you to develop and test your application. It's actually very usable, and comfortable, just like most things in Python ;-)

Also, there's another significant part of App Engine: the administration console provided to help you to monitor and administer deployed applications. Here's how it looks:



All in all, it's an interesting service, and it's going to be even more interesting as soon as other supported languages start to appear. I recommend taking a look at the documentation. If you do, and you're lazy to go through the whole tutorial :), I have uploaded the resulting code to github. The application is deployed here: http://my-private-playground.appspot.com/

Wednesday, March 19, 2008

Support Bruce Perens

Bruce Perens, the legendary icon of Open Source and Free Software, and co-founder of OSI, is running for a membership in the OSI board. You can support him by signing the petition.

Saturday, February 09, 2008

Ohcount released as open-source

Ohloh.net, great site with statistics on open-source projects, released the ohcount tool as open-source. Ohcount is a ruby script with C++ extensions, capable of recognizing and counting the number of lines of code in your project. Its usage and installation are pretty easy: take a peek here, and you can start playing with it on your own. Here is an example of stats produced by ohcount for my yui-compressor-ant-task mini project:


n0ha@n0ha:~$ ohcount ~/code/javaflight-code/yui-compressor-ant-task/
Examining 35 file(s)
Ohloh Line Count Summary

Language Files Code Comment Comment % Blank Total
-------------- ----- --------- --------- --------- --------- ---------
html 18 3080 115 3.6% 426 3621
java 3 224 85 27.5% 65 374
javascript 15 205 28 12.0% 0 233
xml 1 56 0 0.0% 8 64
css 1 14 7 33.3% 8 29
-------------- ----- --------- --------- --------- --------- ---------
Total 23 3579 235 6.2% 507 4321


Looks like I've got more of an html project than a Java project :) The html numbers are of course the generated Javadocs.

Ohcount recognizes languages by file extensions. For every language it recognizes, it knows how to distinguish between code and comments. That can be a useful statistics, especially for large projects.

Sunday, February 03, 2008

Java vs JavaScript

Funny insight from Dion Almaer.