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.

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