Monday, June 16, 2008

toilets.

I was at home depot this weekend helping my friend pick up some shelving for his condo. While I love visiting home depot, I'd never visited it from the point of view of a home-owner - just a renter.

I started looking through the various sections trying to figure out how I would choose a particular lighting fixture, bathroom tiles, or kitchen cabinets.

And then I saw the toilet aisle. There were on the order of 20 toilets. Ranging from >$350 to <$50. Which one would I choose? They were mounted way above my head - so it's not like they expected you to choose on the basis of comfort. They were pretty much all some variation of white. So color was not the differentiator. Some of the shapes were somewhat different - but did that justify a 7x price jump? The GPF (Gallons Per Flush) was listed for each toilet. But I'm guessing that changing that doesn't really affect the price a lot. Then it hit me - maybe the more expensive ones had those cool warm-water-and-air systems built in for that extra-clean feeling. Nope. At this point, my investigation was cut short.

I think this one deserves a return trip at some point. If you know what differentiates toilets, save me a trip and leave a comment.

Links




Update: Added some links.

Wednesday, June 04, 2008

On Verbosity

I wouldn't consider myself a super talkative person. Which is not to say that I'm a quiet recluse - just that I don't chatter a lot. That's my opinion of myself. Yours may differ greatly. :)

My wife thinks I'm extremely verbose. But she's a journalist, so I suppose she'd better be damn good at being concise.

I try really hard to edit my emails before sending them out. Usually I do at least 3-4 edits of even simple emails. All credit for that goes to Chad Hermann's business communications class at CMU. (Ironically I had to stop following his blog because I just found it incredibly verbose and time consuming).

Anyways, here's the nut graf. Using twitter I've noticed that I'm often forced to write and rewrite a single 140 char post. It's caused an increase in my signal-to-noise ratio.

But not everything needs to be distilled down to 140 characters. I imagine there are some of you who actually like for me to ramble here every now and then.

Saturday, March 01, 2008

reporterist is hiring

reporterist is hiring. If you know someone that may be interested, please send them our way.

PS: Although I probably shouldn't steer any engineers away from reporterist, my buddies over at Jambool are hiring also. I worked with Vikas for a year, and he's definitely awesome to work with.

Wednesday, February 27, 2008

foot pedals

I spend a fair amount of time working in coffee shops these days - it breaks the monotony of working from home, and it gives me an excuse to get on my bicycle and get some fresh air.

That should help explain why it occurred to me today that foot pedals could be employed much more liberally in public restrooms.

Clearly, I'm not the first to think of using foot pedals in the restroom. I wish we saw more of these in public places. It seems like a much cheaper and more reliable alternative to electronic versions.







Thursday, February 14, 2008

AAACMAADSSTT

Nope. It's not a puzzle (The puzzle is OTTFF).

It's the Annual Almost All Carnegie Mellon Almost All Desi Ski Snowboard and Telemark Trip. Naming, courtesy Kush.

It's been almost a decade since I graduated from college. In the past 5-6 years, we've been doing an annual ski trip comprised, as the name might suggest, of a group of close friends - many of whom I've known for almost 12 years.

17 of us will be in Steamboat Springs this weekend, and I can't wait. Apart from a few religious regulars, most people tend not to have made it to every single trip. I unfortunately missed two of the trips when we were in India, but last year's trip was great.

The group includes friends, friends-of-friends, significant-others-of-friends, and siblings-of-friends (I think that covers it - I don't think we've had any parents/grandparents attend :) ). It's one big family, and it's a great time to catch up with people I am not always in touch with. There's always lots of food, drink, games, stories, laughter. I can't wait.


I'm ridiculously out of shape. I did a practice-day at kirkwood this past weekend, and got my butt kicked by some double-blacks (I was just trying to confirm that they're still out of my league).

Incidentally, if you're a skier/snowboarder, you should check out the Ski and Snowboard Facebook application, developed by Vikas Gupta, my buddy and founder of jambool.

Wednesday, February 06, 2008

recent reporterist press.

This weekend we were interviewed by the Online Journalism Review, and there's some blog buzz today.
Exciting stuff. Now, back to coding.

Tuesday, January 22, 2008

The PCH

Last Friday, we drove part of the Pacific Coast Highway, on our way back from Irvine, CA.

After leaving Irvine around 10am, We stopped in Santa Barbara for lunch at La Super Rica. The weather there reminded us of Goa, and I was just walking around with a permanent smile stuck on my face.

After lunch, we were debating whether or not to take the PCH since it was already past 2pm. Thankfully we did, and were rewarded with breathtaking views of the ocean, cliffs, and sunset.

I was trying to coordinate a beer-taco-sunset spot along the highway, but we didn't find any taco joints at the right time, so we had to settle for a romantic sunset, and then dinner at a slightly upscale place in Big Sur.

The last stop en route to Oakland was at Monterey to visit Nate, who's at Naval Postgraduate School. It was long since dark, so this was more of a 'drop in and say hello' rather than a sightseeing stop.

Exhausted, we arrived home at 11pm, after a week long trip (mostly work, but a bit of fun too) to L.A.

Sunday, December 23, 2007

getting the memo

Last night, we went to a friend's wedding reception. About 30 minutes before when we had to leave, I started rummaging around looking for a suit, tie, and nice shirt - all those pieces of clothing that rarely get used. I tried to get some advice on tie/shirt matching over IM from a friend. Finally, frustrated, I decided that I was just going to wear a Kurta instead. I have some Kurtas from the various ceremonies surrounding our wedding - and they never see the light of day anyway. I picked a nice white one with a bit of embroidery on it.

We showed up at the hotel and proceeded to grab a drink and appetizers. I didn't see anyone else wearing a kurta. About 45 minutes into the event, I was pretty distraught; whereas the women were decked out in their finest Indian clothes, I stood alone, in bright white, in a sea of black suits.

It's as if everyone else there got the memo, but they forgot to cc me.

You'd think more people would wear Indian clothes at an Indian wedding, huh? But maybe evening events call for a suit.

So what does one do in a situation like that? I did what any self respecting male does. I downed my wine, took a few gulps of scotch, and used all that liquid confidence to pretend like *they* hadn't received the memo.

I'm penning this for posterity, lest all the liquid confidence makes me forget to wear a suit next time.

Thursday, December 13, 2007

Socio-adjusting

Babies have this comfort zone of how many people they want to be around. If they grow up with lots of people around, they suddenly feel at a loss when they are alone. If they are used to just having their parents around, they feel overwhelmed when they are around many people for a long time.

I've noticed it with many 2nd generation indian kids who go back to India on vacation. They flip out when they first get there, because they're suddenly being doted on by grandparents, uncles, aunts, and cousins. Three or four weeks later, they head back home and are suddenly antsy when only their parents (and maybe siblings) are around.

I think that happened to me this month. I've been working alone for the past nine months and was suddenly thrust into three weeks of meeting people (though I actually didn't do the normal amount of socializing because I was pretty busy working).

Now I'm back in Berkeley, and working from an empty, quiet home again seems awfully difficult.

Thursday, December 06, 2007

not another rails post

It has come to my attention that many of my readers couldn't care less about rails. I apologize. Since this past february, my life has been consumed by reporterist. I eat, breathe, and dream about it. Bed-talk with my wife often involves reporterist brainstorming.

And yet, life does tend to have a way of going on. I'm currently spending a few weeks in Pune, and am fortunate to be able to attend the famous Sawai Gandharva Mahotsav - a four-day indian classical music festival. It's my first ever, and the first day was great!

I'm happy to report that eighteen months of living in Bangalore seems to have solidified my India-driving skills. I'm now pretty comfortable driving here even after not doing so for a year.

I got a wisdom tooth removed, and have been in pain for over a week. Earlier this week I decided to stop taking painkillers, and start drinking instead. A bit of cognac from Dad's bar seems to have eased the pain (and pleased the palette) this evening.

Saturday, November 24, 2007

testing mailers in rails

AFAIK, the only way to test mailers is to create a mail object directly, and then look for textual matches within the mail body.
That's lame. I wanted something more akin to the 'template_objects' method that you can call on a response when writing functional tests.

Turns out that ActionMailer::Base does some funky stuff that makes it really hard to do this. Here's what I resorted to in the mean time:

Let's say that my NotificationMailer looks something like:

class NotificationMailer < ActionMailer::Base
def my_notification_method
@body['name'] = "bob"
end
end


add the following code in test_helper.rb:

ActionMailer::Base.class_eval {
alias initialize_which_results_in_auto_create initialize
def initialize( method_name = nil, *params )
return if( :test == method_name )
initialize_which_results_in_auto_create( method_name, *params )
end

class << ActionMailer::Base
def grab_vars( method, *params )
obj = new(:test)
obj.send( :initialize_defaults, method )
obj.send( method, *params )
return {:body => obj.body, :subject => obj.subject, :recipients => obj.recipients}
end
end # class
}


I can now check for 'assigns' as follows:

nm = NotificationMailer.grab_vars( :my_notification_method )
assert_equal( "bob", nm[:body]['name'] )


That's still fugly, but it lets me test the @body hash at least. If you have a better way of doing this, or a way to make that look prettier, please let me know!

Friday, September 28, 2007

Rails Integration Testing

I found this to be a pretty good (well, there's not really much info out there) intro to writing integration tests.

But if you look in the comments, people are sort of stumped on how to deal with logging in users when you don't have passwords stored in the clear.

Here's my solution, which injects the user object directly into the request session, meaning that you don't need any other ugly hacks (such as letting your user controller accept hashed passwords.. ugh).



# http://weblog.jamisbuck.org/2006/3/9/integration-testing-in-rails-1-1
# describes some cool integration testing, but there's no
# solution for how to 'inject' a user into the system when all
# you have is hashed passwords.
# The code below lets you inject a user object directly into your
# 'session' object.

# So you can add the following methods to your integration test (see the above blog
# for more explanation):
#
# def new_session_as( user )
# new_session do | sess | # new_session is defined per the blog post above
# sess.user_object = user # aha this is where we inject the user object
# yield sess if block_given?
# end
# end


# allow a user_object to be injected via the HTTP headers
ActionController::Integration::Session.class_eval {
attr_accessor :user_object
alias process_without_user_headers process
def process( method, path, parameters=nil, headers=nil )
unless self.user_object.nil?
headers = (headers || {}).merge( {'X_USER_HACK' => self.user_object } )
end
process_without_user_headers( method, path, parameters, headers )
end
}

# extract the user object from the headers, and store it as an attribute
ActionController::Integration::Session::MockCGI.class_eval {
alias initialize_for_real initialize
attr_accessor :user_object
def initialize( env, input )
user = env.delete( 'HTTP_X_USER_HACK' )
self.user_object = user
initialize_for_real( env, input )
end
}

# extract the user object from the mock cgi class, and
# set it up in our session
ActionController::CgiRequest.class_eval {
alias initialize_for_real initialize
def initialize( cgi, options )
initialize_for_real( cgi,options )
# The following line may be different for you:
self.session['user'] = cgi.user_object
end
}

Wednesday, August 29, 2007

reporterist.com private beta

So we just officially launched a private beta of reporterist to 60 professional journalists.
We just launched a very, very small subset of our functionality - just to get some initial feedback from our users.

I'm super excited (and nervous).

You can follow the reporterist blog for more updates.

In other, more personal, news; we found an nice apartment in Berkeley (not the easiest of things to do) and have begun to settle in. Our neighbours are awesome - three of the wife's classmates actually stay next door.

That's all for now.

Friday, August 03, 2007

amazon fps launched!

This is very exciting! The Amazon Flexible Payments Service has finally launched!

I say finally, because I had the honor to be a small part of the development of this service when I moved to Bangalore. Amazon FPS was built almost entirely out of India by a really awesome team.

I left that team in February 2006, so I can't claim that much of my code lives on (which may be a good thing!) but I'm definitely proud to have played a part.

Awesome job guys!

update: here's the aws blog post.

Wednesday, July 25, 2007

figuring out the gmail spam filters

So I'm working on a web application, and today I was trying to send invites out to some users. Turns out that they were going into the gmail spam filter.

I made sure that my RDNS (Reverse DNS) was set up correctly, and then I checked the email headers to ensure that gmail didn't suspect my ISP's IP address as a spammer IP.

A friend suggested that it might have something to do with the content of my emails, and not the body.

So I started playing around and, sure enough, that was it. After several emails I realized that it had to do with the link I was sending in the email. At first I thought that it might have to do with the length of the link (and an MD5-encoded token in the params).

After several tests I figured out exactly what trips it: If I send email from a foo.com server (hostname = foo.com, DNS and RDNS consistent with foo.com) with a signup link for foo.com, then that sends the mail to spam. If, on the other hand, I send email from a bar.com server with a link to foo.com, then the email makes it through the spam filter.

That seems so non-intuitive to me. It seems more shady for an email from bar.com to have a link to foo.com in it.

Anyways, I've got a temporary work-around (I think?), but I still don't know the 'right' way do this.

Monday, July 02, 2007

music for the soul

At most points in my life, I've listened to, sang, played, and loved music that 'spoke' to me. I think most people know what I'm talking about.

Sadly, there have been some points (more so recently) when I just haven't been able to find music that speaks to me. Much of my music collection just doesn't do it for me anymore. Even classic evergreens like U2 and Bob Dylan - which usually always have something to say to me - just fall on my ears but don't penetrate any deeper.

Those who know my general music taste; feel free to recommend me some new music.

Wednesday, June 13, 2007

The quest for quarters

It's been a while since I needed quarters to do laundry.
In Seattle, we had an in-unit washer/dryer, and in Berkeley we could send money from a student account directly to the machines.

In Baltimore, I we need quarters for laundry and, having just moved here, I don't have a jar full of them lying around. Of course, I waited until the last possible minute to do laundry. So yesterday I rolled out of bed and decided to go in search of quarters. The wife had the car, so I was limited to walking distance.

I started with the local mini-mart; he agreed to give me 4 quarters but no more. Next I went to the laundromat. The lady there was exceptionally rude and gave me a "yeah right" when I asked if she had quarters. She wasn't very helpful telling me about banks in the area either. My next stop was a few blocks away at a laundromat with a change machine; turns out that it had been broken for years. I went into another minimart, and the desi owner refused me quarters even if I were to buy something.

I finally gave up and came home. On rummaging through my suitcases, I was able to find one hiding undergarment, thus allowing me to shower.

In the evening when the wife got home, we went to the gym and decided to stop by a grocery store afterwards. We happened upon a small stripmall with a laundromat and pharmacy, so we stopped there.

As I was about to put my $20 bill into the change machine at the laundromat, I simultaneously heard a raspy voice and read the hand-scrwaled notice in front of me: "No change unless you're doing your laundry here!" I apologized and walked out, frustrated.

At the RiteAid, we purchased our wares, and politely (maybe desperately?) asked for a roll of quarters. She didn't have a roll, but gave us a few dollars and suggested that we ask the other cashier.

As we were about to ask the other cashier for change, the lady in front of us says to her daughter as she's walking away "ok. well, I think not we shold have enough for one more load."
The cashier was out of quarters.

I feel like we've entered the quarter-free twilight zone. Maybe this weekend we'll drive down to DC or Virgina and smuggle a few rolls of quarters over the border. Who knows, maybe we could sell them for a premiuim.

Thursday, May 17, 2007

roller coaster

Wow.

I had heard about how starting a company can be an emotional roller coaster. But it's been interesting to experience it first hand over the past 3 months. Every good customer response makes me feel on top of the world, and every time I think about all of the things that could go wrong, I start a downward spiral.

And I've barely just started! I'm sure it will become even more challenging once the stakes get higher.

I'm glad I'm not in it alone. Having someone else working on it is great - not only to get things done, but to smooth out the roller coaster, and to help in making judgment calls.

Sunday, April 29, 2007

emacs love

I was working on some ruby code just now. I had a hash with keys that were capitalized words, such as:

comp << l['Address'] unless l['Address'].empty?
comp << l['City'] unless l['City'].empty?
comp << l['State'] unless l['State'].empty?
comp << l['Zip'] unless l['Zip'].empty?
comp << l['Country'] unless l['Country'].empty?

but I made some changes so that all of the keys would now be lowercase and turned into symbols. Basically I wanted the output to look like this:

comp << l[:address] unless l[:address].empty?
comp << l[:city] unless l[:city].empty?
comp << l[:state] unless l[:state].empty?
comp << l[:zip] unless l[:zip].empty?
comp << l[:country] unless l[:country].empty?

With a little help from an ex coworker's blog, I was able to achieve this using the following regular expression:

M-x replace-regexp
l\['\([A-Z]\)\([^']*\)'\]
l[:\,(downcase \1)\2]

Note that the '\,' (backslash-comma) combination escapes the lisp command that is part of the replacement text.
I never ceased to be amazed by the power of emacs. I'm still decades away from being able to develop a webservice in lisp. :)