Tuesday, December 29, 2009

Desert for today

Made 3 of these today.
[caption id="" align="alignnone" width="561" caption="OooOOooohhh. Yummiest."]


i walked away only for a few seconds, it was still in pristine condition, came back and found out that somebody had been naughty!

Tuesday, December 22, 2009

Committing to SVN using Bazaar

Ejat and I were working on how to do the above for MyMeeting codes and we did it! I have asked ejat to put this down in writing in his blog, but sadly the blog is not available anymore (alaa ejat bukan susah sangat cari hosting punnnnn.. susah2 ko host sendiri jek kat umah :P)

MyMeeting is also on Launchpad that makes use of Bazaar. We wanted to find a way how to send changes to both its main repo (using SVN) and Launchpad.

So we've been using SVN for MyMeeting hosted at OSCC. A typical way for us would be like this.

$ svn co https://svn.oscc.org.my/mymeeting/trunk trunk
$ cd trunk
(hack hack hack...)
$ svn status #see our changes
$ svn ci -m 'added feature ABC' #commit to SVN repository

To use Bazaar to work with SVN repo, you have to install bzr and bzr-svn. Excellent doc on bzr-szv is here.

$ sudo apt-get bzr bzr-svn


Working with Bazaar, the way would be something like this.

$ mkdir dev
$ bzr init-repo --default-rich-root dev
$ cd dev
$ bzr co https://svn.oscc.org.my/mymeeting/trunk trunk
$ cd trunk
(hack hack hack...)
$ bzr update #get changes done by others
$ bzr ci -m 'added form for feature ABC' #commit to SVN repository
$ bzr push lp:mymeeting #push to Launchpad, only have to provide location once
(hack hack hack...)
$ bzr update #get changes done by others
$ bzr ci -m 'added list for feature ABC' #commit to SVN repository
$ bzr push

Decentralized Bazaar way

If we were to take advantage of Bazaar's decentralised way of doing it (so you can work offline, for example), it's like this.

$ mkdir dev
$ bzr init-repo --default-rich-root dev
$ cd dev
$ bzr co https://svn.oscc.org.my/mymeeting/trunk trunk #our copy of trunk
$ bzr branch trunk working #make a local branch to hack on
$ cd working
(hack hack hack...working offline)
$ bzr ci -m 'added form for feature ABC' #commit to local branch
(hack hack hack...working offline)
$ bzr ci -m 'added list for feature ABC' #commit to local branch

(when you get your connection back)
$ cd ../trunk
$ bzr update #get changes done by others to our copy of trunk
$ cd ../working
$ bzr pull #pull the changes to our local branch
$ bzr status #see our changes
$ cd ../trunk
$ bzr merge ../working
$ bzr ci -m 'added feature ABC'

Personally I like the centralised approach because it's similar to SVN. Local branch is great feature if I have to do my work offline sometimes. And while I can pick Bazaar from now on, the rest of the team doesn't have to switch tool. That's great!

Friday, December 18, 2009

I've had pretty good lecturers so far at UKM

Now that I've just found out the thing that we're supposed to submit tomorrow is now postponed to next week, I'm taking a moment to write about my 4 lecturers I've had so far and my whole experience being a in grad school here.

Semester I
The conditions of the class were pretty common and just above tolerable. No power points in sight except at the very front and the very back. When it was raining I prayed to god that I won't die because of the cold temperature. Being in an IT faculty, taking an IT course, but no wifi? The ones they had was the prepaid ones. I couldn't be bothered to search for any open shops in campus that's open on Saturdays. Being one of the research university, free wifi should be available to all staff and students! Unless I need that rare publications, I can pretty much do anything on the internet.

Dr. Md Jan taught Data Structures (we got to know trees). He's a considerate person. It's a very straightforward paper, like Maths, that I loved it! He's always open for discussions, jovial and committed. I like him because he made use of internet in his lectures. He's current. He let us choose our own programming language for his assignments. Being an open source person, that's freedom of choice and I liked it.

Prof. Patel taught Computer Network. I just couldn't bring myself to like this paper. It felt like out of this world. He came across as someone who teaches just to pay the rent. Nothing's wrong there of course, it just felt ordinary. I couldn't understand his assignments, I did it just to pass the test. Network is something that I don't wish to dwell in so much.

Semester 2
Hey the classroom looks so much better. New floor, new chairs so I the chilling problem gone. They set up power points! And there's wifi! Applaudable effort for me even though it's not stable all the time but the thought is there. Keep it up!

Dr. Salwani teaches Software Engineering. Her expertise is in AI but she used to be a developer so it's actually captivating to listen to her lectures (at least for me coz I can relate). She used real life scenarios and real life problems & solutions. I think she's well respected in her field to other academicians in Malaysia. She's got a thing with open source that I'm not so comfortable with (from past experience maybe?). She's tough and kinda strict but lacks a bit in managing assignments deadlines. We have 2 assignments still not sure of the deadlines. I think my classmates wish she would just take back the those 2 since other one we've been doing is quite huge!

Dr. Azura teaches Advanced Artificial Intelligent. She's one of the top AI researchers along with Dr. Salwani, although her interest is in data mining. The work they've done, I mean, seriously, big corporations should hire/consult these 2 - they can give you patterns and predict things! I am astounded that I had not looked into AI before (I studied maths doing my first degree and I though AI is very physics-like haha thanks to tv shows), that I feel those CS graduates should all work in AI industry! Don't just program a program, program an AI program. Anyway, she's a great person, abit chatty in the classroom although I don't mind it since the class is 3-5pm, and a very knowlegable person.

Although the lecturers have been great, I've had some problems with my group assignments. I like if the assignments is individual coz I don't have to rely on others to do my work. I have no problems with working in a group, it's just frustrating some of them like to work last minute. So I usually did my part early and trust that they would take that and continue. When it's time to submit, it's disheartening looking at the end result so messy and unorganized. Oh well.

Being the only programmer in the group really sucks sometimes. The group did their part, I believe as much as they could but I get the right to grumble. Non-programming assignment, I contribute to the group. When it comes to programming, only me doing it? It's because they have already forgetten how to program. This is real, so real that it sucks being a programmer in this case.

Studying really takes a toll in your life. Your priority changes abit. Not much if you're single, alot if you're married. I understand my group have husbands and children to care for but it's not good if you abandon your team on not one, but many presentation days. My advice to married women who wants to pursue study:

[1] Let everyone in your family know your intention. If you're studying, let them know you're studying. Your priority has changed abit. Last time you go straight to the kitchen after work 5 times a week, now you only do it 2 times a week. There's just some routine stuff you can't do anymore.
[2] Your husband should understand what being a grad student means. It doesn't mean you still can be with him everytime going to everywhere, not until you finish studying. It doesn't mean he can continue old habit of not doing anything around the house after work (just an example). You wife has other stuff to do now, give a take a little now can we? If you can't work together, I assure you, you're going to be staying up late every night just to catch up with the lessons.
[3] Please understand the sacrifice you have to make if you're studying. You're going to be tired, busy all the time and you can't afford to be at all family occasions/kenduri kawen kawan anymore. If you're studying, you want to be good at it and because it means something to you. If not why do it at all?

Anyway, I actually enjoy the whole period so far although I don't have time for anything else. You want it, you have to sacrifice your time. I now know some stuff that I probably wouldn't have known if I'm learning on my own. Granted there are times I felt like quitting - but that's just normal I guess.

Education is not cheap these days. I should squeeze everything out of it so I get the money worth. All in all I think UKM is an ok place for me. As long as they have good lecturers, that's the most important thing and so far I think they have pretty good ones at FTSM.

Thursday, December 17, 2009

SVN upgrade to 1.6.6

After being pointed out by ejat about the OSCC SVN server was being slow (or something, along the line of should upgrade to 1.5 for faster process) so I went out and check out SVN was indeed of version 1.4.2, the latest is 1.6.6.

On CentOS machine:

Stop any service that's running httpd, svnserve, etc.

Add RPMForge repository as that's where the latest SVN is

# i386
$ wget http://apt.sw.be/redhat/el5/en/i386/RPMS.dag/rpmforge-release-0.3.6-1.el5.rf.i386.rpm
$ rpm -i rpmforge-release-0.3.6-1.el5.rf.*.rpm

This will create /etc/yum.repo.d/rpmforge.repo file. Edit this file, change enable=0 as RPMForge contains bleeding edge, often unstable packages. You don't want to do $ yum update accidentally and put your entire system at risk if you don't know what you're doing.

You may not need this but just in case, backup your SVN repo.

$ svnadmin dump /path/to/repository > dumpfile.txt

If anything goes wrong, even if you install a new copy of SVN, you can recover you data with this:

$ svnadmin create /path/to/newrepository
$ svnadmin load /path/to/newrepository

Now check for SVN update $ yum --enablerepo=rpmforge check-update subversion It should display the latest version like this subversion.x86_64 1.6.6-0.1.el5.rf rpmforge

Then upgrade $ yum --enablerepo=rpmforge update subversionThis will update SVN from the RPMForge.

Restart the service httpd, svnserve, etc.

Wednesday, December 16, 2009

A quick post on chocolate drink

I don't really like chocolate much - I don't go gaga over it like other girls do. But these... add a little sugar... oohhh... come to mama!

[caption id="" align="aligncenter" width="500" caption="Do you know how delicious these taste? "]



Tuesday, December 8, 2009

CakePHP oh CakePHP

I've seen alot of people with PHP experience of 2-3 years, when being presented with CakePHP, they say something along the line of "Oh this is hard", "Why is it so different?", "What's this arrow and arrays inside array thingie?", etc.

Lots of young programmers working with PHP that I've seen in Malaysia hardly understand the OO (object oriented) concept. When you look at their codes, it's alot of functions and alot of includes. Classes? Nowhere to be seen. It's probably the most hardest concept to grab while they were in college when actually it's not that hard at all. If you don't understand OO then it's likely you don't know why it's good. And of course the MVC (Model-View-Controller) concept in many programming language frameworks you will find it very very hard to digest. Those frameworks are for RAD (Rapid Application Development) - just look at the name, don't you think it will have something to do with your development speed? It's like you have a bicycle and a car. You know you can get there faster by car, you only have to learn how to use it. It may takes time but for the next 20 years you're going to need the car so you can get anywhere faster. So would you or would you not learn how to use the car?? If you still picks bicycle, that's not a wrong answer. It only shows your preference.

Having MVC, for example, gives you the advantage of having multiple people working on the same page at the same time. A can work on the controller part, B can work on its layout and C can totally change the database engine from MySQL to Postgresql (for example) without having A or B amending their codes at all after that. Also I believe, it's easier to take over an MVC-ed application than a non-MVC ones. I can't imagine having to wade through all those includes/requires/imports. All I need to know is where the models, controllers and views are.

Want to try CakePHP? Just one thing you MUST have - the discipline to put your codes to where it belongs, follow the standards. Don't make your queries in the layouts - it just doesn't make sense. It's likely that you're going to forget about it in a week or two, you're going to curse your way through it when you can't find it later for maintenance work (not to mention the other new programmer working on the same app). Just plan for the future. The time that it takes you to do it properly now will save you a heck of a time later. That includes proper comments in your codes.

The learning curve is a bit steep - yes it is if you don't understand OO. So get to know your OO stuff. And then go for CakePHP, or any framework you fancy. You'll be surprised how much you'll like it.

Saturday, December 5, 2009

Cup of sweet sweet tea


Well I'm going to have cups and cups of tea! It's been raining here and what else could have made the days better. I love them sweet, just sugar and nothing else added. Sometimes I put in peach halves in there - yum!

There's alot types of tea out there. I normally drink the normal one. What I mean is, I'm not into those flavoured ones. The only one that I've tried and liked is chamomile tea which is just so calming. There's something about it that's so peaceful and serene. Like I said, I like it sweet, for now. They bring you many benefits as long as you cut the sugar down. But I'm a rebel - I want it the way I like it :P
Tea is known as nature’s 'wonder drug'. Of late, tea and its healthy benefits have been receiving wide attention in the media. The ability of tea to promote good health has long been believed in many countries, especially Japan, China, India, and even England. - http://www.teabenefits.com/

What tea is good for (from http://www.farsinet.com/hottea/medicalbenefits.html:

  • Arthritis - tea drinkers are 60 percent less likely to develop rheumatoid arthritis

  • Bone density - stronger bones

  • Cancer - green tea

  • Flu - boost your fight against the flu with black tea

  • Heart disease - two cups of tea a day decreased the risk of death following a heart attack by 44 percent

  • High blood pressure - green or oolong tea

  • Parkinson's diseases

  • Oral health - prevent cavities and gum disease

That's just abit of info. I'm sure there's hordes and hoards of info online.

Here's to good health!