Sunrise
November 7, 2008 | 0 Comments
After working all night at a 24 coffee house, I took a ride around the Headlands loop.
Server Migration
October 17, 2008 | 0 Comments
The uuorld.com server used to be hosted on a standard dedicated box at a datacenter in Los Angeles. In an effort to consolidate resources, enable flexibility for future efforts, and save money, it made sense to move all of our servers to Amazon's EC2 cloud infrastructure.
The old server had been running CentOS. I opted to go with CentOS because it was considered a secure, well-supported standard. The hosting provider's sales team convinced me that I would be a lot better off if I also had CPanel installed, so I paid a little extra for that too. (CPanel provides a web interface for common administrative tasks on the server.) There were many problems with the whole setup.
- I have a strong background in Debian and Ubuntu platforms, but lack the experience with RedHat based distros. This often made troubleshooting more complicated than it should have been.
- The default installation of CPanel and CentOS included a lot of things we didn't need, including a full up DNS server, IP logging programs, phpMyAdmin, FrontPage extensions, etc.
- The CentOS repositories contained old versions of a lot of software packages, and we were depending on some bleeding edge packages to provide the functionality we wanted. It was not just once that I was forced to uninstall the default packages and compile from source.
- We were paying a lot of money.
I'm convinced the Ubuntu guys are saints.
The Current
October 7, 2008 | 0 Comments
After a hiatus of several months, I've been listening to the Current (part of Minnesota Public Radio) again today. It has been great, and I've found myself really enjoying some artists I hadn't encountered before, including Santogold and Stars.
Especially helpful for me is that MPR publishes the list of songs they play.
I had been feeling unhappy with Pandora lately. The stations I've configured with Pandora quickly get stuck in a rut. I read once that top 40 stations are so popular because people tend to carry ~40 songs in their reserve memory. It's hubristic to think I'm better than average, but at the very least I like a diversity. The Current hasn't repeated any songs all day, which is much more than I could say for Pandora.
For today the Current has my vote. Two thumbs up.
vimrc for Py
September 30, 2008 | 0 Comments
A great .vimrc file for coding in my favorite language: vimrc.
This is far superior to coding with Py+Eclipse integration.
Biking Photos
September 22, 2008 | 0 Comments
I posted some photos from my bike rides around San Francisco and Marin.
Visit the Gallery.
Wow
September 11, 2008 | 0 Comments
Dropbox is, um, amazing.
File sharing and syncing across computers. You can share files instantly and easily with your friends or family. Available on Linux, Mac, and Windows. They also support a web interface.
This is ridiculously cool.
Location Location Location
August 19, 2008 | 0 Comments
Yahoo has some of the best mapping and geo-location APIs. Their GeoPlanet services provides a Where-On-Earth unique ID for millions of places around the world. Their API has a search feature, so it's straightforward to get a WOEID for any place based a plain-text query string.
FireEagle is another strong offering from Yahoo. It's a personal location tracking system. Combined with a SPOT Messenger GPS system that uses a satellite uplink, I should be able to notify FireEagle of my location -- literally anywhere in the world -- at 10-minute intervals. For now, my location data will be kept private inside the service, but I may open up some of it and post it here. The SPOT was ordered last week, and testing should begin later this week.
C++ Maps (the STL kind)
July 22, 2008 | 0 Comments
At UUorld, I get to work on a lot of cool problems. Often I find myself working with the STL: maps, sets, iterators, and the rest of them. The STL is great. (For what it's worth, I think Qt has done a great job of making it just a little bit easier to use while still maintaining the fundamental attributes that make the STL great.)
Recently I was working with maps that were of type map<int, string>. I needed to copy every item from one map to the other map where the keys of the first map were also contained in an STL set. Here's what I came up with:
#include <iostream>
#include <set>
#include <map>
#include <iterator>
#include <algorithm>
using namespace std;
template< class MAP_A, class MAP_B, class COLL >
void mapCopy( MAP_A& a, MAP_B& b, COLL& c ) {
for( typename MAP_A::const_iterator it = a.begin(); it != a.end(); ++it ) {
if( find( c.begin(), c.end(), it->first ) != c.end() ) {
b.insert( make_pair( it->first, it->second ) );
}
}
}
int main( int /* argc */, char ** /* argv */ ) {
map< int, int > a;
map< int, int > b;
set< int > ints;
for( int i = 0; i < 10; ++i ) {
ints.insert( i );
}
for( int i = 6; i < 14; i += 2 ) {
a.insert( make_pair( i, i*i ) );
}
mapCopy( a, b, ints );
cout << "Map 'b' currently contains:" << endl;
for( map< int, int >::iterator it = b.begin(); it != b.end(); ++it ) {
cout << it->first << "->" << it->second << " ";
}
cout << endl << "--------" << endl;
}
I know this can be further optimized. The C++ example should use a stateful class when iterating over the set to keep track of what item in the set was last seen (since the map keys are sorted, all subsequent lookups against the set will compare against items later in the set).
Internet problems
July 18, 2008 | 3 Comments
Not sure what was going on today... but it looks like pandora.com was hacked for a while. Also had problems getting to this site as well as nytimes.com, news.yc, uuorld.com, and a whole bunch of other domains that I didn't have the foresight to track and that aren't showing up in my browser history.
I did look some of them up on WhoIs, and found that the sites I had problems with are registered under several different registrars. NYTimes is under Network Solutions, YC is EasyDNS, Pandora is Network Solutions, this site and UUorld are both under GoDaddy. It doesn't seem likely that several of the major registrars would be hacked at the same time. My friend reports she was able to get to some of these sites when I wasn't able to.
This suggests some DNS hacking somewhere between my router (which still seems to be clean) and those websites.
[Edit - evidently I was tired and didn't spell pandora.com correctly. Lame. Sorry for the false alarm with that image I posted.]
Glad the problems didn't last too long. My thanks goes out to those anonymous network admins who evidently fought the good fight on this one.