Google DevFest 2013 Hefei
Google DevFest 2013 Hefei

Last Saturday (9/22) I attent to the Google DevFest 2013 session Hefei site meeting. I have a 40 minutes speech to intorduce some Google's APIs and services. I felt good but my wife said she want to sleep when she hear my speech :-(

Read More>
AWS S3 files manager
AWS S3 files manager

AWS S3 Files Manager An AWS S3 Files online manager base on python/django To use this app follow these steps: Create your working environment Install Django Put the s3filesmanager into INSTALLED_APPS Install additional dependencies syncdb and migrate (if you use South) Install pip install s3filesmanager louis vuitton outlet Dependency django-model-utils django-bootstrap-toolkit PIL sorl-thumbnail boto django-storages INSTALLED_APPS INSTALLED_APPS = ( ... 'south', 'bootstrap_toolkit', 'sorl.thumbnail', 's3filesmanager', ) Settings AWS_ACCESS_KEY_ID = 'YOUR_AWS_ACCESS_KEY_ID' AWS_SECRET_ACCESS_KEY = 'YOUR_AWS_SECRET_ACCESS_KEY' DEFAULT_FILE_STORAGE = 'storages.backends.s3boto.S3BotoStorage' AWS_STORAGE_BUCKET_NAME = 'YOUR_AWS_STORAGE_BUCKET_NAME' ASSETS_URL = 'https://BUCKET_NAME.stimuli.s3-website-us-east-1.amazonaws.com' MEDIA_ROOT = ASSETS_URL + 'media/' MEDIA_URL = ASSETS_URL + 'media/' AWS_S3_SECURE_URLS = False AWS_QUERYSTRING_AUTH = False urls.py url(r'^', include('s3filesmanager.urls')), template tags {% load s3filesmanager_tags %}

Read More>
盘点我9个月的自由职业生涯
盘点我9个月的自由职业生涯

从去年8月份我离职开始自由职业以来,我就一直没有理发,头发长长的,别人看了觉得“好有艺术范”,好吧,我承认自己有那么一点闷骚和自负,谁说一个写代码的不能有艺术感呢?话说我当年还是以文科成绩见长呢。虽然我学的是机械工程自动化专业,但从小(好像是初中)开始就喜欢计算机,所以毕业后坚持从事了IT,搞软件开发已经有十一个年头,可惜是碌碌无为,又或是为生活计,女朋友计,结婚生子计,家庭计...... 混到后来在一家别人看来还不错的外企朝九晚五,我也曾经买过杜拉拉那套书,也想个职场中如鱼得水,飞黄腾达,可惜造化弄人,眼高手低,又不肖阿谀奉承、溜须拍马,终是得一攻城狮称号,各大招聘网站不定时更新,QQ好友中也有那么几位猎头偶然闪动,十几年下来,换得几家公司,萝卜坑、白菜坑,抑或是什么别的坑。终有一日,英语曰:suddenly!,脑海中闪现巨大问号:这不是我要的生活,这不是我的destiny!我看了很多书,去了不少地方,北上广面了一轮,好吧,没有我想要的,何不放下?放下即得到,于是我选了个好日子,2012年8月8日,离职,先去了趟东南亚看海,回来做起了自由职业。

Read More>
How to use raspberry pi to build a network media player at home
How to use raspberry pi to build a network media player at home

2 Weeks ago I buied a raspberry PI from the office homepage (http://www.raspberrypi.org/). I was thinking to use it as a mini web server to host as a private git server, but it's too easy to implement so I dicided to do some others. I knew the XBMC is a good solution for raspberry PI and fortunately there is a opensource project named Raspbmc which provide the install package for PI. Ok, let me show how to use them together to build a powerful home network media player!

In the Chinese government advocates thrift campaign on the occasion, Hermès (Hermès) is one of the few luxury brands continue to maintain prosperity in the Chinese market. Hermes CEO of the family business heir Exel ? Dumai (Axel Dumas), said: "So far, there is no indication that any of our performance has been affected."Earlier cheap louis vuitton outlet and the Japanese artist Yayoi Kusama between joint series launched by the world's loyal fans in hot pursuit. Recently, one of London's most famous department store Selfridge (Selfridges) opened the eagerly anticipated even among the Louis Vuitton Yayoi Kusama louis vuitton outlet store concept store, but also the world's seven cooperation program concept store.To fully convey the complete creative ideas blame my mother's, Selfridges for the first time all 24 windows fully showcase a range of advanced garments, handbags, shoes, and her collection of Louis Vuitton accessories, and put a lot of louis vuitton outlet online specially made props, even a 1: 1 between grass Yayoi wax. The concept store has a circular dots work points more than the American painter Roy Lichtenstein (Roy Lichtenstein). The retailer's Miracle House (Wonder Room) has been transformed into a red and white meet the Seussian display area. And Yayoi Kusama's signature giant pumpkin is used as a chandelier and countertops. Although a century luxury brand cheap louis vuitton handbags in an elegant style leather started, but in recent years it is very aggressive in cutting-edge fields of impressive costumes, in addition to women for young women often spend big money to play outside, men are increasingly have more attempts, such as the fall and winter of 2012 atlas, then special clothing with a variety of simple, but stressed that a strong personal aristocratic demeanor.New season encompasses leather, shirts, and other basic color models down vest, hunting equipment, MA-1 flight jacket and so followed the traditional brand advocate noble sports. Also, unlike in the past no longer suit tall as serious and rigid, but added more mature young man that has focused on the playful and chic, in general, still exudes the inviolability of nobility, but it is undeniable that the cut really is quite outstanding. If you feel perfectly packed luggage is not so important in the journey, then you probably can only say that travel long enough, or do not appreciate the art of the perfect package. In this area, as the absolute leader louis vuitton outlet , maybe we do not have an exclusive butler to help you pack, then at least to steal the division at the thought of the French royal family started packing bags Louis Vuitton (Louis Vuitton ), enjoy a box "perfect luggage," the charm of it.In 1854, Mr. Louis Vuitton designed the first revolutionary cheap louis vuitton outlet online flat top leather case, and in Paris, opened the first LV store, creating the first generation of LV pattern, since then, the capital letter combinations LV the pattern has been the symbol for leather, has long lasting. But just like today, LV's design will soon be copied, then flat-topped rectangular suitcase will become a trend. cheap louis vuitton online suitcase from the early to the T stage in Paris a year now constantly changing LV fashion show, LV (Louis Vuitton) has been standing on the top position in the international fashion industry, the real reason is that has its own special brand of "DNA" as one of Louis Vuitton's core technology, excellent exquisite leather craft is from generation to generation ever since. Louis Vuitton leather goods perfect interpretation of this century and a half after the temper of craftsmanship and skill: it is the details of the art, in-depth understanding of the material, but also on the superior quality of continuous exploration. All of these factors contribute to a product unmatched durability, but also demonstrates the Louis Vuitton timeless craftsmanship. cheap louis vuitton in 1854, began his career in the production of hard luggage. With the constant changes in modes of transportation, Louis Vuitton also will continue to improve their products, the production range gradually expanded from hard to soft luggage suitcase.1901 launch of the Steamer bag and in 1930 launched Keepall series, both for travelers with a more lively, simple and practical way. Both products are inspired and led more new designs and innovations, thus laying the cheap louis vuitton outlet store leather craft position in the field.1888 and 1896 and the launch of Damier pattern classic Monogram canvas, Louis Vuitton leather goods has become the most representative elements, but also a symbol of the Louis Vuitton brand elements.In 1998, Marc Jacobs, cheap louis vuitton handbags as creative director for the brand to bring a series of changes. Louis Vuitton respecting tradition and on the basis of consistent style, Marc Jacobs launched Monogram Vernis, Suhali and Utah and other iconic series. In these fashion-oriented products, Marc Jacobs and Takashi Murakami collaboration (Takashi Murakami), Stephen Sprouse and Richard Prince and other famous artists will once again carried the brand's classic pattern of a new interpretation of fashion. louis vuitton bags outlet leather goods every one made by the exquisite and meticulous craftsmanship. These skills and knowledge through 150 years of accumulated between artisans continue tradition, has become a tradition.Carefully selected materials from leather to sew fine fine system, to concentrate on the details of creating the best products, Louis Vuitton show consistently high quality standards. Today, Louis Vuitton, as always, with their proud traditions and styles, while constant innovation, improvement and development of all aspects of the manufacturing process, the virtuosity generations. 

Read More>
git分支策略
git分支策略

    话说当年linux内核开发者林纳斯·托瓦兹(Linus Torvalds)为了更好的管理Linux内核开发,创下git(读『给特』)以来,时至今日,当下最流行的『版本管理系统』已非git莫属了!

    笔者私下认为,git相比其他的版本管理系统(csv, svn等)来,最大的方便莫过于分支(branch)的操作十分便捷,但项目开发分支如何管理,萝卜白菜各有所爱,见仁见智。笔者因工作需要,经常要参与国际化团队的协作开发,git乃是必不可缺之利器之一。在实际的开发过程中,偶有小得,不敢私藏,帖此一来做分享用,二来抛砖引玉。

一、团队开发者人人一个分支
    笔者曾经给一个创业团队从事开发工作,中间和几个印度人一起合作,几个印度人一上来便要强调代码版本管理的方式,即要求每个开发者都有一个branch,我称之为『开发者分支』,即每位开发都都从master分支上创建一个独属于自己的分支,自己所做的开发都在这个分支上进行,具体操作遵循以下步骤:
1. 开始工作前,先pull自己的分支的同时,merge主分支,这样保障自己的分支的代码是最新的(包括了主分支上最新的代码)
2. 在自己的分支上进行工作,commit和push代码
3. 当功能已经完成,并且经过了测试之后,push自己分支的代码
4. checkout到主分支,pull最新的主分支代码,merge自己分支的代码
4.1 如果这个时候,主分支代码并没有别人的代码(即还是步骤1那时的主分支代码的话),主分支merge自己的开发分支应该是没有任何问题
4.2 如果这个时候,主分支代码已经有别人的代码了(别人在你之前操作过同样的步骤),主分支的merge需要自己处理冲突,git merge会自动merge没有冲突的地方,有冲突的地方需要手工处理
5. push主分支, 这样主分支上就会有你的开发分支代码,并且已经进行过merge

    这种方式我们可以看到,适合一些小的,团队开发人员不太多的情况还是非常好的,尤其是每位开发者开发的功能都相对独立,也很容易在每个开发者的分支上查看commit记录等。但对于一些大的项目,或者开发人员比较多,开发功能又相互交叉的情况下,笔者觉得还不是很理想,因为第4步会经常碰到merge和冲突的情况,处理不好会让整个开发团队痛苦。

二、只有一个主分支和一个开发分支,其他为临时分支
    这是笔者从一个米国开发者那里学到的一种策略,后来发现这种方式MS更为流行和科学,尤其是在github上结合了pull request的使用。
    总的来说,就是一个项目只有两个分支,一个分支是主分支,这个分支只用于部署,对于一些大版本的部署就使用主分支;另一个分支为开发分支,所有开发人员都只在这个开发分支上进行操作,主分支可以定期或者定版本的从开发分支上合并用于部署。除了这两个固定的分支外,可以有很多临时性的分支,比如一个功能一个分支,一个bug修改一个分支等。当每个临时性的分支完成后,merge进开发分支,这个临时性分支就完成了历史的使命,可以说拜拜了。当然留着也行,只要你不觉得以后分支太多太花眼的话。具体的操作遵循以下的步骤:
1. 当有一个功能需要开发的时候,某位开发者从开发分支上创建一个新分支,这个分支的全名尽量和要完成的功能相关。假设要实现一个图片上传的功能,我们可以取名为image-upload,如果你取名abcde-123啥的,没人知道什么意思,别的开发人员或者主程以后肯定会砍你的。
2. 这位开发者开发过程中,对image-upload这个分支进行正常的commit和push代码
3. 当功能完成,并且通过测试以后,这位开发者觉得可以合并回开发分支了,这时
3.1 merge开发分支到image-upload分支,确保在他开发image-upload过程中,有别的开发者已经做过类似的操作,合并了其他的功能分支的代码。
3.2 push image-upload分支
3.3 checkout开发分支,再merge image-upload的分支,这个过程中也有可能还会有冲突,因为有可能就在执行3.2和3.3之间这短短的时间内也有别人做过操作了,解决冲突之后顺利把开发分支merge image-upload分支,这样开发分支上就有了image-upload分支的代码,并push开发分支
4. (可选项)可以删除image-upload分支了,然后进行下一个功能的开发操作,重新执行步骤1

    这种方式有一个好处就是不管开发人员有多少,固定的分支只有一个,一个开发分支,一个用于部署的主分支。同时我们可以看到,最有可能发生冲突的地方是在3.1,因为开发者在开发过程中,别人已经merge了新的代码到开发分支,而这部分的代码有可能和这位正在开发的代码有冲突,但是这种冲突发生在自己正在开发的代码上,所以处理起来应该没什么难度。至于3.3的冲突,可能性极小,就算发生了,因为仍然是自己正在开发的那些代码有冲突,处理起来问题不大。

    其实对于策略二来说,笔者曾经工作的项目团队是不允许每个开发者都自己去往开发分支上merge的,有这种权限的只有主程那个人。(这里说的权限并不是实际上一个权限系统,而是事先说好由谁来做这部分工作),因为我们的项目是放在github上的,我们使用了github的pull request的功能,即在步骤3.2之后,开发人员不需要往开发分支上去做merge操作,而是提交一个pull request到开发分支,由主程来审核是否通过,如果主程审核代码觉得没问题,他可以同意这个pull request,代码也就自动合并到开发分支上了,如果他不同意,可以让开发者继续进行某些修改直到同意。当然在此过程中,pull request的代码已经不能自动合并到开发分支上了(过程中有其他的pull request请求先通过了,不过我想一般主程不会干这种事情吧)主程可以要求开发者解决冲突后再同意pull request,顺利merge进开发分支。

    不管是哪种策略,笔者认为,目标是使用git来有效的提高效率,尤其是提高整个团队的协作效率,并且遵循一致的方式。当然,以前很多只有笔者一个人开发的项目,因为没有team member,笔者都是一个主分支到底的:-) 但是采用主分支(用于部署)和开发分支分开的方式,更加科学和明确,应该会在以后项目中自经常采用。

【以上文字,皆为原创,如需转载,请注明出处】
































Read More>