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

[电脑网络]Octave Portable and Octave in the Cloud

I am now taking an on-line course about Machine Learning on CourseRA (Link to the course) which requires Matlab or Octave (an open-source alternative of Matlab) for its programming assignments.
I am taking this course on computers in a library on which I don't have the privilege to install anything. I found there is a portable version of Octave available (see here ) that I can put it on my USB drive and use it on any Windows computer. I haven't tried it yet but it will be very convenient for people who like to take their working environment with them on a USB stick. The caveat is that I can only do this on Windows machines. Also, the portable Octave is based on Octave v2.9.15 while the latest Octave is v3.6.2.The ML class, however, provides an 3.2.4 version (Windows version download link).
From the class forum I learnt that there is an cloud based service which offering access to 3.6.2 version of Octave. Again, I haven't tried it yet but it seems to be an promising way to practice Octave. The Link of the service is here.
Download Links:
  1. Portable Octave 2.9.15 Download
  2. Installation Octave 3.2.4 Download
  3. Octave 3.6.2 in the Cloud

2014-02-27

[讀書筆記]死線的神奇功能——讀《拖拉一点也无妨》




寫在前面的話
=======

寫這篇小文的時間,距離我讀這本書已經有不短的時間了。當初讀書的時候沒有記筆記,寫作的過程中也沒有回去參考原書。文中僅僅最后一部分與原書緊密相關,其他部分為自己閱讀“拖延癥”主題圖書的心得。

以上。

人為什么會拖延?
=======

一件事情會被你拖下來,大概就是因為這樣一件事,做著無聊,無趣,無信心,也沒那么重要(我相信沒人會在生死攸關的事情上拖延)。可這事兒你又偏偏必須做。這事兒是領導,老師派給的,不做會得到差評,弄不好得丟工作或者無法畢業,然周圍的人失望;或者是因為你做出了承諾(向自己或者向他人),不做會覺得丟臉,損人品,失去朋友,甚至失去自尊。這些都統統放一起,濃縮一下其實就是一樣:這事兒你不想做。人對于自己樂于做的事情,即便沒有提醒催促,也不會拖延的。

可是,現實的情況是,不是人人都知道自己喜歡做什么事情,但是幾乎人人都有自己不喜歡做卻必須得做或者自己以為自己必須得做的事情。這樣一來,似乎拖延的人四處可見,拖延癥也就橫空出世,越來越引人關注了。

人總是要做一下自己不太喜歡做的事情的。因此,在我看來,拖延這件事情,只要人類還有情感,就是人類的宿命。宿命性的東西,無論你接不接受,也會一直在那里。所以,作為人類的你,還是認了吧。

如何對付拖延?
=======

雖然我是認了命,接受了自己的拖延,但卻不意味著我們就不能對它做點兒什么了。

上面提到了,人們一般只會在自己不喜歡的事情上拖延。因此,面對拖延,一般有兩類辦法:一類是幫你認識到自己喜歡的事情,然后盡量多的承接自己喜歡的任務,減少不喜歡的任務,進而減少拖延。沒有不喜歡的任務的理想狀態雖然基本不可能達到,但是花八成時間在喜歡的事情上,而成在不喜歡的事情上,也是會很令人開心的。

另外一類方法,則是幫你應付那些你不喜歡的事情的。比如,讓你培養一份公事公辦的態度,而不讓個人感情影響事情的完成。再比如,養成某些習慣,舉行某些儀式,把做某些不喜歡的事情變成程序性的動作。等等。

本書的秘方:死線的神奇功能
=======

這本書的內容,就屬于上面提到的第二類方法。它的實現卻另辟蹊徑,不落俗套。

其原理很簡單,我試著來總結一下。你可能同時會有兩件以上不喜歡做又必須得做的事情。而且這些事情,一般都會有個時間限制,英文叫做Deadline,直譯過來叫做“死線”或者“死限”。其實多數情況下,這個deadline是靈活的,可以商量,變化的。(當然,即便它沒有商量的余地,你超過了這個時間限制沒有完成,一般也沒有誰會死。)這個“死線”卻有一個非常神奇的功能,隨著它的臨近,這件你原本就不喜歡的事情會變得越來越面目可憎。這聽著不像什么好事兒吧,但是請注意,這時候,其他的那些原本你也不喜歡的事情,卻變得面目相對討喜起來。這時,你就可以不那么費力的去做這些原本不愿做,現在卻變得討喜的事情啦。

當然,你會說,那么那件“死線”將至的事情怎么辦?總不能就這么讓它死掉吧?這個呢,書評人就不說了。聰明的讀者可以自己想想怎么解決這個問題。或者,你也可以找來這本書讀一讀,看看作者的高見。


1:06 pm 02/25/2014

2014-01-21

Freesurfer 2013 course: Videos and PPTs

Intro
The developers of (FreeSurfer)[www.freesurfer.net] have put videos of their 2013 training course online to YouTube. The PowerPoint slides they used in the course are also freely distributed on their website. This gives the new Freesurfer users like me a great way to learn about this neuroimaging data processing and analysis tool. I am truly thankful for the generous of the FreeSerfer team for making the course lectures available online. It is really nice that I can take the courses in my own time and on my own pace. And it does not really cost me anything. All I need is, well, to fight with my procrastination.
One thing I found not very good is that the videos on the FreeSurfer YouTube channel is not organized well enough. I had to constantly refer back to the course schedule to figure out which video should I watch after one ends. So I pulled all the links for the videos and corresponding slides together and arranged them according to the course schedule. The organized links are shared below.
Please note that only the talk session were put online. Most of the tutorials and demonstrations module of the course were not available in the form of videos. There are, however, the web links to the tutorial materials (which I also have the links) are available. It is very important to go through the tutorials if you really want to master the Freesurfer software. Hope the organized links are useful to you. Cheers~~
Course Videos and Links
Day 1
1.1 Tutorial: Unix Tutorial for FreeSurfer Users
1.2 Talk: Introduction To FreeSurfer Jargon
1.3 Talk: Introduction To FreeSurfer
1.4 Talk: Analyzing the Individual Subject
1.5 Talk: A Non-physicist’s Intro to MR
1.6 Demo: Freeview/Tksurfer Demostration
N/A
1.7 Tutorial: Interaction with Individual Subject Data Tutorial
1.8 Talk: FreeSurfer Troubleshooting
1.9 Demo: Quality Checking a Recon
1.10 Tutorial: Troubleshooting Tutorial
1.11 Talk: Question and Answer Session (Answers to online questions here)
  • Video: N/A
  • Questions Online: access
Day 2:
2.1 Talk: Surface-based Analysis: Intersubject Smoothing & Registration
2.2 Talk: Group Analysis
2.3 Tutorial: Group Analysis Tutorial:
2.4 Talk: Multiple Comparisons
2.5 Demo: QDEC demonstration
  • N/A
2.6 Tutorial: Multiple Comparisons Tutorial
2.7 Tutorial: QDEC Tutorial
2.8 Talk: ROI Analysis
2.9 Tutorial: ROI Analysis Tutorial
2.10 Talk: Longitudinal FreeSurfer
2.11 Tutorial: Longitudinal Tutorial
Day 3
3.1 Talk: Multi-Modal Integration, Part 1
3.2 Tutorial: Multi-Modal Integration Tutorial, Part 1
3.3 Talk: Introduction to Diffusion MRI
3.4 Tutorial: Diffusion Processing Tutorial
3.5 Talk: TRActs Constrained by UnderLying Anatomy (TRACULA)
3.6 Tutorial: Tracula Tutorial
3.7 Talk: Multi-Modal Integration, Part 2
3.8 Tutorial: Multi-Modal Integration Tutorial, Part 2
3.9 Talk: MRI Acquisition Methods For Morphometry
3.10 Talk: Motion-compensated neuroanatomical imaging
3.11 Talk: Registration Methods