If anyone reads my blog, they would have noticed that I haven't posted any good programming tidbits here in a while. The reason is that I've been busy making arrangements for my move to Japan.
Next month (October 16th to be exact), my wife and I are moving to Tokyo where I will start my new job at NTT Communications' headquarters in Hibiya. My last day here at NTT MCL will be October 5th.
I've worked at NTT MCL for over 5 and half years, making it the longest I have ever worked at a single company. I've really enjoyed working at NTT MCL, so I'm a bit sad to leave. Luckily, my job at NTT Communications will entail further development and maintenance of the servers we developed at NTT MCL for the HOTSPOT wireless network, so it looks like I'll keep in regular contact with my current co-workers. By the way, if you find yourself in Tokyo, or just about any major city in Japan, you should purchase a 1-day pass for HOTSPOT. You get wireless Internet access at a huge number of locations for just 500 yen (about 4 dollars). Having worked on HOTSPOT for over 5 years, I was shocked when I discovered T-Mobile charges $10/day for a similar service in the U.S.
Also, I can't stress enough how nice of a place NTT MCL is to work at. There are lots of positions open, the work environment is relaxed and relatively low-stress, and you'll get to work on a variety of different projects. I know I am going to miss working here, but I simply cannot pass up this opportunity to work abroad for a few years. Hopefully, they'll take me back when I return to the U.S.
Friday, September 21, 2007
Monday, September 17, 2007
Sony getting out of Cell production
According to Asahi Shinbun, Sony will be selling their semiconductor production facilities, including those for the production of their Cell processor, to Toshiba for approximately 100 billion yen (~870 million dollars). The sale is expected to happen next spring. There is speculation that Sony does not foresee new applications for their Cell processor and is seeking to reclaim a large amount of their investment capital.
Sony's semiconductor subsidiary, Sony Semiconductor, is selling the LSI (Large Scale Integration) facilities in their Nagasaki Technology Center on the island of Kyushu. Besides being the production facilities for the Cell processor, the plant also makes image processing chips for game devices.
Sony will continue to develop the Cell processor, but they are reconsidering producing the chips themselves. Instead, the will be putting their effort into next generation audio/video devices. In particularly, they intend to put emphasis on the production of CMOS sensors like those used to record images in digital cameras.
Sony's semiconductor subsidiary, Sony Semiconductor, is selling the LSI (Large Scale Integration) facilities in their Nagasaki Technology Center on the island of Kyushu. Besides being the production facilities for the Cell processor, the plant also makes image processing chips for game devices.
Sony will continue to develop the Cell processor, but they are reconsidering producing the chips themselves. Instead, the will be putting their effort into next generation audio/video devices. In particularly, they intend to put emphasis on the production of CMOS sensors like those used to record images in digital cameras.
Monday, September 3, 2007
Keepon
I saw this last night on a Japanese TV show. Apparently, a U.S. and Japanese researcher have been working on a little robot called "keepon", experimenting with human interaction. Here is a short movie demonstrating some basic emotive interaction:
The American researcher filmed a demo video of the little robot responding to a song by a L.A. band called "Spoon" and uploaded it to YouTube:
Apparently, the video was so popular that the band caught notice and contacted the researchers about using the robot in one of their official music videos. The Japanese researcher appears in the video with the robot (the video was filmed in Tokyo):
Like probably just about everyone else who has seen the video, I checked to see if I could buy one. You can't.
The American researcher filmed a demo video of the little robot responding to a song by a L.A. band called "Spoon" and uploaded it to YouTube:
Apparently, the video was so popular that the band caught notice and contacted the researchers about using the robot in one of their official music videos. The Japanese researcher appears in the video with the robot (the video was filmed in Tokyo):
Like probably just about everyone else who has seen the video, I checked to see if I could buy one. You can't.
- Update 2007/09/04 1:30am (JST):
- As with everything else you can think of, Wikipedia already has an entry about Keepon. Sometimes I wonder why I bother writing anything. You could replace my entire blog with nothing but links to Wikipedia articles. :)
Sunday, September 2, 2007
Python: Reconstructing datetimes from strings
Previously, I posted a small snippet for converting the
Last time Lawrence Oluyede was kind enough to point out that the dateutil module can likely do this and a lot more. However, I'm trying to stick to modules in the base library. Of course, it wouldn't be a bad thing if dateutil were to make it into the base library....
Speaking of which, the snipped above relies on the FixedOffset tzinfo object described in the documentation for the datetime.tzinfo module. Being that the documentation is part of the standard python distribution, I guess you could call that code part of the base library, even if you can't import it. :|
str() representation of a python timedelta object back to its equivalent object. This time I'm going to address doing the same for datetime objects:
def parseDateTime(s):
"""Create datetime object representing date/time
expressed in a string
Takes a string in the format produced by calling str()
on a python datetime object and returns a datetime
instance that would produce that string.
Acceptable formats are: "YYYY-MM-DD HH:MM:SS.ssssss+HH:MM",
"YYYY-MM-DD HH:MM:SS.ssssss",
"YYYY-MM-DD HH:MM:SS+HH:MM",
"YYYY-MM-DD HH:MM:SS"
Where ssssss represents fractional seconds. The timezone
is optional and may be either positive or negative
hours/minutes east of UTC.
"""
if s is None:
return None
# Split string in the form 2007-06-18 19:39:25.3300-07:00
# into its constituent date/time, microseconds, and
# timezone fields where microseconds and timezone are
# optional.
m = re.match(r'(.*?)(?:\.(\d+))?(([-+]\d{1,2}):(\d{2}))?$',
str(s))
datestr, fractional, tzname, tzhour, tzmin = m.groups()
# Create tzinfo object representing the timezone
# expressed in the input string. The names we give
# for the timezones are lame: they are just the offset
# from UTC (as it appeared in the input string). We
# handle UTC specially since it is a very common case
# and we know its name.
if tzname is None:
tz = None
else:
tzhour, tzmin = int(tzhour), int(tzmin)
if tzhour == tzmin == 0:
tzname = 'UTC'
tz = FixedOffset(timedelta(hours=tzhour,
minutes=tzmin), tzname)
# Convert the date/time field into a python datetime
# object.
x = datetime.strptime(datestr, "%Y-%m-%d %H:%M:%S")
# Convert the fractional second portion into a count
# of microseconds.
if fractional is None:
fractional = '0'
fracpower = 6 - len(fractional)
fractional = float(fractional) * (10 ** fracpower)
# Return updated datetime object with microseconds and
# timezone information.
return x.replace(microsecond=int(fractional), tzinfo=tz)
Last time Lawrence Oluyede was kind enough to point out that the dateutil module can likely do this and a lot more. However, I'm trying to stick to modules in the base library. Of course, it wouldn't be a bad thing if dateutil were to make it into the base library....
Speaking of which, the snipped above relies on the FixedOffset tzinfo object described in the documentation for the datetime.tzinfo module. Being that the documentation is part of the standard python distribution, I guess you could call that code part of the base library, even if you can't import it. :|
- Update 2007/09/03 1:39pm (JST):
- Fix example format examples in doc-string per comment from David Goodger.
Friday, August 17, 2007
Bought a Mac
My wife and I have been considering buying a new computer for a couple of months now; yesterday we bought a new 24" iMac. The odd thing is, even though my wife was comfortable on a Mac and I was drawn to the BSD underpinnings, we had decided against getting a Mac largely on the grounds of the expense (and the inability to easily uninstall software). Instead, we had settled on a small form-factor Dell. That is, until we visited the Apple Store on University Ave. Sunday afternoon.
We were in the neighborhood to pick up some prints at Wolf Camera and I wanted to stick my head in the Apple Store to check out the new Aluminum iMacs. They are gorgeous. I've never seen a screen quite like it. But the kicker was when my wife asked whether the $1799 price on the card next to the computer was for the computer we were looking at.
It wasn't. We were gawking at the 20" iMac; the placard was for the 24" iMac next to us. Now that was an impressive machine. And what was more amazing was that the $1799 price tag was on-par, if not cheaper, than the equivalent Dell desktop we had been considering! That's right, we could get the gorgeous iMac for the same price as the bland Dell we were planning to buy.
I have read claims in the past the recent-model Macs were cheaper than equivalent PCs, but there it was staring me in the face. Just to prove I'm not making this up, I just re-spec'ed the Dell machine we were going to buy to compare it to the Apple machine we did buy. As of 2007/08/17:
| Component | Dell Optiplex 745 Small Form Factor | Apple iMac 24" |
|---|---|---|
| CPU | Intel Core 2 Duo Processor E6600 (2.40GHz, 4M, 1066MHz FSB) | Intel Core 2 Duo Processor T7700 (2.40GHz, 4M, 800MHz FSB) |
| OS | Windows Vista Ultimate, with media, 32 Edition, English | Mac OS X v10.4.10 Tiger |
| Memory | 1.0GB DDR2 Non-ECC SDRAM, 667MHz, (1DIMM) | 1.0GB DDR2 Non-ECC PC2-5300 SDRAM, 667MHz, (1SO-DIMM) |
| Hard Disk | 250GB SATA 3.0Gb/s | 320GB SATA 7200-rpm |
| Removable Disc | 8X Slimline DVD+/-RW | Slot-loading 8x SuperDrive (DVD±R DL/DVD±RW/CD-RW) |
| Video Card | 256MB ATI Radeon X1300PRO | 256MB (GDDR3) ATI Radeon HD 2600 PRO |
| Speakers | Dell™ A225 Speakers | Built-in stereo speakers |
| WiFi | Linksys WUSB54GC Wireless-G USB Adapter | AirPort Extreme wireless networking (802.11n) |
| Price w/o Monitor | $1,198 | N/A |
| Display | UltraSharp 2407WFP-HC 24-inch Widescreen Flat Panel LCD $569 | 24-inch widescreen TFT active-matrix LCD |
| Total | $1,767 | $1,799 |
Anyway, we left the Apple Store to head over to Fry's to do some shopping. But while we were at Fry's, my wife looked over at me and "we should get the Mac". She didn't have to say that twice. In my 15 years or so in the computer industry, I have never before seen a machine that I really wanted to buy. So we bought of copy of Parallels Desktop at Fry's and headed back over to the Apple Store.
Unfortunately, we were too late. They close at 6:00pm on Sundays. We tried again Monday night but both the University Ave. and Stanford Shopping Center stores were sold out of the 24" iMacs. We went ahead and ordered on on-line, but we were going to have to wait two weeks for it to even be shipped. So yesterday morning we made it up to the University Ave. store at 10:15am (they open at 10:00am) and bought the last 24" model in that day's shipment. That's right: sold out in 15 minutes. Needless to say, we cancelled our on-line order.
I was up to 4:00am last night setting up Parallels to run Win2k for some of our old software (namely, Microsoft Money and our favorite game: Settlers 3), installing Firefox and Thunderbird, importing our photos into iPhoto, etc. That screen is simply awesome. I don't think I've had this much fun since I was a kid. Certainly not with a computer.
Thursday, August 16, 2007
License for code posted on my blog
It occurred to me that while many people post code on their blogs, they seldom grant anyone else license to use their code. Google encourages their BlogSpot users to mark their posts with the Creative Commons License, but does not enforce users to do so nor do many blogs I've seen follow this recommendation. Now, the poster may know they have no intent to sue anyone over the use of their snippet, but how can the reader be sure?
To address the problem, I'm hereby declaring that all code posted on my blog (kbyanc.blogspot.com) is covered by the license below unless otherwise indicated in the body of the post itself:
I hope that others will follow suite and clarify the license terms of use for content posted on their blogs too. Use a different license if you like (it is your code after all), but don't be fooled into thinking that simply posting code on your blog makes it open source.
And before someone writes that I should just declare the code to be public domain, I should point out that you can't do that (at least it probably won't become public domain until I'm so long dead that the idea of using the code I posted at the turn of the century seems quaint).
To address the problem, I'm hereby declaring that all code posted on my blog (kbyanc.blogspot.com) is covered by the license below unless otherwise indicated in the body of the post itself:
Copyright (c) 2007, Kelly Yancey
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
I hope that others will follow suite and clarify the license terms of use for content posted on their blogs too. Use a different license if you like (it is your code after all), but don't be fooled into thinking that simply posting code on your blog makes it open source.
And before someone writes that I should just declare the code to be public domain, I should point out that you can't do that (at least it probably won't become public domain until I'm so long dead that the idea of using the code I posted at the turn of the century seems quaint).
Wednesday, August 15, 2007
Python: Reconstructing timedeltas from strings
For some reason, the date/time objects implemented by the datetime module have no methods to construct them from their own string representations (as returned by calling
But the other types are not quite so easy. Next time, I'll post my implementation for reconstructing datetime objects from their string representation.
str() or unicode() on the objects). It so happens that reconstructing a timedelta from its string representation can be implemented using a relatively simple regular expression:import re
from datetime import timedelta
def parseTimeDelta(s):
"""Create timedelta object representing time delta
expressed in a string
Takes a string in the format produced by calling str() on
a python timedelta object and returns a timedelta instance
that would produce that string.
Acceptable formats are: "X days, HH:MM:SS" or "HH:MM:SS".
"""
if s is None:
return None
d = re.match(
r'((?P<days>\d+) days, )?(?P<hours>\d+):'
r'(?P<minutes>\d+):(?P<seconds>\d+)',
str(s)).groupdict(0)
return timedelta(**dict(( (key, int(value))
for key, value in d.items() )))
But the other types are not quite so easy. Next time, I'll post my implementation for reconstructing datetime objects from their string representation.
Subscribe to:
Posts (Atom)