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