Wednesday, 12 December 2012

The Future

Wonder if anyone from CS3216 is still reading these blogs...

Was reading a bunch of articles about the PC vs mobile space and started day-dreaming.

Actually, *this* article http://arstechnica.com/gadgets/2012/12/in-bringing-office-to-ios-microsoft-is-playing-a-dangerous-game/. In it, the author mentions that Windows dominates the PC world, and iOS dominates the mobile world, and both aren't willing to let it go.

The development of their products is highly defensive right now I see it, with respect to the competitor's platforms. iTunes, Office for Mac, Office for iOS? How many of these are to provide true choice to the user - i.e. platform independence - and how many are to induce the user to switch platforms? Microsoft seems the less aggressive player in this tug-of-war, as compared to Apple which is consolidating its iOS base it seems.

That is just one thing.

I want to envision the future, where we probably have much more surfaces that are actually computers in some form. Let's look at some videos that probably better explain it...






This kind of world isn't just confined to Microsoft's dreams - the scenes in WALL-E (my favourite movie) also have significant similarity with such a future. (And Pixar is rather aligned with Apple as any Pixar fan should know). Various other sci-fi movies have also shown similar technology. These worlds are often shown to provide such power to the user, in a way that it is almost like a personal helper.

Assume we have all the technology to make all these happen. Transparent materials for the actual devices and interfaces, reliable APIs for virtual interactions in mid-air by any major platform.

In such a world, how would one dominant player or two/several competing players be different? What kind of ecosystem would we have? Cloud-based? Data freedom?
What would the platforms look like? Would there be apps? Apps would definitely specialize, how would apps communicate with each other?
What would devices look like? How are we going to make every surface smart? The advent of low cost computing has to come to make almost every surface do something.
What kind of infrastructure would we have? Fibre and wifi everywhere? Data centres won't be much different I presume... (www.wired.com/wiredenterprise/category/secret-servers-2/ good read too)

It's thus that I see Windows and maybe iOS as taking the right steps towards this future, though they are really slow steps - the packaging of apps, memory and resource management etc are really useful in this kind of future. Windows 8 share contracts are probably one of the things that when developed to its fullest, would enable apps to talk to each other, with whatever they want - critical for emergent behaviour and value to appear.

Windows Phone though, has become a niche computing platform. Would it one day just appear on one of these surfaces?

No one knows, but I sure hope this day comes in my lifetime...

Tuesday, 4 December 2012

Back to FYP

Now that exams are over, it's time to go back to FYP.

Scripting COMSOL in Matlab is so unintuitive. The whole objective function "program" looks nothing like a program, but more like a bunch of function calls to COMSOL API.

All that is written by me are only equations, to multiply this variable with that. It is just a script of math equations that I can't picture, that mostly make sense when you take symbol a multiply with symbol b.

The NSGA (non-domination sort genetic algorithm) implementation was rather interesting, however it's getting rather tedious to modify it.

How I wish I can rewrite the whole thing. But it's too late for that isn't it?

Wednesday, 21 November 2012

CS3216: Mission Complete

It's over. Another chapter closed. So much to say, so much to think about. Even though there's so much to do, still must post, to find closure for myself. This post won't be truly coherent, I'm going to just write here what comes to my mind.

Well, can't really say mission complete. It wasn't really a mission in the first place, it just - happened.

But through this course, I've really seen a lot, gone through a lot, had moments of real happiness and also severe unhappiness, even depression - where I sort of hated everything that was happening. All thanks to my friends who saw me through everything, that's why I'm still writing about CS3216 and this late hour...

I remember at the start, when it was just the first week or so, and we got our assignment 1. My friends were saying "what module wants you to have a project completed by week 3? school hasn't even barely started!" Indeed many of them asked me to drop this module and concentrate on the others - such as FYP. Such is the camaraderie amongst chem eng, but yes, we are engineers and we are so damn practical - attempts at what you do should to be feasible with your resources. (to any people reading this, I repeat for the nth time - I am NOT from CS). So I got hooked on app development (i was thinking "seriously I'm going to write a FB app? no way this would be possible").

Assignment 1 (Let's Goal) was characterised with many late night stayovers as we coded in COM1 basement at 3am on Saturday mornings, followed by all those workshops in the afternoons. Endless seaweed (actually limited) provided by yujing and yuling was the main stay for me (maybe?). I still don't like my design for Let's Goal, and we really need a better UI. Sadly my assignment 1 groupmate shaohua left the module by assignment 3.

Assignment 2 - the 20s slides that was incredible to watch and impossible to finish. characterised by weird random meetups during assignment 1, and one strange session in the library where we practiced in the discussion rooms.

Assignment 3 (CrossView) - sometimes after I code too much here, I call it cross-eyed. A project with kianzhong whom I worked with once in RH, when I was still damn new to PHP. REST server was fun to do, but connecting to the REST endpoints as a app was messy. VERY messy. I just remember the crazy index.inc.php and kz's "i don't want to do already, i want to drop the module". Same thing, late night coding sessions in SOC. First time I didn't sleep in 1 day.

Thus recess week disappeared. At this time I was really panicking about my FYP (or lack thereof), since interim report was coming soon. 4 projects from my chem eng modules were coming up back-to-back / overlapping, and I still had FYP to do (SUPER IMPORTANT since it'll be possible veto for my honours class ><). At one point I had 6 deadlines in 1 week (midterms, projects, 3216 deadlines).

What to do? Press on with it. I don't know how I survived. Till this date, I don't know WHY I am in this course. I mean, HOW ON EARTH did I get in?! Did the filters not filter me out as one of those who won't be able to take the pain? Cause I don't think I can, and I don't think I did take all the pain till the end. I'd hope Colin or Su Yuen can enlighten me on this (if you read this - or I may go bug you on fb once everything's settled) on what element in my essay made you accept me. Really curious.

Back to topic. Final project. I was very uneasy about joining what came to be Mini Monocle. Afterall, CrossView was interesting, and Project Genius (as initially what the group was about) was intended to be an ipad app. No iOS development history, no idea what's happening, and we had 5 people. Felt very uneasy, like I've stepped into "wrong territory". I told them, I can leave if we can't have 5 people. The twins told me "no we're staying together". Still felt uneasy. Set my mind on learning iOS and making myself useful.

So we set about planning for the PG app (the acronym is ironic isn't it). But the idea got thrashed on the first consultation. It was too elaborate, too complex, and going against existing players with no idea what's happening on our end. Project Genius framework - scrap that..

Fast forward. PL1 not open, no Macs, obtain OSX VM. Started installing onto hard disk, then when I got into xcode - I thought "what?". I was totally lost as to how to code for a mac (haven't done C-related coding for 1 year)

When we got the Mini Monocle idea, we were at Katong, at Kai's parents' music school (Millet Music). Parents told us they didn't like Angry Birds, Temple Run and those brainless games. Which I rather agree for kids, but not for us. Spent one afternoon after that to look through the feedback and coming up with program features and even some simple concept art. That was when we came up with "Mini Monocle".

Still felt uneasy. Tried to figure out what iOS apps are built of. The NS prefixes, the views and controllers and their terms thoroughly confused me. After I started doing the database, I realized that the programming concept was somewhat parallel to windows forms programming (i.e. stuff like visual basic lol). Felt a bit better about iOS.

(going to bring out all the issues - to try to settle them once n for all - hopefully to get the closure that i want, and maybe move on)

Then came the first bombshell, at least for me. We had initially decided on SQLite as our backend, which seemed somewhat complicated. I was determined to learn it though, but suddenly I was told "we're using core data". I was suddenly very VERY upset. I suddenly felt like I wasn't part of the group, but just an extra pair of hands who could do coding. That sapped all my energy and I didn't talk to the rest for some time. It was a rather terrible experience to be already trying reading/learning something complex to fulfil your part, then suddenly to be told that it was decided by your group members that we'd be using something else. Just couldn't take it, and I sort of snapped. Maybe as stress and self-expectation builds, the trigger to break it all up was as simple as those in quotes above.

At this point, I was just being an idiot and resisting for the sake of principle instead of logic, cause I was really upset. So eventually we figured out that there weren't something else that was really suitable for the persistence, and I agreed to it as well.

We went on and I sort of accepted that I won't be touching the mac already - even though I was supposed to be a coder (Imagine what I was thinking when people asked me "so you're coder?" at the poster session). The twins would run the show, and I'll just make changes to the core data model and the database accessor methods. Which I think most of them were unused by the time we fine tuned our app for poster session.

Then it came again, a second time, when the features that I had coded all night got discarded. ): I gave in, all restraint went loose and I just went "do whatever you want". Was very upset that my intentions for future-proofing weren't understood, that it became extraneous stuff. I was thinking, "what on earth was I doing for this project? am I really just an additional pair of hands?" Felt like I'm just a freeloader for the project. Was so hurt that I just stoned through another project meeting that I was at for the next 2 hours. And I went back and cried.

It's a good case of trying to do well for project A, getting rejected, and giving up on B, C, D, etc. Never try that. Be more resilient. I can put it on my personality for how and what I responded (simplify stuff to observe patterns, and taking it to heart personally), but that's simplifying stuff and attributing where they may not have an exact cause and effect.

Note to anyone who's doing very logical stuff. Remember that you're dealing with people, that people have their ups and downs. Sometimes we all forget cause it's easy to get lost in the unfeeling world of logic, math and science and forget the feelings of others, and unknowingly hurt them in the process. I've done this many times to. But be very careful, and always remember this.

So in the last week, I tried to concentrate on the poster session. Dabbled in illustrator, did whole bunch of scripts here n there to rename files (damn exact-case file name matching in OSX), and learnt photoshop scripts. Of course, it was a given that I wouldn't be touching the code, so I tried wherever possible to do other stuff that I could do. Modified the DB accessors to get whatever was required, based on what was asked.

I was basically slacking around in SDE when we decided to do a promo website. Jumped at the opportunity, after all it's probably what I do best with my current resources. Took on the website and finished it in 2 days, with small refinements here n there. Considering how I worked, I was working the way I didn't like others to - do all the work on my own, and never update the rest on what's happening. But, that was the only way that I felt I was making up for the work that I never put into the project...

In any case, kai and ben are awesome designers. So enjoyed seeing them generate the graphics, and the different styles that they did: "kai-style" and "ben-style", and they could even do graphics in each other's styles. Interesting. And it was damn fun "ordering graphics" in the lab: "i want a blue facebook icon" "i want a xxx icon" and they'll go "coming right up". AI really looks damn fun, I should go learn how to use it...

So in the end, our whole group was staring at one mac, one ipad, and all of us were generating QR codes, objects, silhouettes, stickers and "stickers with standard sizes" till we were lost on what was for what.

---- Mood check. Got too emo from that previous part. Must not do this again. ---

Got emo when leaving SDE for the last time towards SOC. Again. It's what happens when you leave memories behind without proper closure. I AM SENTIMENTAL. VERY.

Poster session was rather crazy. The number of people that came way surpassed my expectations, like it was a trade fair / IT fair where people squeeze to get to stuff. Was stoning around trying to take photos with kai's zai camera and blending into the crowd. Until my IT1005 lecturer (Steven) came around and asked me what's the app doing. Then I had to recall what we had talked about... and I surprised myself with the stuff that I described. Of course observation of the rest while they presented was crucial to this though.

After that presentations came rather smoothly. Jammed up some times when I forgot to talk about the value proposition (it might not be obvious). One person gave me a huge lesson on what to say, how to do a poster presentation, and gave A LOT of help.

So leaving SOC for the last time in this sem at 10:30pm, memories from CS3216 are a mixed bag. Seemed to have understood myself and my friends LESS instead of more. Sometimes I even feel I don't understand anyone.

---- And I still am wondering how on earth I got through the pain filter check ---

Thanks yuling and yujing for accompanying me through this course, and for accepting/ignoring my craziness at times.

Thanks kianzhong, ruifeng, zhaorui for crossview. Sorry I didn't continue with you for final project...

Thanks kai, ben for being wonderful designers! Love your UI and thanks for teaching me so much. and letting me 班门弄斧 in some design matters lol.

Thanks colin, su yuen, jon lew, angad, and alan so much for the course, and especially colin and su yuen for being the contact points that got so much interaction with all of us. If i'm doing such a thing, i'd probably be exhausted by the end.

----

Now CS3216 is complete (except for final report :X)...

My dreams aren't. Nor my other mission that I hoped to achieve. Let's see if it'll come through in the end.

Till then, keep the dreams flying high. With dreams and proper execution, the world is a much better place today than yesterday, and will be even better tomorrow.

----

So I've written continuously for 1 hour and 40 minutes. It's 2:40am right now.

Time to sleep soon, and re-budget the energy reserved for CS3216 to FYP and the other modules.
Design project, FYP (my irritating 130% energy efficiency) and 2 finals.

IT1005 review session for my class in 5 hours. Can I survive tomorrow? I wonder hahaha

----

CS3216: mission complete.

Thursday, 8 November 2012

Compromises

It really really sucks when I have to make compromises. Somehow I feel like the decisions I make don't make any more sense, when I try to accommodate this and that.

Like not putting in enough effort for iOS cause my comp is running my FYP.
Like planning a birthday celebration and the actual birthday person isn't going.
Like coordinating meetups and I have to resolve strongly differing opinions.
Or just choosing a place to eat in a group, and making sure everyone is fine with it.

It isn't a matter of time management or stress handling anymore. It's about the relationships you have with other people. I wonder why I'm trying to make sure it's all fair, that everyone is happy, at the expense of my own health and stress. When to other people, it doesn't mean a thing at all. AT ALL. I keep asking myself, why do I still do it, then?

I read this I think 7 years ago. Explains what I'm saying about. http://www.personalitypage.com/INFJ.html

Really tired of all of this. I think I'm really trying to do too much, for too many people, with too little time, and not being understood.

Tuesday, 23 October 2012

Week 9 and 10: Security, Scalability

Since I forgot to post on the class last week (or more like, too caught up in work), will do one post on both weeks at the same time.

----

Week 9 was on security. Security as a form of protection for users' data that has been entrusted to you (as simple as a password).

The ultimate test of the lecture contents is what you remember after 1 week. The 2nd half on how IBM is structured to produce security products, I didn't really pay attention. But the first half was rather interesting, especially when a typical loophole after another were revealed in class. I particularly remember the part on SQL and code injection, because that was one of the earliest security lessons on a web service I had. And maybe about password hashing for storage. And this.

I remember the first time I encountered PHP programming was in Year 1, in RH computer club. We were supposed to pick up PHP and MySQL to write a "Supper Ordering System". Of course novice projects weren't implemented, but in the implementation, one of the seniors taught me the concept of MD5 hashing. I was hooked on this simple way of protecting users' passwords, yet not being computationally complex (I still don't understand SSL, encryption keys).

Under some circumstances that are now fuzzy memories, I managed to talk to one senior on database statements. And so he taught me the need to protect against SQL injection, by escaping every string that was provided by the user — possibly using a custom layer to protect every SQL query that goes to the server.

One thing that I always believe when developing apps is that we have to have security in mind right from the start. From the storage layer, user data especially private information should be somehow protected. The best place this can be done is probably at the database interface layer.

I don't know much about securing the communication between the user and the server, but another thing is to protect your data from being tampered without the right credentials, and to prevent leaks of the same data. So the usual implementation I'd come up with is: if you have the correct credentials to access the data, I'll let you push or pull the data. And guess where this goes — database layer.

Of course, authentication and stuff is another tricky issue that needs rather in depth testing to make sure no information can be leaked. I don't know much about this, so let's leave this to the experts to say so?

----

Week 10 was on scalability. Nice, big word. And coming with it are a whole bunch of related terms like, elastic provisioning, high availability, load balancing, duplication, redundancy.

I always had an interest in scalability - of storage. In the past, when I was running a computer with a small hard disk, the numerous external hard disks that came in 40 or 80 GB, ended up being consumed very quickly. That'll probably make any person who backups regularly think "where am I going to put my next backup? a new hard disk? or do I delete some old ones to make space for the newer backups?" And the headache gets bigger when you deal with backups and shared storage across a network that you maintain alone.

Then came along NASes. And WHS (Windows Home Server - I'm a supporter of this OS). After one year of evaluating the costs-benefits of each variant (linux boxes vs headless WHS), I caved in and got a DLink DNS323. What it seemed to tell me is that the storage in this box is going to be scalable. Put in one disk, you get a 500GB NAS. Put in 2 disks, you get redundancy (duplication RAID-1) or speed (RAID-0 or JBOD). Replace disks, you can seamlessly upgrade to larger disks under RAID-1, and to your clients, it's all transparent.

WHS was even better. After WHSv1 got terminated by MS, I got a friend to buy back WHSv1 from the US, and installed it on an older desktop. The best part of WHS over linux NASes like my DNS323 was that my storage was expandable, scalable — across ANY bus type — to create a disk pool. And I didn't have to worry about storage being a limitation anymore as long as I have enough ports (money is still, data must still live in hard disks). When capacity is reached, just get a new disk, and the software automatically balances storage and duplication across the disks using certain heuristics (like associated files are kept on one disk to prevent spin-up & down across many disks or something like that). And still, to the clients, it's all transparent. (Plus I get proper windows server support for shared printers!)

But. The awesome Drive Extender software layer had been terminated as of WHS2011, but its spirit lives on, reinvented in Windows 8 Storage Spaces.

(The joys of a digital hoarder.)

As can be seen, scalability of a home NAS / server has many parallels to a web service that is accessed by many clients. In a storage environment, the resources that are needed are the physical disks, while in a web service, the resources are the app logic and database etc.

But the same concepts apply. Addition of low cost layers to the resource acquisition process: duplication of essential services (redudancy), load balancing & proper routing to the desired resource. All while being transparent to the client (same IP, same HTTP requests).

In any case, it was interesting learning about the scalability issues from a more fundamental software, hardware and efficiency point of view (like swap, RDS i.e. slow clients, and the expensiveness of threads on linux - never knew that!)

----

Noticed I like to relate what I've learnt to past experiences. Interesting.

Sunday, 21 October 2012

Panic state

Having real serious time management problems now.

Competing objectives of FYP, 3216, core module projects. Each with different time costs and benefits. Sounds like an optimization problem, but with unknown weights.

FYP is really stuck. The model isn't working beyond 1 cell, so optimization of fuel cell stack is not really possible in the current state. The updated scripts that I got run really slow, and the API is really complex, so I don't know where I should continue.

CS3216, just doing database for now. Although it sounds and looks very similar to VB6, VC# and .Net in general, I'm going to leave the real coding to yj and yl, since they're experienced and I think they don't want me to mess up anything, or slow anything down. Which is real likely. I don't know if it's me or what, but I just feel like I'm not doing enough for this group.

Have too much on my hands already. Feel very lost and tired.

Thursday, 4 October 2012

Peer review

So I missed the deadline for peer review... Must have been blind to not see the time but the date only... Opened IVLE at 9:02 when it closed at 9am. ARGH.

Can I do anything for it now? ><