Archive for the 'geek out' Category

Sweet Home Office

January 16th, 2012 | Category: geek out,work

I don’t want it to seem like all I do is work. But…

My uncle and aunt in California gave Melissa and I an engagement gift of a credit to a nice furniture store in DC. Used it to get an awesome home office setup. I wish I got to use it more, but today is the perfect day to stay home and do some research.

The monument is sticking out in the background. The view is splendid.

For NYE, we went to Fripp Island, SC with some good friends. I’ll post some pictures shortly. The highlights were a great golf game with Mitch and an Oyster roast on New Years Eve. Regarding golf, let me just say that if Caroline is my scorekeeper, I might make par someday, otherwise there is no chance.

No comments

HTTParty 0.8.0 with MultiJson throws ‘NameError: constant JSON::Parser not defined’

September 21st, 2011 | Category: geek out

I’d written a gem to make requests of an OPOWER internal API. In that gem, I’d used HTTParty 0.7.8 to do the get, put, etc to the API endpoint. I’d used Crack to parse the JSON. HTTParty revvd to 0.8.0 and seemingly removed Crack support. Here is how I got my gem to work again.

1. Update the Gemfile and Gemfile.lock to use the new version of httparty

2. Started seeing errors like this:

NameError: constant JSON::Parser not defined
/Users/rbanerjee/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
/Users/rbanerjee/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
/Users/rbanerjee/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
/Users/rbanerjee/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
/Users/rbanerjee/.rvm/gems/ruby-1.9.2-p180/gems/multi_json-1.0.3/lib/multi_json.rb:30:in `block in default_engine'

and

NotImplementedError: HTTParty::Parser has not implemented a parsing method for the :json format.
/Users/rbanerjee/.rvm/gems/ruby-1.9.2-p180/gems/httparty-0.8.0/lib/httparty/parser.rb:138:in `rescue in parse_supported_format'
/Users/rbanerjee/.rvm/gems/ruby-1.9.2-p180/gems/httparty-0.8.0/lib/httparty/parser.rb:136:in `parse_supported_format'

Huh? That doesn’t make any sense: HTTParty doesn’t have a built in JSON parser? What about the dependencies it just listed? Turns out that the second error is a result of the first failure.

3. Did some digging into multi_json docs, which are listed as a dependency. The first example in the basic doc is incorrect and I had to do a little tweaking.

SOLUTION

1. Fix your require statements at the top of your class:
require 'httparty'
require 'multi_json'

2. Inside your class or module,
include HTTParty
include MultiJson

3. Place this near your code, in a place where it’ll effect every function:
MultiJson.engine = :json_gem

Good luck. Drop a note and let me know if this worked / didn’t work for you.

No comments

Beautiful Earth

September 19th, 2011 | Category: geek out

“Science educator James Drake took 600 still photos from the International Space Station as it orbited the Earth, and created a fantastic time-lapse animation out of them. It must be seen to be appreciated; storms and cities fly past below in amazing clarity.”

 

from Slashdot. Turn to high-def mode and full screen for this gorgeous video!

No comments

Spicy Ketchup chez Raj!

August 27th, 2011 | Category: geek out

Hurricane Irene is here. Since we can’t hit the beach this weekend, spicy ketchup is finally on the menu!

I’m starting with this recipe from the food network:

Ingredients

* 3 pounds very ripe tomatoes, coarsely chopped
* 1 1/2 teaspoons vegetable oil
* 1 small onion, finely chopped
* 1 large clove garlic, minced
* 1/4 cup light brown sugar
* 1/2 teaspoon ground mustard
* 1/2 teaspoon ground ginger
* 1/4 teaspoon crushed red pepper
* 1/4 teaspoon cayenne pepper
* 1/4 teaspoon ground allspice
* 1/8 teaspoon ground cloves
* Pinch ground cinnamon
* 1/4 cup cider vinegar
* Salt

 

Start by buying the ripest, most delicious tomatoes you can find.

 

From Hurricane Irene

 

We got these from a farmer’s market on 14th and U street in Northwest DC. The tomatoes are delicious: we ate one of the heirloom tomatoes destined for the pot in about 30 seconds flat.

Next, chop them coarsely and blend them to a puree.

Pass the puree through a wire mesh strainer and into a bowl or pot.

Use a wooden spoon to mash the paste through the strainer until all that remains is the solids.

Finely dice a small onion.

And fry it up.

Now the cooking begins. It will cook down for over an hour.

And the final product!

So delicious. It is mildly spicy: I will use 3x the crushed red pepper next time. I had no cider vinegar and used ordinary vinegar instead and it added became a little too tart. But man it was good. My cousins came over last night and we put the ketchup on everything from edamame to dumplings.

it was awesome.

No comments

Next Energy Efficiency Project

August 25th, 2011 | Category: home improvement

Trying to pick my next home energy efficiency project. Melissa and I were supposed to go to the beach in Delaware this weekend but Hurricane Irene has thwarted our plans. I have a rainy weekend to try one of these:

1. Ceiling Fan in the guest bedroom. No more steaming while reading, and more comfortable for friends sleeping over

2. Solar Shades to keep the sun out and the place cooler (and let me sleep longer)

3. Home beer brewing. It takes soooo much energy to transport the beer from the brewery to me.

4. More motion detector light switches. Some of the lights turn off when you leave the room. Upgrade the rest of them.

 

Have to pick one, any suggestions?

3 comments

Installing a Thermostat controllable with Wifi

June 23rd, 2011 | Category: home improvement

I recently installed a Wifi Thermostat in my condo. A programmable thermostat is a must, for the following reasons:

  • Turn off the AC / Heat while you’re at work
  • Cool off the apartment before you return
  • Save a LOT of money

A lot of people leave their temperature at the same setting all day and night. This is a terrible waste of energy. It is much more cost effective to cool it when you are returning home, and to turn off system when you leave in the morning. It is hard to remember to do it manually, so a programmable thermostat is significantly better.

I decided to one-up the programmable thermostat and completely geek it out with a wifi thermostat that one can control from their computer, Android or iphone.

The thermostat of choice was this one:

CT30 Radio Thermostat

The CT30 from Radio Thermostat Company of America. Despite the cheesy 80′s sounding name which you may liken to other well known institutions like the Peanut Corporation of America or Yokogawa Corporation of America, this is a fine thermostat. The interface is well designed and the software is surprisingly good.

 

Installation

This thermostat was quite easy to install. You need to have a C-Wire in your condo, which is a 24V AC electric supply. It frequently comes from your HVAC unit directly. Most modern buildings have this wire. Our condominium, The Floridian, has a C-Wire ready to use.

Removal of the Old Thermostat

You should remove the old thermostat carefully. In case you find that your wiring isn’t up to snuff and you don’t have a C-Wire, you’ll want to put this back. I had a cheap, builders-grade digital thermometer with only two buttons. I kept it just to have a backup. It had some strange snaps in the back, but can be pried off with a flat screw driver:

Pry it off. It has two weird snaps holding it on:

Turn Off your CIRCUIT BREAKER!




Turn off the HVAC unit and any A/C Compressors you have. Hopefully they are on individual circuits and individually labeled. The C-Wire carries 24V of electricity and could give you a nasty jolt. It could kill your goldfish but is unlikely to kill you.

Prepare the new thermostat

Remove the old wall plate. Remove this carefully. In our condo, the builder had half-assed the job and hadn’t put any anchors into the wall. I also found out that there was a hidden aluminum junction box immediately behind the drywall which made it hard to add my own wall anchors. I highly recommend using molly bolts in drywall, otherwise any screws you install are apt to fall out with just a light tug.

Wiring and Mounting

Our building has a 5-wire system:

5-wire heat pump system with Auxiliary Heat

This means that a heat pump is used to raise and lower the temperature in the condo. When the temperature needs to be raised by more than 5 degrees, or the heat pump is malfunctioning for some reason, an electric Auxiliary heater kicks in as “emergency heat”. This heater consumes a lot of electricity and is expensive to run. Think about heating with a hair dryer. It is imperative to buy a thermostat that can have a meaningful relationship with the auxiliary heater.

Follow the instruction manual to wire it up and mount it to the wall using wall anchors. You may have to drill up to four small holes to install the wall anchors. They will help to keep the thermostat installed snugly against your wall. I was only able to install two wall anchors because of the pesky hidden aluminum junction box I spoke of before.

Final Product

Total Time: 45 Minutes

Total Cost: $130

Total Savings: $1m, at least. Per week.

In all seriousness, installing a programmable thermostat, even an ordinary one, will save you a lot of money on your energy bill. It will keep the apartment at your ideal temperature when you’re home, and at a more efficient temperature when you’re away. Don’t believe the myth that cooling your home all day while you are away is more efficient than turning on your AC 30 minutes before you come home. Nowadays, I can turn on the AC with my phone anytime I want.

4 comments

Next Page »