Javascript 通用筛选功能

如何对 HTML 上的元素,如表格,列表或者 DIV 等等按照关键字进行筛选呢?最简单的方法是通过循环遍历各个元素,对比关键字与元素的 inner html 内容。但是,这个方法有一个很大的缺陷。例如,如果对跨行的表格 tr 进行筛选呢?在显示上,跨行的 tr 与其他 tr 显示在同一行,但是它们的 inner html 往往却不同。而代码上,它们又在不同的 tr 上。所以,隐藏了跨行的 tr 会破坏整个表格的布局。对于这个问题,我们的解决方案是对任何可筛选的元素添加匹配字符串变量,这样,筛选功能就变得更加通用和灵活了。因为,就算 tr 的内容不一样,我们仍然可以在代码中设置相同的匹配字符串变量,使其在筛选中被同样处理,显示或者隐藏。下面我们简单介绍筛选功能的 javascript:

示范例子

<pre>

… … … … …
菜系 菜名 价钱
粤菜烧汁茄子10.00
烧鸭20.00
西芹炒百合15.00
东北菜酱骨架35.00
火龙鱼70.00
湘菜xxxx.xx
潮菜xxxx.xx
越菜xxxx.xx
寿司xxxx.xx
清真xxxx.xx


<pre> function strip_spaces(stripee) { return stripee.replace(/(^[ ]*) | ([ ]*$)/g,''); }

function filter(id, criteria) {
var t = $(id);
if (!t) { return; }

t.getElementsByClassName(‘no_matched_notice’).each(function(elem) { elem.remove(); }); var notice_msg = ‘No matching data found!’; criteria = strip_spaces(criteria);

empty_input = criteria.length === 0;

var matched_none = true; t.childElements().each(function(elem) { // if the user doesn’t input anything, then show all the elements if (!elem.matched_strs || empty_input) { Element.show(elem); } else { // else find the element matched = false; elem.matched_strs.each(function(str) { if (str.toUpperCase().indexOf(criteria.toUpperCase()) != -1) { matched = true; matched_none = false; return; } }); matched ? Element.show(elem) : Element.hide(elem); } }); if (matched_none && !empty_input) { var tag = t.tagName; var ins = null; switch (tag) { case “TBODY”: case “TABLE”: ins = new Insertion.Bottom(t, “”no_matched_notice\“>” + notice_msg + “”); break; case “OL”: case “UL”: ins = new Insertion.Bottom(t, “”no_matched_notice\“>” + notice_msg + “”); break; default: ins = new Insertion.Bottom(t, “<” + tag + " class=\“no_matched_notice\”>" + notice_msg + “</” + tag + “>”); break; } }

}

在 HTML中,我们需要做的工作是:

1) 添加匹配字符串到所有可匹配元素上,为了能够匹配多个关键字,将以数组的形式存储:
<pre> $('tr_01').matched_strs = ["粤菜", "烧汁茄子", "烧鸭", "西芹炒百合"]; $('tr_02').matched_strs = ["粤菜", "烧汁茄子", "烧鸭", "西芹炒百合"]; $('tr_03').matched_strs = ["粤菜", "烧汁茄子", "烧鸭", "西芹炒百合"];

$(‘tr_04’).matched_strs = [“东北菜”, “酱骨架”, “火龙鱼”];
$(‘tr_05’).matched_strs = [“东北菜”, “酱骨架”, “火龙鱼”];

2) 添加筛选关键字的输入框:
<pre> <input id="keyword" type="text" /> </pre>

3) 绑定 filter 函数到输入框事件上:
<pre>

$(‘keyword’).onkeyup = function() {filter(‘food’, this.value);};
$(‘keyword’).onchange = function() {filter(‘food’, this.value);};

恭喜你,完成了!

Posted by Shaokun 04 Dec 2007 at 04:33PM


Javascript Filter on table, ol, ul...

It’s very common to enter a keyword and then filter it in a table or list. The easiest way could be go through each item of the table or list and then compare the keyword with the inner html of that item. But there is a drawback of this method. For instance, how to do filter in a table which has rows whose rowspan are set to bigger than 1? The code will break the layout of that table completely.

The method will come out with is to add a matching keyword to every item that are filterable. In other words, instead of comparing with the inner html, the code do it with the matching keyword. This gives the filter more flexibility. We will discuss the code a little bit belows. Note that it’s built on Prototype and used in Ruby on Rails. So, we have helper function to generate javascript in view too. But here, we just talk about the pure javascript part.

Here is an EXAMPLE

<pre> function strip_spaces(stripee) { return stripee.replace(/(^[ ]*) | ([ ]*$)/g,''); }

function filter(id, criteria) {
var t = $(id);
if (!t) { return; }

t.getElementsByClassName(‘no_matched_notice’).each(function(elem) { elem.remove(); }); var notice_msg = ‘No matching data found!’; criteria = strip_spaces(criteria);

empty_input = criteria.length === 0;

var matched_none = true; t.childElements().each(function(elem) { // if the user doesn’t input anything, then show all the elements if (!elem.matched_strs || empty_input) { Element.show(elem); } else { // else find the element matched = false; elem.matched_strs.each(function(str) { if (str.toUpperCase().indexOf(criteria.toUpperCase()) != -1) { matched = true; matched_none = false; return; } }); matched ? Element.show(elem) : Element.hide(elem); } }); if (matched_none && !empty_input) { var tag = t.tagName; var ins = null; switch (tag) { case “TBODY”: case “TABLE”: ins = new Insertion.Bottom(t, “”no_matched_notice\“>” + notice_msg + “”); break; case “OL”: case “UL”: ins = new Insertion.Bottom(t, “”no_matched_notice\“>” + notice_msg + “”); break; default: ins = new Insertion.Bottom(t, “<” + tag + " class=\“no_matched_notice\”>" + notice_msg + “</” + tag + “>”); break; } }

}

In html, all we need to do are:

1) add an array of keyword to each item which is filterable
<pre> $('tr_01').matched_strs = ["apple", "banana", "pineapple", ..., "pear"]) $('tr_02').matched_strs = ["bamboo", "eggplant", "cabbage", ..., "pepper"]) ... $('tr_02').matched_strs = ["elephant", "tiger", "monkey", ..., "fish"]) </pre>

2) add a text field to enter keyword:
<pre> <input id="keyword" type="text" /> </pre>

3) bind filter function to keyword’s event:
<pre> $('keyword').onkeyup = function() {filter('food', this.value);}; $('keyword').onchange = function() {filter('food', this.value);}; </pre>

That’s it! :)

Posted by Shaokun 04 Dec 2007 at 03:27PM


Textmate script to restart mongrel

I often find myself needing to restart the rails app I am working on while in Textmate. Sure, its easy enough to switch to a terminal window and hit up-arrow, but since Textmate is a wonderfully developer friendly app, I decided to see what I could do about automating a common task.

In Textmate go to Bundles → Bundle Editor → Edit Commands

Use the + at the bottom to create a new Command

This gives you a blank template for a new command. The command editor gives you control over several aspects of your current working document and project. Since this is an app restart for development purposes, I choose to save all files before executing the command. Then, I just put in a few shell commands that will be executed directly. I like to do a clean restart so that the same script works even if this is the first time starting it up:

<pre> echo "Restarting the App..." cd "$TM_PROJECT_DIRECTORY" mongrel_rails stop mongrel_rails start -d -p4040 </pre>

This command takes no input, and puts the output into a tooltip. Finally, I need to select a key combination. cmd-R is taken, so I settled on cmd-G (for GO!).

That’s it. My very own custom command in Textmate in under 5 min. I leave the “Stop App” command as an exercise for the user.

Posted by adevadeh 03 Dec 2007 at 10:40PM


Drift Wood for sale on Alibaba

Just found this on Alibaba while looking into an idea for a new web service (and, simultaneously, a source for whitewater rafts, since I learned this weekend that the proper keyword for this is "drift"). Not that is hard to find unusual things there.Still, interesting. I guess drift wood is a kind of seafood... makes sense:
GUAN CHUAN SEAFOOD TRADER (1997)

Contract Base Supply of Drift Wood.

Inquire Now Offline
Post Date: Dec 01, 2007
Expiry date: May 29, 2008
Detailed Selling Lead Description
We can supply, on contract basis naturally dried, sea drifted wood naturally shaped and washed ashore on tropical island. All enquiries welcome.
Address: 61 Neo Tiew Road Singapore 719021, SG
Link But really, the point was to make a quick informal survey of the quality of the english translations on the site. Hm, perhaps a better way to do this is to search for words that can only have been the result of poor translation. Or maybe not?

STICKY SHIT,TOYS,TOY

Nov 29, 2007
WE ARE THE BEST MANUFACTURER ALL KINDS OF STICKY SHIT ...
What's Gold Supplier?
And they are a GOLD supplier. I'm impressed. Ok, enough. Summary: Translations are almost perfect. Not surprising, since I think listing on Alibaba always involves personal assistance from an english speaking Alibaba employee.

Blogged with Flock

Posted by Uli 03 Dec 2007 at 01:58PM


Yunnan - Tiger Leaping Gorge

Some of the best adventures start with someone telling you "You can't go". In this case, this is what I am told in Lijiang when asking about Tiger Leaping Gorge hike. There was a landslide, so it's closed.   Oh well, I think... "Closed" wouldn't stop me in South America, but I'm in China and can't talk my way into and out of things. Besides, it's been raining, I only have 2 days and my foot hurts anyway.

So I decide to go to Shangrila instead, 5 hours up into the mountains from Lijiang.

On the way, as we descend into the Yangtze valley, I am glued to the window... beautiful scenery. And then, we pass through Qiao Tou, the trailhead for hiking the Gorge. Before I know it, I'm off the bus. As it leaves, I'm in a classic NowWhat situation.... what have I done, now I am stuck in some random town where no one speaks english!

A few seconds, later, and SUV stops. Two foreigners give me the scoop: Call Jane, have her pick you up and sneak you past the guards, stay at her Tibetan guest house, then leaving early in the morning before anyone notices.

I'm still a bit hesitant.. after all, I haven't told anyone what I'm doing, and I should be online for emergencies this weekend. So I order some food and some cold water, and go online. Good connection. Great eggplant and wild mushrooms. I send the warm beer back that came in lieu of the water, and eventually settle for frozen carbonated coffee cola that comes as a replacement for the beer.

Given that I'm online, I call Jane who turns out to be Tibetan indeed... I do a few hours of work, and as I wake up I notice that my toe (which had been hurting) is now positively infected. I can barely walk in my hiking shoes.

The other hikers who stayed at Jane's leave, and I calmly pack up and decide I might as well try for half an hour, and start walking with one hiking boot and one sandal.

It's not really working.. foot hurts too much. Bummer. Oh well... I'll come back. But if I come back anyway, no point in staying on the trail, is there?

So here it is, once again.. the moment that changes everything.

I decide to take a small foot path straight up the mountain. After passing two people who keep telling me I should go back, the trail is further down, I come to a third man who insists that I should go back. I hesitate. after all, what's the point of walking randomly up a mountain with my whole traveling pack. I curiously look through the gate into his courtyard, and before I know it, I am invited in and I have to stay for breakfast.

He explains that his daughter speaks english and will be there soon... so for now I limit myself to looking around, smiling, and cracking the fresh walnuts he gives me, while he splits some wood and starts a fire, clearly excited about making breakfast.

The house looks very well built, but half abandoned.. lots of gear lying around, indications of a formerly working farm. But -- there is no land to farm, at least not enough to support such a serious house... There is brand new solar water heater, a satellite TV dish. Wood neatly piled up in a half finished section of the house. A machine for, as it turns out, making noodles. Another one for making some kind of flour, running off an electric motor. A stove that looks exactly like the ones the peace corps tries to get people to build in South America.

The daughter and her friend eventually come out, between some initial shyness and lots of giggling we figure out that their english is about as good as my mandarin. Somehow, though, between that and sign language, we figure things out. Her father drives a taxi, in Shangrila. That explains the car key dangling from his belt. They live in Shangrila, and only come to their country house on weekends.  I take of my sock, show my infected toe, and explain that I want to go through the gorge but can not.

At this point, breakfast is ready.. it consists of steamed bread and a liquid that looks like corn soup. It's not. It's made by putting hot water,a piece of what appears to be butter, and some green leaves into a bamboo tube, sticking a plunger in it, mixing it well, and pouring it throw strainer that seems to be hand made from vines or bamboo fiber. I have a slight suspicion that this is Yak butter tea, but it doesn't really fit the description... I'll find out soon, I guess, in Shangrila. It tastes quite good... buttery, who'd have thunk. Mr Taxi driver then explains that he has a horse, and asks me if I know how to ride a horse. Yes, I say, not thinking much of it. He then points to my foot and asks if I want to use his horse, since i can't walk...

He first suggests a two day trip, but I'm thinking my foot isn't that bad, and an overnight trip requires more logistics for both sides. So we settle on getting me to halfway house, about 5h from where we are.

I quickly check my email and schedule a conference call between DC, CA and China for monday morning, and then we head off... after 2 minutes, Mr Taxi driver runs into a younger guy and after a short conversation they decide that that younger guy will go with me instead. Fair enough.

The "horse", which I decide to call farty, turns out to be a very good and well mannered mule.

The trail is beautiful, with fantastic views of mountains and the river far below. I am in awe about the beauty of the houses here.. it reminds me of Bali.. such a nice surprise in an area so economically poor.

Lots of new construction, even here... We stop at Tea Horse Guest House for lunch - nice people, fantastic food and cute puppies. This would be a fantastic place to stay, beautiful rooms with a great view. But, no CDMA internet coverage. Bummer.

So we continue on... a few minutes the mystery of solar water heaters and washing machines on top of a mountain is solved-- there is a jeep up here, so there must be a road. More beautiful views, walnuts apples and pears along the trail (apples turn out to be great rewards for farty, who is starting to get tired).

The trail is marginally doable on muleback, and feeling sorry for farty I get off in a few places and walk.

We pass some Chinese hikers, and my guide ends up carrying their backpacks for them - good for him, another 50 RMB. Poor farty, though, as eventually the backpacks are strapped to his saddle.

At around 2pm we pass a group of 4 teenage girls, a women who looks like she could be mother, and one young man loading rocks into the bed of a pickup truck. It's a strange sight.. a combination of sad and cute, watching them cheerfully make a team effort to lift heavy rocks into the truck. They wave and giggle as we pass by, and shyly say "hello" and "how are you", practicing their english. Eventually, after passing two moderately motivated guys trying to fix the road after a landslide,  we arrive at Halfway. Bye bye, Farty.

The views are incredible, the owner is very nice, and... there is CDMA! The rooms are ridiculously nice, given where we are, with brand new modern bathrooms, including heat lamps!

I decide to stay, and ask him what the white powder in the giant wok over the fire is. He says, in decent english, that it is Tungsten. I don't believe it until he starts talking about light bulbs, and I try to lift one of the sacks, and it's 5x heavier than one would expect.

So as a short afternoon walk I decide to visit his Tungsten "Factory"; sounds like he has a sluice box that somehow collects tungsten ore particles from a stream.

On the way there, I get lost again, see some nice farm terraces (corn, sunflowees, vegetables, lots of pumpkin, and walnut trees), and get to a dead end. I head back, and just as I get to the road. a truck comes towards me, and on it are 4 giggly teenage girls eating apples. I signal that I want a ride, and before I know it I am in the back as well, eating an apple and trying to hold on. The destination turns out to be the landslide just before Halfway house... we all get off, and the rocks are dumped out. The girls get to work immediately. A lot of rocks fell into drainage ditch beside the road, and I decide that this is a great way to get exercise without having to aggravate my foot further. Amazingly, the girl I pass the rocks from the ditch to manages to dispose of them faster than I can supply them; and she weighs about half as much as I do and has probably worked all day. More giggling. After the ditch is clean of rocks, I say goodbye and head on to halfway house.

The tungsten refinery is in full swing, and another sack of wet tungsten ore is poured into the Wok. I have dinner with the two Chinese backpackers who didn't want to carry their packs. After dinner I have a second dinner with the owner's family, and -- the road work crew from before. It's the owner's wife, his daughter, and 3 employees who usually help at the guest house, but since the gorge is closed there were few visitors and they were commandeered to do road work. A close look at one of the girl's hands shows that this happens a lot -- she is missing one nail and has lots of bruises and scars. I feel like a baby with my infected little toe.

We look at some pictures, more giggling, then at Google Earth. Tungsten Miner, Guesthouse owner, and (according to LP) medicinal plant tour guide decides to offer internet access at his guest house. What an amazing enterprising guy!

I ask lots of questions about hikes that can be done from there; there is a trail up to the glacier. About 5h to a little hut (occupied part time by yak herders), from there another 5 or so to the glacier. It's possible to hike over a pass (3800m) into the next valley.

And now, exhausted and sore, I'm in bed, typing this up. What a day!

Blogged with Flock

Posted by Uli 27 Nov 2007 at 06:05AM


Exploring Lamma Island, Hong Kong

Lamma island -- after doing some reading online, this seemed to be the place to be in Hong Kong for crazy people like me who'd rather be closer to the beach and hiking trails than to the karaoke bar. You know you are desperate to get away when the island that sounds like the most attractive destination features a huge power plant that looks like it came straight from a Japanese urban monster movie. But everything else sounded appealing, and, frankly, hard to believe. A place within 20 minutes of central Hong Kong that has no cars, just walking trails? Beaches where you can actually swim without transforming into the protagonist in above-mentioned type of movie? I had to check it out. The walk from my hotel to the ferry dock was the usual Hong Kong experience of 3-dimensional urban planning, involving elevators passing through buildings, walkways across roads, and crossing a huge mall. Switters would have felt safe here -- my feet never touched the ground. The boat connections are great, running every half hour or so. There are ferry piers in two villages on the island; I went to Sok Kwu Wan (40 min) and planned on coming back from Yung Shue Wan (20 min, more frequent service, until midnight!). You pay with the very practical octopus proximity card (which also works for the subway) -- only 2 US$. The first thing I noticed as the ferry arrived in Sok Kwu Wan were the floating aquaculture setups built using 55 gallon drums; very similar to one of my crazy projects in Panama, but at a much larger scale. I'll have to come back with someone who speaks cantonese to find a way to check them out that does not involve swimming. The bay did *not* look clean. The village is small and looks somewhat dilapidated... much more like a fishing village than I was expecting. I was delighted. So now what? There is a trail that goes to Yung Shue Wan, but that's the one everyone writes about, and as usual, I wanted to get off the beaten path.
I decided to follow the "family trail" in the other direction, going around the island clockwise, leading straight away from the main populated part of the village. They might as well have called it "rollerblading trail" -- although only about 5 feet wide, it is paved for all of its 15km or so. And they actually have vehicles to drive on it. This one looked like it was custom built with a 4kw generator.
The first few minutes of the trail featured an octopus-accepting vending machine, registered trees number T 20 through T 36, and registered slope 15NW. Apparently, even unregistered trees are more important than registered slopes, so they get to keep a little bit of soil around them. Nice.
And then I spotted an opportunity to step off the concrete... some barely visible stairs cut into the rock, leading straight up the hill. I have been in this situation so many times... the trail twigs (I wouldn't say branch here...) - you don't know where, or even if, it will go. There no sign, probably because no sane person would even try to go. I almost always take the twigs (not just when hiking, but that's another story), and it's almost always worth it.
In this case, the trail actually improved, and so did the views. It led to the top of the highest hill in the area, probably about 300m high (20 min)

At the top, there was a group of workers sharpening their tools for chopping down the vegetation. We had a  nice chat... they came from Kowloon to work here, and weren't sure why they were asked to chop everything down. They seemed to wonder, though, as they had clearly discussed this and came to the conclusion that it was to avoid fire hazards. Interesting...

After enjoying the view, I went back down on the other side of the hill, using the walkway that normal people use, passing more registered trees and slopes.

Between trees growing out of rounded faux rock concrete, high voltage equipment and walkway lights, and literally hundreds of skyscrapers in the background, I felt like I was in some kind of science fiction story, and about to find out that the registered trees were all fake.
       

This was clearly not the case -- by now I was having an incredibly enjoyable time in real nature, with stunning views and beautiful details to enjoy.


A few minutes later I passed through a little village with some nice old, and newer, buildings. It seemed a very unlikely location for a rural village, but there it was. People grew bananas and taro (the swamp variety, dasheen in Panama)


 One of my objectives for the day was to go for a swim -- and the protected cove I saw from the hill seemed to be the perfect spot. 

The way there featured many more atractions of twig nature, so it took me quite a while to get there. On the way, I found many lookout points, shrines, and... ruins of abandoned buildings. How very strange... 45 minutes from here you can rent apartments for USD $30,000 per month, and people put up with small sinks to save space. And nobody wants to live here?  I don't get it. I'd love to find out what is going on with this...


    


Eventually, i did manage to reach the beach. There were a couple of buildings there, almost completely abandoned. I counted 3 residents who were about 250 years old total. I wished I could talk to them... and I hope someone does, and writes down their stories of what they have experienced while living in such a place. I went for a refreshing swim... very nice, except for a few dead sardines floating in the water. The place was deserted enough to swim in my underwear without offending anyone, and there was even a public toilet with running water and a bucket to rinse off the salt and any traces of godzillitis-inducing substances. (Yes, I am spoiled.. the beach was truly beautiful, and the water was nice. I'm just trying to be funny. Ignore it).
And then.. kayaks. old ones, but they were certainly kayaks. Even a home-made outrigger canoe-type contraption (involving PVC pipe as outrigger and traces of disintegrated duct tape). An incredibly tasteful water collection barrel (no sarcasm here). Peeling paint on "For Rent" signs. How very intriguing...
How can it be that on my first day exploring Hong Kong I manage to find the kind of place that I would have expected anywhere else, but not here. (Ok, maybe not in NY city either)? I love travelling, I really do. And somehow I knew that the only other person in sight, who is swimming, would have a story to tell. Sure enough -- a very friendly lady from Scotland told me about a guy who ran a hostel there, who built furniture form driftwood, which he transported using his surfboard. The hostel is still there, and the 80 something year old local lady taking care of it (unless she is on her way carrying her starfruit harvest to town to sell it) is happy to rent out bunks or one of two small apartments, which supposedly even have an internet connection. Once again, I wished I knew some cantonese.
Did I mention I love travelling? I decided not to attempt to hitch a ride with a Chinese family who had come for the day in a rented junk, and instead, head to the village to find a place to stay. I had seen enough to know I'd need to spend more time here. So much more to explore... bunkers supposedly used to store kamikaze boats in WWII, and many miles of coastline, and, most of all, plenty of potential for more pleasant surprises.
Many moreincreasingly justifiably registered trees later, I started getting back into civilization...

  

On another, much more developed beach, I saw an interesting type of rescue kayak, but none of the three lifeguards protecting zero swimmers from the dangerous ocean knew how to roll and what a sprayskirt is for. Interesting.


 

 Approaching the village, the practicalities of an island without cars became more and more entertaining... In an odd way I was reminded of Isla Bastimentos in Bocas. Concrete walkways, bicycles, houses on stilts, people bailing boats in ingenious ways, etc.


When I reached town, I had half an hour to secure a place to stay, with internet. A local real estate agent named Stephen was incredibly helpful, and I rented a small apartment for a few days that he manages for one of his clients.

What a day... a good reminder that it's ALWAYS worth to get out and explore!

Posted by Uli 26 Nov 2007 at 01:10AM


A hike on Lamma Island, Hong Kong

On my first hike around Lamma Island, I noticed a trail that appeared to go to the top of a peak that promised a great view... That day I did not have time to go, but now, a couple of weeks later, we decided to go. But let me back up... the day before, we had a few extra hours in Hong Kong, so Andy and I bought new cameras. What else would two geeks do in Hong Kong? And of course, they needed to be tried out the same day; none of us had been to the Peak, one of the main attractions in Hong Kong -- we missed the sunset, but Andy still managed to take some great pictures. I really don't like cities all that much, but Hong Kong is fascinating, just because of the sheer scale, and the contrasts... We saw the nightly light show; somewhat disappointing, but still impressive.
Ok, back to the hike on Lamma Island. We had managed to pick one of the hottest days of the year for it, and there is absolutely no shade on the trail... the hike ended up being a lot more challenging than expected. But also more rewarding... We got a good workout, and the views were fantastic. We walked from Yun Shue Wan to Sok Kwu Wan, then on towards Tung O, but instead of going down to the beach, we went right, past the red pavillion on the little pass that crosses the island's main ridge. At this point we were joined by another group of hikers, who first passed us, but soon slowed down. One of them, a guy from Finland, actually decided to lie down on the trail. At first I didn't realize that he was in bad shape... but when he asked me to get some water out of his backpack, it became obvious that he was in trouble. Clearly he was not used to the combination of heat and elevation gain... he finished his water, seemed to be doing better, and then slowly headed down to the pavilion, while we continued to the top.
The hike took a whole lot longer than I expected, and I had a flight to Manila the same day in the evening. I was enjoying being outside and getting workout, so I lost track of the time; when we checked the ferry schedule later it became clear that I'd have to hurry back to make it in time. So I decided to run ahead... I had about 1 hour to catch the ferry, and was a 2 hour walk away from the ferry dock, and certainly needed to take a shower before getting on a plane. Fortunately, I knew the 2 hour estimate was the official trail hiking time for your average hiker in this area... and such times tend to be inflated proportionally to population density in the area.
So I started running. The first section was supposed to take 45 min, and it took me 14 minutes. That was quite encouraging... the trail from Sok Kwu Wan, however, was to steep for me to make it in less than one third of the official time, it took me about 30 min. And then -- well, the ferry schedule information was somewhat inaccurate, and I was so exhausted that I just wanted to lie down... (after drinking about half a gallon of water) I ended up changing the flight anyway. Oh well... it was worth it, for a wonderful day and a healthy workout.


Posted by Uli 26 Nov 2007 at 12:52AM


The site of 3rd conference of Chinese Communist

It's just about 50 meters aways from our office. Built with red brick, very common at that age in Canton.

Posted by Shaokun 25 Nov 2007 at 10:06PM


Respect For Trees

There are a lot of trees in our neighborhood. And people respect them and would rather build around them than chop them down. I like that.

Posted by Uli 25 Nov 2007 at 04:22PM