dig deeper, do different

2010-07-20
使用wine在Mac上运行Win程序

首先需要安装wine。具体方法参考toyjack’s GeekTalks的博文Mac系统下安装Wine

用wine运行程序,如果出现找不到mfc42.dll这样的错误,则需要用winetricks下载必要的文件。参考6.5. My application says some DLL or font is missing. What do I do?以及Getting winetricks

winetricks是一个脚本文件,下载后保存到用户目录(~),然后运行如下命令:

chmod +x winetricks
./winnetricks

在弹出的对话框中,根据所需,如缺mfc42.dll,则选择vcrun6。之后会在~目录下生成.winetrickscache目录,并把vc6redistsetup_enu.exe下载至该目录。

进入该目录,运行

wine vc6redistsetup_enu.exe

在弹出窗口中选择提取文件的存放目录,比如~/tmp,则进入~/tmp,运行

wine vcredist.exe

会把文件提取到~/.wine/drive_c/windows/system32目录。
此时再运行wine app_name.exe应该就可以成功了。

Read More

2010-07-19
Adjust brightness for Android devices

AdjBrightness main page

The settings for brightness of buttons and screen are very rough in Android devices, like in HTC Hero. But if your rom is ROOTED, you can download and install AdjBrightness, which can adjust the brightness of the screen from the value 2 to 255.

There are six predefined values in the main page, simply click one of them to set the brightness. If the predefined values cannot fit your request, just type the brightness value you want in the edit box and set it.

Besides those, in the option page, you can find several settings:

  1. Auto restore: Tick this if you want AdjBrightness to restore the brightness after the screen turned on.
  2. Notification: Tick this, AdjBrightness will display a message on screen every after it set the brightness.
  3. Lock brightness: This is really cool. Tick this if you do not want other applications to change the brightness. After tick this, you needn’t tick the Auto restore.
  4. Lock off button light: This is for background light of keyboard. If you don’t like the light as well, tick this to turn off and lock it.
    You can download this application from Google Market. Just search adjbrightness or access following link in your phone market://search?q=pname:com.deskangel.adjbrightness.

Always, if you encounter any problem, drop me an email.

NOTICE: If you cannot turn on the screen, please keep the “Auto restore” ticked in settings.

Read More

2010-07-08
Share DaysAndDate and get Ads removal code

Long story short, everybody who recommended DaysAndDate or wrote reviews/shared experiences for it in three places in internet (blog, twitter, forum, etc.) will get an Ads removal code for DaysAndDate as a gift after they emailed the links of above places to william.xue@gmail.com.

If you like the application but hate the Ads, this is a chance to spread the application to world and get ride of the Ads from your device. Two birds with one stone. DO NOT WASTE IT!

It is running from now to 11/30/2010.

Quick introduction:

DaysAndDate tells you how many days between two dates or the date before/after several days. For example, how many days left to your next birthday from now? Or what is the date after your baby has been born 100 days?
Link to the DaysAndDate in Android Market:
market://search?q=pname:com.deskangel.DaysAndDate

Read More

2010-06-28
波斯王子:遗忘之沙(WII)剧情

波斯王子:遗忘之沙(WII)讲述的是一个王子与精灵的故事。

精灵Zahra和她的族人曾经居住在森林中一个叫做lzdihar的王国,但是后来她的族人都被一个叫做Haoma的妖怪杀掉了。为了打败Haoma,她把自己卖给了王子,一个正在寻找可以让他领导的王国的勇士。

他们穿过丛林,来到一块空地。在Zahra的引导下,王子亲吻了一座被施了魔法的雕像,由此获得了不死的能力。之后,lzdihar王国的入口出现在他的眼前。

在探索中,王子发现了一把奇怪的刀。就在这时,一只巨大的怪物出现了。王子用那把刀攻击怪物。刀折断了。怪物带着刀刃逃跑了,但是刀柄还留在王子手里。Zahra告诉王子,那把刀封印了Haoma,现在她被释放了。他们必须把刀刃和刀柄重新组合在一起才能击败Haoma。

在接下来的对怪物的追逐中,王子学习到了各种技能。利用这些技能,度过了多个难关,解开了多个谜题,最后把那个巨大的怪物击败了。这时发现,原来怪物是这个王国的国王。他请求王子击败Haoma,解救他的女儿,王国的公主。

拿到断刃的王子,经过了神的四道考验,最终把断刃和刀柄重新融合在一起,开始与Haoma的进行最后的战斗。

经过三次攻击Haoma的心脏,这个植物型的妖怪终于被打败。Haoma恢复成原来的样子,原来她就是这个王国的公主。但是,还未等王子他们喘上一口气,妖怪用最后的力量驱动植物缠住了公主的脚,要把她拖向深渊。在千钧一发之际,王子抓住了公主的手。但是力量悬殊。王子只能利用最后的机会亲吻了公主,把他获得的不死的能力传递给了公主。

lzdihar开始塌陷,沙子开始吞噬整个王国。王子和Zahra在逃离中进入了王国的精神世界。整个世界如梦幻一般,王子的动作变得缓慢而持久。而Zahra的声音也犹如呓语一般不断的在王子的耳边重复”remember”。这是Zahra最后的声音和心愿!

逃离了精神世界之后,王子从他第一次亲吻的雕像前的泉水中出现,回到了现实世界。雕像随后倒塌。

最后,王子一个人踽踽于沙漠之中,渐行渐远……

也许某一天,他会再次回来,回到这个王国,去寻找公主和Zahra。

http://en.wikipedia.org/wiki/Prince_of_Persia:_The_Forgotten_Sands_(Wii)

Read More

2010-06-04
给Android程序添加不同的广告平台

本文假设已有一个广告,比如admob,然后添加另一广告,比如有米,用来在根据不同的语言自动调用不同的广告平台。

1. 在attrs.xml中追加一个declare-stylea,原有的属性不需要再定义。结果如下:


< ?xml version=”1.0” encoding=”UTF-8”?>
















2. 为不同的区域创建不同的layout
首先在默认的layout目录中创建ads.xml文件,用于存放广告代码。在工程目录上右击,New->Android XML File,输入文件名ads.xml,结束。
然后为特定的语言创建ads.xml。在工程目录上右击,New->Android XML File,输入文件名ads.xml选择资源类型为Layout,添加Region为cn,添加Language为zh,结束。

3. 把针对于非中文的广告配置移动到layout/ads.xml文件中,如下:


< ?xml version=”1.0” encoding=”utf-8”?>

<com .admob.android.ads.AdView
    android:id="@+id/ad"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    admobsdk:backgroundColor="#000000"
    admobsdk:textColor="#FFFFFF"
    admobsdk:keywords="Android application"
    admobsdk:refreshInterval="60"
    admobsdk:testing="false"
/>



4. 把针对中文的广告配置移动到layout-zh-rCN/ads.xml文件中:


< ?xml version=”1.0” encoding=”utf-8”?>

<net .youmi.android.AdView
    android:id="@+id/ad"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    umadsdk:refreshInterval="30"
    umadsdk:changeAdAnimation="false"
    umadsdk:backgroundTransparent="255"
    umadsdk:testing="false"
    umadsdk:isGoneWithoutAd="true"
/>



5. 在需要显示广告的地方添加:





大功告成!非常简单的配置。

Read More