New Year, New Interests and moving on from old projects

Posted by Jeremy Gillick on 17 Feb 2011 10:06 pm in Miscellaneous

So it’s the second month of the new year and a lot has happened. I notice that my last post is over a year old and is a great indicator to where my mind has been. Over the last two years I have been focusing more on my life and extracurricular activities than my blog and technical projects. It’s been an exciting ride and continues.

First off, I think it is high time that I officially announce that I will no longer be maintaining my mozilla extensions. This will come as no surprise as I haven’t been doing anything with them in the last few years. My arm has been twisted into this reality as the hosting company of my extensions seemed to loose my website and everything on it. The code for them is still publicly available on my SVN server (which will be moved to github at sometime in the future).

On to the new interests. Two years ago I decided to get back into shape and through diet and a dedicated workout routine I lost ~30lbs in about 3 months. I have continued my routine and in August became part of CrossFit Mountain View. A big part of this transition was learning how to cook food that is delicious, healthy, and now paleo. So many of my friends have asked me for my recipes and tips that I finally decided to start posting it all online!

So, without further ado, I present my new fitness blog: *drum roll* The Tough Banana!

It’s brand new and I’m still working on the content, design and templates. Check it out and feel free to provide suggestions.

Not to worry, I’m not killing this blog, I’m just checking in and letting you all know what I’m doing. I’ll update this one as it’s relevant.


Climbing Mount Shasta — Part 2

Posted by Jeremy Gillick on 27 Nov 2009 03:25 pm in Insipiring & Travel

This is a follow-up to the post I wrote last year with a lot of new information I learned from my last two climbs. Be sure to read the original post first to get a good overview about the mountain and the route.

The Tale of Two Trips

My plan was to attempt to climb Shasta twice in one week in May, with a few days in between to recover. It didn’t go entirely as well as I had planned, but I did learn a lot. Here’s how both trips went.

Trip 1

Note: The events in the first trip are not representative of a common climb up Shasta, but the risks are present. Be prepared and wear a helmet.

The first trip was with my friends Tracy and Karen and we decided to do a three day journey starting with the first night at horse camp, to acclimate to the elevation, and then to base camp at Lake Helen the next day. Summit morning was extremely difficult; there was ~40mph winds up at Red Banks, which kept dusting the climbers with snow and once in awhile pelting small ice balls at them. About an hour into the climb, at a 15 steps and stop pace, Karen started feeling hypothermic and couldn’t go any further. I told Tracy to keep going and I’d walk Karen back down to base camp and then catch up. After getting Karen into the tent and making sure she would be okay, I started back up the mountain, now at a ~35 steps and stop pace to catch up.

Before I caught up to her, and on one of the steeper parts of the ascent, I heard a climber up ahead yell “rock!” and everyone around me, including myself, dug our ice axes into the snow and crouched into safe fetal positions on the snow. About 3 second later I felt a medium size rock slam into my body. For the first few moments I went into shock and everything was a little slower and I was a bit dizzy. I went through the mental checklist: can I move my toes? Check. Am I still awake? Check. Still holding onto my ice axe? Check. I was lucky that the rock hit me square on the butt cheek, otherwise it could have been a much more serious issue.

After I composed myself and was sure that there weren’t any more falling rocks, I got up and caught up to Tracy close to Red Banks (see picture above). We continued over the ridge and started hiking up the next hill. The wind was insane and I was exhausted from trying to catch up to Tracy, not drinking/eating enough and still mentally recovering from the incident with the rock. Tracy’s was determined, but her camelback hose has froze and she had not been drinking or eating enough either. At that point I realized that getting to the summit and back to base camp wouldn’t be safe and we needed to turn around. (we weren’t even to Misery Hill yet) It’s always important to put the safety of the group ahead of hitting the summit. The mountain will still be there next year.

Trip 2

A few days later, with a huge bruise on my ass, I attempted the mountain with my Dad. The conditions couldn’t have been better — calm skies, no wind to worry about and a few clouds to keep base camp cool from the midday sun. We did the standard two-day trip, with one night at Helen Lake, and we were able to hit the summit without a hitch.

Training

Before you attempt the mountain be sure to do the proper training so that you can complete it safely. Last season I trained too hard, too fast and didn’t balance my muscle groups, which led to a bad back injury and a trip to the ER for a mild vasovagal episode from the pain. To prevent this, make sure when you work one muscle group at the gym you also build the opposite group. For example, if you are building your pectoral muscles (pecs), make sure you spend as much time on your shoulders (bench press followed by seated rows). When working your abs also strengthen your lower back. Do slow, clean reps and watch your form. If you don’t do this, you will injure yourself!

Another good way to train is to find some good difficult hikes around your area and notice which muscles are weak on the hike and sore the next day. Those are the muscles you’ll want to strengthen at the gym. If you find that your calve muscles get tired easily or are really sore the next day, make sure to concentrate on building those muscles between hikes. Keep doing this until your entire body feels strong during and after the hike. In the San Francisco Bay area I’ve found that Mission Peak is a great mountain to train on. Whichever trail you pick for training, make sure it has a decent elevation gain. For example, Mission Peak has about 2000 feet elevation gain.

Caffeine

Another good trick that I tried before Shasta was to give up coffee three weeks before the climb. This lowered my tolerance to caffeine so that when I had coffee the morning of the climb and in food supplements like Gu it was far more effective. In fact, I don’t remember the last time I had that much energy. When we reached base camp, after a full day of hiking, we still had the energy to build a large snow shelter, complete with walls.

My Dad did the same caffeine trick, so when we got to base camp on my second trip, we went to work improving the snow shelter with bigger walls and a breakfast nook. Not bad at 11,000 feet.

Altitude

One way to counter the affects of the high altitude is to get a prescription for Diamox, which you’ll need to start taking at least 24 hours before the climb. The standard dose is 240mg, which can cause you to urinate a lot, but studies show that taking 125mg (basically cutting the 240mg pill in half) is just as effective.

Here’s more information on altitude sickness, prevention and acclimation:
http://www.princeton.edu/~oa/safety/altitude.html

Talk to the rangers

The conditions on the mountain change daily and the rangers can alert you to things to look out for. Always talk to them and take their advice to ensure a safe trip. When you get your wilderness pass at the ranger station in town, ask them about the mountain, the climb, weather conditions and to show you their short mountain presentation.

When you’re on the mountain, make sure you ask similar questions to all the rangers you pass. Here’s a list of handy questions to ask:

  • What are the current conditions like?
  • Any avalanche dangers?
  • What should do I do if:

    • I get caught in an avalanche?
    • Someone yells “rock”?
  • What is the best route up avalanche gulch?
  • What should be our absolute turn around time on the summit ascent?
  • How’s your day? Can I buy you a beer when we get off this mountain?

If you’re nice to the rangers, they’ll take care of you!

Pacing yourself

A lot of climbers will be tempted to push themselves as long as possible between breaks, but on the steep terrain and high altitude, this will wear you out really quickly. A good technique is to figure out an attainable number of steps between breaks and stick to it. When I was going up Red Banks my pace was about 35 steps per 15 - 30 second break. When we were on Misery Hill we adjusted it to 15 - 20 steps. Be sure to use some of your breaks to hydrate and consume solid nutrients, like Gu or trail mix. Counting off your steps will also give you something to concentrate on and off of how it looks like you’re not making any progress.

Turn around time

Hitting the summit is the goal of all the climbers on the mountain, but getting a late start or not turning around early enough can be dangerous. As the sun comes up and warms the mountain, it’ll turn nice solid ice to squishy snow and slides. It can make your decent more difficult and, at the worst, it can open up small crevasse or cause avalanches. Be sure to decide on an absolute turn around time for your ascent. If you don’t hit the summit by this time, you turn around — no exceptions. Ask the rangers what the turnaround time should be considering the current conditions. Ideally you should be back at base camp before noon.

Equipment

The number one piece of equipment you should have is a helmet! You can rent one pretty cheap at The Fifth Season in town. Many climbers will think they don’t need one, but if I didn’t have one and the rock had hit me on the head, I would have been dead. There’s no question about that. If that doesn’t convince you, last year climber died on the Avalanche Gulch route because she was not properly prepared.

Make sure the rest of your equipment is fitted right for you and balanced in your bag. Ask the friendly people at the sporting good store to help you with this. Wearing a backpack that is not fitted for your height and size will easily injure your back. Get your back measured so you can get the right size pack.

If you’re not carrying skis and there’s snow at Bunny Flats, be sure to rent snow shoes for the decent from base camp. Otherwise, you’ll be “post holing” (i.e. your feet will sink into the snow about a foot or more with each step) all the way down to your car and you shoes will be filled with freezing water.

Planning for 2010

For 2010, we’ll be trying a different approach on the ascent to base camp, we’re going to ski up! This is called Ski RandonnĂ©e, or Alpine Touring, in which you wear skis with specially designed downhill-like bindings that allows you to ascend like cross-country skis. Attaching a special fabric to the bottom, called climbing skins, prevents the skis from slipping backwards when you are going uphill. Then when you pack up base camp you remove the skins, clip down and ski all the way to your car.

Split Button Form Control

Posted by Jeremy Gillick on 15 Mar 2009 12:28 am in Code & Technical

A split button element is a submit button with a built-in menu of actions. My goal was to create a split button form control that is both semantic and accessible.

Stylized controls, like this, should only be used when there is a solid reason to do so. In general the default browser controls work fine and provide a pattern that users are familiar with. For certain situations, however, it is useful to provide a simple way to choose a single action using stylized controls.

Split Button HTML

<script type="text/javascript" src="splitbutton.js"></script> <p class="splitButton"> <select name="actions" id="actions" title="Choose Action"> <option>Send Message</option> <option>Flag</option> <option>Chug Pixie Stick</option> </select> <input type="submit" value="Go" /> </p>

This will create a split button with 3 options and the default button name will be “Choose Action” (see example above). The key elements here are:

  • A surrounding element with the splitButton class.
  • A select element with an optional title attribute.
  • A submit button.

If the select element has a title attribute, that text will be used as the default button name; otherwise, it will use the first (or selected) option as the button name.

When an action is selected the JavaScript will send a click event (via the click() function) to the submit button element in order submit the form.

The menu is also accessible with the keyboard. When you bring focus to control, the menu will open and you can use your arrows to select an option. Pressing ESC will close the menu.

Dependencies

This code uses YUI 2.6 with the Selector beta library and can easily be ported to jQuery or any other framework.

Download

Split button

Usage

You are free to download, modify and use this code anywhere you want. There are no restrictions.

I don’t want to miss a single life experience — even death

Posted by Jeremy Gillick on 11 Jan 2009 02:14 pm in Life & Miscellaneous

I’m the type of person who loves to learn and experience new and different things whenever I can. My Parents have always shown me how exposure and experiences can enrich your life, and often times the more awkward or uncomfortable it is, the more you get out of it.

For example, recently I had a few days where I was going through some real depression; the cause of which is another story which I’m sure I’ll write about in the near future. Having depression felt odd since I’ve never really experienced depression before and have always been good at regulating my emotional state. This is how my mind processed the experience:

“Hmmm, this is a new feeling. Kind of different.”
“I think it’s depression…yup, I’m entirely sure it’s depression.”
“It’s an odd new feeling.”
“I have decided I don’t like it much.”
“Okay, I know how to deal with this, I will now decide to be happy!”
“Hmmm, I’m still feeling depressed, that didn’t work very well.”

Simply deciding to be happy didn’t help as much as it usually does, but instead, I eventually went for a hike where I meditated and later enlisted the support of friends. I let the feelings wash over me and they were gone in a couple of days.

Being depressed made me feel completely tired, sad and the need to be around people but somehow despised the thought of being around people. The contradiction alone was enough to keep my mind busy for awhile to sort it out.

After the fact, I find it funny that I was so intrigued by this new feeling and experience.

The Death Experience

A couple years ago the thought of death became my greatest fascination — and fear. It was brought on by some very bizarre dreams I had, where in them, I died. At first it was disturbing, and then it became something of a mental obsession.

I am a spiritual person and was raised Catholic (although, not currently practicing), so I posed this question to myself: “What if there is no after life? What happens? What’s it like?” That became a riddle for me to unwind; similar to asking about the meaning of life. The vision of nothingness appeared to me like an empty black void. “What is is like to not exist?”

That’s a hard question to answer because, well, existing is practically all I do.

The other part of the question was, “What is it like to die instantly?” The thought of being alive one moment and not the next without being aware of it, scared me. But why? It’s not like it’ll matter much after I’m dead. I wont know that I’m dead, so why should it matter that I know I’m about to go?

Sometimes I pose this question to friends and they usually say they would rather not know and just die instantly or in their sleep. This still bothers me.

I finally realized why — I want to know what it’s like to die. I want to be able to embrace that final life experience before I head off into the great unknown. (as ironic as that is) Somehow I feel that if I miss it, then I have missed one of life’s greatest, and last, experiences. Some of you reading this probably think that’s pretty sick. I’m okay with that.

Conclusion

For those of you who are afraid this is the prologue to a suicide letter, fear not. There are still too many experience I have not had to end this ride short. I expect to live my life long and full until I die at a very old age.

Maybe I’ll be that old guy who interrupts your conversation at the coffee shop to bore you with off color Irish jokes (”What’s the difference between an Irish wedding and an Irish wake?”) or tails of grand things I [never] did. Yes I’m sure I’ll be that guy. Oh the stories I will tell.

Climbing Mount Shasta

Posted by Jeremy Gillick on 09 Jan 2009 06:32 pm in Events & Insipiring & Travel

UPDATE: I’ve written a follow-up post which contains a lot of new information and how my two 2009 trips went.


As 2009 rolled around I decided that this would be a great year to go backpacking up Mount Shasta again. I have attempted the mountain twice in the past and topped out (i.e. reached the summit) once. This year I’m organizing a group trip, which is why I’ve started planning so early and the reason for this post. Here I will outline my experience with the mountain and what to expect.

Not all the pictures I’ve included are mine. Here are the pictures from my Shasta trips in 2001 and 2002.

Mountain Stats

Location
Northern California (near the Oregon border)
Elevation at the top
14,179 ft
Trailhead
6,920 ft
Elevation Gain
7,259 ft
Trail Distance
~ 6 miles (averages to about 1,000 feet elevation gain per mile)
Nights on trail
1
Best time of year to climb
May to Mid July

Overview of a standard trip

Typically the climb and decent will take two days, although, some people do it in one.

Day 1 starts with a 4 - 6 hour hike from the parking lot up to Helen Lake (which is really just a glacier) where you setup base camp. The rest of the day is spent admiring the view, making food (yay, dehydrated meals!) and preparing your day pack for the next morning.

The summit ascent begins somewhere between 12 AM - 3 AM the next morning. You’ll want to start as early as possible, while the snow is still firm and solid, and get to red banks before the sun starts making it soft and slushy.

When you reach the summit stop to enjoy the view, regain your energy and prepare for the best part of the journey — glissading down the mountain! This literally means you will sit on your butt in the groove created by the people before you and slide down the entire mountain; stopping briefly at base camp to collect the rest of your gear. Not to worry, you will have your ice axe with you as a safety device that will help you regulate your speed down the mountain. Think of it as your hand brake.

So that’s it, 2 days to get to the top and and 3 - 4 hours down.

My First Attempt

Now that you know the basics, here are my experiences.

As long as I can remember my father has been telling me the story of when he was young and climbed Shasta with his friends from school. It always sounded like an exciting adventure and in 2001 I invited him to climb it with me. He spent months preparing. Hired a personal trainer, lost a lot of weight and really got prepared for the trip. I was 20 years old and thought I was in perfect shape and wouldn’t need to train or do anything to prepare. I mean, I’ve done hikes before, I went biking regularly, how hard could it be? That was my first mistake.

Our second mistake was to attempt the mountain sometime in August or September. At that time of year much of the snow has melted at the base of the mountain and you have to traverse up loose volcanic scree all the way to base camp. It was miserable, and I was seriously lagging behind my Dad.

The next morning we decided not to attempt the summit since the snow was melting and could cause falling rocks. And I was still exhausted from the day before.


My Second Attempt — Success!

The following year we decided to attempt it again with a better understanding of how to approach it. I was 21 years old now, so a lot wiser and as a bonus was legal to drink! (although that has nothing to do with the story)

This time I started training about 2 months prior to the climb by going to the local high school 2 or 3 nights a week and running the bleachers. That made all the difference in the world.

We also decided to go in June, so the snow on the mountain was almost at the trail head. This helps considerably by giving you enough traction to hike straight up the mountain without a lot of traversing.

We got to Helen Lake and the next morning started the ascent around 12 AM, while it was still dark. With our headlamps turned on and crampons on our boots we began the steep hike to the summit. The closer we got the thinner the air became. With the summit in view I would take about 5 to 10 steps and need to stop for a short break.

Reaching the top was extremely rewarding and provided a view that was worth every minute of the climb. It’s beyond description and pictures can’t come close to capturing it; you’re at the top of the world. From there you can look down at the giant shadow the mountain casts on the rest of the valley. In fact the entire hike provides scenic views you wont experience anywhere else.

Last leg of the hike to the summit
My dad and I at the summit

Equipment

Most of the equipment you need can be rented. I would recommend buying a pair of comfortable boots that can easily be hiked in and support crampons. You’ll need an ice axe for safety, although there isn’t any vertical climbing along the route. Here’s a list of a few of the things you’ll need:

  • 2 Backpacks: One to carry the supplies for base camp and a small day pack to carry to the summit.
  • Warm clothes: Wearing layers is a good idea.
  • Hiking boots that can support crampons.
  • Ice axe. (rent)
  • Helment: Optional, but a good idea. (rent)
  • Tent: Light and made for snow and wind.
  • Sleeping bag: Mummy bag made for backpacking and rated for very cold weather (-30° F).
  • 2 Telemark poles: These are fancy hiking sticks.
  • Camp stove and cooking supplies.
  • Water filtering device. (You’ll be filtering melted snow for water at base camp)

If you go to a good mountaineering shop they can help you pick out the right equipment and definitely try to rent what you can.

Boot and crampons

Training

Depending on your current fitness level, you’ll want to start training at least 2 months before the hike. I found that running up and down bleachers at a local high school football field worked really well to prepare for the hike. The key is to work on your core muscles for the pack and your legs for the hike.

The best core exercise you can do is the “plank” and “side planks“. Do these 3 - 5 times a week.

For legs, I’ve found that doing stairs and stepper machines is a great way to train. For a little more of a challenge, stand in front of a bench with weights in your hands and step up on it and then step down. Alternate legs each time and don’t let your knees move beyond your toes during the movement.

Learn More

The Siskiyous EDU site has a great virtual tour of the climb, including an description of each leg of the journey with an elevation profile diagram.

The book we used to prepare for Mount Shasta trip was Climbing Mt. Shasta: Route 1 by Steve J. Lewis. This book has everything you need in a simple, easy to follow format. Many websites will try to scare you with how dangerous the hike is. While it’s true that any backpacking trip can be dangerous, if you have some common sense and prepare appropriately Shasta is a pretty safe trip.

For fun you can view the Shasta Cam to get a live view of the mountain.

Looking out at the valley from the top

UPDATE: I’ve written a follow-up post which contains a lot of new information and how my two 2009 trips went.

The Chicken, the Egg and Facebook — The required “5 users”

Posted by Jeremy Gillick on 13 Nov 2008 08:35 pm in Miscellaneous

At MixerMixer we’ve created a Facebook application but cannot submit it to the Facebook application directory because the app must “have at least 5 users” before it can be submitted. Okay. So I try to share the app with friends, but they don’t get the message because the app is not in the application directory yet! It’s a catch-fucking-22.

All the Facebook documentation says is “It must have at least 5 users”, but nowhere does it explain how to get 5 users to install an app that is not published yet. Damnit Facebook, complete your documentation!

Perhaps I shouldn’t have had a few drinks before attempting to complete the process. :)

I’ll update this post when I figure out how to get those 5 elusive users.

Ganzbot: An Arduino robot who reads Twitter

Posted by Jeremy Gillick on 18 Aug 2008 09:03 am in Electronics

This funny little robot has eyes, eyebrows and a mouth and will verbally read your latest Twitter status to you. It uses an Arduino Decima to control the head actions and receives the latest Twitter status information over USB from a host computer.

For those who don’t know, Twitter is a micro blogging tool where users announce what they’re doing with 140 characters or less. (see Twitter in Plain English)

You can also send the robot something to say directly from the command line with a few Ganzbot moods to choose from. More information after the videos.




Steve’s Reaction

Background

A couple months ago a few people at LinkedIn decided to create a Twitter account called “Ganzbot”, named after Steve Ganz, as a joke. Then when Steve left to compete in the PDGA World Championships we decided to build a “real” Ganz Robot to occupy his cube when he returns.

How it works

At a high level, there is a Java program on the host computer which retrieves the latest Twitter status, passes facial and word data to the head and then speaks the Twitter status through the computer speakers using FreeTTS, an open source Java text-to-speech synthesis library. I would have liked to put a speech synthesis chip in the head instead, but didn’t have the time.

LED Lips — how to make them talk

Getting the LED lips to be synchronized with the words was a bit tricky. Unfortunately FreeTTS doesn’t implement 100% of the JSAPI, so when it’s speaking there is no way to know when one word ends and another begins. Instead, the Java program on the computer splits up the text into individual words, sets the volume to zero and speaks each one to figure out how long it takes to say. Then the program passes the word times to the head and starts speaking the entire sentence with the volume at the normal level. The lip synchronization isn’t perfect, but it’s pretty good.

Another option might be to light up the LED lips from an audio spectrum analyzer.

Circuit

To keep it simple I took a standard perf board from Radio Shack and added header pins to turn it into an Arduino shield. This makes it really easy to connect it to the Arduino and ensures all the pins are in the correct sockets. The circuit below was created to show the pins and voltage source as they appear on the board. More details on the circuit after the diagram.


Circuit Diagram

Download circuit schematic

Transistors

Unfortunately there wasn’t enough juice coming from the Arduino chip to power the LEDs very bright, so I had to use standard NPN transistors to feed the LEDs power directly from the board.

Lips and Eyes

I only included half of the lips and eyes in the circuit diagram since the other halves are simply connected in parallel and I didn’t want to clutter it up. I’m sure you can figure it out. If you have trouble, leave a comment below.

Eyes

The eyes are simple multi-color LEDs I picked up from Radio shack. They can output red, green and blue, but the Ganzbot only uses red and blue. The longest pin is positive and the color depends on which pin you put to ground. I suggest testing it on a breadboard before soldering it into place.

Software

On the host computer a Java program retrieves the Twitter information (or command line message) and sends the word times to Arduino over the USB cable. All the robot needs to know is the mood it should be in (neutral, sad, angry) and how many milliseconds each word takes the speech synthesis program to say. If the program is started in “-twitter” mode, it’ll continue checking Twitter for updates every 2 minutes until you stop it.

Download

Go to the download section.

Requirements

OS: Any
Java: version 1.5 or greater

I compiled the program using Java 1.5, so as long as you have version or greater you should be able to use it out of the box. If not, you can simply compile the app to your version Java (see the Build section below).

Libraries

The GanzBot program relies on the following libraries, which are all included in the download:

Build

To build the Ganzbot source code you first need to install the Apache Ant build tool. Then go into the “src” directory and simply run “ant”. It should take care of compiling both Ganzbot and JSON and placing their Jar files in the correct locations.

FreeTTS comes precompiled from Java 1.4. If you are using an older version of Java you’ll need to download their source code and build it manually. Once completed put the jar files it created in it’s lib directory in the Ganzbot lib directory.

RXTX is the same as FreeTTS and comes precompiled. To compile it to another OS or version of Java, follow the instructions on their wiki.

Installer

In the download I’ve included an “install.sh” script that will install the RXTX library and Mac USB drivers that are needed to communicate with the Arduino. The installer is specific to Apple and wont work on other operating systems. The simplest way to make it work on other systems is to install the Arduino software. Otherwise you can always install RXTX and the FTDI USB/Serial driver manually.

Running the Program

  • To run the progam start by plugging in the Ganzbot and then open up a command line terminal.
  • In the command line, go to the place you downloaded and extracted the program.
  • For a simple “Hello World” test type java -jar ganzbot.jar "Hello World" (be patient, It might take awhile to process)

If the program gave you an error, it’s likely because it doesn’t know which USB/Comm port that the Arduino is plugged into. It should list the available ports you can choose from in the error message. Then run the command again with the “-port” flag, like this:

java -jar ganzbot.jar -port '/dev/tty.usbserial-A6004oQf' "Hello World"

For windows you’ll probably use something like “COM1″ instead of the “/dev/tty…” string.

You can also type java -jar ganzbot.jar -help for more options.

Reading Twitter

To speak a Twitter status message enter a command like this (where jgillick is the twitter user) :

java -jar ganzbot.jar -twitter jgillick

Ganzbot wont read the same twitter message twice. The program saves the last tweet ID in a file called “.tweetid”, remove this file to have it say the last Twitter message again.

Moods

Ganzbot can be a bit moody sometimes. To define the mood he should speak in, add the mood text to the very beginning of the message. Here are a few examples:

  • “[angry]I am very angry right now. Destroy, Destroy.”
  • “[sad]When I’m sad I whine alot.”
  • “I am not angry or sad, for I am a robot.”

Rails Application

For fun I also created a super simple rails application that let anyone queue up messages to be spoken instead of using Twitter. If the Ganzbot program is in Twitter mode it’ll automatically check that queue if there isn’t a new Twitter status message. The app is hardcoded to look at http://localhost:1024/ for the queue. You can change that in GanzBot.java if you need.

In order to run the web application you first need to make sure you have both Ruby and Ruby on Rails installed. Then download the package (see download section), extract it and run the following from the command line in the “GanzbotRails” directory.:

./script/server --port 1024

This will start the server and put your Ganzbot queue at http://localhost:1024.

Downloads

Ruby on Rails: Hash#Except and Converting Arrays to Args

Posted by Jeremy Gillick on 21 Jul 2008 10:32 pm in Code

Tonight I was working on rewriting the event creation flow for MixerMixer, the social event community I’ve been building, and couldn’t figure out why the Hash#except method wasn’t working.

My goal was to exclude users who were already invited to the event so they wouldn’t be reinvited when the user edits it. So I have 2 hashes: one with the users that are selected and the other with the users who have already been invited to the event. Should be simple:

# Hash format: user_id => user_id
# current_invites = { 567 => 567, 890 => 890}
# selected_invites = { 123 => 123, 567 => 567, 890 => 890}

add = selected_invites.except(@current_invites.keys)

# Should return { 123 => 123 }
# It actually returns { 123 => 123, 567 => 567, 890 => 890}

As you can see, it returns the full hash and doesn’t remove anything. This will not do.

It tuns out that I missunderstood the Rails documentation. Hash#except doesn’t take in an array of keys to remove it takes in a list of arguments. Here’s a simple example:

add = selected_invites.except(567, 890)
# Returns { 123 => 123 }

Now I needed to figure out how to convert the @current_invites.keys array into an argument list. It turns out to be as easy as adding an asterisk in front of it:

add = selected_invites.except(*@current_invites.keys)
# Returns { 123 => 123 }

Success!

Enjoy.

TinyUrl 2.0 supports multiple services

Posted by Jeremy Gillick on 15 Jul 2008 10:24 pm in Extensions

One of the most requested features for the TinyUrl Creator extension is to support other URL shrinking services like bit.ly and is.gd. After some dedicated research and development I have been able to add the following seven URL shrinking services to the latest version of TinyUrl (v2.0):

To change the service you’re using click Tools > Options and select the service from the dropdown list.

If you prefer another URL shrinking service and would like it to be added to this extension, leave a comment here to let me konw. Be sure to check if the service has an API, because if they don’t the extension will have to resort to screen scraping; which is pretty ugly.

Install TinyUrl Creator

Thanks for all your support.

New Feature in the TinyUrl Creator Firefox Extension

Posted by Jeremy Gillick on 14 Jul 2008 11:46 am in Extensions

Along with upgrading all my extensions to work in Firefox 3 I also added a new feature to the TinyUrl creator extension: Link Preview.

Now the extension will find all links which have a tinyurl.com address and add a tooltip to tell you what the actual URL is. Simply hover your mouse over the link for a moment and the tooltip will appear with the full URL. Here’s an example:

TinyUrl Creator with Link Preview

I can’t actually take full credit for this idea, last month my friend Stephanie Trimble suggested it over twitter. Thanks Stephanie for the idea!

I also plan to add support for other URL shrinking services in this feature. Please post a comment here with your favorite URL shrinking service so I can be sure to add it to the list.

You can install the extension from this page: http://mozmonkey.com

As always, I really appreciate the support of my users. Thanks.

Next Page »