Skip to main content

Posts

Learning Ruby on Rails

 1. Polymorphic Association http://railscasts.com/episodes/154-polymorphic-association http://guides.rubyonrails.org/association_basics.html#polymorphic-associations For instance, a book can be liked and a video can also be liked. To make a generalised association which can like both a book an a video, we can simply make a polymorphic association named likeable which contains the likable_type and likable_id.  2.  Choose between has_many :through and has_and_belongs_to_many http://guides.rubyonrails.org/association_basics.html#choosing-between-has-many-through-and-has-and-belongs-to-many For instance, a book has many tags and a tag can be associated with many books. To make a simple many-to-many relationship, we can simply use has_and_belongs_to_many. However, to create an indirect association through a joint model, we can use has_many:through. 3. execJs: 'Could not find a JavaScript runtime' error. To add gem 'execjs' gem 'therubyracer...

What is more important

Just recovered from last weekend's hackathon in Blk71. It was a nice one, except that our team didn't get the top prize. Honestly, we are among the most hardworking teams and we delivered a cool app. That's great. Though it is the process that matters the most, the team still feel quite down when the result doesn't fit our expectation. The less hardworking teams actually made it, not because their apps are cooler, but that they used the apis provided by the sponsors. However, our app will probably be further polished to fit the real market whereas most other teams will not move on. That's a quite big difference. The idea first came when Jerry(the project manager) and I met in a hotpot restaurant in Beijing two months ago. It's a travel app which records the friends' location when they post images and generates travel history summery.  Two of my juniors, Zeyu and Cui wei are very interested to join, thus we form a team to make the app out. Jerry himself ...

Commitments

"When you commit for something, it becomes some sorts of responsibilities." I came back to SG to attend the commencements few days ago. Actually, I didn't intend to come back so soon. Firstly, I still haven't finished the voluntary job in One-Man university(wanmen). Indeed, I enjoy it so much that I spend days and nights coding the system. Secondly, my favourite profs are not attending the commencements(Indeed, I think my favourite prof would rather me to work harder on the great projects than taking a photo with him). Thirdly, the commencement of CEG(computer engineering)takes place in different dates with SOC and Engin while my most projects are actually accomplished with SOC peers. However, I finally bought the air ticket, firstly because I have committed to Sharon(the NOC Israel coordinator) that I'd better come back to attend the commencement day since it is one of the most important days in one's life. Secondly, our iOS team has committed to attend the...

Super Fruitful Weeks

These two weeks are extremely fruitful. Almost all my expectations for coming to Beijing have been met in such a short time-- to form long term relationship with entrepreneurs here, to work with talented designers, to improve my coding skills, to experience the tech entrepreneur life, etc. I'm loving the city. Though not as clean and nice as Singapore, this is a place for young dreamers to pursue their careers. As a famous song writer wrote about Beijing, " 我在这里欢笑(I'm laughing here) 我在这里哭泣(crying here) 我在这里活着(living here) 也在这里死去(dying here) 我在这里祈祷 (praying here) 我在这里迷惘(confusing here) 我在这里寻找(seeking here)  在这里失去(losing here) ". The extreme inequality creates a lot of diversities and opportunities here in Beijing. The youth have a strong desire to be successful and they form active entrepreneurial communities in cafes, meetup groups, incubators,etc(mostly in and around Zhong Guan Cun). Here is a photo taken in Cheku Cafe which is a tech hub for youn...

@Zhong Guan Cun

It was a fruitful week. The major task I do here in Beijing is to help a friend building an open university for the ordinary Chinese people. It's a non-profitable organization and the founder is not going to accept any commercial fundings. I know the founder personally during a trip visiting the Versailles in Paris. He was a master student in Ecole normale studying Physics. Before that, he was an undergraduate student in Peking University. When I met him in Paris, he already got admitted by ETH for the PHD study with full scholarships. However, instead of going for the PHD study, he returned to China to build the open-university,named 万门大学 (one-man university). At the beginning, I thought he was doing the open university for fun. However, after observing for half a year, I realised that he really means it. Indeed, I think he is going to devote his whole life to the education career. In the past two months, he went to 30+ top Chinese universities to give talks on th...

First Week in Beijing

Some highlights 1. I attended a talk by Amazon China's VP, James Fong in Peking University Guanghua school of management. In one of his slides, Mr. Fong highlighted Amazon's products eco-system in the following diagram which was drawn by one of Amazon's founders in the early years.  The diagram starts with sellers, followed by selection and customer experience, then growing traffic, lower cost structure,lower prices and better customer experience, finally a better eco-system. Some of the stages in the circle can be beaten by other competitors, but a stronger eco-system is not that easy to be challenged. The most important fact in this diagram is " Customer Experience" as Mr. Fong mentioned, that is why most companies now focus so much on improving "Customer Experience". Another thing he highlighted in that talk is the difference between the Chinese market and the Foreign market in terms of e-commerce.  Two examples can be "Payment(alipay ins...

In the Great Firewall Zone

I flew to HK two weeks ago and stayed there for three days before flying back home. The brief thoughts and observations of HK have been posted on my  travel blog . My mum happened to be quite free during my stay at home because the printing factory she worked for was under investigation for its sewage pollution. There are quite a number of problems in China. Some happening ones in my hometown are pollution, food safety, ageing population, rapid urbanization, educational resource shortage for the less developed areas, trust between people,etc. Good news is that problems always come with opportunities. People of my generation are working on it to fix the unhealthy nation. Last Wednesday, I came here to Beijing which is the IT hub of the whole nation. People are striving for survivor. Competition is fierce, even a call taxi app has got several competitors. http://blog.renren.com/blog/253739580/905754705 Behind the Great Firewall, Blogger, Google Drive, Google handout, Fa...