The Old Blog Archive, 2005-2009

sqlite3 bombed in Rails 1.2.2

Lately I have found the an app under Rails 1.2.2 bombed every now and then, and I thought the culprit was Mongrel.

Turned out that the error was “too many open files” and the culprit was the sqlite3 connector. This ticket explains the reason, but this patch didn’t seem to go into the 1.2.2 (even though it’s fixed before the 1.2.2 release date). The resolution is either switching to Edge just for that (and starting living on the edge…) or patching it on your own. Just follow the ticket’s diff and everything’s back to normal.

I wouldn’t have been able to found that without using the UNIX tool lsof. Apparently some knowledge on the UNIX utils can definitely save your day when in need.

ObjectiveFlickr 0.9.5 (Objective-C and Ruby) Released

ObjectiveFlickr is a Flickr API library available in two versions, one for Objective-C (hence its name) and one for Ruby.

This is a major update, and finally the Objective-C version catches up with its Ruby counterpart (in terms of version number at least).

The most important change of this version is that it now works with Flickr’s new original photo URL scheme. Original photos on Flickr will have different “secrets”, and API consumers need to give an extra parameter (original_format) when they call methods like flickr.photo.search in order to get that piece of information.

Photo URL helpers in ObjectiveFlickr (both ObjC and Ruby) have been updated to reflect that change.

Other changes in the Objective-C version include bug fixes, some deprecations, and updates in the demo code. Whereas for the Ruby version we now have HTTP POST support.

The Objective-C version is available at its Google Code hosting site.

Whereas the Ruby version is available at RubyForge and can be installed by simply using “gem install objectiveflickr”.

And of course, its own blog.

One interesting note for those who try to run the unit tests of the Ruby version: one of the tests actually brakes when trying to ask flickr.test.echo to echo back a string that contains angle brackets (< and >). It turns out that Flickr actually returns sqaure brackets back in this case, and this has only been happening since mid-January. Other than this quirk, everything should work just fine as in all previous versions.

A Belated Announcement in English: Yullio Layout Generator

(Announcement in Chinese here.)

hlb and I have created a Rails generator that churns out good-looking layouts (it’s Mollio :) ) for your controllers. Yullio Layout Generator (gem: layout_yullio_generator) is a layout generator that combines the flexibility of YUI Grids with Mollio CSS/HTML templates. Simply generate the layout with:

script/generate layout_yullio  [optional partial name]

And it places a copy of YUI Grids and Mollio CSS files in your public/ directory, instantly giving your views a great look.

This generator is a continuation of Mollio Layout Generator (gem: layout_mollio_generator). Here we combine Mollio’s good theme design with YUI Grids’ flexibility. It’s very easy to change the layout of your views. Just add the following lines in your controller:

  class MyController < ApplicationController
    yullio_page_width :doc2
    yullio_column_template :yui_t2

Here yullio_page_width is followed by YUI Grids page width styles, currently :doc, :doc2 and :doc3 are supported. Column templates follow the same naming rules. YUI calls them yui-t1 to -t7, here we replace the dash with the underline for obvious reasons. The two methods are implemented as a plug-in, which is of course copied for you by the generator. :)

Simply type “script/generator layout_yullio” for usage and description. We hope this generator will help you save time in creating layouts, further speeding up the prototyping stage of Rails app development.

Opacity Quirkiness on Mac Browsers

Dave Shea has discussed the opacity bugs found in both FireFox and Safari. This has been plaguing FireFox 2.0 on Mac for a while: whenever there is an element with a < 1.0 opacity, the page’s font rendering becomes very thin, sometimes causing hard to read pages. Currently there doesn’t seem to be any solution to it, other than not using opacity at all.

Lately I have found that opacity can affect Safari’s performance, too. If your pages contains element overlays that have opacity settings, when there are a few of them (say around 10), Safari becomes extremely slow in loading and rendering the page. If you open the page as a tab, switching to the tab will be very slow too. This badly affects the performance of JavaScript in the page, notably the Scriptaculous sortables. It has misled me to think that Scriptaculous was the culprit. After I removed the opacity settings, the sortables are as smooth as it should be. And no, running Safari on a MacBook Pro doesn’t help.

For testing, please open up both this slow version and fast version. The only difference is that the overlays in the slow version have opacity set.

WebKit and FireFox don’t have such problem.

It’s There! Rails 1.2 Released

Apparently people on the mailing list are watching closely: http://dev.rubyonrails.org/changeset/5982. RubyForge has already got 1.2.1 now. May have wait until it’s clear why 1.2.1 is released just 14 hours after 1.2 came out. There seems to be some last-minute fix to a serious database adaptor defect.

But all in all, this must be the Rails version hitherto mostly waited and expected. Along with the newly published 2nd ed of AWDwR, it seems people will be able to live off the edge for quite a while. :)

Kudos to the Rails people!

Focusing, or Drifting Away

I have written more on programming and software-related stuff since last October than I ever did. My lifelong problem and anxiety (so far) has always been that I wasn’t on/into anything particular for a long time. So three months is amazing. Will have to see where all this leads to.

Annual Report of the OpenVanilla Fund-Raising Campaign

The annual report of the OpenVanilla Fund-Raising Campaign in 2006 has already been compiled, available in Chinese at http://donate.openvanilla.org/reports/OV-Donation-AnnualReport-2006.txt (gpg signed document, UTF-8 encoding).

ObjectiveFlickr 0.9.2 (Ruby) in Sync with the New “farm id” Requirement

Also posted in Flickr API Group.

The Ruby version of the ObjectiveFlickr library has been updated. Version 0.9.2 includes support for Flickr’s new “farm id”, now required for newly uploaded photos since the format’s announcement.

Your old code will work without any change. If you also use this library’s helper functions that help you handle the photo information (a hash that stores photo id, server id, “secret”, and the newly-added farm id), there should be no problem working with new photos too.

Other minor changes include some refactoring and deprecations that should lead to cleaner code and style. Documentation is also updated. Please refer to its release notes for details.

To install ObjectiveFlickr, simply use “gem install objectiveflickr” for the latest version. The Ruby version is hosted at http://rubyforge.org/projects/objectiveflickr.

The Objective-C version (hosted separately at http://code.google.com/p/objectiveflickr/) will be updated shortly. I’m refactoring part of its code so it may take another few days.

High Way Service Areas

Some high way service areas in Taiwan have free wireless access now. They have already been 24/7 with convenient stores and gas stations, and now they have free wireless access.

It’s hard to write about transits probably because that’s what they are. Travel literature is more about places like cities, towns, countrysides, or about sceneary, people in history, art objects, or events. Transportation means or transits are part of the travel, but they are more like the backdrop. It’s harder to imagine a trip solely consisting of airport or train station hopping (not that there ain’t people who do that, it’s just more fringe). We go viaJFK to NYC. If we go to JFK, it’s because we’re heading elsewhere. There was once I put my instant messenger nickname as “SFO-NRT mm/dd1-dd2″ and a friend of mine asked if I was doing an airport-hopping trip. He took things too literally.

Transits can be what the Japanese call “ma,” or in-betweenness. Transits are not associated with memory and are not worth being written or noted exactly because that’s what they’re for. A trip overflown with self-boasting photos or captured memory (how apropos that phrase is) is like being on an all-you-can-eat spree, resulting in too much. Transits are there to give people a breathing space, a nothingness in-between the two stops, the two meaningful meanings (or the meanings-that-I-intend-it-to-be). They are there to be tasteless.

Still, I like the fact they have free wireless access here. Being connected on the road is a different thing. One is at the same time cut off from the beingness of stops themselves but still gets the access. Scribbling or doddling in such ambience is like working in a newly-remade partition. And anyway it’s a memoryless area. Things simply feel, to bear their own very properties, transient.

ObjectiveFlickr 0.9.1 (Ruby): Some Minor Update

ObjectiveFlickr 0.9.1 is released. This is a minor update. For details, please refer to the ObjectiveFlickr blog article.

« Previous PageNext Page »