<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-7147569507271803579</id><updated>2024-09-05T05:42:57.290-05:00</updated><category term="mathematica"/><category term="2D graphics"/><category term="c++"/><category term="video"/><category term="html"/><category term="mac"/><category term="statistics"/><category term="twitter"/><category term="3D graphics"/><category term="gps"/><category term="pdf"/><category term="photo"/><category term="bbedit"/><category term="bookmarklet"/><category term="bug"/><category term="diff"/><category term="flickr"/><category term="futurama"/><category term="hg"/><category term="iMovie"/><category term="iPhone"/><category term="iTunes"/><category term="image processing"/><category term="javascript"/><category term="math"/><category term="mathlink"/><category term="mozilla"/><category term="network"/><category term="objc"/><category term="python"/><category term="quicktime"/><category term="scm"/><category term="visual studio"/><category term="webkit"/><category term="windows"/><category term="wolframalpha"/><category term="xcode"/><category term="youtube"/><title type='text'>/dev/ragfield</title><subtitle type='html'>Ragfield&#39;s software development blog</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://dev.ragfield.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7147569507271803579/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://dev.ragfield.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/7147569507271803579/posts/default?start-index=26&amp;max-results=25&amp;redirect=false'/><author><name>Ragfield</name><uri>http://www.blogger.com/profile/12325362017984149251</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='25' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjl1SMlQXOTAV7_F3A5DZg4b2e5eimTTKX9EFIlSIGempd0D7LkUqQQ9cneJqOm9HkcSDncQURdiuKI_uoLJJTJs8hSu7nFDdJ_LNdI1hpdiamXqIc6zPoJtTHCZXpkEA/s220/Ahoy.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>27</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-7147569507271803579.post-1227265087946617854</id><published>2010-05-26T16:19:00.001-05:00</published><updated>2010-05-26T16:19:38.338-05:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="mathematica"/><title type='text'>Power Smart Pricing</title><content type='html'>&lt;p&gt;Ameren Illinois Utilities Power Smart Pricing data is available in tabular form on the web.  This function will scrape that data and return the rate in US dollars for a given date/time.  My friend John wanted to use this data for something I didn&#39;t quite understand...&lt;/p&gt;

&lt;div class=&quot;Input&quot;&gt;Date[]&lt;/div&gt;
&lt;div class=&quot;Output&quot;&gt;{2010, 5, 26, 16, 3, 34.163065`8.286131807151374}&lt;/div&gt;
&lt;div class=&quot;Input&quot;&gt;PowerSmartPrice[&lt;span style=&quot;color: #428957;font-style:italic;&quot;&gt;{&lt;/span&gt;&lt;span style=&quot;color: #428957;font-style:italic;&quot;&gt;y_&lt;/span&gt;, m_, d_, h_, mm_, s_&lt;span style=&quot;color: #428957;font-style:italic;&quot;&gt;}&lt;/span&gt;]:=Module[&lt;br/&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&lt;span style=&quot;color: #428957;font-style:italic;&quot;&gt;{&lt;/span&gt;&lt;span style=&quot;color: #428957;&quot;&gt;url&lt;/span&gt;, &lt;span style=&quot;color: #428957;&quot;&gt;data&lt;/span&gt;&lt;span style=&quot;color: #428957;font-style:italic;&quot;&gt;}&lt;/span&gt;, &lt;br/&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&lt;span style=&quot;color: #428957;&quot;&gt;url&lt;/span&gt; = StringJoin[&lt;span style=&quot;color: #666666;&quot;&gt;&amp;quot;http://www.powersmartpricing.org/chart/?display=table&amp;amp;price_dt=&amp;quot;&lt;/span&gt;, ToString[m], &lt;span style=&quot;color: #666666;&quot;&gt;&amp;quot;/&amp;quot;&lt;/span&gt;, ToString[d], &lt;span style=&quot;color: #666666;&quot;&gt;&amp;quot;/&amp;quot;&lt;/span&gt;, ToString[&lt;span style=&quot;color: #428957;font-style:italic;&quot;&gt;y&lt;/span&gt;]];&lt;br/&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&lt;span style=&quot;color: #428957;&quot;&gt;data&lt;/span&gt; = Import[&lt;span style=&quot;color: #428957;&quot;&gt;url&lt;/span&gt;, &lt;span style=&quot;color: #666666;&quot;&gt;&amp;quot;Data&amp;quot;&lt;/span&gt;][[2;;]];&lt;br/&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;ToExpression[StringDrop[&lt;span style=&quot;color: #428957;&quot;&gt;data&lt;/span&gt;[[Floor[h] + 1, 2]],  - 1]] / 100.&lt;br/&gt;
];&lt;/div&gt;
&lt;div class=&quot;Input&quot;&gt;PowerSmartPrice[Date[]]&lt;/div&gt;
&lt;div class=&quot;Output&quot;&gt;0.065`&lt;/div&gt;
&lt;div class=&quot;Input&quot;&gt;PowerSmartPrice[{2010, 5, 25, 16, 0, 0}]&lt;/div&gt;
&lt;div class=&quot;Output&quot;&gt;0.066`&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://dev.ragfield.com/feeds/1227265087946617854/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/7147569507271803579/1227265087946617854' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7147569507271803579/posts/default/1227265087946617854'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7147569507271803579/posts/default/1227265087946617854'/><link rel='alternate' type='text/html' href='http://dev.ragfield.com/2010/05/power-smart-pricing.html' title='Power Smart Pricing'/><author><name>Ragfield</name><uri>http://www.blogger.com/profile/12325362017984149251</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='25' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjl1SMlQXOTAV7_F3A5DZg4b2e5eimTTKX9EFIlSIGempd0D7LkUqQQ9cneJqOm9HkcSDncQURdiuKI_uoLJJTJs8hSu7nFDdJ_LNdI1hpdiamXqIc6zPoJtTHCZXpkEA/s220/Ahoy.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7147569507271803579.post-8979604904450399643</id><published>2009-10-21T07:47:00.001-05:00</published><updated>2009-10-21T07:47:25.286-05:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="iTunes"/><category scheme="http://www.blogger.com/atom/ns#" term="mac"/><category scheme="http://www.blogger.com/atom/ns#" term="mathematica"/><title type='text'>Play a specific track in iTunes from Mathematica</title><content type='html'>A coworker was making a presentation and asked me for a function he could trigger with Button[] to start playing a specific track in iTunes (on a Mac).  This gets the job done:

&lt;div class=&quot;Input&quot;&gt;iTunesPlay[&lt;span style=&quot;color: #428957;font-style:italic;&quot;&gt;playlist_String&lt;/span&gt;,  &lt;span style=&quot;color: #428957;font-style:italic;&quot;&gt;track_Integer&lt;/span&gt;] := Run[StringJoin[&lt;br/&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&lt;span style=&quot;color: #666666;&quot;&gt;&amp;quot;osascript -e &amp;apos;tell application \&amp;quot;iTunes\&amp;quot; to play track &amp;quot;&lt;/span&gt;,  &lt;br/&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;ToString[&lt;span style=&quot;color: #428957;font-style:italic;&quot;&gt;track&lt;/span&gt;],  &lt;span style=&quot;color: #666666;&quot;&gt;&amp;quot; of user playlist \&amp;quot;&amp;quot;&lt;/span&gt;,  &lt;span style=&quot;color: #428957;font-style:italic;&quot;&gt;playlist&lt;/span&gt;,  &lt;span style=&quot;color: #666666;&quot;&gt;&amp;quot;\&amp;quot;&amp;apos;&amp;quot;&lt;/span&gt;&lt;br/&gt;
]]; &lt;/div&gt;
&lt;div class=&quot;Input&quot;&gt;iTunesPlay[&lt;span style=&quot;color: #666666;&quot;&gt;&amp;quot;Mix&amp;quot;&lt;/span&gt;,  1]&lt;/div&gt;
&lt;div class=&quot;Input&quot;&gt;iTunesPlay[&lt;span style=&quot;color: #666666;&quot;&gt;&amp;quot;Mix&amp;quot;&lt;/span&gt;,  2]&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dev.ragfield.com/feeds/8979604904450399643/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/7147569507271803579/8979604904450399643' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7147569507271803579/posts/default/8979604904450399643'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7147569507271803579/posts/default/8979604904450399643'/><link rel='alternate' type='text/html' href='http://dev.ragfield.com/2009/10/play-specific-track-in-itunes-from.html' title='Play a specific track in iTunes from Mathematica'/><author><name>Ragfield</name><uri>http://www.blogger.com/profile/12325362017984149251</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='25' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjl1SMlQXOTAV7_F3A5DZg4b2e5eimTTKX9EFIlSIGempd0D7LkUqQQ9cneJqOm9HkcSDncQURdiuKI_uoLJJTJs8hSu7nFDdJ_LNdI1hpdiamXqIc6zPoJtTHCZXpkEA/s220/Ahoy.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7147569507271803579.post-8635510875788250326</id><published>2009-10-08T17:17:00.001-05:00</published><updated>2009-10-08T17:17:47.103-05:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="bbedit"/><category scheme="http://www.blogger.com/atom/ns#" term="diff"/><category scheme="http://www.blogger.com/atom/ns#" term="hg"/><category scheme="http://www.blogger.com/atom/ns#" term="scm"/><title type='text'>Use BBEdit for diffing with Mercurial</title><content type='html'>Add the following lines to your &lt;code&gt;~/.hgrc&lt;/code&gt; file:

&lt;pre&gt;[extensions]
hgext.extdiff =

[extdiff]
cmd.bbdiff = bbdiff
opts.bbdiff = --resume --wait --reverse&lt;/pre&gt;

Then diff with the bbdiff command:

&lt;pre&gt;$ hg bbdiff [...]&lt;/pre&gt;</content><link rel='replies' type='application/atom+xml' href='http://dev.ragfield.com/feeds/8635510875788250326/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/7147569507271803579/8635510875788250326' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7147569507271803579/posts/default/8635510875788250326'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7147569507271803579/posts/default/8635510875788250326'/><link rel='alternate' type='text/html' href='http://dev.ragfield.com/2009/10/use-bbedit-for-diffing-with-mercurial.html' title='Use BBEdit for diffing with Mercurial'/><author><name>Ragfield</name><uri>http://www.blogger.com/profile/12325362017984149251</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='25' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjl1SMlQXOTAV7_F3A5DZg4b2e5eimTTKX9EFIlSIGempd0D7LkUqQQ9cneJqOm9HkcSDncQURdiuKI_uoLJJTJs8hSu7nFDdJ_LNdI1hpdiamXqIc6zPoJtTHCZXpkEA/s220/Ahoy.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7147569507271803579.post-7245377241830607648</id><published>2009-09-15T08:58:00.001-05:00</published><updated>2009-09-15T09:01:28.351-05:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="iPhone"/><category scheme="http://www.blogger.com/atom/ns#" term="objc"/><title type='text'>Insert text at the current cursor location in a UITextField on iPhone OS 3.0</title><content type='html'>&lt;p&gt;The text widgets (UITextField, UITextView, etc) in the iPhone OS SDK appear to have been intentionally designed to allow as little control for 3rd party developers as possible.  I found myself needing a user interface in an iPhone application which has buttons (in addition to the standard keyboard) that insert text into the currently selected UITextField.  Neither UITextField nor any of it&#39;s parent classes or protocols have such a method.&lt;/p&gt;

&lt;p&gt;One possible solution would be to get the contents of the UITextField, append the desired text to it, then set the contents of the UITextField to the new string.  This gives the expected behavior if the text cursor is at the end of the text (which it usually is), but it does not give the correct behavior when the text cursor is anywhere else within the text.&lt;/p&gt;

&lt;p&gt;There is a solution in iPhone OS 3.0.  The method -(void)paste:(id)sender inserts the text from the system pasteboard at the current text cursor location.  So all we need to do is temporarily hijack the system pasteboard.  The basic steps are as follows:&lt;ol&gt;&lt;li&gt;get a reference to the system pasteboard&lt;/li&gt;&lt;li&gt;save the contents of the pasteboard so you can restore them later&lt;/li&gt;&lt;li&gt;change the contents of the pasteboard to include the text you wish to insert&lt;/li&gt;&lt;li&gt;send the -(void)paste:(id)sender message to the responder (UITextField or UITextView)&lt;/li&gt;&lt;li&gt;restore the contents of the system pasteboard&lt;/li&gt;&lt;/ol&gt;&lt;/p&gt;

&lt;p&gt;Here is a simple category on UIResponder which adds a -(void)insertText:(NSString*)text method to this base class that should work on any text editing view.&lt;/p&gt;

&lt;pre&gt;
@interface UIResponder(UIResponderInsertTextAdditions)
- (void) insertText: (NSString*) text;
@end

@implementation UIResponder(UIResponderInsertTextAdditions)

- (void) insertText: (NSString*) text
{
	// Get a refererence to the system pasteboard because that&#39;s
	// the only one @selector(paste:) will use.
	UIPasteboard* generalPasteboard = [UIPasteboard generalPasteboard];
	
	// Save a copy of the system pasteboard&#39;s items
	// so we can restore them later.
	NSArray* items = [generalPasteboard.items copy];
	
	// Set the contents of the system pasteboard
	// to the text we wish to insert.
	generalPasteboard.string = text;
	
	// Tell this responder to paste the contents of the
	// system pasteboard at the current cursor location.
	[self paste: self];
	
	// Restore the system pasteboard to its original items.
	generalPasteboard.items = items;
	
	// Free the items array we copied earlier.
	[items release];
}

@end
&lt;/pre&gt;</content><link rel='replies' type='application/atom+xml' href='http://dev.ragfield.com/feeds/7245377241830607648/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/7147569507271803579/7245377241830607648' title='35 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7147569507271803579/posts/default/7245377241830607648'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7147569507271803579/posts/default/7245377241830607648'/><link rel='alternate' type='text/html' href='http://dev.ragfield.com/2009/09/insert-text-at-current-cursor-location.html' title='Insert text at the current cursor location in a UITextField on iPhone OS 3.0'/><author><name>Ragfield</name><uri>http://www.blogger.com/profile/12325362017984149251</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='25' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjl1SMlQXOTAV7_F3A5DZg4b2e5eimTTKX9EFIlSIGempd0D7LkUqQQ9cneJqOm9HkcSDncQURdiuKI_uoLJJTJs8hSu7nFDdJ_LNdI1hpdiamXqIc6zPoJtTHCZXpkEA/s220/Ahoy.jpg'/></author><thr:total>35</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7147569507271803579.post-4673024194370594765</id><published>2009-07-08T08:32:00.001-05:00</published><updated>2009-07-08T14:32:09.262-05:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="mathematica"/><category scheme="http://www.blogger.com/atom/ns#" term="video"/><category scheme="http://www.blogger.com/atom/ns#" term="youtube"/><title type='text'>Upload videos to YouTube with Mathematica</title><content type='html'>&lt;div class=&quot;Text&quot;&gt;First, install the &lt;a href=&quot;http://sites.google.com/site/ragfield/dev/GData.zip?attredirects=0&quot;&gt;GData package&lt;/a&gt; in $UserBaseDirectory/Applications.  Load the GData package which contains the code used to interact with YouTube (and other Google services).&lt;/div&gt;
&lt;div class=&quot;Input&quot;&gt;&amp;lt;&amp;lt;GData`&lt;/div&gt;
&lt;div class=&quot;Text&quot;&gt;Next, log in to YouTube.  This will prompt for a user name and/or password if either is not specified.&lt;/div&gt;
&lt;div class=&quot;Input&quot;&gt;yt = YouTubeLogin[&lt;span style=&quot;color: #666666;&quot;&gt;&amp;quot;User&amp;quot;&lt;/span&gt;-&amp;gt;&lt;span style=&quot;color: #666666;&quot;&gt;&amp;quot;robragfield&amp;quot;&lt;/span&gt;]&lt;/div&gt;
&lt;div class=&quot;Output&quot;&gt;YouTube[&amp;lt;...&amp;gt;]&lt;/div&gt;
&lt;div class=&quot;Text&quot;&gt;We can make sure it&amp;apos;s working by asking for a list of videos uploaded to this account.&lt;/div&gt;
&lt;div class=&quot;Input&quot;&gt;(&lt;span style=&quot;color: #666666;&quot;&gt;&amp;quot;Title&amp;quot;&lt;/span&gt;/.&lt;span style=&quot;color: #428957;font-style:italic;&quot;&gt;#&lt;/span&gt;)&amp;amp;/@YouTubeUploads[yt]&lt;/div&gt;
&lt;div class=&quot;Output&quot;&gt;{OmetepeProfile.mov, Homer Fireworks, Tripod, Cobb Park Crit, Mt. Diablo descent, Seymour TT starts, Screaming hard drive, Descent (iMovie image stabilization comparison), Descent, Descent, Carpenter Park Cross #2 (Line Art), Indy Marathon chase}&lt;/div&gt;
&lt;div class=&quot;Text&quot;&gt;We can also check out other accounts.&lt;/div&gt;
&lt;div class=&quot;Input&quot;&gt;YouTubeUploads[yt, &lt;span style=&quot;color: #666666;&quot;&gt;&amp;quot;wolframmathematica&amp;quot;&lt;/span&gt;]//Length&lt;/div&gt;
&lt;div class=&quot;Output&quot;&gt;950&lt;/div&gt;
&lt;div class=&quot;Text&quot;&gt;Finally, we can upload a new video to YouTube.&lt;/div&gt;
&lt;div class=&quot;Input&quot;&gt;YouTubeUpload[yt, &lt;span style=&quot;color: #666666;&quot;&gt;&amp;quot;/Users/schofield/Movies/carpenter_park_2.mp4&amp;quot;&lt;/span&gt;, &lt;span style=&quot;color: #666666;&quot;&gt;&amp;quot;Title&amp;quot;&lt;/span&gt;-&amp;gt;&lt;span style=&quot;color: #666666;&quot;&gt;&amp;quot;Carpenter&amp;quot;&lt;/span&gt;, &lt;span style=&quot;color: #666666;&quot;&gt;&amp;quot;Description&amp;quot;&lt;/span&gt;-&amp;gt;&lt;span style=&quot;color: #666666;&quot;&gt;&amp;quot;Carpenter Park cyclocross race&amp;quot;&lt;/span&gt;]&lt;/div&gt;
&lt;div class=&quot;Output&quot;&gt;«JavaObject[com.google.gdata.data.youtube.VideoEntry]»&lt;/div&gt;
&lt;div class=&quot;Text&quot;&gt;You can also specify the category and keywords.&lt;/div&gt;
&lt;div class=&quot;Input&quot;&gt;Options[YouTubeUpload]&lt;/div&gt;
&lt;div class=&quot;Output&quot;&gt;{Title-&amp;gt;Automatic, Description-&amp;gt;Undescripted, Category-&amp;gt;Tech, Keywords-&amp;gt;{uploaded by Mathematica}}&lt;/div&gt;
&lt;div class=&quot;Text&quot;&gt;&lt;a href=&quot;http://sites.google.com/site/ragfield/dev/2009-07-08-YouTubeUploads.nb?attredirects=0&quot;&gt;Download Mathematica notebook.&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;Text&quot;&gt;&lt;a href=&quot;http://sites.google.com/site/ragfield/dev/GData.zip?attredirects=0&quot;&gt;Download GData package&lt;/a&gt;.&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://dev.ragfield.com/feeds/4673024194370594765/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/7147569507271803579/4673024194370594765' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7147569507271803579/posts/default/4673024194370594765'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7147569507271803579/posts/default/4673024194370594765'/><link rel='alternate' type='text/html' href='http://dev.ragfield.com/2009/07/upload-videos-to-youtube-with.html' title='Upload videos to YouTube with Mathematica'/><author><name>Ragfield</name><uri>http://www.blogger.com/profile/12325362017984149251</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='25' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjl1SMlQXOTAV7_F3A5DZg4b2e5eimTTKX9EFIlSIGempd0D7LkUqQQ9cneJqOm9HkcSDncQURdiuKI_uoLJJTJs8hSu7nFDdJ_LNdI1hpdiamXqIc6zPoJtTHCZXpkEA/s220/Ahoy.jpg'/></author><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7147569507271803579.post-8219108494317841844</id><published>2009-07-03T22:55:00.001-05:00</published><updated>2009-07-03T22:55:44.397-05:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="network"/><title type='text'>I thought 802.11N 5GHz was the fastest</title><content type='html'>&lt;p&gt;Not so.  While I was setting up my &lt;a href=&quot;http://www.apple.com/airportextreme/&quot;&gt;Airport Extreme&lt;/a&gt; 802.11N (gigabit ethernet) router I could have sworn I read that the fastest wireless performance would be achieved with 802.11N-Only 5GHz  mode, so this is what I have been using for the past year+.  All our computers and the &lt;a href=&quot;http://www.apple.com/appletv/&quot;&gt;AppleTV&lt;/a&gt; use 802.11N, but our &lt;a href=&quot;http://www.apple.com/iphone/&quot;&gt;iPhones&lt;/a&gt; only have 802.11G.  So I set up my old Airport Extreme 802.11G (hershey kiss) router to handle the iPhones.&lt;/p&gt;

&lt;p&gt;Anyway, this causes some annoying problems where apparently iPhone &amp; desktop apps which are supposed to sync with each other don&#39;t work very well (Apple&#39;s &lt;a href=&quot;http://www.apple.com/itunes/remote/&quot;&gt;Remote&lt;/a&gt; and Filemaker&#39;s &lt;a href=&quot;http://filemaker.com/products/bento/iphone.html&quot;&gt;Bento&lt;/a&gt; come to mind).  Even though they&#39;re on the same subnet the syncing was just incredibly unreliable.  It would work every once in a while, but usually it would just wait forever for a connection that never came.&lt;/p&gt;

&lt;p&gt;A little frustrated with the situation I decided to try out some of the other modes for the Airport Extreme 802.11N router to see how much worse the network performance was.  Perhaps I&#39;d be willing to live with a slight performance hit if it meant more reliable iPhone app syncing.&lt;/p&gt;

&lt;p&gt;I was &lt;strong&gt;shocked&lt;/strong&gt; to find that, of all the available modes, the supposed fastest mode I had been using all this time was actually the &lt;strong&gt;slowest&lt;/strong&gt;.  I saw roughly twice the file transfer speed using 2.4 GHz, even when G/B compatible mode was enabled, even when the 802.11G iPhone was connected to the router loading web pages.&lt;/p&gt;

&lt;p&gt;For each of the modes I copied a 246 MB file using scp from my MacBook Pro 15&quot; downstairs to my Mac Pro desktop upstairs.  Twice.&lt;/p&gt;

&lt;pre&gt;schofieldmaclap.local (802.11N/5.0GHz) Airport Extreme (gigabit) macpro.local

[schofieldmaclap:tmp]$ scp ApertureTrial.dmg macpro.local:/tmp/
ApertureTrial.dmg                             100%  246MB   3.7MB/s   01:07    
[schofieldmaclap:tmp]$ scp ApertureTrial.dmg macpro.local:/tmp/
ApertureTrial.dmg                             100%  246MB   3.7MB/s   01:06    


schofieldmaclap.local (802.11N/G/B/2.4GHz) Airport Extreme (gigabit) macpro.local

[schofieldmaclap:tmp]$ scp ApertureTrial.dmg macpro.local:/tmp/
ApertureTrial.dmg                             100%  246MB   7.9MB/s   00:31    
[schofieldmaclap:tmp]$ scp ApertureTrial.dmg macpro.local:/tmp/
ApertureTrial.dmg                             100%  246MB   8.2MB/s   00:30    


schofieldmaclap.local (802.11N/G/B/2.4GHz/iPhone) Airport Extreme (gigabit) macpro.local

[schofieldmaclap:tmp]$ scp ApertureTrial.dmg macpro.local:/tmp/
ApertureTrial.dmg                             100%  246MB   7.9MB/s   00:31    
[schofieldmaclap:tmp]$ scp ApertureTrial.dmg macpro.local:/tmp/
ApertureTrial.dmg                             100%  246MB   8.2MB/s   00:30    


schofieldmaclap.local (802.11N/2.4GHz) Airport Extreme (gigabit) macpro.local

[schofieldmaclap:tmp]$ scp ApertureTrial.dmg macpro.local:/tmp/
ApertureTrial.dmg                             100%  246MB   7.5MB/s   00:33    
[schofieldmaclap:tmp]$ scp ApertureTrial.dmg macpro.local:/tmp/
ApertureTrial.dmg                             100%  246MB   8.5MB/s   00:29    


schofieldmaclap.local (802.11N/5.0GHz) Airport Extreme (gigabit) macpro.local

[schofieldmaclap:tmp]$ scp ApertureTrial.dmg macpro.local:/tmp/
ApertureTrial.dmg                             100%  246MB   3.5MB/s   01:11    
[schofieldmaclap:tmp]$ scp ApertureTrial.dmg macpro.local:/tmp/
ApertureTrial.dmg                             100%  246MB   3.5MB/s   01:11    &lt;/pre&gt;

&lt;p&gt;I guess I&#39;ll be switching to 802.11N/G/B compatible mode.&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://dev.ragfield.com/feeds/8219108494317841844/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/7147569507271803579/8219108494317841844' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7147569507271803579/posts/default/8219108494317841844'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7147569507271803579/posts/default/8219108494317841844'/><link rel='alternate' type='text/html' href='http://dev.ragfield.com/2009/07/i-thought-80211n-5ghz-was-fastest.html' title='I thought 802.11N 5GHz was the fastest'/><author><name>Ragfield</name><uri>http://www.blogger.com/profile/12325362017984149251</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='25' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjl1SMlQXOTAV7_F3A5DZg4b2e5eimTTKX9EFIlSIGempd0D7LkUqQQ9cneJqOm9HkcSDncQURdiuKI_uoLJJTJs8hSu7nFDdJ_LNdI1hpdiamXqIc6zPoJtTHCZXpkEA/s220/Ahoy.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7147569507271803579.post-2717035809875013531</id><published>2009-06-18T11:28:00.001-05:00</published><updated>2009-06-18T11:28:28.003-05:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="2D graphics"/><category scheme="http://www.blogger.com/atom/ns#" term="3D graphics"/><category scheme="http://www.blogger.com/atom/ns#" term="mathematica"/><category scheme="http://www.blogger.com/atom/ns#" term="pdf"/><title type='text'>Link: Creating and Post-Processing Mathematica Graphics on Mac OS X</title><content type='html'>&lt;p&gt;&lt;a href=&quot;http://www.uoregon.edu/~noeckel/MathematicaGraphics.html#ExportGraphics&quot;&gt;Creating and Post-Processing Mathematica Graphics on Mac OS X&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This user does a good (and thorough) job at enumerating a number of potential problems one could run into when creating and exporting graphics in Mathematica.  In most cases the user also includes workarounds.  In some cases the user&#39;s assumptions/explanations aren&#39;t technically correct, but the workarounds are still well thought out.&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://dev.ragfield.com/feeds/2717035809875013531/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/7147569507271803579/2717035809875013531' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7147569507271803579/posts/default/2717035809875013531'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7147569507271803579/posts/default/2717035809875013531'/><link rel='alternate' type='text/html' href='http://dev.ragfield.com/2009/06/link-creating-and-post-processing.html' title='Link: Creating and Post-Processing Mathematica Graphics on Mac OS X'/><author><name>Ragfield</name><uri>http://www.blogger.com/profile/12325362017984149251</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='25' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjl1SMlQXOTAV7_F3A5DZg4b2e5eimTTKX9EFIlSIGempd0D7LkUqQQ9cneJqOm9HkcSDncQURdiuKI_uoLJJTJs8hSu7nFDdJ_LNdI1hpdiamXqIc6zPoJtTHCZXpkEA/s220/Ahoy.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7147569507271803579.post-5288252092313024397</id><published>2009-05-21T23:15:00.001-05:00</published><updated>2009-05-21T23:30:41.152-05:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="2D graphics"/><category scheme="http://www.blogger.com/atom/ns#" term="mathematica"/><category scheme="http://www.blogger.com/atom/ns#" term="statistics"/><category scheme="http://www.blogger.com/atom/ns#" term="twitter"/><title type='text'>Twitter usage patterns</title><content type='html'>&lt;div class=&quot;Text&quot;&gt;What kind of Twitterer am I?  I&amp;apos;m kind of on a role with this data mining of Twitter so I&amp;apos;ll take a brief look at my own Twitter habits.&lt;/div&gt;
&lt;div class=&quot;Input&quot;&gt;&amp;lt;&amp;lt;Twitter`&lt;/div&gt;
&lt;div class=&quot;Input&quot;&gt;session = TwitterSessionOpen[&lt;span style=&quot;color: #666666;&quot;&gt;&amp;quot;User&amp;quot;&lt;/span&gt;-&amp;gt;&lt;span style=&quot;color: #666666;&quot;&gt;&amp;quot;ragfield&amp;quot;&lt;/span&gt;]&lt;/div&gt;
&lt;div class=&quot;Output&quot;&gt;TwitterSession[&amp;lt;ragfield&amp;gt;]&lt;/div&gt;
&lt;div class=&quot;Input&quot;&gt;Length[tweets = TwitterUserAllTimeline[session]]&lt;/div&gt;
&lt;div class=&quot;Output&quot;&gt;1487&lt;/div&gt;
&lt;div class=&quot;Input&quot;&gt;DateDifference[TwitterStatusDate@Last@tweets, TwitterStatusDate@First@tweets, {&lt;span style=&quot;color: #666666;&quot;&gt;&amp;quot;Year&amp;quot;&lt;/span&gt;, &lt;span style=&quot;color: #666666;&quot;&gt;&amp;quot;Month&amp;quot;&lt;/span&gt;, &lt;span style=&quot;color: #666666;&quot;&gt;&amp;quot;Day&amp;quot;&lt;/span&gt;}]&lt;/div&gt;
&lt;div class=&quot;Output&quot;&gt;{{1, Year}, {3, Month}, {20.83855324074074`, Day}}&lt;/div&gt;
&lt;div class=&quot;Input&quot;&gt;Length[tweets] / DateDifference[TwitterStatusDate@Last@tweets, TwitterStatusDate@First@tweets, {&lt;span style=&quot;color: #666666;&quot;&gt;&amp;quot;Day&amp;quot;&lt;/span&gt;}][[1, 1]]&lt;/div&gt;
&lt;div class=&quot;Output&quot;&gt;3.125009501379522`&lt;/div&gt;
&lt;div class=&quot;Text&quot;&gt;1487 total tweets in the last 1 year, 3 months, and 21 days.  On average that&amp;apos;s 3.125 tweets per day.&lt;/div&gt;
&lt;div class=&quot;Input&quot;&gt;DateListPlot[Tally[{&lt;span style=&quot;color: #428957;font-style:italic;&quot;&gt;#&lt;/span&gt;[[1]], &lt;span style=&quot;color: #428957;font-style:italic;&quot;&gt;#&lt;/span&gt;[[2]], 1, 0, 0, 0.}&amp;amp;/@(TwitterStatusDate/@tweets)], Joined-&amp;gt;True, Filling-&amp;gt;Axis, FrameLabel-&amp;gt;{&lt;span style=&quot;color: #666666;&quot;&gt;&amp;quot;Month&amp;quot;&lt;/span&gt;, &lt;span style=&quot;color: #666666;&quot;&gt;&amp;quot;Tweets per month&amp;quot;&lt;/span&gt;}, PlotLabel-&amp;gt;&lt;span style=&quot;color: #666666;&quot;&gt;&amp;quot;Ragfield Twitter usage&amp;quot;&lt;/span&gt;, DateTicksFormat-&amp;gt;{&lt;span style=&quot;color: #666666;&quot;&gt;&amp;quot;MonthNameShort&amp;quot;&lt;/span&gt;, &lt;span style=&quot;color: #666666;&quot;&gt;&amp;quot; &amp;quot;&lt;/span&gt;, &lt;span style=&quot;color: #666666;&quot;&gt;&amp;quot;Year&amp;quot;&lt;/span&gt;}]&lt;/div&gt;
&lt;div class=&quot;Output&quot;&gt;&lt;a href=&quot;http://www.flickr.com/photos/10274904@N05/3552649133&quot; title=&quot;View &#39;Ragfield Twitter usage&#39; on Flickr.com&quot;&gt;&lt;img style=&quot;border:none;&quot; src=&quot;http://farm3.static.flickr.com/2470/3552649133_8783fd5809_o.png&quot; alt=&quot;Ragfield Twitter usage&quot; border=&quot;0&quot; width=&quot;360&quot; height=&quot;257&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;Input&quot;&gt;Total[StringLength[TwitterStatusText[&lt;span style=&quot;color: #428957;font-style:italic;&quot;&gt;#&lt;/span&gt;]]&amp;amp;/@tweets]&lt;/div&gt;
&lt;div class=&quot;Output&quot;&gt;107442&lt;/div&gt;
&lt;div class=&quot;Input&quot;&gt;N[% / Length[tweets]]&lt;/div&gt;
&lt;div class=&quot;Output&quot;&gt;72.2542030934768`&lt;/div&gt;
&lt;div class=&quot;Text&quot;&gt;107,442 total characters typed.  On average that&amp;apos;s 72 characters per tweet, roughly half the allotted space.&lt;/div&gt;
&lt;div class=&quot;Input&quot;&gt;First@SortBy[TwitterStatusText/@tweets, StringLength]&lt;/div&gt;
&lt;div class=&quot;Output&quot;&gt;bed&lt;/div&gt;
&lt;div class=&quot;Text&quot;&gt;My shortest tweet was simply &amp;quot;bed&amp;quot;.&lt;/div&gt;
&lt;div class=&quot;Input&quot;&gt;Length[allWords = StringSplit[StringJoin[Riffle[TwitterStatusText/@tweets,  &lt;span style=&quot;color: #666666;&quot;&gt;&amp;quot; &amp;quot;&lt;/span&gt;]], Except[WordCharacter|&lt;span style=&quot;color: #666666;&quot;&gt;&amp;quot;&amp;apos;&amp;quot;&lt;/span&gt;]..]]&lt;/div&gt;
&lt;div class=&quot;Output&quot;&gt;19188&lt;/div&gt;
&lt;div class=&quot;Text&quot;&gt;19,188 unique words typed.&lt;/div&gt;
&lt;div class=&quot;Input&quot;&gt;Length[allWords = DeleteCases[allWords, x_/;StringMatchQ[x, DigitCharacter..]]]&lt;/div&gt;
&lt;div class=&quot;Output&quot;&gt;18528&lt;/div&gt;
&lt;div class=&quot;Text&quot;&gt;18,528 if you don&amp;apos;t count numbers.&lt;/div&gt;
&lt;div class=&quot;Input&quot;&gt;First@Reverse@SortBy[Tally[allWords], Part[&lt;span style=&quot;color: #428957;font-style:italic;&quot;&gt;#&lt;/span&gt;, 2]&amp;amp;]&lt;/div&gt;
&lt;div class=&quot;Output&quot;&gt;{the, 604}&lt;/div&gt;
&lt;div class=&quot;Text&quot;&gt;The most common word I&amp;apos;ve typed is &amp;quot;the&amp;quot;.  That&amp;apos;s not terribly useful.  Let&amp;apos;s take a look at just nouns to see what kind of topics I mention most frequently.&lt;/div&gt;
&lt;div class=&quot;Input&quot;&gt;Length[nouns = Cases[allWords, x_/;MemberQ[WordData[x], &lt;span style=&quot;color: #666666;&quot;&gt;&amp;quot;Noun&amp;quot;&lt;/span&gt;, ‚àû]]]&lt;/div&gt;
&lt;div class=&quot;Output&quot;&gt;7883&lt;/div&gt;
&lt;div class=&quot;Input&quot;&gt;Grid[Take[Reverse@SortBy[Tally[nouns], Part[&lt;span style=&quot;color: #428957;font-style:italic;&quot;&gt;#&lt;/span&gt;, 2]&amp;amp;], 30], Alignment-&amp;gt;{{Right, Left}}]&lt;/div&gt;
&lt;div class=&quot;Output&quot;&gt;&lt;table border=&quot;1&quot;&gt;
&lt;tr&gt;&lt;td&gt;I&lt;/td&gt;&lt;td&gt;431&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;a&lt;/td&gt;&lt;td&gt;419&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;in&lt;/td&gt;&lt;td&gt;259&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;at&lt;/td&gt;&lt;td&gt;126&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;have&lt;/td&gt;&lt;td&gt;77&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;bike&lt;/td&gt;&lt;td&gt;62&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;work&lt;/td&gt;&lt;td&gt;54&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;time&lt;/td&gt;&lt;td&gt;52&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;out&lt;/td&gt;&lt;td&gt;51&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;are&lt;/td&gt;&lt;td&gt;48&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;ride&lt;/td&gt;&lt;td&gt;45&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;think&lt;/td&gt;&lt;td&gt;43&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;so&lt;/td&gt;&lt;td&gt;43&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;run&lt;/td&gt;&lt;td&gt;43&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;now&lt;/td&gt;&lt;td&gt;42&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;like&lt;/td&gt;&lt;td&gt;42&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;one&lt;/td&gt;&lt;td&gt;38&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;d&lt;/td&gt;&lt;td&gt;38&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;morning&lt;/td&gt;&lt;td&gt;36&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;last&lt;/td&gt;&lt;td&gt;36&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;can&lt;/td&gt;&lt;td&gt;36&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;race&lt;/td&gt;&lt;td&gt;35&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;miles&lt;/td&gt;&lt;td&gt;35&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;mile&lt;/td&gt;&lt;td&gt;35&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;home&lt;/td&gt;&lt;td&gt;35&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;first&lt;/td&gt;&lt;td&gt;35&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;way&lt;/td&gt;&lt;td&gt;34&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;still&lt;/td&gt;&lt;td&gt;34&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;year&lt;/td&gt;&lt;td&gt;31&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;good&lt;/td&gt;&lt;td&gt;31&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;div class=&quot;Text&quot;&gt;Most common topics: bike, work, time, ride, think, run, like, morning, race, mile(s), home.&lt;/div&gt;
&lt;div class=&quot;Text&quot;&gt;We can do the same thing with verbs to see what kind of actions I describe most frequently.&lt;/div&gt;
&lt;div class=&quot;Input&quot;&gt;Length[verbs = Cases[allWords, x_/;MemberQ[WordData[x], &lt;span style=&quot;color: #666666;&quot;&gt;&amp;quot;Verb&amp;quot;&lt;/span&gt;, ‚àû]]]&lt;/div&gt;
&lt;div class=&quot;Output&quot;&gt;4300&lt;/div&gt;
&lt;div class=&quot;Input&quot;&gt;Grid[Take[Reverse@SortBy[Tally[verbs], Part[&lt;span style=&quot;color: #428957;font-style:italic;&quot;&gt;#&lt;/span&gt;, 2]&amp;amp;], 30], Alignment-&amp;gt;{{Right, Left}}]&lt;/div&gt;
&lt;div class=&quot;Output&quot;&gt;&lt;table border=&quot;1&quot;&gt;
&lt;tr&gt;&lt;td&gt;is&lt;/td&gt;&lt;td&gt;164&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;was&lt;/td&gt;&lt;td&gt;108&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;be&lt;/td&gt;&lt;td&gt;80&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;have&lt;/td&gt;&lt;td&gt;77&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;bike&lt;/td&gt;&lt;td&gt;62&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;up&lt;/td&gt;&lt;td&gt;59&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;work&lt;/td&gt;&lt;td&gt;54&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;time&lt;/td&gt;&lt;td&gt;52&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;out&lt;/td&gt;&lt;td&gt;51&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;ride&lt;/td&gt;&lt;td&gt;45&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;been&lt;/td&gt;&lt;td&gt;44&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;think&lt;/td&gt;&lt;td&gt;43&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;run&lt;/td&gt;&lt;td&gt;43&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;has&lt;/td&gt;&lt;td&gt;43&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;like&lt;/td&gt;&lt;td&gt;42&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;last&lt;/td&gt;&lt;td&gt;36&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;can&lt;/td&gt;&lt;td&gt;36&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;race&lt;/td&gt;&lt;td&gt;35&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;home&lt;/td&gt;&lt;td&gt;35&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;still&lt;/td&gt;&lt;td&gt;34&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;had&lt;/td&gt;&lt;td&gt;32&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;got&lt;/td&gt;&lt;td&gt;32&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;get&lt;/td&gt;&lt;td&gt;30&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;do&lt;/td&gt;&lt;td&gt;30&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;back&lt;/td&gt;&lt;td&gt;28&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;long&lt;/td&gt;&lt;td&gt;27&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;will&lt;/td&gt;&lt;td&gt;26&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;see&lt;/td&gt;&lt;td&gt;26&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;did&lt;/td&gt;&lt;td&gt;25&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;know&lt;/td&gt;&lt;td&gt;24&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;div class=&quot;Text&quot;&gt;Most common actions: bike, work, ride, think, run, race, see, know.  I guess there&amp;apos;s a lot of overlap between the nouns and the verbs.&lt;/div&gt;
&lt;div class=&quot;Text&quot;&gt;It&amp;apos;s also pretty easy to determine the other users I mention most frequently.&lt;/div&gt;
&lt;div class=&quot;Input&quot;&gt;Grid[Take[Reverse@SortBy[Tally[StringCases[StringJoin[Riffle[TwitterStatusText/@tweets,  &lt;span style=&quot;color: #666666;&quot;&gt;&amp;quot; &amp;quot;&lt;/span&gt;]], &lt;span style=&quot;color: #666666;&quot;&gt;&amp;quot;@&amp;quot;&lt;/span&gt;~~a:Except[WhitespaceCharacter]..:&amp;gt;Hyperlink[ToLowerCase[a], &lt;span style=&quot;color: #666666;&quot;&gt;&amp;quot;http://twitter.com/&amp;quot;&lt;/span&gt;&amp;lt;&amp;gt;ToLowerCase[a]]]], Part[&lt;span style=&quot;color: #428957;font-style:italic;&quot;&gt;#&lt;/span&gt;, 2]&amp;amp;], 10]]&lt;/div&gt;
&lt;div class=&quot;Output&quot;&gt;&lt;table border=&quot;1&quot;&gt;
&lt;tr&gt;&lt;td&gt;&lt;a href=&quot;http://twitter.com/melissa_raguet&quot;&gt;melissa_raguet&lt;/a&gt;&lt;/td&gt;&lt;td&gt;84&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;a href=&quot;http://twitter.com/spoonshake&quot;&gt;spoonshake&lt;/a&gt;&lt;/td&gt;&lt;td&gt;69&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;a href=&quot;http://twitter.com/esmithrunner&quot;&gt;esmithrunner&lt;/a&gt;&lt;/td&gt;&lt;td&gt;32&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;a href=&quot;http://twitter.com/erik_d&quot;&gt;erik_d&lt;/a&gt;&lt;/td&gt;&lt;td&gt;28&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;a href=&quot;http://twitter.com/dbfulton&quot;&gt;dbfulton&lt;/a&gt;&lt;/td&gt;&lt;td&gt;18&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;a href=&quot;http://twitter.com/gutzville&quot;&gt;gutzville&lt;/a&gt;&lt;/td&gt;&lt;td&gt;14&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;a href=&quot;http://twitter.com/ultrashea&quot;&gt;ultrashea&lt;/a&gt;&lt;/td&gt;&lt;td&gt;11&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;a href=&quot;http://twitter.com/erik__d&quot;&gt;erik__d&lt;/a&gt;&lt;/td&gt;&lt;td&gt;9&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;a href=&quot;http://twitter.com/adamengst&quot;&gt;adamengst&lt;/a&gt;&lt;/td&gt;&lt;td&gt;9&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;a href=&quot;http://twitter.com/chockenberry&quot;&gt;chockenberry&lt;/a&gt;&lt;/td&gt;&lt;td&gt;6&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;div class=&quot;Subsection&quot;&gt;Downloads&lt;/div&gt;
&lt;div class=&quot;Text&quot;&gt;&lt;a href=&quot;http://ragfield-packages.googlecode.com/svn/trunk/Twitter.m&quot;&gt;Download Twitter.m&lt;/a&gt;.&lt;/div&gt;
&lt;div class=&quot;Text&quot;&gt;&lt;a href=&quot;http://ragfield-packages.googlecode.com/svn/trunk/WebUtils.m&quot;&gt;Download WebUtils.m&lt;/a&gt; (required by Twitter.m).&lt;/div&gt;
&lt;div class=&quot;Text&quot;&gt;&lt;a href=&quot;http://sites.google.com/site/ragfield/dev/2009-05-21-TwitterUsageAnalysis.nb?attredirects=0&quot;&gt;Download Mathematica Notebook&lt;/a&gt;.&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dev.ragfield.com/feeds/5288252092313024397/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/7147569507271803579/5288252092313024397' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7147569507271803579/posts/default/5288252092313024397'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7147569507271803579/posts/default/5288252092313024397'/><link rel='alternate' type='text/html' href='http://dev.ragfield.com/2009/05/twitter-usage-patterns.html' title='Twitter usage patterns'/><author><name>Ragfield</name><uri>http://www.blogger.com/profile/12325362017984149251</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='25' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjl1SMlQXOTAV7_F3A5DZg4b2e5eimTTKX9EFIlSIGempd0D7LkUqQQ9cneJqOm9HkcSDncQURdiuKI_uoLJJTJs8hSu7nFDdJ_LNdI1hpdiamXqIc6zPoJtTHCZXpkEA/s220/Ahoy.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7147569507271803579.post-6951769468085994584</id><published>2009-05-20T23:54:00.001-05:00</published><updated>2009-05-21T00:03:38.908-05:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="2D graphics"/><category scheme="http://www.blogger.com/atom/ns#" term="mathematica"/><category scheme="http://www.blogger.com/atom/ns#" term="statistics"/><category scheme="http://www.blogger.com/atom/ns#" term="twitter"/><category scheme="http://www.blogger.com/atom/ns#" term="wolframalpha"/><title type='text'>Wolfram|Alpha tweet analysis</title><content type='html'>&lt;div class=&quot;Text&quot;&gt;Last month &lt;a href=&quot;http://dev.ragfield.com/2009/04/twittering-with-mathematica.html&quot;&gt;I wrote&lt;/a&gt; about my &lt;a href=&quot;http://ragfield-packages.googlecode.com/svn/trunk/Twitter.m&quot;&gt;Twitter package&lt;/a&gt; for &lt;span style=&quot;font-style:italic;&quot;&gt;Mathematica&lt;/span&gt;.  Shortly thereafter I wrote a &lt;a href=&quot;http://blog.wolfram.com/2009/04/30/twittering-with-mathematica/&quot;&gt;similar post&lt;/a&gt; for my company&amp;apos;s blog.  That post seems to have been well received and has generated &lt;a href=&quot;http://search.twitter.com/search?q=twitter+mathematica&quot;&gt;quite a bit of interest&lt;/a&gt; on &lt;a href=&quot;http://twitter.com/&quot;&gt;Twitter&lt;/a&gt;.&lt;/div&gt;
&lt;div class=&quot;Subsection&quot;&gt;Search&lt;/div&gt;
&lt;div class=&quot;Text&quot;&gt;I have continued to add useful features to the package, including the ability to search Twitter.&lt;/div&gt;
&lt;div class=&quot;Input&quot;&gt;&amp;lt;&amp;lt;Twitter`&lt;/div&gt;
&lt;div class=&quot;Input&quot;&gt;Column[Take[TwitterSearch[&lt;span style=&quot;color: #666666;&quot;&gt;&amp;quot;twitter mathematica&amp;quot;&lt;/span&gt;], 5], Dividers-&amp;gt;All]&lt;/div&gt;
&lt;div class=&quot;Output&quot;&gt;&lt;table border=&quot;1&quot;&gt;
&lt;tr&gt;&lt;td&gt;TwitterStatus[&amp;lt;netzturbine: ‚ô∫ @imabug cool, mathematica + the twitter API http://bit.ly/1Wv0iV - should work w/ !laconica 2&amp;gt;]&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;TwitterStatus[&amp;lt;imabug: cool, mathematica and the twitter API http://bit.ly/1Wv0iV&amp;gt;]&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;TwitterStatus[&amp;lt;kdrewien: RT @PragueBob Wolframs mainstream Mathematica software is plugging into Twitter: http://cli.gs/257htM Geeky!&amp;gt;]&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;TwitterStatus[&amp;lt;lunajade: How to Twitter with Mathematica and analyze the data... http://bit.ly/14WA8F (via @WolframResearch) [VERY interesting...]&amp;gt;]&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;TwitterStatus[&amp;lt;pythonism: http://twitter.com/MikeCr/statuses/1835493378 &amp;quot;@ruby_gem Mathematica, firefox, python&amp;quot;&amp;gt;]&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;div class=&quot;Text&quot;&gt;Adding this functionality was actually a little more difficult than it should have been because the Twitter search API returns a different flavor of XML (ATOM) than the regular Twitter API.&lt;/div&gt;
&lt;div class=&quot;Text&quot;&gt;Also, I renamed the HTTP.m package (which was used by Twitter.m) to WebUtils.m and I added some other useful functionality, including the ability to interact with a few popular URL shortening/expanding services.  This has enabled some interesting possibilities.&lt;/div&gt;
&lt;div class=&quot;Subsection&quot;&gt;Tweet cache&lt;/div&gt;
&lt;div class=&quot;Text&quot;&gt;As you may already know, &lt;a href=&quot;http://www.wolframalpha.com/&quot;&gt;Wolfram|Alpha&lt;/a&gt; launched this past weekend.  The website went live on Friday evening and the official launch was Monday afternoon.  Sometime Friday afternoon I started running a short &lt;span style=&quot;font-style:italic;&quot;&gt;Mathematica&lt;/span&gt; program that used the TwitterSearch[] function to download all tweets mentioning Wolfram|Alpha and stuff them into an SQLite database.  The program is still running, downloading new tweets as they happen.&lt;/div&gt;
&lt;div class=&quot;Input&quot;&gt;db = Database`OpenDatabase[&lt;span style=&quot;color: #666666;&quot;&gt;&amp;quot;Twitter.sqlite&amp;quot;&lt;/span&gt;]&lt;/div&gt;
&lt;div class=&quot;Output&quot;&gt;Database`Database[Twitter.sqlite]&lt;/div&gt;
&lt;div class=&quot;Input&quot;&gt;Database`QueryDatabase[db,  &lt;span style=&quot;color: #666666;&quot;&gt;&amp;quot;CREATE TABLE tweets (id INTEGER PRIMARY KEY, text TEXT, source TEXT, created_at DATE, in_reply_to_status_id INTEGER, in_reply_to_user_id INTEGER, in_reply_to_screen_name TEXT, user_id INTEGER, user_screen_name TEXT, user_name TEXT, user_profile_image_url TEXT);&amp;quot;&lt;/span&gt;];&lt;/div&gt;
&lt;div class=&quot;Input&quot;&gt;TwitterStatusDateDBString[&lt;span style=&quot;color: #428957;font-style:italic;&quot;&gt;status_TwitterStatus&lt;/span&gt;] := &lt;br/&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;DateString[TwitterStatusDate[&lt;span style=&quot;color: #428957;font-style:italic;&quot;&gt;status&lt;/span&gt;],  {&lt;br/&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&lt;span style=&quot;color: #666666;&quot;&gt;&amp;quot;Year&amp;quot;&lt;/span&gt;, &lt;span style=&quot;color: #666666;&quot;&gt;&amp;quot;-&amp;quot;&lt;/span&gt;, &lt;span style=&quot;color: #666666;&quot;&gt;&amp;quot;Month&amp;quot;&lt;/span&gt;, &lt;span style=&quot;color: #666666;&quot;&gt;&amp;quot;-&amp;quot;&lt;/span&gt;, &lt;span style=&quot;color: #666666;&quot;&gt;&amp;quot;Day&amp;quot;&lt;/span&gt;, &lt;span style=&quot;color: #666666;&quot;&gt;&amp;quot; &amp;quot;&lt;/span&gt;, &lt;br/&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&lt;span style=&quot;color: #666666;&quot;&gt;&amp;quot;Hour&amp;quot;&lt;/span&gt;, &lt;span style=&quot;color: #666666;&quot;&gt;&amp;quot;:&amp;quot;&lt;/span&gt;, &lt;span style=&quot;color: #666666;&quot;&gt;&amp;quot;Minute&amp;quot;&lt;/span&gt;,  &lt;span style=&quot;color: #666666;&quot;&gt;&amp;quot;:&amp;quot;&lt;/span&gt;,  &lt;span style=&quot;color: #666666;&quot;&gt;&amp;quot;Second&amp;quot;&lt;/span&gt;&lt;br/&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;}];&lt;/div&gt;
&lt;div class=&quot;Input&quot;&gt;InsertTweet[&lt;span style=&quot;color: #428957;font-style:italic;&quot;&gt;db_Database`Database&lt;/span&gt;, &lt;span style=&quot;color: #428957;font-style:italic;&quot;&gt;status_TwitterStatus&lt;/span&gt;]:=Module[{&lt;span style=&quot;color: #428957;&quot;&gt;query&lt;/span&gt;, &lt;span style=&quot;color: #428957;&quot;&gt;user&lt;/span&gt;, &lt;span style=&quot;color: #428957;&quot;&gt;vals&lt;/span&gt;}, &lt;span style=&quot;color: #428957;&quot;&gt;query&lt;/span&gt; = &lt;span style=&quot;color: #666666;&quot;&gt;&amp;quot;INSERT INTO tweets (id, text, source, created_at, in_reply_to_status_id, in_reply_to_user_id, user_screen_name, user_name, user_profile_image_url) values (?, ?, ?, ?, ?, ?, ?, ?, ?)&amp;quot;&lt;/span&gt;;&lt;br/&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&lt;span style=&quot;color: #428957;&quot;&gt;user&lt;/span&gt; = TwitterStatusUser[&lt;span style=&quot;color: #428957;font-style:italic;&quot;&gt;status&lt;/span&gt;];&lt;br/&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&lt;span style=&quot;color: #428957;&quot;&gt;vals&lt;/span&gt; = {&lt;br/&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;TwitterStatusID[&lt;span style=&quot;color: #428957;font-style:italic;&quot;&gt;status&lt;/span&gt;], &lt;br/&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;TwitterStatusText[&lt;span style=&quot;color: #428957;font-style:italic;&quot;&gt;status&lt;/span&gt;], &lt;br/&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;TwitterStatusSource[&lt;span style=&quot;color: #428957;font-style:italic;&quot;&gt;status&lt;/span&gt;], &lt;br/&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;TwitterStatusDateDBString[&lt;span style=&quot;color: #428957;font-style:italic;&quot;&gt;status&lt;/span&gt;], &lt;br/&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;TwitterStatusReplyID[&lt;span style=&quot;color: #428957;font-style:italic;&quot;&gt;status&lt;/span&gt;], &lt;br/&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;TwitterStatusReplyUserID[&lt;span style=&quot;color: #428957;font-style:italic;&quot;&gt;status&lt;/span&gt;], &lt;br/&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;TwitterUserScreenName[&lt;span style=&quot;color: #428957;&quot;&gt;user&lt;/span&gt;], &lt;br/&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;TwitterUserName[&lt;span style=&quot;color: #428957;&quot;&gt;user&lt;/span&gt;], &lt;br/&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;TwitterUserProfileImageURL[&lt;span style=&quot;color: #428957;&quot;&gt;user&lt;/span&gt;]&lt;br/&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;};&lt;br/&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;Database`QueryDatabase[&lt;span style=&quot;color: #428957;font-style:italic;&quot;&gt;db&lt;/span&gt;, &lt;span style=&quot;color: #428957;&quot;&gt;query&lt;/span&gt;, &lt;span style=&quot;color: #428957;&quot;&gt;vals&lt;/span&gt;]&lt;br/&gt;
];&lt;/div&gt;
&lt;div class=&quot;Input&quot;&gt;query = &lt;span style=&quot;color: #666666;&quot;&gt;&amp;quot;wolframalpha OR wolfram_alpha OR \&amp;quot;wolfram alpha\&amp;quot;&amp;quot;&lt;/span&gt;;&lt;/div&gt;
&lt;div class=&quot;Input&quot;&gt;TwitterSearchSince[&lt;span style=&quot;color: #428957;font-style:italic;&quot;&gt;query_String&lt;/span&gt;, &lt;span style=&quot;color: #428957;font-style:italic;&quot;&gt;id_Integer&lt;/span&gt;]:=Module[{&lt;span style=&quot;color: #428957;&quot;&gt;tweets&lt;/span&gt; = {}, &lt;span style=&quot;color: #428957;&quot;&gt;lastCount&lt;/span&gt; =  - 1, &lt;span style=&quot;color: #428957;&quot;&gt;page&lt;/span&gt; = 1}, &lt;br/&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;While[Length[&lt;span style=&quot;color: #428957;&quot;&gt;tweets&lt;/span&gt;] =!= &lt;span style=&quot;color: #428957;&quot;&gt;lastCount&lt;/span&gt;, &lt;br/&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&lt;span style=&quot;color: #428957;&quot;&gt;lastCount&lt;/span&gt; = Length[&lt;span style=&quot;color: #428957;&quot;&gt;tweets&lt;/span&gt;];&lt;br/&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&lt;span style=&quot;color: #428957;&quot;&gt;tweets&lt;/span&gt; = Join[&lt;span style=&quot;color: #428957;&quot;&gt;tweets&lt;/span&gt;, &lt;br/&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;TwitterSearch[&lt;span style=&quot;color: #428957;font-style:italic;&quot;&gt;query&lt;/span&gt;, &lt;span style=&quot;color: #666666;&quot;&gt;&amp;quot;Results&amp;quot;&lt;/span&gt;-&amp;gt;100, &lt;span style=&quot;color: #666666;&quot;&gt;&amp;quot;Since&amp;quot;&lt;/span&gt;-&amp;gt;&lt;span style=&quot;color: #428957;font-style:italic;&quot;&gt;id&lt;/span&gt;, &lt;span style=&quot;color: #666666;&quot;&gt;&amp;quot;Page&amp;quot;&lt;/span&gt;-&amp;gt;&lt;span style=&quot;color: #428957;&quot;&gt;page&lt;/span&gt;++]&lt;br/&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;]&lt;br/&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;];&lt;br/&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&lt;span style=&quot;color: #428957;&quot;&gt;tweets&lt;/span&gt;&lt;br/&gt;
];&lt;/div&gt;
&lt;div class=&quot;Input&quot;&gt;since = TwitterStatusID[First[TwitterSearch[query]]];&lt;/div&gt;
&lt;div class=&quot;Input&quot;&gt;UpdateCache[]:=While[True, &lt;br/&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;tweets = TwitterSearchSince[query, since];&lt;br/&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;Monitor[&lt;br/&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;Do[InsertTweet[db, tweets[[i]]], {i, Length[tweets]}], ProgressIndicator[Dynamic[i/Length[tweets]]]&lt;br/&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;];&lt;br/&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;since = If[Length[tweets]&amp;gt;0, TwitterStatusID[First[tweets]], since];&lt;br/&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;Print[&lt;span style=&quot;color: #666666;&quot;&gt;&amp;quot;added &amp;quot;&lt;/span&gt;, ToString[Length[tweets]], &lt;span style=&quot;color: #666666;&quot;&gt;&amp;quot; tweets to database at &amp;quot;&lt;/span&gt;, DateString[]];&lt;br/&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;Pause[30]&lt;br/&gt;
];&lt;/div&gt;
&lt;div class=&quot;Input&quot;&gt;UpdateCache[]&lt;/div&gt;
&lt;div class=&quot;Text&quot;&gt;I chose SQLite because it&amp;apos;s easy to use, it&amp;apos;s included with &lt;span style=&quot;font-style:italic;&quot;&gt;Mathematica&lt;/span&gt; (though possibly undocumented), it can be accessed easily via a command line tool, and it can be safely accessed by multiple processes at the same time.  I started the program five days ago and it&amp;apos;s still running.  I am able to query the database from a different &lt;span style=&quot;font-style:italic;&quot;&gt;Mathematica&lt;/span&gt; process without interrupting the tweet downloads.&lt;/div&gt;
&lt;div class=&quot;Subsection&quot;&gt;Tweet rate&lt;/div&gt;
&lt;div class=&quot;Text&quot;&gt;So, from the other instance of &lt;span style=&quot;font-style:italic;&quot;&gt;Mathematica&lt;/span&gt; I am able to do things like this.&lt;/div&gt;
&lt;div class=&quot;Input&quot;&gt;db = Database`OpenDatabase[&lt;span style=&quot;color: #666666;&quot;&gt;&amp;quot;Twitter.sqlite&amp;quot;&lt;/span&gt;]&lt;/div&gt;
&lt;div class=&quot;Output&quot;&gt;Database`Database[Twitter.sqlite]&lt;/div&gt;
&lt;div class=&quot;Input&quot;&gt;Length[ids = Database`QueryDatabase[db, &lt;span style=&quot;color: #666666;&quot;&gt;&amp;quot;select id from tweets&amp;quot;&lt;/span&gt;]]&lt;/div&gt;
&lt;div class=&quot;Output&quot;&gt;62659&lt;/div&gt;
&lt;div class=&quot;Text&quot;&gt;62,659 tweets mentioning Wolfram|Alpha between Friday and Wednesday of launch week.  Let&amp;apos;s take a look at the timeline.  First, grab the creation date of each tweet in the database.&lt;/div&gt;
&lt;div class=&quot;Input&quot;&gt;dateStrs = Database`QueryDatabase[db, &lt;span style=&quot;color: #666666;&quot;&gt;&amp;quot;select created_at from tweets&amp;quot;&lt;/span&gt;];&lt;/div&gt;
&lt;div class=&quot;Text&quot;&gt;Convert the strings into &lt;span style=&quot;font-style:italic;&quot;&gt;Mathematica&lt;/span&gt; DateList[] notation.&lt;/div&gt;
&lt;div class=&quot;Input&quot;&gt;dates = Monitor[Table[DateList[dateStrs[[i, 1]]], {i, Length[dateStrs]}], ProgressIndicator[Dynamic[i / Length[dateStrs]]]];&lt;/div&gt;
&lt;div class=&quot;Text&quot;&gt;Tally the number of tweets per hour.&lt;/div&gt;
&lt;div class=&quot;Input&quot;&gt;tally = Tally[{&lt;span style=&quot;color: #428957;font-style:italic;&quot;&gt;#&lt;/span&gt;[[1]], &lt;span style=&quot;color: #428957;font-style:italic;&quot;&gt;#&lt;/span&gt;[[2]], &lt;span style=&quot;color: #428957;font-style:italic;&quot;&gt;#&lt;/span&gt;[[3]], &lt;span style=&quot;color: #428957;font-style:italic;&quot;&gt;#&lt;/span&gt;[[4]], 0, 0}&amp;amp;/@dates];&lt;/div&gt;
&lt;div class=&quot;Input&quot;&gt;DateListPlot[tally, Joined-&amp;gt;True, FrameLabel-&amp;gt;{&lt;span style=&quot;color: #666666;&quot;&gt;&amp;quot;Date&amp;quot;&lt;/span&gt;, &lt;span style=&quot;color: #666666;&quot;&gt;&amp;quot;Tweets per hour&amp;quot;&lt;/span&gt;}, PlotRange-&amp;gt;{{First[dates], DatePlus[DateList[], { - 1, &lt;span style=&quot;color: #666666;&quot;&gt;&amp;quot;Hour&amp;quot;&lt;/span&gt;}]}, Automatic}, PlotLabel-&amp;gt;&lt;span style=&quot;color: #666666;&quot;&gt;&amp;quot;Wolfram|Alpha tweet rate&amp;quot;&lt;/span&gt;, Filling-&amp;gt;Axis, ImageSize-&amp;gt;{500, Automatic}]&lt;/div&gt;
&lt;div class=&quot;Output&quot;&gt;&lt;a href=&quot;http://www.flickr.com/photos/10274904@N05/3550875670&quot; title=&quot;View &#39;Wolfram|Alpha tweet rate&#39; on Flickr.com&quot;&gt;&lt;img style=&quot;border:none;&quot; src=&quot;http://farm4.static.flickr.com/3364/3550875670_efe9f58354_o.png&quot; alt=&quot;Wolfram|Alpha tweet rate&quot; border=&quot;0&quot; width=&quot;500&quot; height=&quot;342&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;Text&quot;&gt;There are large spikes in tweets per hour around the time the website went live on Friday evening, and again when the site officially launched on Monday.&lt;/div&gt;
&lt;div class=&quot;Subsection&quot;&gt;Tweet links&lt;/div&gt;
&lt;div class=&quot;Text&quot;&gt;Since many people post URLs in their tweets it might be interesting to take a look at these to see which web pages and blogs about Wolfram|Alpha are generating the most interest.&lt;/div&gt;
&lt;div class=&quot;Input&quot;&gt;tweets = Database`QueryDatabase[db, &lt;span style=&quot;color: #666666;&quot;&gt;&amp;quot;select text from tweets&amp;quot;&lt;/span&gt;][[All, 1]];&lt;/div&gt;
&lt;div class=&quot;Text&quot;&gt;There is a wide variation in the way people post URLs to Twitter, so unfortunately I couldn&amp;apos;t find a single regular expression that would find every single one of them.  This one works reasonably well.&lt;/div&gt;
&lt;div class=&quot;Input&quot;&gt;Length[urls = Flatten[StringCases[&lt;span style=&quot;color: #428957;font-style:italic;&quot;&gt;#&lt;/span&gt;, &lt;span style=&quot;color: #666666;&quot;&gt;&amp;quot;http://&amp;quot;&lt;/span&gt;~~Except[&lt;span style=&quot;color: #666666;&quot;&gt;&amp;quot;&amp;gt;&amp;quot;&lt;/span&gt;|&lt;span style=&quot;color: #666666;&quot;&gt;&amp;quot;]&amp;quot;&lt;/span&gt;|&lt;span style=&quot;color: #666666;&quot;&gt;&amp;quot;\&amp;quot;&amp;quot;&lt;/span&gt;|&lt;span style=&quot;color: #666666;&quot;&gt;&amp;quot;&amp;apos;&amp;quot;&lt;/span&gt;|&lt;span style=&quot;color: #666666;&quot;&gt;&amp;quot;,&amp;quot;&lt;/span&gt;|WhitespaceCharacter]..]&amp;amp;/@tweets]]&lt;/div&gt;
&lt;div class=&quot;Output&quot;&gt;37565&lt;/div&gt;
&lt;div class=&quot;Input&quot;&gt;Length[tally = Tally[urls]]&lt;/div&gt;
&lt;div class=&quot;Output&quot;&gt;17969&lt;/div&gt;
&lt;div class=&quot;Text&quot;&gt;So there appear to be 37,565 links posted, 17,969 of which are unique.  The thing about these URLs is that many use URL shortening services.  So it&amp;apos;s quite possible many shortened URLs point to the same destination URL.  No matter.  We can use the URLExpand[] function in my WebUtils package to expand URLs from many of the common URL shortening services.&lt;/div&gt;
&lt;div class=&quot;Text&quot;&gt;Unfortunately, that much network traffic takes a long time.  So let&amp;apos;s cache the results as a list of rules so we can avoid future lookups of the same short URL if possible.&lt;/div&gt;
&lt;div class=&quot;Input&quot;&gt;urlMap = {};&lt;/div&gt;
&lt;div class=&quot;Input&quot;&gt;expandURL[&lt;span style=&quot;color: #428957;font-style:italic;&quot;&gt;url_String&lt;/span&gt;] := Module[&lt;br/&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;{&lt;span style=&quot;color: #428957;&quot;&gt;newurl&lt;/span&gt;}, &lt;br/&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&lt;span style=&quot;color: #428957;&quot;&gt;newurl&lt;/span&gt; =  &lt;span style=&quot;color: #428957;font-style:italic;&quot;&gt;url&lt;/span&gt; /. urlMap;&lt;br/&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;If[&lt;span style=&quot;color: #428957;&quot;&gt;newurl&lt;/span&gt; === &lt;span style=&quot;color: #428957;font-style:italic;&quot;&gt;url&lt;/span&gt;, &lt;br/&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&lt;span style=&quot;color: #428957;&quot;&gt;newurl&lt;/span&gt; = URLExpand[&lt;span style=&quot;color: #428957;font-style:italic;&quot;&gt;url&lt;/span&gt;];&lt;br/&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;If[&lt;span style=&quot;color: #428957;&quot;&gt;newurl&lt;/span&gt; =!= &lt;span style=&quot;color: #428957;font-style:italic;&quot;&gt;url&lt;/span&gt;, AppendTo[urlMap, &lt;span style=&quot;color: #428957;font-style:italic;&quot;&gt;url&lt;/span&gt;-&amp;gt;&lt;span style=&quot;color: #428957;&quot;&gt;newurl&lt;/span&gt;]];&lt;br/&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;];&lt;br/&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&lt;span style=&quot;color: #428957;&quot;&gt;newurl&lt;/span&gt;&lt;br/&gt;
];&lt;/div&gt;
&lt;div class=&quot;Text&quot;&gt;This expansion takes quite some time.&lt;/div&gt;
&lt;div class=&quot;Input&quot;&gt;expanded = Monitor[Table[expandURL[urls[[i]]], {i, Length[urls]}], ProgressIndicator[Dynamic[i / Length[urls]]]];&lt;/div&gt;
&lt;div class=&quot;Input&quot;&gt;Length[tally = Reverse@SortBy[Tally[expanded], Part[&lt;span style=&quot;color: #428957;font-style:italic;&quot;&gt;#&lt;/span&gt;, 2]&amp;amp;]]&lt;/div&gt;
&lt;div class=&quot;Output&quot;&gt;14609&lt;/div&gt;
&lt;div class=&quot;Text&quot;&gt;Let&amp;apos;s take a look at all of the expanded URLs which were posted more than 100 times.&lt;/div&gt;
&lt;div class=&quot;Input&quot;&gt;BarChart[Labeled[Hyperlink[&lt;span style=&quot;color: #428957;font-style:italic;&quot;&gt;#&lt;/span&gt;[[2]], &lt;span style=&quot;color: #428957;font-style:italic;&quot;&gt;#&lt;/span&gt;[[1]]], Rotate[&lt;span style=&quot;color: #428957;font-style:italic;&quot;&gt;#&lt;/span&gt;[[1]], Pi / 2], {Bottom}]&amp;amp;/@Cases[tally, {url_String, n_Integer}/;n&amp;gt;100], ImageSize-&amp;gt;{500, Automatic}]&lt;/div&gt;
&lt;div class=&quot;Output&quot;&gt;&lt;a href=&quot;http://www.flickr.com/photos/10274904@N05/3550069443&quot; title=&quot;View &#39;Wolfram|Alpha tweeted URLs&#39; on Flickr.com&quot;&gt;&lt;img style=&quot;border:none;&quot; src=&quot;http://farm4.static.flickr.com/3575/3550069443_611d1c73a7_o.png&quot; alt=&quot;Wolfram|Alpha tweeted URLs&quot; border=&quot;0&quot; width=&quot;500&quot; height=&quot;311&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;Input&quot;&gt;Grid[{&lt;span style=&quot;color: #428957;font-style:italic;&quot;&gt;#&lt;/span&gt;[[2]], Hyperlink[&lt;span style=&quot;color: #428957;font-style:italic;&quot;&gt;#&lt;/span&gt;[[1]]]}&amp;amp;/@Take[tally, 30], Dividers-&amp;gt;All, Alignment-&amp;gt;{{Right, Left}}]&lt;/div&gt;
&lt;div class=&quot;Output&quot;&gt;&lt;table border=&quot;1&quot;&gt;
&lt;tr&gt;&lt;td&gt;4475&lt;/td&gt;&lt;td&gt;&lt;a href=&quot;http://www.wolframalpha.com/&quot;&gt;http://www.wolframalpha.com/&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;1443&lt;/td&gt;&lt;td&gt;&lt;a href=&quot;http://www.wolframalpha.com/screencast/introducingwolframalpha.html&quot;&gt;http://www.wolframalpha.com/screencast/introducingwolframalpha.html&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;1428&lt;/td&gt;&lt;td&gt;&lt;a href=&quot;http://www.wolframalpha.com&quot;&gt;http://www.wolframalpha.com&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;1004&lt;/td&gt;&lt;td&gt;&lt;a href=&quot;http://mashable.com/2009/05/17/wolfram-easter-eggs/&quot;&gt;http://mashable.com/2009/05/17/wolfram-easter-eggs/&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;590&lt;/td&gt;&lt;td&gt;&lt;a href=&quot;http://mashable.com/2009/05/19/wolfram-alpha-better-than-google/&quot;&gt;http://mashable.com/2009/05/19/wolfram-alpha-better-than-google/&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;528&lt;/td&gt;&lt;td&gt;&lt;a href=&quot;http://mashable.com/2009/05/17/better-wolfram-easter-eggs/&quot;&gt;http://mashable.com/2009/05/17/better-wolfram-easter-eggs/&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;331&lt;/td&gt;&lt;td&gt;&lt;a href=&quot;http://nakedoncam.info/free&quot;&gt;http://nakedoncam.info/free&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;316&lt;/td&gt;&lt;td&gt;&lt;a href=&quot;http://www.wolframalpha.com/input/&quot;&gt;http://www.wolframalpha.com/input/&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;316&lt;/td&gt;&lt;td&gt;&lt;a href=&quot;http://www.wolframalpha.com/index.html&quot;&gt;http://www.wolframalpha.com/index.html&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;312&lt;/td&gt;&lt;td&gt;&lt;a href=&quot;http://wolframalpha.com&quot;&gt;http://wolframalpha.com&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;291&lt;/td&gt;&lt;td&gt;&lt;a href=&quot;http://www.justin.tv/wolframalpha&quot;&gt;http://www.justin.tv/wolframalpha&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;276&lt;/td&gt;&lt;td&gt;&lt;a href=&quot;http://www.wolfram.com/broadcast/wolframalpha/&quot;&gt;http://www.wolfram.com/broadcast/wolframalpha/&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;201&lt;/td&gt;&lt;td&gt;&lt;a href=&quot;http://justin.tv/wolframalpha&quot;&gt;http://justin.tv/wolframalpha&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;188&lt;/td&gt;&lt;td&gt;&lt;a href=&quot;http://mashable.com/2009/05/15/wolfram-alpha-launch-2/&quot;&gt;http://mashable.com/2009/05/15/wolfram-alpha-launch-2/&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;184&lt;/td&gt;&lt;td&gt;&lt;a href=&quot;http://mashable.com/2009/05/15/wolfram-alpha-video/&quot;&gt;http://mashable.com/2009/05/15/wolfram-alpha-video/&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;173&lt;/td&gt;&lt;td&gt;&lt;a href=&quot;http://www.youtube.com/watch?v=ASnHvwmHuMQ&quot;&gt;http://www.youtube.com/watch?v=ASnHvwmHuMQ&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;172&lt;/td&gt;&lt;td&gt;&lt;a href=&quot;http://www.justin.tv/clip/2dd6b9f07e7f8a4e&quot;&gt;http://www.justin.tv/clip/2dd6b9f07e7f8a4e&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;126&lt;/td&gt;&lt;td&gt;&lt;a href=&quot;http://www.you-got-rick-rolled.com&quot;&gt;http://www.you-got-rick-rolled.com&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;100&lt;/td&gt;&lt;td&gt;&lt;a href=&quot;http://you-got-rick-rolled.com&quot;&gt;http://you-got-rick-rolled.com&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;97&lt;/td&gt;&lt;td&gt;&lt;a href=&quot;http://www.theregister.co.uk/2009/05/19/dziuba_wolfram/&quot;&gt;http://www.theregister.co.uk/2009/05/19/dziuba_wolfram/&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;89&lt;/td&gt;&lt;td&gt;&lt;a href=&quot;http://www.hothotjoboffers.com/32/&quot;&gt;http://www.hothotjoboffers.com/32/&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;87&lt;/td&gt;&lt;td&gt;&lt;a href=&quot;http://business.timesonline.co.uk/tol/business/industry_sectors/technology/article6307744.ece&quot;&gt;http://business.timesonline.co.uk/tol/business/industry_sectors/technology/article6307744.ece&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;81&lt;/td&gt;&lt;td&gt;&lt;a href=&quot;http://wolframalpha.com/&quot;&gt;http://wolframalpha.com/&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;72&lt;/td&gt;&lt;td&gt;&lt;a href=&quot;http://www.wolframalpha.com.&quot;&gt;http://www.wolframalpha.com.&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;71&lt;/td&gt;&lt;td&gt;&lt;a href=&quot;http://lifehacker.com/5257400/first-look-at-wolfram-alphas-impressive-and-fun-knowledge-computation&quot;&gt;http://lifehacker.com/5257400/first-look-at-wolfram-alphas-impressive-and-fun-knowledge-computation&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;69&lt;/td&gt;&lt;td&gt;&lt;a href=&quot;http://www.wolframalpha.com/examples/&quot;&gt;http://www.wolframalpha.com/examples/&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;69&lt;/td&gt;&lt;td&gt;&lt;a href=&quot;http://tedchris.posterous.com/wolfram-alpha-vs-google-1&quot;&gt;http://tedchris.posterous.com/wolfram-alpha-vs-google-1&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;69&lt;/td&gt;&lt;td&gt;&lt;a href=&quot;http://news.google.com/news/url?sa=T&amp;amp;amp&quot;&gt;http://news.google.com/news/url?sa=T&amp;amp;amp&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;65&lt;/td&gt;&lt;td&gt;&lt;a href=&quot;http://www.readwriteweb.com/archives/wolfram_alpha_launch_starts_tonight.php&quot;&gt;http://www.readwriteweb.com/archives/wolfram_alpha_launch_starts_tonight.php&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;61&lt;/td&gt;&lt;td&gt;&lt;a href=&quot;http://www.wolframalpha.com/input/?i=meaning+of+life&quot;&gt;http://www.wolframalpha.com/input/?i=meaning+of+life&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;div class=&quot;Text&quot;&gt;So we have a whole bunch of links directly to the Wolfram|Alpha website, a bunch links to the screencast, a lot of links to some Easter eggs, a porn site (hmmm...), the justin.tv broadcast, Rick-Roll URLs, blog posts, etc.  Interesting stuff.&lt;/div&gt;
&lt;div class=&quot;Subsection&quot;&gt;Downloads&lt;/div&gt;
&lt;div class=&quot;Text&quot;&gt;&lt;a href=&quot;http://ragfield-packages.googlecode.com/svn/trunk/Twitter.m&quot;&gt;Download Twitter.m&lt;/a&gt;.&lt;/div&gt;
&lt;div class=&quot;Text&quot;&gt;&lt;a href=&quot;http://ragfield-packages.googlecode.com/svn/trunk/WebUtils.m&quot;&gt;Download WebUtils.m&lt;/a&gt; (required by Twitter.m).&lt;/div&gt;
&lt;div class=&quot;Text&quot;&gt;&lt;a href=&quot;http://sites.google.com/site/ragfield/dev/2009-05-20-TwitterSearch.nb?attredirects=0&quot;&gt;Download Mathematica Notebook&lt;/a&gt;.&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dev.ragfield.com/feeds/6951769468085994584/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/7147569507271803579/6951769468085994584' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7147569507271803579/posts/default/6951769468085994584'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7147569507271803579/posts/default/6951769468085994584'/><link rel='alternate' type='text/html' href='http://dev.ragfield.com/2009/05/wolframalpha-tweet-analysis.html' title='Wolfram|Alpha tweet analysis'/><author><name>Ragfield</name><uri>http://www.blogger.com/profile/12325362017984149251</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='25' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjl1SMlQXOTAV7_F3A5DZg4b2e5eimTTKX9EFIlSIGempd0D7LkUqQQ9cneJqOm9HkcSDncQURdiuKI_uoLJJTJs8hSu7nFDdJ_LNdI1hpdiamXqIc6zPoJtTHCZXpkEA/s220/Ahoy.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7147569507271803579.post-1457026784011156035</id><published>2009-05-05T11:59:00.001-05:00</published><updated>2009-05-05T12:01:17.978-05:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="2D graphics"/><category scheme="http://www.blogger.com/atom/ns#" term="mathematica"/><category scheme="http://www.blogger.com/atom/ns#" term="statistics"/><title type='text'>Tri the Illini swim analysis</title><content type='html'>&lt;div class=&quot;Text&quot;&gt;On Saturday I participated in the &lt;a href=&quot;https://netfiles.uiuc.edu/ro/www/FightingIlliniTriathlon/events.html&quot;&gt;Tri the Illini&lt;/a&gt; triathlon on the University of Illinois campus.  You can read all about the race &lt;a href=&quot;http://rob.ragfield.com/2009/05/first-triathlon-of-2009.html&quot;&gt;here&lt;/a&gt;.  One of the interesting things about this race is that participants were started 10 seconds apart in order of their estimated time for the 300 meter swim in the indoor pool.  In theory, if everyone swims at their estimated time nobody will have to pass anyone else in the pool.  Now that the results have been posted, let&amp;apos;s take a quick look to see how accurate the participants&amp;apos; predictions were.&lt;/div&gt;
&lt;div class=&quot;Text&quot;&gt;Import the data from the results web page.&lt;/div&gt;
&lt;div class=&quot;Input&quot;&gt;data = Import[&lt;span style=&quot;color: #666666;&quot;&gt;&amp;quot;http://www.mattoonmultisport.com/images/stories/results/trithetri/overall.htm&amp;quot;&lt;/span&gt;, {&lt;span style=&quot;color: #666666;&quot;&gt;&amp;quot;HTML&amp;quot;&lt;/span&gt;, &lt;span style=&quot;color: #666666;&quot;&gt;&amp;quot;FullData&amp;quot;&lt;/span&gt;}];&lt;/div&gt;
&lt;div class=&quot;Text&quot;&gt;Clean it up a bit by removing empty elements, labels, and column headers. Basically, we only want the entries with an integer value in the first column (the overall place).&lt;/div&gt;
&lt;div class=&quot;Input&quot;&gt;Length[data]&lt;/div&gt;
&lt;div class=&quot;Output&quot;&gt;9&lt;/div&gt;
&lt;div class=&quot;Input&quot;&gt;data = DeleteCases[data, {}|{{}}];&lt;/div&gt;
&lt;div class=&quot;Input&quot;&gt;Length[data]&lt;/div&gt;
&lt;div class=&quot;Output&quot;&gt;1&lt;/div&gt;
&lt;div class=&quot;Input&quot;&gt;data = First[data];&lt;/div&gt;
&lt;div class=&quot;Input&quot;&gt;Length[data]&lt;/div&gt;
&lt;div class=&quot;Output&quot;&gt;345&lt;/div&gt;
&lt;div class=&quot;Input&quot;&gt;Take[data, 12]//InputForm&lt;/div&gt;
&lt;div class=&quot;Output&quot;&gt;{{&amp;quot;&amp;quot;, &amp;quot;------- Swim -------&amp;quot;, &amp;quot;------- T1 -------&amp;quot;, &lt;br/&gt;
  &amp;quot;------- Bike -------&amp;quot;, &amp;quot;------- T2 -------&amp;quot;, &amp;quot;------- Run -------&amp;quot;, &lt;br/&gt;
  &amp;quot;Total&amp;quot;}, {&amp;quot;Place&amp;quot;, &amp;quot;Name&amp;quot;, &amp;quot;Bib No&amp;quot;, &amp;quot;Age&amp;quot;, &amp;quot;Rnk&amp;quot;, &amp;quot;Time&amp;quot;, &amp;quot;Pace&amp;quot;, &lt;br/&gt;
  &amp;quot;Rnk&amp;quot;, &amp;quot;Time&amp;quot;, &amp;quot;Pace&amp;quot;, &amp;quot;Rnk&amp;quot;, &amp;quot;Time&amp;quot;, &amp;quot;Rate&amp;quot;, &amp;quot;Rnk&amp;quot;, &amp;quot;Time&amp;quot;, &amp;quot;Pace&amp;quot;, &lt;br/&gt;
  &amp;quot;Rnk&amp;quot;, &amp;quot;Time&amp;quot;, &amp;quot;Pace&amp;quot;, &amp;quot;Time&amp;quot;}, {1, &amp;quot;Daniel Bretscher&amp;quot;, 8, 26, 3, &lt;br/&gt;
  &amp;quot;04:19.75&amp;quot;, &amp;quot;23:59/M&amp;quot;, 1, &amp;quot;00:34.00&amp;quot;, &amp;quot;&amp;quot;, 1, &amp;quot;26:42.95&amp;quot;, &amp;quot;24.7mph&amp;quot;, &lt;br/&gt;
  19, &amp;quot;00:44.25&amp;quot;, &amp;quot;&amp;quot;, 2, &amp;quot;16:09.15&amp;quot;, &amp;quot;5:23/M&amp;quot;, &amp;quot;48:30.10&amp;quot;}, &lt;br/&gt;
 {2, &amp;quot;Michael Bridenbaug&amp;quot;, 27, 25, 15, &amp;quot;04:39.50&amp;quot;, &amp;quot;25:50/M&amp;quot;, 6, &lt;br/&gt;
  &amp;quot;00:43.65&amp;quot;, &amp;quot;&amp;quot;, 5, &amp;quot;28:16.55&amp;quot;, &amp;quot;23.3mph&amp;quot;, 6, &amp;quot;00:37.55&amp;quot;, &amp;quot;&amp;quot;, 4, &lt;br/&gt;
  &amp;quot;16:15.75&amp;quot;, &amp;quot;5:25/M&amp;quot;, &amp;quot;50:33.00&amp;quot;}, {3, &amp;quot;Peter Garde&amp;quot;, 17, 24, 24, &lt;br/&gt;
  &amp;quot;04:53.05&amp;quot;, &amp;quot;27:08/M&amp;quot;, 51, &amp;quot;01:21.90&amp;quot;, &amp;quot;&amp;quot;, 2, &amp;quot;27:06.50&amp;quot;, &amp;quot;24.4mph&amp;quot;, &lt;br/&gt;
  109, &amp;quot;01:05.95&amp;quot;, &amp;quot;&amp;quot;, 3, &amp;quot;16:13.05&amp;quot;, &amp;quot;5:24/M&amp;quot;, &amp;quot;50:40.45&amp;quot;}, &lt;br/&gt;
 {4, &amp;quot;Nickolaus Early&amp;quot;, 16, 29, 2, &amp;quot;04:07.30&amp;quot;, &amp;quot;22:52/M&amp;quot;, 18, &lt;br/&gt;
  &amp;quot;00:57.45&amp;quot;, &amp;quot;&amp;quot;, 4, &amp;quot;27:58.40&amp;quot;, &amp;quot;23.6mph&amp;quot;, 4, &amp;quot;00:36.40&amp;quot;, &amp;quot;&amp;quot;, 9, &lt;br/&gt;
  &amp;quot;18:01.25&amp;quot;, &amp;quot;6:00/M&amp;quot;, &amp;quot;51:40.80&amp;quot;}, {5, &amp;quot;Zach Rosenbarger&amp;quot;, 78, 33, 50, &lt;br/&gt;
  &amp;quot;05:15.85&amp;quot;, &amp;quot;29:10/M&amp;quot;, 45, &amp;quot;01:16.75&amp;quot;, &amp;quot;&amp;quot;, 3, &amp;quot;27:42.00&amp;quot;, &amp;quot;23.8mph&amp;quot;, &lt;br/&gt;
  54, &amp;quot;00:53.30&amp;quot;, &amp;quot;&amp;quot;, 5, &amp;quot;17:11.80&amp;quot;, &amp;quot;5:44/M&amp;quot;, &amp;quot;52:19.70&amp;quot;}, &lt;br/&gt;
 {6, &amp;quot;Edward Elliot&amp;quot;, 32, 28, 11, &amp;quot;04:35.45&amp;quot;, &amp;quot;25:28/M&amp;quot;, 16, &amp;quot;00:56.15&amp;quot;, &lt;br/&gt;
  &amp;quot;&amp;quot;, 6, &amp;quot;28:23.40&amp;quot;, &amp;quot;23.3mph&amp;quot;, 38, &amp;quot;00:48.85&amp;quot;, &amp;quot;&amp;quot;, 7, &amp;quot;17:43.75&amp;quot;, &lt;br/&gt;
  &amp;quot;5:54/M&amp;quot;, &amp;quot;52:27.60&amp;quot;}, {7, &amp;quot;Ryan Forster&amp;quot;, 28, 27, 35, &amp;quot;05:03.95&amp;quot;, &lt;br/&gt;
  &amp;quot;28:03/M&amp;quot;, 9, &amp;quot;00:46.20&amp;quot;, &amp;quot;&amp;quot;, 12, &amp;quot;29:39.95&amp;quot;, &amp;quot;22.3mph&amp;quot;, 39, &lt;br/&gt;
  &amp;quot;00:49.05&amp;quot;, &amp;quot;&amp;quot;, 11, &amp;quot;18:07.00&amp;quot;, &amp;quot;6:02/M&amp;quot;, &amp;quot;54:26.15&amp;quot;}, &lt;br/&gt;
 {8, &amp;quot;Jun Yamaguchi&amp;quot;, 15, 27, 27, &amp;quot;04:58.20&amp;quot;, &amp;quot;27:36/M&amp;quot;, 2, &amp;quot;00:37.85&amp;quot;, &lt;br/&gt;
  &amp;quot;&amp;quot;, 11, &amp;quot;29:36.70&amp;quot;, &amp;quot;22.3mph&amp;quot;, 30, &amp;quot;00:47.05&amp;quot;, &amp;quot;&amp;quot;, 13, &amp;quot;18:49.30&amp;quot;, &lt;br/&gt;
  &amp;quot;6:16/M&amp;quot;, &amp;quot;54:49.10&amp;quot;}, {9, &amp;quot;Scott Paluska&amp;quot;, 63, 42, 71, &amp;quot;05:35.30&amp;quot;, &lt;br/&gt;
  &amp;quot;31:01/M&amp;quot;, 3, &amp;quot;00:40.70&amp;quot;, &amp;quot;&amp;quot;, 7, &amp;quot;28:44.00&amp;quot;, &amp;quot;23.0mph&amp;quot;, 118, &lt;br/&gt;
  &amp;quot;01:06.90&amp;quot;, &amp;quot;&amp;quot;, 12, &amp;quot;18:43.60&amp;quot;, &amp;quot;6:14/M&amp;quot;, &amp;quot;54:50.50&amp;quot;}, &lt;br/&gt;
 {10, &amp;quot;Rob Raguet-Schoofield&amp;quot;, 42, 31, 44, &amp;quot;05:09.75&amp;quot;, &amp;quot;28:37/M&amp;quot;, 20, &lt;br/&gt;
  &amp;quot;01:01.55&amp;quot;, &amp;quot;&amp;quot;, 18, &amp;quot;30:10.50&amp;quot;, &amp;quot;21.9mph&amp;quot;, 45, &amp;quot;00:51.45&amp;quot;, &amp;quot;&amp;quot;, 8, &lt;br/&gt;
  &amp;quot;17:52.60&amp;quot;, &amp;quot;5:57/M&amp;quot;, &amp;quot;55:05.85&amp;quot;}}&lt;/div&gt;
&lt;div class=&quot;Input&quot;&gt;data = DeleteCases[data, x_/;Head[First[x]] === String];&lt;/div&gt;
&lt;div class=&quot;Input&quot;&gt;Length[data]&lt;/div&gt;
&lt;div class=&quot;Output&quot;&gt;301&lt;/div&gt;
&lt;div class=&quot;Input&quot;&gt;places = data[[All, 1]];&lt;/div&gt;
&lt;div class=&quot;Input&quot;&gt;places==Range[301]&lt;/div&gt;
&lt;div class=&quot;Output&quot;&gt;True&lt;/div&gt;
&lt;div class=&quot;Input&quot;&gt;swimSeeds = data[[All, 3]];&lt;/div&gt;
&lt;div class=&quot;Input&quot;&gt;swimPlaces = data[[All, 5]];&lt;/div&gt;
&lt;div class=&quot;Input&quot;&gt;swimΔ = swimPlaces - swimSeeds;&lt;/div&gt;
&lt;div class=&quot;Text&quot;&gt;Take a look at {overall place, swim seed, swim place, swim Δ} for each participant.  A negative Δ means the participant&amp;apos;s swim place was better than their seeded swim place, while a positive Δ means the participant&amp;apos;s swim place was worse than their seeded swim place.&lt;/div&gt;
&lt;div class=&quot;Input&quot;&gt;Grid[Prepend[Transpose[{places, swimSeeds, swimPlaces, swimΔ}], {&lt;span style=&quot;color: #666666;&quot;&gt;&amp;quot;Overall\nPlace&amp;quot;&lt;/span&gt;, &lt;span style=&quot;color: #666666;&quot;&gt;&amp;quot;Swim\nSeed&amp;quot;&lt;/span&gt;, &lt;span style=&quot;color: #666666;&quot;&gt;&amp;quot;Swim\nPlace&amp;quot;&lt;/span&gt;, &lt;span style=&quot;color: #666666;&quot;&gt;&amp;quot;Swim\nΔ&amp;quot;&lt;/span&gt;}], Dividers-&amp;gt;All]&lt;/div&gt;
&lt;div class=&quot;Output&quot;&gt;&lt;table border=&quot;1&quot;&gt;
&lt;tr&gt;&lt;td&gt;Overall&lt;br/&gt;
Place&lt;/td&gt;&lt;td&gt;Swim&lt;br/&gt;
Seed&lt;/td&gt;&lt;td&gt;Swim&lt;br/&gt;
Place&lt;/td&gt;&lt;td&gt;Swim&lt;br/&gt;
Δ&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;1&lt;/td&gt;&lt;td&gt;8&lt;/td&gt;&lt;td&gt;3&lt;/td&gt;&lt;td&gt; - 5&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;2&lt;/td&gt;&lt;td&gt;27&lt;/td&gt;&lt;td&gt;15&lt;/td&gt;&lt;td&gt; - 12&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;3&lt;/td&gt;&lt;td&gt;17&lt;/td&gt;&lt;td&gt;24&lt;/td&gt;&lt;td&gt;7&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;4&lt;/td&gt;&lt;td&gt;16&lt;/td&gt;&lt;td&gt;2&lt;/td&gt;&lt;td&gt; - 14&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;5&lt;/td&gt;&lt;td&gt;78&lt;/td&gt;&lt;td&gt;50&lt;/td&gt;&lt;td&gt; - 28&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;6&lt;/td&gt;&lt;td&gt;32&lt;/td&gt;&lt;td&gt;11&lt;/td&gt;&lt;td&gt; - 21&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;7&lt;/td&gt;&lt;td&gt;28&lt;/td&gt;&lt;td&gt;35&lt;/td&gt;&lt;td&gt;7&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;8&lt;/td&gt;&lt;td&gt;15&lt;/td&gt;&lt;td&gt;27&lt;/td&gt;&lt;td&gt;12&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;9&lt;/td&gt;&lt;td&gt;63&lt;/td&gt;&lt;td&gt;71&lt;/td&gt;&lt;td&gt;8&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;10&lt;/td&gt;&lt;td&gt;42&lt;/td&gt;&lt;td&gt;44&lt;/td&gt;&lt;td&gt;2&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;11&lt;/td&gt;&lt;td&gt;9&lt;/td&gt;&lt;td&gt;9&lt;/td&gt;&lt;td&gt;0&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;12&lt;/td&gt;&lt;td&gt;62&lt;/td&gt;&lt;td&gt;31&lt;/td&gt;&lt;td&gt; - 31&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;13&lt;/td&gt;&lt;td&gt;54&lt;/td&gt;&lt;td&gt;105&lt;/td&gt;&lt;td&gt;51&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;14&lt;/td&gt;&lt;td&gt;30&lt;/td&gt;&lt;td&gt;14&lt;/td&gt;&lt;td&gt; - 16&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;15&lt;/td&gt;&lt;td&gt;200&lt;/td&gt;&lt;td&gt;155&lt;/td&gt;&lt;td&gt; - 45&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;16&lt;/td&gt;&lt;td&gt;14&lt;/td&gt;&lt;td&gt;8&lt;/td&gt;&lt;td&gt; - 6&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;17&lt;/td&gt;&lt;td&gt;83&lt;/td&gt;&lt;td&gt;83&lt;/td&gt;&lt;td&gt;0&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;18&lt;/td&gt;&lt;td&gt;6&lt;/td&gt;&lt;td&gt;33&lt;/td&gt;&lt;td&gt;27&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;19&lt;/td&gt;&lt;td&gt;47&lt;/td&gt;&lt;td&gt;53&lt;/td&gt;&lt;td&gt;6&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;20&lt;/td&gt;&lt;td&gt;66&lt;/td&gt;&lt;td&gt;34&lt;/td&gt;&lt;td&gt; - 32&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;21&lt;/td&gt;&lt;td&gt;40&lt;/td&gt;&lt;td&gt;102&lt;/td&gt;&lt;td&gt;62&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;22&lt;/td&gt;&lt;td&gt;86&lt;/td&gt;&lt;td&gt;106&lt;/td&gt;&lt;td&gt;20&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;23&lt;/td&gt;&lt;td&gt;100&lt;/td&gt;&lt;td&gt;75&lt;/td&gt;&lt;td&gt; - 25&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;24&lt;/td&gt;&lt;td&gt;45&lt;/td&gt;&lt;td&gt;59&lt;/td&gt;&lt;td&gt;14&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;25&lt;/td&gt;&lt;td&gt;120&lt;/td&gt;&lt;td&gt;58&lt;/td&gt;&lt;td&gt; - 62&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;26&lt;/td&gt;&lt;td&gt;4&lt;/td&gt;&lt;td&gt;12&lt;/td&gt;&lt;td&gt;8&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;27&lt;/td&gt;&lt;td&gt;3&lt;/td&gt;&lt;td&gt;36&lt;/td&gt;&lt;td&gt;33&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;28&lt;/td&gt;&lt;td&gt;33&lt;/td&gt;&lt;td&gt;13&lt;/td&gt;&lt;td&gt; - 20&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;29&lt;/td&gt;&lt;td&gt;51&lt;/td&gt;&lt;td&gt;25&lt;/td&gt;&lt;td&gt; - 26&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;30&lt;/td&gt;&lt;td&gt;72&lt;/td&gt;&lt;td&gt;115&lt;/td&gt;&lt;td&gt;43&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;31&lt;/td&gt;&lt;td&gt;12&lt;/td&gt;&lt;td&gt;16&lt;/td&gt;&lt;td&gt;4&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;32&lt;/td&gt;&lt;td&gt;39&lt;/td&gt;&lt;td&gt;7&lt;/td&gt;&lt;td&gt; - 32&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;33&lt;/td&gt;&lt;td&gt;65&lt;/td&gt;&lt;td&gt;66&lt;/td&gt;&lt;td&gt;1&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;34&lt;/td&gt;&lt;td&gt;330&lt;/td&gt;&lt;td&gt;240&lt;/td&gt;&lt;td&gt; - 90&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;35&lt;/td&gt;&lt;td&gt;48&lt;/td&gt;&lt;td&gt;64&lt;/td&gt;&lt;td&gt;16&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;36&lt;/td&gt;&lt;td&gt;21&lt;/td&gt;&lt;td&gt;6&lt;/td&gt;&lt;td&gt; - 15&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;37&lt;/td&gt;&lt;td&gt;13&lt;/td&gt;&lt;td&gt;5&lt;/td&gt;&lt;td&gt; - 8&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;38&lt;/td&gt;&lt;td&gt;68&lt;/td&gt;&lt;td&gt;56&lt;/td&gt;&lt;td&gt; - 12&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;39&lt;/td&gt;&lt;td&gt;212&lt;/td&gt;&lt;td&gt;89&lt;/td&gt;&lt;td&gt; - 123&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;40&lt;/td&gt;&lt;td&gt;214&lt;/td&gt;&lt;td&gt;79&lt;/td&gt;&lt;td&gt; - 135&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;41&lt;/td&gt;&lt;td&gt;67&lt;/td&gt;&lt;td&gt;45&lt;/td&gt;&lt;td&gt; - 22&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;42&lt;/td&gt;&lt;td&gt;76&lt;/td&gt;&lt;td&gt;21&lt;/td&gt;&lt;td&gt; - 55&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;43&lt;/td&gt;&lt;td&gt;75&lt;/td&gt;&lt;td&gt;211&lt;/td&gt;&lt;td&gt;136&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;44&lt;/td&gt;&lt;td&gt;81&lt;/td&gt;&lt;td&gt;63&lt;/td&gt;&lt;td&gt; - 18&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;45&lt;/td&gt;&lt;td&gt;251&lt;/td&gt;&lt;td&gt;172&lt;/td&gt;&lt;td&gt; - 79&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;46&lt;/td&gt;&lt;td&gt;44&lt;/td&gt;&lt;td&gt;114&lt;/td&gt;&lt;td&gt;70&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;47&lt;/td&gt;&lt;td&gt;162&lt;/td&gt;&lt;td&gt;95&lt;/td&gt;&lt;td&gt; - 67&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;48&lt;/td&gt;&lt;td&gt;7&lt;/td&gt;&lt;td&gt;4&lt;/td&gt;&lt;td&gt; - 3&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;49&lt;/td&gt;&lt;td&gt;74&lt;/td&gt;&lt;td&gt;92&lt;/td&gt;&lt;td&gt;18&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;50&lt;/td&gt;&lt;td&gt;55&lt;/td&gt;&lt;td&gt;48&lt;/td&gt;&lt;td&gt; - 7&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;51&lt;/td&gt;&lt;td&gt;52&lt;/td&gt;&lt;td&gt;29&lt;/td&gt;&lt;td&gt; - 23&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;52&lt;/td&gt;&lt;td&gt;237&lt;/td&gt;&lt;td&gt;124&lt;/td&gt;&lt;td&gt; - 113&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;53&lt;/td&gt;&lt;td&gt;11&lt;/td&gt;&lt;td&gt;18&lt;/td&gt;&lt;td&gt;7&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;54&lt;/td&gt;&lt;td&gt;77&lt;/td&gt;&lt;td&gt;98&lt;/td&gt;&lt;td&gt;21&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;55&lt;/td&gt;&lt;td&gt;56&lt;/td&gt;&lt;td&gt;30&lt;/td&gt;&lt;td&gt; - 26&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;56&lt;/td&gt;&lt;td&gt;117&lt;/td&gt;&lt;td&gt;104&lt;/td&gt;&lt;td&gt; - 13&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;57&lt;/td&gt;&lt;td&gt;1&lt;/td&gt;&lt;td&gt;1&lt;/td&gt;&lt;td&gt;0&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;58&lt;/td&gt;&lt;td&gt;300&lt;/td&gt;&lt;td&gt;74&lt;/td&gt;&lt;td&gt; - 226&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;59&lt;/td&gt;&lt;td&gt;151&lt;/td&gt;&lt;td&gt;125&lt;/td&gt;&lt;td&gt; - 26&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;60&lt;/td&gt;&lt;td&gt;139&lt;/td&gt;&lt;td&gt;82&lt;/td&gt;&lt;td&gt; - 57&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;61&lt;/td&gt;&lt;td&gt;274&lt;/td&gt;&lt;td&gt;151&lt;/td&gt;&lt;td&gt; - 123&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;62&lt;/td&gt;&lt;td&gt;64&lt;/td&gt;&lt;td&gt;22&lt;/td&gt;&lt;td&gt; - 42&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;63&lt;/td&gt;&lt;td&gt;122&lt;/td&gt;&lt;td&gt;87&lt;/td&gt;&lt;td&gt; - 35&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;64&lt;/td&gt;&lt;td&gt;36&lt;/td&gt;&lt;td&gt;37&lt;/td&gt;&lt;td&gt;1&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;65&lt;/td&gt;&lt;td&gt;250&lt;/td&gt;&lt;td&gt;243&lt;/td&gt;&lt;td&gt; - 7&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;66&lt;/td&gt;&lt;td&gt;154&lt;/td&gt;&lt;td&gt;148&lt;/td&gt;&lt;td&gt; - 6&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;67&lt;/td&gt;&lt;td&gt;121&lt;/td&gt;&lt;td&gt;90&lt;/td&gt;&lt;td&gt; - 31&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;68&lt;/td&gt;&lt;td&gt;136&lt;/td&gt;&lt;td&gt;258&lt;/td&gt;&lt;td&gt;122&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;69&lt;/td&gt;&lt;td&gt;282&lt;/td&gt;&lt;td&gt;146&lt;/td&gt;&lt;td&gt; - 136&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;70&lt;/td&gt;&lt;td&gt;87&lt;/td&gt;&lt;td&gt;69&lt;/td&gt;&lt;td&gt; - 18&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;71&lt;/td&gt;&lt;td&gt;112&lt;/td&gt;&lt;td&gt;110&lt;/td&gt;&lt;td&gt; - 2&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;72&lt;/td&gt;&lt;td&gt;315&lt;/td&gt;&lt;td&gt;278&lt;/td&gt;&lt;td&gt; - 37&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;73&lt;/td&gt;&lt;td&gt;24&lt;/td&gt;&lt;td&gt;19&lt;/td&gt;&lt;td&gt; - 5&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;74&lt;/td&gt;&lt;td&gt;80&lt;/td&gt;&lt;td&gt;77&lt;/td&gt;&lt;td&gt; - 3&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;75&lt;/td&gt;&lt;td&gt;135&lt;/td&gt;&lt;td&gt;184&lt;/td&gt;&lt;td&gt;49&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;76&lt;/td&gt;&lt;td&gt;69&lt;/td&gt;&lt;td&gt;97&lt;/td&gt;&lt;td&gt;28&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;77&lt;/td&gt;&lt;td&gt;185&lt;/td&gt;&lt;td&gt;163&lt;/td&gt;&lt;td&gt; - 22&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;78&lt;/td&gt;&lt;td&gt;59&lt;/td&gt;&lt;td&gt;49&lt;/td&gt;&lt;td&gt; - 10&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;79&lt;/td&gt;&lt;td&gt;128&lt;/td&gt;&lt;td&gt;94&lt;/td&gt;&lt;td&gt; - 34&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;80&lt;/td&gt;&lt;td&gt;60&lt;/td&gt;&lt;td&gt;51&lt;/td&gt;&lt;td&gt; - 9&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;81&lt;/td&gt;&lt;td&gt;187&lt;/td&gt;&lt;td&gt;28&lt;/td&gt;&lt;td&gt; - 159&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;82&lt;/td&gt;&lt;td&gt;35&lt;/td&gt;&lt;td&gt;20&lt;/td&gt;&lt;td&gt; - 15&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;83&lt;/td&gt;&lt;td&gt;113&lt;/td&gt;&lt;td&gt;134&lt;/td&gt;&lt;td&gt;21&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;84&lt;/td&gt;&lt;td&gt;90&lt;/td&gt;&lt;td&gt;40&lt;/td&gt;&lt;td&gt; - 50&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;85&lt;/td&gt;&lt;td&gt;163&lt;/td&gt;&lt;td&gt;17&lt;/td&gt;&lt;td&gt; - 146&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;86&lt;/td&gt;&lt;td&gt;22&lt;/td&gt;&lt;td&gt;38&lt;/td&gt;&lt;td&gt;16&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;87&lt;/td&gt;&lt;td&gt;133&lt;/td&gt;&lt;td&gt;200&lt;/td&gt;&lt;td&gt;67&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;88&lt;/td&gt;&lt;td&gt;267&lt;/td&gt;&lt;td&gt;73&lt;/td&gt;&lt;td&gt; - 194&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;89&lt;/td&gt;&lt;td&gt;256&lt;/td&gt;&lt;td&gt;145&lt;/td&gt;&lt;td&gt; - 111&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;90&lt;/td&gt;&lt;td&gt;92&lt;/td&gt;&lt;td&gt;122&lt;/td&gt;&lt;td&gt;30&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;91&lt;/td&gt;&lt;td&gt;159&lt;/td&gt;&lt;td&gt;206&lt;/td&gt;&lt;td&gt;47&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;92&lt;/td&gt;&lt;td&gt;165&lt;/td&gt;&lt;td&gt;130&lt;/td&gt;&lt;td&gt; - 35&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;93&lt;/td&gt;&lt;td&gt;137&lt;/td&gt;&lt;td&gt;153&lt;/td&gt;&lt;td&gt;16&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;94&lt;/td&gt;&lt;td&gt;149&lt;/td&gt;&lt;td&gt;128&lt;/td&gt;&lt;td&gt; - 21&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;95&lt;/td&gt;&lt;td&gt;104&lt;/td&gt;&lt;td&gt;80&lt;/td&gt;&lt;td&gt; - 24&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;96&lt;/td&gt;&lt;td&gt;182&lt;/td&gt;&lt;td&gt;136&lt;/td&gt;&lt;td&gt; - 46&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;97&lt;/td&gt;&lt;td&gt;26&lt;/td&gt;&lt;td&gt;46&lt;/td&gt;&lt;td&gt;20&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;98&lt;/td&gt;&lt;td&gt;172&lt;/td&gt;&lt;td&gt;93&lt;/td&gt;&lt;td&gt; - 79&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;99&lt;/td&gt;&lt;td&gt;241&lt;/td&gt;&lt;td&gt;55&lt;/td&gt;&lt;td&gt; - 186&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;100&lt;/td&gt;&lt;td&gt;277&lt;/td&gt;&lt;td&gt;109&lt;/td&gt;&lt;td&gt; - 168&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;101&lt;/td&gt;&lt;td&gt;114&lt;/td&gt;&lt;td&gt;165&lt;/td&gt;&lt;td&gt;51&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;102&lt;/td&gt;&lt;td&gt;97&lt;/td&gt;&lt;td&gt;103&lt;/td&gt;&lt;td&gt;6&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;103&lt;/td&gt;&lt;td&gt;131&lt;/td&gt;&lt;td&gt;159&lt;/td&gt;&lt;td&gt;28&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;104&lt;/td&gt;&lt;td&gt;228&lt;/td&gt;&lt;td&gt;194&lt;/td&gt;&lt;td&gt; - 34&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;105&lt;/td&gt;&lt;td&gt;46&lt;/td&gt;&lt;td&gt;117&lt;/td&gt;&lt;td&gt;71&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;106&lt;/td&gt;&lt;td&gt;141&lt;/td&gt;&lt;td&gt;199&lt;/td&gt;&lt;td&gt;58&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;107&lt;/td&gt;&lt;td&gt;132&lt;/td&gt;&lt;td&gt;162&lt;/td&gt;&lt;td&gt;30&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;108&lt;/td&gt;&lt;td&gt;246&lt;/td&gt;&lt;td&gt;132&lt;/td&gt;&lt;td&gt; - 114&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;109&lt;/td&gt;&lt;td&gt;115&lt;/td&gt;&lt;td&gt;205&lt;/td&gt;&lt;td&gt;90&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;110&lt;/td&gt;&lt;td&gt;213&lt;/td&gt;&lt;td&gt;183&lt;/td&gt;&lt;td&gt; - 30&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;111&lt;/td&gt;&lt;td&gt;127&lt;/td&gt;&lt;td&gt;181&lt;/td&gt;&lt;td&gt;54&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;112&lt;/td&gt;&lt;td&gt;157&lt;/td&gt;&lt;td&gt;147&lt;/td&gt;&lt;td&gt; - 10&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;113&lt;/td&gt;&lt;td&gt;254&lt;/td&gt;&lt;td&gt;131&lt;/td&gt;&lt;td&gt; - 123&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;114&lt;/td&gt;&lt;td&gt;266&lt;/td&gt;&lt;td&gt;256&lt;/td&gt;&lt;td&gt; - 10&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;115&lt;/td&gt;&lt;td&gt;41&lt;/td&gt;&lt;td&gt;61&lt;/td&gt;&lt;td&gt;20&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;116&lt;/td&gt;&lt;td&gt;61&lt;/td&gt;&lt;td&gt;39&lt;/td&gt;&lt;td&gt; - 22&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;117&lt;/td&gt;&lt;td&gt;43&lt;/td&gt;&lt;td&gt;41&lt;/td&gt;&lt;td&gt; - 2&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;118&lt;/td&gt;&lt;td&gt;191&lt;/td&gt;&lt;td&gt;196&lt;/td&gt;&lt;td&gt;5&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;119&lt;/td&gt;&lt;td&gt;106&lt;/td&gt;&lt;td&gt;257&lt;/td&gt;&lt;td&gt;151&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;120&lt;/td&gt;&lt;td&gt;96&lt;/td&gt;&lt;td&gt;81&lt;/td&gt;&lt;td&gt; - 15&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;121&lt;/td&gt;&lt;td&gt;234&lt;/td&gt;&lt;td&gt;60&lt;/td&gt;&lt;td&gt; - 174&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;122&lt;/td&gt;&lt;td&gt;201&lt;/td&gt;&lt;td&gt;85&lt;/td&gt;&lt;td&gt; - 116&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;123&lt;/td&gt;&lt;td&gt;108&lt;/td&gt;&lt;td&gt;142&lt;/td&gt;&lt;td&gt;34&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;124&lt;/td&gt;&lt;td&gt;161&lt;/td&gt;&lt;td&gt;218&lt;/td&gt;&lt;td&gt;57&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;125&lt;/td&gt;&lt;td&gt;123&lt;/td&gt;&lt;td&gt;149&lt;/td&gt;&lt;td&gt;26&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;126&lt;/td&gt;&lt;td&gt;98&lt;/td&gt;&lt;td&gt;150&lt;/td&gt;&lt;td&gt;52&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;127&lt;/td&gt;&lt;td&gt;138&lt;/td&gt;&lt;td&gt;271&lt;/td&gt;&lt;td&gt;133&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;128&lt;/td&gt;&lt;td&gt;265&lt;/td&gt;&lt;td&gt;179&lt;/td&gt;&lt;td&gt; - 86&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;129&lt;/td&gt;&lt;td&gt;195&lt;/td&gt;&lt;td&gt;54&lt;/td&gt;&lt;td&gt; - 141&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;130&lt;/td&gt;&lt;td&gt;50&lt;/td&gt;&lt;td&gt;86&lt;/td&gt;&lt;td&gt;36&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;131&lt;/td&gt;&lt;td&gt;53&lt;/td&gt;&lt;td&gt;161&lt;/td&gt;&lt;td&gt;108&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;132&lt;/td&gt;&lt;td&gt;170&lt;/td&gt;&lt;td&gt;137&lt;/td&gt;&lt;td&gt; - 33&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;133&lt;/td&gt;&lt;td&gt;58&lt;/td&gt;&lt;td&gt;26&lt;/td&gt;&lt;td&gt; - 32&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;134&lt;/td&gt;&lt;td&gt;169&lt;/td&gt;&lt;td&gt;120&lt;/td&gt;&lt;td&gt; - 49&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;135&lt;/td&gt;&lt;td&gt;204&lt;/td&gt;&lt;td&gt;249&lt;/td&gt;&lt;td&gt;45&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;136&lt;/td&gt;&lt;td&gt;342&lt;/td&gt;&lt;td&gt;65&lt;/td&gt;&lt;td&gt; - 277&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;137&lt;/td&gt;&lt;td&gt;91&lt;/td&gt;&lt;td&gt;100&lt;/td&gt;&lt;td&gt;9&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;138&lt;/td&gt;&lt;td&gt;103&lt;/td&gt;&lt;td&gt;47&lt;/td&gt;&lt;td&gt; - 56&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;139&lt;/td&gt;&lt;td&gt;125&lt;/td&gt;&lt;td&gt;182&lt;/td&gt;&lt;td&gt;57&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;140&lt;/td&gt;&lt;td&gt;82&lt;/td&gt;&lt;td&gt;68&lt;/td&gt;&lt;td&gt; - 14&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;141&lt;/td&gt;&lt;td&gt;88&lt;/td&gt;&lt;td&gt;76&lt;/td&gt;&lt;td&gt; - 12&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;142&lt;/td&gt;&lt;td&gt;147&lt;/td&gt;&lt;td&gt;241&lt;/td&gt;&lt;td&gt;94&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;143&lt;/td&gt;&lt;td&gt;238&lt;/td&gt;&lt;td&gt;107&lt;/td&gt;&lt;td&gt; - 131&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;144&lt;/td&gt;&lt;td&gt;303&lt;/td&gt;&lt;td&gt;202&lt;/td&gt;&lt;td&gt; - 101&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;145&lt;/td&gt;&lt;td&gt;70&lt;/td&gt;&lt;td&gt;191&lt;/td&gt;&lt;td&gt;121&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;146&lt;/td&gt;&lt;td&gt;297&lt;/td&gt;&lt;td&gt;247&lt;/td&gt;&lt;td&gt; - 50&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;147&lt;/td&gt;&lt;td&gt;188&lt;/td&gt;&lt;td&gt;178&lt;/td&gt;&lt;td&gt; - 10&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;148&lt;/td&gt;&lt;td&gt;2&lt;/td&gt;&lt;td&gt;10&lt;/td&gt;&lt;td&gt;8&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;149&lt;/td&gt;&lt;td&gt;130&lt;/td&gt;&lt;td&gt;164&lt;/td&gt;&lt;td&gt;34&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;150&lt;/td&gt;&lt;td&gt;311&lt;/td&gt;&lt;td&gt;288&lt;/td&gt;&lt;td&gt; - 23&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;151&lt;/td&gt;&lt;td&gt;168&lt;/td&gt;&lt;td&gt;187&lt;/td&gt;&lt;td&gt;19&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;152&lt;/td&gt;&lt;td&gt;283&lt;/td&gt;&lt;td&gt;158&lt;/td&gt;&lt;td&gt; - 125&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;153&lt;/td&gt;&lt;td&gt;144&lt;/td&gt;&lt;td&gt;216&lt;/td&gt;&lt;td&gt;72&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;154&lt;/td&gt;&lt;td&gt;295&lt;/td&gt;&lt;td&gt;287&lt;/td&gt;&lt;td&gt; - 8&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;155&lt;/td&gt;&lt;td&gt;208&lt;/td&gt;&lt;td&gt;244&lt;/td&gt;&lt;td&gt;36&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;156&lt;/td&gt;&lt;td&gt;287&lt;/td&gt;&lt;td&gt;157&lt;/td&gt;&lt;td&gt; - 130&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;157&lt;/td&gt;&lt;td&gt;111&lt;/td&gt;&lt;td&gt;176&lt;/td&gt;&lt;td&gt;65&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;158&lt;/td&gt;&lt;td&gt;199&lt;/td&gt;&lt;td&gt;111&lt;/td&gt;&lt;td&gt; - 88&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;159&lt;/td&gt;&lt;td&gt;272&lt;/td&gt;&lt;td&gt;223&lt;/td&gt;&lt;td&gt; - 49&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;160&lt;/td&gt;&lt;td&gt;179&lt;/td&gt;&lt;td&gt;242&lt;/td&gt;&lt;td&gt;63&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;161&lt;/td&gt;&lt;td&gt;84&lt;/td&gt;&lt;td&gt;190&lt;/td&gt;&lt;td&gt;106&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;162&lt;/td&gt;&lt;td&gt;310&lt;/td&gt;&lt;td&gt;152&lt;/td&gt;&lt;td&gt; - 158&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;163&lt;/td&gt;&lt;td&gt;109&lt;/td&gt;&lt;td&gt;118&lt;/td&gt;&lt;td&gt;9&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;164&lt;/td&gt;&lt;td&gt;37&lt;/td&gt;&lt;td&gt;67&lt;/td&gt;&lt;td&gt;30&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;165&lt;/td&gt;&lt;td&gt;180&lt;/td&gt;&lt;td&gt;227&lt;/td&gt;&lt;td&gt;47&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;166&lt;/td&gt;&lt;td&gt;340&lt;/td&gt;&lt;td&gt;135&lt;/td&gt;&lt;td&gt; - 205&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;167&lt;/td&gt;&lt;td&gt;328&lt;/td&gt;&lt;td&gt;193&lt;/td&gt;&lt;td&gt; - 135&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;168&lt;/td&gt;&lt;td&gt;263&lt;/td&gt;&lt;td&gt;197&lt;/td&gt;&lt;td&gt; - 66&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;169&lt;/td&gt;&lt;td&gt;312&lt;/td&gt;&lt;td&gt;250&lt;/td&gt;&lt;td&gt; - 62&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;170&lt;/td&gt;&lt;td&gt;148&lt;/td&gt;&lt;td&gt;143&lt;/td&gt;&lt;td&gt; - 5&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;171&lt;/td&gt;&lt;td&gt;242&lt;/td&gt;&lt;td&gt;224&lt;/td&gt;&lt;td&gt; - 18&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;172&lt;/td&gt;&lt;td&gt;278&lt;/td&gt;&lt;td&gt;230&lt;/td&gt;&lt;td&gt; - 48&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;173&lt;/td&gt;&lt;td&gt;253&lt;/td&gt;&lt;td&gt;139&lt;/td&gt;&lt;td&gt; - 114&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;174&lt;/td&gt;&lt;td&gt;292&lt;/td&gt;&lt;td&gt;279&lt;/td&gt;&lt;td&gt; - 13&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;175&lt;/td&gt;&lt;td&gt;10&lt;/td&gt;&lt;td&gt;32&lt;/td&gt;&lt;td&gt;22&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;176&lt;/td&gt;&lt;td&gt;276&lt;/td&gt;&lt;td&gt;254&lt;/td&gt;&lt;td&gt; - 22&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;177&lt;/td&gt;&lt;td&gt;18&lt;/td&gt;&lt;td&gt;101&lt;/td&gt;&lt;td&gt;83&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;178&lt;/td&gt;&lt;td&gt;155&lt;/td&gt;&lt;td&gt;167&lt;/td&gt;&lt;td&gt;12&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;179&lt;/td&gt;&lt;td&gt;271&lt;/td&gt;&lt;td&gt;276&lt;/td&gt;&lt;td&gt;5&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;180&lt;/td&gt;&lt;td&gt;102&lt;/td&gt;&lt;td&gt;169&lt;/td&gt;&lt;td&gt;67&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;181&lt;/td&gt;&lt;td&gt;192&lt;/td&gt;&lt;td&gt;248&lt;/td&gt;&lt;td&gt;56&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;182&lt;/td&gt;&lt;td&gt;257&lt;/td&gt;&lt;td&gt;78&lt;/td&gt;&lt;td&gt; - 179&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;183&lt;/td&gt;&lt;td&gt;93&lt;/td&gt;&lt;td&gt;210&lt;/td&gt;&lt;td&gt;117&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;184&lt;/td&gt;&lt;td&gt;346&lt;/td&gt;&lt;td&gt;294&lt;/td&gt;&lt;td&gt; - 52&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;185&lt;/td&gt;&lt;td&gt;255&lt;/td&gt;&lt;td&gt;269&lt;/td&gt;&lt;td&gt;14&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;186&lt;/td&gt;&lt;td&gt;158&lt;/td&gt;&lt;td&gt;192&lt;/td&gt;&lt;td&gt;34&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;187&lt;/td&gt;&lt;td&gt;49&lt;/td&gt;&lt;td&gt;171&lt;/td&gt;&lt;td&gt;122&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;188&lt;/td&gt;&lt;td&gt;126&lt;/td&gt;&lt;td&gt;201&lt;/td&gt;&lt;td&gt;75&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;189&lt;/td&gt;&lt;td&gt;143&lt;/td&gt;&lt;td&gt;140&lt;/td&gt;&lt;td&gt; - 3&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;190&lt;/td&gt;&lt;td&gt;231&lt;/td&gt;&lt;td&gt;88&lt;/td&gt;&lt;td&gt; - 143&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;191&lt;/td&gt;&lt;td&gt;220&lt;/td&gt;&lt;td&gt;186&lt;/td&gt;&lt;td&gt; - 34&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;192&lt;/td&gt;&lt;td&gt;298&lt;/td&gt;&lt;td&gt;177&lt;/td&gt;&lt;td&gt; - 121&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;193&lt;/td&gt;&lt;td&gt;107&lt;/td&gt;&lt;td&gt;144&lt;/td&gt;&lt;td&gt;37&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;194&lt;/td&gt;&lt;td&gt;94&lt;/td&gt;&lt;td&gt;129&lt;/td&gt;&lt;td&gt;35&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;195&lt;/td&gt;&lt;td&gt;129&lt;/td&gt;&lt;td&gt;188&lt;/td&gt;&lt;td&gt;59&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;196&lt;/td&gt;&lt;td&gt;184&lt;/td&gt;&lt;td&gt;274&lt;/td&gt;&lt;td&gt;90&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;197&lt;/td&gt;&lt;td&gt;116&lt;/td&gt;&lt;td&gt;273&lt;/td&gt;&lt;td&gt;157&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;198&lt;/td&gt;&lt;td&gt;224&lt;/td&gt;&lt;td&gt;259&lt;/td&gt;&lt;td&gt;35&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;199&lt;/td&gt;&lt;td&gt;186&lt;/td&gt;&lt;td&gt;214&lt;/td&gt;&lt;td&gt;28&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;200&lt;/td&gt;&lt;td&gt;174&lt;/td&gt;&lt;td&gt;198&lt;/td&gt;&lt;td&gt;24&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;201&lt;/td&gt;&lt;td&gt;290&lt;/td&gt;&lt;td&gt;221&lt;/td&gt;&lt;td&gt; - 69&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;202&lt;/td&gt;&lt;td&gt;95&lt;/td&gt;&lt;td&gt;175&lt;/td&gt;&lt;td&gt;80&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;203&lt;/td&gt;&lt;td&gt;152&lt;/td&gt;&lt;td&gt;215&lt;/td&gt;&lt;td&gt;63&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;204&lt;/td&gt;&lt;td&gt;189&lt;/td&gt;&lt;td&gt;246&lt;/td&gt;&lt;td&gt;57&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;205&lt;/td&gt;&lt;td&gt;156&lt;/td&gt;&lt;td&gt;239&lt;/td&gt;&lt;td&gt;83&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;206&lt;/td&gt;&lt;td&gt;336&lt;/td&gt;&lt;td&gt;141&lt;/td&gt;&lt;td&gt; - 195&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;207&lt;/td&gt;&lt;td&gt;118&lt;/td&gt;&lt;td&gt;174&lt;/td&gt;&lt;td&gt;56&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;208&lt;/td&gt;&lt;td&gt;197&lt;/td&gt;&lt;td&gt;91&lt;/td&gt;&lt;td&gt; - 106&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;209&lt;/td&gt;&lt;td&gt;194&lt;/td&gt;&lt;td&gt;280&lt;/td&gt;&lt;td&gt;86&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;210&lt;/td&gt;&lt;td&gt;196&lt;/td&gt;&lt;td&gt;212&lt;/td&gt;&lt;td&gt;16&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;211&lt;/td&gt;&lt;td&gt;291&lt;/td&gt;&lt;td&gt;121&lt;/td&gt;&lt;td&gt; - 170&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;212&lt;/td&gt;&lt;td&gt;190&lt;/td&gt;&lt;td&gt;189&lt;/td&gt;&lt;td&gt; - 1&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;213&lt;/td&gt;&lt;td&gt;247&lt;/td&gt;&lt;td&gt;119&lt;/td&gt;&lt;td&gt; - 128&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;214&lt;/td&gt;&lt;td&gt;286&lt;/td&gt;&lt;td&gt;126&lt;/td&gt;&lt;td&gt; - 160&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;215&lt;/td&gt;&lt;td&gt;219&lt;/td&gt;&lt;td&gt;52&lt;/td&gt;&lt;td&gt; - 167&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;216&lt;/td&gt;&lt;td&gt;229&lt;/td&gt;&lt;td&gt;170&lt;/td&gt;&lt;td&gt; - 59&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;217&lt;/td&gt;&lt;td&gt;23&lt;/td&gt;&lt;td&gt;23&lt;/td&gt;&lt;td&gt;0&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;218&lt;/td&gt;&lt;td&gt;236&lt;/td&gt;&lt;td&gt;277&lt;/td&gt;&lt;td&gt;41&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;219&lt;/td&gt;&lt;td&gt;235&lt;/td&gt;&lt;td&gt;265&lt;/td&gt;&lt;td&gt;30&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;220&lt;/td&gt;&lt;td&gt;252&lt;/td&gt;&lt;td&gt;204&lt;/td&gt;&lt;td&gt; - 48&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;221&lt;/td&gt;&lt;td&gt;258&lt;/td&gt;&lt;td&gt;281&lt;/td&gt;&lt;td&gt;23&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;222&lt;/td&gt;&lt;td&gt;99&lt;/td&gt;&lt;td&gt;84&lt;/td&gt;&lt;td&gt; - 15&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;223&lt;/td&gt;&lt;td&gt;211&lt;/td&gt;&lt;td&gt;226&lt;/td&gt;&lt;td&gt;15&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;224&lt;/td&gt;&lt;td&gt;279&lt;/td&gt;&lt;td&gt;272&lt;/td&gt;&lt;td&gt; - 7&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;225&lt;/td&gt;&lt;td&gt;216&lt;/td&gt;&lt;td&gt;267&lt;/td&gt;&lt;td&gt;51&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;226&lt;/td&gt;&lt;td&gt;167&lt;/td&gt;&lt;td&gt;116&lt;/td&gt;&lt;td&gt; - 51&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;227&lt;/td&gt;&lt;td&gt;243&lt;/td&gt;&lt;td&gt;275&lt;/td&gt;&lt;td&gt;32&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;228&lt;/td&gt;&lt;td&gt;262&lt;/td&gt;&lt;td&gt;220&lt;/td&gt;&lt;td&gt; - 42&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;229&lt;/td&gt;&lt;td&gt;230&lt;/td&gt;&lt;td&gt;154&lt;/td&gt;&lt;td&gt; - 76&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;230&lt;/td&gt;&lt;td&gt;288&lt;/td&gt;&lt;td&gt;166&lt;/td&gt;&lt;td&gt; - 122&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;231&lt;/td&gt;&lt;td&gt;337&lt;/td&gt;&lt;td&gt;251&lt;/td&gt;&lt;td&gt; - 86&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;232&lt;/td&gt;&lt;td&gt;269&lt;/td&gt;&lt;td&gt;228&lt;/td&gt;&lt;td&gt; - 41&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;233&lt;/td&gt;&lt;td&gt;233&lt;/td&gt;&lt;td&gt;252&lt;/td&gt;&lt;td&gt;19&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;234&lt;/td&gt;&lt;td&gt;20&lt;/td&gt;&lt;td&gt;208&lt;/td&gt;&lt;td&gt;188&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;235&lt;/td&gt;&lt;td&gt;110&lt;/td&gt;&lt;td&gt;185&lt;/td&gt;&lt;td&gt;75&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;236&lt;/td&gt;&lt;td&gt;308&lt;/td&gt;&lt;td&gt;284&lt;/td&gt;&lt;td&gt; - 24&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;237&lt;/td&gt;&lt;td&gt;261&lt;/td&gt;&lt;td&gt;231&lt;/td&gt;&lt;td&gt; - 30&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;238&lt;/td&gt;&lt;td&gt;245&lt;/td&gt;&lt;td&gt;127&lt;/td&gt;&lt;td&gt; - 118&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;239&lt;/td&gt;&lt;td&gt;343&lt;/td&gt;&lt;td&gt;283&lt;/td&gt;&lt;td&gt; - 60&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;240&lt;/td&gt;&lt;td&gt;160&lt;/td&gt;&lt;td&gt;70&lt;/td&gt;&lt;td&gt; - 90&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;241&lt;/td&gt;&lt;td&gt;150&lt;/td&gt;&lt;td&gt;264&lt;/td&gt;&lt;td&gt;114&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;242&lt;/td&gt;&lt;td&gt;85&lt;/td&gt;&lt;td&gt;156&lt;/td&gt;&lt;td&gt;71&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;243&lt;/td&gt;&lt;td&gt;5&lt;/td&gt;&lt;td&gt;173&lt;/td&gt;&lt;td&gt;168&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;244&lt;/td&gt;&lt;td&gt;347&lt;/td&gt;&lt;td&gt;213&lt;/td&gt;&lt;td&gt; - 134&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;245&lt;/td&gt;&lt;td&gt;153&lt;/td&gt;&lt;td&gt;203&lt;/td&gt;&lt;td&gt;50&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;246&lt;/td&gt;&lt;td&gt;175&lt;/td&gt;&lt;td&gt;219&lt;/td&gt;&lt;td&gt;44&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;247&lt;/td&gt;&lt;td&gt;339&lt;/td&gt;&lt;td&gt;298&lt;/td&gt;&lt;td&gt; - 41&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;248&lt;/td&gt;&lt;td&gt;134&lt;/td&gt;&lt;td&gt;290&lt;/td&gt;&lt;td&gt;156&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;249&lt;/td&gt;&lt;td&gt;203&lt;/td&gt;&lt;td&gt;42&lt;/td&gt;&lt;td&gt; - 161&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;250&lt;/td&gt;&lt;td&gt;348&lt;/td&gt;&lt;td&gt;282&lt;/td&gt;&lt;td&gt; - 66&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;251&lt;/td&gt;&lt;td&gt;289&lt;/td&gt;&lt;td&gt;112&lt;/td&gt;&lt;td&gt; - 177&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;252&lt;/td&gt;&lt;td&gt;124&lt;/td&gt;&lt;td&gt;168&lt;/td&gt;&lt;td&gt;44&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;253&lt;/td&gt;&lt;td&gt;218&lt;/td&gt;&lt;td&gt;238&lt;/td&gt;&lt;td&gt;20&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;254&lt;/td&gt;&lt;td&gt;145&lt;/td&gt;&lt;td&gt;207&lt;/td&gt;&lt;td&gt;62&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;255&lt;/td&gt;&lt;td&gt;119&lt;/td&gt;&lt;td&gt;113&lt;/td&gt;&lt;td&gt; - 6&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;256&lt;/td&gt;&lt;td&gt;183&lt;/td&gt;&lt;td&gt;123&lt;/td&gt;&lt;td&gt; - 60&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;257&lt;/td&gt;&lt;td&gt;299&lt;/td&gt;&lt;td&gt;236&lt;/td&gt;&lt;td&gt; - 63&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;258&lt;/td&gt;&lt;td&gt;73&lt;/td&gt;&lt;td&gt;62&lt;/td&gt;&lt;td&gt; - 11&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;259&lt;/td&gt;&lt;td&gt;302&lt;/td&gt;&lt;td&gt;261&lt;/td&gt;&lt;td&gt; - 41&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;260&lt;/td&gt;&lt;td&gt;29&lt;/td&gt;&lt;td&gt;96&lt;/td&gt;&lt;td&gt;67&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;261&lt;/td&gt;&lt;td&gt;57&lt;/td&gt;&lt;td&gt;57&lt;/td&gt;&lt;td&gt;0&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;262&lt;/td&gt;&lt;td&gt;173&lt;/td&gt;&lt;td&gt;225&lt;/td&gt;&lt;td&gt;52&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;263&lt;/td&gt;&lt;td&gt;281&lt;/td&gt;&lt;td&gt;255&lt;/td&gt;&lt;td&gt; - 26&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;264&lt;/td&gt;&lt;td&gt;31&lt;/td&gt;&lt;td&gt;99&lt;/td&gt;&lt;td&gt;68&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;265&lt;/td&gt;&lt;td&gt;275&lt;/td&gt;&lt;td&gt;270&lt;/td&gt;&lt;td&gt; - 5&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;266&lt;/td&gt;&lt;td&gt;319&lt;/td&gt;&lt;td&gt;296&lt;/td&gt;&lt;td&gt; - 23&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;267&lt;/td&gt;&lt;td&gt;181&lt;/td&gt;&lt;td&gt;245&lt;/td&gt;&lt;td&gt;64&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;268&lt;/td&gt;&lt;td&gt;178&lt;/td&gt;&lt;td&gt;301&lt;/td&gt;&lt;td&gt;123&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;269&lt;/td&gt;&lt;td&gt;89&lt;/td&gt;&lt;td&gt;108&lt;/td&gt;&lt;td&gt;19&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;270&lt;/td&gt;&lt;td&gt;307&lt;/td&gt;&lt;td&gt;291&lt;/td&gt;&lt;td&gt; - 16&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;271&lt;/td&gt;&lt;td&gt;294&lt;/td&gt;&lt;td&gt;229&lt;/td&gt;&lt;td&gt; - 65&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;272&lt;/td&gt;&lt;td&gt;215&lt;/td&gt;&lt;td&gt;43&lt;/td&gt;&lt;td&gt; - 172&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;273&lt;/td&gt;&lt;td&gt;176&lt;/td&gt;&lt;td&gt;160&lt;/td&gt;&lt;td&gt; - 16&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;274&lt;/td&gt;&lt;td&gt;270&lt;/td&gt;&lt;td&gt;180&lt;/td&gt;&lt;td&gt; - 90&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;275&lt;/td&gt;&lt;td&gt;240&lt;/td&gt;&lt;td&gt;195&lt;/td&gt;&lt;td&gt; - 45&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;276&lt;/td&gt;&lt;td&gt;217&lt;/td&gt;&lt;td&gt;263&lt;/td&gt;&lt;td&gt;46&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;277&lt;/td&gt;&lt;td&gt;318&lt;/td&gt;&lt;td&gt;302&lt;/td&gt;&lt;td&gt; - 16&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;278&lt;/td&gt;&lt;td&gt;316&lt;/td&gt;&lt;td&gt;303&lt;/td&gt;&lt;td&gt; - 13&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;279&lt;/td&gt;&lt;td&gt;285&lt;/td&gt;&lt;td&gt;237&lt;/td&gt;&lt;td&gt; - 48&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;280&lt;/td&gt;&lt;td&gt;280&lt;/td&gt;&lt;td&gt;297&lt;/td&gt;&lt;td&gt;17&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;281&lt;/td&gt;&lt;td&gt;177&lt;/td&gt;&lt;td&gt;72&lt;/td&gt;&lt;td&gt; - 105&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;282&lt;/td&gt;&lt;td&gt;207&lt;/td&gt;&lt;td&gt;234&lt;/td&gt;&lt;td&gt;27&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;283&lt;/td&gt;&lt;td&gt;314&lt;/td&gt;&lt;td&gt;217&lt;/td&gt;&lt;td&gt; - 97&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;284&lt;/td&gt;&lt;td&gt;309&lt;/td&gt;&lt;td&gt;232&lt;/td&gt;&lt;td&gt; - 77&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;285&lt;/td&gt;&lt;td&gt;306&lt;/td&gt;&lt;td&gt;253&lt;/td&gt;&lt;td&gt; - 53&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;286&lt;/td&gt;&lt;td&gt;248&lt;/td&gt;&lt;td&gt;292&lt;/td&gt;&lt;td&gt;44&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;287&lt;/td&gt;&lt;td&gt;193&lt;/td&gt;&lt;td&gt;289&lt;/td&gt;&lt;td&gt;96&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;288&lt;/td&gt;&lt;td&gt;296&lt;/td&gt;&lt;td&gt;286&lt;/td&gt;&lt;td&gt; - 10&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;289&lt;/td&gt;&lt;td&gt;227&lt;/td&gt;&lt;td&gt;285&lt;/td&gt;&lt;td&gt;58&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;290&lt;/td&gt;&lt;td&gt;171&lt;/td&gt;&lt;td&gt;222&lt;/td&gt;&lt;td&gt;51&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;291&lt;/td&gt;&lt;td&gt;345&lt;/td&gt;&lt;td&gt;304&lt;/td&gt;&lt;td&gt; - 41&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;292&lt;/td&gt;&lt;td&gt;305&lt;/td&gt;&lt;td&gt;262&lt;/td&gt;&lt;td&gt; - 43&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;293&lt;/td&gt;&lt;td&gt;71&lt;/td&gt;&lt;td&gt;268&lt;/td&gt;&lt;td&gt;197&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;294&lt;/td&gt;&lt;td&gt;264&lt;/td&gt;&lt;td&gt;266&lt;/td&gt;&lt;td&gt;2&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;295&lt;/td&gt;&lt;td&gt;226&lt;/td&gt;&lt;td&gt;235&lt;/td&gt;&lt;td&gt;9&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;296&lt;/td&gt;&lt;td&gt;225&lt;/td&gt;&lt;td&gt;209&lt;/td&gt;&lt;td&gt; - 16&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;297&lt;/td&gt;&lt;td&gt;273&lt;/td&gt;&lt;td&gt;295&lt;/td&gt;&lt;td&gt;22&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;298&lt;/td&gt;&lt;td&gt;244&lt;/td&gt;&lt;td&gt;260&lt;/td&gt;&lt;td&gt;16&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;299&lt;/td&gt;&lt;td&gt;142&lt;/td&gt;&lt;td&gt;305&lt;/td&gt;&lt;td&gt;163&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;300&lt;/td&gt;&lt;td&gt;209&lt;/td&gt;&lt;td&gt;306&lt;/td&gt;&lt;td&gt;97&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;301&lt;/td&gt;&lt;td&gt;313&lt;/td&gt;&lt;td&gt;307&lt;/td&gt;&lt;td&gt; - 6&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;div class=&quot;Text&quot;&gt;It looks like the race leaders were fairly accurate in their predictions, while the differences start to become greater around 40th place or so.&lt;/div&gt;
&lt;div class=&quot;Input&quot;&gt;BarChart[swimΔ, FrameLabel-&amp;gt;{&lt;span style=&quot;color: #666666;&quot;&gt;&amp;quot;Overall Place&amp;quot;&lt;/span&gt;, &lt;span style=&quot;color: #666666;&quot;&gt;&amp;quot;Swim Δ&amp;quot;&lt;/span&gt;}, Frame-&amp;gt;{True, True, False, False}]&lt;/div&gt;
&lt;div class=&quot;Output&quot;&gt;&lt;a href=&quot;http://www.flickr.com/photos/10274904@N05/3505059168&quot; title=&quot;View &#39;2009-05-05-TriTheIllini1&#39; on Flickr.com&quot;&gt;&lt;img style=&quot;border:none&quot; src=&quot;http://farm4.static.flickr.com/3571/3505059168_4b49cf2174_o.png&quot; alt=&quot;2009-05-05-TriTheIllini1&quot; border=&quot;0&quot; width=&quot;360&quot; height=&quot;231&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;Text&quot;&gt;From the sorted Δs it looks like about half of the participants were within 50 places or so of their seeds, while a few were way off (in both directions).&lt;/div&gt;
&lt;div class=&quot;Input&quot;&gt;BarChart[Sort[swimΔ]]&lt;/div&gt;
&lt;div class=&quot;Output&quot;&gt;&lt;a href=&quot;http://www.flickr.com/photos/10274904@N05/3505059178&quot; title=&quot;View &#39;2009-05-05-TriTheIllini2&#39; on Flickr.com&quot;&gt;&lt;img style=&quot;border:none&quot; src=&quot;http://farm4.static.flickr.com/3563/3505059178_72317a5cfa_o.png&quot; alt=&quot;2009-05-05-TriTheIllini2&quot; border=&quot;0&quot; width=&quot;360&quot; height=&quot;215&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;Input&quot;&gt;Median[Abs@swimΔ]&lt;/div&gt;
&lt;div class=&quot;Output&quot;&gt;41&lt;/div&gt;
&lt;div class=&quot;Input&quot;&gt;N[Mean[Abs@swimΔ]]&lt;/div&gt;
&lt;div class=&quot;Output&quot;&gt;56.70099667774086`&lt;/div&gt;
&lt;div class=&quot;Input&quot;&gt;N[StandardDeviation[Abs@swimΔ]]&lt;/div&gt;
&lt;div class=&quot;Output&quot;&gt;51.80100030247153`&lt;/div&gt;
&lt;div class=&quot;Input&quot;&gt;Commonest[Abs@swimΔ]&lt;/div&gt;
&lt;div class=&quot;Output&quot;&gt;{16}&lt;/div&gt;
&lt;div class=&quot;Input&quot;&gt;tally = Sort[Tally[Abs@swimΔ]]&lt;/div&gt;
&lt;div class=&quot;Output&quot;&gt;{{0, 5}, {1, 3}, {2, 4}, {3, 3}, {4, 1}, {5, 6}, {6, 6}, {7, 6}, {8, 5}, {9, 4}, {10, 5}, {11, 1}, {12, 5}, {13, 3}, {14, 4}, {15, 5}, {16, 10}, {17, 1}, {18, 4}, {19, 3}, {20, 5}, {21, 4}, {22, 6}, {23, 4}, {24, 3}, {25, 1}, {26, 5}, {27, 2}, {28, 4}, {30, 6}, {31, 2}, {32, 4}, {33, 2}, {34, 6}, {35, 4}, {36, 2}, {37, 2}, {41, 5}, {42, 2}, {43, 2}, {44, 3}, {45, 3}, {46, 2}, {47, 2}, {48, 3}, {49, 3}, {50, 3}, {51, 5}, {52, 3}, {53, 1}, {54, 1}, {55, 1}, {56, 3}, {57, 4}, {58, 2}, {59, 2}, {60, 2}, {62, 4}, {63, 3}, {64, 1}, {65, 2}, {66, 2}, {67, 4}, {68, 1}, {69, 1}, {70, 1}, {71, 2}, {72, 1}, {75, 2}, {76, 1}, {77, 1}, {79, 2}, {80, 1}, {83, 2}, {86, 3}, {88, 1}, {90, 5}, {94, 1}, {96, 1}, {97, 2}, {101, 1}, {105, 1}, {106, 2}, {108, 1}, {111, 1}, {113, 1}, {114, 3}, {116, 1}, {117, 1}, {118, 1}, {121, 2}, {122, 3}, {123, 4}, {125, 1}, {128, 1}, {130, 1}, {131, 1}, {133, 1}, {134, 1}, {135, 2}, {136, 2}, {141, 1}, {143, 1}, {146, 1}, {151, 1}, {156, 1}, {157, 1}, {158, 1}, {159, 1}, {160, 1}, {161, 1}, {163, 1}, {167, 1}, {168, 2}, {170, 1}, {172, 1}, {174, 1}, {177, 1}, {179, 1}, {186, 1}, {188, 1}, {194, 1}, {195, 1}, {197, 1}, {205, 1}, {226, 1}, {277, 1}}&lt;/div&gt;
&lt;div class=&quot;Input&quot;&gt;BarChart[Range[0, Max[tally[[All, 1]]]]/.Append[Apply[Rule, tally, 1], _Integer-&amp;gt;0], FrameLabel-&amp;gt;{TraditionalForm[Abs[&lt;span style=&quot;color: #666666;&quot;&gt;&amp;quot;swimΔ&amp;quot;&lt;/span&gt;]], &lt;span style=&quot;color: #666666;&quot;&gt;&amp;quot;Count&amp;quot;&lt;/span&gt;}, Frame-&amp;gt;{True, True, False, False}]&lt;/div&gt;
&lt;div class=&quot;Output&quot;&gt;&lt;a href=&quot;http://www.flickr.com/photos/10274904@N05/3505059196&quot; title=&quot;View &#39;2009-05-05-TriTheIllini3&#39; on Flickr.com&quot;&gt;&lt;img style=&quot;border:none&quot; src=&quot;http://farm4.static.flickr.com/3587/3505059196_cf3d6f9fbb_o.png&quot; alt=&quot;2009-05-05-TriTheIllini3&quot; border=&quot;0&quot; width=&quot;360&quot; height=&quot;237&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;Text&quot;&gt;It looks like most people were 40-50 places off (in one direction or the other) from their seed.  This is higher than I would have expected.  The most common difference was 16 places.  There must have been a &lt;span style=&quot;font-style:italic;&quot;&gt;lot&lt;/span&gt; of passing going on.&lt;/div&gt;
&lt;div class=&quot;Text&quot;&gt;&lt;a href=&quot;http://sites.google.com/site/ragfield/dev/2009-05-05-TriTheIllini.nb?attredirects=0&quot;&gt;Download Mathematica Notebook&lt;/a&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dev.ragfield.com/feeds/1457026784011156035/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/7147569507271803579/1457026784011156035' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7147569507271803579/posts/default/1457026784011156035'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7147569507271803579/posts/default/1457026784011156035'/><link rel='alternate' type='text/html' href='http://dev.ragfield.com/2009/05/tri-illini-swim-analysis.html' title='Tri the Illini swim analysis'/><author><name>Ragfield</name><uri>http://www.blogger.com/profile/12325362017984149251</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='25' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjl1SMlQXOTAV7_F3A5DZg4b2e5eimTTKX9EFIlSIGempd0D7LkUqQQ9cneJqOm9HkcSDncQURdiuKI_uoLJJTJs8hSu7nFDdJ_LNdI1hpdiamXqIc6zPoJtTHCZXpkEA/s220/Ahoy.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7147569507271803579.post-8472304940600756874</id><published>2009-04-24T17:24:00.000-05:00</published><updated>2009-04-24T20:55:23.691-05:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="c++"/><category scheme="http://www.blogger.com/atom/ns#" term="mozilla"/><category scheme="http://www.blogger.com/atom/ns#" term="webkit"/><title type='text'>My first WebKit patch</title><content type='html'>&lt;p&gt;Several years ago I spent a few hours implementing a feature in &lt;a href=&quot;http://www.mozilla.org/&quot;&gt;Mozilla&lt;/a&gt;, and then probably 10 times that amount of time dealing with the hassle of getting my code (which I was trying to &lt;em&gt;give&lt;/em&gt; them for &lt;em&gt;free&lt;/em&gt;) approved and into their sources.  The incident left a bitter aftertaste.&lt;/p&gt;

&lt;p&gt;Fast forward to present day.  I was just reading through some &lt;a href=&quot;http://webkit.org/&quot;&gt;WebKit&lt;/a&gt; sources and noticed a typo in one of the comments.  So I decided to fix the typo and submit a patch to see how painful the process is for the competing project.&lt;/p&gt;

&lt;pre&gt;Index: JavaScriptCore/ChangeLog
===================================================================
--- JavaScriptCore/ChangeLog	(revision 42833)
+++ JavaScriptCore/ChangeLog	(working copy)
@@ -1,3 +1,9 @@
+2009-04-24  Rob Raguet-Schofield  
+
+        Reviewed by NOBODY (OOPS!).
+
+        * wtf/CurrentTime.h:
+
 2009-04-23  Mark Rowe  
 
         With great sadness and a heavy heart I switch us back from YARR to WREC in
Index: JavaScriptCore/wtf/CurrentTime.h
===================================================================
--- JavaScriptCore/wtf/CurrentTime.h	(revision 42833)
+++ JavaScriptCore/wtf/CurrentTime.h	(working copy)
@@ -36,7 +36,7 @@ namespace WTF {
 
     // Returns the current system (UTC) time in seconds, starting January 1, 1970.
     // Precision varies depending on a platform but usually is as good or better 
-    // then a millisecond.
+    // than a millisecond.
     double currentTime();
 
 } // namespace WTF&lt;/pre&gt;

&lt;p&gt;Picky?  Sure.  But why not?&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Update:&lt;/strong&gt; patch approved after 5 hours.&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://dev.ragfield.com/feeds/8472304940600756874/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/7147569507271803579/8472304940600756874' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7147569507271803579/posts/default/8472304940600756874'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7147569507271803579/posts/default/8472304940600756874'/><link rel='alternate' type='text/html' href='http://dev.ragfield.com/2009/04/my-first-webkit-patch.html' title='My first WebKit patch'/><author><name>Ragfield</name><uri>http://www.blogger.com/profile/12325362017984149251</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='25' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjl1SMlQXOTAV7_F3A5DZg4b2e5eimTTKX9EFIlSIGempd0D7LkUqQQ9cneJqOm9HkcSDncQURdiuKI_uoLJJTJs8hSu7nFDdJ_LNdI1hpdiamXqIc6zPoJtTHCZXpkEA/s220/Ahoy.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7147569507271803579.post-741314217453872411</id><published>2009-04-20T22:33:00.001-05:00</published><updated>2009-04-20T22:34:13.555-05:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="quicktime"/><category scheme="http://www.blogger.com/atom/ns#" term="video"/><title type='text'>Video on Aiptek PocketCinema</title><content type='html'>&lt;a href=&quot;http://www.flickr.com/photos/ragfield/3152820702/&quot; title=&quot;Pocket projector by ragfield, on Flickr&quot;&gt;&lt;img src=&quot;http://farm4.static.flickr.com/3283/3152820702_3c8e270ace.jpg&quot; width=&quot;500&quot; height=&quot;333&quot; alt=&quot;Pocket projector&quot; /&gt;&lt;/a&gt;

&lt;p&gt;The documentation for the Aiptek PocketCinema pico-projector claims to support the following video formats:&lt;/p&gt;

&lt;blockquote&gt;
 - MJPEG AVI (recommended)&lt;br/&gt;
 - MPEG-4 ASF&lt;/blockquote&gt;

&lt;p&gt;So how do I convert video into one of these formats on a Mac with QuickTime Pro?&lt;/p&gt;

&lt;p&gt;
&lt;strong&gt;Test&lt;/strong&gt;:  Use &lt;em&gt;QuickTime Player&lt;/em&gt; to Export Movie to MPEG-4.&lt;br/&gt;
&lt;strong&gt;Result&lt;/strong&gt;:  FAIL.  PocketCinema hangs when attempting to preview video and needs to be reset by removing battery.
&lt;/p&gt;

&lt;p&gt;
&lt;strong&gt;Test&lt;/strong&gt;:  Use &lt;em&gt;QuickTime Player&lt;/em&gt; to Export Movie to AVI.  MJPEG is not support.  Try uncompressed, BMP, and Cinepak.&lt;br/&gt;
&lt;strong&gt;Result&lt;/strong&gt;:  FAIL. PocketCinema recognizes AVI file, does not hang, but also does not play any of the files (uncompressed, BMP, or Cinepak).
&lt;/p&gt;

&lt;p&gt;
&lt;strong&gt;Test&lt;/strong&gt;:  Use &lt;em&gt;QuickTime Player&lt;/em&gt; to Export Movie to QuickTime Movie with Motion JPEG codec.&lt;br/&gt;
&lt;strong&gt;Result&lt;/strong&gt;:  FAIL.  PocketCinema does not recognize .mov file.
&lt;/p&gt;

&lt;p&gt;
&lt;strong&gt;Test&lt;/strong&gt;:  Use &lt;em&gt;QuickTime Player&lt;/em&gt; to Export to MPEG-4, then use &lt;em&gt;Flv Crunch&lt;/em&gt; to convert to MPEG-4 &lt;em&gt;again&lt;/em&gt;.&lt;br/&gt;
&lt;strong&gt;Result&lt;/strong&gt;:  Success!  Apparently the projector has a problem with the MPEG4 generated by &lt;em&gt;QuickTime&lt;/em&gt;, but does not have a problem with the MPEG4 generated by &lt;em&gt;ffmpeg&lt;/em&gt;.
&lt;/p&gt;

&lt;p&gt;Behind the scenes &lt;em&gt;Flv Crunch&lt;/em&gt; is just using the &lt;em&gt;ffmpeg&lt;/em&gt; command line tool.  The following command did the trick for me:&lt;/p&gt;

&lt;code&gt;ffmpeg -i source.mp4 dest.mp4&lt;/code&gt;</content><link rel='replies' type='application/atom+xml' href='http://dev.ragfield.com/feeds/741314217453872411/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/7147569507271803579/741314217453872411' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7147569507271803579/posts/default/741314217453872411'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7147569507271803579/posts/default/741314217453872411'/><link rel='alternate' type='text/html' href='http://dev.ragfield.com/2009/04/video-on-aiptek-pocketcinema.html' title='Video on Aiptek PocketCinema'/><author><name>Ragfield</name><uri>http://www.blogger.com/profile/12325362017984149251</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='25' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjl1SMlQXOTAV7_F3A5DZg4b2e5eimTTKX9EFIlSIGempd0D7LkUqQQ9cneJqOm9HkcSDncQURdiuKI_uoLJJTJs8hSu7nFDdJ_LNdI1hpdiamXqIc6zPoJtTHCZXpkEA/s220/Ahoy.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://farm4.static.flickr.com/3283/3152820702_3c8e270ace_t.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7147569507271803579.post-8936881171530090836</id><published>2009-04-17T12:27:00.001-05:00</published><updated>2009-04-17T12:27:40.842-05:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="2D graphics"/><category scheme="http://www.blogger.com/atom/ns#" term="gps"/><category scheme="http://www.blogger.com/atom/ns#" term="mathematica"/><title type='text'>Mapping GPS Data</title><content type='html'>&lt;p&gt;I have written a blog entry titled &lt;a href=&quot;http://blog.wolfram.com/2009/04/17/mapping-gps-data/&quot;&gt;Mapping GPS Data&lt;/a&gt; that has just been posted to the &lt;a href=&quot;http://blog.wolfram.com/&quot;&gt;Wolfram Research blog&lt;/a&gt;.&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://dev.ragfield.com/feeds/8936881171530090836/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/7147569507271803579/8936881171530090836' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7147569507271803579/posts/default/8936881171530090836'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7147569507271803579/posts/default/8936881171530090836'/><link rel='alternate' type='text/html' href='http://dev.ragfield.com/2009/04/mapping-gps-data.html' title='Mapping GPS Data'/><author><name>Ragfield</name><uri>http://www.blogger.com/profile/12325362017984149251</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='25' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjl1SMlQXOTAV7_F3A5DZg4b2e5eimTTKX9EFIlSIGempd0D7LkUqQQ9cneJqOm9HkcSDncQURdiuKI_uoLJJTJs8hSu7nFDdJ_LNdI1hpdiamXqIc6zPoJtTHCZXpkEA/s220/Ahoy.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7147569507271803579.post-786353583281928181</id><published>2009-04-16T21:28:00.001-05:00</published><updated>2009-05-05T10:19:56.968-05:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="mathematica"/><category scheme="http://www.blogger.com/atom/ns#" term="twitter"/><title type='text'>Twittering with Mathematica</title><content type='html'>&lt;div class=&quot;Text&quot;&gt;A couple weeks ago &lt;a href=&quot;http://jamesrohal.com/&quot;&gt;James Rohal&lt;/a&gt; wrote about &amp;quot;&lt;a href=&quot;http://jamesrohal.com/2009/04/05/updating-twitter-from-mathematica/&quot;&gt;Updating Twitter from Mathematica&lt;/a&gt;.&amp;quot;  His technique is interesting, but it has a number of drawbacks.  It requires special PHP code to run on his server.  The user name and password appear to be hardcoded.  The only functionality it provides is updating the status.&lt;/div&gt;
&lt;div class=&quot;Text&quot;&gt;&lt;a href=&quot;http://twitter.com/&quot;&gt;Twitter&lt;/a&gt; has a &lt;a href=&quot;http://en.wikipedia.org/wiki/Representational_State_Transfer&quot;&gt;REST&lt;/a&gt; &lt;a href=&quot;http://apiwiki.twitter.com/REST+API+Documentation&quot;&gt;API&lt;/a&gt; which can be called directly from a number of languages, including &lt;span style=&quot;font-style:italic;&quot;&gt;Mathematica&lt;/span&gt;.  Several months ago I started, but didn&amp;apos;t finish, a &lt;span style=&quot;font-style:italic;&quot;&gt;Mathematica&lt;/span&gt; package to wrap the Twitter API.  After I read James&amp;apos; post I took the opportunity to clean it up and fill in the missing pieces.&lt;/div&gt;
&lt;div class=&quot;Text&quot;&gt;Let&amp;apos;s take a look a few of the things this Twitter package can do.  Begin by loading the package in the usual manner.&lt;/div&gt;
&lt;div class=&quot;Input&quot;&gt;&amp;lt;&amp;lt;Twitter`&lt;/div&gt;
&lt;div class=&quot;Subsection&quot;&gt;TwitterSession&lt;/div&gt;
&lt;div class=&quot;Text&quot;&gt;Next we&amp;apos;ll open a &lt;span style=&quot;font-style:italic;&quot;&gt;session&lt;/span&gt;.  This will bring up a login dialog.&lt;/div&gt;
&lt;div class=&quot;Input&quot;&gt;session = TwitterSessionOpen[]&lt;/div&gt;
&lt;div class=&quot;Output&quot;&gt;TwitterSession[&amp;lt;ragfield&amp;gt;]&lt;/div&gt;
&lt;div class=&quot;Input&quot;&gt;TwitterSessionAuthorizedQ[session]&lt;/div&gt;
&lt;div class=&quot;Output&quot;&gt;True&lt;/div&gt;
&lt;div class=&quot;Input&quot;&gt;TwitterSessionScreenName[session]&lt;/div&gt;
&lt;div class=&quot;Output&quot;&gt;ragfield&lt;/div&gt;
&lt;div class=&quot;Input&quot;&gt;TwitterSessionClose[session]&lt;/div&gt;
&lt;div class=&quot;Text&quot;&gt;It&amp;apos;s also possible to specify the user name and/or login programatically to avoid the manual step.  However, doing so will require a hardcoded password.&lt;/div&gt;
&lt;div class=&quot;Input&quot;&gt;session = TwitterSessionOpen[&lt;span style=&quot;color: #666666;&quot;&gt;&amp;quot;User&amp;quot;&lt;/span&gt;-&amp;gt;&lt;span style=&quot;color: #666666;&quot;&gt;&amp;quot;ragfield&amp;quot;&lt;/span&gt;]&lt;/div&gt;
&lt;div class=&quot;Output&quot;&gt;TwitterSession[&amp;lt;ragfield&amp;gt;]&lt;/div&gt;
&lt;div class=&quot;Subsection&quot;&gt;TwitterUser&lt;/div&gt;
&lt;div class=&quot;Text&quot;&gt;The next object is a &lt;span style=&quot;font-style:italic;&quot;&gt;user&lt;/span&gt;.  The session is associated with the user who logged in.&lt;/div&gt;
&lt;div class=&quot;Input&quot;&gt;user = TwitterSessionUser[session]&lt;/div&gt;
&lt;div class=&quot;Output&quot;&gt;TwitterUser[&amp;lt;ragfield&amp;gt;]&lt;/div&gt;
&lt;div class=&quot;Text&quot;&gt;We can query the user for several attributes.&lt;/div&gt;
&lt;div class=&quot;Input&quot;&gt;TwitterUserID[user]&lt;/div&gt;
&lt;div class=&quot;Output&quot;&gt;12920162&lt;/div&gt;
&lt;div class=&quot;Input&quot;&gt;TwitterUserName[user]&lt;/div&gt;
&lt;div class=&quot;Output&quot;&gt;Rob Raguet-Schofield&lt;/div&gt;
&lt;div class=&quot;Input&quot;&gt;TwitterUserScreenName[user]&lt;/div&gt;
&lt;div class=&quot;Output&quot;&gt;ragfield&lt;/div&gt;
&lt;div class=&quot;Input&quot;&gt;TwitterUserLocation[user]&lt;/div&gt;
&lt;div class=&quot;Output&quot;&gt;Urbana, Illinois&lt;/div&gt;
&lt;div class=&quot;Input&quot;&gt;TwitterUserHomePage[user]&lt;/div&gt;
&lt;div class=&quot;Output&quot;&gt;http://rob.ragfield.com&lt;/div&gt;
&lt;div class=&quot;Input&quot;&gt;TwitterUserDescription[user]&lt;/div&gt;
&lt;div class=&quot;Output&quot;&gt;My name is Rob. I write software, ride bicycles, and occasionally write software while riding bicycles.&lt;/div&gt;
&lt;div class=&quot;Input&quot;&gt;TwitterUserProfilePage[user]&lt;/div&gt;
&lt;div class=&quot;Output&quot;&gt;http://twitter.com/ragfield&lt;/div&gt;
&lt;div class=&quot;Input&quot;&gt;TwitterUserInfo[user]&lt;/div&gt;
&lt;div class=&quot;Output&quot;&gt;&lt;span style=&quot;font-weight:bold;&quot;&gt;Name &lt;/span&gt;Rob Raguet-Schofield&lt;br/&gt;
&lt;span style=&quot;font-weight:bold;&quot;&gt;Location &lt;/span&gt;Urbana, Illinois&lt;br/&gt;
&lt;span style=&quot;font-weight:bold;&quot;&gt;Web &lt;/span&gt;http://rob.ragfield.com&lt;br/&gt;
&lt;span style=&quot;font-weight:bold;&quot;&gt;Bio &lt;/span&gt;My name is Rob. I write software, ride bicycles, and occasionally write software while riding bicycles.&lt;/div&gt;
&lt;div class=&quot;Text&quot;&gt;And all this information can be displayed graphically with hyperlinks, tooltips, etc.&lt;/div&gt;
&lt;div class=&quot;Input&quot;&gt;TwitterUserUI[user]&lt;/div&gt;
&lt;div class=&quot;Output&quot;&gt;&lt;a href=&quot;http://www.flickr.com/photos/10274904@N05/3448427417&quot; title=&quot;View &#39;2009-04-16-TwitteringWithMathematica1&#39; on Flickr.com&quot;&gt;&lt;img style=&quot;border:none;&quot; src=&quot;http://farm4.static.flickr.com/3321/3448427417_2bb2f1895b_o.png&quot; alt=&quot;2009-04-16-TwitteringWithMathematica1&quot; border=&quot;0&quot; width=&quot;58&quot; height=&quot;68&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;Subsection&quot;&gt;TwitterStatus&lt;/div&gt;
&lt;div class=&quot;Text&quot;&gt;The final, and perhaps most important, object is the &lt;span style=&quot;font-style:italic;&quot;&gt;status&lt;/span&gt;.  A status can be accessed directly by its unique ID, or it can be retrieved from a timeline (see below).&lt;/div&gt;
&lt;div class=&quot;Input&quot;&gt;status = TwitterStatus[671394002]&lt;/div&gt;
&lt;div class=&quot;Output&quot;&gt;TwitterStatus[&amp;lt;ragfield: shopping for underpants&amp;gt;]&lt;/div&gt;
&lt;div class=&quot;Text&quot;&gt;We can also query the status message for several attributes.&lt;/div&gt;
&lt;div class=&quot;Input&quot;&gt;TwitterStatusID[status]&lt;/div&gt;
&lt;div class=&quot;Output&quot;&gt;671394002&lt;/div&gt;
&lt;div class=&quot;Input&quot;&gt;TwitterStatusUser[status]&lt;/div&gt;
&lt;div class=&quot;Output&quot;&gt;TwitterUser[&amp;lt;ragfield&amp;gt;]&lt;/div&gt;
&lt;div class=&quot;Input&quot;&gt;TwitterStatusDate[status]&lt;/div&gt;
&lt;div class=&quot;Output&quot;&gt;Sat 2 Feb 2008 19:02:02&lt;/div&gt;
&lt;div class=&quot;Input&quot;&gt;TwitterStatusText[status]&lt;/div&gt;
&lt;div class=&quot;Output&quot;&gt;shopping for underpants&lt;/div&gt;
&lt;div class=&quot;Input&quot;&gt;TwitterStatusPage[status]&lt;/div&gt;
&lt;div class=&quot;Output&quot;&gt;http://twitter.com/ragfield/statuses/671394002&lt;/div&gt;
&lt;div class=&quot;Input&quot;&gt;TwitterStatusSource[status]&lt;/div&gt;
&lt;div class=&quot;Output&quot;&gt;&lt;a href=&quot;http://twitterhelp.blogspot.com/2008/05/twitter-via-mobile-web-mtwittercom.html&quot;&gt;mobile web&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;Input&quot;&gt;TwitterStatusUI[status]&lt;/div&gt;
&lt;div class=&quot;Output&quot;&gt;&lt;a href=&quot;http://www.flickr.com/photos/10274904@N05/3449241574&quot; title=&quot;View &#39;2009-04-16-TwitteringWithMathematica2&#39; on Flickr.com&quot;&gt;&lt;img style=&quot;border:none;&quot; src=&quot;http://farm4.static.flickr.com/3642/3449241574_7470c123df_o.png&quot; alt=&quot;2009-04-16-TwitteringWithMathematica2&quot; border=&quot;0&quot; width=&quot;278&quot; height=&quot;70&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;Subsection&quot;&gt;Setting the status&lt;/div&gt;
&lt;div class=&quot;Text&quot;&gt;We can set our status.&lt;/div&gt;
&lt;div class=&quot;Input&quot;&gt;status = TwitterSetStatus[session, &lt;span style=&quot;color: #666666;&quot;&gt;&amp;quot;Tweeting from Mathematica&amp;quot;&lt;/span&gt;]&lt;/div&gt;
&lt;div class=&quot;Output&quot;&gt;TwitterStatus[&amp;lt;ragfield: Tweeting from Mathematica&amp;gt;]&lt;/div&gt;
&lt;div class=&quot;Input&quot;&gt;TwitterStatusUI[status]&lt;/div&gt;
&lt;div class=&quot;Output&quot;&gt;&lt;a href=&quot;http://www.flickr.com/photos/10274904@N05/3448441199&quot; title=&quot;View &#39;2009-04-16-TwitteringWithMathematica9&#39; on Flickr.com&quot;&gt;&lt;img style=&quot;border:none;&quot; src=&quot;http://farm4.static.flickr.com/3405/3448441199_dcf7700176_o.png&quot; alt=&quot;2009-04-16-TwitteringWithMathematica9&quot; border=&quot;0&quot; width=&quot;253&quot; height=&quot;70&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;Text&quot;&gt;We can also delete any of our tweets if we decided we don&amp;apos;t like them.&lt;/div&gt;
&lt;div class=&quot;Input&quot;&gt;status = TwitterSetStatus[session, &lt;span style=&quot;color: #666666;&quot;&gt;&amp;quot;I am dumb&amp;quot;&lt;/span&gt;]&lt;/div&gt;
&lt;div class=&quot;Output&quot;&gt;TwitterStatus[&amp;lt;ragfield: I am dumb&amp;gt;]&lt;/div&gt;
&lt;div class=&quot;Input&quot;&gt;id = TwitterStatusID[status]&lt;/div&gt;
&lt;div class=&quot;Output&quot;&gt;1537789527&lt;/div&gt;
&lt;div class=&quot;Input&quot;&gt;TwitterDeleteStatus[session, status]&lt;/div&gt;
&lt;div class=&quot;Output&quot;&gt;TwitterStatus[&amp;lt;ragfield: I am dumb&amp;gt;]&lt;/div&gt;
&lt;div class=&quot;Input&quot;&gt;TwitterStatus[id]&lt;/div&gt;
&lt;div class=&quot;Message&quot;&gt;FetchURL::&amp;quot;conopen&amp;quot;: &amp;quot;\!\(\*StyleBox[\&amp;quot;\\\&amp;quot;The connection to URL \\\&amp;quot;\&amp;quot;, \&amp;quot;MT\&amp;quot;]\)\!\(\*StyleBox[\!\(\&amp;quot;http://twitter.com/statuses/show/1537789527.xml\&amp;quot;\), \&amp;quot;MT\&amp;quot;]\)\!\(\*StyleBox[\&amp;quot;\\\&amp;quot; cannot be opened. If the URL is correct, you might need to configure your firewall program, or you might need to set a proxy in the Internet connectivity tab of the Preferences dialog (or by calling SetInternetProxy).  For HTTPS connections, you might need to inspect the authenticity of the server&amp;apos;s SSL certificate and choose to accept it.\\\&amp;quot;\&amp;quot;, \&amp;quot;MT\&amp;quot;]\)&amp;quot;&lt;/div&gt;
&lt;div class=&quot;Output&quot;&gt;$Failed&lt;/div&gt;
&lt;div class=&quot;Text&quot;&gt;The tweet has been deleted, so any attempt to download it again fails.&lt;/div&gt;
&lt;div class=&quot;Subsection&quot;&gt;Timelines&lt;/div&gt;
&lt;div class=&quot;Text&quot;&gt;A list of status messages can be retrieved from a specific user.&lt;/div&gt;
&lt;div class=&quot;Input&quot;&gt;Take[TwitterUserTimeline[user], 4]&lt;/div&gt;
&lt;div class=&quot;Output&quot;&gt;{TwitterStatus[&amp;lt;ragfield: Tweeting from Mathematica&amp;gt;], TwitterStatus[&amp;lt;ragfield: testing...&amp;gt;], TwitterStatus[&amp;lt;ragfield: 4 mile recovery/photo walk&amp;gt;], TwitterStatus[&amp;lt;ragfield: Marge, if anyone asks, you require 24 hour nursing care, Lisa&amp;apos;s a clergyman, Maggie is seven people, and Bart was wounded in Vietnam&amp;gt;]}&lt;/div&gt;
&lt;div class=&quot;Input&quot;&gt;Column[TwitterStatusUI/@%]&lt;/div&gt;
&lt;div class=&quot;Output&quot;&gt;&lt;a href=&quot;http://www.flickr.com/photos/ragfield/3448427529/&quot; title=&quot;2009-04-16-TwitteringWithMathematica3 by ragfield, on Flickr&quot;&gt;&lt;img style=&quot;border:none;&quot; src=&quot;http://farm4.static.flickr.com/3394/3448427529_ea9094d125_o.png&quot; width=&quot;398&quot; height=&quot;320&quot; alt=&quot;2009-04-16-TwitteringWithMathematica3&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;Text&quot;&gt;And more...&lt;/div&gt;
&lt;div class=&quot;Input&quot;&gt;Take[TwitterUserTimeline[user, &lt;span style=&quot;color: #666666;&quot;&gt;&amp;quot;Page&amp;quot;&lt;/span&gt;-&amp;gt;2], 4]&lt;/div&gt;
&lt;div class=&quot;Output&quot;&gt;{TwitterStatus[&amp;lt;ragfield: off to run the marathon. wish me luck.&amp;gt;], TwitterStatus[&amp;lt;ragfield: @esmithrunner good luck to you and your family as well&amp;gt;], TwitterStatus[&amp;lt;ragfield: It&amp;apos;s just another race&amp;gt;], TwitterStatus[&amp;lt;ragfield: Little Miss C (kindergarten) after successfully adding 95+3, &amp;quot;I probably know just about all maths.&amp;quot;&amp;gt;]}&lt;/div&gt;
&lt;div class=&quot;Input&quot;&gt;Column[TwitterStatusUI/@%]&lt;/div&gt;
&lt;div class=&quot;Output&quot;&gt;&lt;a href=&quot;http://www.flickr.com/photos/ragfield/3448427541/&quot; title=&quot;2009-04-16-TwitteringWithMathematica4 by ragfield, on Flickr&quot;&gt;&lt;img style=&quot;border:none;&quot; src=&quot;http://farm4.static.flickr.com/3305/3448427541_b7e3cbfceb_o.png&quot; width=&quot;398&quot; height=&quot;306&quot; alt=&quot;2009-04-16-TwitteringWithMathematica4&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;Text&quot;&gt;And even other users&amp;apos; timelines...&lt;/div&gt;
&lt;div class=&quot;Input&quot;&gt;Take[TwitterUserTimeline[&lt;span style=&quot;color: #666666;&quot;&gt;&amp;quot;lancearmstrong&amp;quot;&lt;/span&gt;], 3]&lt;/div&gt;
&lt;div class=&quot;Output&quot;&gt;{TwitterStatus[&amp;lt;lancearmstrong: The Armstrong&amp;apos;s in the snow! Just went swimming at the aspen rec center.&amp;gt;], TwitterStatus[&amp;lt;lancearmstrong: http://twitpic.com/3ffo8&amp;gt;], TwitterStatus[&amp;lt;lancearmstrong: This is AMAZING!!!! http://tinyurl.com/d7d6ex&amp;gt;]}&lt;/div&gt;
&lt;div class=&quot;Input&quot;&gt;Column[TwitterStatusUI/@%]&lt;/div&gt;
&lt;div class=&quot;Output&quot;&gt;&lt;a href=&quot;http://www.flickr.com/photos/ragfield/3448427453/&quot; title=&quot;2009-04-16-TwitteringWithMathematica5 by ragfield, on Flickr&quot;&gt;&lt;img style=&quot;border:none;&quot; src=&quot;http://farm4.static.flickr.com/3660/3448427453_3caefea4b4_o.png&quot; width=&quot;398&quot; height=&quot;232&quot; alt=&quot;2009-04-16-TwitteringWithMathematica5&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;Text&quot;&gt;And the &lt;span style=&quot;font-style:italic;&quot;&gt;friends&lt;/span&gt; timeline...&lt;/div&gt;
&lt;div class=&quot;Input&quot;&gt;Take[TwitterFriendsTimeline[session], 3]&lt;/div&gt;
&lt;div class=&quot;Output&quot;&gt;{TwitterStatus[&amp;lt;cabel: Enjoying the absurdity of Remi Gaillard&amp;apos;s real-life Pac-Man. http://tinyurl.com/dm9mor&amp;gt;], TwitterStatus[&amp;lt;danielpunkass: I suggest opt-in per tweet. I get a message from @twitshirt: &amp;quot;Lucky you! Somebody wants to make you famous!&amp;quot; Per-tweet licensing agreement.&amp;gt;], TwitterStatus[&amp;lt;danielpunkass: Feel bad for @twitshirt guys, but I agree it&amp;apos;s a smarmy premise ¬©-wise. Friend in IRC suggested opt-in + @messages inviting opt-in. Solved.&amp;gt;]}&lt;/div&gt;
&lt;div class=&quot;Input&quot;&gt;Column[TwitterStatusUI/@%]&lt;/div&gt;
&lt;div class=&quot;Output&quot;&gt;&lt;a href=&quot;http://www.flickr.com/photos/ragfield/3448427461/&quot; title=&quot;2009-04-16-TwitteringWithMathematica6 by ragfield, on Flickr&quot;&gt;&lt;img style=&quot;border:none;&quot; src=&quot;http://farm4.static.flickr.com/3306/3448427461_76c5de99f8_o.png&quot; width=&quot;398&quot; height=&quot;280&quot; alt=&quot;2009-04-16-TwitteringWithMathematica6&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;Text&quot;&gt;And any &lt;span style=&quot;font-style:italic;&quot;&gt;replies&lt;/span&gt; to the user...&lt;/div&gt;
&lt;div class=&quot;Input&quot;&gt;Take[TwitterReplies[session], 3]&lt;/div&gt;
&lt;div class=&quot;Output&quot;&gt;{TwitterStatus[&amp;lt;spoonshake: @ragfield Ah, priceless Simpsons quotes.&amp;gt;], TwitterStatus[&amp;lt;gutzville: @ragfield I would just be happy if they put the curtis road exit in that has been open for more than a year&amp;gt;], TwitterStatus[&amp;lt;spoonshake: @ragfield Priceless headline.&amp;gt;]}&lt;/div&gt;
&lt;div class=&quot;Input&quot;&gt;Column[TwitterStatusUI/@%]&lt;/div&gt;
&lt;div class=&quot;Output&quot;&gt;&lt;a href=&quot;http://www.flickr.com/photos/ragfield/3449241648/&quot; title=&quot;2009-04-16-TwitteringWithMathematica7 by ragfield, on Flickr&quot;&gt;&lt;img style=&quot;border:none;&quot; src=&quot;http://farm4.static.flickr.com/3411/3449241648_3538e4c180_o.png&quot; width=&quot;398&quot; height=&quot;232&quot; alt=&quot;2009-04-16-TwitteringWithMathematica7&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;Text&quot;&gt;And the &lt;span style=&quot;font-style:italic;&quot;&gt;public&lt;/span&gt; timeline...&lt;/div&gt;
&lt;div class=&quot;Input&quot;&gt;Take[TwitterPublicTimeline[], 3]&lt;/div&gt;
&lt;div class=&quot;Output&quot;&gt;{TwitterStatus[&amp;lt;lastp1acechamps: @mchowes yah my friend seriously lives right across the street from the newbury store and he couldn&amp;apos;t get up for me.&amp;gt;], TwitterStatus[&amp;lt;exult: Some things alarm me more than other things&amp;gt;], TwitterStatus[&amp;lt;HambyDavid: Phone is dying. Need car charger&amp;gt;]}&lt;/div&gt;
&lt;div class=&quot;Input&quot;&gt;Column[TwitterStatusUI/@ %]&lt;/div&gt;
&lt;div class=&quot;Output&quot;&gt;&lt;a href=&quot;http://www.flickr.com/photos/ragfield/3449241682/&quot; title=&quot;2009-04-16-TwitteringWithMathematica8 by ragfield, on Flickr&quot;&gt;&lt;img style=&quot;border:none;&quot; src=&quot;http://farm4.static.flickr.com/3402/3449241682_647ed25cd6_o.png&quot; width=&quot;398&quot; height=&quot;232&quot; alt=&quot;2009-04-16-TwitteringWithMathematica8&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;Subsection&quot;&gt;Friends and Followers&lt;/div&gt;
&lt;div class=&quot;Text&quot;&gt;Finally we can get a list of our &lt;span style=&quot;font-style:italic;&quot;&gt;friends&lt;/span&gt; and &lt;span style=&quot;font-style:italic;&quot;&gt;followers&lt;/span&gt;.&lt;/div&gt;
&lt;div class=&quot;Input&quot;&gt;Take[friends = TwitterFriends[session], 5]&lt;/div&gt;
&lt;div class=&quot;Output&quot;&gt;{TwitterUser[&amp;lt;bmeyaard&amp;gt;], TwitterUser[&amp;lt;quickKarl2&amp;gt;], TwitterUser[&amp;lt;_Becca_Knight&amp;gt;], TwitterUser[&amp;lt;bikefriday&amp;gt;], TwitterUser[&amp;lt;aimeekandrac&amp;gt;]}&lt;/div&gt;
&lt;div class=&quot;Input&quot;&gt;Take[followers = TwitterFollowers[session], 5]&lt;/div&gt;
&lt;div class=&quot;Output&quot;&gt;{TwitterUser[&amp;lt;bmeyaard&amp;gt;], TwitterUser[&amp;lt;quickKarl2&amp;gt;], TwitterUser[&amp;lt;NaturalComedy&amp;gt;], TwitterUser[&amp;lt;akw279&amp;gt;], TwitterUser[&amp;lt;Modells_Coupons&amp;gt;]}&lt;/div&gt;
&lt;div class=&quot;Text&quot;&gt;And since this is &lt;span style=&quot;font-style:italic;&quot;&gt;Mathematica&lt;/span&gt;, we can do interesting data explorations.&lt;/div&gt;
&lt;div class=&quot;Input&quot;&gt;friendIDs = TwitterUserID/@friends;&lt;br/&gt;
followerIDs = TwitterUserID/@followers;&lt;br/&gt;
union = Intersection[friendIDs, followerIDs];&lt;/div&gt;
&lt;div class=&quot;Text&quot;&gt;55% of the people I&amp;apos;m following also follow me.&lt;/div&gt;
&lt;div class=&quot;Input&quot;&gt;N[Length[union] / Length[friendIDs]]&lt;/div&gt;
&lt;div class=&quot;Output&quot;&gt;0.55`&lt;/div&gt;
&lt;div class=&quot;Text&quot;&gt;42% of the people who follow me are people whom I also follow.&lt;/div&gt;
&lt;div class=&quot;Input&quot;&gt;N[Length[union] / Length[followerIDs]]&lt;/div&gt;
&lt;div class=&quot;Output&quot;&gt;0.41509433962264153`&lt;/div&gt;
&lt;div class=&quot;Input&quot;&gt;TwitterSessionClose[session]&lt;/div&gt;
&lt;div class=&quot;Subsection&quot;&gt;Downloads&lt;/div&gt;
&lt;div class=&quot;Text&quot;&gt;&lt;a href=&quot;http://ragfield-packages.googlecode.com/svn/trunk/Twitter.m&quot;&gt;Download Twitter.m&lt;/a&gt;.&lt;/div&gt;
&lt;div class=&quot;Text&quot;&gt;&lt;a href=&quot;http://ragfield-packages.googlecode.com/svn/trunk/HTTP.m&quot;&gt;Download HTTP.m&lt;/a&gt; (required by Twitter.m).&lt;/div&gt;
&lt;div class=&quot;Text&quot;&gt;&lt;a href=&quot;http://sites.google.com/site/ragfield/dev/2009-04-16-TwitteringWithMathematica.nb?attredirects=0&quot;&gt;Download Mathematica Notebook&lt;/a&gt;.&lt;/div&gt;

&lt;br /&gt;
&lt;strong&gt;Update:&lt;/strong&gt; I have written a very similar entry for &lt;a href=&quot;http://blog.wolfram.com/2009/04/30/twittering-with-mathematica/&quot;&gt;my company&#39;s blog&lt;/a&gt;.</content><link rel='replies' type='application/atom+xml' href='http://dev.ragfield.com/feeds/786353583281928181/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/7147569507271803579/786353583281928181' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7147569507271803579/posts/default/786353583281928181'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7147569507271803579/posts/default/786353583281928181'/><link rel='alternate' type='text/html' href='http://dev.ragfield.com/2009/04/twittering-with-mathematica.html' title='Twittering with Mathematica'/><author><name>Ragfield</name><uri>http://www.blogger.com/profile/12325362017984149251</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='25' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjl1SMlQXOTAV7_F3A5DZg4b2e5eimTTKX9EFIlSIGempd0D7LkUqQQ9cneJqOm9HkcSDncQURdiuKI_uoLJJTJs8hSu7nFDdJ_LNdI1hpdiamXqIc6zPoJtTHCZXpkEA/s220/Ahoy.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7147569507271803579.post-8875477107243688384</id><published>2009-04-06T21:55:00.001-05:00</published><updated>2009-04-06T21:55:27.663-05:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="bookmarklet"/><category scheme="http://www.blogger.com/atom/ns#" term="html"/><category scheme="http://www.blogger.com/atom/ns#" term="javascript"/><title type='text'>Some useful bookmarklets</title><content type='html'>&lt;p&gt;In case you don&#39;t know, &lt;em&gt;bookmarklets&lt;/em&gt; are bookmarks which run JavaScript code rather than open a specific web page.  Here are a collection of bookmarklets I use on a semi-regular basis to speed up searching of frequently used web sites.  Bookmarklets can do other things, since they run arbitrary JavaScript code.&lt;/p&gt;

&lt;p&gt;To install them click on the hyperlink and drag it to your bookmarks bar (or maybe right/control-click on the link and choose a menu item to add to bookmarks).  They may not work in all browsers, but these all work in Safari.&lt;/p&gt;

&lt;p&gt;You can use them in one of two ways.  First, if you just choose the bookmark it will pop up a dialog asking for the query text, then search the corresponding site for the text you enter.  Second, you can select a piece of text on the current web page, then when you choose the bookmarklet it will automatically search the corresponding site for the selected text.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;javascript:x=&#39;&#39;+getSelection();if(!x.length){x=prompt(&#39;Wikipedia:&#39;,&#39;&#39;)}if(x&amp;&amp;x.length){location.href=&#39;http://en.wikipedia.org/w/wiki.phtml?search=&#39;+escape(x)}&quot;&gt;Wikipedia&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;javascript:x=&#39;&#39;+getSelection();if(!x.length){x=prompt(&#39;Wikipedia:&#39;,&#39;&#39;)}if(x&amp;&amp;x.length){location.href=&#39;http://en.wikipedia.org/w/wiki.phtml?search=&#39;+escape(x)}&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;javascript:x=&#39;&#39;+getSelection();if(!x.length){x=prompt(&#39;Dictionary:&#39;,&#39;&#39;)}if(x&amp;&amp;x.length){location.href=&#39;http:/dictionary.reference.com/search?q=&#39;+escape(x)}&quot;&gt;Dictionary&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;javascript:x=&#39;&#39;+getSelection();if(!x.length){x=prompt(&#39;Dictionary:&#39;,&#39;&#39;)}if(x&amp;&amp;x.length){location.href=&#39;http:/dictionary.reference.com/search?q=&#39;+escape(x)}&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;javascript:x=&#39;&#39;+getSelection();if(!x.length){x=prompt(&#39;Thesaurus:&#39;,&#39;&#39;)}if(x&amp;&amp;x.length){location.href=&#39;http:/thesaurus.reference.com/search?q=&#39;+escape(x)}&quot;&gt;Thesaurus&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;javascript:x=&#39;&#39;+getSelection();if(!x.length){x=prompt(&#39;Thesaurus:&#39;,&#39;&#39;)}if(x&amp;&amp;x.length){location.href=&#39;http:/thesaurus.reference.com/search?q=&#39;+escape(x)}&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;javascript:x=&#39;&#39;+getSelection();if(!x.length){x=prompt(&#39;Google%20Images:&#39;,&#39;&#39;)}if(x&amp;&amp;x.length){location.href=&#39;http://images.google.com/images?hl=en&amp;q=&#39;+escape(x)}&quot;&gt;Google Images&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;javascript:x=&#39;&#39;+getSelection();if(!x.length){x=prompt(&#39;Google%20Images:&#39;,&#39;&#39;)}if(x&amp;&amp;x.length){location.href=&#39;http://images.google.com/images?hl=en&amp;q=&#39;+escape(x)}&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;javascript:x=&#39;&#39;+getSelection();if(!x.length){x=prompt(&#39;Google%20News:&#39;,&#39;&#39;)}if(x&amp;&amp;x.length){location.href=&#39;http:/news.google.com/news?q=&#39;+escape(x)}&quot;&gt;Google News&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;javascript:x=&#39;&#39;+getSelection();if(!x.length){x=prompt(&#39;Google%20News:&#39;,&#39;&#39;)}if(x&amp;&amp;x.length){location.href=&#39;http:/news.google.com/news?q=&#39;+escape(x)}&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;javascript:x=&#39;&#39;+getSelection();if(!x.length){x=prompt(&#39;Google%20Maps:&#39;,&#39;&#39;)}if(x&amp;&amp;x.length){location.href=&#39;http://maps.google.com/?q=&#39;+escape(x)}&quot;&gt;Google Maps&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;javascript:x=&#39;&#39;+getSelection();if(!x.length){x=prompt(&#39;Google%20Maps:&#39;,&#39;&#39;)}if(x&amp;&amp;x.length){location.href=&#39;http://maps.google.com/?q=&#39;+escape(x)}&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;javascript:x=&#39;&#39;+getSelection();if(!x.length){x=prompt(&#39;IMDB:&#39;,&#39;&#39;)}if(x&amp;&amp;x.length){location.href=&#39;http:/imdb.com/Find?for=&#39;+escape(x)}&quot;&gt;IMDB&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;javascript:x=&#39;&#39;+getSelection();if(!x.length){x=prompt(&#39;IMDB:&#39;,&#39;&#39;)}if(x&amp;&amp;x.length){location.href=&#39;http:/imdb.com/Find?for=&#39;+escape(x)}&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;javascript:x=&#39;&#39;+getSelection();if(!x.length){x=prompt(&#39;Amazon:&#39;,&#39;&#39;)}if(x&amp;&amp;x.length){location.href=&#39;http://www.amazon.com/exec/obidos/external-search/?keyword=&#39;+escape(x)}&quot;&gt;Amazon&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;javascript:x=&#39;&#39;+getSelection();if(!x.length){x=prompt(&#39;Amazon:&#39;,&#39;&#39;)}if(x&amp;&amp;x.length){location.href=&#39;http://www.amazon.com/exec/obidos/external-search/?keyword=&#39;+escape(x)}&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;javascript:x=&#39;&#39;+getSelection();if(!x.length){x=prompt(&#39;eBay:&#39;,&#39;&#39;)}if(x&amp;&amp;x.length){location.href=&#39;http://search.ebay.com/search/search.dll?query=&#39;+escape(x)}&quot;&gt;eBay&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;javascript:x=&#39;&#39;+getSelection();if(!x.length){x=prompt(&#39;eBay:&#39;,&#39;&#39;)}if(x&amp;&amp;x.length){location.href=&#39;http://search.ebay.com/search/search.dll?query=&#39;+escape(x)}&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://dev.ragfield.com/feeds/8875477107243688384/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/7147569507271803579/8875477107243688384' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7147569507271803579/posts/default/8875477107243688384'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7147569507271803579/posts/default/8875477107243688384'/><link rel='alternate' type='text/html' href='http://dev.ragfield.com/2009/04/some-useful-bookmarklets.html' title='Some useful bookmarklets'/><author><name>Ragfield</name><uri>http://www.blogger.com/profile/12325362017984149251</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='25' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjl1SMlQXOTAV7_F3A5DZg4b2e5eimTTKX9EFIlSIGempd0D7LkUqQQ9cneJqOm9HkcSDncQURdiuKI_uoLJJTJs8hSu7nFDdJ_LNdI1hpdiamXqIc6zPoJtTHCZXpkEA/s220/Ahoy.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7147569507271803579.post-3245616557266493666</id><published>2009-04-06T09:09:00.001-05:00</published><updated>2009-04-08T11:23:57.243-05:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="2D graphics"/><category scheme="http://www.blogger.com/atom/ns#" term="3D graphics"/><category scheme="http://www.blogger.com/atom/ns#" term="mathematica"/><category scheme="http://www.blogger.com/atom/ns#" term="pdf"/><title type='text'>Font outlines and 3D text</title><content type='html'>&lt;div class=&quot;Text&quot;&gt;When importing PDF files &lt;span style=&quot;font-style:italic;&quot;&gt;Mathematica&lt;/span&gt; 6-7 converts glyphs to polygons.  We can utilize this fact to get outlines of these glyphs which can be further processed as desired.  Here I will show how to make arbitrary font/glyph combinations into 3D objects.&lt;/div&gt;
&lt;div class=&quot;Text&quot;&gt;NOTE: this code depends on a specific behavior of &lt;span style=&quot;font-style:italic;&quot;&gt;Mathematica&lt;/span&gt;&amp;apos;s PDF import feature.  This code may break if future versions of &lt;span style=&quot;font-style:italic;&quot;&gt;Mathematica&lt;/span&gt; change the way glyphs from PDF files are imported.&lt;/div&gt;
&lt;div class=&quot;Text&quot;&gt;As &lt;a href=&quot;http://dev.ragfield.com/2009/03/polygons-with-holes-in-mathematica.html&quot;&gt;I mentioned previously&lt;/a&gt;, &lt;span style=&quot;font-style:italic;&quot;&gt;Mathematica&lt;/span&gt;&amp;apos;s PDF import simulates polygons/paths with holes by connecting the different segments/contours with 0-width lines.  There is a &lt;span style=&quot;font-style:italic;&quot;&gt;break&lt;/span&gt; in a contour where these 0-width lines occur.  This first function finds the points which comprise the 0-width lines.&lt;/div&gt;
&lt;div class=&quot;Input&quot;&gt;FindContourBreaks[&lt;span style=&quot;color: #428957;font-style:italic;&quot;&gt;pts_List&lt;/span&gt;] := Module[&lt;br/&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;{&lt;span style=&quot;color: #428957;&quot;&gt;i&lt;/span&gt;,  &lt;span style=&quot;color: #428957;&quot;&gt;lines&lt;/span&gt;,  &lt;span style=&quot;color: #428957;&quot;&gt;breaks&lt;/span&gt;  =  {}}, &lt;br/&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&lt;span style=&quot;color: #428957;&quot;&gt;lines&lt;/span&gt;  =  {&lt;span style=&quot;color: #428957;font-style:italic;&quot;&gt;pts&lt;/span&gt;[[&lt;span style=&quot;color: #428957;font-style:italic;&quot;&gt;#&lt;/span&gt;[[1]]]],  &lt;span style=&quot;color: #428957;font-style:italic;&quot;&gt;pts&lt;/span&gt;[[&lt;span style=&quot;color: #428957;font-style:italic;&quot;&gt;#&lt;/span&gt;[[2]]]]}&amp;amp; /@&lt;br/&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;Partition[RotateLeft[Flatten[{&lt;span style=&quot;color: #428957;font-style:italic;&quot;&gt;#&lt;/span&gt;,  &lt;span style=&quot;color: #428957;font-style:italic;&quot;&gt;#&lt;/span&gt;}&amp;amp; /@&lt;br/&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;Range[Length[&lt;span style=&quot;color: #428957;font-style:italic;&quot;&gt;pts&lt;/span&gt;]],  1]],  2];&lt;br/&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;For[&lt;span style=&quot;color: #428957;&quot;&gt;i&lt;/span&gt;  =  1,  &lt;span style=&quot;color: #428957;&quot;&gt;i&lt;/span&gt; &amp;lt;= Length[&lt;span style=&quot;color: #428957;&quot;&gt;lines&lt;/span&gt;],  &lt;span style=&quot;color: #428957;&quot;&gt;i&lt;/span&gt;++, &lt;br/&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;If[MemberQ[&lt;span style=&quot;color: #428957;&quot;&gt;lines&lt;/span&gt;,  {&lt;span style=&quot;color: #428957;&quot;&gt;lines&lt;/span&gt;[[&lt;span style=&quot;color: #428957;&quot;&gt;i&lt;/span&gt;, 2]],  &lt;span style=&quot;color: #428957;&quot;&gt;lines&lt;/span&gt;[[&lt;span style=&quot;color: #428957;&quot;&gt;i&lt;/span&gt;, 1]]}], &lt;br/&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;AppendTo[&lt;span style=&quot;color: #428957;&quot;&gt;breaks&lt;/span&gt;,  &lt;span style=&quot;color: #428957;&quot;&gt;i&lt;/span&gt;]&lt;br/&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;];&lt;br/&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;];&lt;br/&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&lt;span style=&quot;color: #428957;&quot;&gt;breaks&lt;/span&gt;&lt;br/&gt;
]; &lt;/div&gt;
&lt;div class=&quot;Text&quot;&gt;This function returns a list of the individual polygon contours.&lt;/div&gt;
&lt;div class=&quot;Input&quot;&gt;FindContours[&lt;span style=&quot;color: #428957;font-style:italic;&quot;&gt;pts_List&lt;/span&gt;] := Module[&lt;br/&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;{&lt;span style=&quot;color: #428957;&quot;&gt;breaks&lt;/span&gt;,  &lt;span style=&quot;color: #428957;&quot;&gt;ranges&lt;/span&gt;}, &lt;br/&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&lt;span style=&quot;color: #428957;&quot;&gt;breaks&lt;/span&gt;  =  FindContourBreaks[&lt;span style=&quot;color: #428957;font-style:italic;&quot;&gt;pts&lt;/span&gt;];&lt;br/&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&lt;span style=&quot;color: #428957;&quot;&gt;ranges&lt;/span&gt;  =  Partition[RotateLeft[Join[{1,  1}, &lt;br/&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;Flatten[{&lt;span style=&quot;color: #428957;font-style:italic;&quot;&gt;#&lt;/span&gt;,  &lt;span style=&quot;color: #428957;font-style:italic;&quot;&gt;#&lt;/span&gt;  +  1}&amp;amp; /@ &lt;span style=&quot;color: #428957;&quot;&gt;breaks&lt;/span&gt;]]],  2];&lt;br/&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&lt;span style=&quot;color: #428957;&quot;&gt;ranges&lt;/span&gt;  =  Drop[&lt;span style=&quot;color: #428957;&quot;&gt;ranges&lt;/span&gt;,   - 1];&lt;br/&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;DeleteCases[Take[&lt;span style=&quot;color: #428957;font-style:italic;&quot;&gt;pts&lt;/span&gt;,  &lt;span style=&quot;color: #428957;font-style:italic;&quot;&gt;#&lt;/span&gt;]&amp;amp; /@ &lt;span style=&quot;color: #428957;&quot;&gt;ranges&lt;/span&gt;,  x_ /; Length[x] &amp;lt; 3]&lt;br/&gt;
];&lt;/div&gt;
&lt;div class=&quot;Text&quot;&gt;Now that we have a list of the contours we can process them further.  Here I will convert them from a 2D polygon to a object.  The top of the object will be the 2D polygon living in 3D space.  The bottom will be the reverse of the top (to get the lighting correct) offset a certain depth below the top.  Finally, I will add a sequence of rectangles orthogonal to the top and bottom to form the sides of the object to close it in.&lt;/div&gt;
&lt;div class=&quot;Input&quot;&gt;ThreeDContour[&lt;span style=&quot;color: #428957;font-style:italic;&quot;&gt;pts_List&lt;/span&gt;,  &lt;span style=&quot;color: #428957;font-style:italic;&quot;&gt;depth_&lt;/span&gt;] := Module[&lt;br/&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;{&lt;span style=&quot;color: #428957;&quot;&gt;topPts&lt;/span&gt;,  &lt;span style=&quot;color: #428957;&quot;&gt;botPts&lt;/span&gt;,  &lt;span style=&quot;color: #428957;&quot;&gt;sideRects&lt;/span&gt;,  &lt;span style=&quot;color: #428957;&quot;&gt;sidePts&lt;/span&gt;,  &lt;span style=&quot;color: #428957;&quot;&gt;sideNormals&lt;/span&gt;}, &lt;br/&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&lt;span style=&quot;color: #428957;&quot;&gt;topPts&lt;/span&gt;  =  {&lt;span style=&quot;color: #428957;font-style:italic;&quot;&gt;#&lt;/span&gt;[[1]],  &lt;span style=&quot;color: #428957;font-style:italic;&quot;&gt;#&lt;/span&gt;[[2]],  0}&amp;amp; /@ &lt;span style=&quot;color: #428957;font-style:italic;&quot;&gt;pts&lt;/span&gt;;&lt;br/&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&lt;span style=&quot;color: #428957;&quot;&gt;botPts&lt;/span&gt;  =  (&lt;span style=&quot;color: #428957;font-style:italic;&quot;&gt;#&lt;/span&gt;  +  {0.,  0.,   - &lt;span style=&quot;color: #428957;font-style:italic;&quot;&gt;depth&lt;/span&gt;})&amp;amp; /@ &lt;span style=&quot;color: #428957;&quot;&gt;topPts&lt;/span&gt;;&lt;br/&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&lt;span style=&quot;color: #428957;&quot;&gt;sideRects&lt;/span&gt;  =  Partition[RotateLeft[Flatten[{&lt;span style=&quot;color: #428957;font-style:italic;&quot;&gt;#&lt;/span&gt;,  &lt;span style=&quot;color: #428957;font-style:italic;&quot;&gt;#&lt;/span&gt;}&amp;amp; /@&lt;br/&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;Range[Length[&lt;span style=&quot;color: #428957;&quot;&gt;topPts&lt;/span&gt;]],  1]],  2];&lt;br/&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&lt;span style=&quot;color: #428957;&quot;&gt;sidePts&lt;/span&gt;  =  {&lt;br/&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&lt;span style=&quot;color: #428957;&quot;&gt;topPts&lt;/span&gt;[[&lt;span style=&quot;color: #428957;font-style:italic;&quot;&gt;#&lt;/span&gt;[[1]]]],  &lt;span style=&quot;color: #428957;&quot;&gt;botPts&lt;/span&gt;[[&lt;span style=&quot;color: #428957;font-style:italic;&quot;&gt;#&lt;/span&gt;[[1]]]], &lt;br/&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&lt;span style=&quot;color: #428957;&quot;&gt;botPts&lt;/span&gt;[[&lt;span style=&quot;color: #428957;font-style:italic;&quot;&gt;#&lt;/span&gt;[[2]]]],  &lt;span style=&quot;color: #428957;&quot;&gt;topPts&lt;/span&gt;[[&lt;span style=&quot;color: #428957;font-style:italic;&quot;&gt;#&lt;/span&gt;[[2]]]]&lt;br/&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;}&amp;amp; /@ &lt;span style=&quot;color: #428957;&quot;&gt;sideRects&lt;/span&gt;;&lt;br/&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;Polygon /@ &lt;span style=&quot;color: #428957;&quot;&gt;sidePts&lt;/span&gt;&lt;br/&gt;
];&lt;/div&gt;
&lt;div class=&quot;Input&quot;&gt;ThreeDContours[&lt;span style=&quot;color: #428957;font-style:italic;&quot;&gt;pts_List&lt;/span&gt;,  &lt;span style=&quot;color: #428957;font-style:italic;&quot;&gt;depth_&lt;/span&gt;] := Module[&lt;br/&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;{&lt;span style=&quot;color: #428957;&quot;&gt;contours&lt;/span&gt;}, &lt;br/&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&lt;span style=&quot;color: #428957;&quot;&gt;contours&lt;/span&gt;  =  FindContours[&lt;span style=&quot;color: #428957;font-style:italic;&quot;&gt;pts&lt;/span&gt;];&lt;br/&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;ThreeDContour[&lt;span style=&quot;color: #428957;font-style:italic;&quot;&gt;#&lt;/span&gt;,  &lt;span style=&quot;color: #428957;font-style:italic;&quot;&gt;depth&lt;/span&gt;]&amp;amp; /@ &lt;span style=&quot;color: #428957;&quot;&gt;contours&lt;/span&gt;&lt;br/&gt;
]; &lt;/div&gt;
&lt;div class=&quot;Input&quot;&gt;ThreeDPolygon[&lt;span style=&quot;color: #428957;font-style:italic;&quot;&gt;Polygon&lt;/span&gt;[pts_List],  &lt;span style=&quot;color: #428957;font-style:italic;&quot;&gt;depth_&lt;/span&gt;] := Module[&lt;br/&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;{&lt;span style=&quot;color: #428957;&quot;&gt;topPts&lt;/span&gt;,  &lt;span style=&quot;color: #428957;&quot;&gt;botPts&lt;/span&gt;,  &lt;span style=&quot;color: #428957;&quot;&gt;sidePolys&lt;/span&gt;}, &lt;br/&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&lt;span style=&quot;color: #428957;&quot;&gt;topPts&lt;/span&gt;  =  {&lt;span style=&quot;color: #428957;font-style:italic;&quot;&gt;#&lt;/span&gt;[[1]],  &lt;span style=&quot;color: #428957;font-style:italic;&quot;&gt;#&lt;/span&gt;[[2]],  0}&amp;amp; /@ pts;&lt;br/&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&lt;span style=&quot;color: #428957;&quot;&gt;botPts&lt;/span&gt;  =  Reverse[(&lt;span style=&quot;color: #428957;font-style:italic;&quot;&gt;#&lt;/span&gt;  +  {0.,  0.,   - &lt;span style=&quot;color: #428957;font-style:italic;&quot;&gt;depth&lt;/span&gt;})&amp;amp; /@ &lt;span style=&quot;color: #428957;&quot;&gt;topPts&lt;/span&gt;];&lt;br/&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&lt;span style=&quot;color: #428957;&quot;&gt;sidePolys&lt;/span&gt;  =  ThreeDContours[pts,  &lt;span style=&quot;color: #428957;font-style:italic;&quot;&gt;depth&lt;/span&gt;];&lt;br/&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;{&lt;span style=&quot;color: #428957;font-style:italic;&quot;&gt;Polygon&lt;/span&gt;[&lt;span style=&quot;color: #428957;&quot;&gt;topPts&lt;/span&gt;],  &lt;span style=&quot;color: #428957;font-style:italic;&quot;&gt;Polygon&lt;/span&gt;[&lt;span style=&quot;color: #428957;&quot;&gt;botPts&lt;/span&gt;],  EdgeForm[],  &lt;span style=&quot;color: #428957;&quot;&gt;sidePolys&lt;/span&gt;}&lt;br/&gt;
];&lt;/div&gt;
&lt;div class=&quot;Text&quot;&gt;This function converts a 2D graphics scene to a 3D graphics scene where all the 2D polygons are made into 3D objects with the given depth.&lt;/div&gt;
&lt;div class=&quot;Input&quot;&gt;ThreeDGraphics[&lt;span style=&quot;color: #428957;font-style:italic;&quot;&gt;gfx_Graphics&lt;/span&gt;,  &lt;span style=&quot;color: #428957;font-style:italic;&quot;&gt;depth_&lt;/span&gt;] :=&lt;br/&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&lt;span style=&quot;color: #428957;font-style:italic;&quot;&gt;gfx&lt;/span&gt; /. Polygon[pts_List] :&amp;gt; ThreeDPolygon[Polygon[pts],  &lt;span style=&quot;color: #428957;font-style:italic;&quot;&gt;depth&lt;/span&gt;] /.&lt;br/&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;(PlotRange -&amp;gt; _) :&amp;gt; PlotRange -&amp;gt; All /.&lt;br/&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;Graphics[gfx2D___] :&amp;gt; Graphics3D[gfx2D]; &lt;/div&gt;
&lt;div class=&quot;Text&quot;&gt;These final two functions will take an arbitrary piece of text in an arbitrary font, export it to PDF, import the PDF back into &lt;span style=&quot;font-style:italic;&quot;&gt;Mathematica&lt;/span&gt; (to convert the glyphs to outlines), and make them 3D.&lt;/div&gt;
&lt;div class=&quot;Input&quot;&gt;ThreeDText[&lt;span style=&quot;color: #428957;font-style:italic;&quot;&gt;str_String&lt;/span&gt;,  &lt;span style=&quot;color: #428957;font-style:italic;&quot;&gt;family_String:&lt;/span&gt;&lt;span style=&quot;color: #666666;&quot;&gt;&amp;quot;Times&amp;quot;&lt;/span&gt;,  &lt;span style=&quot;color: #428957;font-style:italic;&quot;&gt;depth_:&lt;/span&gt;10] :=&lt;br/&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;ThreeDGraphics[TwoDText[&lt;span style=&quot;color: #428957;font-style:italic;&quot;&gt;str&lt;/span&gt;,  &lt;span style=&quot;color: #428957;font-style:italic;&quot;&gt;family&lt;/span&gt;],  &lt;span style=&quot;color: #428957;font-style:italic;&quot;&gt;depth&lt;/span&gt;]; &lt;/div&gt;
&lt;div class=&quot;Input&quot;&gt;TwoDText[&lt;span style=&quot;color: #428957;font-style:italic;&quot;&gt;str_String&lt;/span&gt;,  &lt;span style=&quot;color: #428957;font-style:italic;&quot;&gt;family_String:&lt;/span&gt;&lt;span style=&quot;color: #666666;&quot;&gt;&amp;quot;Times&amp;quot;&lt;/span&gt;] := &lt;br/&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;First[ImportString[ExportString[Cell[&lt;span style=&quot;color: #428957;font-style:italic;&quot;&gt;str&lt;/span&gt;,  FontSize -&amp;gt; 100, &lt;br/&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;FontFamily -&amp;gt; &lt;span style=&quot;color: #428957;font-style:italic;&quot;&gt;family&lt;/span&gt;],  &lt;span style=&quot;color: #666666;&quot;&gt;&amp;quot;PDF&amp;quot;&lt;/span&gt;],  &lt;span style=&quot;color: #666666;&quot;&gt;&amp;quot;PDF&amp;quot;&lt;/span&gt;]]; &lt;/div&gt;
&lt;div class=&quot;Text&quot;&gt;Finally, we can see the results.&lt;/div&gt;
&lt;div class=&quot;Input&quot;&gt;ThreeDText[&lt;span style=&quot;color: #666666;&quot;&gt;&amp;quot;Hello\nWorld&amp;quot;&lt;/span&gt;]&lt;/div&gt;
&lt;div class=&quot;Output&quot;&gt;&lt;a href=&quot;http://www.flickr.com/photos/10274904@N05/3418303702&quot; title=&quot;View &#39;Hellow world in 3D&#39; on Flickr.com&quot;&gt;&lt;img style=&quot;border:none;&quot; src=&quot;http://farm4.static.flickr.com/3352/3418303702_3f5fc12836_o.png&quot; alt=&quot;Hellow world in 3D&quot; border=&quot;0&quot; width=&quot;205&quot; height=&quot;161&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;Text&quot;&gt;We could also build an interface that allows us to choose which glyph in which font we want.&lt;/div&gt;
&lt;div class=&quot;Input&quot;&gt;Manipulate[&lt;br/&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;Show[&lt;br/&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;ThreeDText[FromCharacterCode[character], font, depth], &lt;br/&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;ImageSize-&amp;gt;{Automatic, 300}&lt;br/&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;], &lt;br/&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;{{font, &lt;span style=&quot;color: #666666;&quot;&gt;&amp;quot;Times&amp;quot;&lt;/span&gt;}, &lt;br/&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;Map[First, FE`Evaluate[FEPrivate`GetPopupList[&lt;span style=&quot;color: #666666;&quot;&gt;&amp;quot;MenuListFonts&amp;quot;&lt;/span&gt;]]]}, &lt;br/&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;{{character, 65}, 33, 127, 1}, &lt;br/&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;{{depth, 10}, 0, 100}&lt;br/&gt;
]&lt;/div&gt;
&lt;div class=&quot;Output&quot;&gt;&lt;a href=&quot;http://www.flickr.com/photos/10274904@N05/3417493733&quot; title=&quot;View &#39;Manipulate 3D text&#39; on Flickr.com&quot;&gt;&lt;img style=&quot;border:none;&quot; src=&quot;http://farm4.static.flickr.com/3629/3417493733_254aba4360_o.png&quot; alt=&quot;Manipulate 3D text&quot; border=&quot;0&quot; width=&quot;480&quot; height=&quot;448&quot; /&gt;&lt;/a&gt;&lt;/div&gt;

&lt;p&gt;&lt;a href=&quot;http://sites.google.com/site/ragfield/dev/2009-04-06-FontOutlines.nb?attredirects=0&quot;&gt;Download Mathematica Notebook&lt;/a&gt;&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://dev.ragfield.com/feeds/3245616557266493666/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/7147569507271803579/3245616557266493666' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7147569507271803579/posts/default/3245616557266493666'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7147569507271803579/posts/default/3245616557266493666'/><link rel='alternate' type='text/html' href='http://dev.ragfield.com/2009/04/font-outlines-and-3d-text.html' title='Font outlines and 3D text'/><author><name>Ragfield</name><uri>http://www.blogger.com/profile/12325362017984149251</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='25' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjl1SMlQXOTAV7_F3A5DZg4b2e5eimTTKX9EFIlSIGempd0D7LkUqQQ9cneJqOm9HkcSDncQURdiuKI_uoLJJTJs8hSu7nFDdJ_LNdI1hpdiamXqIc6zPoJtTHCZXpkEA/s220/Ahoy.jpg'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7147569507271803579.post-7946708842535087695</id><published>2009-04-05T11:57:00.001-05:00</published><updated>2009-04-08T20:49:40.709-05:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="bug"/><category scheme="http://www.blogger.com/atom/ns#" term="c++"/><category scheme="http://www.blogger.com/atom/ns#" term="visual studio"/><category scheme="http://www.blogger.com/atom/ns#" term="windows"/><title type='text'>Horrible Visual Studio 2008 Standard Edition installer bug</title><content type='html'>&lt;a href=&quot;http://www.flickr.com/photos/10274904@N05/3424784003&quot; title=&quot;View &#39;&#39; on Flickr.com&quot;&gt;&lt;div style=&quot;text-align:center;&quot;&gt;&lt;img src=&quot;http://farm4.static.flickr.com/3661/3424784003_ab52f1e603.jpg&quot; alt=&quot;&quot; border=&quot;0&quot; width=&quot;500&quot; height=&quot;374&quot; /&gt;&lt;/div&gt;&lt;/a&gt;

&lt;p&gt;I spend nearly all my time working on a Mac.  Given the nature of cross-platform development I do sometimes require use of a Windows machine.  Not too long ago I was upgrading to Visual Studio 2008 when I found a horrible bug in the installer.&lt;/p&gt;

&lt;a href=&quot;http://www.flickr.com/photos/10274904@N05/3415221932&quot; title=&quot;View &#39;Visual Studio 2008 Installer&#39; on Flickr.com&quot;&gt;&lt;div style=&quot;text-align:center;&quot;&gt;&lt;img src=&quot;http://farm4.static.flickr.com/3313/3415221932_61bf664b08.jpg&quot; alt=&quot;Visual Studio 2008 Installer&quot; border=&quot;0&quot; width=&quot;500&quot; height=&quot;384&quot; /&gt;&lt;/div&gt;&lt;/a&gt;

&lt;p&gt;I didn&#39;t want any Visual Basic or C# crap littering my machine.  So I disabled those options, leaving only the C++ tools to be installed.  Installation completed and I fired up the compiler only to get the following error message:&lt;/p&gt;

&lt;pre&gt;Compiling...
Project : error PRJ0003 : Error spawning &#39;cl.exe&#39;.&lt;/pre&gt;

&lt;p&gt;Uh.&lt;/p&gt;

&lt;p&gt;That&#39;s not supposed to happen.&lt;/p&gt;

&lt;p&gt;Let&#39;s take a closer look:&lt;/p&gt;

&lt;pre&gt;C:\Program Files\Microsoft Visual Studio 9.0\VC\bin&gt;dir
 Volume in drive C has no label.
 Volume Serial Number is 104F-0033

 Directory of C:\Program Files\Microsoft Visual Studio 9.0\VC\bin

04/05/2009  09:48 AM    &amp;lt;DIR&amp;gt;          .
04/05/2009  09:48 AM    &amp;lt;DIR&amp;gt;          ..
04/05/2009  09:46 AM    &amp;lt;DIR&amp;gt;          1033
04/05/2009  09:48 AM    &amp;lt;DIR&amp;gt;          amd64
11/08/2007  08:19 AM           165,376 atlprov.dll
11/08/2007  08:19 AM            77,312 bscmake.exe
11/08/2007  08:19 AM           670,192 c1.dll
11/08/2007  08:19 AM         2,334,200 c1xx.dll
11/08/2007  08:19 AM            33,784 cvtres.exe
11/08/2007  08:19 AM            17,920 dumpbin.exe
11/08/2007  08:19 AM            17,920 editbin.exe
11/08/2007  08:19 AM            17,912 lib.exe
11/08/2007  08:19 AM           790,008 link.exe
06/05/2006  06:02 PM               268 link.exe.config
11/08/2007  08:19 AM           358,384 ml.exe
11/08/2007  08:19 AM            94,200 nmake.exe
11/08/2007  08:19 AM            20,480 undname.exe
03/07/2007  03:44 PM                31 vcvars32.bat
04/05/2009  09:48 AM    &amp;lt;DIR&amp;gt;          x86_amd64
11/08/2007  08:19 AM            40,448 xdcmake.exe
06/05/2006  06:02 PM               268 xdcmake.exe.config
              16 File(s)      4,638,703 bytes
               5 Dir(s)  12,399,824,896 bytes free&lt;/pre&gt;

&lt;p&gt;So, no C++ compiler with C++ installation.  Perfect.&lt;/p&gt;

&lt;a href=&quot;http://www.flickr.com/photos/10274904@N05/3415221974&quot; title=&quot;View &#39;Visual Studio 2008 Installer&#39; on Flickr.com&quot;&gt;&lt;div style=&quot;text-align:center;&quot;&gt;&lt;img src=&quot;http://farm4.static.flickr.com/3367/3415221974_fe7488c813.jpg&quot; alt=&quot;Visual Studio 2008 Installer&quot; border=&quot;0&quot; width=&quot;500&quot; height=&quot;384&quot; /&gt;&lt;/div&gt;&lt;/a&gt;

&lt;p&gt;On the suggestion of a coworker I also installed the C# tools.  Low and behold the C# tools included the C++ compiler, and my problems went away:&lt;/p&gt;

&lt;pre&gt;C:\Program Files\Microsoft Visual Studio 9.0\VC\bin&gt;dir
 Volume in drive C has no label.
 Volume Serial Number is 104F-0033

 Directory of C:\Program Files\Microsoft Visual Studio 9.0\VC\bin

04/05/2009  10:43 AM    &amp;lt;DIR&amp;gt;          .
04/05/2009  10:43 AM    &amp;lt;DIR&amp;gt;          ..
04/05/2009  09:46 AM    &amp;lt;DIR&amp;gt;          1033
04/05/2009  09:48 AM    &amp;lt;DIR&amp;gt;          amd64
11/08/2007  08:19 AM           165,376 atlprov.dll
11/08/2007  08:19 AM            77,312 bscmake.exe
11/08/2007  08:19 AM           670,192 c1.dll
11/08/2007  08:19 AM         2,334,200 c1xx.dll
11/08/2007  08:19 AM         2,356,720 c2.dll
11/08/2007  08:19 AM           125,936 cl.exe
06/05/2006  06:02 PM               268 cl.exe.config
11/08/2007  08:19 AM            33,784 cvtres.exe
11/08/2007  08:19 AM            17,920 dumpbin.exe
11/08/2007  08:19 AM            17,920 editbin.exe
11/08/2007  08:19 AM            17,912 lib.exe
11/08/2007  08:19 AM           790,008 link.exe
06/05/2006  06:02 PM               268 link.exe.config
11/08/2007  08:19 AM           358,384 ml.exe
11/08/2007  08:19 AM            94,200 nmake.exe
11/08/2007  08:19 AM            20,480 undname.exe
03/07/2007  03:44 PM                31 vcvars32.bat
04/05/2009  09:48 AM    &amp;lt;DIR&amp;gt;          x86_amd64
11/08/2007  08:19 AM            40,448 xdcmake.exe
06/05/2006  06:02 PM               268 xdcmake.exe.config
              19 File(s)      7,121,627 bytes
               5 Dir(s)  12,437,422,080 bytes free&lt;/pre&gt;

&lt;p&gt;I find it fairly shocking that this configuration was never tested before the bits left Microsoft.&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://dev.ragfield.com/feeds/7946708842535087695/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/7147569507271803579/7946708842535087695' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7147569507271803579/posts/default/7946708842535087695'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7147569507271803579/posts/default/7946708842535087695'/><link rel='alternate' type='text/html' href='http://dev.ragfield.com/2009/04/horrible-visual-studio-2008-standard.html' title='Horrible Visual Studio 2008 Standard Edition installer bug'/><author><name>Ragfield</name><uri>http://www.blogger.com/profile/12325362017984149251</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='25' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjl1SMlQXOTAV7_F3A5DZg4b2e5eimTTKX9EFIlSIGempd0D7LkUqQQ9cneJqOm9HkcSDncQURdiuKI_uoLJJTJs8hSu7nFDdJ_LNdI1hpdiamXqIc6zPoJtTHCZXpkEA/s220/Ahoy.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://farm4.static.flickr.com/3661/3424784003_ab52f1e603_t.jpg" height="72" width="72"/><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7147569507271803579.post-1569218023302162983</id><published>2009-04-03T00:51:00.001-05:00</published><updated>2009-04-09T18:26:31.667-05:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="2D graphics"/><category scheme="http://www.blogger.com/atom/ns#" term="gps"/><category scheme="http://www.blogger.com/atom/ns#" term="mathematica"/><category scheme="http://www.blogger.com/atom/ns#" term="video"/><title type='text'>Video with telemetry data overlay</title><content type='html'>&lt;div class=&quot;Text&quot;&gt;At my cycling team&amp;apos;s &lt;a href=&quot;http://rob.ragfield.com/2009/03/training-camp.html&quot;&gt;training camp&lt;/a&gt; last weekend I used my &lt;a href=&quot;http://www.theflip.com/&quot;&gt;Flip video camera&lt;/a&gt; to record video of some of the hill descents.  Several teammates thought it would be neet to see the video with telemetry data (such as speed) overlayed on top of it.  Since I had my GPS recording at the time it was a straightforward matter to create such a video.  Here&amp;apos;s how I did it.&lt;/div&gt;
&lt;div class=&quot;Text&quot;&gt;In preparation I exported my GPS data to a GPX file, which &lt;span style=&quot;font-style:italic;&quot;&gt;Mathematica&lt;/span&gt; can import.  Next, I used QuickTime Player Pro to convert the movie into a sequence of PNG images, which &lt;span style=&quot;font-style:italic;&quot;&gt;Mathematica&lt;/span&gt; can import.&lt;/div&gt;
&lt;div class=&quot;Text&quot;&gt;Set the working directory to this notebook&amp;apos;s directory for convenience.&lt;/div&gt;
&lt;div class=&quot;Input&quot;&gt;SetDirectory[NotebookDirectory[]]; &lt;/div&gt;
&lt;div class=&quot;Text&quot;&gt;Import the data from the GPX file.&lt;/div&gt;
&lt;div class=&quot;Input&quot;&gt;xml = Import[&lt;span style=&quot;color: #666666;&quot;&gt;&amp;quot;Descent.gpx&amp;quot;&lt;/span&gt;, &lt;span style=&quot;color: #666666;&quot;&gt;&amp;quot;XML&amp;quot;&lt;/span&gt;]; &lt;/div&gt;
&lt;div class=&quot;Text&quot;&gt;Pull out all the &amp;quot;trkpt&amp;quot; elements.&lt;/div&gt;
&lt;div class=&quot;Input&quot;&gt;trkpts = Cases[xml, XMLElement[&lt;span style=&quot;color: #666666;&quot;&gt;&amp;quot;trkpt&amp;quot;&lt;/span&gt;, _, _], Infinity]; &lt;br/&gt;
Length[trkpts]&lt;/div&gt;
&lt;div class=&quot;Output&quot;&gt;204&lt;/div&gt;
&lt;div class=&quot;Input&quot;&gt;First[trkpts]&lt;/div&gt;
&lt;div class=&quot;Output&quot;&gt;XMLElement[trkpt, {lat-&amp;gt;37.6150774, lon-&amp;gt;-89.2330897}, {XMLElement[ele, {}, {222.6824951}], XMLElement[time, {}, {2009-03-29 16:09:18}]}]&lt;/div&gt;
&lt;div class=&quot;Text&quot;&gt;Extract the latitude/longitude/elevation/time from each trackpoint.&lt;/div&gt;
&lt;div class=&quot;Input&quot;&gt;latitudes = ToExpression[&lt;span style=&quot;color: #666666;&quot;&gt;&amp;quot;lat&amp;quot;&lt;/span&gt; /. &lt;span style=&quot;color: #428957;font-style:italic;&quot;&gt;#&lt;/span&gt;[[2]]]&amp;amp; /@ trkpts; &lt;br/&gt;
longitudes = ToExpression[&lt;span style=&quot;color: #666666;&quot;&gt;&amp;quot;lon&amp;quot;&lt;/span&gt; /. &lt;span style=&quot;color: #428957;font-style:italic;&quot;&gt;#&lt;/span&gt;[[2]]]&amp;amp; /@ trkpts; &lt;br/&gt;
elevations = Cases[trkpts, XMLElement[&lt;br/&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&lt;span style=&quot;color: #666666;&quot;&gt;&amp;quot;ele&amp;quot;&lt;/span&gt;, _, {e_String}] :&amp;gt; ToExpression[e], Infinity]; &lt;br/&gt;
dates = Cases[trkpts, XMLElement[&lt;br/&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&lt;span style=&quot;color: #666666;&quot;&gt;&amp;quot;time&amp;quot;&lt;/span&gt;, _, {t_String}] :&amp;gt; DateList[t], Infinity]; &lt;/div&gt;
&lt;div class=&quot;Input&quot;&gt;pts = Transpose[{latitudes, longitudes, elevations}]; &lt;/div&gt;
&lt;div class=&quot;Text&quot;&gt;Compute the distance between each successive trackpoint.&lt;/div&gt;
&lt;div class=&quot;Input&quot;&gt;distances = GeoDistance[&lt;br/&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;GeoPosition[&lt;span style=&quot;color: #428957;font-style:italic;&quot;&gt;#&lt;/span&gt;[[1]], &lt;span style=&quot;color: #666666;&quot;&gt;&amp;quot;WGS84Original&amp;quot;&lt;/span&gt;],&lt;br/&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;GeoPosition[&lt;span style=&quot;color: #428957;font-style:italic;&quot;&gt;#&lt;/span&gt;[[2]], &lt;span style=&quot;color: #666666;&quot;&gt;&amp;quot;WGS84Original&amp;quot;&lt;/span&gt;]&lt;br/&gt;
]&amp;amp; /@ Partition[pts, 2, 1]; &lt;/div&gt;
&lt;div class=&quot;Text&quot;&gt;Compute the time interval between each successive trackpoing.&lt;/div&gt;
&lt;div class=&quot;Input&quot;&gt;times = First[DateDifference[&lt;span style=&quot;color: #428957;font-style:italic;&quot;&gt;#&lt;/span&gt;[[1]], &lt;span style=&quot;color: #428957;font-style:italic;&quot;&gt;#&lt;/span&gt;[[2]], &lt;span style=&quot;color: #666666;&quot;&gt;&amp;quot;Second&amp;quot;&lt;/span&gt;]]&amp;amp; /@&lt;br/&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;Partition[dates, 2, 1]; &lt;/div&gt;
&lt;div class=&quot;Text&quot;&gt;Speed = distance/time.  Convert from Meter/Second to Mile/Hour.&lt;/div&gt;
&lt;div class=&quot;Input&quot;&gt;&amp;lt;&amp;lt;Units`&lt;/div&gt;
&lt;div class=&quot;Input&quot;&gt;speeds = (Convert[&lt;span style=&quot;color: #428957;font-style:italic;&quot;&gt;#&lt;/span&gt; Meter/Second, Mile/Hour] Hour/Mile)&amp;amp; /@&lt;br/&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;distances/times; &lt;/div&gt;
&lt;div class=&quot;Text&quot;&gt;Since there are more video frames than GPS trackpoints we&amp;apos;re going to want to know what the speed is between trackpoints.  To do this we&amp;apos;ll create an InterpolatingFunction.  At any time between two trackpoints we&amp;apos;ll estimate the speed to be a linear interpolation between the speed at those two points.&lt;/div&gt;
&lt;div class=&quot;Input&quot;&gt;absoluteTimes = Drop[AbsoluteTime /@ dates, 1]; &lt;/div&gt;
&lt;div class=&quot;Input&quot;&gt;interp = Interpolation[Transpose[{absoluteTimes, speeds}]]; &lt;/div&gt;
&lt;div class=&quot;Text&quot;&gt;For each frame of the video we will import the PNG file, compute the speed for that frame of video, draw the speed on top of the video, then export the new frame.&lt;/div&gt;
&lt;div class=&quot;Input&quot;&gt;processFrame[&lt;span style=&quot;color: #428957;font-style:italic;&quot;&gt;i_Integer&lt;/span&gt;] := Module[&lt;br/&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;{&lt;span style=&quot;color: #428957;&quot;&gt;label&lt;/span&gt;, &lt;span style=&quot;color: #428957;&quot;&gt;istr&lt;/span&gt;, &lt;span style=&quot;color: #428957;&quot;&gt;img&lt;/span&gt;, &lt;span style=&quot;color: #428957;&quot;&gt;g&lt;/span&gt;},&lt;br/&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&lt;span style=&quot;color: #428957;&quot;&gt;label&lt;/span&gt; = ToString@NumberForm[&lt;br/&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;interp[First[absoluteTimes]+&lt;span style=&quot;color: #428957;font-style:italic;&quot;&gt;i&lt;/span&gt;*1/29.97], {Infinity, 2}];&lt;br/&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&lt;span style=&quot;color: #428957;&quot;&gt;label&lt;/span&gt; = StringJoin[&lt;span style=&quot;color: #428957;&quot;&gt;label&lt;/span&gt;, &lt;span style=&quot;color: #666666;&quot;&gt;&amp;quot; mph&amp;quot;&lt;/span&gt;];&lt;br/&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&lt;span style=&quot;color: #428957;&quot;&gt;istr&lt;/span&gt; = IntegerString[&lt;span style=&quot;color: #428957;font-style:italic;&quot;&gt;i&lt;/span&gt;, 10, 4];&lt;br/&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&lt;span style=&quot;color: #428957;&quot;&gt;img&lt;/span&gt; = Import[StringJoin[&lt;span style=&quot;color: #666666;&quot;&gt;&amp;quot;Descent&amp;quot;&lt;/span&gt;, &lt;span style=&quot;color: #428957;&quot;&gt;istr&lt;/span&gt;, &lt;span style=&quot;color: #666666;&quot;&gt;&amp;quot;.png&amp;quot;&lt;/span&gt;]];&lt;br/&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&lt;span style=&quot;color: #428957;&quot;&gt;g&lt;/span&gt; = Show[&lt;br/&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;Rasterize[&lt;span style=&quot;color: #428957;&quot;&gt;img&lt;/span&gt;],&lt;br/&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;Graphics[Style[{&lt;br/&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;Text[&lt;span style=&quot;color: #428957;&quot;&gt;label&lt;/span&gt;, Scaled[{0.5, 0.1}], {0, 0}],&lt;br/&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;Style[Text[&lt;span style=&quot;color: #428957;&quot;&gt;label&lt;/span&gt;,&lt;br/&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;Offset[{-4, 4}, Scaled[{0.5, 0.1}]], {0, 0}]&lt;br/&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;, FontColor -&amp;gt; White]&lt;br/&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;}, FontSize -&amp;gt; 72]]&lt;br/&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;];&lt;br/&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;Export[StringJoin[&lt;span style=&quot;color: #666666;&quot;&gt;&amp;quot;DescentProcessed&amp;quot;&lt;/span&gt;, &lt;span style=&quot;color: #428957;&quot;&gt;istr&lt;/span&gt;, &lt;span style=&quot;color: #666666;&quot;&gt;&amp;quot;.png&amp;quot;&lt;/span&gt;], &lt;span style=&quot;color: #428957;&quot;&gt;g&lt;/span&gt;];&lt;br/&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&lt;span style=&quot;color: #428957;&quot;&gt;g&lt;/span&gt;&lt;br/&gt;
]; &lt;/div&gt;
&lt;div class=&quot;Input&quot;&gt;processFrame[1]&lt;/div&gt;
&lt;div class=&quot;Output&quot;&gt;&lt;a href=&quot;http://www.flickr.com/photos/10274904@N05/3408132945&quot; title=&quot;View &#39;DescentProcessed0001&#39; on Flickr.com&quot;&gt;&lt;img style=&quot;border:none;&quot; src=&quot;http://farm4.static.flickr.com/3599/3408132945_d0fd022528.jpg&quot; alt=&quot;DescentProcessed0001&quot; border=&quot;0&quot; width=&quot;500&quot; height=&quot;281&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;Text&quot;&gt;Call the processFrame[] function for each frame (and wait a potentially long time).&lt;/div&gt;
&lt;div class=&quot;Input&quot;&gt;With[{&lt;span style=&quot;color: #428957;&quot;&gt;start&lt;/span&gt; = 1, &lt;span style=&quot;color: #428957;&quot;&gt;stop&lt;/span&gt; = 9606}, Monitor[&lt;br/&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;Do[processFrame[i], {i, &lt;span style=&quot;color: #428957;&quot;&gt;start&lt;/span&gt;, &lt;span style=&quot;color: #428957;&quot;&gt;stop&lt;/span&gt;, 1}],&lt;br/&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;ProgressIndicator[Dynamic[(i - &lt;span style=&quot;color: #428957;&quot;&gt;start&lt;/span&gt;)/(&lt;span style=&quot;color: #428957;&quot;&gt;stop&lt;/span&gt; - &lt;span style=&quot;color: #428957;&quot;&gt;start&lt;/span&gt;)]]&lt;br/&gt;
]]&lt;/div&gt;
&lt;div class=&quot;Text&quot;&gt;Once all the frames have been exported we can recombine them back into a single movie using QuickTime Player Pro.&lt;/div&gt;

&lt;object width=&quot;480&quot; height=&quot;385&quot;&gt;&lt;param name=&quot;movie&quot; value=&quot;http://www.youtube.com/v/b_IiynBEt0A&amp;hl=en&amp;fs=1&amp;rel=0&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/b_IiynBEt0A&amp;hl=en&amp;fs=1&amp;rel=0&quot; type=&quot;application/x-shockwave-flash&quot; allowscriptaccess=&quot;always&quot; allowfullscreen=&quot;true&quot; width=&quot;480&quot; height=&quot;385&quot;&gt;&lt;/embed&gt;&lt;/object&gt;

&lt;p&gt;&lt;a href=&quot;http://sites.google.com/site/ragfield/dev/2009-04-03-VideoTelemetry.nb?attredirects=0&quot;&gt;Download Mathematica Notebook&lt;/a&gt;&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://dev.ragfield.com/feeds/1569218023302162983/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/7147569507271803579/1569218023302162983' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7147569507271803579/posts/default/1569218023302162983'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7147569507271803579/posts/default/1569218023302162983'/><link rel='alternate' type='text/html' href='http://dev.ragfield.com/2009/04/video-with-telemetry-data-overlay.html' title='Video with telemetry data overlay'/><author><name>Ragfield</name><uri>http://www.blogger.com/profile/12325362017984149251</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='25' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjl1SMlQXOTAV7_F3A5DZg4b2e5eimTTKX9EFIlSIGempd0D7LkUqQQ9cneJqOm9HkcSDncQURdiuKI_uoLJJTJs8hSu7nFDdJ_LNdI1hpdiamXqIc6zPoJtTHCZXpkEA/s220/Ahoy.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://farm4.static.flickr.com/3599/3408132945_d0fd022528_t.jpg" height="72" width="72"/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7147569507271803579.post-7908768978625630042</id><published>2009-04-02T22:22:00.001-05:00</published><updated>2009-04-09T17:02:11.214-05:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="c++"/><category scheme="http://www.blogger.com/atom/ns#" term="mac"/><category scheme="http://www.blogger.com/atom/ns#" term="mathematica"/><category scheme="http://www.blogger.com/atom/ns#" term="mathlink"/><category scheme="http://www.blogger.com/atom/ns#" term="xcode"/><title type='text'>Xcode project templates for MathLink applications</title><content type='html'>&lt;p&gt;Setting up an Xcode project to build MathLink applications can be confusing and tedius.  Therefore I have created Xcode project templates for MathLink applications.&lt;/p&gt;

&lt;a href=&quot;http://www.flickr.com/photos/10274904@N05/3408683286&quot; title=&quot;View &#39;Xcode project template installation&#39; on Flickr.com&quot;&gt;&lt;div style=&quot;text-align:center;&quot;&gt;&lt;img style=&quot;border:none;&quot; src=&quot;http://farm4.static.flickr.com/3624/3408683286_d3e80d37db_o.png&quot; alt=&quot;Xcode project template installation&quot; border=&quot;0&quot; width=&quot;500&quot; /&gt;&lt;/div&gt;&lt;/a&gt;

&lt;p&gt;Download the templates &lt;a href=&quot;http://ragfield-packages.googlecode.com/files/MathLinkXcodeProjectTemplates.tgz&quot;&gt;here&lt;/a&gt;.  Install the &quot;MathLink&quot; directory into &quot;/Library/Application Support/Developer/Shared/Xcode/Project Templates/&quot;.  After installation, when you create a new project in Xcode there will be a &lt;strong&gt;User Templates&lt;/strong&gt; section that contains a &lt;strong&gt;MathLink&lt;/strong&gt; subsection.  Click on &lt;strong&gt;MathLink&lt;/strong&gt; and find the two project templates.&lt;/p&gt;

&lt;a href=&quot;http://www.flickr.com/photos/10274904@N05/3407862183&quot; title=&quot;View &#39;Xcode project templates&#39; on Flickr.com&quot;&gt;&lt;div style=&quot;text-align:center;&quot;&gt;&lt;img style=&quot;border:none;&quot; src=&quot;http://farm4.static.flickr.com/3662/3407862183_f7bc1bee64_o.png&quot; alt=&quot;Xcode project templates&quot; border=&quot;0&quot; width=&quot;500&quot; /&gt;&lt;/div&gt;&lt;/a&gt;

&lt;p&gt;The first project template is called &lt;strong&gt;C MathLink Program&lt;/strong&gt;.  Use it for the very simplest of applications where you want to implement a function (or a few functions) in C/C++ and call it directly from Mathematica.  The project will create a single executable (.exe extension, &lt;strong&gt;yes&lt;/strong&gt;, .exe, &lt;strong&gt;yes&lt;/strong&gt;, on Mac).&lt;/p&gt;

&lt;p&gt;Build the target and begin using it in &lt;em&gt;Mathematica&lt;/em&gt; with the &lt;a href=&quot;http://reference.wolfram.com/mathematica/ref/Install.html&quot;&gt;Install&lt;/a&gt; command.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt;: if Mathematica is installed in a different location than /Applications/Mathematica.app you will need to adjust the value of the user defined &lt;strong&gt;MATHEMATICA&lt;/strong&gt; build setting in the target info window.&lt;/p&gt;

&lt;div class=&quot;Input&quot;&gt;l = Install[&lt;span style=&quot;color: #666666;&quot;&gt;&amp;quot;~/Desktop/MyTest/build/Debug/MyTest.exe&amp;quot;&lt;/span&gt;]&lt;/div&gt;
&lt;div class=&quot;Output&quot;&gt;LinkObject[/Users/schofield/Desktop/MyTest/build/Debug/MyTest.exe, 153, 9]&lt;/div&gt;
&lt;div class=&quot;Input&quot;&gt;LinkPatterns[l]&lt;/div&gt;
&lt;div class=&quot;Output&quot;&gt;{MyTest[arg1_Integer, arg2_Real, arg3_String]}&lt;/div&gt;
&lt;div class=&quot;Input&quot;&gt;MyTest[23, 4.5, &lt;span style=&quot;color: #666666;&quot;&gt;&amp;quot;67&amp;quot;&lt;/span&gt;]&lt;/div&gt;
&lt;div class=&quot;Output&quot;&gt;23&lt;/div&gt;

&lt;p&gt;The second project template is called &lt;strong&gt;C MathLink Package&lt;/strong&gt;.  Use it for more complicated applications that require both C/C++ code and supporting &lt;em&gt;Mathematica&lt;/em&gt; code.  The support code goes into &lt;em&gt;init.m&lt;/em&gt;.&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://dev.ragfield.com/feeds/7908768978625630042/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/7147569507271803579/7908768978625630042' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7147569507271803579/posts/default/7908768978625630042'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7147569507271803579/posts/default/7908768978625630042'/><link rel='alternate' type='text/html' href='http://dev.ragfield.com/2009/04/xcode-project-templates-for-mathlink.html' title='Xcode project templates for MathLink applications'/><author><name>Ragfield</name><uri>http://www.blogger.com/profile/12325362017984149251</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='25' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjl1SMlQXOTAV7_F3A5DZg4b2e5eimTTKX9EFIlSIGempd0D7LkUqQQ9cneJqOm9HkcSDncQURdiuKI_uoLJJTJs8hSu7nFDdJ_LNdI1hpdiamXqIc6zPoJtTHCZXpkEA/s220/Ahoy.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7147569507271803579.post-2394365439621148550</id><published>2009-03-31T23:08:00.001-05:00</published><updated>2009-04-09T16:55:34.373-05:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="flickr"/><category scheme="http://www.blogger.com/atom/ns#" term="html"/><category scheme="http://www.blogger.com/atom/ns#" term="mathematica"/><category scheme="http://www.blogger.com/atom/ns#" term="photo"/><title type='text'>FlickrCalendar</title><content type='html'>&lt;div class=&quot;Text&quot;&gt;I take (at least) one photo each day and designate it my Photo of the Day.  I have a set on Flickr with all of these photos and I thought it would be interesting to look at these in a calendar layout.  I wrote a simple &lt;span style=&quot;font-style:italic;&quot;&gt;Mathematica&lt;/span&gt; package to do some basic photoset and photo management on Flickr.  Using this package it is a simple matter to download all the Photos of the Day for a given month and arrange them in a calendar layout.&lt;/div&gt;
&lt;div class=&quot;Text&quot;&gt;Load the Flickr package.&lt;/div&gt;
&lt;div class=&quot;Input&quot;&gt;&amp;lt;&amp;lt;Flickr`&lt;/div&gt;
&lt;div class=&quot;Text&quot;&gt;Get a list of all my photosets.&lt;/div&gt;
&lt;div class=&quot;Input&quot;&gt;Short[sets = FlickrPhotosets[]]&lt;/div&gt;
&lt;div class=&quot;Output&quot;&gt;{72157610604254463-&amp;gt;Photo of the Day, &amp;lt;&amp;lt;22&amp;gt;&amp;gt;, 72157609839542329-&amp;gt;S…on}&lt;/div&gt;
&lt;div class=&quot;Text&quot;&gt;Get the ID of each photo in the &amp;quot;Photo of the Day&amp;quot; set.&lt;/div&gt;
&lt;div class=&quot;Input&quot;&gt;set = First[sets]&lt;/div&gt;
&lt;div class=&quot;Output&quot;&gt;72157610604254463-&amp;gt;Photo of the Day&lt;/div&gt;
&lt;div class=&quot;Input&quot;&gt;photos = FlickrPhotosetPhotos[set,&lt;br/&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;{2009, 3, 1, 0, 0, 0}, {2009, 4, 1, 0, 0, 0}]&lt;/div&gt;
&lt;div class=&quot;Output&quot;&gt;{3320801525, 3325013076, 3327845866, 3330214268, 3332574152, 3333951749, 3336286979, 3339612210, 3343616292, 3346180622, 3347410349, 3349861835, 3352196443, 3355574796, 3358281254, 3361319213, 3364753768, 3366450803, 3368858991, 3372005764, 3374713192, 3377655879, 3381457738, 3384282674, 3386926438, 3389038038, 3390498631, 3394129518, 3396858987, 3400094291, 3402856851}&lt;/div&gt;
&lt;div class=&quot;Input&quot;&gt;Length[photos]&lt;/div&gt;
&lt;div class=&quot;Output&quot;&gt;31&lt;/div&gt;
&lt;div class=&quot;Text&quot;&gt;Import the 75x75 pixel &amp;quot;Square&amp;quot; sized thumbnail of each photo.&lt;/div&gt;
&lt;div class=&quot;Input&quot;&gt;squares = FlickrPhotoImport[&lt;span style=&quot;color: #428957;font-style:italic;&quot;&gt;#&lt;/span&gt;, &lt;span style=&quot;color: #666666;&quot;&gt;&amp;quot;Square&amp;quot;&lt;/span&gt;]&amp;amp; /@ photos; &lt;/div&gt;
&lt;div class=&quot;Input&quot;&gt;First[squares]&lt;/div&gt;
&lt;div class=&quot;Output&quot;&gt;&lt;a href=&quot;http://www.flickr.com/photos/10274904@N05/3403681656&quot; title=&quot;View &#39;Calendar tile&#39; on Flickr.com&quot;&gt;&lt;img style=&quot;border:none;&quot; src=&quot;http://farm4.static.flickr.com/3476/3403681656_a60d3e54f7_o.jpg&quot; alt=&quot;Calendar tile&quot; border=&quot;0&quot; width=&quot;75&quot; height=&quot;75&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;Text&quot;&gt;Overlay the day of the month on top of each thumbnail.&lt;/div&gt;
&lt;div class=&quot;Input&quot;&gt;tiles = Table[&lt;br/&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;Show[Rasterize[squares[[i]]], &lt;br/&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;Graphics[{&lt;br/&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;White, Opacity[0.667],&lt;br/&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;FontSize -&amp;gt; 64,&lt;br/&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;Text[ToString[i], {Center, Center}]&lt;br/&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;}]&lt;br/&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;], {i, Length[squares]}&lt;br/&gt;
]; &lt;/div&gt;
&lt;div class=&quot;Input&quot;&gt;First[tiles]&lt;/div&gt;
&lt;div class=&quot;Output&quot;&gt;&lt;a href=&quot;http://www.flickr.com/photos/10274904@N05/3402870161&quot; title=&quot;View &#39;Calendar tile&#39; on Flickr.com&quot;&gt;&lt;img style=&quot;border:none;&quot; src=&quot;http://farm4.static.flickr.com/3455/3402870161_d31c85ffe9_o.jpg&quot; alt=&quot;Calendar tile&quot; border=&quot;0&quot; width=&quot;75&quot; height=&quot;75&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;Text&quot;&gt;Get the URL of each image and make the tiles hyperlinks.&lt;/div&gt;
&lt;div class=&quot;Input&quot;&gt;urls = First[&lt;span style=&quot;color: #666666;&quot;&gt;&amp;quot;urls&amp;quot;&lt;/span&gt; /. FlickrPhotoInfo[&lt;span style=&quot;color: #428957;font-style:italic;&quot;&gt;#&lt;/span&gt;]]&amp;amp; /@ photos; &lt;/div&gt;
&lt;div class=&quot;Input&quot;&gt;First[urls]&lt;/div&gt;
&lt;div class=&quot;Output&quot;&gt;http://www.flickr.com/photos/ragfield/3320801525/&lt;/div&gt;
&lt;div class=&quot;Input&quot;&gt;tiles = Table[Hyperlink[tiles[[i]], urls[[i]]], {i, Length[tiles]}]; &lt;/div&gt;
&lt;div class=&quot;Text&quot;&gt;Now write a reusable calendar[] function which takes a list of content and lays them out into a grid for the specified month.&lt;/div&gt;
&lt;div class=&quot;Input&quot;&gt;daysInMonth[&lt;span style=&quot;color: #428957;font-style:italic;&quot;&gt;year_Integer&lt;/span&gt;, &lt;span style=&quot;color: #428957;font-style:italic;&quot;&gt;month_Integer&lt;/span&gt;] := Part[&lt;br/&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;{31,&lt;br/&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;Which[&lt;br/&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;Mod[&lt;span style=&quot;color: #428957;font-style:italic;&quot;&gt;year&lt;/span&gt;, 400] === 0, 29,&lt;br/&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;Mod[&lt;span style=&quot;color: #428957;font-style:italic;&quot;&gt;year&lt;/span&gt;, 100] === 0, 28,&lt;br/&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;Mod[&lt;span style=&quot;color: #428957;font-style:italic;&quot;&gt;year&lt;/span&gt;, 4] === 0, 29,&lt;br/&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;True, 28&lt;br/&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;], 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}, &lt;span style=&quot;color: #428957;font-style:italic;&quot;&gt;month&lt;/span&gt;&lt;br/&gt;
]; &lt;/div&gt;
&lt;div class=&quot;Input&quot;&gt;calendar[&lt;span style=&quot;color: #428957;font-style:italic;&quot;&gt;&lt;br/&gt;
&lt;/span&gt;&lt;span style=&quot;color: #428957;font-style:italic;&quot;&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&lt;/span&gt;&lt;span style=&quot;color: #428957;font-style:italic;&quot;&gt;year_Integer&lt;/span&gt;,&lt;span style=&quot;color: #428957;font-style:italic;&quot;&gt;&lt;br/&gt;
&lt;/span&gt;&lt;span style=&quot;color: #428957;font-style:italic;&quot;&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&lt;/span&gt;&lt;span style=&quot;color: #428957;font-style:italic;&quot;&gt;month_Integer&lt;/span&gt;,&lt;span style=&quot;color: #428957;font-style:italic;&quot;&gt;&lt;br/&gt;
&lt;/span&gt;&lt;span style=&quot;color: #428957;font-style:italic;&quot;&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&lt;/span&gt;&lt;span style=&quot;color: #428957;font-style:italic;&quot;&gt;content_List&lt;/span&gt;,&lt;span style=&quot;color: #428957;font-style:italic;&quot;&gt;&lt;br/&gt;
&lt;/span&gt;&lt;span style=&quot;color: #428957;font-style:italic;&quot;&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&lt;/span&gt;&lt;span style=&quot;color: #428957;font-style:italic;&quot;&gt;opts___&lt;/span&gt;&lt;span style=&quot;color: #428957;font-style:italic;&quot;&gt;&lt;br/&gt;
&lt;/span&gt;] := Module[&lt;span style=&quot;color: #428957;font-style:italic;&quot;&gt;&lt;br/&gt;
&lt;/span&gt;&lt;span style=&quot;color: #428957;font-style:italic;&quot;&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&lt;/span&gt;{&lt;span style=&quot;color: #428957;&quot;&gt;startDate&lt;/span&gt;, &lt;span style=&quot;color: #428957;&quot;&gt;startDay&lt;/span&gt;, &lt;span style=&quot;color: #428957;&quot;&gt;daysOfWeek&lt;/span&gt;, &lt;span style=&quot;color: #428957;&quot;&gt;days&lt;/span&gt;},&lt;span style=&quot;color: #428957;font-style:italic;&quot;&gt;&lt;br/&gt;
&lt;/span&gt;&lt;span style=&quot;color: #428957;font-style:italic;&quot;&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&lt;/span&gt;&lt;span style=&quot;color: #428957;&quot;&gt;startDate&lt;/span&gt; = {&lt;span style=&quot;color: #428957;font-style:italic;&quot;&gt;year&lt;/span&gt;, &lt;span style=&quot;color: #428957;font-style:italic;&quot;&gt;month&lt;/span&gt;, 1, 0, 0, 0};&lt;span style=&quot;color: #428957;font-style:italic;&quot;&gt;&lt;br/&gt;
&lt;/span&gt;&lt;span style=&quot;color: #428957;font-style:italic;&quot;&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&lt;/span&gt;&lt;span style=&quot;color: #428957;&quot;&gt;startDay&lt;/span&gt; = DateString[&lt;span style=&quot;color: #428957;&quot;&gt;startDate&lt;/span&gt;, &lt;span style=&quot;color: #666666;&quot;&gt;&amp;quot;DayNameShort&amp;quot;&lt;/span&gt;];&lt;span style=&quot;color: #428957;font-style:italic;&quot;&gt;&lt;br/&gt;
&lt;/span&gt;&lt;span style=&quot;color: #428957;font-style:italic;&quot;&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&lt;/span&gt;&lt;span style=&quot;color: #428957;&quot;&gt;daysOfWeek&lt;/span&gt; = {&lt;span style=&quot;color: #666666;&quot;&gt;&amp;quot;Sun&amp;quot;&lt;/span&gt;, &lt;span style=&quot;color: #666666;&quot;&gt;&amp;quot;Mon&amp;quot;&lt;/span&gt;, &lt;span style=&quot;color: #666666;&quot;&gt;&amp;quot;Tue&amp;quot;&lt;/span&gt;, &lt;span style=&quot;color: #666666;&quot;&gt;&amp;quot;Wed&amp;quot;&lt;/span&gt;, &lt;span style=&quot;color: #666666;&quot;&gt;&amp;quot;Thu&amp;quot;&lt;/span&gt;, &lt;span style=&quot;color: #666666;&quot;&gt;&amp;quot;Fri&amp;quot;&lt;/span&gt;, &lt;span style=&quot;color: #666666;&quot;&gt;&amp;quot;Sat&amp;quot;&lt;/span&gt;};&lt;span style=&quot;color: #428957;font-style:italic;&quot;&gt;&lt;br/&gt;
&lt;/span&gt;&lt;span style=&quot;color: #428957;font-style:italic;&quot;&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&lt;/span&gt;&lt;span style=&quot;color: #428957;font-style:italic;&quot;&gt;&lt;br/&gt;
&lt;/span&gt;&lt;span style=&quot;color: #428957;font-style:italic;&quot;&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&lt;/span&gt;&lt;span style=&quot;color: #999999;&quot;&gt;(*&lt;br/&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;if the month starts in the middle of the week&lt;br/&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;prepend some empty strings to the content list&lt;br/&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;*)&lt;/span&gt;&lt;span style=&quot;color: #428957;font-style:italic;&quot;&gt;&lt;br/&gt;
&lt;/span&gt;&lt;span style=&quot;color: #428957;font-style:italic;&quot;&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&lt;/span&gt;&lt;span style=&quot;color: #428957;&quot;&gt;days&lt;/span&gt; = Join[Table[&lt;span style=&quot;color: #666666;&quot;&gt;&amp;quot;&amp;quot;&lt;/span&gt;,&lt;span style=&quot;color: #428957;font-style:italic;&quot;&gt;&lt;br/&gt;
&lt;/span&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;{Position[&lt;span style=&quot;color: #428957;&quot;&gt;daysOfWeek&lt;/span&gt;, &lt;span style=&quot;color: #428957;&quot;&gt;startDay&lt;/span&gt;][[1,1]] - 1}], &lt;span style=&quot;color: #428957;font-style:italic;&quot;&gt;content&lt;/span&gt;];&lt;span style=&quot;color: #428957;font-style:italic;&quot;&gt;&lt;br/&gt;
&lt;/span&gt;&lt;span style=&quot;color: #428957;font-style:italic;&quot;&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&lt;/span&gt;&lt;span style=&quot;color: #428957;font-style:italic;&quot;&gt;&lt;br/&gt;
&lt;/span&gt;&lt;span style=&quot;color: #428957;font-style:italic;&quot;&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&lt;/span&gt;&lt;span style=&quot;color: #999999;&quot;&gt;(*&lt;br/&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;if less content was specified than days in the month&lt;br/&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;pad the end of content list&lt;br/&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;*)&lt;/span&gt;&lt;span style=&quot;color: #428957;font-style:italic;&quot;&gt;&lt;br/&gt;
&lt;/span&gt;&lt;span style=&quot;color: #428957;font-style:italic;&quot;&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&lt;/span&gt;&lt;span style=&quot;color: #428957;&quot;&gt;days&lt;/span&gt; = Join[&lt;span style=&quot;color: #428957;&quot;&gt;days&lt;/span&gt;, Table[&lt;span style=&quot;color: #666666;&quot;&gt;&amp;quot;&amp;quot;&lt;/span&gt;,&lt;span style=&quot;color: #428957;font-style:italic;&quot;&gt;&lt;br/&gt;
&lt;/span&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;{daysInMonth[&lt;span style=&quot;color: #428957;font-style:italic;&quot;&gt;year&lt;/span&gt;, &lt;span style=&quot;color: #428957;font-style:italic;&quot;&gt;month&lt;/span&gt;] - Length[&lt;span style=&quot;color: #428957;font-style:italic;&quot;&gt;content&lt;/span&gt;]}]];&lt;span style=&quot;color: #428957;font-style:italic;&quot;&gt;&lt;br/&gt;
&lt;/span&gt;&lt;span style=&quot;color: #428957;font-style:italic;&quot;&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&lt;/span&gt;&lt;span style=&quot;color: #428957;font-style:italic;&quot;&gt;&lt;br/&gt;
&lt;/span&gt;&lt;span style=&quot;color: #428957;font-style:italic;&quot;&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&lt;/span&gt;&lt;span style=&quot;color: #999999;&quot;&gt;(*&lt;br/&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;if the month ends in the middle of the week&lt;br/&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;append some empty strings to the content list&lt;br/&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;*)&lt;/span&gt;&lt;span style=&quot;color: #428957;font-style:italic;&quot;&gt;&lt;br/&gt;
&lt;/span&gt;&lt;span style=&quot;color: #428957;font-style:italic;&quot;&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&lt;/span&gt;&lt;span style=&quot;color: #428957;&quot;&gt;days&lt;/span&gt; = Join[&lt;span style=&quot;color: #428957;&quot;&gt;days&lt;/span&gt;, Table[&lt;span style=&quot;color: #666666;&quot;&gt;&amp;quot;&amp;quot;&lt;/span&gt;,&lt;span style=&quot;color: #428957;font-style:italic;&quot;&gt;&lt;br/&gt;
&lt;/span&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;{Mod[7 - Mod[Length[&lt;span style=&quot;color: #428957;&quot;&gt;days&lt;/span&gt;], 7], 7]}]];&lt;span style=&quot;color: #428957;font-style:italic;&quot;&gt;&lt;br/&gt;
&lt;/span&gt;&lt;span style=&quot;color: #428957;font-style:italic;&quot;&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&lt;/span&gt;&lt;span style=&quot;color: #428957;font-style:italic;&quot;&gt;&lt;br/&gt;
&lt;/span&gt;&lt;span style=&quot;color: #428957;font-style:italic;&quot;&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&lt;/span&gt;GraphicsGrid[&lt;span style=&quot;color: #428957;font-style:italic;&quot;&gt;&lt;br/&gt;
&lt;/span&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;Join[&lt;span style=&quot;color: #428957;font-style:italic;&quot;&gt;&lt;br/&gt;
&lt;/span&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;{Join[{Text[Style[&lt;span style=&quot;color: #428957;font-style:italic;&quot;&gt;&lt;br/&gt;
&lt;/span&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;DateString[&lt;span style=&quot;color: #428957;&quot;&gt;startDate&lt;/span&gt;,&lt;span style=&quot;color: #428957;font-style:italic;&quot;&gt;&lt;br/&gt;
&lt;/span&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;{&lt;span style=&quot;color: #666666;&quot;&gt;&amp;quot;MonthName&amp;quot;&lt;/span&gt;, &lt;span style=&quot;color: #666666;&quot;&gt;&amp;quot; &amp;quot;&lt;/span&gt;, &lt;span style=&quot;color: #666666;&quot;&gt;&amp;quot;Year&amp;quot;&lt;/span&gt;}],&lt;span style=&quot;color: #428957;font-style:italic;&quot;&gt;&lt;br/&gt;
&lt;/span&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;FontFamily -&amp;gt; &lt;span style=&quot;color: #666666;&quot;&gt;&amp;quot;Times&amp;quot;&lt;/span&gt;,&lt;span style=&quot;color: #428957;font-style:italic;&quot;&gt;&lt;br/&gt;
&lt;/span&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;FontSize -&amp;gt; 48&lt;span style=&quot;color: #428957;font-style:italic;&quot;&gt;&lt;br/&gt;
&lt;/span&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;]]},&lt;span style=&quot;color: #428957;font-style:italic;&quot;&gt;&lt;br/&gt;
&lt;/span&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;Table[SpanFromLeft, {6}]&lt;span style=&quot;color: #428957;font-style:italic;&quot;&gt;&lt;br/&gt;
&lt;/span&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;]},&lt;span style=&quot;color: #428957;font-style:italic;&quot;&gt;&lt;br/&gt;
&lt;/span&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;Partition[&lt;span style=&quot;color: #428957;&quot;&gt;days&lt;/span&gt;, 7]&lt;span style=&quot;color: #428957;font-style:italic;&quot;&gt;&lt;br/&gt;
&lt;/span&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;],&lt;span style=&quot;color: #428957;font-style:italic;&quot;&gt;&lt;br/&gt;
&lt;/span&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&lt;span style=&quot;color: #428957;font-style:italic;&quot;&gt;opts&lt;/span&gt;&lt;span style=&quot;color: #428957;font-style:italic;&quot;&gt;&lt;br/&gt;
&lt;/span&gt;&lt;span style=&quot;color: #428957;font-style:italic;&quot;&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&lt;/span&gt;]&lt;span style=&quot;color: #428957;font-style:italic;&quot;&gt;&lt;br/&gt;
&lt;/span&gt;]; &lt;/div&gt;
&lt;div class=&quot;Text&quot;&gt;Now add the tile images to the calendar.&lt;/div&gt;
&lt;div class=&quot;Input&quot;&gt;c = calendar[2009, 3, tiles,&lt;br/&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;Spacings -&amp;gt; 0, ImageSize -&amp;gt; 460,&lt;br/&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;Dividers -&amp;gt; All, Background -&amp;gt; LightGray]&lt;/div&gt;
&lt;div class=&quot;Output&quot;&gt;&lt;img style=&quot;border:none;&quot; src=&quot;http://farm4.static.flickr.com/3583/3403712856_12fa7eb1b2_o.jpg&quot; alt=&quot;March calendar&quot; border=&quot;0&quot; width=&quot;460&quot; height=&quot;394&quot; usemap=&#39;#map_1&#39; /&gt;&lt;map name=&#39;map_1&#39;&gt;
&lt;area shape=&#39;rect&#39; coords=&#39;131,392,196,327&#39; href=&#39;http://www.flickr.com/photos/ragfield/3402856851/&#39;/&gt;
&lt;area shape=&#39;rect&#39; coords=&#39;66,392,131,327&#39; href=&#39;http://www.flickr.com/photos/ragfield/3400094291/&#39;/&gt;
&lt;area shape=&#39;rect&#39; coords=&#39;1,392,66,327&#39; href=&#39;http://www.flickr.com/photos/ragfield/3396858987/&#39;/&gt;
&lt;area shape=&#39;rect&#39; coords=&#39;392,327,458,261&#39; href=&#39;http://www.flickr.com/photos/ragfield/3394129518/&#39;/&gt;
&lt;area shape=&#39;rect&#39; coords=&#39;327,327,392,261&#39; href=&#39;http://www.flickr.com/photos/ragfield/3390498631/&#39;/&gt;
&lt;area shape=&#39;rect&#39; coords=&#39;262,327,327,261&#39; href=&#39;http://www.flickr.com/photos/ragfield/3389038038/&#39;/&gt;
&lt;area shape=&#39;rect&#39; coords=&#39;196,327,262,261&#39; href=&#39;http://www.flickr.com/photos/ragfield/3386926438/&#39;/&gt;
&lt;area shape=&#39;rect&#39; coords=&#39;131,327,196,261&#39; href=&#39;http://www.flickr.com/photos/ragfield/3384282674/&#39;/&gt;
&lt;area shape=&#39;rect&#39; coords=&#39;66,327,131,261&#39; href=&#39;http://www.flickr.com/photos/ragfield/3381457738/&#39;/&gt;
&lt;area shape=&#39;rect&#39; coords=&#39;1,327,66,261&#39; href=&#39;http://www.flickr.com/photos/ragfield/3377655879/&#39;/&gt;
&lt;area shape=&#39;rect&#39; coords=&#39;392,261,458,196&#39; href=&#39;http://www.flickr.com/photos/ragfield/3374713192/&#39;/&gt;
&lt;area shape=&#39;rect&#39; coords=&#39;327,261,392,196&#39; href=&#39;http://www.flickr.com/photos/ragfield/3372005764/&#39;/&gt;
&lt;area shape=&#39;rect&#39; coords=&#39;262,261,327,196&#39; href=&#39;http://www.flickr.com/photos/ragfield/3368858991/&#39;/&gt;
&lt;area shape=&#39;rect&#39; coords=&#39;196,261,262,196&#39; href=&#39;http://www.flickr.com/photos/ragfield/3366450803/&#39;/&gt;
&lt;area shape=&#39;rect&#39; coords=&#39;131,261,196,196&#39; href=&#39;http://www.flickr.com/photos/ragfield/3364753768/&#39;/&gt;
&lt;area shape=&#39;rect&#39; coords=&#39;66,261,131,196&#39; href=&#39;http://www.flickr.com/photos/ragfield/3361319213/&#39;/&gt;
&lt;area shape=&#39;rect&#39; coords=&#39;1,261,66,196&#39; href=&#39;http://www.flickr.com/photos/ragfield/3358281254/&#39;/&gt;
&lt;area shape=&#39;rect&#39; coords=&#39;392,196,458,131&#39; href=&#39;http://www.flickr.com/photos/ragfield/3355574796/&#39;/&gt;
&lt;area shape=&#39;rect&#39; coords=&#39;327,196,392,131&#39; href=&#39;http://www.flickr.com/photos/ragfield/3352196443/&#39;/&gt;
&lt;area shape=&#39;rect&#39; coords=&#39;262,196,327,131&#39; href=&#39;http://www.flickr.com/photos/ragfield/3349861835/&#39;/&gt;
&lt;area shape=&#39;rect&#39; coords=&#39;196,196,262,131&#39; href=&#39;http://www.flickr.com/photos/ragfield/3347410349/&#39;/&gt;
&lt;area shape=&#39;rect&#39; coords=&#39;131,196,196,131&#39; href=&#39;http://www.flickr.com/photos/ragfield/3346180622/&#39;/&gt;
&lt;area shape=&#39;rect&#39; coords=&#39;66,196,131,131&#39; href=&#39;http://www.flickr.com/photos/ragfield/3343616292/&#39;/&gt;
&lt;area shape=&#39;rect&#39; coords=&#39;1,196,66,131&#39; href=&#39;http://www.flickr.com/photos/ragfield/3339612210/&#39;/&gt;
&lt;area shape=&#39;rect&#39; coords=&#39;392,131,458,66&#39; href=&#39;http://www.flickr.com/photos/ragfield/3336286979/&#39;/&gt;
&lt;area shape=&#39;rect&#39; coords=&#39;327,131,392,66&#39; href=&#39;http://www.flickr.com/photos/ragfield/3333951749/&#39;/&gt;
&lt;area shape=&#39;rect&#39; coords=&#39;262,131,327,66&#39; href=&#39;http://www.flickr.com/photos/ragfield/3332574152/&#39;/&gt;
&lt;area shape=&#39;rect&#39; coords=&#39;196,131,262,66&#39; href=&#39;http://www.flickr.com/photos/ragfield/3330214268/&#39;/&gt;
&lt;area shape=&#39;rect&#39; coords=&#39;131,131,196,66&#39; href=&#39;http://www.flickr.com/photos/ragfield/3327845866/&#39;/&gt;
&lt;area shape=&#39;rect&#39; coords=&#39;66,131,131,66&#39; href=&#39;http://www.flickr.com/photos/ragfield/3325013076/&#39;/&gt;
&lt;area shape=&#39;rect&#39; coords=&#39;1,131,66,66&#39; href=&#39;http://www.flickr.com/photos/ragfield/3320801525/&#39;/&gt;
&lt;/map&gt;&lt;/div&gt;
&lt;div class=&quot;Text&quot;&gt;We could export directly to JPEG, but since the image contains hyperlinks exporting to HTML will yield both a JPEG &lt;span style=&quot;font-style:italic;&quot;&gt;and&lt;/span&gt; the HTML code for an image map.&lt;/div&gt;
&lt;div class=&quot;Input&quot;&gt;SetDirectory[CreateDirectory[&lt;span style=&quot;color: #666666;&quot;&gt;&amp;quot;/tmp/FlickCalendar&amp;quot;&lt;/span&gt;]]; &lt;/div&gt;
&lt;div class=&quot;Input&quot;&gt;Export[&lt;span style=&quot;color: #666666;&quot;&gt;&amp;quot;FlickCalendar.html&amp;quot;&lt;/span&gt;, c, &lt;span style=&quot;color: #666666;&quot;&gt;&amp;quot;GraphicsOutput&amp;quot;&lt;/span&gt; -&amp;gt; &lt;span style=&quot;color: #666666;&quot;&gt;&amp;quot;JPEG&amp;quot;&lt;/span&gt;]; &lt;/div&gt;

&lt;p&gt;&lt;a href=&quot;http://sites.google.com/site/ragfield/dev/2009-03-31-FlickrCalendar.nb?attredirects=0&quot;&gt;Download Mathematica Notebook&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://ragfield-packages.googlecode.com/svn/trunk/Flickr.m&quot;&gt;Download Flickr Mathematica package&lt;/a&gt;&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://dev.ragfield.com/feeds/2394365439621148550/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/7147569507271803579/2394365439621148550' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7147569507271803579/posts/default/2394365439621148550'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7147569507271803579/posts/default/2394365439621148550'/><link rel='alternate' type='text/html' href='http://dev.ragfield.com/2009/03/flickcalendar.html' title='FlickrCalendar'/><author><name>Ragfield</name><uri>http://www.blogger.com/profile/12325362017984149251</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='25' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjl1SMlQXOTAV7_F3A5DZg4b2e5eimTTKX9EFIlSIGempd0D7LkUqQQ9cneJqOm9HkcSDncQURdiuKI_uoLJJTJs8hSu7nFDdJ_LNdI1hpdiamXqIc6zPoJtTHCZXpkEA/s220/Ahoy.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7147569507271803579.post-6587309952543065922</id><published>2009-03-31T08:24:00.001-05:00</published><updated>2009-04-09T18:31:02.986-05:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="image processing"/><category scheme="http://www.blogger.com/atom/ns#" term="iMovie"/><category scheme="http://www.blogger.com/atom/ns#" term="mathematica"/><category scheme="http://www.blogger.com/atom/ns#" term="video"/><title type='text'>Image stabilization in iMovie &amp;#39;09</title><content type='html'>&lt;p&gt;I got the chance yesterday to try out the new image stabilization feature in &lt;a href=&quot;http://www.apple.com/ilife/imovie/&quot;&gt;iMovie &#39;09&lt;/a&gt;.  It works.  Sort of.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://rob.ragfield.com/2009/03/training-camp.html&quot;&gt;Last weekend&lt;/a&gt; I strapped my &lt;a href=&quot;http://www.theflip.com/&quot;&gt;Flip video camera&lt;/a&gt; onto the handlebars of my bike while descending a big hill.  The resulting footage was pretty jerky.  I started iMovie for the first time and it decided to &lt;em&gt;build thumbnails&lt;/em&gt; for what seemed like forever.  Finally I was able to add my clip to a project and enable image stabilization for it.  It took around two hours on my 2.2 GHz dual core MacBook Pro to process five minutes of video.  Ouch.&lt;/p&gt;

&lt;p&gt;It appears to work by cropping the image frame to give it a few extra pixels in each direction with which to work.  It then attempts to match up corresponding sections of subsequent video frames.  Finally, it re-expands the cropped image to fill the frame again.&lt;/p&gt;

&lt;p&gt;With my particular video there were a few sections which it was able to successfully stabilize, but most of it couldn&#39;t be helped.  In parts the video was actually worse after stabilization (due to the scaling?).  Anyway, here&#39;s a brief comparison.  The top image is the original (scaled down from HD) video.  The bottom frame is the stabilized version from iMovie &#39;09.&lt;/p&gt;

&lt;object width=&quot;480&quot; height=&quot;385&quot;&gt;&lt;param name=&quot;movie&quot; value=&quot;http://www.youtube.com/v/1z2XNs1muQE&amp;hl=en&amp;fs=1&amp;rel=0&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/1z2XNs1muQE&amp;hl=en&amp;fs=1&amp;rel=0&quot; type=&quot;application/x-shockwave-flash&quot; allowscriptaccess=&quot;always&quot; allowfullscreen=&quot;true&quot; width=&quot;480&quot; height=&quot;385&quot;&gt;&lt;/embed&gt;&lt;/object&gt;

&lt;p&gt;I assure you the two videos are synchronized.  Notice how the iMovie (bottom) video has a noticeably smaller field of view, slightly washed out colors, and slightly more side-to-side movement, but slightly less jerkiness.&lt;/p&gt;

&lt;p&gt;The video was easy to put together in Mathematica.  First I saved each movie as an Image Sequence in QuickTime Player Pro.  Then I combined the two frames using &lt;em&gt;Mathematica&lt;/em&gt; 7&#39;s image processing functions.  Then I assembled the resulting frames back into a movie using QuickTime Player Pro.  Here&#39;s the &lt;em&gt;Mathematica&lt;/em&gt; code.&lt;/p&gt;

&lt;div class=&quot;Input&quot;&gt;processFrame[&lt;span style=&quot;color: #428957;font-style:italic;&quot;&gt;i_Integer&lt;/span&gt;] := Module[&lt;br/&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;{&lt;span style=&quot;color: #428957;&quot;&gt;n&lt;/span&gt;, &lt;span style=&quot;color: #428957;&quot;&gt;n1&lt;/span&gt;, &lt;span style=&quot;color: #428957;&quot;&gt;n2&lt;/span&gt;, &lt;span style=&quot;color: #428957;&quot;&gt;n3&lt;/span&gt;, &lt;span style=&quot;color: #428957;&quot;&gt;i1&lt;/span&gt;, &lt;span style=&quot;color: #428957;&quot;&gt;i2&lt;/span&gt;, &lt;span style=&quot;color: #428957;&quot;&gt;i3&lt;/span&gt;},&lt;br/&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&lt;span style=&quot;color: #428957;&quot;&gt;n&lt;/span&gt; = StringJoin[IntegerString[&lt;span style=&quot;color: #428957;font-style:italic;&quot;&gt;i&lt;/span&gt;, 10, 4], &lt;span style=&quot;color: #666666;&quot;&gt;&amp;quot;.png&amp;quot;&lt;/span&gt;];&lt;br/&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&lt;span style=&quot;color: #428957;&quot;&gt;n1&lt;/span&gt; = StringJoin[&lt;span style=&quot;color: #666666;&quot;&gt;&amp;quot;Descent/Descent&amp;quot;&lt;/span&gt;, &lt;span style=&quot;color: #428957;&quot;&gt;n&lt;/span&gt;];&lt;br/&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&lt;span style=&quot;color: #428957;&quot;&gt;n2&lt;/span&gt; = StringJoin[&lt;span style=&quot;color: #666666;&quot;&gt;&amp;quot;DescentStabilized/DescentStabilized&amp;quot;&lt;/span&gt;, &lt;span style=&quot;color: #428957;&quot;&gt;n&lt;/span&gt;];&lt;br/&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&lt;span style=&quot;color: #428957;&quot;&gt;n3&lt;/span&gt; = StringJoin[&lt;span style=&quot;color: #666666;&quot;&gt;&amp;quot;DescentCompare/DescentCompare&amp;quot;&lt;/span&gt;, &lt;span style=&quot;color: #428957;&quot;&gt;n&lt;/span&gt;];&lt;br/&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&lt;span style=&quot;color: #428957;&quot;&gt;i1&lt;/span&gt; = Import[&lt;span style=&quot;color: #428957;&quot;&gt;n1&lt;/span&gt;];&lt;br/&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&lt;span style=&quot;color: #428957;&quot;&gt;i2&lt;/span&gt; = Import[&lt;span style=&quot;color: #428957;&quot;&gt;n2&lt;/span&gt;];&lt;br/&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&lt;span style=&quot;color: #428957;&quot;&gt;i3&lt;/span&gt; = ImageAssemble[{&lt;br/&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;{ImageResize[&lt;span style=&quot;color: #428957;&quot;&gt;i1&lt;/span&gt;, {480, 270}]},&lt;br/&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;{ImageResize[&lt;span style=&quot;color: #428957;&quot;&gt;i2&lt;/span&gt;, {480, 270}]}&lt;br/&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;}];&lt;br/&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;Export[&lt;span style=&quot;color: #428957;&quot;&gt;n3&lt;/span&gt;, &lt;span style=&quot;color: #428957;&quot;&gt;i3&lt;/span&gt;]&lt;br/&gt;
];&lt;/div&gt;
&lt;div class=&quot;Input&quot;&gt;With[{&lt;span style=&quot;color: #428957;&quot;&gt;start&lt;/span&gt; = 1, &lt;span style=&quot;color: #428957;&quot;&gt;stop&lt;/span&gt; = 9606}, Monitor[&lt;br/&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;Do[processFrame[i], {i, &lt;span style=&quot;color: #428957;&quot;&gt;start&lt;/span&gt;, &lt;span style=&quot;color: #428957;&quot;&gt;stop&lt;/span&gt;, 1}],&lt;br/&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;ProgressIndicator[Dynamic[(i - &lt;span style=&quot;color: #428957;&quot;&gt;start&lt;/span&gt;)/(&lt;span style=&quot;color: #428957;&quot;&gt;stop&lt;/span&gt; - &lt;span style=&quot;color: #428957;&quot;&gt;start&lt;/span&gt;)]]&lt;br/&gt;
]]&lt;/div&gt;


&lt;p&gt;I&#39;ll bet I could do the stabilization in &lt;em&gt;Mathematica&lt;/em&gt;...&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://dev.ragfield.com/feeds/6587309952543065922/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/7147569507271803579/6587309952543065922' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7147569507271803579/posts/default/6587309952543065922'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7147569507271803579/posts/default/6587309952543065922'/><link rel='alternate' type='text/html' href='http://dev.ragfield.com/2009/03/image-stabilization-in-imovie.html' title='Image stabilization in iMovie &amp;#39;09'/><author><name>Ragfield</name><uri>http://www.blogger.com/profile/12325362017984149251</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='25' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjl1SMlQXOTAV7_F3A5DZg4b2e5eimTTKX9EFIlSIGempd0D7LkUqQQ9cneJqOm9HkcSDncQURdiuKI_uoLJJTJs8hSu7nFDdJ_LNdI1hpdiamXqIc6zPoJtTHCZXpkEA/s220/Ahoy.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7147569507271803579.post-4706248407875695712</id><published>2009-03-19T22:10:00.001-05:00</published><updated>2009-04-09T18:40:09.418-05:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="futurama"/><category scheme="http://www.blogger.com/atom/ns#" term="math"/><category scheme="http://www.blogger.com/atom/ns#" term="mathematica"/><title type='text'>Expressible as the sum of two cubes</title><content type='html'>&lt;a href=&quot;http://www.flickr.com/photos/10274904@N05/3368858991&quot; title=&quot;View &#39;Bite my shiny metal ass&#39; on Flickr.com&quot;&gt;&lt;div style=&quot;text-align:center;&quot;&gt;&lt;img src=&quot;http://farm4.static.flickr.com/3469/3368858991_e78b6a0b00.jpg&quot; alt=&quot;Bite my shiny metal ass&quot; border=&quot;0&quot; width=&quot;321&quot; height=&quot;500&quot; /&gt;&lt;/div&gt;&lt;/a&gt;

&lt;div class=&quot;Text&quot;&gt;&lt;span style=&quot;font-weight:bold;&quot;&gt;Futurama episode 1ACV06 (The Lesser of Two Evils)&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;Text&quot;&gt;&lt;span style=&quot;font-weight:bold;&quot;&gt;Bender&lt;/span&gt;: &lt;span style=&quot;font-style:italic;&quot;&gt;Hey robot, what&amp;apos;s your serial number?&lt;/span&gt;&lt;br/&gt;
&lt;span style=&quot;font-weight:bold;&quot;&gt;Flexo&lt;/span&gt;: &lt;span style=&quot;font-style:italic;&quot;&gt;3370318.&lt;/span&gt;&lt;br/&gt;
&lt;span style=&quot;font-weight:bold;&quot;&gt;Bender&lt;/span&gt;: &lt;span style=&quot;font-style:italic;&quot;&gt;No way, mine&amp;apos;s 2716057!&lt;/span&gt;&lt;br/&gt;
(robot laughter)&lt;br/&gt;
&lt;span style=&quot;font-weight:bold;&quot;&gt;Fry&lt;/span&gt;: &lt;span style=&quot;font-style:italic;&quot;&gt;I don&amp;apos;t get it.&lt;/span&gt;&lt;br/&gt;
&lt;span style=&quot;font-weight:bold;&quot;&gt;Bender&lt;/span&gt;: &lt;span style=&quot;font-style:italic;&quot;&gt;We&amp;apos;re both expressible as the sum of two cubes!&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;Text&quot;&gt;Well that should be easy enough to test with &lt;span style=&quot;font-style:italic;&quot;&gt;Mathematica&lt;/span&gt;.  Let&amp;apos;s just use a brute force method to check each pair of numbers &lt;span style=&quot;font-style:italic;&quot;&gt;{i, j}&lt;/span&gt; that adds up to number &lt;span style=&quot;font-style:italic;&quot;&gt;n&lt;/span&gt; where &lt;span style=&quot;font-style:italic;&quot;&gt;i&lt;/span&gt; is in the range of &lt;span style=&quot;font-style:italic;&quot;&gt;0&lt;/span&gt; to the &lt;span style=&quot;font-style:italic;&quot;&gt;cube root of n&lt;/span&gt; and &lt;span style=&quot;font-style:italic;&quot;&gt;j&lt;/span&gt; is in the range of &lt;span style=&quot;font-style:italic;&quot;&gt;0&lt;/span&gt; to &lt;span style=&quot;font-style:italic;&quot;&gt;i&lt;/span&gt;.&lt;/div&gt;
&lt;div class=&quot;Input&quot;&gt;flexo = 3370318;&lt;br/&gt;
bender = 2716057;&lt;/div&gt;
&lt;div class=&quot;Input&quot;&gt;SumOfTwoCubes[&lt;span style=&quot;color: #428957;font-style:italic;&quot;&gt;n_Integer&lt;/span&gt;] := &lt;br/&gt;
Catch@Do[&lt;br/&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;If[i^3  +  j^3  ==  &lt;span style=&quot;color: #428957;font-style:italic;&quot;&gt;n&lt;/span&gt;,  Throw[{i,  j}]], &lt;br/&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;{i,  &lt;span style=&quot;color: #428957;font-style:italic;&quot;&gt;n&lt;/span&gt;^(1 / 3)}, &lt;br/&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;{j,  i}&lt;br/&gt;
]; &lt;/div&gt;
&lt;div class=&quot;Input&quot;&gt;SumOfTwoCubes[flexo]&lt;/div&gt;
&lt;div class=&quot;Output&quot;&gt;{119, 119}&lt;/div&gt;
&lt;div class=&quot;Input&quot;&gt;SumOfTwoCubes[bender]&lt;/div&gt;
&lt;div class=&quot;Text&quot;&gt;So this test found the two numbers whose cubes add up to Flexo&amp;apos;s serial number, but it did not find the two numbers whose cubes add up to Bender&amp;apos;s serial number.  Interesting.  This problem must be trickier than I first thought.  Indeed it is.  A coworker pointed out that the first test only searches half of the possible numbers--it completely excludes negative numbers!&lt;/div&gt;
&lt;div class=&quot;Text&quot;&gt;Okay, let&amp;apos;s rewrite the test to include negative numbers.  The absolute value of &lt;span style=&quot;font-style:italic;&quot;&gt;i&lt;/span&gt; must no longer be constrained to the &lt;span style=&quot;font-style:italic;&quot;&gt;cube root of n&lt;/span&gt; since one of the terms can be negative.  We must instead search all values between -∞ and ∞.  Hmm.  That might take a while.  Okay, instead we&amp;apos;ll just deal with numbers whose cubes are expressible as a 32-bit signed machine integer and we&amp;apos;ll stop the search as soon as we find the answer.  Additionally, we&amp;apos;ll have to add an additional test where the smaller of the two values (in this case &lt;span style=&quot;font-style:italic;&quot;&gt;j&lt;/span&gt;) is negative.  We know it must be the smaller of the two since their sum is positive.&lt;/div&gt;
&lt;div class=&quot;Input&quot;&gt;BetterSumOfTwoCubes[&lt;span style=&quot;color: #428957;font-style:italic;&quot;&gt;n_Integer&lt;/span&gt;] := &lt;br/&gt;
   Catch@Do[&lt;br/&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;Which[&lt;br/&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;i^3  +  j^3  ==  &lt;span style=&quot;color: #428957;font-style:italic;&quot;&gt;n&lt;/span&gt;,  Throw[{i,  j}], &lt;br/&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;i^3  +  ( - j)^3  ==  &lt;span style=&quot;color: #428957;font-style:italic;&quot;&gt;n&lt;/span&gt;,  Throw[{i,   - j}]&lt;br/&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;], &lt;br/&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;{i,  (2^31  -  1)^(1 / 3)}, &lt;br/&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;{j,  i}&lt;br/&gt;
];&lt;/div&gt;
&lt;div class=&quot;Input&quot;&gt;BetterSumOfTwoCubes[flexo]&lt;/div&gt;
&lt;div class=&quot;Output&quot;&gt;{119, 119}&lt;/div&gt;
&lt;div class=&quot;Input&quot;&gt;BetterSumOfTwoCubes[bender]&lt;/div&gt;
&lt;div class=&quot;Output&quot;&gt;{952,  - 951}&lt;/div&gt;
&lt;div class=&quot;Text&quot;&gt;Tricky television writers.&lt;/div&gt;
&lt;div class=&quot;Text&quot;&gt;&lt;/div&gt;
&lt;div class=&quot;Text&quot;&gt;&lt;span style=&quot;font-weight:bold;&quot;&gt;Update:&lt;/span&gt; Paul Abbott points out in the comments that there&amp;apos;s a far better way to solve this problem:&lt;/div&gt;
&lt;div class=&quot;Input&quot;&gt;Reduce[i^3 + j^3==3370318, Integers]&lt;/div&gt;
&lt;div class=&quot;Output&quot;&gt;i==119&amp;amp;&amp;amp;j==119&lt;/div&gt;
&lt;div class=&quot;Input&quot;&gt;Reduce[i^3 + j^3==2716057, Integers]&lt;/div&gt;
&lt;div class=&quot;Output&quot;&gt;(i== - 951&amp;amp;&amp;amp;j==952)||(i==952&amp;amp;&amp;amp;j== - 951)&lt;/div&gt;
&lt;div class=&quot;Text&quot;&gt;I must admit that I&amp;apos;ve never used the Reduce function before so this was a bit of a surprise to me, but a welcome one at that.&lt;/div&gt;

&lt;p&gt;&lt;a href=&quot;http://sites.google.com/site/ragfield/dev/2009-03-19-FuturamaSumOfTwoCubes.nb?attredirects=0&quot;&gt;Download Mathematica notebook&lt;/a&gt;&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://dev.ragfield.com/feeds/4706248407875695712/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/7147569507271803579/4706248407875695712' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7147569507271803579/posts/default/4706248407875695712'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7147569507271803579/posts/default/4706248407875695712'/><link rel='alternate' type='text/html' href='http://dev.ragfield.com/2009/03/expressible-as-sum-of-two-cubes.html' title='Expressible as the sum of two cubes'/><author><name>Ragfield</name><uri>http://www.blogger.com/profile/12325362017984149251</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='25' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjl1SMlQXOTAV7_F3A5DZg4b2e5eimTTKX9EFIlSIGempd0D7LkUqQQ9cneJqOm9HkcSDncQURdiuKI_uoLJJTJs8hSu7nFDdJ_LNdI1hpdiamXqIc6zPoJtTHCZXpkEA/s220/Ahoy.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://farm4.static.flickr.com/3469/3368858991_e78b6a0b00_t.jpg" height="72" width="72"/><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7147569507271803579.post-3056780215317704287</id><published>2009-03-18T14:18:00.001-05:00</published><updated>2009-03-18T14:18:30.255-05:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="c++"/><title type='text'>Using stack based object constructors as function parameters</title><content type='html'>&lt;p&gt;In C++, if the type of a function parameter is a bare class or a const reference to a class then it is not necessary to pre-create an object to pass into that function.  You can use one of the class&#39; constructors in place.  For example:&lt;/p&gt;

&lt;pre&gt;class Graphics;
class Point;
...
void drawPoint(Graphics&amp; g, const Point&amp; p);
...
// The first argument is a non-const reference,
//   so the object must already exist
// The second argument is const reference,
//   so it can be created on the spot
drawPoint(g, Point(0, 0));
&lt;/pre&gt;

&lt;p&gt;The constructor for the stack based object is called first, then the function is called, then the destructor for the stack based object is called last.&lt;/p&gt;

&lt;p&gt;This is potentially very useful when combined with auto_ptr (or similar classes):&lt;/p&gt;

&lt;pre&gt;void foo(class Bar* b);
...
// A new &quot;Bar&quot; object is created, passed into
//   the foo() function, then destroyed
//   automatically after foo() is called.
foo(std::auto_ptr&amp;lt;Bar&amp;gt;(new Bar(...)));
&lt;/pre&gt;</content><link rel='replies' type='application/atom+xml' href='http://dev.ragfield.com/feeds/3056780215317704287/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/7147569507271803579/3056780215317704287' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7147569507271803579/posts/default/3056780215317704287'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7147569507271803579/posts/default/3056780215317704287'/><link rel='alternate' type='text/html' href='http://dev.ragfield.com/2009/03/using-stack-based-object-constructors.html' title='Using stack based object constructors as function parameters'/><author><name>Ragfield</name><uri>http://www.blogger.com/profile/12325362017984149251</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='25' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjl1SMlQXOTAV7_F3A5DZg4b2e5eimTTKX9EFIlSIGempd0D7LkUqQQ9cneJqOm9HkcSDncQURdiuKI_uoLJJTJs8hSu7nFDdJ_LNdI1hpdiamXqIc6zPoJtTHCZXpkEA/s220/Ahoy.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7147569507271803579.post-4615177368161566096</id><published>2009-03-18T08:40:00.001-05:00</published><updated>2009-04-09T17:12:02.563-05:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="2D graphics"/><category scheme="http://www.blogger.com/atom/ns#" term="mathematica"/><title type='text'>Polygons with holes in Mathematica</title><content type='html'>&lt;p&gt;The &lt;em&gt;Mathematica&lt;/em&gt; graphics language has a &lt;a href=&quot;http://reference.wolfram.com/mathematica/ref/Polygon.html&quot;&gt;Polygon&lt;/a&gt; primitive, but (as of &lt;em&gt;Mathematica&lt;/em&gt; 7) there is no way to create a Polygon with holes punched out (more specifically, any polygon with two or more contours).  However, there is a fairly good way to fake this feature.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Draw the first polygon contour.&lt;/li&gt;
&lt;li&gt;Draw a line from the ending point of the first contour to the starting point of the second contour.&lt;/li&gt;
&lt;li&gt;Draw the second polygon contour.&lt;/li&gt;
&lt;li&gt;Repeat steps 1-3 for N contours&lt;/li&gt;
&lt;li&gt;Once all contours are drawn, draw a line from the ending point of contour N-1, then N-2, ..., all the way back to contour 1.  These are the same ending points we used earlier, except in reverse order.
&lt;/ol&gt;

&lt;div class=&quot;Input&quot;&gt;MultiContourPolygon[&lt;span style=&quot;color: #428957;font-style:italic;&quot;&gt;polys_List&lt;/span&gt;] := Module[&lt;br/&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;{&lt;span style=&quot;color: #428957;&quot;&gt;contours&lt;/span&gt;&lt;span style=&quot;color: #428957;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #428957;&quot;&gt;Append&lt;/span&gt;[&lt;span style=&quot;color: #428957;font-style:italic;&quot;&gt;#&lt;/span&gt;, First[&lt;span style=&quot;color: #428957;font-style:italic;&quot;&gt;#&lt;/span&gt;]]&amp;amp;/@&lt;span style=&quot;color: #428957;font-style:italic;&quot;&gt;polys&lt;/span&gt;}, &lt;br/&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;{&lt;br/&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;Polygon@Join[Join@@&lt;span style=&quot;color: #428957;&quot;&gt;contours&lt;/span&gt;, Reverse[First/@&lt;span style=&quot;color: #428957;&quot;&gt;contours&lt;/span&gt;]], &lt;br/&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;Line[&lt;span style=&quot;color: #428957;&quot;&gt;contours&lt;/span&gt;]&lt;br/&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;}&lt;br/&gt;
]&lt;/div&gt;
&lt;div class=&quot;Input&quot;&gt;Graphics@MultiContourPolygon[{&lt;br/&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;{{0, 0}, {0, 1}, {1, 1}, {1, 0}}, &lt;br/&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;{{.25, .25}, {.75, .25}, {.75, .75}, {.25, .75}}, &lt;br/&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;{{.4,  .4}, {.6, .4}, {.6, .6}, {.4, .6}}&lt;br/&gt;
}]&lt;/div&gt;
&lt;div class=&quot;Output&quot;&gt;&lt;div class=&quot;Output&quot;&gt;&lt;a href=&quot;http://www.flickr.com/photos/10274904@N05/3364724383&quot; title=&quot;View &#39;Polygons with holes&#39; on Flickr.com&quot;&gt;&lt;div style=&quot;text-align:left;&quot;&gt;&lt;img src=&quot;http://farm4.static.flickr.com/3093/3364724383_b4d2784136.jpg&quot; alt=&quot;Polygons with holes&quot; border=&quot;0&quot; width=&quot;360&quot; height=&quot;359&quot; /&gt;&lt;/div&gt;&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;Mathematica&#39;s built-in PDF import feature uses this same algorithm to represent arbitrary multi-contoured paths from PDF files.&lt;/p&gt;

&lt;div class=&quot;Input&quot;&gt;Import[&lt;span style=&quot;color: #666666;&quot;&gt;&amp;quot;ExampleData/mathematica.pdf&amp;quot;&lt;/span&gt;]&lt;/div&gt;
&lt;div class=&quot;Output&quot;&gt;&lt;a href=&quot;http://www.flickr.com/photos/10274904@N05/3364737231&quot; title=&quot;View &#39;Polygons with holes 2&#39; on Flickr.com&quot;&gt;&lt;div style=&quot;text-align:left;&quot;&gt;&lt;img src=&quot;http://farm4.static.flickr.com/3433/3364737231_8817093554.jpg&quot; alt=&quot;Polygons with holes 2&quot; border=&quot;0&quot; width=&quot;364&quot; height=&quot;70&quot; /&gt;&lt;/div&gt;&lt;/a&gt;&lt;/div&gt;

&lt;p&gt;&lt;a href=&quot;http://sites.google.com/site/ragfield/dev/2009-03-18-PolygonsWithHoles.nb?attredirects=0&quot;&gt;Download Mathematica notebook&lt;/a&gt;&lt;/p&gt;</content><link rel='enclosure' type='application/octet-stream' href='http://sites.google.com/site/ragfield/dev/2009-03-18-PolygonsWithHoles.nb?attredirects=0' length='42508'/><link rel='replies' type='application/atom+xml' href='http://dev.ragfield.com/feeds/4615177368161566096/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/7147569507271803579/4615177368161566096' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7147569507271803579/posts/default/4615177368161566096'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7147569507271803579/posts/default/4615177368161566096'/><link rel='alternate' type='text/html' href='http://dev.ragfield.com/2009/03/polygons-with-holes-in-mathematica.html' title='Polygons with holes in Mathematica'/><author><name>Ragfield</name><uri>http://www.blogger.com/profile/12325362017984149251</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='25' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjl1SMlQXOTAV7_F3A5DZg4b2e5eimTTKX9EFIlSIGempd0D7LkUqQQ9cneJqOm9HkcSDncQURdiuKI_uoLJJTJs8hSu7nFDdJ_LNdI1hpdiamXqIc6zPoJtTHCZXpkEA/s220/Ahoy.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://farm4.static.flickr.com/3093/3364724383_b4d2784136_t.jpg" height="72" width="72"/><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7147569507271803579.post-4896657983079568884</id><published>2009-03-17T12:45:00.000-05:00</published><updated>2009-03-18T08:19:27.533-05:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="2D graphics"/><category scheme="http://www.blogger.com/atom/ns#" term="html"/><category scheme="http://www.blogger.com/atom/ns#" term="mac"/><category scheme="http://www.blogger.com/atom/ns#" term="python"/><title type='text'>Use Quartz2D Python bindings to rasterize HTML</title><content type='html'>&lt;p&gt;Since (I believe) &lt;a href=&quot;http://www.apple.com/macosx/&quot;&gt;Mac OS X&lt;/a&gt; 10.2, the CoreGraphics framework (&lt;a href=&quot;http://developer.apple.com/documentation/GraphicsImaging/Conceptual/drawingwithquartz2d/dq_intro/dq_intro.html&quot;&gt;Quartz2D&lt;/a&gt;) has included &lt;a href=&quot;http://developer.apple.com/graphicsimaging/pythonandquartz.html&quot;&gt;incredibly useful bindings&lt;/a&gt; for the &lt;a href=&quot;http://python.org/&quot;&gt;Python&lt;/a&gt; language.  This makes it very easy to test code and to automate graphics related tasks.&lt;/p&gt;

&lt;p&gt;A few days ago a colleague asked if I knew a simple way to automate the creation of image previews of web pages.  In a couple minutes I whipped up a short Python script to do just that.&lt;/p&gt;

&lt;pre&gt;#!/usr/bin/python
import os, sys
from CoreGraphics import *

# what size image should we create?
w = 600
h = 430

# get the input and output file paths
if len(sys.argv) &lt; 3:
	print &#39;usage: %s inputfile.html outputfile.png&#39; % sys.argv[0]
	sys.exit()

input = sys.argv[1]
output = sys.argv[2]

# read the input file
f = open(input)
html = &#39;&#39;.join(f.readlines())
f.close()

# draw the HTML into a Quartz bitmap context then write that image to a PNG file
ctx = CGBitmapContextCreateWithColor(w, h, CGColorSpaceCreateDeviceRGB(), (0, 0, 0, 0))
ctx.drawHTMLTextInRect(CGDataProviderCreateWithString(html), CGRectMake(0, 0, w, h))
ctx.writeToFile(output, kCGImageFormatPNG)&lt;/pre&gt;

&lt;p&gt;&lt;a href=&quot;http://sites.google.com/site/ragfield/dev/2009-03-17-RasterizeHTML.py?attredirects=0&quot;&gt;Download Python script&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Unfortunately, this simple script has a fairly major limitation.  It doesn&#39;t do any network access, so the HTML file and all accompanying resources must be stored somewhere on your file system.&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://dev.ragfield.com/feeds/4896657983079568884/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/7147569507271803579/4896657983079568884' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7147569507271803579/posts/default/4896657983079568884'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7147569507271803579/posts/default/4896657983079568884'/><link rel='alternate' type='text/html' href='http://dev.ragfield.com/2009/03/use-quartz2d-python-bindings-to.html' title='Use Quartz2D Python bindings to rasterize HTML'/><author><name>Ragfield</name><uri>http://www.blogger.com/profile/12325362017984149251</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='25' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjl1SMlQXOTAV7_F3A5DZg4b2e5eimTTKX9EFIlSIGempd0D7LkUqQQ9cneJqOm9HkcSDncQURdiuKI_uoLJJTJs8hSu7nFDdJ_LNdI1hpdiamXqIc6zPoJtTHCZXpkEA/s220/Ahoy.jpg'/></author><thr:total>0</thr:total></entry></feed>