Thursday, March 28, 2013

Candy crush Saga 81卡關玩不了, loading問題

前日玩candy crush 時開開心心完成了玩了多天的80關,正要向81關口進發時,,,,,,Er!!! Loading ?!! 等我reboot 先。 Loading ?!?! 換FB account 再入 Loading ............

不知是怪bug作怪還是我騙心心太多竟然入不到笫81關。。
解決方法就是。。。

用電腦玩完第81關,到第82關就可以用手機,ipad去玩了!!(幸好81關相對很易玩)

Sunday, March 24, 2013

CHK vs FRE Build

download Microsoft software, service pack 時常會見到 有FRE 同 CHK之分.


其實 CHK 即係 Checked Build 又名 Debug Build.


FRE 即係 Free Build (Retail build)





Saturday, March 23, 2013

how to replace Activity.managedQuery

Since getActivity().managedQuery is UI Thread Blocking, it gets deprecated in API 15.
So.... how to get the cursor for SimpleCursorAdapter ?!?!?
You can replace the Cursor with CursorLoader, but a lot of work is needed...
Maybe Google should consider restructure SimpleCursorAdapter to meet the loader structure in the next release....

http://mobile.tutsplus.com/tutorials/android/android-sdk_loading-data_cursorloader/

Friday, March 22, 2013

Candy Crush Saga Cheats: Infinity Life 無限心心 (修改時間取心 android, iphone, ipad,ios)

早日有同士事問 : "如何可以不問朋友的情況下可以增加心心"
一開始時立即想到遊戲修改大師, 但係之後10秒推翻左我要開GM 的小白想法.
http://computerterminal.blogspot.hk/2013/03/candy-crush-cheats-infinity-life.html
****較快手機時間取得生命無限生命大法****

1) 用完心心, 又唔想問朋友 (無朋友?!?!?!)


2) 選擇 "日期和時間"

3) 取消 "自動日期和時間" 如下圖
http://computerterminal.blogspot.hk/2013/03/candy-crush-cheats-infinity-life.html
3) 選擇  "設定日期" 
http://computerterminal.blogspot.hk/2013/03/candy-crush-cheats-infinity-life.html
4) 日子, 月分 , 或者年分 期中一個加一.......我選擇修改月分 + 1

5) 入GAME 看看. 嘩, 5條命 !!!!!


6) 之後再進入SETTING  選擇 "自動日期和時間" 如下圖, 即可自動追回正確時間

7) Enjoy Your Game: SWEETIES



Friday, February 01, 2013

Java 8 Lambda

係香港 IT 通常看重  framework, application, 對 Programming Language evolve 的不是很多, 會用空檔時間看看多國IT 進展的人更小之又小小(我指pure technical news 唔係 andoid 又出5.0 iphone 個mon 又大左0.3" 之類的 3C 新聞). Anyway, 如無意外 Java 8 會有如C# closure 的 Lambda.
至於 Closure 和 Delegate 同 Lambda 有什麼不同呢?! 我記得之前 James Gosling 還在SUN 之時的一個 BLOG 有講過, 但現在好像 DELETE 了.
只好去 Neal Gafter 的舊Blog 看看了, 可惜 Neal Gafter 現在也是 M$ 的人了.

Java 8 Lambda:
http://feeds.dzone.com/~r/dzone/frontpage/~3/LSospUbDMYM/java_8_project_lambda.html

Saturday, January 26, 2013

AdMob 中 AdView 在 Proguard 之下的 "Proguard returned with error code 1"

多手升級一下 App 中的 Proguard version 同 AdMob SDK 立即出了:


Proguard returned with error code 1. See console
Note: there were 160 duplicate class definitions.
Warning: com.google.ads.m: can't find referenced class com.google.ads.internal.state.AdState
Warning: com.google.ads.m: can't find referenced class com.google.ads.internal.state.AdState
You should check if you need to specify additional program jars.
Warning: there were 2 unresolved references to classes or interfaces.
 You may need to specify additional library jars (using '-libraryjars').

先在 Project -> Build Path -> Export 中手動加入了
GoogleAdMobAdsSdk-6.2.1.jar
但那Error老在
又修改了一下 proguard-project.txt:
加入了:


-keepattributes *Annotation*
-keep public class com.google.ads.** {*;}
-libraryjars /libs/GoogleAdMobAdsSdk-6.2.1.jar

都无功而返:
只好學一下AdView 中的example 加入一些

-dontpreverify -repackageclasses '
-allowaccessmodification 
-optimizations !code/simplification/arithmetic


-keepclasseswithmembers class * {
public <init>(android.content.Context, android.util.AttributeSet, int);
}

-keepclassmembers class * extends android.content.Context {
public void *(android.view.View);
public void *(android.view.MenuItem);
}


但是............
所以話AdMob 是 Google API 中最失敗的一個
次次要Update 都要花費一些時間.
最後只好問問全能的Google.


This problem started with AdMob SDK 6.1.0 and 6.2.1 (for Android). To fix the error, add this to your proguard.cfg file:
中文是叫大家加下會的一句在 proguard.cfg:

-dontwarn com.google.ads.**



Case Close.



Wednesday, January 23, 2013

Hong Kong ID Formula (HKID Number Check Digit)

此文之中文版
http://computerterminal.blogspot.hk/2005/11/hkid-calculation.html


I found out form the Google Analystic that 1/8 of the visitors to this site is to the post HKID Calculation and 1/3 of the visitors are from Russia(!!!) and USA. So i decide to write that post in English for them.

HK ID number starts from Two English Letters plus 6 digits and end with a check digit in bracket
for example: AB987654(3)

Validate the HKID by the following steps:


1) Replace the leading English alphabet with numberic value following the rules below:

Space = 36  A = 10    B = 11   C = 12   D = 13  E = 14    F = 15

G = 16    H = 17   I = 18     J = 19   K = 20    L = 21M = 22    N = 23  O = 24   P = 25   Q = 26    R = 27S = 28    T = 29   U = 30   V = 31   W = 32   X = 33Y = 34     Z = 35

2) Weighted Total 
Calculation 
   A)If double english alphabet digit,e.g. AB987654(3):
           Total = 1st Digit x9 + 2nd Digit x8 + 3rd Digit x7 + 4th Digit x6 + 5th Digit x5 + 6th Digit x4 + 7th Digit x3 +8th Digit x2

   B) Else if single english alphabet digit,e.g. E364912(5):
           E364912(5) = (Space)E364912(5)
           Total = 36 x 9 + 1st Digit x8 + 2nd Digit x7 + 3rd Digit x6 + 4th Digit x5 + 5th Digit x4 + 6th Digit x3 + 7th Digit x2 

3) CheckDigit Calculation

Remaining= Total modulo 11 

IF
a)Remaning = 0:
   CheckDigit = 0

b)Remaning = 1:
   CheckDigit = A

c)Remaning = [2-10]:
   CheckDigit = 11 - Remaining


Example:
HKID:E364912(5)
(PS:E is equal to 14 according to step 1)

324 + 14x8 + 3x7 + 6x6 + 4x5 + 9x4 + 1x3 + 2x2 = 556

556 % 11 = 68

11 - 6 = 5

So E364912(5) is a Valid HKID


Wednesday, March 28, 2012

Android :: Hide Virtual Keyboard on App Start ( 隱藏鍵盤)

最近在做一個睇星坐APP, 一開始有一個 edittext, 但一當 load activity 時就該edittext 就立即on focus 彈出 virtual keyboard
google 一下, 只要在Activity::OnCreate 中加入以下 code 即可 !!!


// hidden keyboard
this.getWindow().setSoftInputMode(
WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_HIDDEN);

Tuesday, February 07, 2012

Set up DfpAdView/AdView of admob

教學有很多, 但大多十分多肺話, 所以我的十分精簡:

1) Reg On Admob site to get the Publisher ID -  a14exxxxxxxxxx

2) Mainfest.xml:
    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
     <activity
            android:name="com.google.ads.AdActivity"            android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize" />

3) Add a LinearLayout called ad_layout to the Activity "XML" file that u want to show the ad.

4a) Add the code to the correspondence Activity "JAVA Code" file
   
    ------- Field -------
     private DfpAdView mAdView;

      I----- onCreate ------
      final LinearLayout adRow = (LinearLayout) findViewById(R.id.ad_layout);
mAdView = new DfpAdView(this, AdSize.SMART_BANNER, "a14exxxxxxxxxx");
adRow.addView(mAdView);
mAdView.loadAd(new AdRequest());

4b) Change DfpAdView to AdView, if u want AdView

5) Override onDestory
     @Override
protected void onDestroy() {
if (mAdView != null) {
mAdView.removeAllViews();
mAdView.destroy();
}
super.onDestroy();
}

6) Run Test !!!!

PS: Add DfpInterstitialAd Later
 

Saturday, January 27, 2007

Hafnium Vally ?

Intel and IBM announces a research result tothe use of alloy of hafnium to replace the silicon dioxide can makes Morrow's Law to be valid in the future.

New York Time

Sunday, January 21, 2007

Wednesday, January 17, 2007

Proxy + 代理猎手

我现在是proxy switcher 跟 代理猎手一起用,proxy switcher 有个功能是自动下载代理服务器网站的代理列表,找到后在全部拿到代理猎手上verify,看哪个连到gindis的比较快。。。具体操作嘛。。。。

proxy switcher
Actions-->Download Proxy Lists,等待几分钟,程序如果开始testing 那些代理的话你把他给stop掉,这时你应该可以在左边
NEW里看到一些刚刚下载的代理,点那个new的文件夹,全选右边的代理,然后File-->export to text file-->命名


代理猎手
System-->Change Option 出来一个option,按中间那个Verification Data Option tab, 选择下面的Add
会出现一个窗口
Name:随便
URL:你要verify 的网址,http://www.gindis.com, 这个填完后按旁边的get, 新窗口弹出再按get一次,这时你会在那个新窗口收到一些数据,随便copy 一下army commander 之类的当你的key word,然后按ok,接着回到你之前的Verification Data Option tab, 选择刚刚你才加的verification,然后按下面的use。这是为了以后测试你那些代理服务器连到这个网址后能不能在找到这个keyword,找到 的速度越快代表你的代理越快(当然可能连接gindis快的,连接论坛就慢了,有时根本不能连)

接下来去代理猎手主窗口,点Results-->import-->之前找到的代理,加完后点中间那个Result tab,按右边的verify all,等几分钟,good就是可以用的代理,你点Timing 可以从最快到最慢排序

回到proxy switcher
选择左边的proxyswitcher 文件夹,把刚刚那些good的代理加进去,剩下的就一个个试,看哪个速度快

Monday, January 15, 2007

Next Generation of Fortan -- Fortress

Sun released Fortress as a replacement of well know scientific purpose language -- Fortran.
Fortress is target on JVM 1.5.

The most natural different between it and Java is that it assume that a process should be run in parallel instead of single-threaded. It also means to target to high-performance computing area.

Tuesday, January 09, 2007

iPhone come out from Jobs's packet

In today Macworld San Franciso 2007, Jobs took a new iPod from his packet !!!

Ohhhhhhh~~ wait that is not iPod !!!!


~~ iPhone ~~

The details released were:
  1. 3.5-inch widescreen display

  2. 2.0 Megapixel camer

  3. 8GB /4GB storage

  4. Bluetooth with EDR

  5. WiFi

  6. quadband GSM radio with EDGE.
7. It will be availiable in June for $499 for 4GB and $599 for 8GB
iPhone Offical Site