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

 <title>Dave Dash</title>
 <link href="http://davedash.com/tag/del.icio.us/atom.xml" rel="self"/>
 <link href="http://davedash.com/tag/del.icio.us"/>
 <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>Delicious keeps you in the know</title>
   <link href="http://davedash.com/2009/08/04/delicious-keeps-you-in-the-know/"/>
   <updated>2009-08-04T00:00:00-07:00</updated>
   <id>http://davedash.com/2009/08/04/delicious-keeps-you-in-the-know</id>
   <content type="html">&lt;p&gt;My last task at Delicious was to build along with the amazing &lt;a href=&quot;http://zooie.wordpress.com/&quot;&gt;Vik Singh&lt;/a&gt; was to build a new feed of bookmarks that was heavily influenced by Twitter.  It was one of the most interesting and enjoyable pieces of code that I worked on at Delicious.&lt;/p&gt;

&lt;p&gt;Over two months since my final check-in, the code is &lt;a href=&quot;http://delicious.com/&quot;&gt;now in production&lt;/a&gt;.  It is mostly as intended, but is lacking an RSS or JSON feed (which I had already built).  This is somewhat disappointing since I was hoping that Delicious would remain as open as it had been in the past.&lt;/p&gt;

&lt;p&gt;The algorithm is fairly simple we take a look at what trending topics exist at any moment in time (via Google Trends and Twitter) and we combine it with a list of popular terms.  We take the whole lot of these items and   query search twitter and store an in-memory data table of tweets.  We also take a snapshot of new URLs to the Delicious corpus (basically anything on &lt;a href=&quot;http://delicious.com/recent/&quot;&gt;Delicious recent&lt;/a&gt; with 1 save).  We cluster the Delicious URLs and then find tweets that are similar to each of these clusters.&lt;/p&gt;

&lt;p&gt;The code for this is similar to &lt;a href=&quot;http://zooie.wordpress.com/2009/01/15/twitter-boss-real-time-search/&quot;&gt;Vik's TweetNews&lt;/a&gt; - but I think the Delicious data is a nicer fit.&lt;/p&gt;

&lt;p&gt;We optimized this quite a bit and built a very fast inverted-index and tweaked the code to run in about a minute.  Like TweetNews the heart of this was built using Python.  Python while being a dynamic language is quite amazing for manipulating and iteratiting over sets of data.&lt;/p&gt;

&lt;p&gt;While building this tool, it became my way to feel pulse of what's going on.  I could ditch a lot of my RSS feeds and rely solely on Delicious to be on the up and up.  Unfortunately I can't subscribe to a feed for this.  Either delicious has made a mistake and didn't launch their feeds at the same time as their web (entirely possible, since Delicious hasn't been updated for most of 2009) or they are deliberately taking a step backwards.&lt;/p&gt;

&lt;p&gt;This step backwards is weird from the usability issue.  Delicious has always been a tool that allowed for multiple types of consumers and a tool that appealed to developers thanks to its myriad of RSS and JSON feeds.    I'm glad I didn't have to be on the losing side of that decision.  Delicious relies heavily on Google Trends and Twitter Search.  While there is no requirement for them to share the data they are mashing up, it would be the right thing to do.&lt;/p&gt;

&lt;p&gt;Let me know what you think of the new feeds.  I wish I could share a github link or something snazzy so you could play around with it, but this post should be a good starting point for other real-time data mashups.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Update&lt;/strong&gt;: Read &lt;a href=&quot;http://blog.delicious.com/blog/2009/08/delicious-homepage-gets-%E2%80%9Cfresh%E2%80%9D.html&quot;&gt;Vik's account of this on the Delicious Blog&lt;/a&gt;.&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Fixing the DiggBar with Delicious</title>
   <link href="http://davedash.com/2009/04/02/fixing-the-diggbar-with-delicious/"/>
   <updated>2009-04-02T00:00:00-07:00</updated>
   <id>http://davedash.com/2009/04/02/fixing-the-diggbar-with-delicious</id>
   <content type="html">&lt;p&gt;I've been tooling around with the &lt;a href=&quot;http://digg.com/http://spindrop.us/&quot;&gt;DiggBar&lt;/a&gt; and I've been quite pleased... but I was a bit annoyed that it was hard to bookmark things in Delicious via the digg bar.  I'd have to either close bar and then bookmark in delicious, or right click on the url in the DiggBar and then change the title.&lt;/p&gt;

&lt;p&gt;I'm fundamentally a lazy programmer, so I wrote &lt;a href=&quot;http://userscripts.org/scripts/show/45716&quot;&gt;some greasemonkey to save me some time&lt;/a&gt;.  Hooray... diggBar+Delicious.&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Why code rewrites are often coupled with redesigns</title>
   <link href="http://davedash.com/2008/08/13/why-code-rewrites-are-often-coupled-with-redesigns/"/>
   <updated>2008-08-13T00:00:00-07:00</updated>
   <id>http://davedash.com/2008/08/13/why-code-rewrites-are-often-coupled-with-redesigns</id>
   <content type="html">&lt;p&gt;I've done some rewrites of code, and they usually are coupled with redesigns.&lt;/p&gt;

&lt;p&gt;Redesigns and rewrites are tricky.  With web sites existing users tend to prefer incremental changes with each.  Changing a design element or a feature are pretty much equivalent when its done incrementally.&lt;/p&gt;

&lt;p&gt;Usually small changes are like surgery.  You make a small change, you possibly announce it, and people look at it and usually say yes, this change is better.  But mostly a small change can go unnoticed.&lt;/p&gt;

&lt;p&gt;Tiny atomic changes are nice and they improve the product.&lt;/p&gt;

&lt;p&gt;A rewrite of code however is a discrete change.  They take forever.  Second system and all that.  They inevitably involve a redesign as well.  They tend to be received with mixed reviews.&lt;/p&gt;

&lt;p&gt;Generally a design of a site is grafted onto code.  Sometimes by templating languages, sometimes in a tightly coupled system.  In either case there's usually two options:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Make a faithful port of the design.&lt;/li&gt;
&lt;li&gt;Redesign&lt;/li&gt;
&lt;/ol&gt;


&lt;p&gt;The latter is generally preferred since this saves a lot of time.  Generally there are bugs with a design, and there is a design backlog.   A faithful port of the design would mean porting every broken HTML code, every non user-friendly element, etc.&lt;/p&gt;

&lt;p&gt;Unfortunately this leaves web developers with a scary situation: Launching a product which changes peoples functional and UI experience.&lt;/p&gt;

&lt;p&gt;The good thing is redesigns usually mean evolutionary leaps.  Meaning, iterations can happen faster, both in design and functionality.  We can easily please new customers, and we can quickly bring current customers up to speed.&lt;/p&gt;

&lt;p&gt;In my spare time, I've been rewriting code that I wrote in symfony (PHP) into django (python).  It's a tiresome long process that can easily kill a side project.&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>... and the new Delicious has landed</title>
   <link href="http://davedash.com/2008/07/31/and-the-new-delicious-has-landed/"/>
   <updated>2008-07-31T00:00:00-07:00</updated>
   <id>http://davedash.com/2008/07/31/and-the-new-delicious-has-landed</id>
   <content type="html">&lt;p&gt;Working at Delicious with the team has been a wonderful experience.  This is probably the most fun I've had working on a project.  I am really glad to work on a site that I use almost daily (and regularly if not daily before I joined) with a &lt;a href=&quot;http://delicious.com/about#team&quot;&gt;team that really cares about their product&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;So without further ado...&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://delicious.com/&quot;&gt;Delicious 2.0&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Here's &lt;a href=&quot;http://blog.delicious.com/blog/2008/07/oh-happy-day.html&quot;&gt;the official announcement&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;object type=&quot;application/x-shockwave-flash&quot; width=&quot;400&quot; height=&quot;300&quot; data=&quot;http://www.flickr.com/apps/video/stewart.swf?v=55430&quot; classid=&quot;clsid:D27CDB6E-AE6D-11cf-96B8-444553540000&quot;&gt; &lt;param name=&quot;flashvars&quot; value=&quot;intl_lang=en-us&amp;amp;photo_secret=3f35e658c4&amp;amp;photo_id=2718285703&quot;&gt;&lt;/param&gt; &lt;param name=&quot;movie&quot; value=&quot;http://www.flickr.com/apps/video/stewart.swf?v=55430&quot;&gt;&lt;/param&gt; &lt;param name=&quot;bgcolor&quot; value=&quot;#000000&quot;&gt;&lt;/param&gt; &lt;param name=&quot;allowFullScreen&quot; value=&quot;true&quot;&gt;&lt;/param&gt;&lt;embed type=&quot;application/x-shockwave-flash&quot; src=&quot;http://www.flickr.com/apps/video/stewart.swf?v=55430&quot; bgcolor=&quot;#000000&quot; allowfullscreen=&quot;true&quot; flashvars=&quot;intl_lang=en-us&amp;amp;photo_secret=3f35e658c4&amp;amp;photo_id=2718285703&quot; height=&quot;300&quot; width=&quot;400&quot;&gt;&lt;/embed&gt;&lt;/object&gt;&lt;/p&gt;

&lt;p&gt;And here's &lt;a href=&quot;http://www.flickr.com/photos/davedash/sets/72157606475284163&quot;&gt;some photos I took&lt;/a&gt;.&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Optimization heuristics</title>
   <link href="http://davedash.com/2008/02/26/optimization-heuristics/"/>
   <updated>2008-02-26T00:00:00-08:00</updated>
   <id>http://davedash.com/2008/02/26/optimization-heuristics</id>
   <content type="html">&lt;p&gt;I decided to play version control private-eye today when my coworker mentioned that we make a system call to check the time several times per request on a few specific pages.&lt;/p&gt;

&lt;p&gt;My analysis was we didn't need to have the calls but it had me thinking...&lt;/p&gt;

&lt;!--more--&gt;


&lt;h3&gt;The micro-caching heuristic&lt;/h3&gt;

&lt;p&gt;One way of optimizing code is by calculating expensive operations once and storing them in a specific location.  It's a micro-cache if you will of data.&lt;/p&gt;

&lt;p&gt;One obvious example ends up being loops:&lt;/p&gt;

&lt;div&gt;&lt;textarea name=&quot;code&quot; class=&quot;php&quot;&gt;
// inefficient
for ($i = 0; $i &lt; count($arr); $i++)
{
// magic
}

// efficient
$arr_size = count($arr);
for ($i = 0; $i &lt; $arr_size; $i++)
{
// magic
}
&lt;/textarea&gt;&lt;/div&gt;


&lt;p&gt;The inefficient example computes &lt;code&gt;count($arr)&lt;/code&gt; &lt;em&gt;n&lt;/em&gt; times where &lt;em&gt;n&lt;/em&gt; is the size of the array &lt;code&gt;$arr&lt;/code&gt;.  The latter computes it once.&lt;/p&gt;

&lt;p&gt;When we write and review code we should look out for loops and repeated code.  These elements can be pulled out.&lt;/p&gt;

&lt;p&gt;With some data lookups like system calls or queries we can apply a request-wide caching.  In a symfony app, for example, we might need to calculate the time stamp in several locations throughout the code.  Rather than calling &lt;code&gt;time()&lt;/code&gt; throughout the code, we can create a site wide accessible attribute that has the same value.&lt;/p&gt;

&lt;p&gt;For example, we can subclass &lt;code&gt;sfContext&lt;/code&gt; and add a method called &lt;code&gt;getTime()&lt;/code&gt; which runs &lt;code&gt;time()&lt;/code&gt; once and only once per request and stores it internally.  Whenever part of the app needs the time stamp, &lt;code&gt;myContext::getInstance()-&amp;gt;getTime()&lt;/code&gt; (or an equivalent shortcut) can be called.  Of course, I haven't tested this, and &lt;code&gt;myContext&lt;/code&gt; might not be the best place for this, but a similar strategy will work.&lt;/p&gt;

&lt;p&gt;-dd&lt;/p&gt;
</content>
 </entry>
 

</feed>

