Posts filed under 'tech'
On Saturday, I spent the day at BarCampDC2. Like last year there were plenty of great sessions. I really wanted to discuss Amazon’s EC2 as I think it is where most small companies should be moving their sites and I see huge business opportunities in this space. As the session board was being built I kept looking for something on Amazon’s EC2, S3 or AWS. I had not used the services yet, but I was determined to discuss them as I know many of the companies present were using them. In desperation, I grabbed a pen and a post it note and wrote “To Cloud or Not? AWS, EC2, S3 or build your own“. I owned the session and I hoped I would have a few experts in the room so I could act as a moderator instead of presenter.
The room was packed and I started out by telling everyone that I had no presentation or experience with these technologies and hoped we had some experts in the room. As I expected there were plenty of experts in the room and we had a great discussion on what Amazon had to offer and other offerings that companies can leverage.
The room was filled with some of the greatest minds from the DC Tech scene.

More pics are here.
My notes from the session are here. Nikolas Coukouma helped clean them up and added some additional pointers.
After my session I attended several hard core geek sessions, as usual there were many sessions I was unable to attend. Maybe we can videotape the sessions next time?
I attended
- 11AM - Nitrogen Web Framework
- 1PM - Git
- 2PM - MySQL Optimization
- 3PM-5PM wandered through various sessions.
- 5PM - Beer! Great presentation by Chris Williams. I thought this was an early happy hour room but instead Chris schooled us on the history of beer.
Afterward we headed to McFadden’s where I consumed several pints of Guinness. Fortunately I had taken the bus and metro from my house so getting home was a non-issue.
Thanks to Center for Digital Imaging Arts at Boston University for letting us have the conference there and thanks to all the folks that helped put this together. Can we do this again in 6 months?
October 20th, 2008
A few months ago I was asked to do a Technology Due Diligence of SocialThing. My 1st reaction was why do we need another aggregator? We have BuddyFeed and several technologies that are proven to scale. People always snicker when AOL and technology are mentioned in the same sentence but the fact of the matter is that we’ve been building products that need to scale to millions of users, on day one, for well over 15 years. There are some amazing software engineers at AOL.
Back to SocialThing….
As TechCrunch and others have noted, there are several social aggregators out there, but SocialThing found a powerful niche in the LifeStream aggregation market. Let me start by defining what a LifeStream is and then I’ll get to what makes SocialThing unique.
LifeStreams focus on feeds about your life.
- What you are doing right now
- What pictures you recently uploaded
- What you posted to your blog.
Feeds on news and other events that are published by 3rd parties are not part of a LifeStream. They may still be feeds but they are not part of your life.
Life with a single social network
If everyone updated their status, uploaded pictures and blogged on a single social network LifeStreams would be easy. The standard Facebook News Feed would be all we needed to keep up to date with what our friend were up to. Of course, if there was a single network it would probably be pretty boring. Competition between social networks means we’ll always have the latest and greatest features, and if we don’t we’ll eventually move to where the best features are.
The problem with this competition is that our online life is fragmented and our friends are in various places. If we want to keep up with everyone we need to sign into several services or find a way to aggregate information on the people we care about.
LifeStream Aggregators try to make this easy. I’ll compare three of them here. These notes were made on my wiki a few months ago when I was hashing out what it was we were looking to buy.
FriendFeed
Many of the things our friends do are available via public feeds. This makes pulling them together in a meaningful way easy. FriendFeed makes this easy but you need to define what you want people to see in your feed (Me Feed) and then people can subscribe to your feed.
For example. I can quickly build a feed on FriendFeed that includes my Twitter, Pownce, Flickr and Blog feeds. Then my friends that use FriendFeed can subscribe to my feed to build a LifeStream of people they follow. FriendFeed makes this easy but its another account you need to create.
AIM has a buddy feed that does almost the same thing as FriendFeed. The AIM Buddy Feed feature is not well advertised but if you set it up your updates will show up in your friends buddy lists. Setup your feed here. If AOL promotes this feature and your friends are already on AIM this will save you from registering at yet another site. The aggregation of all LifeStreams of your buddies has been at dashboard.aim.com at times and then disappears. I hope it comes back soon.
Social Thing
SocialThing makes aggregation simpler than FriendFeed and AIM Buddy Feed because they took a different approach. Instead of requiring all your friends to join SocialThing they just pull your friend’s feeds from the networks you already belong to. They also let you post messages to your various networks.
They can do this because they ask you for your name and password on these sites. Personally I find this scary. Some sites like Facebook can give 3rd party sites tokens that they can store and use to access your account so the password is never sent to the 3rd party site. But sites like Twitter do not have this capability so sites like SocialThing need to save your username and password.
What do you get for giving up your usernames and passwords? Power!
Some services like Twitter have APIs to fetch your aggregated LifeStream in a single call. This makes SocialThing’s job easy. Other APIs require a 2 step process to get the aggregated LifeStream.
- Step 1 — Fetch my friends
- Step 2 — Fetch my friend’s “Me” Feeds.
This second scenario presents a scaling nightmare. If I login to SocialThing and I have 5 networks that require a 2 step process and I have approximately 50 friends in each, they need to make (5 + 50*5) 255 calls anytime I visit. They then need to keep polling these services to keep them up to date. This is a lot of work for SocialThing to be doing but it is also beating up on my 5 networks. As SocialThing grows its user base they might find their IP Address block as they overload the sites they are polling to build LifeStreams.
Another nice feature that you get by giving SocialThing your password is the ability to send messages to your various networks from SocialThing. With 1 click you can update your status on Twitter, Facebook and Pownce.
What’s next?
Honestly, I don’t know.
At this point the product folks are in control. We have an opportunity to make a great product even better and to bring our AOL, AIM and Bebo users into the world of LifeStream aggregation.
August 15th, 2008
Handles are the key to having applications update on the profile page without a user taking action. Some notes on how to do this on Facebook are here. Since Bebo has implemented most of the Facebook API this should be easy but I think some things (like Infinite session keys) are still missing. Hoping someone will leave me pointer proving me wrong on this.
By placing a handle on a user’s page you can (in theory) push updates to a user’s profile page without them interacting with the application. For example. If you had a “Washington Capitals Fans” application that pushed news to every user’s profile that had the application, all these pages would have the same handle. Having a single handle means that a single update of the handle content would update all profiles using the application.
In other cases you might want a unique handle per profile. For example, if your application injected an RSS feed of the user’s choice onto their profile.
Here is a simple example of setting a handle on a user’s page. I use the user’s UID as the handle in this case.
Set a handle on a user’s profile
I then write an update.php file that injects the date on the user’s profile
Update a handle on a user’s profile
That’s all fine and good but the update wasn’t automatic. The user had to hit the update.php file. In a real application we would have a database of all the users and we could periodically update the handles. Assuming there is an infinite session concept in the Bebo API. Since I could not figure out how to implement an infinite session here is my hack.
I place a hidden image on the user’s page that calls the update function.
Now when a user views their profile, the hidden image calls refresh.php and the handle content is updated. Unfortunately, the update happens after the page is rendered so you’ll need to reload to see the change.
The code…
Set a handle on a user’s profile and use hidden image for update
Unfortunately, the update happens after the page is rendered so you’ll need to reload the page to see the change. It should also be noted that anytime someone views your page they will call the update.php. If they also have the application installed your handle will be updated.
Assuming infinite sessions keys are unavailable I would leverage app users to update their peers. In your database of users keep track of the last time they were updated. Anytime the update.php function is called do an update on all handles that haven’t been updated in a specific period of time. As the user base grows this should allow for a more even distribution of updates. This might even be better than the cron jobs that infinite session key users use in their cron jobs.
April 16th, 2008
Last week I spent some time learning how to build Bebo applications. Their API is just like the Facebook API but it is not complete and the documentation has some holes in it. If you haven’t built a Facebook application the entire process can seem awkward.
The Bebo Developer Page makes it sound like a simple 3 step process
- Get the library
- Install the app
- Start Creating.
If you don’t know how to write web applications in PHP, Java or Ruby stop now. You need to know at least one of these systems to continue.
I downloaded the PHP library and put it on my host. Next step was to install the developer application. Why? Why do I need to install an app to build apps? Seems weird at 1st but basically this application is used to manage the keys, locations and settings for your apps.
Once you have the app launch it and click “Create new app” (way off on the right) . Give your application a name and a URL and a callback URL.
What is the callback URL? It is the URL that is hit when a user goes to the Application URL. http://apps.bebo.com/yourappname is just a proxy that adds headers and parameters to the request before it hits your application file. The bebo library uses this information.
For example. I created an app called sample with a URL of http://apps.bebo.com/sample. My callback URL is http://bebo.tonycode.com/apps/sample
Hitting http://apps.bebo.com/sample results in a call to http://bebo.tonycode.com/apps/sample where I have the following index.php
http://tonycode.com/wiki/index.php?title=Bebo_Examples#Display_All_My_Friends
This application simply prints out all your friends.
Add the application to your page by going to the developer application, viewing the app and clicking the profile page for the app. Now go to your profile page a voila.. the app is there but not your friends.
Huh? How do I get the content to show up on my profile page? If I don’t show it on the profile page it seems pretty pointless. right?
To add content to the profile page you use profile_setFBML. Last I checked the return codes for this function are not defined. Seems to return a 1 when it works and an array when it fails. Nice. :-\
Here is the code updated to put friends on profile too.
http://tonycode.com/wiki/index.php?title=Bebo_Examples#Display_All_My_Friends_on_my_Profile
Weeks go by and you add new friends to your profile and you notice that the list of friends in your custom application aren’t changing. profile_setFBML is only called when you visit the application page. Well that stinks you say. How can I make it update each time I visit the profile? I’ll get to that in my next post.
Random Tips.
- Documentation is at http://developer.bebo.com/documentation.html
- The downloaded libraries have example code. Start there
- You may need to look at 2 different sections to piece together how a function works. For example user.getInfo has a fields parameter
- http://www.bebo.com/docs/api/UsersGetInfo.jsp
- Look at the SNQL users table to find what is available
- http://www.bebo.com/docs/snql/User.jsp
April 15th, 2008
I always hated printing confirmation pages from web sites. Printing a piece of paper that’ll end up in the recycle bin in a few weeks is just silly. There are also times that I’m not connected to a printer and I really need to save a copy of something I’m viewing.
My answer for the past few years has been PDFCreator, install it and whenever you print, you can print to a pdf file instead of a printer. This month alone I think I’ve printed one paper page from my printer and about 90 pages to PDF form.
I also used PDF creator to email proof pages for our daughter’s yearbook to teachers. In the past printouts would be made for each teacher, they would mark them up and send them back. I’ve easily saved a ream of paper this year by doing this via email. Not to mention its easier to manage email than paper.
Once installed, just use it like a printer. It will show up as a printer in the print dialog.

From there it will ask you for a title and then a name for your pdf. If you want to make a hardcopy later you can just print the pdf file you created.
March 24th, 2008
Over the past few years my Blockbuster subscription fee has increased and the number of in store exhanges allowed has decreased. At the same time my queue is running on empty. At 1st there were tons of movies I wanted to see but now I’m caught up and I don’t have the desire to rent more than 1 move a week.
What are 4 movies a month worth? If I use Redbox those 4 movies will cost me $4 (if I return them in 24 hours). With Blockbuster Online only the cost is $9 (no in store exhanges).
Sure I can keep the blockbuster movies as long as I want but I only watch them once and why not just grab one when I know I have time to watch it.
The trouble with Redbox in the past was that you never knew what was going to be in the box when you got there. They recently made my local Redbox part of their online rental system so that problem is solved.
There is a remaining issue that I hope Redbox is working on. There are frequently people browsing movies when you get to the box. You need to wait for them to finish before you can return a movie or pick up your movie, that you ordered online. They should have an online pickup and return slot on the side so those of us impatient people don’t need to pace around behind the people browsing titles.
Bye Bye Blockbuster. I suspect next year I’ll be able to dump Comcast an use Antenna and the web for my television consumption.
March 12th, 2008
After I blogged about building a sitemap for Rails I contacted Mike Clark and asked him if he thought it would make a good Recipe for his upcoming book, Advanced Rails Recipes. He thought it was a good fit and it is currently in the Beta version of the book.
I wrote up my notes in the Recipe format, then Mike basically rewrote it for Rails 2.0 and added some additional content. Thanks Mike! I almost feel bad being cited as the author since after editing it is drastically different from the original.
The core concepts are still there and some thoughts were dropped since Recipes should be short. So, Here are some elaborations..
The Ping Protocol
There is a warning in the book about excessively pinging to Google to have them read your sitemap. I would recommend letting search engines crawl your sitemaps at their own speed. The ping example in the book was a nice overview of when to use an Observer and also provided complete coverage on how to submit sitemaps. Please use ping sparingly, if at all.
Sitemaps with over 50,000 entries
I work on sites where we use siteindex files because we submit well over 50,000 URLs to the search engines. I didn’t provide an example on how to build these in Rails because I’m not sure they provide any value to the typical site.
My theory is that if you build a sitemap with the 50,000 pages that were most recently updated you will give the search engines all they need. If a page isn’t updated for a while and it falls off the list is that really a problem? If the page was worth anything someone externally would be linking to it before it fell off the list. Now if your site is creating millions of pages a day this may not be the case.
If your pages are islands (no links to them) and you’re afraid they won’t be found unless they are all in the sitemap, I would suggest building the sitemap via a rake task that is kicked off via a cron job. This will also give you an opportunity to gzip the files. I’ll try to writeup some example code for the this when I find some free time.
Do I really need a sitemap?
If your site has navigation to all its pages, then a sitemap will probably not benefit you. I suggest checking what pages the search engines have in their index and if key content is missing then pursue a sitemap. Even if they are finding all your pages a sitemap certainly couldn’t hurt.
Just in case you didn’t know how to find the pages Google knows about on your site you can simply type site:youdomain.com in the Google or Yahoo search box.
Example results for my site are here
March 8th, 2008
Electric clothes dryers are not an efficient way to heat your home, but if you’re using it anyway, you might as well use that heat to warm and humidify your home in the winter. Not only is your dryer heating air and sending it outside, it is constantly pulling warm air out of your house when it is running. What is coming into your house is cold dry air to replace the air the dryer is expelling. There is also the issue of air coming into your dryer vent when the dryer isn’t running. If your outside vent cap doesn’t seal well this can make your laundry room very drafty.
Here’s what I do every fall to help warm my home, increase humidity and lower drafts in my laundry room.
1) I disconnect my dryer hose from the outside and stuff the hole with plastic grocery bags. These make great insulation, just don’t forget to take them out in the spring when you reconnect.
2) I connect a longer dryer hose to my dryer and run it to a lint trap. Try to get the trap as far as possible from the dryer as you want the humid air to dissipate. Depending on your existing setup you may be able to use your existing hose.
Here is my lint trap. Under the sink, next to the washer

Here is the dryer hose running from my dryer and past the washer.

Since I have kids we do a lot of laundry, which in turn results in me never having static electricity issues in the winter as my home is never too dry. These lint traps are pretty common. If you Google “lint trap” you’ll find plenty of places selling them. They are filled with water and they catch most of the lint. Warning, If you let the trap run dry you’ll end up with a linty home.
I know some people use nylon stockings over the end of the hose instead of a trap but if you didn’t clean it often you could damage your dryer or cause a fire. I also have friends who have created larger boxes to capture more lint. Please leave comments or other ideas below.
Warning #1: Only do this in the winter months as you may end up with a mildew problem from excessive humidity and this will work against your air conditioning. We want to expel heat in the summer. Also, the dryer will not be able to dry clothes as fast if it is pulling in excessively humid air. I find this to be a non-issue in the winter because the humid exhaust is quickly evaporated into the relatively dry house air. The further you can get the lint trap from the dryer the better.
Warning #2: Don’t do this if you have a natural gas dryer. You must vent this outside to prevent carbon monoxide buildup in your home.
Warning #3: If you use fabric softeners or home dry clean kits you should probably not do this as you may end up with unhealthy air.
i find that switching over from internal to external venting gives me an excuse to clean lint out of the lines and dryer twice a year. When was the last time you cleaned your vent hose?
February 12th, 2008
Recently I implemented a Rails application sitemap but once the search engines started hitting my site, I realized that I wasn’t giving them all the information they desired.
- Yahoo was doing simple HTTP head requests on my sitemap and going away
- 206.190.57.45 - - [11/Dec/2007:08:35:49 -0800] “HEAD /sitemap.xml HTTP/1.0″ 200 334 “-” “Yahoo! Slurp/Site Explorer”
- Google read my sitemap infrequently but loved to do HEAD requests on my index page
- 66.249.70.196 - - [17/Dec/2007:07:11:24 -0800] “HEAD / HTTP/1.1″ 200 372 “-” “Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)”
For those of you unfamiliar with HEAD requests, they are requests for a page that don’t actually return the page. Just information like size and date. Its a nice way for search engines and caches to decide if there are any changes they need to pull. For some examples of HTTP requests check out the wiki page I wrote on making HTTP requests via telnet.
Now what do you think Google and Yahoo were looking for? My assumption is they are looking for the Last-Modified header in the response to see if they should bother requesting the sitemap. They could compare the size of the response since they last visited but I doubt they want track this information.
The Last-Modified date is the ideal field to check.
This is all fine and good but guess what. Rails doesn’t set that header for you.
telnet ficlets.com 80
Trying 64.12.150.213...
Connected to www.ficlets.com.
Escape character is '^]'.
HEAD / HTTP/1.0
Host: www.ficlets.com
HTTP/1.1 200 OK
Date: Wed, 09 Jan 2008 20:22:31 GMT
Server: Mongrel 1.0.1
Status: 200 OK
Cache-Control: no-cache
Content-Type: text/html; charset=utf-8
Content-Length: 16355
Set-Cookie: _session_id=s322clipped; path=/
Vary: Accept-Encoding
Connection: close
The good news is this is easy to add! If you look at my wiki example you’ll see that I set the header with the time of the latest entry in the sitemap.
headers[”Last-Modified”] = @entries[0].updated_at.httpdate
Now it isn’t rails job to add this header for you but it would be nice if the scaffolding added this header. The standard show/1 actions are pulling a record from a database and the action knows the updated_at value.
I have added this header to my show actions as I am just pulling a record from a database and I have the modified time!
headers[”Last-Modified”] = @business.updated_at.httpdate
That’s all. I’m looking forward to any comments and suggestions people may have.
January 10th, 2008
Up until a few months ago, all of my bedroom ceiling fans used Compact Florescent bulbs (CFLs). Back in October I bought a Hampton Bay Ceiling fan for Dani’s room and when I installed the light fixture I noticed it had a different socket type. It used Intermediate base bulbs (also known as E17). These bulbs are rare and there is no CFL option. So I went back to Home Depot and sure enough all the manufacturers were starting to use these things. The Home Depot guy suspected it was a conspiracy between the ceiling fan companies and the bulb manufacturer. There is only a single brand of intermediate base bulbs at Home Depot so this made a little sense. They also cost as much as a CFL!
I had no desire to use these bulbs so I started looking into converting my base to use the standard medium base socket. I saw a medium base for a ceiling fan display model at Home Depot but they wouldn’t sell it to me and it was no longer going to be carried. The plot thickened. So I looked on the Lowes website and I found a medium base socket that I figured I could retrofit onto my base. While I was looking for the item at Lowes, I asked a representative of one of the lighting companies (who was restocking) about the intermediate bases and he said it was all part of the 2007 Energy Bill. Huh? How can using a base that doesn’t support CFLs be part of an energy bill? I googled around and it appears this was a loophole to get around the Bill. The bill required ceiling fan manufacturers to ship with CFLs, UNLESS they used candelabra or intermediate base bulbs.
Bastards.
Here is the conversion that I did tonight in about 15 minutes.
DISCLAIMER: Please do no do this unless you are experienced with electrical wiring. Follow these steps at your own risk. There may be typos so use common sense if you do this.
1) Unscrew the existing sockets and cut the wires. Keep track of the original wiring. Save the screws.
2) Remove the mount from the Lowes socket and attach it to the base with the screw from the intermediate base. Twist and bend to get it as close to center.
3) You’ll need to strip the existing wires that were not part of the intermediate bases.
4) Combine your whites and blacks and attach with a twist on electrical wire connector.
5) Reinstall
Since these sockets are bigger I needed to bend the socket a little before the light covers fit but overall the fixture looks great.
Pictures. yeah close ups are out of focus but hopefully helpful. 
This is the bottom of the intermediate bulb base. poor focus. This is where you will find the screw to remove it.

Here is how the medium base (lleft) compares to the intermediate base (right).

The new base had 2 screws. I removed them and used the screw from the intermediate base since I knew it fit the fixture.

Old Wiring.

New Wiring

And now I have CFL joy.
January 7th, 2008
Previous Posts