Sunday, August 31, 2008

how to get faster javascript loading!

High Scalability | Building bigger, faster, more reliable websites.
Don't have a CDN? Why not let Google and Yahoo be your CDN? At least for Ajax libraries. No charge. Google runs a content distribution network and loading architecture for the most popular open source JavaScript libraries, which include: jQuery, prototype, script.aculo.us, MooTools, and dojo. The idea is web pages directly include your library of choice from Google's global, fast, and highly available network. Some have found much better performance and others experienced slower performance. My guess is the performance may be slower if your data center is close to you, but far away users will be much happier. Some negatives: not all libraries are included, you'll load more than you need because all functionality is included. Yahoo has had a similar service for YUI for a while. Remember to have a backup plan for serving your libraries, just in case.

choose a javascript libary best ones?

The JavaScript Library World Cup [JavaScript & AJAX Tutorials]
Well, the short answer to this question is that there is no real stand-out solution that excels in all situations.

Prototype is the most comprehensively documented -- albeit in a splintered way. It is also seemingly the most widespread library at the moment, possibly because it really excels at the kind of tasks developers complete most often, like selecting nodes and working with lists. Of course, it's going to be the natural choice for Ruby developers because it sticks to many Ruby idioms. One other great thing about Prototype is that it has the mighty weight of Rails behind it and, as a result, there are many developers providing bug fixes and patches to Prototype. Finally, it offers a wealth of add-on libraries such as scriptaculous, Rico, and Behaviour that make it a good, solid choice for many developers.

On the other hand, Prototype has a very under-developed event handling framework, which is a major problem for an otherwise powerful library. Also -- and this is purely a matter of taste -- Prototype's super-pragmatic approach to things (like the heavy use of the innerHTML property) can seem a little "dirty" sometimes.

For smaller projects, the decoupled design and fully-featured components of YUI may well be a big plus. It's very easy to drop in the Connection Manager or the Event library and get going on some basic tasks without having to traverse too much of a learning curve. On the whole, though, it doesn't have much to offer in terms of cool or powerful features.

Dojo is definitely the daddy of the bunch -- you can almost always rely on it for the most powerful implementation of any feature. And Dojo's focus on performance is an absolute godsend if you're planning a very JavaScript-intensive application. The widget implementation also has enormous potential for building complex UIs. However it really is quite big -- both in terms of its file size and the size of the API -- so I wouldn't recommend it for smaller projects.

In my opinion, Mochikit is by far the most well designed and well thought out of the four, and Python/Twisted/Nevow developers will definitely find its API very familiar. However, its documentation is a bit thin in some places (for instance, I'm still a little unsure as to which version of the Mochikit distribution to put in the script tag). Also, some of the idioms and functional techniques that it uses may be confusing for beginners or those who aren't well versed in functional programming techniques. However, it really is worth a look. Mochikits's capabilities will probably surprise you -- the createDOM function, iteration tools and the asynchronous architecture are a work of art.

this is great! backup for my websites!


Welcome to s3sync.rb -------------------- Home page, wiki, forum, bug reports, etc: http://s3sync.net This is a ruby program that easily transfers directories between a local directory and an S3 bucket:prefix. It behaves somewhat, but not precisely, like the rsync program. In particular, it shares rsync's peculiar behavior that trailing slashes on the source side are meaningful. See examples below. One benefit over some other comparable tools is that s3sync goes out of its way to mirror the directory structure on S3. Meaning you don't *need* to use s3sync later in order to view your files on S3. You can just as easily use an S3 shell, a web browser (if you used the --public-read option), etc. Note that s3sync is NOT necessarily going to be able to read files you uploaded via some other tool. This includes things uploaded with the old perl version! For best results, start fresh! s3sync runs happily on linux, probably other *ix, and also Windows (except that symlinks and permissions management features don't do anything on Windows). If you get it running somewhere interesting let me know (see below) s3sync is free, and license terms are included in all the source files. If you decide to make it better, or find bugs, please let me know. The original inspiration for this tool is the perl script by the same name which was made by Thorsten von Eicken (and later updated by me). This ruby program does not share any components or logic from that utility; the only relation is that it performs a similar task.

Wednesday, August 13, 2008

watch out for the little babies

Karolyis' sour grapes makes bad whine - Olympics - Yahoo! Sports
This was a nightmare for Marta. She had to watch Sacramone, a 20-year-old woman, crumble under the pressure and stumble off a beam. Meanwhile, the Chinese kept sticking their landings.

“Little babies,” she barked.

It was too much to bear. The little babies had gotten her. The little babies were driving her and her husband nuts.

The little babies were winning gold.

Sunday, August 03, 2008

hmm.....

How To Concentrate
Concentration is the Most Important Intellectual Habit of Man."

Not one person in ten thousand can really concentrate. Some realize that they do not know how—others drift along the line of least resistance and let their minds vegetate, apparently never suspecting their weakness or realizing that they are an utter failure at concentration. To Cori-centre—bringing all your mental force and faculties to bear steadily on a given center with-out deviation from that exact point—whipping into line all wandering fancies—stray ideas or thoughts that go off on a tangent—to hold steadily all your power on the central thing under consideration without an instant of wavering—that is Concentration.

how to type mandarin on mac

Thomas Kho’s Blog » Learning Mandarin Chinese with Mac OS X
Learning Mandarin Chinese with Mac OS X

April 19, 2008 at 9:09 pm · Filed under Computers, General, OS X

I use a Mac probably 90% of the time, so I wanted to share some tips for OS X I picked up that (I hope) are really helpful to the Mandarin Chinese learner.

As a bit of background, let me tell you where I’m coming from: I went to Chinese school for years as a kid and didn’t really learn much of anything. I was never fluent, never really learned enough characters to sufficiently read (let alone write), and then I just stopped caring for some amount of time. Now, I’m back for more learning.

So, here are the tips:

* ITABC Input Method

I haven’t really used Windows in years, but last time I tried, I don’t think it had the pervasive Unicode support to even display Chinese characters in most apps. That said, I was nicely surprised when I found OS X 10.5 comes with a slew of Traditional and Simplified Chinese Input Methods built in. The one I use, ITABC, is dead simple. You just enter pinyin without tones and choose from candidate matches. There are plenty of places online (here’s one at Yale) that can walk you through setting it up.
* CEDICT for Apple Dictionary

Apple includes a dictionary application in OS X. No big deal, right? Well, it’s actually pretty cool, because you can add your own custom dictionaries that integrate as seamlessly as the built-in dictionaries. CEDICT is a Chinese-English dictionary project (here’s an online dictionary based on CEDICT) that’s available as a user dictionary for Dictionary.app. Even better, it also has pronunciations (little sound bites you can play) embedded in dictionary entries.

Here’s CEDICT for Apple Dictionary at Apple Downloads. Just download it and drop it into your /Library/Dictionaries (or ~/Library/Dictionaries).
* Dictionary.app integration throughout OS X

I mentioned seamless integration in that last bullet point. Well, in the Apple way, the dictionary is integrated throughout the system. Hover over some text, hit a hotkey (defaults to Cmd-Ctrl-D, but might I suggest F1), and a little panel pop up (inline, in your application) with the definition.

This hint at Mac OS X Hints reminds us that we can hold down the dictionary hotkey to continuously get the definition of whatever word is currently under the cursor. Say you’re scanning news.google.cn and there are a handful of words you don’t know. Just hit that hotkey, the dictionary entry panel pops up in Safari, and it moves with you as you move the cursor across the sentence.

If the default popup panel is too small for your tastes, this post has a link to a modified DictionaryPanel.app (drop it in /Applications/Dictionary.app/Contents/SharedSupport) that enlarges the popup panel window. Alternatively, you can open up DictionaryPanel.app/Contents/Resources/English.lproj/PopupWindow.nib in Interface Builder and just need to change the size of both the popup window and its content. Be sure to make a backup first!
* ChinesePod on iTunes

Alright, so this last one might be a strech, but I found out about ChinesePod, which is a podcast with lessons in spoken Mandarin. It helps that the podcasters are pretty amusing. How does this tie in? Well, iTunes is setup to scrape the newest lessons and syncs them automatically with my iPod, so I can listen on my way to work. Zero effort necessary!

Alright. That’s it for now. If you know of any other tips, please do share!

Note: This might seem like one big rave for OS X, but I tried really hard to keep that to a minimum. Apple’s just too cool :)

Saturday, August 02, 2008

jay chou love me don't go!

Chinese Music Forum / [Completed] ~Translation~ Jay Chou- 爱我别走
I just heard one of Jay's song in his 2005 concert..
and it's quite a nice song..Check it out!!

周杰伦- 爱我别走
Jay Chou- Love me, don’t go

我到了这个时候还是一样
Wo dao le zhe ke shi jian hai shi yi yang
Having arrived at this moment, I’m still the same

夜里的寂寞容易叫人悲伤
Ye li de ji mo rong yi jiao ren bei shang
Loneliness of the night easily makes people hurt

我不敢想的太多
Wo bu gan xiang de tai duo
I don’t dare to think too much

因为我一个人
Ying wei wo yi ke ren
Because I’m all by myself

迎面而光的月光拉长身影
Ying mian er guang de ye guang la chang shen ying
Facing moonlight, it draws out the silhouette

走在漫无目的的街
Zou zai man wu mu di de jie
Walking by the boundless and endless street

我没有你的消息
Wo mei you ni de xiao xi
I don’t hear your news

因为我在想你
Yin wei wo zai xiang ni
Because I’m thinking of you

Chorus:

爱我别走
Ai wo bie zou
Love me, don’t go

如果你说你不爱我
Ru guo ni shuo ni bu ai wo
If you say you don’t love me

不要听见你真的说出口
Bu yao ding jian ni zhen de shuo chu kou
I don’t want to hear you really said it

再给我一点温柔
Cai gei wo yi dian wen rou
Give me a bit warmth again

--------------------------------------------------

就在今晚抹去对方的肯定
Jiu zai jin wan mo qu dui fang de ken ding
And at this night, erasing the other is for sure

夜里的寂寞容易叫人悲伤
Ye li de ji mo rong yi jiao ren bei shang
Loneliness of the night easily makes people hurt

我没有你的消息
Wo mei you ni de xiao xi
I don’t hear your news

因为我一个人
Ying wei wo yi ke ren
Because I’m all by myself

迎面而光的月光拉长身影
Ying mian er guang de ye guang la chang shen ying
Facing moonlight, it draws out the silhouette

一个人走在漫无目的的街
Yi ke ren zou zai man wu mu di de jie
A person walking by the boundless and endless street

我没有你的消息
Wo mei you ni de xiao xi
I don’t hear your news

因为我在想你
Yin wei wo zai xiang ni
Because I’m thinking of you

爱我别走
Ai wo bie zou
Love me, don’t go

如果你说你不爱我
Ru guo ni shuo ni bu ai wo
If you say you don’t love me

不要听见你真的说出口
Bu yao ding jian ni zhen de shuo chu kou
I don’t want to hear you really said it

再给我一点温柔
Cai gei wo yi dian wen rou
Give me a bit warmth again

Tuesday, July 29, 2008

drink some eel!

Eel Drink Goes On Sale For Japan's Hot Summer, `Energy Boosting' Eel Drink Goes On Sale For Japan's Hot Summer - CBS News
A canned drink called "Unagi Nobori," or "Surging Eel," made by Japan Tobacco Inc., hit the nation's stores this month just ahead of Japan's annual eel-eating season, company spokesman Kazunori Hayashi said Monday.

"It's mainly for men who are exhausted by the summer's heat," Hayashi said of the beverage, believed to be the first mass-produced eel drink in Japan.

Many Japanese believe eating eel boosts stamina in hot weather.

The fizzy, yellow-colored drink contains extracts from the head and bones of eel and five vitamins _ A, B1, B2, D and E _ contained in the fish.

Tuesday, July 22, 2008

how to clean blackberry trackball

How to clean your BlackBerry’s Trackball | BlackBerryInsight
Today it was enough! The problem is, I cannot afford to loose that phone for maybe several weeks while it will be repaired. So I searched forums, googled (even yahooed) and found a lot of stuff which had not really an answer to my question. I remembered an article some months ago which mentioned the coloring the of the Pearl’s trackball by coloring the LED beneath the trackball. Finally I realized that removing the pearl’s cover would the best way to get access to its sensor and clean it. By the way, this should work for all BlackBerry devices that carry a trackball around like BlackBerry Pearl, Curve, 8800 and 8830.

The silver ring which covers the trackball can easily be removed if you use a small screwdriver to lift it at the outer side of the ring. Be careful here! Like you should be during the whole process as all parts have very small plastic nipple which can break very easy. When the silver plastic ring is removed you will see the inner trackball component which can be removed completely. Before doing this you should carefully remove the silver metal ring that holds the trackball component in its position. The trackball component itself can also be carved. For every direction the ball can roll to you’ll find a sensor wheel. Those wheels are mostly carrying some gunk you should clean them from. Once this is done put everything back together to the place the pieces came from and secure the trackball with the silver plastic ring you removed in the first step. Your BlackBerry’s trackball should be back working now.

Friday, July 04, 2008

food that are good for you

The 11 Best Foods You Arent Eating - Well - Tara Parker-Pope - Health - New York Times Blog
# Beets: Think of beets as red spinach, Dr. Bowden said, because they are a rich source of folate as well as natural red pigments that may be cancer fighters.
How to eat: Fresh, raw and grated to make a salad. Heating decreases the antioxidant power.
# Cabbage: Loaded with nutrients like sulforaphane, a chemical said to boost cancer-fighting enzymes.
How to eat: Asian-style slaw or as a crunchy topping on burgers and sandwiches.
# Swiss chard: A leafy green vegetable packed with carotenoids that protect aging eyes.
How to eat it: Chop and saute in olive oil.
# Cinnamon: May help control blood sugar and cholesterol.
How to eat it: Sprinkle on coffee or oatmeal.
# Pomegranate juice: Appears to lower blood pressure and loaded with antioxidants.
How to eat: Just drink it.

Tuesday, June 24, 2008

serialversionUID generator for intellij

IntelliJ IDEA « Just Five Minutes
Cleaning up code I launched serialver to create serialVersionUIDs for some serializable classes. Wondering why IntelliJ IDEA did not seem to provide a generator for UIDs, I browsed the code inspection settings and it turns out that there actually is one - but it is disabled by default. To use it, go to

Settings -> Errors -> Serialization issues -> Serializable class without ’serialVersionUID’

When editing a Serializable class without a serialVersionUID field set, IDEA now displays a warning and provides a Quickfix (Alt+Enter) to generate one.


props to this guy!

Thursday, June 19, 2008

chinese is the new black

China Journal : In South Africa, Chinese is the New Black
In South Africa, Chinese is the New Black

A high court in South Africa ruled on Wednesday that Chinese-South Africans will be reclassified as “black,” a term that includes black Africans, Indians and others who were subject to discrimination under apartheid. As a result of this ruling, ethnically Chinese citizens will be able to benefit from government affirmative action policies aimed at undoing the effects of apartheid.

In 2006, the Chinese Association of South Africa sued the government, claiming that its members were being discriminated against because they were being treated as whites and thus failed to qualify for business contracts and job promotions reserved for victims of apartheid. The association successfully argued that, since Chinese-South Africans had been treated unequally under apartheid, they should be reclassified in order to redress wrongs of the past.

Wednesday, June 18, 2008

how to control your anger

Soccer Parents: Why They Rage
Jay Goldstein’s tips for not becoming one of those parents

When you feel your anger rising at something you see on the field:

* Controlled deep breathing exercises (inhale for 4 seconds and exhale for 8 seconds)
* Suck on a lollipop (Occupies your mouth and reminds you that you’re there for your child.)
* Visualize a relaxing experience like floating on water.
* Repeat a calm word or phrase.
* Do yoga-like muscle stretches.
* Replace angry thoughts with rational ones, such as “This is my child’s game, not mine,” or “Mistakes are opportunities to learn.”
* Don’t say the first thing that comes into your head. Count to 10 and think about possible responses.
* If you did not see the game, first ask your child “How did you play?” rather than “Did you win?”
* Praise your child’s effort, then, maybe, comment on the results.
* Use humor, but avoid harsh or sarcastic humor. Picture the referee wearing Elton John glasses.

Thursday, June 12, 2008

who is the mommy!

Cover Story - When Mom and Dad Share It All - Adventures in Equal Parenting - Lisa Belkin - NYTimes.com
Harlyn Aizley, mother of a 6-year-old daughter, describes the moment that her then-partner, Faith Soloway, first took their newborn in her arms in the delivery room. “Just moments after I gave birth,” Aizley writes in the anthology “Confessions of the Other Mother: Nonbiological Lesbian Moms Tell All,” “Faith scooped up the baby, cooed into her squishy newborn face and said: ‘Hello there. I’m your mommy.’ I wanted to kill her. Faith, that is. I wanted to be Mommy, the only Mommy.”

Thursday, June 05, 2008

pick up your pooo

Scoop It Up or Pay - On Patrol With Enforcers of the Dog Law - NYTimes.com
He could see all the telltale signs of negligent intent: the irritated expression, the hurried pace, the absence of a plastic bag in the pocket. “People who pick up have time,” he said earlier. “You can look at some people right away and say, ‘This person is not going to pick up after their dog.’ ”

Monday, May 26, 2008

When upgrading Wordpress from 2.3 to 2.5 make sure you change your permalink.

My Life and Times › Permalink Settings — WordPress
Customize Permalink Structure

By default WordPress uses web URLs which have question marks and lots of numbers in them, however WordPress offers you the ability to create a custom URL structure for your permalinks and archives. This can improve the aesthetics, usability, and forward-compatibility of your links. A number of tags are available, and here are some examples to get you started.

Friday, May 23, 2008

External Drive NTFS for Macs!

How-to: Read and Write NTFS Windows Partition on Mac OS X - Stepcase Lifehack
How-to: Read and Write NTFS Windows Partition on Mac OS X

Updated: from MacFuse 0.1.0 Beta 6 to 0.1.7

Users running Mac OS X with Bootcamp Windows may struggle to modify or update your documents and files in the Windows partition - usually it is in NTFS File System format which you can read the drive natively in Mac OS X but not write onto it.

Recently Amit Singh, a Google employee, releases a implementation called MacFUSE which makes it possible to use any FUSE (File-system in USErspace) file systems in Mac. And the most useful FUSE is the NTFS-3G Read/Write Driver, which ables system to load NTFS with read and write capability. This is truly the greatest news for dual booting Mac OS X and Windows XP or Vista.

Without going into great deal of technical details and compilation of the source code, I found out users around Internet already came up with binary version (in DMG) of MacFUSE and ntfs-3g, ready to install (credit to ShadowOfGed at AppleNova). Here are the instructions on how to use MacFUSE and NTFS-3G. It does require a little of administration skills as it involves running commands in the Terminal.

MacFUSE/NTFS-3G works for me, but as this is an experimental software, so back up your data, and try it at your own risk.

* Download and Install MacFuse 0.1.7 DMG


This works great! I use it for my laptop to connect to my image drive!

How to scale twitter

Scaling Twitter redux--the ESB should be your best friend | Negative Approach - CNET News.com
Scaling Twitter redux--the ESB should be your best friend
Posted by Dave Rosenberg 1 comment

As we Twitt-iots sit around bemoaning the fact that we can't send each other useless junk on a flaky service, I thought I would take this chance to address the notion that this message-scaling problem is new.

It's not. It's very common, and it can be solved.

Scaling a messaging platform is why IBM sells a boatload of MQ series, why the AMQP protocol was developed, and why JMS is nearly ubiquitous. Pretty much every large enterprise has similar scale issues related to messaging, especially in financial services. But they don't have downtime, and if they did as frequently as Twitter, the people behind them would all get fired.

This is a topic I actually know something about. (Disclosure: my company develops an open-source enterprise service bus, or ESB, called Mule.) All of our use cases involve some kind of complicated messaging architecture, whether it be Web-service based, publish and subscribe, one to many, direct connection, etc. And most deal with data transformations and a vast array of protocols.

In my view, what Twitter needs is to adopt a bus-type of architecture that separates the transport from the application and uses a middleman to process the transactions. This is a very common enterprise scenario that needs to be applied. This is what an ESB does.



publish and subscribe!

Sars Information

Damn Interesting
The Heroes of SARS
Written by Matt Castle on May 23rd, 2008 at 1:00 am

On 21 February 2003, a physician in Hong Kong was feeling particularly unwell. He must have had an inkling that something serious was amiss, for his symptoms closely matched those of a number of patients he had treated in recent weeks: fever, aching muscles, headache, a dry cough, and shortness of breath. An alarmingly high proportion of these people had become critically ill, with inflamed, fluid-saturated lungs. Breathing was rendered somewhat difficult, and death frequently followed.

Wednesday, May 21, 2008

hi sir

hi sir this is a test blog! sorry i am testing my software