Archive for 2009

SelectList 0.1.1

Saturday, October 31st, 2009

Here’s another minor update to one of my jQuery plugins — this time it’s selectList, version 0.1.1. The update is mostly a code cleanup, with one functional change — if a hint has been provided with the title attribute, it is always shown as the currently selected option in the dropdown list after each selection takes place (as requested by some).

Rocket

Friday, October 23rd, 2009

Meet Rocket.

Rocket

Rocket is a (approximately) seven weeks old, cute-as-hell kitten.

I found him about a month ago, while going for a walk around my neighborhood. He was crawling through some bushes, squeaking silently, but loud enough for me to hear. I have had a few kittens throughout my life, so I immediately recognized the characteristic squeak of a baby cat calling for help. When I saw him, the poor thing looked really miserable, messy, with eyes completely matted shut. Seeing no signs of his cat mother anywhere near, and knowing that the little guy had no chance of surviving on his own, I decided to take him home.

He was soon seen by a veterinarian, and it turned out he was literally covered with ticks. As the doctor put it, they would have “sucked him dry” if he hadn’t been found. It took a whole hour to remove all those little bastards. The doctor also opened Rocket’s matted eyes, and there was some bad news. His eyes were badly infected (in doctor’s words, the infection looked “horrible”), and it was highly likely that he will be blind or nearly blind for the rest of his cat life.

This didn’t sound optimistic, but I thought, what the hell, whatever chance there is, it’s worth trying, so I took him back home and started his treatment (based on massive amounts of various eye drops). At that time, his eyes looked really bad, lifeless and empty, like those of a zombie. Rocket could open them, but it was obvious he couldn’t see a thing.

I have other cats in my apartment, and since Rocket’s infection was contagious, I had to isolate him. I arranged him a cozy therapy room in the bathroom and he stayed there most of the time. However, he had an unstoppable urge to explore the world around him, and whenever I opened the bathroom door, he shot out of there like a freaking rocket. Yup, that’s how he got his name.

Despite being sightless and weakened by his illness, he was unbelievably full of life. I got him a toy rat, and he spent hours biting, strangling, and generally torturing the hell out of it. Whenever he smelled food, he sniffed his way towards it like a hunting dog — and when he got to it, he ate like crazy.

I’m sure it was this exceptional lust for life that made him defeat his illness. After a few days of intensive treatment, I noticed some changes. His eyes looked less zombielike every day, and there were undoubted signs that Rocket was starting to see. This was mostly observable when he paused his activities (which mostly involved running around and biting everything) for a brief moment, and turned his head only slightly, obviously experiencing the formerly unknown sensation of sight.

About two weeks after I found him, he was all better. His eyes looked almost normal, with just a few barely noticeable spots left after the infection. The first time I saw him play with a tiny piece of paper, I had no doubt that he was able to see pretty clearly. Even the doctor was amazed by how well he was doing.

I could not keep Rocket in my apartment for good, because the other cats weren’t getting along with him especially well. Luckily, my mom decided to take him, so now Rocket has a new, loving home, and he’s a happy little troublemaker.

ImgZoom 0.1.1

Friday, October 2nd, 2009

Today I released a new version of imgZoom. It’s just a minor update that fixes one bug and introduces the getOptions() API method.

I have also updated the documentation — it now includes a reference of the available API methods.

Learning jQuery 1.3 – Book Review

Monday, September 28th, 2009

Learning jQuery 1.3I recently had a chance to read “Learning jQuery 1.3″ by Jonathan Chaffer and Karl Swedberg. Having been using jQuery for quite a while in dozens of web development projects, and having released a few plugins, I consider myself an advanced user of this great library. However, my knowledge of jQuery comes almost exclusively from the official online documentation (particularly the API reference) and some occasional reading. So I thought this could be an interesting opportunity to compare my experience-based knowledge with a structured course in a book.

The book is divided into two parts — the first six chapters are a gradual introduction to the concepts of jQuery and its basic features, while the remaining chapters discuss the more advanced topics and show some real-world applications of the library.

I expected the introductory part of the book to be a bit boring, since I already knew all that elementary stuff, but I was pleasantly surprised to be wrong. The authors have managed to describe the basics (selectors, events, AJAX, etc.) really comprehensively, drawing attention to many details and subtleties. For example, the chapter about effects is nothing like the “how to amaze your visitors with cool effects” approach that many tutorials seem to take — instead, the reader gets a thorough explanation of topics such as custom animations and effect queuing.

The advanced chapters are even more interesting, demonstrating a number of practical examples of how jQuery can enrich users’ experience when dealing with common web application features, such as presenting data in tables and filling out forms. While the examples are quite complicated and lead to code snippets spanning several pages, they remain beginner-friendly, as all the new elements are introduced progressively, starting with the basics and adding more features along the way.

Last but not least, the book includes useful appendices that list numerous valuable online resources and development tools for jQuery users. There is also an excellent appendix on JavaScript closures, which is a very significant (and often misunderstood) subject for jQuery plugin developers, as well as anyone interested in advanced JavaScript programming.

What I consider the greatest strength of the book is the professional approach to web development that the authors take and try to pass to the reader. The book places great emphasis on good web development practices, especially accessibility issues — all the many examples conform to the concepts of graceful degradation and progressive enhancement, and the presented techniques can be safely implemented in accessible web applications.

I highly recommend the book to any present or future jQuery user. If you’re a beginner, it will help you learn jQuery and use it the right way. If you’re experienced, you might be surprised to learn a few new tricks (I was), or at the very least, you will find it an interesting read.

ImgAreaSelect 0.9.1

Friday, August 7th, 2009

I have just released an update to imgAreaSelect with a version number of 0.9.1. It fixes a nasty bug found in version 0.9 that affected the initialization stage, causing some unexpected behavior (like not being able to set the initial selection) and JavaScript errors.

Thanks to all the people who noticed the bug and reported it to me.

ImgZoom 0.1

Monday, August 3rd, 2009

Here’s yet another jQuery plugin made by yours truly. ImgZoom creates a smooth zoom effect for thumbnailed images by doing a graceful transition from the thumbnail to the full-size image. Feel welcome to take a look at the live demo.

There are already a few jQuery plugins that do this, but as far as I know they all achieve the zoom effect by gradually changing the dimensions of HTML image elements. ImgZoom, on the other hand, utilizes the vector graphics capabilities found in browsers (including Internet Explorer), which results in really smooth animation and allows for additional effects to be incorporated into the process.

I’m releasing the plugin a bit early, as it only has about half of the functionality that I intend to implement. My long-term evil plan is to make the plugin a viable alternative to Lightbox et al, with prev/next links, keyboard support and such. Anyway, I’ll be happy to get some feedback on this premature 0.1 release — let me know if you like the plugin, whether you think it would be useful, and what features you would like to see in future versions.

ImgAreaSelect 0.9

Monday, July 20th, 2009

I finally found enough time to finish developing the new version of imgAreaSelect, and I’m happy to announce it’s available for download.

This release brings a few major changes and new features — here’s a summary:

  • Styling the plugin is now done with CSS (the old styling options are still supported)
  • A new option has been added to show/hide the plugin with a fade effect
  • A new option has been added to get an instance of the plugin’s object
  • Some of the plugin’s methods have been made public and can be called through the instance
  • A new callback function has been introduced (onInit)

Implementing and testing the new features took me about one third of the total time I worked on this version, I spent the rest cleaning up and refactoring the code. As a result, although the new version has many new features, it’s actually a bit smaller that the previous release (0.8). The packed JavaScript file (included in the distribution package) is less than 8KB in size.

The plugin’s project page has also undergone some face lift and reorganization. The documentation is now on a separate page, and there’s a new examples page (at this moment, only three examples are included, but I will be adding more soon, I promise).

There is also a special bonus for all the people who want to modify the plugin’s source code and implement their own solutions based on it — I have made available an extensively commented version of the source code.

SelectList 0.1

Friday, June 5th, 2009

I have developed a new jQuery plugin, called selectList. It’s purpose is to transform the standard multiple selection box used in web forms into a nicely looking list that you can add items to and remove items from. So, it turns this:

Traditional selection box

Into this:

selectList

Apart from the more attractive appearance, the list approach is also better in terms of user friendliness, as all the selected items are shown to the user all the time. With the traditional solution, the user often has to scroll the box to check if all the desired options have been highlighted.

The plugin is actually an extension of the idea that I demonstrated in an article on multiple select fields that I wrote some time ago. Back when I wrote it, I thought of developing this plugin, and, well, I finally had a spare afternoon to write it (and half of night to deal with browser incompatibilities). Be my guest and take a look at the project page and some examples — as usual, your feedback is more than welcome.

Shoehacking

Monday, May 25th, 2009

Did I ever tell you that I like running? Probably not, as all I’ve been blogging about so far was web development or technology-oriented stuff. And even if I tried writing about something else for a change, I ended up with a Greasemonkey script, damn it.

Anyway, I like running. Not long ago, I’ve decided to try out the Nike+iPod Sport Kit, which seems to have gained significant popularity among some runners. If you haven’t heard of it, the Nike+iPod kit is a neat accessory that turns your iPod into a workout companion. While you’re running, it measures your distance and pace, and gives you voice feedback on your performance.

So I got myself an iPod Nano and the kit, which consists of a receiver that is attached to the iPod, and a sensor that should be placed in your shoe. Nike “strongly recommends” that you buy a special pair of running shoes that have a little pocket under the insole where the sensor is supposed to go. However, I already had an excellent pair of Ecco Receptor shoes that I found very comfortable, and I wasn’t keen on switching just because of the sensor issue.

Suspecting I wasn’t the only one on the globe with this problem, I googled around and found that I have two options: buy a special holder for the sensor, or hack it into the shoe somehow — I chose the latter, of course. I came across this blog post, which has a nicely collected list of hacks (as well as commercial products) that people invented to use their sensors with non-Nike+ shoes.

The method that I used is a modified version of the first hack shown on that page. In the original method, the sensor is tucked under the shoelaces and kept in place with a small piece of velcro. I didn’t use velcro, I just stuffed the sensor under the laces, but first I wrapped it in a tiny ziploc plastic baggie. Here are the ridiculously simple instructions:

Step 1. Put the sensor in a plastic baggie

Putting the sensor in a ziploc plastic bag

Step 2. Stuff the baggied sensor under the laces

Baggied sensor tucked under the laces

The use of the plastic bag has two major benefits:

  1. It makes the sensor sit tightly under the laces, making it virtually impossible for it to fall off.
  2. It protects the sensor from dirt and rain (yes, I’m tough enough to run when it rains).

I have now run about a hundred kilometers with the sensor attached like this, and it never even got loose. If you’re looking for a quick hack that doesn’t involve any sort of shoe surgery, I recommend you try this one. It might not work with your shoes as well as it worked with mine (the spot under the laces needs to be quite tight), so go for a test run first and make sure the sensor sits steadily after a few hundred meters. Have fun!

Setting Up an Ubuntu Subversion Server

Tuesday, May 19th, 2009

A few days ago, my friend asked me to help him configure Subversion on his Ubuntu server, so that he and his fellow programmers could use it for their projects. Being the helpful chap that I am, I wrote up some instructions for him, and then I thought I might as well write a step-by-step tutorial on this subject. So here it is — my tutorial on setting up an Ubuntu-based Subversion server.