embarrassing 2010 sohu

June 8th, 2010

Haven't blogging for quite a long time.

Not sure whether I should do English or Chinese now, tbd...

Anyway, today's finding:

You wanna know 2010 world cup's finals? check here:

http://2010.sohu.com/saicheng/

2010 world cup sohu points to 2006...

 

Posted in

Android upgrade to 1.5

April 28th, 2009

I have to say this is a very great upgrade, and worth the effort. Here is the step by step instruction (on linux):

  1. Download radio image: ota-radio-2_22_19_26I.zip and recovery image: signed-dream_devphone-ota-147201.zip
  2. make sure HTC Gphone is connected to your computer, and `adb devices` see your phone listed
  3. adb push ota-radio-2_22_19_26I.zip /sdcard/update.zip
  4. adb shell sync
  5. shut down your GPhone. When preparing to restart, please press and hold "Home" then hit the Start (should be the same power off button aka the "Call End" button) button, waiting for the "!" sign as into the recovery mode
  6. ALT + I  to enable log info (I didn't see any log info though)
  7. ALT + s  to install the update
  8. Press HOME + BACK and write the install, and there will follow an automatic reboot
  9. adb push signed-dream_devphone-ota-147201.zip /sdcard/update.zip
  10. repeat 4 - 8

Sounds pretty straightforward, the original/official instruction is here: http://www.htc.com/www/support/android/adp.html . But with my first try, I kinda stuck at step 5, I didn't see the exclamation mark when I am into recovery mode, instead, the screen was frozen with android bot standing there and I can't shut off the GPhone. And since I didn't see the "!" sign, I don't know whether I could continue with step 6 or not.

Then I tried to use adb tool for help, `adb devices` tells me the device is in recovery mode, so I continued my venture. However I saw three Android Bots at the bottom of the screen in the process instead of the "installing package" or "writing update" signs. So I was not sure whether I finished my upgrading or not, but the GPhone is back live. So I restarted everything from the beginning, and this time everything works like charm, and got what I want:

  • Soft Keyborad when web browsing to enter new url
  • Camcorder, now I can record video with my GPhone
  • Voice Search
  • Wireless support of WPA2 protocol, so I can have user name and password
  • And I am expecting to find more :)
Tags: gphone android Posted in Google

running two versions of firefox on two different profiles

April 1st, 2009

Months ago, I blogged about alternative brower other than firefox to use. However I have to switch back to firefox, as I couldn't get used to the shortcut key on the webkit based browser, and Prism doesn't support Gear, also it tends to open the web page of the same domain inside the Prism, which sometimes makes Flash, Applet, Javascript awkard, and no extension could be installed to Prism.

So I am back with Firefox, but I still need it to run faster and lighter. Solution: create a new profile with following command

firefox -ProfileManager

And don't mess it with too many extensions. After you create one new profile, say "light", you now can run it with:

firefox -P light

then you will start with "light" profile, and you can create a custom launcher to do this.

I also happen to want to run 2 different versions of firefox. It is trivial to download another version of firefox binary, say it sits at /alt/

/alt/firefox

if there is no other firefox instance running, the above command runs perfect. However if the default firefox is running, then you will notice another window with the default firefox version is started not the newer version you want to start. So you have to use this option:

/alt/firefox -no-remote

As the firefox -help tells: "-no-remote"        Open new instance, not a new window in running instance.

So now you can run the light proflie with the newest Firefox and keep the older version compatible with various extensions although it might start and load slow.

Tags: firefox Posted in Browser

gphone activation through wifi

March 29th, 2009

Finally, I ordered the android dev phone 1 (adp), but my cell phone is with AT&T and I have no intention to switch to TMobile for the moment. So before I made the decision to buy the adp, I did some research whether adp can work well with AT&T, and seems folks are saying adp works well with AT&T if you are ok without 3G.

Folks did mention data plan, like mms or multimedia etc. available from AT&T, but those terms didn't ring the bell to me. I just thought data plan may be just an option for people who want to use it and I only need wifi (and I can't afford those additional data plan, like for $30/month)

Then here came my unlocked adp, after charging battery, I stuck with the Google Data Sync step, the very exact step I entered my user/password, and I believe it's the first step with GPhone. So you could imagine when I stuck there, how hopeless I was and I just wanted to return the GPhone.

I tried those various settings with APNs that people pointed out in the forums for AT&T, but no help (no matter uppercase or lowercase, without detail or with everything). And I believe the root cause is that I don't have a data plan associated with AT&T plan.

So what can I do? Google Search finally leads me to a very helpful post, and here is the solution:

To get that going you first need to install the USB driver for the
 phone and connect it to your computer.
 Run "adb devices" to verify that the device is connected correctly
 (HTC-something should show up under "List of devices attached"). Then
 run "adb shell" and "am start -a android.intent.action.MAIN -n
 com.android.settings/.Settings" from the shell prompt to get the WiFI-
 configuration screen up. Now configure your WIFI and activate the
 phone. Once you get that done you can go to Settings, Wireless
 controls->Mobile networks and register your SIM card on the mobile
 network!

The usb driver comes with andorid SDK, and in the tools direcotry, you should be able to find the adb binary. Then just follow whatever as said in the instruction, you are blessed! At least I am :)

 

 

 

 

Tags: android gphone activation Posted in

xslt preserve entity

March 24th, 2009

To be more accurate, this way preserves the UTF-8 xml character entity as UTF-8 character entity. There are some other suggestions like using character map, feels too much trouble.

So how to do it:

in the xsl output tag, add this attribute:

encoding="ASCII"

Done!

Some other xsl tips I recently used in my hadoop XSLT job:

1) wrapping data in a CDATA (or construct a CDATA node using XSLT, not the best way but get the job done)

<![CDATA[
....
]]
>

2) remember how to apply-templates, it's recursive, (later that day I learned how to use settimeout in Javascript, which again if you know how to use it recursively, it's very powerful)

3) use copy-of to preserve the xml nodes or html tags inside a wanted node

Tags: xslt Posted in

hadoop source jar

March 8th, 2009

When I am using the hadoop jar downloaded from Apache, I couldn't see the source from Eclipse "Declaration" or just simply by mouse over the Class/Function as it gives following error:

Note: This element neither has attached source nor attached Javadoc and hence no Javadoc could be found.

So I took a big effort to download the nightly build and want to create a Hadoop reference project in my Eclipse. However, because of various silly reasons, no success. (I could even create a jar for the core module, but in Eclipse, I still got error, saying the build/test/classes not valid)

Then after hours, I reallized, what I really want is having source file into the jar. So the solution is

cd $HADOOP/src/core; jar uvf ../../hadoop-($version)-core.jar org/
cd $HADOOP/src/mapred; jar uvf ../../hadoop-($version)-core.jar org/

you may also want to have files from src/hdfs (btw, it's interesting Hadoop separates the same pacakge in this way, but no reason you can't do that :) )

Now the hadoop jar file will have the java source and you can view the Hadoop core source in your mapred jobs!

Tags: hadoop jar Posted in Hadoop

Setup GWT 1.6

February 13th, 2009

GWT 1.6 is out now, it has new output structure and the starting scripts all have been updated. So if you want to try the sample inside the GWT, e.g. Hello/.

Just go there and run :    ant hosted  (see the build.xml there to find out the magic), then you can change the code and refresh as usual.

If you want to have new project, now use the webAppCreator shiped with GWT, try something like:

$GWT_PATH/webAppCreator -out Test com.example.code.Test

It will generate all the necessary stuff for you. And do check out the new WAR structre output from GWT 1.6 at its design doc.

Tags: gwt Posted in Java JavaScript

cvs get trunk change into branch

February 6th, 2009

Although I talked about I am being cool as using Git, I still need to play with CVS at work, and I got a little problem.

The problem is that there is some change in the trunk I want to incorporate into my branch, which shouldn't be that hard, something like following should work:

cvs update -j 1.5 -j 1.4 working_file

However, I want to do one step further, that is moving the tag to the new revision (or starting the branching point from 1.5 instead of my previous branching point 1.4 but stay with the old tag name). But it seems I can't use the old tag name as it complains: already exists on branch x.x.x.x, not moving tag to branch. Even with option -F (force), it still failed. Finally, after google, this works:

cvs tag -BF old_tag working_file

so making a note here.

After playing again, seems better to delete the tag first, then re-branch and tag

cvs tag -d old_tag working_file
cvs update -A working_file
cvs tag -b old_tag working_file
cvs update -r old_tag working_file
Tags: cvs Posted in Version Control

convert quicktime to flash (swf)

January 26th, 2009

Used Kodak camera to shoot some video, and wanted to convert them from the .mov (quicktime format) to flash, so I can share them online easily.

I've seen somewhere that people mentioned ffmpeg can do this job, and I know mplayer is very powerful in any sense. So I decided to give it a try. However I have no luck with the mediubuntu version of ffmpeg, since I really want to avoid compiling from source. And the complain is:

Unknown codec 'libmp3lame'

So I decided to compile from souce and with libmp3lame support, with the instruction from a drupal site.

And unluckily, then I ran into the issue of "Audio resampler only works with 16 bits per sample, patch welcome". There is patch available, but not in svn yet.

So I decided just to give mencoder a try, just installed from repo, and with following command, I can happily start to work today:

mencoder input.mov -oac mp3lame -ovc lavc -srate 8000 -o output.swf

 

Tags: ffmpeg mencoder quicktime flash video swf ubuntu Posted in Linux

javascript document location

January 21st, 2009

I am not a javascript guy, but I do want to play with a Ubiquity command. As I am trying to get the current window location as a String, I always failed, which sounds simple to solve now as I found out this is the root cause for the problem I initially bumped into. But it took me hours.

Also I am guessing the document.location may behave differently under linux and windows, otherwise no other reason for it not working at the first place. But anyway, just remember put a String() around the location. Otherwise, the problem I am having is get the behavior of location.reload() rather than get its value by calling document.location.

Tags: error Posted in JavaScript

:-) Join the site

:-) Comment the blog