tomo's blog

PSD to HTML Slicing Services Reviewed

Submitted by tomo on June 17, 2011 - 10:45pm

I've known for awhile about the existence of PSD to XHTML cutting (slicing) services which can turn your website design straight from Photoshop into clean HTML/CSS in factory assembly line turnaround.  But I didn't realize there there were hundreds, perhaps thousands of little shops like this.  With so many options, a number of sites have sprung up to review these PSD2HTML clones.

If you don't want to read any further then just go with  They started the industry and are the most well known and most reviewed.  In general, the reviews are positive.  But there are many, many cheaper options.  If you, like me, always strive to get the best deal, then read on.

Read the rest of this article...

Muong language

Submitted by tomo on May 26, 2011 - 3:45am

Thanks to all the responses from people who listened to the short audio I posted the other day of a man "speaking strange Vietnamese".  I got all kinds of answers from "it's Vietnamese" to "it sounds like Thai mixed with Vietnamese" to "it sounds like a Thai or Cambodian man speaking Vietnamese".  Some people actually understood the content quite clearly, which talks about Jesus, while others couldn't understand it at all.

In fact, the segment was neither a man speaking Vietnamese nor a foreigner speaking Vietnamese with an accent.  This man was speaking his native language, which is Mường, a language closely related to Vietnamese, and perhaps closer to the origins of the Vietnamese language.  The Mường people are basically ethnically Vietnamese but live in the mountainous areas of North-Central provinces such as Hoa Binh and Thanh Hoa.

Although considered a separate language from Vietnamese, many Vietnamese speakers will find they can understand much of the Mường language without studying it.

Read the rest of this article...

Since I mostly use Hootsuite and Seesmic for reading my Twitter timeline (the other big reader, TweetDeck, won't connect to both Twitter and Facebook in either it's Chrome app or desktop versions), I've updated h8sq: the 4sq killer to work on those clients.

This also includes performance enhancements for the version.

Furthermore, if you open your Chrome Developer JavaScript console, you will see log messages for each hated on FourSquare tweet like so:

"hated on tomosaigon" 


Do you find Hootsuite's "Promoted Tweets" distracting?  I've also hacked together an ad blocker for Hootsuite.  Rather, it should be called an ad blacker, as it blacks out the ad but still makes it clear who is spamming you, and you can still read the full ad by mousing over it.

Install h8sq for Chrome

Install hootfree hootsuite ad blacker for Chrome

View from Bitexco Tower

Submitted by tomo on May 3, 2011 - 12:31am

From the top of Saigon's tallest building, the Bitexco Financial Tower. This is what the 200,000 VND ticket to reach the SkyDeck gets you. Y'all can thank me for saving you 200K! Click for higher resolution, and more photos from Mr. dEvEn.

From Saigon Skydeck with love

Drupal Views UI Filter Fields by Content Type

Submitted by tomo on April 21, 2011 - 4:18am

Late night hack:

You have a lot of fields in a lot of content types. You're creating a view with new display fields but it's a pain to find just the content type fields you want. Wouldn't it be cool if you could just select a content type from a pulldown and see content fields filtered to just the ones in that content type?

Add this bookmarklet to your bookmarks bar:
Views UI Filter

Read the rest of this article...

This is in response to a recent news article quoting an idiot Vietnamese-German "traffic expert" on a new traffic reduction proposal (read article).

Reducing traffic in Vietnam's big cities is as simple as this: limit private automobiles (cars), increase public transportation (busses and trains with grade separation). Focus on cars because:

  • Cars disproportionately increase traffic problems.
  • Compared to pedestrians, bicyclists, and motorbikes, they take up much more space per traveler.
  • They are bulky and less maneuverable, so they force everyone else to stop, slow down, be blocked, and block others.
  • Vietnam's roads are generally not wide enough for two cars to pass each other without causing traffic to slow down or stop.
  • Many roads and alleys are hardly wide enough for a car yet they are allowed to use them while blocking all other traffic.
  • Roads in Vietnam are constantly under construction which often means reduced width of lanes and more bottlenecks for cars.
  • While both bikes and cars often stop in intersections after the light turns red, a car jamming an intersection causes a much bigger traffic jam, because unlike bikes it's much harder to go around them. So one car blocking an intersection means other cars who now have the right of way can't move.
  • There is generally no parking for cars so they end up illegally parking on busy streets, reducing capacity, or they drive around idly increasing traffic.
  • Cars and bikes often use each others lanes illegally, but blockage caused by a car in a bike lane is much more severe.
  • Cars are a major culprit causing traffic jams wherever they are. The 500,000 cars in Saigon cause a lot of traffic congestion.

Clearly, taking one car off the road is more effective than many bikes for reducing traffic congestion. It's also a more equitable use of resources like land and fuel.

So-called traffic expert Nguyen Minh Dong says an odd-even license plate number scheme for keeping cars out of the city center every other day wouldn't work, mainly arguing about pollution and ignoring congestion. The problem at hand is congestion, and the corollary to his argument is that we should all buy cars in order to reduce pollution. Absurd.

Pollution would be better addressed by encouraging public transit, bicycles, walking, and affordable housing close to jobs.

But odd-even rationing has been tried many times before successfully. In nearby Guangzhou, an odd-even scheme kept 800,000 cars off the road over two months. While in other countries where cars are cheap it may make sense to buy a second car just to drive it on other days, cars are expensive here and incomes are much lower. It's ridiculous to assert that most would buy another car rather than use ways that almost all other Vietnamese take to travel, and it's ridiculous to say that an odd-even scheme would therefore not be effective.

The article argues that the "most important mission of transport police officers is to control traffic." I think that enforcing an odd-even scheme sounds a lot like controlling traffic. They then go on to argue that such a scheme "may cause" corruption. In Vietnam, enforcing any and all traffic rules causes corruption. Is that a reason to make it legal to run red lights?

There are many ways to reduce the number of cars. This reporter conveniently ignored all of them so I'll suggest a few.

  • We should restrict cars from roads that are too narrow for them and use physical barriers to stop them from entering.
  • We could make and keep roads one-way for cars but bidirectional for other traffic.
  • We can add tolls around the core.
  • We should add barriers to prevent cars from taking over bike lanes, while still making all lanes accessible to bikes.
  • We should also be considering London's congestion charging (with free routes through the city to discourage long avoidance routes) or Singapore's electronic road pricing.
  • We should NOT continue reducing fees for cars.
  • We should NOT be misled into thinking that building more highways leads to less congestion. We should learn that lesson from the US.

And finally, we should NOT just sit around and do nothing. Market forces will mean increasing car ownership in Vietnam for an infrastructure that is overloaded by them as it is. I haven't even begun to address the taxi and busses impact on traffic! That will be a future post...

Every few months, I've had remote OpenBSD servers die mysteriously, without any visible console messages, and still responding to pings, although higher level networking (http, ssh) are unresponsive. The crontab I setup to dump output from top (or systat) also stops. But before the kernel failure load was low and swap was unused.

After rebooting and checking dmesg, I see before the most recent reboot:

uvm_mapent_alloc: out of static map entries

Doing some research, it seems like it could be a problem with kmem_map fragmentation, possibly from long-running processes (like apache, which is being used more heavily now). The problem appears to have been fixed in recent releases of OpenBSD which dynamically increase kmem, but upgrading the server right now isn't feasible.

So the solution is to compile a custom kernel with an increased MAX_KMAPENT added to GENERIC config:

Read the rest of this article...

Daily Twitter Posts - 03/16/2011 - 03/31/2011

Submitted by tomo on March 31, 2011 - 6:11pm

03/30 12:30 Engineering Management 101: 9 Women can't make a baby in 1 month, the mythical man-month #
03/30 06:12 "Bao Viet ceased offering agricultural insurance in 1999. The current proportion of agricultural production insured is only 1 per cent." #
03/30 06:09 Are's Facebook stats for Cambodia as (in)accurate as for Vietnam ? @ChrisInCambo #
03/30 05:47 I'm surprised Paris Cafe on Co Bac is still open.. good French fast food at Vietnamese prices but confusingly hidden #
03/25 10:52 Twitter can't seem to make up its mind as to whether I exist as a page or not #
03/16 11:12 "Some girls they act retarded. Some girls are bout it bout it." - N. Dogg #

Using Nokia's PC Suite, one can export SMS messages from one's phone (maybe only their smartphones with USB). The format is CSV but the output is basically unreadable due to PC Suite bugs. Only a phone number is exported per message, no contact name. But more importantly, the CSV output is broken -- double quotes aren't properly escaped.

I think it's useful to be able to browse old messages online, say in a Google spreadsheet. But to do that, we need to rewrite PC Suite's output a bit.

[I didn't know anything about scripting Excel (or Google's spreadsheet which is basically Excel) but I did want to look up some old messages because I couldn't remember somebody's birthday. After importing messages from a year ago to Google docs, I could read messages between my friend and I around that day to find out exactly.]

Read the rest of this article...

Drupal Add Comment Form Above Comments

Submitted by tomo on March 24, 2011 - 12:57am

Drupal 6 allows you to either display the comment form below saved comments or on a separate page. There's surprisingly no way to configure the form to appear above the comments. It's hard-coded at the bottom of comment_render to either append the form, or not at all.

There's a micro-module aptly titled 'Comment form above comments' which does the job but does so using string replaces on resulting html so it's not the ideal or elegant solution.

It turns out to be simple to get the same effect in code.

First, we need to "configure" the form to appear on a separate page, but only because we're going to manually show it. You can ensure this configuration with the line:

variable_set('comment_form_location_'.$node->type, COMMENT_FORM_SEPARATE_PAGE);

You could even variable_get and re-variable_set after printing the form if you really wanted to.

Next, output the following where you want to display comments, whether in a PHP code block or node template:

$edit = array('nid' => $node->nid);
print comment_form_box($edit) . comment_render($node);

Another recent discovery was that the comment form is hard-coded to redirect to /node after submitting. This hack, as a module, will get you back to the page you submitted from:

function noredirect_comment_form_submit(&$form, &$form_state) {
    $form_state['redirect'] = ltrim($form['#action'], '/');

function noredirect_form_alter(&$form, $form_state, $form_id) {
    if ($form_id == 'comment_form') {
       $form['#action'] = request_uri();
        $form['#submit'][] = 'noredirect_comment_form_submit';

Syndicate content
© 2010-2014 Saigonist.