Posted: February 25th, 2010 | Author: Kevin | Filed under: Random, Tips | Tags: batteries | No Comments »
What your friends tell you about battery conditioning probably does not apply to the Lithium-ion-polymer batteries presently used by most computer manufacturers.
This is what you need to know.
- It is OK to keep your laptop plugged in all the time.
- You run your laptop on battery at least once a month — this should be easy, it’s a laptop right?.
- Battery capacity diminishes over time. Expect to lose most of the capacity within 2-3 years after manufacture.
via post by [Laptop battery myths](http://www.marco.org/195827279
Battery technology has unfortunately not caught up with the rest of technology. Laptops with batteries that lasts for days are long overdue.
Posted: February 18th, 2010 | Author: Kevin | Filed under: Random | Tags: chinese, culture | No Comments »
I have been spending most of my time in mainland China for my trip, specifically, the Shanwei City (Haifeng county) within the Guangdong Province.
Through living here, I’ve observed a couple interesting facts. One of these is the acceptance of age difference among couples within a relationship; it seems to differ greatly from what we’re used to in the Western culture.
In China, it is perfectly acceptable for a adult male to marry someone twenty years younger; on the other hand, it is generally unappreciated for a male to marry an older women. Such bias is especially prominent in traditional upper-class chinese families where there is a strong emphasis on power and social status.
My opinion is that age is just a number, one that is insignificant when the couple in question are both mature adults (20+) and are at a point where they are responsible and self-sustainable.
At the end, it all comes down to living a happy life.
Posted: February 12th, 2010 | Author: Kevin | Filed under: Development, Tips | Tags: ruby | No Comments »
Lets assume we have a module called Fruit, within the Fruit module is a bunch of Fruit classes.
module Fruit
class Apple
end
class Orange
end
class WaterMelon
end
end
If the name of the fruit comes from some data or memory store, and we want to instantiate the class dynamically via the fruit name, you might attempt to do something like this:
>> fruit_name = "Apple"
=> "Apple"
>> class_name = "Fruit::#{fruit_name}"
=> "Fruit::Apple"
>> klass = Object.const_get(class_name)
NameError: wrong constant name Fruit::Apple
from (irb):14:in `const_get'
from (irb):14
The problem here is #const_get does not support retrieving constants within a nested namespace. In order to combat this, we must first retrieve the module in which the class is in, then get the class.
>> Module.const_get("Fruit").const_get(fruit_name)
=> Fruit::Apple
>>
Here is an example in action:
module Fruit
class Apple
def self.color
"red"
end
end
class Orange
def self.color
"orange"
end
end
class WaterMelon
def self.color
"green"
end
end
end
%w{Apple Orange WaterMelon}.each do |fruit_name|
klass = Module.const_get("Fruit").const_get(fruit_name)
puts klass.color
end
# output
red
orange
green
Posted: February 3rd, 2010 | Author: Kevin | Filed under: Random | Tags: air canada, flight | No Comments »
This is a continuation from my last post titled “Air Canada: customer service, redefined.”
Once I got onto the plane (a Boeing 777-300ER) arranged in 3-3-3 configuration, it was outfitted with their new cabin which provided each seat with a touchscreen inflight entertainment system and AC power.
Unfortunately, the seats themselves are not the type you find on Cathay flights where reclining does not affect the person behind you. This is extremely important to me because it makes using a laptop in flight that much safer and it feels like you really have the space all to yourself.
In inflight entertainment system started off as a disappointment. Within 30 minutes into the flight, the captain announces that the entertainment system crashed and that it needs to be restarted, and that restarting the system would take 30 minutes. The startup process was slowing taking place as I witness the screen around me to life one by one. It took each seat about 30 seconds to start before the one beside it would start.
Nevertheless, once everything is up and running, the touchscreen based UI of their IFE was easy to use and straightforward. I believe the screen size is bigger than the configuration Cathay has on their 777. One downside is throughout the flight, the inflight data/map is unavailable. From what I’ve read online, it has been like this the moment the new cabin was introduced. This is a thumbs down for me as I always like observing the flight data/map to know where I am and which route we took.
The food and overall service was mediocre. Their flight attendants managed to hit my pet-peeve on inflight service: leaving finished food left on my tray for too long (over 30 minutes). When you are in a cramped space, having all that junk there with tray down makes it feel even more cramped.
In conclusion, the $300 in savings was well justified. However, I will most likely still fly Cathay in the future for their more flexible flight changes (free with minimal restrictions) and their Asia Miles program.