Less is More in Coding

There is a saying within eBay that the lines of codes of eBay is more than Windows and Linux combined. Well… It is not a compliment from where I stand. The less the code is, the more powerful it can be.

With OOP (Object Oriented Programing), and the right level of abstraction, code can be very simple, very concise, easy to read, but remain more flexible and powerful. I spent the last few weeks rewriting some code with one principle in mind – just to push the limit to have less code. I have successfully turned a 2000 lines code into 250 lines, and another few thousands into 250 lines. I just feel 250 lines of code is a magic number to accomplish a lot. My goal of writing PHP code is, put less than 7 lines (ideally 3 lines or 1 line) into a function, and as less function as possible, while still maintain a very high level of flexibility and functionality. I believe one day I will share some sample codes.

Sony CX500E is Wonderful

After using Sony CX500E for a while, I have to say, I am extremely satisfied with this camcorder. Just like the Sony P8 camera, this Sony product is perfect, and I always feel I am lucky to choose it. There are several reasons.

  1. The SteadyShot feature is amazing. I can take video when I am walking, even running a little bit, but the final result is just like the camera were mounted to a tripod – very clear.
  2. The 12X zoom is wonderful, and useful.
  3. The bright image it captures. It is much better than the dark image of Nikon.
  4. I didn’t have any expectation for the software coming with any hardware, but the PMB (Photo Motion Browser) was wonderful, even better than Picasa.
  5. The nightshot is a must for me – to record Yifan at night when Wendy and I was telling story to him at night
  6. The camera is relatively small to carry. With CX500E, I don’t need to carry cameras at all.
  7. The big LCD screen and touch screen feature – wonderful

I have recorded many video (12G of them). I still didn’t figure out a way to share them yet – I don’t feel comfortable to upload it to Tudou.com, or Youku.com. YouTube is blocked in China – troublesome for me. Will figure it out later.

If you are still choosing which camcorder to buy, I highly recommend this camera: Sony CX500E.

Here are some sample photos I took with the camera:

Photograph by Jian Shuo Wang with Sony CX500E

Photograph by Jian Shuo Wang with Sony CX500E

Photograph by Jian Shuo Wang with Sony CX500E

Photograph by Jian Shuo Wang with Sony CX500E

Photograph by Jian Shuo Wang with Sony CX500E

P.S. Wendy is interested in Dingcha now.

Finally Bought Sony CX500E

After posting my intention to buy a camcorder, Wendy and I finally bought one at “Buy Now” computer market at 7550 RMB. The list price at BestBuy is 8499 RMB – Jia doubted why people want to buy at BestBuy. I believe many people will do it. Wendy and I almost bought it, and later though, if a taxi drive to another place can save you 1000 RMB, who not bother?

The problem is, we have too many Hi-Tech toys, but don’t have time to play with it. Time is now a limited resource to enjoy happiness.

Recorded some high-definition movie of Yifan, and we suddenly realized we should have bought it 2.4 years ago. I will send some time this weekend with the new Camcorder.

Any tips about who I organize and share the video? The last thing I want is some passion about the new tool for few days or weeks, and then store it somewhere. Blogging, for example, is a very good format for me to record stuff. What about video? I don’t think video blogging is a feasible.

Met with Yi Jin

Met with Yi Jin at Starbucks at Super Brand Mall. I was very amazed by the Livescribe pen he used. What a great idea to digitize a notebook?

Wendy was very attracted by Kindle. We agreed to buy one as my birthday gift, instead of spending a fancy night at some hotel.

Manchester Business School MBA

At night, I went to attend a lecture by a professor of Manchester Business School on currency exchange, and financial crisis. Not very interesting for a non-finance guy like me. Stanford is still my dream university.

Installing Windows XP on Dell

I am installing a new copy of Windows XP on my Dell desktop computer (with service tag: JG7PR1X).

Regarding installing Windows, it was one of my favorite many years ago. When I just joined Microsoft in 1998 as an intern (Hey! It is Microsoft!). That was years before Windows 2000 was launched, and we were still using Windows 95. One of my daily job was to install Windows. At that time, many cases need environment to reproduce the problem, and we don’t have fancy stuff like Virtual PC – we only had ghost, but most of the Windows environment don’t have a ghost file. I am very good at installing a Traditional Chinese Office onto a Thai Windows, just to reproduce some weird problems. I may have installed Windows 100+ times in one year.

Now, installing Windows is so boring task, especially when I have to look for the right driver, and fix some minor issues before I continue. See? Big difference in mood between ten years ago and now – doing the same thing.

The interesting difference is, to install a machine is a great accomplishment for me 10 years ago – look at this fresh new machine – which I can work on it tomorrow. Now, installing a computer is just, hmmm, something too small to be satisfied with… When the standard of accomplishment changes, our sense of time changes, and our feeling for happiness changes.

Bought a TCL Internet TV

Wendy and I have been watching small screen TV for a long time. We have been talking about it since we moved in our new home in 2001. Interestingly enough, we are never too materialism to buy big TV, big car, or big nice bags. The current 29” TV worked pretty good for us for a long time. These days, we just started to think about it: isn’t it nice to have a bigger TV?

Story: My “Old” Car

Talking about my tendency to stay as low-cost as possible, I thought about my friend Elliot Ng’s kind joke about my 5-year old Fiat car:

In China, famous Chinese blogger Wang Jianshuo is definitely not poor. Why? He has a car. However, Wang Jianshuo is not rich either. Why? Just look at his car (yes, I’m just teasing him, he’s a down to earth kind of guy).

Yes. Look at my car – at the current price, it is still a little bit cheaper than a Shanghai car plate.

Back to the TV Story

Back to the TV story, Wendy and I feel that we should treat ourselves a little bit better after both of us working hard for 10 years. We deserve a little bit better TV, especially a 52” LCD TV set cost less than 10K RMB (1500 USD). We thought about 46” initially and found the price gap between 46” and 52” is not obvious. We went to Yongle Applicant Shopping Center in Cloud Nine Shopping Center at Zhongshan Park area, and placed the order. I am expecting the TV set to be delivered tomorrow.

Impressive Internet TV

We initially thought about Sony, but I just realized that in the home entertainment segment, big foreign brands like Sony, Panasonic, LG, and Samsung do not have too much competitive advantage. Actually, local brands offer much better price and functions.

I was a happy customer of Konka before, and this time, I choose TCL because their very impressive Internet TV.

TCL Internet TV – MiTV

I know this idea will raise many concerns from my readers, and my purchase of this TV set can be contraversial. The Internet TV actually has a P2P Movie Player embedded. You just need to plug the network cable into the back of the TV set, and you see a huge list – thousands of, if not tens of thousands of DVD titles. You click on the title, and it plays immediately. Most of the newly released TV are in HD format – very nice to a big screen.

The back-end engine is PPStream, a P2P network for people to see real time TV programs, and DVDs. Via PPS and its head-to-head competitor PPLive, you can basically watch anything that is digital – free. Let me show you a sample page. You can watch the 1600 American DVD titles.

Copyright? Well, Can We Change a Topic?

Yes. The content is pirated, or it is not licensed. This product raised many discussion and criticism within China also, and there are companies suing TCL for this product, but as of today, all the major TV manufactures in China is shipping this type of Internet TV (free HD DVD TV) and is 1/4 of all LCD TV Set. It is increasing at 300% per month according to some reports. Millions of Internet TV are sold out to families like us.

What is the impact of this wave of Internet TV to the TV set industry, to the movie industry, and to the culture of this country? We need to wait and see.

The Chinese Way

After seeing the impressive MP4 Player, the Internet TV impressed me again not just by “pirating DVDs”, but also by some nice technology.

When we checked out Sony Bravia TV with Internet cable, they offer a dream of all devices supporting DLNA protocol, so TV can talk with PC, and mobile phone, and it only support MPEG format.

The Chinese Internet TV does not take that “protocol” and “agreement” approach. They just can ready any share folder on the same hub, and play all kinds of possible media, from WMV(720P), MPEG2/4(720P), RMVB, H.264, WMV, MPEG1/2/4, RM, AVI, ASF, VOB, MKV, FLV, DIVX. They support all kinds of subtitle format like SUB, SRT,SMI. They support all type of audio format: MP3, OGG, WMA, WAV, and of cause almost all possible image format.

They of cause support USB stick, or hard disk via USB, and all kinds of interesting way of sharing storage in China.

It is just like the Chinese society: don’t rely on others – everything you just do it yourselves, and provide a great user experience.

I will write a thorough review when we get the TV set few days later.

What is your first impression of such product?

P.S. There are some screen shots in this news article.

A Good Video Camcorder

I have postponed it for a long time – I really need a good video camera to take videos for Yifan. We are not using the pretty early model of flip. What do you recommend me to buy?

My current choices are either a Sony HDR something, or a Flip UltraHD. I want to make the decision quick, and getting back with a good camera to record the precious life we have with Yifan.

Related:

Robert Scoble thinks Flip MinoHD is the best.

TechCrunch guys thinks Flip is bad: The Flip v. My Cheap Canon Camera: Flip Loses Across The Board

PubSubHubbub is Interesting

Was away from tech for a long time.

Noticed Brad’s new protocol PubSubHubbub.

I told Wendy the name of this protocol. She, as I expected, was quite amused by the pronounciation of the name – pub – sub – hub – bub.

It is used for real-time publishing. I have asked Jim to do some research on it. Althoguh there are not too many people using this protocol yet, I would see the protential of this interesting idea.

P.S. The meaning:

Pub = publisher

Sub = Subscriber

Hub = hub

bub = … but what does bub mean?

I Use Hotmail Since 1997

MSN China is running a campaign to engage users to celebrate 10 years of MSN service. They offer to give you your registration time if you enter your MSN account and password (well. security concerns here), they will report the registration date and time, and tell you among all users, how many users are earlier than you.

This is a very nice campaign – it engages users because everyone is curious, and everyone wants to spread out the word if they feel they are pretty early bird – like myself. Another even more successful campaign I participated was the Send Your Name to the Mars.

Here is the date I registered Hotmail.

09:06:41 July 11, 1997

What does the date tells?

  • It tells that I was still in Shanghai Jiaotong University.
  • It tells that it is the starting of a summer after I completed my first two years of university.
  • It reminded me that I registered Hotmail at the No. 3 Dorm of SJTU – the building is right outside my window now.
  • It reminded me that at that time, Hotmail is still using the red Globe+Stamp logo.
  • It tells that is one year and a week since Hotmail was launched on July 4, 2006.
  • It tells that is two years 11 days before MSN Messenger service was launched.
  • It tells that Hotmail at that time was still an independent company invested by DFJ, and 7 months away from Microsoft’s acquisition, and I was two year away from joining Microsoft.

It is interesting to be a historicist, isn’t it?

Nikon D50 CHA Error with SD Card

Wendy just called from Xiamen (she went there with friends) and complained that she got a new SD card, and put it into our Nikon D50, and got error message “CHA” and cannot take photo.

I did some research and confirmed that Nikon D50 is incompatible with any SD card larger than 2G.

P.S. I posted a short message on my twitter about feeling like being caught by flu, and got many response. I am feeling better now.

Google Analytics Cookie by this Site

I am using Google Analytics to track traffic to this site, and thus, it will set first-party cookie on computers of my readers. To help my readers to understand what it is, and whether it contains any private information (someone asked), I am writing a quick guide, although it should be Google’s job to do it.

__utma

Name: __utma

Content: 140862379.1932703144.1241269035.1241269035.1241269035.1

Domain: .home.wangjianshuo.com

Path: /

Sent For: Any type of connection

Expires: 2011-5-2 20:57:18

Remember, my site ID of home.wangjianshuo.com with Google Analytics will always be 140862379. That is a hash of my site name – in case you don’t know what hash is, it is just a complicated way to turn a string (any string) into a unique number. The number 140862379 is always attached to this site. It is not changed unless I change my domain name, even though it has a 4 in it. :-) The good thing is, the 379 ending part seems to be related to my home town Luoyang.

1932703144 is a random number – yes, that is me! Yours should be different than mine. It may be another random number. Anyone has its own number. That number does not change and follows you long enough – 2 years to be exact. Using Internet explorer to visit, I get another random number 1288054309. It is just like this… That is maybe the only thing identify you, my reader, and nothing else is revealed.

Another interesting thing is the last number – that is how many times you have visited this site. Check back from time to time to see the total number of visit you come to this site.

__utmb

This is a 30 minute tracker – the content is the number I just described: with a 4 in it and ending with 379. That is this site again. Actually, this can be nothing or any other random number, because it is whether this cookie present or not that matters, not its value. Every time you visit the site, the expiration time is reset, such to keep the session as long as possible, if there are no pause longer than 30 minutes in the middle.

Name: __utmb

Content: 140862379

Domain: .home.wangjianshuo.com

Path: /

Sent For: Any type of connection

Expires: 2009-5-2 21:49:45

__utmc

This is completely the same as the previous one, except it expires at the end of the session – you close your browser. Just as __utmb, the presence of this cookie is more important than its value. If either of __utmb or __utma misses (__utmb disappears after 30 minutes, and __utmc disappears after the user close the browser), a new session, or in Google Analytics’ term, a visit, starts.

Name: __utmc

Content: 140862379

Domain: .home.wangjianshuo.com

Path: /

Sent For: Any type of connection

Expires: End of session

__utmz

__utmz records the campaign information – it is about how user comes to this site. It expires after 6 months. As you can see from this sample, this user (it is me) comes from Google (as stated in utmcsr, or source), and is from (organic) search result (in utmccn) with term Shanghai taxi (as in utmctr, or term) and the media is organic (as in utmcmd). This typically tells the story of how you get to this site – a search, from Google, and I didn’t pay for the visit (organic).

In this cookie, you notice that 140862379 is still there – my site, and 1241269038 is a time stamp.

Name: __utmz

Content: 140862379.1241269038.1.1.utmccn=(organic)|utmcsr=google|utmctr=shanghai+taxi|utmcmd=organic

Domain: .home.wangjianshuo.com

Path: /

Sent For: Any type of connection

Expires: 2009-11-1 8:57:18

Technical Stuff is Interesting, and Boring

Depends on where you come from, technical information like this can be either boring, or interesting – for me, it is very interesting to understand how on earth it is done to help me understand more about many different things.

Google Analytics Cookie Monitior

Here is a small tool that I created to help you understand what cookie I set to your browser (actually Google did it). As I said, technical stuff is interesting when you know it works.

Loading…

Balloon and Camera in Outer Space

Robert Mao posted a nice article talking about two outer space projects.

One is the Teddy Bear project. The pupils in UK made the balloon and shipped it with two teddy bears, and send it to 30 km away from space.

I love this picture also – the pupils put a teddy bear into a plastic bottle to keep it warm in the harsh cold in outer space, and another one wear a plastic head cover – seems to be the bottom of a Pepsi bottle.

I talked with Wendy about this project for a long time, and I do wish we can create the same project today ourselves, to explore the outer space by ourselves. Wendy said: “Sometimes tech can make people blind of what they can do.” I agree. Anyone want to join?

Dell Optiplex 755

I just got a new desktop at work: Dell Optiplex 755. My first computer when I entered Microsoft was a Dell. They had the tradition to upgrade desktop computer every one to two years. That was a white one (I forgot about the model). The service tag for this new Dell Optiplex 755 is FT15C2X, just for my record in case I lose it later. I will spend more time learning how the new Dell Optiplex 755 works. Interestingly enough, they don’t have network card driver for the brand new Dell Optiplex 755 after I installed Windows XP on it.

Dell vs IBM

My first IBM compute laptop was bought in 2005. I found the quality of IBM X40 was really nice. The major difference between an IBM and Dell is:

  • IBM don’t have warranty or nice on-door service, but it never breaks (or to be more exact, seldom breaks).
  • Dell’s quality is so-so, but they always promptly arrive on door, and change hardware for you.

However, the recently, something changes with IBM. My new X60 ThinkPad under Lenovo brand breaks frequently (blue screen), and batter completely stopped working. This does drive my decision making of purchase from IBM to Dell the next time.

Google Custom Search Engine

I am experimenting Google Custom Search Engine, and here is the result of my experiment. It searched the whole Internet, with priority put on Baixing.com. It also filtered some competitors from the list, and add Subscribed Link. You can try to search for “wangjianshuo” or “panxiaoliang” in the search box.

All Maps in China are Transformed

There are rumor that all printed maps that is available in domestic market are transformed. The goal is to make the map useless for military situation to protect the safety of the country.

I heard about it but I didn’t really believe it. I thought to protect the country from foreign intelligence agents by transforming all maps available in a country is just a fool decision.

I do know that in certain Shanghai map, because of the streets in downtown is so crowded, and in other places, density is lower. So they transformed the map to cover as much as places possible while keep the downtown street clear enough to recognize.

However, the rumor is not about this specialize map. It is about all maps in China.

Google Map Revealed the Secret

In most places in China, Google map has a feature to hybrid map and satellite images. I found that handy. In China, however, there are no this feature.

Recently, Google added traffic map. When traffic map overlaid on top of local map, it fits each other perfectly. If the map is overlaid on a satellite map, you see the huge transformation.

Google Traffic on Map

Look at this: the traffic line and the map fit each other perfectly. You see the yellow line as Huashan Road – the road before where I work, and the green thin line is Huaihai Road, and the upper left double green lines are Elevated Highway.

image

Google Map on Satellite Maps

Look at this again.

The traffic lines are still there, but if you see the reality – the satellite image, you will find out the maps are completely transformed. The real Huashan Road is about 300 meters west of what is shown on the map, and the Huahai Road is actually 200 meters north of it. Meanwhile, it is not a consistent transforming – it is very random.

image

I checked other maps, and my conclusion is:

Look at a Chinese map, the real location may be 0 – 500 meters north, south, west, or east (randomly) of what the real location is. You have no idea about where the real location is because the transform is random.

It is Not a Problem of a Map Provider

Is it the error of a single map provider? In this case, is mapabc.com, the map source that provided the wrong data? I don’t think so. I talked with Google people about this, and talked with map expert. It seems all the maps are transformed.

I Hope We Release Real Map

Civil usage of GPS was once forced to add some noises so it is not accurate as GPS technology can provide. Now, the ban was lifted, and people can get knowledge of where they are via GPS.

I don’t think today, we can protect anything just by transforming a map. It reminded me about the claim of many local "map experts" that Google maps has released the national secret of China. I think the real national secret is, how narrow minded the "experts" are.

User Feedback are the Key

Stumbled upon this article: YouTube Enables Deep Linking Within Videos. It is related to YouTube.

The feature to link deep into a video seems obvious – most of the user feedback based features are very obvious, but it is the key driver for any consumer facing product. To root the inspiration to what users say is very important for the success of a website, just like craigslist has demonstrated.

Software List for Newly Installed PC

I wrote about my software list for newly installed PC the last year. Since I reinstall my laptop from time to time (on average, every quarter), I keep a list of software to be installed. I don’t like software like Ghost – I just want to keep my PC as fresh as possible.

Looking back at the article I wrote before, there are not many in the list. This time, i create a longer list. Maybe after 5 years, when we look back at this list, many of them no longer exists, or we have started to use newer software at that time. A trend I observed from the last year is, most of my daily use software was downloaded from Internet (for free).

  1. Drivers – especially Video, and network drivers.
  2. Windows Update to get to the latest version.
  3. Keep Windows Messenger that comes with Windows XP (don’t want to use Live Messenger)
  4. Turn on ClearType. If in Chinese environment, change the font family for titles, and menus to Tohama from the default SimSong font – so the ClearType can take efect.
  5. Firefox, and then do not use IE after that.
  6. Sogou Pinyin IME (for better experience to input Chinese)
  7. Google Toolbar
  8. Google Picasa

Slow Internet Connection in Early May

I am experiencing very slow Internet connection these days – even Google home page takes about 20 seconds or longer to open.

I guess many people are experiencing the same thing. Why?

image

I just realized that Windows Vista SP1 is releasing these days, and according to Microsoft, Windows Update on every Vista computer is busy downloading from Windows Update to get SP1.

I checked my system tray and realized that in the last night, it only downloaded 49% of the update, and the number does not change in a long time (10 minutes?)

If you also experience the slowness of Internet connection (not only in China, but also in many other countries), it may because of this. The last time, it was confirmed that the Windows XP SP2 patch was the major reason for slow Internet connection. Last time, it lasted for quite some time (few days).

Hope someone can calculate the money wasted on bandwidth because of Microsoft’s update.

Google Docs is Good

This is my test of the new Google Docs – it is hard to define what “new” means in Google product. Maybe when I am writing this document, it is becoming “old” version. Amazing.

The default font is changed to Verdana, 10pt, my favorite, and the same as my blog, and I can insert a picture (Google handles all the pluming work to upload the photo and assign a URL to it.

I can insert a link like this: my blog. (This is the default expectation. No surprise here)
I can even insert comment:
and block quote
Like this
Best of all, I can even publish it from Google Docs to my MovableType based weblog. Amazing!
So, you see this post, and it is created by Google Docs. However, I hope this will be the last time, since the post created from Google Docs is still too crazy in HTML – too many HTML noisy things, which I don’t like. I will still use the MovableType default editor, and Windows Live Writer.