User loginNavigationThe postings on this site are my own and don't necessarily represent IBM's positions, strategies, or opinions. |
TechMaximizer: The Replacement Laptop DilemmaI just got back from a trip to Best Buy to fondle a wide selection of laptops. Considering they don't carry the "business" line from HP or others, there is a giant gap between the consumer laptops and the Mac Book Pro. It would be like going to a car dealer that sold Kias and BMWs (no offense to all the Kia drivers who wait with baited breath for my next awe-inspiring blog post). I spent about an hour typing on some 20 keyboards and testing the flex of the chassis and keyboard. Most were Chiclet style keyboards, which turns out to be a sub-optimal design (in my opinion) if you use more than two fingers to type.
It's now abundantly clear to me, there are only two choices when it comes to quality professional grade notebooks: Lenovo ThinkPad and Mac Book Pro. My second discovery is that my belief that Macs were overpriced is completely false. You can't compare a Mac to a Dell or an Acer (not even an HP consumer grade machine), you have to compare it to the top of the line Lenovo ThinkPads (T510, x201s, x301, etc.) and then, feature for feature, the Mac is competitively priced. Damn.
Not less than, not greater than, but not equal either!I've been twice bitten by this subtlety of the python __cmp__() method, I thought I'd try to save you the same pain (and perhaps by writing it down I won't repeat it... again). When dealing with objects, it's often useful to be able to compare these objects:
if mySwartz > yourSwartz:
print "Suck it."
An obvious (and wrong) __cmp__() method would be:
def __cmp__(mine, yours):
if mine.val < yours.val:
return -1
if mine.val > yours.val:
return 1
return 0
Looks good right? Well, what if some yahoo tries to compare two totally disimilar things, i.e:
if mySwartz > yourForce:
print "Neener Neener."
Such a comparison clearly makes no sense, so let's update __cmp__() to check for similar data types:
def __cmp__(mine, yours):
if not isinstance(yours, Swartz):
return -1
if mine.val < yours.val:
return -1
if mine.val > yours.val:
return 1
return 0
Good right? WRONG. Consider the following ridiculous scenario: mySwartz.val == yourSwartz.val While I'm sure no such thing could happen, let's imagine for the sake of argument that two objects might be compared on an internal value that just might not be unique across all instances of the object. What would happen if you had to retrieve your object from a container?
storage = []
storage.append(yourSwartz)
storage.append(mySwartz)
# time passes
for sw in storage:
if sw == mySwartz:
print "I found my Swartz!"
print "...wait... this is your Swartz... gah!"
Yeah yeah, you could rewrite this to yada yada, that's not the point. The point is while the values of the objects are the same, they are not the same objects and python uses the __cmp__() method for both less than, greater than, equality, AND identify comparison if you're used to thinking of your objects as pointers! If you're faced with a situation where you want to be able to easily sort objects, but still need to be able to identify them uniquely when they share an internal value, augment your __cmp__() routine to check for id as well:
def __cmp__(mine, yours):
if not isinstance(yours, Swartz):
return -1
if mine.val < yours.val:
return -1
if mine.val > yours.val:
return 1
if id(mine) < id(yours):
return -1
if id(mine) > id(yours):
return 1
return 0
If you're a python guru and think I'm missing something, please share, otherwise:
if mySwartz > yourSwartz:
print "I see my Swartz is bigger than yours..."
The iSmudgeApple's follow-on to the iPad, the iSmudge, will contain a moisture sensor so you can lick your thumb and "erase" stuff. Works on files, text, and those photos of your ex. The new device will ship with a monogrammed microfiber cloth to keep your screen "smudge" free.
Cell Usage: What does it really cost to pick up the phone?Many of you have heard my reasoning for not having a fancy cell phone. That extra $30-$40 a month for a dataplan just seems outrageous to me. That got me to thinking about my current plan. My wife and I share 500 minutes and pay $0.20 per text for about $54 per month. We never go over our minutes and one rarely would we even break even if we upgraded to an unlimiting texting plan. My service provider would like me to think I pay $54/500 = 0.10 per minute during the Anytime minutes and that all my other calls are "Free". I don't think of my usage that way. I pay $54 dollars a month and a certain number of "communications" for that. Most of those are about 1 minute long, and to make things simple, I'll consider a "Text" to be a 1 minute call.
Mad Science
Technology and Speed ReadingI'm a hopelessly slow reader, and it continually frustrates me, and later shames me in front of my friends. I just can't read the information fast enough to keep up with the world! I blame elementary school who had me read a grand total of I think 2 books by the time I was 12 (both involving dying dogs [1]... what the hell is wrong with you people?). I've been reading some things on how to improve my reading speed while maintaining comprehension, and also looking into how technology might be able to help. A colleague pointed me to SpreedNews which turns out to be awesome, and I top out at just under 500 words per minute before I simply don't remember anything about what I read. Now if the Amazon Kindel could incorporate this technology and allow me to read anything on the Kindel with this fancy rate adjustable phrase flashing awesomeness, I'd buy two... today. Unfortunately, one of the core technologies of the Kindel is their fancy pants epaper screen, which while it is great to look at and easy on the batteries, its refresh rate wouldn't allow for 20 words per minute, let alone 500. Ah well, maybe when Devon is my age he can get me a nice ereader that solves all my problems, without killing any dogs. 1. "Old Yeller" and "Where the Red Fern Grows" - both belong on the banned books shelf at my local library.
Security Catch-UpOK, so while all my co-workers took a half-day to check their systems for each of the openssh and dns exploits earlier this year, I foolishly let it slide, thinking I had more important things to do. So while I didn't procrastinate so long as to get hacked/phished/etc. I did wait until tonight. So after a few hours research (and a couple educational jems, I've finally regenerated all my system's host keys and have deleted all my .ssh keys and regenerated them on systems where I have console access, relying on ssh agent forwarding everywhere else (thanks Josh). As for DNS, I've redirected my router to opendns which is looking to be an excellent service (thanks John). So I should be all buttoned up again...
Wicd! Wifi Management that Works!It's a very novel concept I know, but the guys at wicd have managed to write a wifi network manager that does things like remember your WPA key (unlike some other more common NetworkManagers). I still need to see if it can do really complicated things like save a config for a hidden network (ooooooh!) and handle enterprise authentication (LEAP), but for now I am very happy to have replaced NetworkManager with something that appears to just work. Check it out: http://wicd.sourceforge.net/. Now, how 'bout it Ubuntu, can we ditch NM already - isn't two broken release cycles enough?
Streaming Media to the PS3 with MediaTombI've been enjoying streaming music to my Playstation 3 with the most excellent MediaTomb uPNP DNLA Media Server for a while. Tonight I managed to get MediaTomb to present the MythTV recordings in a format the PS3 could actually understand. I used the Cidero UPnP A/V Controller to debug the XML presented to the UPnP client by the server. Turns out the PS3 prefers video/mpeg over video/mp2p for MPEG2 video files - picky picky. Simply adding the following: <map from="mpg" to="video/mpeg"/> to the MediaTomb config.xml and removing/adding the recordings folder got my PS3 streaming video from MediaTomb. Excellent!
|
Lumberjocks ProjectsRead |