Illustration Friday :: Music Theme
November 25th, 2009 | Published in Uncategorized
November 25th, 2009 | Published in Uncategorized
November 24th, 2009 | Published in Uncategorized
… I would probably fail the class, but here’s one I’ve been working on anyways: By the Red Line.
November 13th, 2009 | Published in Uncategorized
In light of this administration’s push towards open data and transparency, the folks at the Massachusetts Executive Office of Transportation released a tremendous amount of data about the MBTA (Massachusetts Bay Transportation Authority).
One of the many efforts by the massDOT (Massachusetts Department of Transportation) group has been to create a development community around this vast amount of data, which you can read more about here.
I decided to answer their call for entries to a Visualization Challenge with a project I call A Day of MBTA.
I would love to hear your feedback.
October 28th, 2009 | Published in Uncategorized
August 10th, 2009 | Published in Uncategorized
July 6th, 2009 | Published in Uncategorized
We’ve recently had to deal with a large string issue, that was just killing our server. It was fairly infrequent, but when it happened, it would just grind everything to a screeching halt. In searching around the webs, I came across this amazing bug report that should have really gotten more attention than it did. Although it’s 120 days old, I still feel it’s important to point it out.
There are two ways to concatenate strings in ruby:
a = "this" # Way 1: a += " and that" # Way 2: a << " and then some"
Both would really result in the same outcome EXCEPT the minor detail that += generates a new string EVERY TIME it is called whereas << destructively overwrites the existing string. This appears to be a non issue for small strings but for large strings, it's clearly a deal breaker.
Here are some great benchmarks thieved from the bug report to illustrate the issue:
~ $ time ruby -e 'a = "A"; 100000.times { a << "A" }'
real 0m0.444s
user 0m0.428s
sys 0m0.016s
~ $ time ruby -e 'a = "A"; 1000000.times { a << "A" }'
real 0m1.760s
user 0m1.740s
sys 0m0.020s
==========Now the same tests with +===========
~ $ time ruby -e 'a = "A"; 100000.times { a += "A" }'
real 0m15.284s
user 0m15.197s
sys 0m0.068s
~ $ time ruby -e 'a = "A"; 1000000.times { a += "A" }'
^C-e:1: Interrupt
from -e:1:in `times'
from -e:1
real 5m8.497s
user 4m59.915s
sys 0m4.844s
I just love learning these little incredibly important details, if you've got any like it, do share!
June 27th, 2009 | Published in Uncategorized
I didn’t have a great idea for this week, but while listening to Dodo by Dave Matthews in the car, I had an image of this very sad dodo bird realizing she was all alone…
The lyrics for reference:
When was it killed
The very last dodo bird
And was she aware
She was the very last one
April 30th, 2009 | Published in Uncategorized
I’ve been playing around with Solr at work for a project I am working on, and figured it might be beneficial to others to post some of the install pains I’ve experienced with Tomcat 6. If you are using Tomcat 5, then this guide might work for you. It is not accurate for Tomcat 6 however.
A Bit of Background:
Solr is an open source enterprise search server based on the Lucene Java search library, with XML/HTTP and JSON APIs, hit highlighting, faceted search, caching, replication, a web administration interface and many more features. It runs in a Java servlet container such as Tomcat.
Install Steps:
Here are the install steps more or less that I went through (on OSX, although that shouldn’t matter too much):
Solr:
1. Download your Solr binary, I got version 1.3.0 from here.
2. tar xzf it to your working directory, something like /usr/local, or /opt/local. Make sure you chown the resulting directory to the proper owner.
Tomcat (If you already have Tomcat running, skip this step):
1. Download your tomcat binary build. I got version 6.0.18 from here.
2. tar xzf it to your working directory, something like /usr/local, or /opt/local. Make sure you chown the resulting directory to the proper owner.
4. There are two env variables that are required for Tomcat to run: CATALINA_HOME and JAVA_HOME. I made a couple of scripts to start and stop tomcat where I set those. The scripts look something like:
#!/bin/sh export CATALINA_HOME=/opt/local/apache-tomcat-6.0.18 export JAVA_HOME=/usr $CATALINA_HOME/bin/startup.sh
and
#!/bin/sh export CATALINA_HOME=/opt/local/apache-tomcat-6.0.18 export JAVA_HOME=/usr $CATALINA_HOME/bin/shutdown.sh
Don’t forget to make them executable:
chmod ug+x yourDir/start_tomcat yourDir/stop_tomcat
Solr+Tomcat: This part may be the most important one for actually getting solr to work with Tomcat
1. Copy from your SOLR_HOME_DIR/dist/apache-solr-1.3.0.war to your tomcat webapps directory: $CATALINA_HOME/webapps/solr.war – Note the war file name change. That’s important.
2. Create your solr home directory at a location of your choosing. This is where index data will be held and where the configuration for that solr install resides. I have it in a completly separate location on my file system so it was important for me to be able to do that. The easiest way to do this is to copy the SOLR_HOME_DIR/examples/solr directory to wherever it is you want your solr home container to be.
3. Start tomcat. Note this is only necessary to allow tomcat to unpack your war file. If you look under $CATALINA_HOME/webapps there should now be a solr directory.
4. Stop tomcat.
5. Go into that solr directory and edit under WEB-INF/web.xml. Scroll down until you see an entry that looks like this:
<!-- People who want to hardcode their "Solr Home" directly into the
WAR File can set the JNDI property here...
-->
<!--
<env-entry>
<env-entry-name>solr/home</env-entry-name>
<env-entry-value>/Path/To/My/solr/Home/solr/</env-entry-value>
<env-entry-type>java.lang.String</env-entry-type>
</env-entry>
-->
Uncomment that env-entry and change the env-entry-value to point to wherever it is you copied that solr home from the example dir in step 2.
6. Start Tomcat again, and things should be going splendidly. You should be able to verify that solr is running by trying the url http://localhost:8080/solr/admin/.
Enjoy.
April 28th, 2009 | Published in Uncategorized
April 22nd, 2009 | Published in Uncategorized
I really liked this drawing but ended up going with this one as an entry.
I’ve never had a cat, but if I did, I bet I couldn’t get it to jump through a hoop unless it felt like it =).