2014-10-03

Please vote for us - 请帮忙投票

大家好,我需要你们帮个忙.
如果你有facebook帐号的话,希望你能花一分钟的时间到下面的网站给我投一个票. (https://www.missionmainstreetgrants.com/business/detail/7733) . 投票后可能会有一个小的s survey,你可以点"no thanks"跳过它.
完毕,很简单吧。如果你想了解更多,请接着阅读。

关于这个投票

  • 这个投票是为我和我的一个朋友的 Chao-Gan 非营利网站, the R-fMRI Network,向Chase申请一些funding. 这个网站通过网站的形式向功能影像研究者们提供软件,preprint服务和交流平台.如果你感兴趣的话,你可以去网站看看. http://rfmri.org/

帮助我们的其他方式


My dear Friends, I need your help.

If you have a Facebook profile, please consider taking one minute to click the link (https://www.missionmainstreetgrants.com/business/detail/7733) and vote for us. (There will be a small survey, but you can skip it by clicking "no thanks" at right-bottom of the page).
And that's it. But if you want to know more about what you just did, read on please:

About the voting

  • My friend Chao-Gan and I are applying a grant from Chase for our nonprofit start-up the R-fMRI Network. With it, we are aiming to serve the neuroimaging research community with our software, preprint service and networking platform to facilitate the scientific research with functional MRI. If you are interested, please check us out at http://rfmri.org/

Another way to help us

2014-08-21

[电脑网络]Add two numbers

The leetcode question "adding two numbers" (https://oj.leetcode.com/problems/add-two-numbers/)  is a hard on for me. But I got to understand the concept of linked list and finally was able to manipulate it after finishing this question.

The Question.:

You are given two linked lists representing two non-negative numbers. The digits are stored in reverse order and each of their nodes contain a single digit. Add the two numbers and return it as a linked list.
Input: (2 -> 4 -> 3) + (5 -> 6 -> 4)
Output: 7 -> 0 -> 8
My solution can be found here.

The hard part is figuring out how to create new nodes and move to next node of the linked list. Once I got this the problem was not too hard to solve.






2014-08-09

[电脑网络]Flashed Verizon Galaxy S3 to Selectel

参考资料:

1. Video from Youtube: Galaxy SIII to Page Plus Tutorial
2. Article from innominatedthoughts.com: Guide: Note 3 flash to PagePlus with 3G data
3. Article from blog King of Tweaks: Program Verizon Galaxy S4 for PagePlusCellular

基本步骤:


1. 软件准备:本教程需要DFS软件和手机的驱动。DFS软件下载可以在参考资料2中找到。手机驱动可以在三星的官方网站找到。
2. 安装软件:安装上述软件在电脑上。
3. 激活手机:找到手机的IMEI,联系Selectel激活手机。打电话给客服,获取自己的MIN,MDN和SID。
4. 取下SIM卡:整个刷机过程不需要SIM卡。
5. 开启DM模式:在手机上拨 ##366633#,选取 DM MODE ON。按HOME键退出。
6. 手机设定备份:手机连接电脑,确认驱动程序安装好了。运行DFS
  •  Open “Ports”, select the COM port belonging to the phone.
  • DFS should establish a connection and read the status and diagnostic info.
  • Enter your SPC and click the button (log should indicate “UNLOCKED”)
  • Enter your 16-digit password and click the button (log should indicate “UNLOCKED”)
  • Go through each section of the equipment and programming tabs and click READ for each subsection.  Then MAKE SCREENSHOTS of your default values.
7. 获取HA, AAA Keys:我没有Donner Phone,略过这一步。如果你想知道怎么做,请看参考资料2.
8. 刷机

DFS – Now you can WRITE

  1. Make sure the SIM card is removed.
  2. Turn on phone and connect to USB – ensure drivers are detected and installed.
  3. Start DFS.  Open “Ports”, select the COM port belonging to the phone.
  4. DFS should establish a connection and read the status and diagnostic info.
  5. Enter your SPC and 16-digit password
  6. In Programming / NAM, write the following:
    1. IMSI (leave IMSI T unchanged)
      1. MIN A and MIN D = your MIN / MSID (not phone number)
      2. MCC = 310; MNC=00
    2. Enter your MDN into both the SPC and MDN fields
    3. Set your SID (NID should be 65535)
    4. Check the remaining boxes to match this and then click WRITE:
      DFS: Programming / NAM
      DFS: Programming / NAM
  7. In Programming / Data, write the following:
    1. PPP
      1. SIP NAI: “Your MDN”@dun.vzw3g.com
      2. UID: “Your MDN”@vzw3g.com
      3. PWD: vzw (box unchecked)
    2. HDR AN
      1. NAI: “Your MDN”@vzw3g.com
      2. PWD: vzw (box unchecked)
    3. HDR AN Long
      1. UID: “Your MDN”@vzw3g.com
      2. PWD: vzw (box unchecked)
    4. I will make a brief note here to remark that some of these values were erased when changing the baseband on my phone (which I did out of order of this guide) and I ended up with this.  It still worked (and I have learned not to mess with things that are working).
    5. Check the remaining boxes to match this (Hybrid preferred can be Enabled):
      DFS: Programming / Data
      DFS: Programming / Data
    6. Click WRITE
  8. In Programming / Mobile IP, write the following:
    1. Under profile column:
      1. Select the first bubble and make active (Right click, enable profile)
      2. Make sure all other profiles are Disabled (Right click, Disable profile)
    2. Under Mobile IP main settings
      1. DS QcMIP: PrefMobileIP
      2. Active profile: 0
      3. Number of Profiles: 1
      4. Retries count: 2
      5. Pre-Reg timeout: 30
      6. Retries interval: ms1750
      7. 2002 BIS MN HA AUTH: checked
      8. Domant handoff: checked
      9. PRQ IF Traffic: unchecked
    3. Click WRITE
    4. Under Selected profile settings
      1. NAI: “Your MDN”@vzw3g.com
      2. Home address: 0.0.0.0
      3. Prim HA address 255.255.255.255
      4. Sec HA address 255.255.255.255
      5. MN HA SPI set: Check box; 300
      6. MN AAA SPI set: Check box; 2
      7. Reverse Tunneling pref: Check box
      8. AAA Shared Secret
        1. Enter 32-digit value in HEX: Check Box
      9. HA Shared Secret
        1. Enter 32-digit value in HEX: Check box
      10. RM NAI : “Your MDN”@dun.vzw3g.com
      11. DMU PKOID: 10
      12. DMU MN Auteth: 1.178.7
    5. CLICK ON ” Write current profile settings” – do this 2x to make sure everything stuck
  9. Finally, lets go back to Programming / NAM, and write the PRL:
    1. First READ and then SAVE your current PRL
    2. Then LOAD and WRITE the 60008 PagePlus PRL
    3. The radios will reboot/reset after doing this
  10. Done!  Click Reset in the top right, and restart phone!
    1. Disconnect from DFS and unplug your phone.

至此刷机完成。完成后,可以直接打电话和发短信了。

2014-06-06

Flash my Verizon Galaxy Nexus to Selectel

Intro

I used to have unlimited talk and text and shared 4GB of data with Verizon, for that I pay $60 per month (already in a family plan). Howerver, I don't usually make a lot of phone calls and I barely use the data since I have WIFI at work and home. It's stupid of me to pay big bucks after I found out that there are cheaper plans out there with many prepaid carriers. After looking for a better solution for a while, I decided to go with Selectel.

I actually considered Selectel and Page Plus (another prepaid carrier). Both are most popular at this time. Page plus is in the business for several years and has a lot of users. It uses Verizon's prepaid network and charge for roaming. Selectel is a new carrier which started in 2013. It uses Verizon's post-paid network (might be more reliable than its prepaid network?) and do not change for roaming. For more information about them, please visit their website, talk to their support staff or do your research online. I found a lot of information on the website of genius-wireless.com. genius-wireless.com is a dealer of Page plus and Selectel, I am using their service but I don't receive anything from them for this article.

Yesterday, I finally flashed my phone and switched my cell phone service from Verizon to Selectel. It turned out that Verizon's Galaxy Nexus has a reputation of hard-to-flash. Luckily there are already tutorials out there (see my reference at the end of this article). Here I just want to document the the process again in case I need to this again.

Before I go ahead, I have to say I did not bother to try flashing my phone to 3G (I don't really use it), but it can be done. A link has been given if you are interested in flash your galaxy nexus to 3G.

OK, let's start.

Port phone number to Selectel

Call Verizon and tell them your are going to port your number, ask them if there is anything you need to take care of before you do it, whether there will be any charges and how to avoid them. For me, since my contract already ended and I was not the account holder of the family plan I was in, there was no charge and no complications. If you are the account holder of a family plan, you need to let all other lines out of the plan before you can do something on your own number. If you are in a family plan, let the account holder know before you port your number since s/he might want to downgrade the plan before your port your number out.
Ask Verizon to give you:
  • Verizon account #:
  • Passcode:
  • Account holder’s name:
  • Billing address:
On your phone, find your phone's ESN (MEID) (see here for how-to).

With your MEID and the information you get from Verizon, order a free port in service via genius-wireless.com (link) or other dealer. Please ask dealer to give you the MIN and SIP. If they ask why do you need them, just tell them you need to manually program your phone.

Preparation:

Software, rom, script and patch files

Please download all the needed software and files HERE (404MB). Unzip the file to you computer.

Please confirm you have the following files.

In the Install to computer folder, you should have:
In the copy to phone folder, you should have
  • 52892_page_plus_sprint_phones.prl
  • EOS-toroplus-20130617-105.zip
  • i515-3g-patch-ga02.zip
  • pa_toro-3.60-25JUN2013-064020.zip
  • Slim_Gapps.4.2.2.build.5.zip
  • toroplus_for_toro_cdma_radio-FC12.zip
There are two other files
  • PagePlusSIDList.xls
  • script.txt

Hardware

  • A Windows PC
  • A sim card
  • Your phone (with at least 50% power on battery) and USB cord
Now you have everything you need and let's start flashing the phone.

Flashing steps:

Step 0: software Installation

Install Galaxy Nexus Toolkit, ETS 8.5.17, and Drivers of the phone to you computer. When install ETS, there is a step asking you to choose communication port, choose USB (very important). After installation, restart your computer (very important).

Step 1: Unlock and root your phone, and install custom recovery. [Skip this step if you have done this before.]

  1. Remove SIM card from your phone. (Don't toss it, you will need it later)
  2. On phone, Enable usb debugging
  3. Power off the phone and boot into boot loader (by holding Power + Volume up + Volume down buttons)
  4. Connect phone to PC via USB. On your computer, start device manager, if your phone is recognized as Android 1.0 instead of Samsung ADB Interface, you need to update it's driver. On the screen where you're told to Browse for driver software on your computer, instead click on Let me pick from a list of device drivers on my compute at the bottom of the window and select the SAMSUNG Android ADB Interface.
  5. On computer, Start Galaxy Nexus Toolkit.
  6. say no to update
  7. select you android version, option 36 (my was 4.2.2)
  8. select option "8" to unlock, root your phone
  9. follow instructions to unlock bootloader (press VOL DOWN then POWER to unlock bootloader when asked)
  10. Phone will reboot multiple times and you will need to enable usb debugging again. Just follow the instructions. When the phone is finally booted into Android, step 1 is done and your phone is now unlocked and rooted.

Step 2: install EOS, Gapps, toroplus-for-toro-FC12

  1. On computer, copy all files in the copy to phone folder to a folder to the root of your SDCARD. I created a folder named PPflash and put all the files in it.
  2. Unplug the phone and reboot the phone to bootloader.
  3. On phone, go to recovery mod (hit volume up twice and then power botton) and you will be in TWRP.
  4. Wipe/advanced wipe/data, system, cach, dalvik-cache
  5. Install EOS, Gapps, toroplus-for-toro-FC12 included in zip
  6. Wipe cache/dalvik-cache and reboot. The reboot will take a long time and skip all the settings asked.
  7. If tried program the phone before, it is suggested that after loaded into the Android OS, you should do a full *#*#786#*#* reset to wipe all of your previous attempted programming, if any.
Now you are ready to program your phone.

Step 3: Program your phone.

  1. Find CDMA tool, enable usb diagnostic mode within it, and back to main screen.
  2. Dial *#*#3282#*#*, enter 000000 for MSL, go to Others/ETS and select USB. click OK and back out.
  3. Connect your phone to your computer.
  4. On computer, start ETS 8.5.17 (run as administrator) and you should see something like this. If the there is no information in the pop-up window, then need to try enable CDMA usb diagnostic mode again.
  5. Go to ETS's menu: Utilities/Script Utility
  6. Copy content in script.txt and paste it into Script Utility, follow the instructions in the comments, replacing the first two items with the MDN (phone number), the next 3 with your MIN (MSID), and the remainder with your MDN. The last replacement is the SID, which you had to call your carrier (PagePlus or Selectel) to get. Hhit run.
  7. Back in the CDMA Tools app, swipe all the way to the right. Change the directory from /data/media/ to /sdcard/PPflash and flash the 52896 prl.
  8. Now you have your phone manually configured to your carrier. If you only need text, talk and 1X data, you not far from done. If you have a donor phone and want 3g, you need to do these steps before going to the next step..

Step 4: Install rom, radio, patch and activate your phone.

  1. Reboot to recovery. Once again, wipe Data, System, Cache, and Dalvik-cache. Flash your ROM of choice (Paranoid Android included in the files you downloaded), and install Gapps. (I tried to install the Shiny rom but failed :( )
  2. Last, install the i515 3g patch
  3. Power off, Install your SIM card, Power on.
  4. Activate (*228) with Selectel, then option 1 to program your phone. Don't panic when you hear greetings from Verizon, that's not anything wrong since Selectel does use Verizon's network.
  5. Then, dial *228, option 2 to update your PRL with Verizon. Reboot. Everything should be working: Voice, Data, SMS, MMS.
Note: if there is no dial pad during activation, exit. Try dial *228+. Hold down the 0 key to get the +sign.

references :

Guides from dragonhart6505
Guides from innominatethoughts.com

2014-03-05

回国随笔

反省
====

很久不寫東西了。
我的上一篇日誌寫于12年的11月份。到現在已經過去了四個月份。這四個月以來,不儘儘是日誌沒有些,就連晨間日記也荒疏了。每日的ohlife posts不是跳過了就是寫的極其簡單,經常是不用心。唯一留下的紀錄,就是這幾個月來去鍛煉的鍛煉紀錄表。這個記錄表我沒有怎麼整理,但是能看出的是,我的體重已經長了一些了。
為什麼就不寫東西了呢?這個問題並不是很好回答。反正總覺得自己的時間不夠用,或者空閒的時間都花在其它地方了。說到底,其實就是自己沒有把這個事情重視起來。 無論真麼說,要回答為甚沒寫,估計現在說出來的都是借口。不如,現在回憶一下這幾個月的時間,我都經理了那些事情吧。

**這幾個月又發生了什麼事情呢?**

回國了,結婚了,聖誕節補照了婚紗照,去了南京玩兒了幾天,岳父岳母跟來美國探親了,青找到了新工作,要準備搬家了。

回國
------

回國這事吧其實計劃了好久。或者說從好久前就開始準備。提前好久就買好了機票,請好了假。到了臨近出發的時候,青先從北卡飛來紐約與我會合,然後一同坐飛機返回。

飛機上並沒有什麼好說的。儘量睡覺就是了。離開紐約時,時間是下午。到達北京取得行李走出機場時已經時晚上了。北京的空氣彌漫著嗆人的塵煙氣息,像是哪裡著了火,令人窒息的給了我直接正面的一擊。之後的假期中,除了到南京的那幾天,我的嗓子一直也沒有舒服過。

我們的好朋友杜哥和曉耕來機場接機。天很冷。杜哥先是請我們去吃了烤鴨,點了滿桌的菜肴。我挑了幾樣我能吃的,吃了個半飽。青吃的很高興。當然也不是全是吃,見到很久不見的朋友,那心情自然是興奮的。之後杜哥送我們到了三元橋附近的旅館。之所以在北京停留這一天,是為了我的簽證。

第二天的簽證挺順利的。這裡就提一句,給自己提個醒:使館門口又很多的大爺大媽很熱心的幫你整理材料,比如照片要貼在哪裡啊,地址要怎麼寫啊,名字的電碼查詢了什麼的。幫忙不白幫,完事兒會收個十幾二十塊錢的費用。我要提醒的是,這些事情進到使館裡面再弄不遲,而且根本不用花錢。

簽證之後坐火車回家。現在買火車票都需要身分證了。上個火車的安檢程度,快趕上美國這邊上飛機了。這種事情總讓人覺得有些彆扭。下了火車,妹妹來接站。青先打車回家,我和妹妹才走。回家的一路上,覺得到處都不一樣了,天津這些年,真的是蓋了不少的樓房。不過呢,空氣變差,也是非常明顯的。而且那些個樓真的是有點兒千篇一律的樣子。

回家的我,心情依然是平靜的。見到母親,給了她一個擁抱。看得出媽媽很是高興我回家。
不過回去的卻也不是我離開時候的家了。我離開家的時候,家裡住得是平房土屋,出門就是莊稼,院裡一棵棗樹,院門外一棵高大的槐樹,院裡院外種著蔬菜還有一些鳳仙花。那時家裡總是養貓,貓兒不是躺在窗台上晒太阳,就是钻到庄稼地里探险,直到家里人叫它吃饭方回.若是探险时弄到了吃的,它会弄回家来慢慢享用.要是一天都没啥收获,它也不心慌,只是回家的脚步会急匆匆的,怕是饿得狠了吧.