effective life plus

Binzy's blog

Windows Phone 7, Hammock, OAuth and Sina Weibo’s API

| Filed under Mobile Programming

OK, I am developing a windows phone 7 app for Sina Weibo. I just simply don’t like the basic authorisation… And OAuth is much better since once you get the access token, you can use it all the time rather than always passing the username and password around. though there are already two Sina Weibo client apps (1 free and 1 is asking for $0.99) in marketplace, my friend Remy and I still want to develop a new app which will be free and open source.

(more…)

Windows Phone Marketplace Tip for 5.6 Technical Support Information

| Filed under Mobile Programming

OK, it turns out that Microsoft is forcing this policy from the new year, I mean from 2011. My little simple free app’s update was failed the certification at 5.6, which simply requires you to expose your app’s version number and your contact information to end users. So if your app has just single page, probably just put it in some corner and set the opacity lower. If you have multiple pages, adding an about page will be a good idea.

So how about contact info? I tried to add my twitter link to the app, and it just works. From some internal discussion, I would think following information will be OK (not guaranteed…) since in basic, it just requires you to provide a contact approach for end user to contact/feedback to you.

  • twitter link
  • a webpage/website
  • embedded contact form page
  • email
  • anything else can find you…

Hope this helps…

深入PHP :面向对象,模式与实践

| Filed under Programming

书终于在上个月出版了,而我对翻译的记忆的细节已经完全模糊了,只依稀记得那是从2007年到2008年。刚开始的时候是第一版,然后第二版出来了,然后继续翻译,因为2版之间区别不大。大部分的时间都是haohappy在沟通和协调,而我仅是负责我的那部分。虽然我也已然记不大清我具体负责了哪几章,大体是模式那部分。书最终还是出版了,虽然有读者抱怨说原书第三版已然出版,但我还是想说,虽然是第二版,书还是好书。这本书是为数不多的把面向对象,模式及相关良好实践阐述的比较清晰和深人,并且按照PHP的方式来阐述的书。虽然书中的一部分内容,现在看来有些许过时,但理论是一致的。大部分应用软件开发的成本如果不计质量(当然也不计研发),那主要在于单位时间的人力成本及时间总量。而优秀的设计,模式和实践都有助于降低成本及提高或保持质量。

原书的第三版从目录来看,更新了一些有些过时的内容,比如版本管理从CVS改为SVN,针对PHP5.3的一些新特性添加了一些内容,并且加入了持续集成这样的重要敏捷元素章节。

不得不说,翻译比我想象的要累得多。不仅要考虑到原作的表达,也要符合中文的习惯。希望我的翻译不是太糟糕。
更多关于本书,可前往douban等网站,也希望大家多批评指正。

Expand Short Url & Google App Engine

| Filed under Cloud Programming

1. I decided to play around with Python several months ago, but the only thing I’ve done is once creating a script to retrieve an online manual with still few understanding of python. I think I should keep trying…

2. I’m living in China within the famous GFW, and I’m using a twitter proxy site to tweet when I’m at home or using mobile phone.   So there is a problem to me, the http://bit.ly is almost the most popular short url service on twitter which is also blocked by GFW…

3. There are some short url expanding service sites, like http://longurl.org, but they were blocked sometime…

I decided to create a simple function with google app engine after dinner. So that I can continue to learn some of python and also know a little of google’s cloud stuff.

Then here you go the app: http://yatlongurl.appspot.com/ and the source code here. Really quite fun to write code with python. But it looks the app will be intermittently unavailable. And apparently, I did not use any of real functionalities of google’s app engine. Possibly I will add support to automatically retweet or delicious the useful link while expanding it .

nginx + Zend Framework @ Windows

| Filed under Programming

If you feel pretty boring with Apache, just like me, so having a try of nginx might be good idea. Although at most of my time, I’m using Windows, fortunately, nginx has native Windows build. So my steps might be helpful to you to try nginx on Windows, especially Windows 7.

1. Download nginx and php and install

2. Configure nginx and php

  • PHP, no specific configuration, just do what you like to php.ini.
  • Nginx
    Fast-CGI of php
    You can find sample from wiki.nginx.org, http://wiki.nginx.org/PHPFastCGIOnWindows, below works for me.
    location ~ \.php$ {
                fastcgi_pass   127.0.0.1:9999;
                fastcgi_index  index.php;
                fastcgi_param  SCRIPT_FILENAME  D:/www/public/$fastcgi_script_name;
                include        fastcgi_params;
            }

    Configure for Zend Framework
    -f and !-f are used for checking whether file exists.
            error_page 404 /index.php;
    
            if (!-f $request_filename) {
                rewrite ^.*$ /index.php last;
                break;
            }

3. batch script to start and stop nginx + php-cgi

I’m using RunHiddenConsole to hide the prompt window and actually you also can use vbs to run nginx.

start-nginx.bat

@ECHO OFF
ECHO Starting PHP FastCGI...
C:\nginx\RunHiddenConsole.exe C:\PHP5\php-cgi.exe -b 127.0.0.1:9999
ECHO Starting nginx...
C:\nginx\RunHiddenConsole.exe c:\nginx\nginx.exe

stop-nginx.bat
@ECHO OFF
ECHO Stopping nginx...
taskkill /F /IM nginx.exe
ECHO Stopping php-cgi...
taskkill /F /IM php-cgi.exe

but php-pfm doesn’t work on Windows unless you are using cygwin.

nginx_zend

Zend Framework Multiple Helper Path Configuration

| Filed under Programming

As you may have multiple configuration for helpers of Zend View, simply configure as below will help

resources.view.helperPath.Zend_View_Helper = APPLICATION_PATH "/views/helpers"
resources.view.helperPath.My_Custom_Helper = "/path to helpers"

The “My_Custom_Hepler” is the prefix, so that you can support your different modules’ help path without hard coding in php codes.