Sunday, September 21, 2008

Disecting Air Asia

I've been disecting Air Asia over the weekends, in hopes of finding a financial vulnerbility. So far I've found no vulnerbilities.
But I have a few nice facts about Air Asia:
  • the web application was developed by www.navitaire.com (view sourcecode on https://booking.airasia.com/skylights/cgi-bin/skylights.cgi) which is a Philipino company. Probably philipino web developers are more cost effective? By the way, these guys also develop this site: http://www.cebupacificair.com/
  • Air asia flies to 14 countries from Australia to Vietnam
  • Air asia lands on 61 different airports from Alor Star to Vientiane.
  • Air asia has 110 different flight paths. (KL <-> Medan, KL <-> Perth, ....)
  • One weird thing is that, although you can book a flight from Tawau to Johor Bahru, but not the other way around. Even if you book a flight from Tawau to Johor Bahru, you will always get this message, "Sorry, there are no fares available on this date", no matter what date you choose.

Initially the search page would pass these parameters:
  • event=search
  • module=SB
  • page=SEARCH
  • language=EN
  • mode=
  • sid=
  • ref=
  • travel=2
  • from1=KUL
  • to1=HAK
  • departDay1=21
  • departMonth1=200812
  • departDay2=21
  • departMonth2=200902
  • ADULT=6
  • defaultADULT=1
  • INFANT=2
  • defaultINFANT=1
  • toCity1=HAK
  • toCity2=KUL
  • departDate1=20081221
  • departDate2=20090221
  • numberMarkets=2
  • selectedUtil=login
  • alias=
  • pw=
  • log_in=0
  • confNum=
  • departFrom=
  • flight_key=
  • flight_number=
  • depart_date=
  • depart_city=
  • arrive_city=
  • orig=XXX
  • dest=XXX
  • date=20080921
  • flightnum=

but I have found out that these are the minimal parameters required for the search to work
  • event=search
  • travel=2
  • from1=KUL
  • to1=HAK
  • ADULT=1
  • INFANT=1
  • toCity1=HAK
  • toCity2=KUL
  • departDate1=20081221
  • departDate2=20090221
  • numberMarkets=2

Wednesday, September 17, 2008

Postgres 8.3 and hibernate tool 3.2

I tried to generate some codes from the database. Java codes from postgres tables, but i keep getting this:
org.hibernate.cfg.reveng.JDBCReader processPrimaryKey
WARNING: The JDBC driver didn't report any primary key columns in XXX. Asking rev.eng. strategy
org.hibernate.cfg.JDBCBinder createPersistentClasses
WARNING: Cannot create persistent class for org.hibernate.mapping.Table(public.XXX) as no columns were found.
This link told me that Postgres tables should be in lowercase and oracle tables should be in uppercase.
http://seamframework.org/Community/SeamGenerateentitiesWithPostgres83

I changed the table names to lowercase and it worked!

Monday, September 15, 2008

Ubuntu mirror in Malaysia

Try this to get the latest Ubuntu ISO image: http://mirror.oscc.org.my/
If you doubt the authenticity, just check the hash: https://help.ubuntu.com/community/UbuntuHashes

Friday, September 12, 2008

First post on DELL XPS

Yay me.

Wednesday, September 10, 2008

SVN for school work

I wanted somewhere I can put my assignments so that if the file was deleted or if the hard disk failed, I could still get it.
I tried gmailing it to myself, but i found it to be too troublesome. Especially if you have a few files to take care.
I came across code.google.com, it offers free svn hosting for open source codes, but I'm not doing open source coding, I just want to save my files. So google is out.
Then I found cvsdude which also offers free svn hosting as well as comercial svn hosting. But the free package just gives me 2mb of storage. Currently I'm using around 20mb, so its just not enough
Then I found unfuddle. It give 200 mb space, enough to store all my educational assignment and reference throughout my OUM life. http://unfuddle.com/about/tour/plans
I just put files in the folder, and right click, commit, all the files are synchronized to the repository.
You could ftp the files to an ftp server, but then again, you'd have to figure out which files are changed and which files have not changed. Or just waste time copying back all the files. Storing it to a SVN server also allows me to rollback to a previous version.

Trim in java

Usually, when you get an input and you want to remove the spaces, you would use the trim function.
Imagine my shock when I came across this piece of code
item.setProperty("text".trim());

but that was nothing compared to
item.setAnotherProperty("".trim());

Tuesday, September 09, 2008

Fine Print

If you get an offer letter, please make sure what is your gross and what is your net salary. I was very shocked when the salary stated on the offer letter was, "the cost to the company".
Let me explain.
If you are getting say, RM 4,000.00, then your cost to the company is
  • basic salary (RM 4000)
  • epf (12% = RM 480)
  • socso (RM 50 or so)
after that you have to deduct your
  • epf (11% = 440)
  • tax (tax on 4000 - 440 unmarried person is RM 77)
  • socso (RM 15 or so)
Your net salary is: 3468.00
Your gross is: 4000.00
and your cost to the company is: 4530.00

I am giving you these figures because, I came across an offer letter stating that, "Your salary is RM 4500.00 per month (inclusive all)." Which is saying your basic salary is roughly RM 4000.00.
So be careful and ask for clarification. Don't be like me.