Start a new project and push to remote git repo
Like many folks out there, we have been making the switch to git from svn. Although we struggled with git early on, after using both for some time I have come to appreciate the benefits of git. So here is our way of starting new projects with git.
Using gitosis on our server, we create an empty remote repo first. Then, one guy gets the project going and pushes the code into the empty repo. Here are the commands to get that going.
$ cd path/to/new/project
$ git init
$ git add .
$ git commit -m 'initial commit'
$ git remote add origin git@devserver.com:newproject.git
$ git push origin master
Web Wednesday March: Making your splash in the iPhone App Store
Web Wednesday March: Making your splash in the iPhone App Store
Web Wednesday三月:在iPhone程序商店中寻找惊喜
iPhone has changed the way we think about cell phones, and with the App Store, a whole new industry has developed within the past 2 years. Apps, especially the game apps make people crazy about them.
iPhone彻底颠覆了我们对手机的看法,过去的两年里应用程序商店作为一种全新的产业进入了 人们的视野。应用程序,特别是游戏应用程序已经让人们为之疯狂。
As more and more Chinese have iPhone, iPhone games have become more and more popular in China. This month’s Web Wednesday, Peter Tam, CTO of iNFOiSLive and Gameislive, gave us a great speech about the current situation of iPhone App Store in China-market.
由于越来越多的中国人拥有iPhone,iPhone游戏在中国越来越受欢迎。本月的Web Wednesday,我们请来了拉阔资讯有限公司(iNFOiSLive 和Gameislive)的技术总监谭止诚来给我们谈谈中国iPhone应用程序商店的市场现状。
Peter founded his company with a friend after he got his doctorate in US. His company is an international developing IT outsourcing services provider based on Apple system. They develop software, games and ring tone for mobile phones, especially for iPhone.
Peter在美国博士毕业以后就和朋友创办了自己的公司。这家公司 是一家快速发展的国际化信息技术服务外包公司。他们以苹果系统作为服务平台,为手机,特别是iPhone,设计软件、游戏和铃声。
Here are some interesting things mentioned by Peter:
以下是Peter谈到的一些有趣事情:
iPhone games will be translated into English most of the time, but not into other languages. Games always have English version or its local language + English version. Games with only local language version are very rare. Are all the developers good at English? The fact is most of the users are English users. Of course, even the registration of iPhone developer is in English.
大部分时候,iPhone游戏会被翻译成英文,而不是翻译成其他的语言。大部分游戏都只有英文 版本或者本地语言+英文版本。只有本地语言版本的游戏是非常罕见的。开发者的英文都那么棒吗?其实是因为大部分使用者都是英文使用者。当然了,连 iPhone开发者登记都是使用英文的。
Online mobile RPG is more popular in China than other countries. And RPG games are hard to translate into English.
手机线上RPG在中国比在其他的国家更受欢迎一些。RPG游戏也非常难翻译成英文。
Some iPhone App development company have a wired strategy. Most of the App’s names starts from character “A”, Awful Hand, Alien Crisis...This is a traditional A naming strategy in these companies. Unfortunately, most iPhone players will search for App by Top10, not by the name sorted.
有些iPhone应用程序开发公司有一个非常古怪的策略。大部分的应用程序的英文名字第一个字母都是A,Awful Hand,Alien Crisis……这是这类公司传统的“A命名策略”。但很不幸的是,大部分的iPhone玩家都是通过搜索应用程序排行榜上前十位来选择游戏的,而不是根据名字。
Low price and low quality games are on sell in China. The result is losing money and ruining the market.
很多低价低质量游戏在中国出售。结果就是赔了夫人又折兵,赔钱还毁了市场。
People like jailbreak game in China.
中国人喜欢玩翻版游戏。
Q&A
问答环节
Q: Once you put the game on App Store, there will be some SHANZHAI appears. Even when you sell weapons, it will be the same. How can you deal with it?
问:当你把游戏防盗应用程序商店里面,你不怕有山寨版出现吗?就算你是卖装备,也是会这样啊。你怎么 解决这个问题呢?
A: We have a certain account to receive the money. If people choose the SHANZHAI version or pay through the SHANZHAI store, they still can not use it. Because our system doesn’t receive the money, so it would not give you anything.
答:我们有固定的账户来收钱的。如果人们玩山寨版,通过山寨商店买装 备,他们仍然不能玩。因为我们的系统没有收到钱,就不会发出指令让你得到任何装备。
Writer’s Note
作者手记
Wind of iPhone blew into China a few months ago. More than half audiences of Web Wednesday March have iPhone. Now, you can find more and more guys playing games with iPhone in the metro in the morning. You can find the boys playing Doodle Jump at the lunch time in Kudelabs. That’s why we put this topic on top.
iPhone的热潮几个月前就已经吹到了中国。三月Web Wednesday的活动上,过半数的观众都有iPhone。现在,你会发现越来越多的人在地铁上用iPhone玩游戏。你也会发现Kudelabs的男 孩们在吃午饭的时候都在玩Doodle Jump。这就是我们要讲这个话题的原因。
After a sufficient promotion online, this Web Wednesday was full of audiences. Most of the audiences are developers. And one is the author of Fun Input Toy, a famous free input method of Mac OS, Feng Huajun came and shared with us. We don’t know what would attract them most, technology, iPhone or games. But, no matter what, we are happy to see the family of Web Wednesday grows bigger and bigger.
经过了网络上充分的宣传,这次的Web Wednesday坐满了观众。大部分的人都是开发者。甚至Mac OS著名的免费输入法:F.I.T.(Fun Input Toy)的作者华君也到了现场和我们分享。我们不知道是什么吸引他们来的,是技术,iPhone还是游戏?不过,无论如何,我们都非常高兴看到Web Wednesday大家庭越来越兴旺。
Web Wednesday Guangzhou September: Mathias Lin gives some tips on Open Source Software
On September 30th, a day before an eight-days long National Holiday, Mathias Lin, as the guest speaker of this month, gave us a talk about Open Source Software (OSS). Unfortunately, on this special day, most of the people absented to gain more time for the long way back home or trip. So it wasn’t too crowded this time, but the people who stay with us were really big fans of Web Wednesday. Thanks all of the people who always supporting us, no matter they were there by person or especially click to this page now to check out this review.
9月30 日,8日国庆长假来临的前夕,这天,担任本月客席主讲的Mathias Lin与我们共同探讨开源软件。 遗憾的是,在这特殊的一天,大部分的人都必须为他们回家的漫长旅途或者长途旅行争取一些时间,以至于他们非常可惜地不能参 与。所以本次的活动并不是像往常一样人头涌涌,不过那些能够留下来和我们一起的观众确实是Web Wednesday的超级粉丝。感谢所有一直支持我们的人,无论是能够亲身到来的朋友,还是现在特别点击这个页面来看看活动回顾的朋友。

Mathias
Back to the review of the Web Wednesday.
让我们正式回到Web Wednesday回顾这个主题吧。
Our guest speaker Mathias is founder and managing director at SYSVISION Ltd. (Hong Kong) as well as Vice President, Products & Technologies at SYSVISION USA, Inc. He gave us a good speech about OSS.
我们本次的客席主讲Mathias是汉智科技(香港)的创始人和常务董事,同时也是美国汉智科技产品及技术的副总裁。他为我们作了一次非常好的关于开源软件的演讲。

Audience
To make the audiences learn easier, Mathias Lin started his topic with the introduction of OSS. He told us the technical and function definition of OSS by showing the differences in the excerpted, between Windows XP and GNU Public License. In general, Open Source Software is the software with no-maximum legal licence, and also you can see or use the source code. He help people to redefine the concept of “Free” to tell the differences between Free Software and Open Source Software. Here is the “Free” he metioned:
为了让观众们更容易理解,Mathias Lin以介绍开源软件作为他演讲主题的开端。并以Windows XP与GNU Public License说明书上的不同作为例子,为我们阐述了OSS在技术上和操作程序上的定义。总的来说,开源软件就是一个没有合法使用权限人数上限,并且让你 能够看见甚至使用它们的源代码的软件。Mathias帮助人们修正免费的概念,以此来区分免费软件和开源软件。以下就是他提到的“免费”的内容:

Aaron and Alice
What is free?
1. Free as in beer ($)
2. Free as in freedom (gnu.org):
–Freedom to modify, fix, and redistribute
–Freedom from corporate control
–Freedom of expression
–Plus freedom to integrate, freedom from ads
3. Freedom from vendor lock-in…
All open source software is cost-free, but not all cost-free software is open source.
什么是免费?
1. 免费,和免费啤酒一样
2. 免费,获得使用自由
-拥有随意修改,维护和重新调配的自由
-没有公司操纵的自由
-表达方式的自由
-加上资源整合的自由,而且没有广告
3. 没有了厂商对使用内容锁定,拥有了自由
所有的开源软件都是免费使用的,但并不是所有的免费软件都是开源的
Freedom from the “Free” is what Mathias pointed out. He also showed us some OSS in use and made a simple introduction.
从免费中获得了自由就是Mathias强调的点。他再后来也给我们展示了一些人们正在使用开源软件和简单地对他们做了一些介绍。
He also shared the benefit of OSS and how to build a business model afterward.
其后,他也和大家分享了开源软件的优点,还有怎样的建立一个商业模式。
Open source has practical benefits for all:
–“Better”: More stable, secure, interoperable
–You can make a difference
–Little or no licensing cost, upgrade costs
–Good community support, direct line to developers
–Lower system requirements
–Vendor independence
开源软件拥有切实的优点:
-更好:更加稳定、安全、更能共同操纵
-你可以把他变得不一样
-非常少或者没有权限使用费用,和更新费用
-非常好的群体支持,可以直接和开发者取得联系
-更低的系统要求
-独立的厂商

Jonny
Most of the developers will think it is insane to let people know their mystery code for free. But Mathias explained that there is motivation for developers to work on OSS. In his opinion, for 4 reasons, developers would give it away: the benefit from previous work of others; better software, when others can fix it; many hands make light work; part of the business model. Because of the good feelings from any volunteerism, the respect, fame, pride in one’s creation etc, working for free would become reality to some developers.
大部分的开发者都会觉得让其他人免费知道他们的神奇代码是非常傻的一件事。不过,Mathias解 释道,对于开发者来说,是有一定的动力去驱使他们去做开源 软件的开发的。他认为,有四个原因开发者会让人家去了解他们的神奇代码:首先是他们自己能够得益于前人的工作;另外,当有其他人可以维护的时候,就会有更 好的软件;人多力量大,工作更轻松;最后,这也是一种商业模式。基于任何一个志愿者都会产生满足感,而且,自己从创作能够得到了尊重、声望、与骄傲,等等 这些原因,对一些开发者来说免费的劳动也会成为现实。

Little, Jev and Cici
Moreover, Mathias also mentioned some problems and obstacles in OSS. Before the Q&A, he listed some current status and trends of OSS.
另外,Mathias也提到了一些开源软件的存在问题和发展障碍。在问答环节之前,他也列出了一些开源软件最新的现状和趋势。
Problems I've met after upgrading to Snow Leopard
I upgraded my Mac OS X Leopard to Snow Leopard a couple days ago. Everything seems to be fine, system runs faster than before in general. But a couple of softwares doesnt work compatible with SL.
The 1st one is mysql, after upgrading, it's completely gone, I just cannt find it. Then I try to reinstall it with macport, but zlib doesnt work with SL too! So, install mysql manually may be the best way.
Solution: Compiling MySQL on Snow Leopard
The 2nd one is mysql-gem. When I wanna reload db, it shows "uninitialized constant MysqlCompat::MysqlRes" error. To fix this, specify ARCHFLAGS when you install the 'mysql' gem:
sudo env ARCHFLAGS="-arch x86_64" gem install mysql -- --with-mysql-config=/usr/local/mysql/bin/mysql_config
refer to: Error: uninitialized constant MysqlCompat::MysqlRes
The 3rd one is thin-gem. Well, easy to fix:
sudo gem update thin
How to install Paperclip
Paperclip is a plugin for Ruby on Rails’ ActiveRecord that lets files work as simply as any other attributes do. Installing Paperclip itself is simple and quick. But before you can use it, you have to install a couple of libs and softwares.
1. MacPorts
The MacPorts Project is an open-source community initiative to design an easy-to-use system for compiling, installing, and upgrading either command-line, X11 or Aqua based open-source software on the Mac OS X operating system.
Make sure Apple’s Xcode Developer Tools is installed (most of the developer would), you can find it at the Apple Developer Connection site or on your Mac OS X installation CDs/DVD. Download disk image from MacPorts offical site, double click the pkg file in the virtual disk to start installation. Notice:The installation may look like “hang up”, be patient, the “successful install” message will show up within five minutes. But you need to install more libs for MacPorts manually. Open Terminal application and type “sudo port -d selfupdate”, it will finish the rest.
2. ImageMagick
ImageMagick® is a software suite to create, edit, and compose bitmap images. It can read, convert and write images in a variety of formats (over 100) including DPX, EXR, GIF, JPEG, JPEG-2000, PDF, PhotoCD, PNG, Postscript, SVG, and TIFF.
This is what Paperclip based on. Installing ImageMagick via MacPorts is suggested. Open Terminal application and type “sudo port install ImageMagick”. The port command downloads ImageMagick and many of its delegate libraries (e.g. JPEG, PNG, Freetype, etc.) and configures, builds, and installs ImageMagick automagically. Notice: It will take such a loooooong time. In mainland China, connection to those sites of the libs is very very very slow. You will have to break the process by “ctrl+c” and redo “sudo port install ImageMagick” again and again. Fortunately, it will automatically resume the installation where you broke it.
3. RMagick
RMagick is an interface between the Ruby programming language and the ImageMagick® and GraphicsMagick image processing libraries.
Simply open Terminal application and type “sudo gem install rmagick”. Still you have to be patient. A lot of time will pass with no output from the gem command. The “Successfully installed” message does not mean that RMagick was successfully installed. The RMagick installation can encounter error conditions that gem can’t detect. The following irb session is a better indicator of a successful install. (Of course the version numbers in the message may vary from what is shown here, depending on what versions of the software are currently available.)
4. Paperclip
This is the final stop of our trip.
To install Paperclip, open Terminal application and type “script/plugin install git://github.com/thoughtbot/paperclip.git” at the root directory of your rails project. Creat your migration by typing “script/generate migration AddPhotoToListings”. Open your migration and add following:
Then rake your migrations by “rake db:migrate”.
Next you have to tell your model to use Paperclip, open app/models/listings.rb and add following:
At new and edit views you can add:
At show views you can add:
Now, enjoy Paperclip!
Google Developer Day 2009
Last Friday, I attended the amazing Google Developer Day 2009! It’s a set of one-day developer events, and a very good chance to learn about latest products from engineers who built them, including Google Maps, OpenSocial, HTML 5, O3D, Android and the most exiting Google Wave! And this is the first time I have chance to talk and share my thoughs with Google developers.
At the keynote speech made by Kai-fu Lee, we learn about the latest products from Google and new features of existing products. There are two products I should pay my attention to, one is OpenSocial, the other is Google Map.
We have a project known as “FriendsMap.net”, helps you visualize where your contacts from Facebook via facebookr gem are located on the Google Map, we are planning to add Twitter via twitter auth, but it seems it’s hard to make facebookr and twitter auth work together compatibly. After a OpenSocial API lecture by Patrick Chanezon, I think OpenSocial is a better choice. OpenSocial is a common API for social applications across multiple websites, with this API we can bring more social network into our app and without learning how to build with every single one of them. The other techology we are using is Google Map. On Google Map lectures by Pamela Fox, I learn about the latest Google Map API V3, with many new features can greatly increase performance of our website. I ask Pamela a few questions about how much work will be needed in upgrading code V2 to V3 and drawing clickable hotspots on custom gmarkers. Her answer is quite funny and I become totally her fan after the conversation.
At the end, thank you Kudelabs offering me such a great opportunity, and all those who work with me on FriendsMap.net, thanks!
The time has long past for IE6
Following a movement we started in twitter, there is more noise on the web about dropping support for IE 6. This time it comes from a respected web development magazine in the form of a well reasoned article: http://www.bringdownie6.com. For our biggest sites, IE6 makes up 17-26% of the browser share. On this site, IE6 is only 7% (you guys can pat yourselves on the back).
It has long been our position that IE6 is a clearly inferior browser that should be banished. About a year ago, we started allowing some features to degrade, or perhaps not work as nicely in IE6, simply because IE6 can’t support what we want to do. The best example is transparent PNG, which IE should have supported in 5.5. The web would be a much more beautiful place now if it had.
We welcome and support the recent emergence of standards based competition in the browser market. With Webkit, (Chrome, Safari), Firefox, Opera, and even IE8, we look forward to a bright, progressive future in web development.
- As members of your community, take the time to help someone move off of IE6.
- As consultants, explain to clients why supporting IE6 is a waste of time.
- And as developers, lets refuse to downgrade our work to appease the few stragglers.






