Quick update about my game project
It’s been about a month since I started the project and I encountered some Math difficulties. But I managed to ask around and have it solved. So now the enemies will aim at the player and also they moves too! Head to http://1945.lin.net.nz to check it out!
Politicians shouldn’t be paid at premium until they finish their terms
Why do need politicians, we need them to make decision for us. How do politicians make correct decisions for us, if they live in nice big houses and don’t get stuck at traffic jams? How do they realise our problems if they don’t live our normal lives? I bet if John Key lives in Otara he would definitely do something about safety and thefts. But he doesn’t live there, nor has he been robbed, and the truth is these are not his personal problems.
I agree politicians should be paid well, to minimise corruption, but not during their terms, when they finish job then they can have their big exit payments. You corrupt, you don’t get it and go to jail.
What good will bring if they get paid like middle working class? They will suffer our day to day problems and headaches. And only making them feeling the pain, they will actually do something about it.
Temporary Phone Number 0223942826 (Fixed, please use 0212654756 again)
So my beloved iPhone 5 is having camera issues and is being sent to the hospital. There is no other iPhone 5 laying around for the nano sim so have to use a different number for now.
Why attack on my little personal blog?
So my server has been very slow lately, so I took a look at my access log and saw this…
112.205.145.104 - - [03/May/2013:15:28:42 +1200] "POST /wp-login.php HTTP/1.0" 200 211 "james.lin.net.nz/wp-login.php" "Mozilla/5.0 (Windows NT 6.1; rv:19.0) Gecko/20100101 Firefox/19.0" 123.19.166.182 - - [03/May/2013:15:28:56 +1200] "POST /wp-login.php HTTP/1.0" 200 211 "james.lin.net.nz/wp-login.php" "Mozilla/5.0 (Windows NT 6.1; rv:19.0) Gecko/20100101 Firefox/19.0" 112.204.71.145 - - [03/May/2013:15:28:57 +1200] "POST /wp-login.php HTTP/1.0" 200 211 "james.lin.net.nz/wp-login.php" "Mozilla/5.0 (Windows NT 6.1; rv:19.0) Gecko/20100101 Firefox/19.0" 147.30.169.231 - - [03/May/2013:15:28:59 +1200] "POST /wp-login.php HTTP/1.0" 200 211 "james.lin.net.nz/wp-login.php" "Mozilla/5.0 (Windows NT 6.1; rv:19.0) Gecko/20100101 Firefox/19.0" 223.206.203.214 - - [03/May/2013:15:29:00 +1200] "POST /wp-login.php HTTP/1.0" 200 211 "james.lin.net.nz/wp-login.php" "Mozilla/5.0 (Windows NT 6.1; rv:19.0) Gecko/20100101 Firefox/19.0" 189.135.105.58 - - [03/May/2013:15:29:03 +1200] "POST /wp-login.php HTTP/1.0" 200 211 "james.lin.net.nz/wp-login.php" "Mozilla/5.0 (Windows NT 6.1; rv:19.0) Gecko/20100101 Firefox/19.0" 61.28.152.30 - - [03/May/2013:15:29:07 +1200] "POST /wp-login.php HTTP/1.0" 200 211 "james.lin.net.nz/wp-login.php" "Mozilla/5.0 (Windows NT 6.1; rv:19.0) Gecko/20100101 Firefox/19.0" 101.99.36.189 - - [03/May/2013:15:29:13 +1200] "POST /wp-login.php HTTP/1.0" 200 211 "james.lin.net.nz/wp-login.php" "Mozilla/5.0 (Windows NT 6.1; rv:19.0) Gecko/20100101 Firefox/19.0" 110.159.112.16 - - [03/May/2013:15:29:13 +1200] "POST /wp-login.php HTTP/1.0" 200 211 "james.lin.net.nz/wp-login.php" "Mozilla/5.0 (Windows NT 6.1; rv:19.0) Gecko/20100101 Firefox/19.0" 112.208.155.183 - - [03/May/2013:15:29:23 +1200] "POST /wp-login.php HTTP/1.0" 200 211 "james.lin.net.nz/wp-login.php" "Mozilla/5.0 (Windows NT 6.1; rv:19.0) Gecko/20100101 Firefox/19.0" 50.117.80.234 - - [03/May/2013:15:29:26 +1200] "POST /wp-login.php HTTP/1.1" 200 211 "james.lin.net.nz/wp-login.php" "Mozilla/5.0 (Windows NT 6.1; rv:19.0) Gecko/20100101 Firefox/19.0" 123.20.111.25 - - [03/May/2013:15:29:40 +1200] "POST /wp-login.php HTTP/1.0" 200 211 "james.lin.net.nz/wp-login.php" "Mozilla/5.0 (Windows NT 6.1; rv:19.0) Gecko/20100101 Firefox/19.0" 181.54.128.114 - - [03/May/2013:15:29:41 +1200] "POST /wp-login.php HTTP/1.0" 200 211 "james.lin.net.nz/wp-login.php" "Mozilla/5.0 (Windows NT 6.1; rv:19.0) Gecko/20100101 Firefox/19.0" 121.54.54.57 - - [03/May/2013:15:29:41 +1200] "POST /wp-login.php HTTP/1.0" 200 211 "james.lin.net.nz/wp-login.php" "Mozilla/5.0 (Windows NT 6.1; rv:19.0) Gecko/20100101 Firefox/19.0" 110.54.233.98 - - [03/May/2013:15:29:54 +1200] "POST /wp-login.php HTTP/1.0" 200 211 "james.lin.net.nz/wp-login.php" "Mozilla/5.0 (Windows NT 6.1; rv:19.0) Gecko/20100101 Firefox/19.0" 202.152.202.160 - - [03/May/2013:15:29:57 +1200] "POST /wp-login.php HTTP/1.0" 200 211 "james.lin.net.nz/wp-login.php" "Mozilla/5.0 (Windows NT 6.1; rv:19.0) Gecko/20100101 Firefox/19.0" 198.56.193.162 - - [03/May/2013:15:30:05 +1200] "POST /2011/01/16/web-cam-face-detection-real-time-notification-diy-home-security/ HTTP/1.1" 200 32429 "-" "-" 112.203.167.109 - - [03/May/2013:15:30:19 +1200] "POST /wp-login.php HTTP/1.0" 200 211 "james.lin.net.nz/wp-login.php" "Mozilla/5.0 (Windows NT 6.1; rv:19.0) Gecko/20100101 Firefox/19.0" 189.245.84.39 - - [03/May/2013:15:30:21 +1200] "POST /wp-login.php HTTP/1.0" 200 211 "james.lin.net.nz/wp-login.php" "Mozilla/5.0 (Windows NT 6.1; rv:19.0) Gecko/20100101 Firefox/19.0"
Campbell live, about public transport
Tonight, Campbell live talked about our Auckland public transport, and it doesn’t take a scientist to figure it’s useless.
Unless you live and work next to the bus stop and doesn’t need to catch different buses on the way, otherwise our Auckland public transport sucks, it’s a fact.
I heard that we are going to spend $3 billion dollars to improve our roads and rails, I wonder if any study has been done on how feasible of introducing self-driving cars. Let’s have a look at the benefits of having these automous cars on the road (from wikipedia):
- Fewer traffic collisions, due to an autonomous system’s increased reliability and decreased reaction time compared to human drivers.
- Increased roadway capacity and reduced traffic congestion due to reduced need for safety gaps and the ability to better manage traffic flow.
- Relief of vehicle occupants from driving and navigation chores.
- Higher speed limit for autonomous cars
- Removal of constraints on occupants’ state – in an autonomous car, it would not matter if the occupants were under age, over age, blind, distracted, intoxicated, or otherwise impaired.
- Alleviation of parking scarcity as cars could drop off passengers, park far away where space is not scarce, and return as needed to pick up passengers.
- Elimination of redundant passengers – humans are not required to take the car anywhere, as the robotic car can drive independently to wherever it is required. This would be especially relevant to trucks, taxis and car-sharing services.
- Reduction of space required for vehicle parking.
- Reduction in the need for traffic police and vehicle insurance.
- Reduction of physical road signage – autonomous cars could receive necessary communication electronically (although physical signs may still be required for any human drivers).
- Improved fuel efficiency.
Hmm doesn’t it solve most of our problems?
So how feasible is it?
Lets look at Google driverless cars, in August 2012, the team announced that they have completed over 300,000 autonomous-driving miles (500 000 km) accident-free. So it’s possible.
Is it expensive? Yes, very expensive for now, but it can go down depends on how we approach it. Let’s assume it costs about $20000 to upgrade existing cars, not every household can fork out tens of thousands of dollars to upgrade their cars, but if the government is spending $3 billion dollars, can actually subsidies $10000 to 300000 households for the upgrade. Will I take it? Absolutely!
Just imagine you hop into the car in the morning to work, you either continue your sleep or surf the internet. After a long day of work, hop in, take a nap and arrive home rested. How about going to the CBD and not worry about finding a car park? It’s absolutely amazing.
What can we do now?
Actions starts from you and me, advocate about this vision anywhere you see fit, it may seem unrealistic so it was before we landed on the moon.
For now, I wish the government at least has this vision, at least preparing our roads to be autonomous cars friendly.
Javascript Snippet: Play next video
There is a requirement from one of my project to insert video ads before the actual video gets played.
There are ways to do it, one is to use JWPlayer and OVA plugin, or the other way is to write your own javascript to control the playback.
In the following demo, shows how you can put ad video in the first source tag, and put actual video in second source tag.
Javascript game project test run on iOS
I have quite a few goals (ok, things) I want to achieve before I die, couple of those are writing an iOS app and writing a game.
I have had an attempt to write a 1945 style vertical scroll shooting game in python using pygames, and I cannot remember why I stopped and the source code went missing (sounds like a developer nightmare, believe me I had it version contorlled somewhere, oh yes, it was on an overseas VPS that gone bye bye).
Anyway. So I discovered “Crafty”, a javascript game engine. Tried the tutorial and it seemed very interesting (I mean I like it’s style), so I might give a go on this. And this time the repository is on bitbucket https://bitbucket.org/jameslin/crafty-1945-reloaded, so there is no way I can lose it again.
You can always check out the latest development over http://1945.lin.net.nz just mouse over the plane to control it’s movements.
[... some code development ...]
So here we are, managed to get the plane following the mouse and shooting 2 types of bullets at the same time in a browser. Hmmm, in a browser, that means in theory I can run the game in Chrome on my iPhone too! And… it actually worked! Well, performance is not that great though.
The other goal I mentioned at the beginning of this blog is to write an iOS app, I tried learning Objective-C for 10 minutes and just literally fainted on the syntax and gave up, so how am I suppose to write an iOS app without knowing any Objective-C? Luckily Keran McKenzie (my ex-colleague Yellow NZ, now an evangelist in MYOB) mentioned services that will package “web pages” into in iOS app, and that was my plan, for the javascript game I am writing. Sort of one stone two birds.
[... some phonegap app building ...]
Success! it compiled an iOS and installed on my phone, actually it runs way smoother than on ordinary phone browser. So from now, I will spend some time every now and then continuing writing this game till it’s done!
- Actual screenshot of the game on my phone
Video: Django Rapid Development Demo
I think it’s necessary to create a video to demonstrate how quickly web application development can be. Enjoy!



