<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">

 <title>Dave Dash</title>
 <link href="http://davedash.com/atom.xml" rel="self"/>
 <link href="http://davedash.com/"/>
 <updated>2012-01-17T21:54:19-08:00</updated>
 <id>http://davedash.com/</id>
 <author>
   <name>Dave Dash</name>
   <email>dd+atom1@davedash.com</email>
 </author>

 
 <entry>
   <title>Naming things and a recursion</title>
   <link href="http://davedash.com/2012/01/05/naming-things-and-a-recursion/"/>
   <updated>2012-01-05T00:00:00-08:00</updated>
   <id>http://davedash.com/2012/01/05/naming-things-and-a-recursion</id>
   <content type="html">&lt;p&gt;Most Mozilla webdev projects have an awful project structure, and it's
partially my fault.  I'm &lt;a href=&quot;https://github.com/mozilla/playdoh/pull/67&quot;&gt;attemtping to fix that&lt;/a&gt;, but I
cringe every time someone creates a new &lt;a href=&quot;http://playdoh.rtfd.org/&quot;&gt;playdoh&lt;/a&gt;
(Mozilla's Django template)
based project.&lt;/p&gt;

&lt;h3&gt;The typical python project&lt;/h3&gt;

&lt;p&gt;Your typical python project looks like this:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;/my_project
    someotherstuff/
    docs/
    theactualthingicareabout/
    setup.py
    LICENSE
&lt;/code&gt;&lt;/pre&gt;

&lt;h3&gt;MOZtrosity&lt;/h3&gt;

&lt;p&gt;We didn't have a good guide when we first started writing Django projects, so
we opted for something like this:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;theactualthingicareabout/
    apps/
        foo/
        bar/
    __init__.py
    urls.py
    settings.py
    LICENSE
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;In otherwords, the Django Project, which is a python module, is immediately
checked out.  If you check this out to an invalid directory, e.g. you do something like:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;git clone github.com/davedash/myawesomeproject.git will.not.work\!
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Bad things will happen.&lt;/p&gt;

&lt;h3&gt;So?&lt;/h3&gt;

&lt;p&gt;To some people this seems like an easy thing to work-a-round, but when it takes
three of my excellent coworkers a week to diagnose an issue, where this ended
up being the root cause...  well it becomes a higher priority issue.&lt;/p&gt;

&lt;p&gt;So here's what happened this week, when we tried to deploy
&lt;a href=&quot;https://github.com/mozilla/lumbergh/&quot;&gt;the new careers site&lt;/a&gt; to a VM hardware.&lt;/p&gt;

&lt;p&gt;Our ops team sensibly checked out the project like so:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;git clone https://github.com/mozilla/lumbergh.git careers
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;They did everything right.  Sure, they were creative and chose &lt;code&gt;careers&lt;/code&gt; over
the default &lt;code&gt;lumbergh&lt;/code&gt;, but they knew the shortcomings of our system and picked
a name that would resolve as a valid python package.&lt;/p&gt;

&lt;p&gt;Unfortunately we'd hit some &lt;em&gt;recursion error&lt;/em&gt; anytime we tried to hit a URL.
So we knew there was an issue with the URL resolver, but we couldn't figure it
out.&lt;/p&gt;

&lt;p&gt;Here's what the project layout looked like:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;careers/ # I could be called anything, but they chose careers
    __init__.py
    apps/
        careers/  # I'm going to cause problems,
                  # but neither devs nor ops will suspect a thing! mwahaha
            __init__.py
            models.py
            urls.py
            views.py
    settings.py
    urls.py
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;other files.&lt;/p&gt;

&lt;p&gt;We configure our &lt;code&gt;apps/&lt;/code&gt; directory to be part of our &lt;code&gt;PYTHON_PATH&lt;/code&gt; so we can
do things like &lt;code&gt;from careers import views&lt;/code&gt;... you can probably see where this
is going.&lt;/p&gt;

&lt;p&gt;Here's the main &lt;code&gt;urls.py&lt;/code&gt; &lt;a href=&quot;https://github.com/mozilla/lumbergh/blob/master/urls.py&quot;&gt;1&lt;/a&gt;:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;...
urlpatterns = patterns('',
    (r'', include('careers.urls')),
)
...
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;The main &lt;code&gt;urls.py&lt;/code&gt; includes &lt;code&gt;careers.urls&lt;/code&gt; which if you look at the above
project layout, resolves to two different python packages:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;careers/urls.py&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;careers/apps/careers/urls.py&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;Python chose the first, and therefore &lt;code&gt;urls.py&lt;/code&gt; kept calling upon itself.&lt;/p&gt;

&lt;h3&gt;So what did we learn?&lt;/h3&gt;

&lt;p&gt;Do better.&lt;/p&gt;

&lt;p&gt;First of all, we need a better project layout. This will continue to cause
problems for even the brightest developers.&lt;/p&gt;

&lt;p&gt;Secondly, if you don't do this at least name apps carefully.
Django's app model can be a bit much for
non third party apps.  Sometimes there's one app which spans the entire
project, and it's tempting to call it the same name as the project
(e.g. &lt;code&gt;careers&lt;/code&gt;), but sometimes a lamer more generic name like &lt;code&gt;common&lt;/code&gt; is
better.&lt;/p&gt;

&lt;p&gt;But really, the second point is moot if we just clean up.&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>18 months</title>
   <link href="http://davedash.com/2011/11/30/18-months/"/>
   <updated>2011-11-30T00:00:00-08:00</updated>
   <id>http://davedash.com/2011/11/30/18-months</id>
   <content type="html">&lt;p&gt;Yesterday Siddhartha turned 18 months.  I remember last year running into an
18 month old at the airport and being amazed at how well she said &quot;bébé&quot;
(she was French) when she saw Siddhartha.  So I had an expectation that
Siddhartha would be able to speak at least a word or two by now.&lt;/p&gt;

&lt;p&gt;He does.&lt;/p&gt;

&lt;p&gt;He's shy until he gets to know you, but once he warms up he'll repeat most
words you tell him,
or if he knows the sign he'll sign them.&lt;/p&gt;

&lt;p&gt;He cried after slipping and falling the other day, and we did the
&quot;cell phone test&quot; to see if he was okay.
As he sniffled, he would read all the letters that I was drawing on the
screen.  Amazing!&lt;/p&gt;

&lt;p&gt;He talks, he walks, he climbs, he tries to help put away dishes,
and his signs are way more accurate.&lt;/p&gt;

&lt;p&gt;This is him a year ago:&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;http://farm6.staticflickr.com/5288/5275838461_c1906a7ba9.jpg&quot; alt=&quot;6 months&quot; /&gt;&lt;/p&gt;

&lt;p&gt;This is him today:&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;http://cl.ly/131b1h3B0Y0t3C3J3T0b/sibi.jpg&quot; alt=&quot;18 months&quot; /&gt;&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Choosing a New Web Stack</title>
   <link href="http://davedash.com/2011/10/09/choosing-a-new-web-stack/"/>
   <updated>2011-10-09T00:00:00-07:00</updated>
   <id>http://davedash.com/2011/10/09/choosing-a-new-web-stack</id>
   <content type="html">&lt;p&gt;I like building web sites, a lot.  Usually every few years I need to re-
evaluate the stack I use for a side-project.  Joshua's
&lt;a href=&quot;http://stackparts.com/&quot;&gt;Stack Parts&lt;/a&gt; site is handy for this.&lt;/p&gt;

&lt;p&gt;At Mozilla Webdev we stick to reeds + mysql + elasticsearch + celery + rabbitmq
+ memcache + git + virtualenv + python + django + jinja2 + modwsgi + commander
+ puppet + apache + less + jquery as our go-to stack.  It's tried and true and
it's been working and been evolving for two years.&lt;/p&gt;

&lt;p&gt;So I'm at re-evaluation time.  The first element of the stack I needed to
decide upon was the web framework.  I initially thought I'd use Django, and
maybe alternate a few supporting libraries just to color my experience.  But
Flask caught my attention.&lt;/p&gt;

&lt;p&gt;Flask is from Pocoo who have given me great things like:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;lodgeit&lt;/li&gt;
&lt;li&gt;Werkzeug&lt;/li&gt;
&lt;li&gt;Jinja2&lt;/li&gt;
&lt;li&gt;Sphinx&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;It was a microframework, which meant that it didn't contain as many things as
Django, but at the same time, I didn't use that much of Django.&lt;/p&gt;

&lt;p&gt;Flask was a nice way to stay mostly in my comfort-zone, and in some ways, focus
me on just writing an app, and not working in a framework.  Since it's python,
if I start to miss Django, I can probably rewrite my code without too much
effort.&lt;/p&gt;

&lt;p&gt;Overall I'm excited, and I just got past, &quot;Hello World.&quot;&lt;/p&gt;

&lt;p&gt;I'm not sure what my stack will look like, I'm imagining it will evolve into:&lt;/p&gt;

&lt;p&gt;postgresql + memcache + git + flask + jinja2 + gunicorn + fabric + puppet +
nginx + less + backbonejs + jquery&lt;/p&gt;

&lt;p&gt;This will give me a chance to learn more about things I'm interested in, and
utilize what I think might be better options along the stack.&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Interviewing: How You Think</title>
   <link href="http://davedash.com/2011/08/28/interviewing%3A-how-you-think/"/>
   <updated>2011-08-28T00:00:00-07:00</updated>
   <id>http://davedash.com/2011/08/28/interviewing:-how-you-think</id>
   <content type="html">&lt;p&gt;My friend and Web Dev colleague, James Socol, wrote a piece recently about
&lt;a href=&quot;http://coffeeonthekeyboard.com/so-you-want-me-to-hire-you-606/&quot;&gt;some hiring things&lt;/a&gt;.  I think it's a good idea, and it would certainly make
my job easier.  It reminded me that I'm putting off a few posts about hiring.&lt;/p&gt;

&lt;p&gt;I want to touch a bit on the &quot;build/implement/write an X&quot; style technical
questions.  For example:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Implement a linked list&lt;/li&gt;
&lt;li&gt;Write a url parser&lt;/li&gt;
&lt;li&gt;Make an image resizer in Javascript&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;Often we get candidates who are exceptionally smart on paper, have great Github
accounts, but fall flat on the in person implementation.&lt;/p&gt;

&lt;p&gt;For some people this is &lt;em&gt;hard&lt;/em&gt;.  So let's get over the &lt;em&gt;nerves&lt;/em&gt;.  I'm not
going to tell you &lt;strong&gt;it's silly to be nervous&lt;/strong&gt; or that
&lt;strong&gt;I'm as nervous as you&lt;/strong&gt; (I'm not), or
anything that you already know.  I will tell you this. If you notice yourself
not thinking as sharply as you normally do, &lt;strong&gt;count backwards from 10&lt;/strong&gt;.
Then carry on.  Repeat if
necessary.  Usually our interviews are 45 minutes long.  10 seconds of you
counting backwards isn't going to kill us for time.&lt;/p&gt;

&lt;p&gt;Hopefully this will calm you.  If this doesn't... well it was worth a shot.&lt;/p&gt;

&lt;p&gt;So let's get down to &lt;a href=&quot;http://en.wiktionary.org/wiki/brass_tacks?rdfrom=Brass_tacks&quot;&gt;brass tacks&lt;/a&gt;.  I want to know how you implement
things.  I want to know &lt;em&gt;how you think&lt;/em&gt;.  I don't care as much about the
answer, but the correct answer is comforting.&lt;/p&gt;

&lt;p&gt;If I tell you &quot;implement an image resizer in Javascript&quot; and you start diving
into JavaScript code and get flustered, I can't really help you.
If you can do that
without getting flustered and produce something that works, I'll be impressed,
but somewhat alarmed.&lt;/p&gt;

&lt;p&gt;What I really want is you to &lt;strong&gt;step back from the problem&lt;/strong&gt;.
I want you to show me what the resizer will look like and how it will behave.
You don't need to go into too many details, but &lt;em&gt;enough details so I know you
understand the problem&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;If the problem is easily testable (like writing a url parser),
it wouldn't hurt to have some tests to start.&lt;/p&gt;

&lt;p&gt;Then I want you to write the code backwards from high level to low level.
Write the HTML, write the initialization code, and finally write the event
handlers.&lt;/p&gt;

&lt;p&gt;This is not only easier to follow in an interview,
it's basic problems solving,
because you end up breaking the problem into smaller chunks.&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>DjangoCon Testing Tutorial</title>
   <link href="http://davedash.com/2011/08/10/djangocon-testing-tutorial/"/>
   <updated>2011-08-10T00:00:00-07:00</updated>
   <id>http://davedash.com/2011/08/10/djangocon-testing-tutorial</id>
   <content type="html">&lt;div class=&quot;side&quot;&gt;
   &lt;img src=&quot;/static/images/2011/08/10/djangocon.png&quot;
        width=&quot;287&quot; height=&quot;184&quot;
        alt=&quot;DjangoCon 2011&quot; /&gt;
&lt;/div&gt;


&lt;p&gt;If you want to learn all you can about testing anything in your Django App, see
&lt;a href=&quot;http://djangocon.us/schedule/presentations/30/&quot;&gt;my tutorial&lt;/a&gt; at &lt;a href=&quot;http://djangocon.us/&quot;&gt;DjangoCon&lt;/a&gt;.
It's on September 5th, it'll be 3 hours
long and so far with seven sign ups it will be very hands-on.&lt;/p&gt;

&lt;p&gt;Here's what I think I will cover, but I may change this depending on what the
audience wants:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Testing issues

&lt;ul&gt;
&lt;li&gt;ask people to fill out etherpad with issues they've run into&lt;/li&gt;
&lt;li&gt;ask someone to rank them in order of complexity&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;List an outline of topics

&lt;ul&gt;
&lt;li&gt;post them on etherpad&lt;/li&gt;
&lt;li&gt;have people + them if they are interested&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Testing overview

&lt;ul&gt;
&lt;li&gt;We started in late 2009 early 2010&lt;/li&gt;
&lt;li&gt;Our largest project has 2500 tests&lt;/li&gt;
&lt;li&gt;Our next largest has 1100&lt;/li&gt;
&lt;li&gt;We have pretty good coverage&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;How testing works    in Django

&lt;ul&gt;
&lt;li&gt;I'm not 100% sure on this&lt;/li&gt;
&lt;li&gt;Test runner setups up a new database&lt;/li&gt;
&lt;li&gt;Test runner finds and runs tests&lt;/li&gt;
&lt;li&gt;Tests run class setup&lt;/li&gt;
&lt;li&gt;Test runs each test in a test case

&lt;ul&gt;
&lt;li&gt;Load fixtures&lt;/li&gt;
&lt;li&gt;Tests run setup&lt;/li&gt;
&lt;li&gt;Tests runs the test&lt;/li&gt;
&lt;li&gt;Tests runs teardown&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Tests run class Teardown&lt;/li&gt;
&lt;li&gt;You get an F if you're bad and a . if your not.&lt;/li&gt;
&lt;li&gt;Now that you know it, you can hack it.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;How we've hacked testing

&lt;ul&gt;
&lt;li&gt;2500 tests is a lot&lt;/li&gt;
&lt;li&gt;We no longer recreate the database when you run the test suite&lt;/li&gt;
&lt;li&gt;In each test case we just load the fixtures once.&lt;/li&gt;
&lt;li&gt;We rearrange the tests so things with the same fixture set run together&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Testing tools that we use at Mozilla

&lt;ul&gt;
&lt;li&gt;nose/django_nose&lt;/li&gt;
&lt;li&gt;nose plugins

&lt;ul&gt;
&lt;li&gt;nicedots&lt;/li&gt;
&lt;li&gt;progressive&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;coverage

&lt;ul&gt;
&lt;li&gt;git + whatchangedpy&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Testing everything, no excuses

&lt;ul&gt;
&lt;li&gt;100% Coverage isn't important&lt;/li&gt;
&lt;li&gt;80% is nice&lt;/li&gt;
&lt;li&gt;Good coverage on tricky things is important&lt;/li&gt;
&lt;li&gt;Some coverage on everything is important&lt;/li&gt;
&lt;li&gt;External&lt;/li&gt;
&lt;li&gt;If you start depending on APIs, Search or different tools you need to be able to test for them.&lt;/li&gt;
&lt;li&gt;Writing these test cases will take less time than this tutorial&lt;/li&gt;
&lt;li&gt;It will save you so much headache in the future.&lt;/li&gt;
&lt;li&gt;The same headaches you save yourself by writing &quot;normal&quot; tests&lt;/li&gt;
&lt;li&gt;Mock easy things

&lt;ul&gt;
&lt;li&gt;use a decorator on any test/view that might use redis&lt;/li&gt;
&lt;li&gt;if redis isn't setup, use the mock client&lt;/li&gt;
&lt;li&gt;mock client doesn't support everything,

&lt;ul&gt;
&lt;li&gt;just what I need to get my tests running -&lt;/li&gt;
&lt;li&gt;feel free to extend it if you use it&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Testing Redis&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Setup/Teardown for complicated tools

&lt;ul&gt;
&lt;li&gt;Good for search and APIs&lt;/li&gt;
&lt;li&gt;Raise SkipTest (nose) if the developer doesn't want to run these tests&lt;/li&gt;
&lt;li&gt;Non realtime tools

&lt;ul&gt;
&lt;li&gt;Testing Sphinx search&lt;/li&gt;
&lt;li&gt;SetupClass

&lt;ul&gt;
&lt;li&gt;load fixtures&lt;/li&gt;
&lt;li&gt;run indexer&lt;/li&gt;
&lt;li&gt;run server&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Sphinx server now available for all tests in your test case&lt;/li&gt;
&lt;li&gt;Teardown

&lt;ul&gt;
&lt;li&gt;stop server&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Real time tools

&lt;ul&gt;
&lt;li&gt;Nicer, data can be added in post_save signals or elsewhere in your app&lt;/li&gt;
&lt;li&gt;Testing LDAP

&lt;ul&gt;
&lt;li&gt;Setup

&lt;ul&gt;
&lt;li&gt;Remove LDAP files&lt;/li&gt;
&lt;li&gt;Load an ldif&lt;/li&gt;
&lt;li&gt;Start slapd&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Your code can now touch LDAP&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Testing ElasticSearch

&lt;ul&gt;
&lt;li&gt;We leave ES running all the time.&lt;/li&gt;
&lt;li&gt;Setup

&lt;ul&gt;
&lt;li&gt;Checks for ES support or SkipTest&lt;/li&gt;
&lt;li&gt;Deletes index&lt;/li&gt;
&lt;li&gt;Creates index&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;You can now read/write to ES&lt;/li&gt;
&lt;li&gt;Teardown

&lt;ul&gt;
&lt;li&gt;Delete's index&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Fixtures

&lt;ul&gt;
&lt;li&gt;Fixture Magic&lt;/li&gt;
&lt;li&gt;Model Maker&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;pitfalls

&lt;ul&gt;
&lt;li&gt;dates&lt;/li&gt;
&lt;li&gt;using PDB&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;

</content>
 </entry>
 
 <entry>
   <title>Groupon is poor value</title>
   <link href="http://davedash.com/2011/07/09/groupon-is-poor-value/"/>
   <updated>2011-07-09T00:00:00-07:00</updated>
   <id>http://davedash.com/2011/07/09/groupon-is-poor-value</id>
   <content type="html">&lt;p&gt;I bought a $30 coupon to Hobee's for $15.  I spent $67 with friends.  However,
since we ordered 2 $9 mimosas at half off, we couldn't use the Groupon.  Rather
than Hobee's accepting the fact that I spent well over $30, they charged me the
full price for the Mimosas, making my net savings at Hobee's $6.  That's less
than 10% of my total bill.&lt;/p&gt;

&lt;p&gt;This isn't the first time this has happened to me.  Tandori Oven of San José
and even my beloved the Mmoon have weaseled out of Groupon's or similar by
negating anything that remotely seems like a deal at their stores.&lt;/p&gt;

&lt;p&gt;I feel like a bunch of restaurant owners bought into the &quot;Groupon&quot; marketing
concept and saw their (I imagine) already slim margins, get even slimmer - so
they are making Groupons unusable.&lt;/p&gt;

&lt;p&gt;Here's the math, as I've understood it:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;You buy a coupon: $10 for $20 of an item.&lt;/li&gt;
&lt;li&gt;Groupon gets $5, the store gets $5.&lt;/li&gt;
&lt;li&gt;The store is effectively discounting something by up to 75%.&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;What these stores fail to understand:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;I'm discounting my meal by a non-trivial amount.&lt;/li&gt;
&lt;li&gt;In return I buy more than I need to.&lt;/li&gt;
&lt;li&gt;I also tip their employees a bit more.&lt;/li&gt;
&lt;li&gt;I will stop going to their store if they attempt to nickel and dime me.&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;So I'm going to hold off on Groupons unless I go somewhere where I always pay
the same price and they have no &quot;specials&quot; or &quot;deals&quot; that I might get side
tracked with.  The process is a horrible user-experience, for moderate savings.&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Siddhartha: The One Year Old</title>
   <link href="http://davedash.com/2011/05/29/siddhartha-one-years-old/"/>
   <updated>2011-05-29T00:00:00-07:00</updated>
   <id>http://davedash.com/2011/05/29/siddhartha-one-years-old</id>
   <content type="html">&lt;p&gt;This first year of parenting started roughly and going into year two still has
its challenges but the ride has become enjoyable.&lt;/p&gt;

&lt;div class=&quot;side&quot;&gt;
&lt;a href=&quot;http://www.flickr.com/photos/ketiya/sets/72157626722598543/&quot;
   title=&quot;Studying his new book&quot;&gt;
   &lt;img src=&quot;http://farm3.static.flickr.com/2311/5778978503_3bc2882968_m.jpg&quot;
        width=&quot;240&quot; height=&quot;161&quot;
        alt=&quot;Siddhartha studying his new book&quot; /&gt;
&lt;/a&gt;
&lt;/div&gt;


&lt;p&gt;He's heavier, taller, easier to deal with, can take food from multiple sources,
mobile.  Overall, he's a lot of fun.  I enjoy my time with him whenever I can,
and we even get to do &quot;guy stuff&quot; like grocery shopping
and running errands.&lt;/p&gt;

&lt;p&gt;He brings us and others a lot of joy and I'm sure he will continue to do so.&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Better querying for ElasticSearch</title>
   <link href="http://davedash.com/2011/05/17/better-querying-for-elasticsearch/"/>
   <updated>2011-05-17T00:00:00-07:00</updated>
   <id>http://davedash.com/2011/05/17/better-querying-for-elasticsearch</id>
   <content type="html">&lt;p&gt;I wrote &lt;a href=&quot;/2011/03/25/filter-queries-using-pyes/&quot;&gt;about how to write filter queries using &lt;code&gt;pyes&lt;/code&gt;&lt;/a&gt;.
Unfortunately after using ElasticSearch in &lt;a href=&quot;http://builder.addons.mozilla.org&quot;&gt;the Add-ons Builder&lt;/a&gt;, I realized
that our code would become unwieldy and hard to read if we kept using straight
up &lt;code&gt;pyes&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;I prefer to write APIs so that are natural and conform to how I think, not one
that simply mirrors another system.&lt;/p&gt;

&lt;p&gt;So rather than this:&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;python&quot;&gt;    &lt;span class=&quot;n&quot;&gt;filters&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;TermFilter&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;platform&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;all&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;),&lt;/span&gt;
               &lt;span class=&quot;n&quot;&gt;TermFilter&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;product&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;firefox&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;),&lt;/span&gt;
               &lt;span class=&quot;n&quot;&gt;TermFilter&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;version&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;4.0&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)]&lt;/span&gt;
    &lt;span class=&quot;nb&quot;&gt;filter&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;ANDFilter&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;filters&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;q&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;FilteredQuery&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;MatchAllQuery&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(),&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;filter&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;search&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;q&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;facet&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;add_term_facet&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;#39;type&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;results&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;es&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;search&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;q&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;


&lt;p&gt;I made &lt;a href=&quot;https://github.com/davedash/elasticutils/&quot;&gt;something simpler&lt;/a&gt;:&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;python&quot;&gt;    &lt;span class=&quot;kn&quot;&gt;from&lt;/span&gt; &lt;span class=&quot;nn&quot;&gt;elasticutils&lt;/span&gt; &lt;span class=&quot;kn&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;S&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;results&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;S&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;platform&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;#39;all&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;product&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;#39;firefox&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;version&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;#39;4.0&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
               &lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;facet&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;#39;type&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;get_results&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;


&lt;p&gt;Here were the design thoughts:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;I wanted something easy to remember, &lt;code&gt;S&lt;/code&gt; for search.&lt;/li&gt;
&lt;li&gt;I wanted smart defaults, by default &lt;code&gt;S()&lt;/code&gt; matches all documents, unless you
give it a query term.&lt;/li&gt;
&lt;li&gt;I didn't want to write python that looked like Java, or JSON or even a
&lt;code&gt;dict&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;I wanted to write something that felt like the Django-ORM&lt;/li&gt;
&lt;li&gt;Ultimately I want code that I enjoy writing.&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;So here it is, I expect it to power Firefox Add-ons, the Add-ons Builder and
Firefox Input shortly.&lt;/p&gt;

&lt;p&gt;This is all part of &lt;a href=&quot;https://github.com/davedash/elasticutils/&quot;&gt;ElasticUtils&lt;/a&gt;.
Let me know if you are using it, and pull requests are welcome!&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>DeliciousTube</title>
   <link href="http://davedash.com/2011/04/27/delicioustube/"/>
   <updated>2011-04-27T00:00:00-07:00</updated>
   <id>http://davedash.com/2011/04/27/delicioustube</id>
   <content type="html">&lt;p&gt;What do I think about 2 of the YouTube founders buying Delicious?&lt;/p&gt;

&lt;p&gt;Everyone who used Delicious (including those of us who worked on Delicious) and
was aware that Yahoo! purchased Delicious thought at some point, &quot;Well if &lt;em&gt;I&lt;/em&gt;
ran Delicious, I'd do &lt;em&gt;X&lt;/em&gt;.&quot;  Where &lt;em&gt;X&lt;/em&gt; is more than getting a hamster to run in
a wheel.  Chad Hurley and Steve Chen actually put their money where there
mouths are.&lt;/p&gt;

&lt;p&gt;I'm glad Delicious is getting a new lease on life.  The problems it solves
still exist on the web, and I'm hopeful that it will flourish.&lt;/p&gt;

&lt;p&gt;Also, I'd like to publicly apologize for not implementing the following things
while I worked on Delicious:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Keeping archive copies of the web sites.&lt;/li&gt;
&lt;li&gt;Finding which links are dead or need redirecting.&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;In hindsight, all the things I did work on were not nearly as important.  I
built the product I was told to, not the product I wanted.  Oops.&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Filter Queries using pyes</title>
   <link href="http://davedash.com/2011/03/25/filter-queries-using-pyes/"/>
   <updated>2011-03-25T00:00:00-07:00</updated>
   <id>http://davedash.com/2011/03/25/filter-queries-using-pyes</id>
   <content type="html">&lt;p&gt;I've been having a tough time navigating the Elastic Search docs, but some
sleuthing in the test suite for &lt;code&gt;pyes&lt;/code&gt; has proved helpful.&lt;/p&gt;

&lt;p&gt;If I have documents that I'd like filtered by let's say &lt;code&gt;product&lt;/code&gt;, &lt;code&gt;version&lt;/code&gt;
and &lt;code&gt;platform&lt;/code&gt;, I can construct a query like so:&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;python&quot;&gt;    &lt;span class=&quot;n&quot;&gt;filters&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;TermFilter&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;platform&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;all&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;),&lt;/span&gt;
               &lt;span class=&quot;n&quot;&gt;TermFilter&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;product&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;firefox&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;),&lt;/span&gt;
               &lt;span class=&quot;n&quot;&gt;TermFilter&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;version&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;4.0&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)]&lt;/span&gt;
    &lt;span class=&quot;nb&quot;&gt;filter&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;ANDFilter&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;filters&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;q&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;FilteredQuery&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;MatchAllQuery&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(),&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;filter&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;results&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;es&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;search&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;q&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;


&lt;p&gt;There is perhaps a more succinct way of doing this, but this serves my
purposes.&lt;/p&gt;

&lt;p&gt;Let's say you need facets as well:&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;python&quot;&gt;    &lt;span class=&quot;n&quot;&gt;filters&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;TermFilter&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;platform&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;all&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;),&lt;/span&gt;
               &lt;span class=&quot;n&quot;&gt;TermFilter&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;product&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;firefox&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;),&lt;/span&gt;
               &lt;span class=&quot;n&quot;&gt;TermFilter&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;version&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;4.0&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)]&lt;/span&gt;
    &lt;span class=&quot;nb&quot;&gt;filter&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;ANDFilter&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;filters&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;q&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;FilteredQuery&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;MatchAllQuery&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(),&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;filter&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;search&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;q&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;facet&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;add_term_facet&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;#39;type&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;results&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;es&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;search&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;q&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;



</content>
 </entry>
 
 <entry>
   <title>How we slug at Mozilla</title>
   <link href="http://davedash.com/2011/03/24/how-we-slug-at-mozilla/"/>
   <updated>2011-03-24T00:00:00-07:00</updated>
   <id>http://davedash.com/2011/03/24/how-we-slug-at-mozilla</id>
   <content type="html">&lt;p&gt;One problem we find with slug generators, is they do an awful job with unicode.
For a string like this: &lt;code&gt;Bän...g (bang)&lt;/code&gt; you get something like
&lt;code&gt;bng---g--bang-&lt;/code&gt; or at best &lt;code&gt;bang-bang&lt;/code&gt;.  But it's 2011, urls can have
unicode... here's what we really want: &lt;code&gt;bäng-bang&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;In some cases transliteration might be acceptable.  But if we look at Django's
approach it fails at Russian.  Here's a comparison with ours for the Russian
phrase &quot;Быстрее и лучше!&quot; (&quot;Faster and better!&quot;):&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;&amp;gt;&amp;gt;&amp;gt; from django.template.defaultfilters import slugify as djslugify
&amp;gt;&amp;gt;&amp;gt; from slugify import slugify
&amp;gt;&amp;gt;&amp;gt; str = u'Быстрее и лучше!'
&amp;gt;&amp;gt;&amp;gt; print djslugify(str)

&amp;gt;&amp;gt;&amp;gt; print slugify(str)
быстрее-и-лучше
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;So as you can see, the built-in Django &lt;code&gt;slugify&lt;/code&gt; could be disastrous.  So take
a look at &lt;a href=&quot;https://github.com/mozilla/unicode-slugify&quot;&gt;ours&lt;/a&gt;.  If you have some more test cases, please fork it.&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Data Anonymous</title>
   <link href="http://davedash.com/2011/03/02/data-anonymous/"/>
   <updated>2011-03-02T00:00:00-08:00</updated>
   <id>http://davedash.com/2011/03/02/data-anonymous</id>
   <content type="html">&lt;p&gt;I wrote a simple database &lt;a href=&quot;https://github.com/davedash/mysql-anonymous&quot;&gt;scrubber script&lt;/a&gt;.  It takes a &lt;code&gt;yaml&lt;/code&gt; file that
describes what scrubbing needs doing and then outputs &lt;code&gt;sql&lt;/code&gt; that you can send
to &lt;code&gt;mysql&lt;/code&gt;.  It's dreadfully simple and I'd like to see if others can make use
of it.&lt;/p&gt;

&lt;p&gt;At Mozilla we have a lot of contributors and would like them to have access to
realistic data since many of our bugs are based on certain states within the
data.&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Siddhartha: More time out than in</title>
   <link href="http://davedash.com/2011/03/01/siddhartha%3A-more-time-out-than-in/"/>
   <updated>2011-03-01T00:00:00-08:00</updated>
   <id>http://davedash.com/2011/03/01/siddhartha:-more-time-out-than-in</id>
   <content type="html">&lt;p&gt;It's hard to believe that Sidd's spent more time out of the womb than in.
We've also lived in our home longer with the baby than without.  Time is
clearly flying.&lt;/p&gt;

&lt;p&gt;So here's what's new:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;He crawls really well.&lt;/li&gt;
&lt;li&gt;He pulls up on everything especially people.&lt;/li&gt;
&lt;li&gt;He babbles a lot - a few mornings he'll repeat the word &quot;Hi&quot; to me.&lt;/li&gt;
&lt;li&gt;Teething seems to be worse with each tooth.&lt;/li&gt;
&lt;li&gt;He has two bottom teeth, two top teeth and likes to use them (ouch!).&lt;/li&gt;
&lt;li&gt;He still has dairy sensitivity, but eggs are okay.&lt;/li&gt;
&lt;li&gt;He's great at solids... sometimes too great

&lt;ul&gt;
&lt;li&gt;We're just sticking to once maybe twice a day.&lt;/li&gt;
&lt;li&gt;He really likes broccoli, peas and blueberries, but we expect this to
continually change.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Sometimes he doesn't poop for a while.&lt;/li&gt;
&lt;li&gt;His poop has become more adult like (read smelly, but solid).&lt;/li&gt;
&lt;li&gt;His pee smells.&lt;/li&gt;
&lt;li&gt;Sleep

&lt;ul&gt;
&lt;li&gt;Naps are transitioning from 2/3 a day to 1/2 and it's tough - like
teething.  I've been able to get him to nap with not too much fuss
(normally Katie gets him to nap).&lt;/li&gt;
&lt;li&gt;Sleep has good days and bad days.  In the end, I'm glad we're still
co-sleeping.  He lunges for daddy when mommy is holding him and vice
versa... sometimes over and over again.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;These last three months have breezed on by.  I think the next three months will
be just as fantastic.&lt;/p&gt;

&lt;iframe title=&quot;YouTube video player&quot; width=&quot;560&quot; height=&quot;349&quot;
        src=&quot;https://www.youtube.com/embed/G4aMOOMoWdw?rel=0&amp;amp;hd=1&quot;
        frameborder=&quot;0&quot; allowfullscreen&gt;&lt;/iframe&gt;



</content>
 </entry>
 
 <entry>
   <title>Bulk load ElasticSearch using pyes</title>
   <link href="http://davedash.com/2011/02/25/bulk-load-elasticsearch-using-pyes/"/>
   <updated>2011-02-25T00:00:00-08:00</updated>
   <id>http://davedash.com/2011/02/25/bulk-load-elasticsearch-using-pyes</id>
   <content type="html">&lt;p&gt;When indexing a lot of data, you can save time by bulk loading data.&lt;/p&gt;

&lt;p&gt;With &lt;code&gt;pyes&lt;/code&gt; you can do the following:&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;python&quot;&gt;&lt;span class=&quot;kn&quot;&gt;from&lt;/span&gt; &lt;span class=&quot;nn&quot;&gt;pyes&lt;/span&gt; &lt;span class=&quot;kn&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;ES&lt;/span&gt;


&lt;span class=&quot;n&quot;&gt;es&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;ES&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;es&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;index&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;data&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;#39;my-index&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;#39;my-type&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;es&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;index&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;data&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;#39;my-index&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;#39;my-type&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;es&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;index&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;data&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;#39;my-index&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;#39;my-type&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;3&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;es&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;index&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;data&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;#39;my-index&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;#39;my-type&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;4&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;


&lt;p&gt;This will make 4 independent network calls.&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;python&quot;&gt;&lt;span class=&quot;kn&quot;&gt;from&lt;/span&gt; &lt;span class=&quot;nn&quot;&gt;pyes&lt;/span&gt; &lt;span class=&quot;kn&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;ES&lt;/span&gt;


&lt;span class=&quot;n&quot;&gt;es&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;ES&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;es&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;index&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;data&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;#39;my-index&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;#39;my-type&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;bulk&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;bp&quot;&gt;True&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;es&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;index&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;data&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;#39;my-index&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;#39;my-type&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;bulk&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;bp&quot;&gt;True&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;es&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;index&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;data&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;#39;my-index&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;#39;my-type&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;3&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;bulk&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;bp&quot;&gt;True&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;es&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;index&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;data&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;#39;my-index&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;#39;my-type&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;4&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;bulk&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;bp&quot;&gt;True&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;es&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;refresh&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;


&lt;p&gt;Will do this in one call.  This is handy for those &quot;reindex all the items we
can&quot; weekends.&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Installing ElasticSearch plugins</title>
   <link href="http://davedash.com/2011/02/24/installing-elasticsearch-plugins/"/>
   <updated>2011-02-24T00:00:00-08:00</updated>
   <id>http://davedash.com/2011/02/24/installing-elasticsearch-plugins</id>
   <content type="html">&lt;p&gt;I'm slowly trying to familiarize myself with ElasticSearch and the &lt;code&gt;pyes&lt;/code&gt;
python interface.  ElasticSearch uses a lot of plugins, and while the plugin
system is easy to use, it's not obvious where to find the plugins.&lt;/p&gt;

&lt;p&gt;They are &lt;a href=&quot;http://elasticsearch.googlecode.com/svn/plugins/&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;If you want to install the attachments plugin, you can do:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;bin/plugin install mapper-attachments
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;And voilà it's installed.&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>What I should have done...</title>
   <link href="http://davedash.com/2011/02/22/what-i-should-have-done.../"/>
   <updated>2011-02-22T00:00:00-08:00</updated>
   <id>http://davedash.com/2011/02/22/what-i-should-have-done...</id>
   <content type="html">&lt;p&gt;From &lt;a href=&quot;http://www.edd.ca.gov/disability/Paid_Family_Leave.htm&quot;&gt;EDD&lt;/a&gt;:&lt;/p&gt;

&lt;blockquote&gt;&lt;p&gt;For &lt;strong&gt;California workers&lt;/strong&gt; covered by State Disability Insurance, Paid Family
Leave (PFL) insurance provides up to &lt;strong&gt;six weeks of benefits&lt;/strong&gt; for
individuals who must take time off to care for a seriously ill child, spouse,
parent, or registered domestic partner, or to &lt;strong&gt;bond with a new child&lt;/strong&gt;.&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;I learned about this as I did my taxes this year.  Had I done my 2009 taxes by
myself I may have learned of this, and taken advantage of this.  If/when we
have a second child I plan on taking advantage of this.&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Interviews with Fibonacci</title>
   <link href="http://davedash.com/2011/01/28/interviews-with-fibonacci/"/>
   <updated>2011-01-28T00:00:00-08:00</updated>
   <id>http://davedash.com/2011/01/28/interviews-with-fibonacci</id>
   <content type="html">&lt;p&gt;I have the privilege of interviewing many of the people who wish to be web
developers at Mozilla.  I unfortunately witness
&lt;a href=&quot;http://www.codinghorror.com/blog/2007/02/why-cant-programmers-program.html&quot;&gt;programmers not being able to program&lt;/a&gt;.  My interviews are 45 minutes
long.  I tend to ask people about their history, experiences and about what
they know.  Then I give them some time to write some code.&lt;/p&gt;

&lt;h3&gt;My Question&lt;/h3&gt;

&lt;p&gt;I use questions relating to the Fibonacci sequence.  E.g.:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Print &lt;code&gt;n&lt;/code&gt; numbers of the Fibonacci sequence&lt;/li&gt;
&lt;li&gt;Give me a &lt;code&gt;list&lt;/code&gt; (if the person knows python) of &lt;code&gt;n&lt;/code&gt; numbers of the Fibonacci
sequence.&lt;/li&gt;
&lt;li&gt;In rare cases, Print the &lt;code&gt;n&lt;/code&gt;th numbers of Fibonacci.&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;In some cases I dumb it down... a lot:&lt;/p&gt;

&lt;blockquote&gt;&lt;p&gt;Give me &lt;code&gt;n&lt;/code&gt; integers.  In other words &lt;code&gt;f(5) = [1 1 1 1 1]&lt;/code&gt;.  I just want to
know if you can write a &lt;code&gt;for&lt;/code&gt;-loop.&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;Here's the sequence:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;1 1 2 3 5 8 13 21 34 ..  k[n-2] k[n-1] k[n]
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;The &lt;strong&gt;first two numbers are &lt;code&gt;0&lt;/code&gt; and &lt;code&gt;1&lt;/code&gt;&lt;/strong&gt;.  Each successive number is the
&lt;strong&gt;addition of the two proceeding numbers&lt;/strong&gt;.  In other words:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;k[n] = k[n-2] +k[n-1]
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;I don't care too much about efficiency.  I often don't care if it works, if
they're trying.&lt;/p&gt;

&lt;h3&gt;This is a low bar&lt;/h3&gt;

&lt;p&gt;A good &lt;strong&gt;number of people solve this with no issues&lt;/strong&gt;.  They calculate the
sequence and print out the numbers, or store them in a &lt;code&gt;list&lt;/code&gt;.  I run the code,
we optimize it slightly, we move on.&lt;/p&gt;

&lt;p&gt;Unfortunately, &lt;strong&gt;I expect &lt;em&gt;everyone&lt;/em&gt; I interview to easily solve this&lt;/strong&gt;.  Quite
honestly, &lt;strong&gt;if they can't solve this they should not have even made it past the
phone screen&lt;/strong&gt;.  It's harsh and the only exception is pressure.&lt;/p&gt;

&lt;h3&gt;Pressure&lt;/h3&gt;

&lt;p&gt;Interview pressures is a real thing:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Interviewees at Mozilla are generally excited by the prospect.&lt;/li&gt;
&lt;li&gt;People want to appear intelligent to their peers.&lt;/li&gt;
&lt;li&gt;They had too much coffee at their hotel.  There's a lot to think about,
&lt;strong&gt;it's not a natural environment&lt;/strong&gt;.&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;I try to solve this by using a comfortable room with couches.  I also refrain
from yelling at the candidates like a Tiger Mom.  Being nervous, however, is
difficult.&lt;/p&gt;

&lt;p&gt;This problem gives a lot of people coders-block.&lt;/p&gt;

&lt;p&gt;My advice to anyone doing technical interviews:&lt;/p&gt;

&lt;blockquote&gt;&lt;p&gt;&lt;em&gt;Practice.&lt;/em&gt;&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;Have your friends, family, fiance, whomever ask you programming questions.  You
can compile a huge list, and just have them pick one at random.  Make the
process seem natural.&lt;/p&gt;

&lt;h3&gt;Excitement&lt;/h3&gt;

&lt;p&gt;The best &lt;strong&gt;people who solve these problems&lt;/strong&gt; are the ones who
&lt;strong&gt;think problems are exciting&lt;/strong&gt;.  They enjoy challenge.  They are also find the
interview exciting, they are &lt;strong&gt;entering in with a good attitude&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;It's &lt;strong&gt;not about intelligence&lt;/strong&gt;.  Intelligence is rarely a factor.  It's about
effort, and effort is easy to exert if you find something exciting.&lt;/p&gt;

&lt;p&gt;If they are excited to ace a simple interview question, I can usually rely on
them to do their jobs, and in many cases turn to them to come up with solutions
to problems I might be running into.&lt;/p&gt;

&lt;p&gt;The excited interviewer asks about what the solutions should entail, and the
rules:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Are we starting at zero or one?&lt;/li&gt;
&lt;li&gt;Do you want a &lt;code&gt;list&lt;/code&gt;, or a generator?&lt;/li&gt;
&lt;li&gt;Do you want to print this out?&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;They eagerly churn out code.  They check it with some basic tests.  They let me
know it works with confidence.  Occasionally they stumble and sometimes come
out with the wrong answer, but with some assistance they could usually figure
it out.  I can use their failures as a segue to talk about testing and quality
assurance.&lt;/p&gt;

&lt;h3&gt;How do you think?&lt;/h3&gt;

&lt;p&gt;I don't ask this problem, because I'm dying to know the 12th number of the
fibonacci sequence.  I already know that's 144.  I want to know how people
solve problems.  How do they take a set of requirements and implement them.&lt;/p&gt;

&lt;p&gt;Our jobs as software developers are to take requirements or problems, find a
suitable solution and write code to solve it.&lt;/p&gt;

&lt;p&gt;This is my approach.  I know the first number is 1 and the next number is 1,
therefore I can store those and get the third number by adding them.  I shift
the variables around in a for loop and I can get this:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;cur = next = 1
for 1..n:
    print cur
    last = cur
    cur = next
    next += last
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;That's just pseudo-code.  I'm not a math and/or computer science genius.  I
can, however, take requirements and imagine how I would solve them if I had to
do it by hand, and then transcribe that process.&lt;/p&gt;

&lt;p&gt;Likewise if someone tells me, we need to know the average rating that people
gave Firefox in the area of start-up time each day, I can figure out that
problem and then implement it using software.&lt;/p&gt;

&lt;p&gt;So now I have to preface my interviews with, &quot;If you read my post about the
Fibonacci sequence, let me know.&quot;&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Testing Redis in Django</title>
   <link href="http://davedash.com/2010/12/07/testing-redis-in-django/"/>
   <updated>2010-12-07T00:00:00-08:00</updated>
   <id>http://davedash.com/2010/12/07/testing-redis-in-django</id>
   <content type="html">&lt;p&gt;For the &lt;a href=&quot;http://addons.mozilla.org/en-US/firefox/&quot;&gt;Firefox Add-ons&lt;/a&gt; we've been using &lt;a href=&quot;http://code.google.com/p/redis/&quot;&gt;redis&lt;/a&gt; here and there mostly
for cache, but lately for a few things we'd love to persist.&lt;/p&gt;

&lt;p&gt;Unfortunately relying on redis does mean we need to be able to test it.  Since
redis touches some of our core components of the site, we can't just raise a
&lt;code&gt;SkipTest&lt;/code&gt; like we would for Sphinx search related tests.  I also don't want to
rely on our developers to have redis installed in order to run the
test-suite.&lt;/p&gt;

&lt;p&gt;So I built a simple &lt;a href=&quot;https://github.com/mozilla/nuggets/blob/master/redisutils.py#L47&quot;&gt;Mock Redis client&lt;/a&gt;.  It's part of our
&lt;code&gt;redisutils.py&lt;/code&gt; that handles connections to redis.  If a test's &lt;code&gt;setUp&lt;/code&gt; method
calls &lt;code&gt;mock_redis&lt;/code&gt; you'll get this phony object that can do a few minimal
redis-like operations.&lt;/p&gt;

&lt;p&gt;It works great for our specific cases, but feel free to fork it and make it
better.&lt;/p&gt;

&lt;p&gt;Note: This &lt;code&gt;MockRedis&lt;/code&gt; is specifically designed to work with &lt;a href=&quot;http://www.djangoproject.com/&quot;&gt;django&lt;/a&gt;.&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Siddhartha: The Sixth Month</title>
   <link href="http://davedash.com/2010/11/29/siddhartha%3A-the-sixth-month/"/>
   <updated>2010-11-29T00:00:00-08:00</updated>
   <id>http://davedash.com/2010/11/29/siddhartha:-the-sixth-month</id>
   <content type="html">&lt;p&gt;Siddhartha: The sixth month&lt;/p&gt;

&lt;p&gt;Six months ago, we were playing the waiting game.  Katie woke up in a hospital
bed and was undergoing pregnancy induction, and I woke up in an uncomfortable
nook -- not realizing that long restful nights of sleep were gone.  Today, I
woke up on a couch with a six month old sleeping on my belly.&lt;/p&gt;

&lt;p&gt;This month was much like &lt;a href=&quot;/2010/10/30/siddhartha%3A-the-fifth-month/&quot;&gt;last month&lt;/a&gt;, he just got better at everything.
His rolling is now a nuisance on the changing table.  His crawling is still
army like and now he gets into stuff or terrorizes the cat.  He bounces up on
all fours.  He can also sit up without support which means we can put him in a
high chair or in a shopping cart.  And that tooth that's been threatening to
emerge since 2.5 months?  It's broken ground.&lt;/p&gt;

&lt;p&gt;We did give him an avocado for Thanksigiving and we tried once more on
Saturday, but he (and it may be sheer coincidence) got some redness on his
face, excessive spit-up and sneezing, so we're going to try a new vegetable
later this week.&lt;/p&gt;

&lt;p&gt;Here is my son vs a robot:&lt;/p&gt;

&lt;div&gt;
&lt;object width=&quot;560&quot; height=&quot;340&quot;&gt;&lt;param name=&quot;movie&quot; value=&quot;http://www.youtube-nocookie.com/v/pgfK7isMo5w?fs=1&amp;amp;hl=en_US&amp;amp;rel=0&amp;amp;hd=1&quot;&gt;&lt;/param&gt;&lt;param name=&quot;allowFullScreen&quot; value=&quot;true&quot;&gt;&lt;/param&gt;&lt;param name=&quot;allowscriptaccess&quot; value=&quot;always&quot;&gt;&lt;/param&gt;&lt;embed src=&quot;http://www.youtube-nocookie.com/v/pgfK7isMo5w?fs=1&amp;amp;hl=en_US&amp;amp;rel=0&amp;amp;hd=1&quot; type=&quot;application/x-shockwave-flash&quot; allowscriptaccess=&quot;always&quot; allowfullscreen=&quot;true&quot; width=&quot;560&quot; height=&quot;340&quot;&gt;&lt;/embed&gt;&lt;/object&gt;
&lt;/div&gt;



</content>
 </entry>
 
 <entry>
   <title>Pythonic string formatting in Javascript</title>
   <link href="http://davedash.com/2010/11/19/pythonic-string-formatting-in-javascript/"/>
   <updated>2010-11-19T00:00:00-08:00</updated>
   <id>http://davedash.com/2010/11/19/pythonic-string-formatting-in-javascript</id>
   <content type="html">&lt;p&gt;We do a lot of string manipulation on the &lt;a href=&quot;https://addons.mozilla.org/&quot;&gt;Firefox Addons&lt;/a&gt; site.  A lot of
it has to do with localization so one thing that comes up is being able to
format strings.  Here's a little snippet to give yourself python like string
formatting:&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;javascript&quot;&gt;    &lt;span class=&quot;cm&quot;&gt;/* Python(ish) string formatting:&lt;/span&gt;
&lt;span class=&quot;cm&quot;&gt;     * &amp;gt;&amp;gt;&amp;gt; format(&amp;#39;{0}&amp;#39;, [&amp;#39;zzz&amp;#39;])&lt;/span&gt;
&lt;span class=&quot;cm&quot;&gt;     * &amp;quot;zzz&amp;quot;&lt;/span&gt;
&lt;span class=&quot;cm&quot;&gt;     * &amp;gt;&amp;gt;&amp;gt; format(&amp;#39;{x}&amp;#39;, {x: 1})&lt;/span&gt;
&lt;span class=&quot;cm&quot;&gt;     * &amp;quot;1&amp;quot;&lt;/span&gt;
&lt;span class=&quot;cm&quot;&gt;     */&lt;/span&gt;
    &lt;span class=&quot;kd&quot;&gt;function&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;format&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;s&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;args&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;kd&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;re&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;sr&quot;&gt;/\{([^}]+)\}/g&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
        &lt;span class=&quot;k&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;s&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;replace&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;re&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;kd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;_&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;match&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;){&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;args&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;match&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;];&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;});&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;



</content>
 </entry>
 
 <entry>
   <title>My Refrigerator's Sabbath Mode</title>
   <link href="http://davedash.com/2010/11/10/my-refrigerator%27s-sabbath-mode/"/>
   <updated>2010-11-10T00:00:00-08:00</updated>
   <id>http://davedash.com/2010/11/10/my-refrigerator's-sabbath-mode</id>
   <content type="html">&lt;p&gt;From my refrigerator's manual:&lt;/p&gt;

&lt;blockquote&gt;&lt;p&gt;The Sabbath mode feature turns off all lights, disables the water and ice
dispenser, disables all alarms and tones, disables the automatic defrost
feature and disables the control panel.&lt;/p&gt;&lt;/blockquote&gt;
</content>
 </entry>
 
 <entry>
   <title>Using git to borrow from the future</title>
   <link href="http://davedash.com/2010/11/09/using-git-to-borrow-from-the-future/"/>
   <updated>2010-11-09T00:00:00-08:00</updated>
   <id>http://davedash.com/2010/11/09/using-git-to-borrow-from-the-future</id>
   <content type="html">&lt;p&gt;One of the great features of &lt;code&gt;git&lt;/code&gt; is the ability to re-order commits, break
commits into parts, and merge commits together.&lt;/p&gt;

&lt;p&gt;Assuming that my &lt;code&gt;master&lt;/code&gt; branch is a pristine copy of the site and an ancestor
of &lt;code&gt;mybranch&lt;/code&gt; we can re-order commits by running:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;git rebase -i master&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;This will take all the commits in your current branch (&lt;code&gt;mybranch&lt;/code&gt;) that are
built upon &lt;code&gt;master&lt;/code&gt; and allow you to reorder or edit them individually,
remove them or squash them.&lt;/p&gt;

&lt;p&gt;For example you might get:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;pick 123abcd New feature supreme
pick 123abce Whitepsace fixes
pick 2222222 Rename functions.
pick 123abcf rebase me
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;The last commit listed is the latest commit and is where &lt;code&gt;mybranch&lt;/code&gt;'s &lt;code&gt;HEAD&lt;/code&gt;
points to.&lt;/p&gt;

&lt;p&gt;You can edit this like so:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;pick 123abce Whitepsace fixes
pick 2222222 Rename functions.
pick 123abcd New feature supreme
f 123abcf rebase me
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;This will re-order history so the first three items happen and the &quot;rebase me&quot;
commit just gets rolled into the &quot;New feature supreme&quot;.  Note since this is a
rebase the commit hashes will change.  Let's say history is now this (reverse
chronological):&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;323abcd New feature supreme
3222222 Rename functions.
323abce Whitepsace fixes
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Great?  Almost.&lt;/p&gt;

&lt;p&gt;There's a likely hood that your apps' unit tests will not pass after the commit
&quot;Rename functions&quot;.  Some functions may have been renamed somewhere later in
&lt;code&gt;mybranch&lt;/code&gt; possibly in &quot;rebase me&quot; which is now a part of &quot;New feature
supreme.&quot;&lt;/p&gt;

&lt;p&gt;This is a mess, but we can run &lt;code&gt;git rebase -i master&lt;/code&gt; again and edit the
&quot;Rename functions.&quot; commit.  If you run a test-suite and things fail you can
&quot;borrow from the future&quot;.  You see at this point &lt;code&gt;Rename functions&lt;/code&gt; is
something that happened in the past.  &lt;code&gt;mybranch&lt;/code&gt;'s head is now
&lt;code&gt;New feature supreme&lt;/code&gt; which is the future.  We can pick and choose little
changes with some &lt;code&gt;git&lt;/code&gt;-fu.&lt;/p&gt;

&lt;p&gt;While rebasing in the &lt;code&gt;Rename functions.&lt;/code&gt; we might notice that we forgot to
rename a call, but we remembered to rename this call at some point in
&lt;code&gt;mybranch&lt;/code&gt;.  We can simply do this:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;git checkout -p mybranch [paths]&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;This will let you interactively select chunks of code from the head of
&lt;code&gt;mybranch&lt;/code&gt; and put it into your specific commit &lt;code&gt;Rename functions.&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;You can narrow this down by specifying some &lt;code&gt;paths&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Once we finish rebasing we'll have a commit history that is logically ordered
and have all tests passing tests.&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Siddhartha: The Fifth Month</title>
   <link href="http://davedash.com/2010/10/30/siddhartha%3A-the-fifth-month/"/>
   <updated>2010-10-30T00:00:00-07:00</updated>
   <id>http://davedash.com/2010/10/30/siddhartha:-the-fifth-month</id>
   <content type="html">&lt;p&gt;This month has been my favorite thus far.  The first month was exciting, but
nerve racking.  Two was full of changes.  Three was somewhat boring, but we did
get sleep.  Four we lost all our sleep.  In this month a lot of stuff happened
and we got used to the &lt;a href=&quot;http://localhost:4000/2010/09/29/the-fourth-month/&quot;&gt;sleep regression&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;This month we are also sleeping differently.  He sleeps around 7 or 8PM and
wakes up a few times at night.  We sleep around 9 or 10PM.  Katie nurses him in
bed the first few times he wakes.  Once it's 4am I take him out so Katie can
get an hour or two of uninterrupted sleep (or more on the weekend).  I'll
either get him to fall back asleep on me in the couch or in his swing.
Sometimes I'll need to change his diaper, or bottle feed him a bit.&lt;/p&gt;

&lt;p&gt;But the sleep regression wasn't all for naught.  He now rolls, which is
amazing, and he can army crawl:&lt;/p&gt;

&lt;div&gt;
&lt;object width=&quot;560&quot; height=&quot;340&quot;&gt;
    &lt;param name=&quot;movie&quot;
        value=&quot;http://www.youtube.com/v/3ec7gal2d60?fs=1&amp;amp;hl=en_US&amp;amp;rel=0&amp;amp;hd=1&quot;&gt;
    &lt;/param&gt;
    &lt;param name=&quot;allowFullScreen&quot; value=&quot;true&quot;&gt;&lt;/param&gt;
    &lt;param name=&quot;allowscriptaccess&quot; value=&quot;always&quot;&gt;&lt;/param&gt;
    &lt;embed src=&quot;http://www.youtube.com/v/3ec7gal2d60?fs=1&amp;amp;hl=en_US&amp;amp;rel=0&amp;amp;hd=1&quot;
        type=&quot;application/x-shockwave-flash&quot; allowscriptaccess=&quot;always&quot;
        allowfullscreen=&quot;true&quot; width=&quot;560&quot; height=&quot;340&quot;&gt;&lt;/embed&gt;
&lt;/object&gt;
&lt;/div&gt;


&lt;p&gt;I think I'll be spending a lot of weekends hiding wires and cables and other
things that babies think are delicious.  Crawling (and perhaps teething) have
led to a lot more spit-up too.&lt;/p&gt;

&lt;p&gt;My biggest problem has been one of scheduling.  I wake up around 5 or 6AM, get
ready for work, wait for Katie to get ready, then go to work, come back around
6PM and start putting him to sleep.  I don't get enough time to spend with him
on weekdays, and I feel like I'm rushing to and from a job I really enjoy.  I'm
really hoping that he gets to sleep easier, so I won't feel rushed each day.&lt;/p&gt;

&lt;p&gt;In any case, this next month should be exciting - our plan is to give this guy
an avocado for Thanksgiving.&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Faceted Search on Input</title>
   <link href="http://davedash.com/2010/10/29/faceted-search-on-input/"/>
   <updated>2010-10-29T00:00:00-07:00</updated>
   <id>http://davedash.com/2010/10/29/faceted-search-on-input</id>
   <content type="html">&lt;p&gt;So one trick with &lt;a href=&quot;http://sphinxsearch.com/&quot;&gt;Sphinx search&lt;/a&gt; is &lt;a href=&quot;http://en.wikipedia.org/wiki/Faceted_search&quot;&gt;faceted search&lt;/a&gt;.  It's somewhat
crudely implemented, by batching queries together, but does the job well.  In
the case of &lt;a href=&quot;http://input.mozilla.com/&quot;&gt;Firefox Input&lt;/a&gt; it can reduce quite a bit of queries (our
search result pages take one batched sphinx query, and one database query now
instead of 5 database queries).&lt;/p&gt;

&lt;div class=&quot;side&quot;&gt;
&lt;a href=&quot;http://www.flickr.com/photos/davedash/5126379671/&quot;
   title=&quot;Add-on Search Results for shopping :: Add-ons for Firefox&quot;&gt;
   &lt;img src=&quot;http://farm5.static.flickr.com/4041/5126379671_33b3e472d5_m.jpg&quot;
    width=&quot;240&quot; height=&quot;172&quot; alt=&quot;Add-on Search Results for shopping&quot; /&gt;&lt;/a&gt;
&lt;/div&gt;


&lt;p&gt;Faceted search is search with filters to help narrow down a result set.  I'll
give you three examples.  &lt;a href=&quot;http://addons.mozilla.org/&quot;&gt;Firefox Add-ons&lt;/a&gt; which I wrote,
&lt;a href=&quot;http://www.sittercity.com/search-sitters.html?ct=101&amp;amp;zip=95126&quot;&gt;Sitter City&lt;/a&gt; which gives you a lot of ways on narrowing down on the perfect
baby sitter and &lt;a href=&quot;http://ebay.com/&quot;&gt;ebay&lt;/a&gt; which lets your narrow down on auction items.&lt;/p&gt;

&lt;p&gt;For &lt;a href=&quot;http://input.mozilla.com/&quot;&gt;Input&lt;/a&gt; we ask for the following when we do a search:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;How many opinions match the term for which we are searching taking into
account any preferences we have already specified (feeling, locale, operating
system, date range, etc).&lt;/li&gt;
&lt;li&gt;How many opinions show a positive sentiment, and how many show a negative
sentiment?&lt;/li&gt;
&lt;li&gt;What is the breakdown of languages for the opinion results.  (I.e. how many
are en-US, de, fr, etc).&lt;/li&gt;
&lt;li&gt;How many people are on Mac, Linux or Windows.&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;We can batch these four queries into a single Sphinx request.&lt;/p&gt;

&lt;p&gt;Here's &lt;a href=&quot;http://github.com/davedash/reporter/commit/348018&quot;&gt;our implementation&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Having done this twice, I do recognize that there is a lot of room for making
the code a bit more reusable.  But overall it runs fairly well.&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Counting Sphinx groupBy Queries</title>
   <link href="http://davedash.com/2010/10/15/counting-sphinx-groupby-queries/"/>
   <updated>2010-10-15T00:00:00-07:00</updated>
   <id>http://davedash.com/2010/10/15/counting-sphinx-groupby-queries</id>
   <content type="html">&lt;p&gt;I quickly implemented Sphinx on Input, while revisiting it, I saw that we try
to answer this type of question:&lt;/p&gt;

&lt;blockquote&gt;&lt;p&gt;Of the results displayed:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;How many are happy and how many are sad?&lt;/li&gt;
&lt;li&gt;How many are for Windows, Linux or Mac?&lt;/li&gt;
&lt;li&gt;How many are for English, French or Japanese&lt;/li&gt;
&lt;/ul&gt;
&lt;/blockquote&gt;

&lt;p&gt;Finding these involve using faceted search.  Unfortunately this is a bit
awkward to do using Sphinx.  For the first example, happy or sad you would have
to run the query like such:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Take the query, remove any filters on &lt;em&gt;happiness&lt;/em&gt; and do a group by on
happy opinions&lt;/li&gt;
&lt;li&gt;Restore any filters on happiness and run the query as normal.&lt;/li&gt;
&lt;li&gt;Return both the results, and the aggregate data from step 1.&lt;/li&gt;
&lt;/ol&gt;


&lt;p&gt;Doing the group by is easy, but you only get to know how many feelings there
are and what they were.  In our case: happy and sad.  What we really want is
how many of our original search were happy and how many were sad?&lt;/p&gt;

&lt;p&gt;I assumed something like this would work:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;sphinx.SetSelect('feeling, @count')
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;&lt;code&gt;@count&lt;/code&gt; is one of those magic variables that Sphinx uses.  Unfortunately this
doesn't work.  &lt;code&gt;COUNT(*)&lt;/code&gt; doesn't work either.  Here's what did:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;sphinx.SetSelect('feeling, SUM(1) AS count')
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Not the straight forward mysqlish syntax I've come to expect from Sphinx, but
it works.&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>The Fourth Month</title>
   <link href="http://davedash.com/2010/09/29/the-fourth-month/"/>
   <updated>2010-09-29T00:00:00-07:00</updated>
   <id>http://davedash.com/2010/09/29/the-fourth-month</id>
   <content type="html">&lt;p&gt;This was the month where we learned about non-linear progression.  For most of
the second and third months we thought we had it good in terms of sleep.
Usually 5-6 hours, sometimes 8 or 9.  That usually meant one long stretch and a
second smaller stretch of sleep.&lt;/p&gt;

&lt;p&gt;In comes the &lt;a href=&quot;http://www.askmoxie.org/2007/10/4-month-olds/&quot;&gt;19 week &quot;wonder-week&quot;&lt;/a&gt;... with its characteristic
&lt;a href=&quot;http://moxie.blogs.com/askmoxie/2006/02/qa_what_are_sle.html&quot;&gt;&quot;sleep regression&quot;&lt;/a&gt;.  This is a culmination of crazy mental and physical
development that is downright awesome to watch during playtime, but can lead to
waking up every few hours at night.  We're still in the midst of it and
managing through it, but it was real rough at first.  Others say in a few weeks
or months sleep will return to &quot;normal.&quot;  I can't wait.  On top of that we've
been dealing with teething.&lt;/p&gt;

&lt;p&gt;However, I think both Katie and I will agree, Sibi's a lot easier to manage
most of the day.  He entertains himself, he can play a lot longer, and he's
very very chatty in the right company.&lt;/p&gt;

&lt;div&gt;
&lt;object width=&quot;560&quot; height=&quot;340&quot;&gt;
    &lt;param name=&quot;movie&quot;
           value=&quot;http://www.youtube.com/v/WEdsnZtre7U?fs=1&amp;amp;hl=en_US&amp;amp;rel=0&amp;amp;hd=1&quot;&gt;
    &lt;/param&gt;
    &lt;param name=&quot;allowFullScreen&quot; value=&quot;true&quot;&gt;&lt;/param&gt;
    &lt;param name=&quot;allowscriptaccess&quot; value=&quot;always&quot;&gt;&lt;/param&gt;
    &lt;embed src=&quot;http://www.youtube.com/v/WEdsnZtre7U?fs=1&amp;amp;hl=en_US&amp;amp;rel=0&amp;amp;hd=1&quot;
           type=&quot;application/x-shockwave-flash&quot; allowscriptaccess=&quot;always&quot;
           allowfullscreen=&quot;true&quot; width=&quot;560&quot; height=&quot;340&quot;&gt;
    &lt;/embed&gt;
&lt;/object&gt;
&lt;/div&gt;

</content>
 </entry>
 
 <entry>
   <title>Siddhartha: 3 months old</title>
   <link href="http://davedash.com/2010/08/29/siddhartha%3A-3-months-old/"/>
   <updated>2010-08-29T00:00:00-07:00</updated>
   <id>http://davedash.com/2010/08/29/siddhartha:-3-months-old</id>
   <content type="html">&lt;div&gt;
&lt;object width=&quot;560&quot; height=&quot;340&quot;&gt;
    &lt;param name=&quot;movie&quot;
        value=&quot;http://www.youtube.com/v/OocWl4ym2ho?fs=1&amp;amp;hl=en_US&amp;amp;rel=0&amp;amp;hd=1&quot;&gt;
    &lt;/param&gt;
    &lt;param name=&quot;allowFullScreen&quot; value=&quot;true&quot;&gt;&lt;/param&gt;
    &lt;param name=&quot;allowscriptaccess&quot; value=&quot;always&quot;&gt;&lt;/param&gt;
    &lt;embed src=&quot;http://www.youtube.com/v/OocWl4ym2ho?fs=1&amp;amp;hl=en_US&amp;amp;rel=0&amp;amp;hd=1&quot; type=&quot;application/x-shockwave-flash&quot; allowscriptaccess=&quot;always&quot; allowfullscreen=&quot;true&quot; width=&quot;560&quot; height=&quot;340&quot;&gt;&lt;/embed&gt;
&lt;/object&gt;
&lt;/div&gt;


&lt;p&gt;Finally!&lt;/p&gt;

&lt;p&gt;Lately the week-to-week changes have been hard to notice.  Obviously the
occasional bad day or three where he's developing mentally or physically are
noticeable, but for the most part everything is a smooth transition.&lt;/p&gt;

&lt;p&gt;For example, he has gradually been spending more time on his tummy, and he will
sometimes smile, and in one case, while on my tummy, he started having a
conversation with me.&lt;/p&gt;

&lt;p&gt;Naps and sleep in general has been all over the place (and almost impossible in
the car).  For a few days nursing him to sleep wasn't working.  In some ways he
sleeps a lot easier, we used to have to bounce and shush him while swaddled to
get him to sleep.  These days we've had mixed success with less elaborate
measures -- the swing has been pretty good to us.&lt;/p&gt;

&lt;p&gt;Sleep of course sets our mood, so if we can't get enough it makes everything
awful. Luckily we've been able to get okay sleep on most days (averaging 4 hour
stretch at night).&lt;/p&gt;

&lt;p&gt;I like to look forward to things.  In some ways it's a coping mechanism to get
through tough times.  In some ways, it's because I am really looking forward to
an event in the future.  I diligently mark on a calendar when upcoming
milestones might happen, and other notable events.&lt;/p&gt;

&lt;p&gt;During his third month, I was able to enjoy the moment and not constantly look
at what's coming next.  Although with the sleep issues, and occasional cranky
days, it's hard to not be comforted by the future.  The future months where
naps are easier, sleep averages to over six hours a stretch and the baby can
occupy himself for hours at a time.&lt;/p&gt;

&lt;p&gt;I'm also looking forward to the time when we can do &quot;kid stuff&quot; that he'll
enjoy (versus the ones we do just to get out of the house): zoos, parks,
amusement parks, malls and street fairs.&lt;/p&gt;

&lt;p&gt;Either way, next 3 months should be awesome.&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Trimming Whitespace in Django Forms</title>
   <link href="http://davedash.com/2010/08/18/trimming-whitespace-in-django-forms/"/>
   <updated>2010-08-18T00:00:00-07:00</updated>
   <id>http://davedash.com/2010/08/18/trimming-whitespace-in-django-forms</id>
   <content type="html">&lt;p&gt;I've been using frameworks for a number of years.  So I expect a lot of things
to happen &quot;for free&quot; in Django.  One is whitespace removal.  In &lt;a href=&quot;http://delicious.com/&quot;&gt;Delicious&lt;/a&gt;
we had a lot of data in our database with leading and trailing whitespace.  On
the frontend we moved to symfony (actually ysymfony) and that prevented a lot
of this.&lt;/p&gt;

&lt;p&gt;So I was quite surprised that &lt;a href=&quot;http://code.djangoproject.com/ticket/6362&quot;&gt;this is not the case with Django&lt;/a&gt;.  So I
decided we could solve this at the form level, and released a
&lt;a href=&quot;http://github.com/mozilla/happyforms&quot;&gt;ridiculously simple library&lt;/a&gt;.  After some googling, I found that I was
&lt;a href=&quot;http://www.peterbe.com/plog/automatically-strip-whitespace-in-django-forms&quot;&gt;not the first to do this&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Feel free to use this, fork it, submit pull requests, etc.  I suspect in the
future we'll handle other global form filtering - like stripping high order
Unicode since MySQL is often not a fan.&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>The Perils of One Giant Fixture</title>
   <link href="http://davedash.com/2010/08/12/the-perils-of-one-giant-fixture/"/>
   <updated>2010-08-12T00:00:00-07:00</updated>
   <id>http://davedash.com/2010/08/12/the-perils-of-one-giant-fixture</id>
   <content type="html">&lt;p&gt;&lt;img src=&quot;/static/images/2010/08/12/time.jpg&quot; alt=&quot;Timing&quot; /&gt;&lt;/p&gt;

&lt;p&gt;A while back, I thought it would be good to consolidate all the data used in
testing the django-layer of &lt;a href=&quot;https://addons.mozilla.org/&quot;&gt;AMO&lt;/a&gt; into a single data fixture.
Unfortunately we have 600 tests, which were now loading and unloading large
amounts of data each time the test would run.  This made our tests take 20
minutes.&lt;/p&gt;

&lt;p&gt;I decided to cut this down quite a bit, by using smaller fixture files.  Each
fixture file attempts to be a singular primary object (e.g. an Addon or a
Collection or a User) and its associated supporting objects.  It's far from
perfect, but it's achieved tests that run in under 10 minutes.&lt;/p&gt;

&lt;p&gt;The other side effect is tests will be simpler.  They'll only include the
addons needed to generate an effect, and if something can't be done easily with
the fixtures in place, we can always alter the data during the test.&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Siddhartha: Weeks 8-10</title>
   <link href="http://davedash.com/2010/08/08/siddhartha%3A-weeks-8-10/"/>
   <updated>2010-08-08T00:00:00-07:00</updated>
   <id>http://davedash.com/2010/08/08/siddhartha:-weeks-8-10</id>
   <content type="html">&lt;p&gt;Things have been mostly stable.  Sleep has been somewhat all over the place --
3-7 hours or so.  The worst thing is dealing with the &quot;witching hour.&quot;
Siddhartha's not colicky, but definitely fussy in the early evenings, in cars
and &lt;a href=&quot;http://www.kellymom.com/babyconcerns/fussybaby.html&quot;&gt;just before he does his big sleep for the night&lt;/a&gt;.  Now that we know to
expect this, it's not as alarming.&lt;/p&gt;

&lt;p&gt;We also learned that Fisherman's Wharf might be less crowded on the weekdays,
but then you have to deal with weekday rush hour.  Rush hour combined with
stopping to assuage the baby twice made our trip down the peninsula take 4 long
hours.  This was probably the most stressful four hours we've had recently.&lt;/p&gt;

&lt;p&gt;We also learned that Music in the Park in San José is not great for families.
Sibi in his moby wrap was one of the youngest, but definitely not the only
child, present at the event.  Unfortunately San José has a central park
designed for a much smaller city, so the park was jam packed.  Katie and I
foolishly got ice cream sandwiches from Treatbot, but it was by no means worth
it and then realized that we can't both eat treats and take care of junior at
the same time.&lt;/p&gt;

&lt;p&gt;So just past 2 months here's what we've accomplished:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;I'm starting to go into work a few days a week.&lt;/li&gt;
&lt;li&gt;The babies stool is less troublesome since Katie's avoided dairy.  She's
re-introduced yoghurt and some cheese and we still seem to be doing alright.&lt;/li&gt;
&lt;li&gt;Sidd's less at risk of whooping cough thanks to his DTaP vaccine.&lt;/li&gt;
&lt;li&gt;Sidd spins in a circle (may have been doing this at 6 or 7 weeks) on his
activity mat. [&lt;a href=&quot;http://sparkplugdance.org/information/articles/great-stuff-happens/&quot;&gt;1&lt;/a&gt;]&lt;/li&gt;
&lt;li&gt;He can belly crawl once in a while. [&lt;a href=&quot;http://sparkplugdance.org/information/articles/great-stuff-happens/&quot;&gt;1&lt;/a&gt;]&lt;/li&gt;
&lt;li&gt;There is some predictability in his schedule.&lt;/li&gt;
&lt;li&gt;Dealt well with being a tourist at Fisherman's Wharf.  He even let us go in a
submarine.&lt;/li&gt;
&lt;li&gt;Although he fusses at night, he's a bit easier to handle in a Moby Wrap with
me.&lt;/li&gt;
&lt;li&gt;Katie's had less breastfeeding issues.&lt;/li&gt;
&lt;li&gt;He's over 10.5 lbs and 23 inches.&lt;/li&gt;
&lt;li&gt;He now sleeps in an attached co-sleeper.&lt;/li&gt;
&lt;li&gt;He's met both his grandpa and cousin (on Katie's side).&lt;/li&gt;
&lt;/ul&gt;

</content>
 </entry>
 

</feed>


