Posts

Showing posts from May, 2012

Mary Meeker's 2012 annel internet trend report

KPCB Internet Trends 2012

2012 KPCB Internet Trends Year-End Update

來看看網路女王Mary所整理的趨勢,簡單提一下:

我們活在一個正在進化的時代,以前習以為常的習慣到了這兩三年都換了面貌。 Desktop internet與mobile internet的用戶數已經出現黃金交叉了,但是收益比還是將近3:1,所以mobile市場還有很大的爆炸潛力被開發。Android的市場成長幅度是iPhone的四倍(2012年底是六倍)。從行動電話轉換到智慧手機的用戶群還有六倍的潛在客戶。使用電子閱讀器的成年人三年內從2%變成29%行動裝置的上網速度每年都在成長進步,今年更是成長了10%Mobile device的出現其實幫助了eCommerce的成長。全球行動裝置的 App+Ad三年內成長15倍。廣告的投注在行動裝置上目前相對偏低,未來會大幅增進,並且行動裝置使用數也會成長。廣告在行動平台上的有效曝光度顯得偏低,需要找一個好的方式。使用者在行動平台的消費金額比桌上裝置而言弱了三倍。iPad達到兩千萬台的時間(一年)只花了iPhone的一半。 

Android Http post image

http://vikaskanani.wordpress.com/2011/01/11/android-upload-image-or-file-using-http-post-multi-part/

download httpmime.jar in HttpClient

put httpmime.jar in your project's libs/ folder.

Be CAUTION:     at libs/ !!! not other path, otherwise will happen can't found source error at run time.

社群遊戲公司 Zynga

把積欠「失敗」的學費付清之前,你會嚐到許多的失敗 (Fail a lot before you are paying for the failure.)─Zynga 創辦人 Mark Pincus。

http://gnn.gamer.com.tw/1/66261.html

vs-android

vs-android is intended to provide a collection of scripts and utilities to support integrated development of Android NDK C/C++ software under Microsoft Visual Studio.

Currently vs-android only works under Visual Studio 2010. Earlier versions lack the MSBuild integration with the C/C++ compilation systems.

http://code.google.com/p/vs-android/

Android ExpandableListView

Develope Android OpenGL ES based on NDK

Image
NDK: generate native ARM binaries on Linux, OS X, and Windows (with Cygwin) platforms. Be supported in all future versions of the Android platform, starting from Android 1.5. Applications that use native activities must be run on Android 2.3 or later.

OpenGL ES on Android:
The Android framework supports both the OpenGL ES 1.0/1.1 and OpenGL ES 2.0 APIs.

Caution: OpenGL ES 2.0 is currently not supported bythe Android Emulator. You must have a physical test device running Android 2.2 (API Level 8) orhigher in order to run and test the example code in this tutorial.
http://developer.android.com/resources/tutorials/opengl/opengl-es20.html

If your application requires OpenGL 2.0, make sure youdeclare this in your manifest:



Android provides GL10 and GL11 packages, GL10 means OpenGL ES 1.0, GL 11 means OpenGL ES 1.1.

public int getGLVersion() { ActivityManager am = (ActivityManager) getSystemService(Context.ACTIVITY_SERVICE); ConfigurationInfo info = am.getDeviceConfigurati…

Android app: switch page

Image
Press button to change page:
The veiled Activity is your current activity, ex: ChairActivity, and it will switch from ChairActivity to testActivity.

At the most important point, you need to add description in the AndroidManifest.xml






Launch activity from different package

There two activity, mainActivity in applicationA package, NicknameActivity in applicationA.profile package.









http://stackoverflow.com/questions/2741857/launch-activities-from-different-package
http://wangshifuola.blogspot.com/2010/11/androidactivity_18.html

Android app with Facebook API

test


如何在奧古斯都的羅馬課堂上 拿A

很有趣的一個故事:

臉書創辦人佐克柏在期末考前都在忙他的臉書網站,有一門課叫做[
奧古斯都的羅馬]是門歷史課,佐克柏已經很久沒去上課了,這次考試要考課堂中五百張歷史文物的照片對他們的故事背景加以評論。佐克柏心想這次死當了,沒去上課怎麼辦... 
好吧~我來做一件事,我架一個網站把課堂網站的五百張圖片抓下來擺到這網站中,每個圖片都開放討論串。然後把網址寄給所有有修這堂課的同學,不到一兩個小時每張圖片就被討論地很熱烈。
佐克柏就把每個討論記下來去考期末考,那門課他拿了A。

這就是臉書群集媒體的開端。

平民經濟

今天看到了一篇很棒的文章 (Beethoven as Bill Gates):
19世紀初,貝多芬因為印刷業發展以及鋼琴普及靠著寫樂譜致富,
所以他是個成功的創業家。

20世紀末,比爾蓋茲因為個人電腦普及靠著寫作業系統成為世界首富,所以他是個成功的創業家。

這兩位成功者其實都是憑藉著便宜普及的硬體,在上面開發自己受歡迎的"軟體",將之普及到每個人的家中而致富。

21世紀初,你看到了什麼硬體普及了呢?那就是你的機會~~你也可以是個成功的創業家。 以往奢侈品只有世界人口的1%才買得起,但是世界上99%的人口卻在用羨慕的眼神等待有能力也能擁有。是的,所有突然爆發性成長的產業都是: 將奢侈品變成大眾必需品:Toyota對於汽車展業的革新,Uniqolo的平價時尚在普及的硬體上開發出被需要的軟體:微軟的比爾蓋茲, 樂聖貝多芬 這個現象拿到遊戲產業也說得通: 因為PC普及化---> 單機電腦遊戲的風行(id software, Infinity Ward) 因為寬頻網路的普及 ---> 線上遊戲的走紅(NCsoft, Blizzard) 因為智慧手機的普及 ---> app遊戲的受歡迎(Rovio, Gameloft)

Android UI 介面設計

Local static variable destruction

Local static variable dead time can't be confirmed. So we should avoid to use other local static variable at the destructor.
Static variables are allocated at stack and follow FILO rule. If you generate static A before static B, and A use B's attribute in A's destructor, finally A will crash in the deconstruction time, because B has dreaded... Remember!! Stack is FILO.

我們來聊聊同學會

Image
有一個經濟學家 吉爾德說他的大學同學會,先別顧慮為什麼同一個大學班上出了那麼多職業的同學:

大學畢業之後五年,來參加同學會的同學裡面就屬當律師的最囂張,穿著名牌西裝,開著進口車,一畢業就在紐約知名的律師事務所上班。

畢業之後十年的同學會,大家不理律師了,他們變得疲憊許多,而且通常離了婚。現在受歡迎的是醫生,他們念完醫學院當過實習醫生,現在已經是主治醫生了。聽著他們講著他們怎麼醫治病人。

畢業後十五年的同學會,醫生他們工作過度,薪水不斷下滑,健康不如以往,這時換在華爾街的金融家意氣風發,可是沒人會喜歡他們,因為他們總是在玩財富的遊戲。

到了畢業後二十年的同學會,這時候在團體裡面發光的是創業家,他們憑著寫出不可或缺的應用程式,或是用生物科技製造出新的藥品,也可能發明了新的業務流程改造了零售業,他們創造出了獨占事業,把產業的餅做大,替其他人包含自己創造了財富。

這個故事是來自"慧眼挑金"這本書,每個人在替自己人生做決定時很可能都會看到別人風光的一面羨慕他們然後想要跟他們一樣,但是過了幾年後他們變得不是那麼風光了,那時候再改變自己的決定又已經太晚了。

創新才會真的改變整個社會,選擇做自己想做的事情並做的與眾不同,或許現在的努力還看不到成功,但在持續努力的過程中將會學到很多,也許過了不久之後你抬起頭就發現世界被你改變了,創造的可能不是財富但能讓周遭的人受到啟發也是件值得驕傲的事情。

c++ error: operator []: overloads have similar conversions

template <class Type>
class Array
{
    Type&       operator[] ( unsigned int index );
}

Array<int> a1;
a1.pushback(10);
a1.pushback(20);

int g = a1[1];

c++ error: operator []:  3 overloads have similar conversions
Because the compiler can't determine "1" is int, const int, or unsigned int in the implicit conversion rule.

We need to cast it to unsigned int, let the compiler knows what we like to do.
sol:      int g = a1[static_cast<unsigned int>(1)];


Reference:
http://stackoverflow.com/questions/1726740/c-error-operator-2-overloads-have-similar-conversions

Introduction to Three.js

Image
JavaScript 3D Engine WebGL based rendererDeveloped by GoogleSupport Canvas and SVG rendererLightweightModel loaders: JSON, Binary, COLLADA, UTF8Reference:
http://fhtr.org/BasicsOfThreeJS/#1

The relative order of initialization of non-local static objects

Refer to Effective C++ 3rd item 4.
The Relative order of initialization of non-local static objects defined in different translation units is undefined.
main.cpp
--------------------------
testVar var;

int _tmain(int argc, _TCHAR* argv[])
{

     int t[16];

    memcpy( t, var.getVar(), 16 * sizeof(int) );
    return 0;
}

The t will be set [ 0, 0, 0,...... ]. It is wrong, I have set the t to g_identity. I must occur the relative order problem.  Below is the original source code.
testVar.h
--------------------------
template
class testVar
{
private:
    Type var[16];
    static const testVar g_identity;
};

testVar.inl
-----------------------
template const testVar testVar::g_identity( 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15 );
template
testVar::testVar()
{
    setIdentity();
}

template
void testVar::setIdentity()
{
    memcpy( var, g_identity.getVar(), 16 * sizeof(Type) );
}

I replaced direct access non-local static variable - g_identity with call to function
testVar.h
------------------…

Java Calendar.Month return month

Java... Calendar.Month. Today is in May, but It return 4. I found it defined one year is 0~11... so I need to plus 1...

Build SpiderMonkey on Windows

SpiderMonkey is Mozilla's JavaScript engine written in C/C++. It is used in various Mozilla products, including Firefox, and is available under MPL/GPL/LGPL tri-license.

https://developer.mozilla.org/en/Building_only_SpiderMonkey


Requirement:
     Visual Studio 2008

Download SpiderMonkey v1.8.5 after and unzip it https://developer.mozilla.org/En/SpiderMonkey/Getting_SpiderMonkey_source_code#Getting_the_latest_SpiderMonkey_source_codeDownload and install MozillaBuild.exe https://wiki.mozilla.org/MozillaBuildDownload NSPR and unzip http://www.mozilla.org/projects/nspr/Open Visual Studio 2008 Command Line Enter MozillaBuild folder, type start-msvc9.batCompile NSPR
cd c:/nspr-4.8.9
mkdir Debug
cd Debug
../mozilla/nsprpub/configure --enable-win32-target=WIN95    (  WIN95 means Win32 not Windows 95)
makeCompile SpiderMonkey
cd /c/js-1.8.5/js/src
autoconf-2.13
mkdir Release
cd Release
../configure --enable-win32-target=WIN95         (*)

cd ..
mkdir Debug
cd Debug
../configure --enable-win32-target=WIN…

Concern about _itoa()

char *c1;
int lens = 8;
c1 = (char *)malloc( lens * sizeof(char) );

for ( int i = 0; i < lens; i++ )
{
    _itoa( i, &c1[i], 10 );
}

free( c1 );

Above things perhaps  is right. Howerver, it will crash at free( c1 ). It says there is a heap overflow problem. Because _itoa at the same time set ASCII at index item and set the index+1 item to '\0', it will access the c1[lens] item....Therefore, that occurs crash.

遊戲的市場一直都在變....

2009年底 EA收購了宣佈以 2.5 億美元現金(約 88 億新台幣)及 2500 萬 EA 股票併購 Facebook 上頭知名網頁遊戲開發公司 Playfish.

從那天開始我就半推半就的離開了我正在開發的high-end平台遊戲,做著做著兩年過去了,網頁遊戲還沒做完,又發生了多起的併購風暴:

Zynga 2012年三月花了1.8億美元的價格收購了《DrawSomething》開發商OMGPop Inc
韓國Nexon 2012/4/22正就收購移動開發商一事進行談判
2010年底DeNa收購ngmoco, Google收購SocialDeck
Gree 2012年五月花了兩億美金收購行動社群遊戲公司Funzio

遊戲市場的趨勢最近真的變得很快,有收購的存在就表示有人產生了威脅,如果能夠迅速地適應這市場才能讓自己活得比較久。

Android device detect by Mac OSX

Image
you need to update the PATH for tools/ and platform-tools/ folder. type nano ~/.bash_profile
export PATH=${PATH}:/Users/(username)/Desktop/android-sdk/tools export PATH=${PATH}:/Users/(username)/Desktop/android-sdk/platform-tools
save it
type adb devices
show: * daemon not running. starting it now on port 5037 * * daemon started successfully * List of devices attached  HT95FKF0xxxxdevice

HTML5 Browser Comparisons

Image
Desktop browser WebGL comparison
http://www.texaswebdevelopers.com/html5/


Mobile WebGL comparison
http://mobilehtml5.org/


All Browsers WebGL comparison
http://caniuse.com/