Thursday, 27 October 2011

Need to Stop and Think for a While

My life is really buggy these days.  So buggy that I even cannot figure out what I am doing and where I am heading. I really need to stop and think for a while.

1. CS3216 is not about grades, but all that count are grades.That's a bit mysterious. Honestly, I do think my group is doing pretty good in the final project, except the time management is not well conducted. My group members are all very intelligent people. Hu Qiang has a very clear mind on what direction he should be heading(not only in terms of UI). Yingbo is fast in coding. Aldrian thinks really deep and  comprehensive. I am also doing pretty well in this project. In the first week, we've developed the ePub file handler(Aldrian), REST api(Me), reading page(Hu Qiang) and  the basic javascript functionalities(Yingbo). However, when I look at the final project requirements, it says the prototype needs to be as good as the previous assignments and that counts for 10% of the total mark! I'm very worried though. Thankfully, Prof. Ben gave us one extra week to polish it to a that standard. We worked out the book store/personal library(Hu Qiang), localstorage(Yingbo), Synchronization(Aldrian&Me)&Social integration(Me). All that left for us is debugging. We manage to fix most bugs, but unfortunately it's not that easy to be totally bug free. I thought we can finish the whole thing by last Saturday, but we too optimistically estimated the timing. As local database is never getting any updates, we changed the whole local database into local storage and did the synchronization for the local storage and the server. It unexpectedly takes the whole weekend. The most difficult part for our project is synchronization and logic flow. For the synchronization, thanks to Aldrian who is really an awesome programmer, we finished the sync function without bugs on Sunday night after Yingbo finished debugging the local storage. I personally feel ashamed not be able to submit a bug-free ebook reader to Prof. Ben when he has already given us a lenient extension. The problem that really bugs us is the logic flow. We shall first check whether there is a userID stored in our local storage.We'll also need to check the user's mode(online/offline) to determine whether to fetch from local storage or from the server. Bugs can come all along the way from the html, the javascriptAPI to the RESTful API in the server. When we show the demo on Tuesday, there are still many problems. One big bug turns out to be my fault. The facebook api unexpectedly returns a undefined uid value when the javascript API is called. I fixed it after dismissing but find another bug in my UPDATE httprequest, which supposed to fetch some values using GET method and some using PUT. The bugs are almost fixed now but there still got some problems with the logic. As our API is developed before the UI, a userID have to be passed to perform all the functions. We've got some disagreements on the guests login function which may cause a big problem if a fixed userID is used to perform all the functions as multiple users are changing the same reading history/bookmark/settings, etc.

Really got many things to write, like the IP address in our EC2 instance is not detectable in China. The cover page takes too much time to load and why we developed the upload function but choose not deploy it, etc.

Prof.Ben asked about reading epub via providing the ebook url. That's simple to develop, actually I have found the github code few weeks ago using purely javascript to first unzip the epub and then using iframe to display all the html contents. We have thought through at the beginning of our project. We can choose either to process the ebook data on the client side or process the data on the server. Both way is acceptable. However, we are not fully utilizing the processing power of the cloud if we are relying on the client side to process the data. Another concern is that we'll need to get the standard data to store the book infor directly to our database to allow other people to read and SYNCHRONIZE.

2. Am I suitable to become an entrepreneur? After working with many teams this semester, I gradually realize the importance of a good team is really a critical fact for one's success. For instance, I refused a week team and chose to work in a very strong team for a HyperMarket embedded system project. It turns out that the two teams are going to end up with a very different standard of final results. In a strong team, there will be  leading players who will ensure the quality of a job and control the process of the project. People will all be contributing. However, in a weak team, most people will take the soy source and only one or two team leaders will take the fully responsibility. Fortunately, my CS3216 group is awesome expect we are all tend to be individual thinkers/workers and even the strongest programmer is not sort of leadership type. Communication is important but really not easy. I am playing a leading role in a CS2102 project. Thanks to CS3216, I know clearly about what is expected and how to make the things work. Unfortunately, 3 out of the five team members are weak programmers( Though I'm pretty weak in CS3216, but I can consider to be a pretty strong programmer in CS2102). I am suspecting there will be too few brilliant workforce in the market to work for me if I decide to build my own company. However, after listening to the talk on Monday, I found that teams not seem to be that important though...wondering whether Prof.Ben brought some entrepreneurs which are just too lucky.  I intended to ask a question on the co-funders as well. As I observe, those who have worked for few years tend to build their individual businesses. While those we started their own businesses right after(or before) graduation tend to work with a co-founder. Google/Apple/Microsoft, etc, those great companies seem to follow the pattern of two initial founders, one  CEO and one CTO.  I seem to be more keen to be a CTO, but I personally knows my own technology background is not really that strong. I seem not a CEO type either, lack of good communication skills, convincing decision making skills, etc.Not really likely to become an entrepreneur, unless I can really find a good idea and make it happen then occupy the market ASAP. Hu Qiang and I shared the same birthday, maybe we'll work together someday, but before that we both need to be much more stronger.

HaHaHaHa , Sleep!

Thursday, 13 October 2011

Some Thoughts

I didn't realize the real problems our app is going to face until Zit Seng shared his thoughts on Monday's lecture.

Loading time is critical. We won't meet a user's satisfaction if it takes too long (say more than 2seconds) to load. That's pretty disastrous for a HTML5 app as the app may include heavy framework js/CSS files. On one hand, we shall do as many computation as possible on the server side and cut down clients' JS files to reduce the loading time. On the other hand, we can hardly make it as we need these files to perform offline functions. This challenge will unfortunately happen in our new HTML5 app. Even people in China will be accessing it. What if it takes 10 seconds to load the page?!

I also felt worried when Zit Seng said that we shall avoid .htaccess and reduce http requests. Thanks to him, we can at least avoid some of the bad designs in our app. We previously thought to use more javascript to process the ebook reader. Later we decided to utilize the power of cloud to process the ebook data in the back end and do less work in the front end. Thanks to Aldrian, who is really thoughtful and bright to suggest a very scalable database design.


I feel pretty good on our app. Though it's still very rough, I find our team mates are getting more involved now. Hu Qiang has made a pretty nice design. Yingbo processed the json object on the client side. I'm doing pretty well with the database and API. Aldrian is also doing good at the book format processing and some high level designs. Compared with the previous two assignments, we seem to be more specified and dispersed in the job allocation. I find it good and time-saving.

Am updating IOS5 on my Itouch:) Need to do other projects tomorrow as well.

Stay Hungry, Stay Foolish--Steve Jobs

Tuesday, 4 October 2011

Final Project App We Are Going to Build

Prof. Ben keeps emphasizing that CS3216 is not about hard coding, but about solving problems and making a difference.

1. What is the app that we are going to build?

We are trying to build a HTML5 reader that works on different platforms including desktop/laptop browsers, tablets (ipad,etc) and smartphones (iphone /android). I initially came up with the idea of making a HTML5 ebook reader when Hu Qiang and I discussed with an ebook retailer who are currently making a native ipad reader. We think that more people will be able to explore the app if we make it a cross-platform one despite of their physical devices limitations. We also would like to take the advantage of HTML5 and the cloud to allow content synchronization and offline reading.Yingbo enjoys reading novels on her ipod touch and she finds the idea pretty interesting. Aldrian also thinks it's a good project, then we four decide to work together and make it happen:)

2. What is the exact problem that our app is trying to solve?

Depending on situations, readers have their own preferences on the reading devices. For instance, they may love to read on their phones when they are taking a bus. But when they are at home, they may like to read on their laptops or tablets. When the reading devices changes, they would like to continue reading on the new device the same page where they left last time. Readers are also sometimes lazy to download ebooks and then import to their devices. They would prefer a ebook reader that directly get the resource from the internet and view the book on the ebook reader. Another supply-demand problem: China is said to have a mobile ebook reading market of more than 0.8 BILLION RMB/quarter year and we are build this HTML5 to meet the huge demand...

3. Are there similar apps with a similar idea?

Previously, we thought Google ebook reader is the only HTML5 ebook reader that works on different platforms. It uses epub format for its most ebooks and disables the right click button javascript to prevent copying. Later we notice there are some more html5 ebook readers including MagicScroll and BookWorm. They all use epub as their ebook format. Epub ebook is like an archived zip file that packages the xml ebook contents and the corresponding css and format information,etc. Epub is integrating HTML5(to include some important tags), but most epub ebook are in the market are still xmls.

One very new HTML5 ebook reader is the Kindle Cloud Reader by Amazon which was launched a week ago. It's very elegant. Kindle Cloud Reader allows bookmark synchronization,  offline reading, too. They assigned different tags on the html passage tag<p> to do book marking.The ebooks are mostly in epub format, too. One big disadvantage for the Cloud Reader is that it only allow kindle users to access the contents. So far, only Chrome, Safari(desktop/ipad) are supported. Another disadvantage for Amazon is that they do not open up their services in China yet due to copyright and cloud service registration issues. Whereas, our app is mainly targeted in Chinese Ebook Readers which is said to be a 0.8 BILLION dollars' annual business(We're afraid not to implement monetization on that).

A good news for us is that there is no HTML5 ebook reader found in Chinese Market yet. We are the pioneers!

4. Job Allocation.

I know Aldrian and Yingbo are very good programmers. From my knowledge on them, Yingbo is good at javascript but do not have a very good UI sense. She would love to be very clear on the product she's going to build and execute on it. Aldrian is great on database and basically every technical problems. Hu Qiang is new to me and I'm not really sure what he can do. As he said he would love to do the UI, he just do the UI loh. I have done some API implementations and social network integration on the last assignment, but they don't seem to be that important for this project. As I'm the only guy used JQuery Mobile in the last assignment, I'll do some JQuery Mobile stuff and research on the EPUB format. I've designed the database schema already, Aldrian and I may change the role a bit on the job allocation listed in the proposal. For this project, UI might be the most critical part. Previously, we thought the partner company's  UI designers may help, but they don't seem that helpful after talking with them.

I personally love Kindle Cloud  Reader and think it's not hard to build a UI like it using JQuery Mobile. But we need different layout for different screen size devices, the UI may not be suitable for all. By the end of the day, we agreed to build a prototype with the similar UI as QQ reader first for the first version.

For text display, I think it would not be nice to take the HTML file out and render it on Canvas, but as my team mates  say we would be able to standardize all the text format and layout if we render all the text on our own way instead of directly use the HTML file in EPUB. Prof. Ben suggests that Canvas would be too slow to render and not so stable. I think I'll try on both and figure out what's the best way.

5. Very good suggestions.

Prof. Ben suggests that we can allow users to provide a url for the ebooks they find interesting. This not only provides other readers with the access to the books they love to read(not in our library yet), but also prevent copy-right problems. That's a very good suggestion. We may try it out. Kok Wee also finds it a good idea to synchronize among different devices, but the big competitors seem to be very challenging for us.

If you have any other suggestions, please feel free to comment on the blog. Thanks:)
Last but not the least, we'll attract more than 10,000 users for the project, fairly big number ha.