<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
   <channel>
      <title>Benjamin Halsted</title>
      <link>http://benjaminhalsted.com/</link>
      <description>Business owner turned Technical Yahoo!. Life, Flash and the rest of it.</description>
      <language>en</language>
      <copyright>Copyright 2008</copyright>
      <lastBuildDate>Sat, 29 Mar 2008 00:00:01 -0800</lastBuildDate>
      <generator>http://www.sixapart.com/movabletype/?v=3.2ysb5-20051201</generator>
      <docs>http://blogs.law.harvard.edu/tech/rss</docs> 

            <item>
         <title>I&apos;ve got your back.</title>
         <description><![CDATA[<img alt="wow_lvl_45_war.gif" src="http://benjaminhalsted.com/images/wow/wow_lvl_45_war.gif" width="490" height="270" />]]></description>
         <link>http://benjaminhalsted.com/blog/2008/03/ive_got_your_back.html</link>
         <guid>http://benjaminhalsted.com/blog/2008/03/ive_got_your_back.html</guid>
         <category>Fun</category>
         <pubDate>Sat, 29 Mar 2008 00:00:01 -0800</pubDate>
      </item>
            <item>
         <title>@twitter feature request?</title>
         <description><![CDATA[<img alt="twitter_daily_digest.gif" src="http://benjaminhalsted.com/images/fun/twitter_daily_digest.gif" width="425" height="166" />
]]></description>
         <link>http://benjaminhalsted.com/blog/2008/03/twitter_feature_request.html</link>
         <guid>http://benjaminhalsted.com/blog/2008/03/twitter_feature_request.html</guid>
         <category>Life</category>
         <pubDate>Wed, 26 Mar 2008 00:00:01 -0800</pubDate>
      </item>
            <item>
         <title>You know Flash?</title>
         <description><![CDATA[<img alt="whats_flash.gif" src="http://benjaminhalsted.com/images/fun/whats_flash.gif" width="491" height="270" />]]></description>
         <link>http://benjaminhalsted.com/blog/2008/03/you_know_flash.html</link>
         <guid>http://benjaminhalsted.com/blog/2008/03/you_know_flash.html</guid>
         <category>Code</category>
         <pubDate>Sat, 22 Mar 2008 15:19:20 -0800</pubDate>
      </item>
            <item>
         <title>The New Me</title>
         <description><![CDATA[<a href="http://www.gaiaonline.com/profiles/12864172" target="_blank"><img src="http://a2.cdn.gaiaonline.com/gaia/members/ava/ac/4a/76201ae8c44aac_flip.png" border="0"></a>]]></description>
         <link>http://benjaminhalsted.com/blog/2008/03/the_new_me.html</link>
         <guid>http://benjaminhalsted.com/blog/2008/03/the_new_me.html</guid>
         <category>Life</category>
         <pubDate>Fri, 21 Mar 2008 20:44:06 -0800</pubDate>
      </item>
            <item>
         <title>C++ and Spirit</title>
         <description><![CDATA[<p>So I've been busy doing taxes, getting over my cold, and refreshing my C++. As part of the C++ refreshing I was using <a title="Antlr" href="http://antlr.org/">Antlr</a> and some STL libraries. While looking at the STL libs I also went to look at <a title="Boost" href="http://boost.org/">Boost</a>, only to find <a title="Spirit" href="http://spirit.sourceforge.net/">Spirit</a>, a C++ recursive descent parser. I haven't looked at it much, but I'm going to re-do the first couple examples using it, and compare them to the Antlr versions. It may be better suited for what I'm doing since Antlr 3 doesn't have a (working?) C++ output. I know already that if I switch, I'm going to miss AntlrWorks. ;-) </p>]]></description>
         <link>http://benjaminhalsted.com/blog/2008/02/c_and_spirit.html</link>
         <guid>http://benjaminhalsted.com/blog/2008/02/c_and_spirit.html</guid>
         <category>Code</category>
         <pubDate>Mon, 25 Feb 2008 07:25:59 -0800</pubDate>
      </item>
            <item>
         <title>Antl3 actions in C</title>
         <description><![CDATA[<p>I started working with rule actions in Antlr 3 + C (A3C). In section 3.2 of the book Terence adds an action to load a stored value from a recognized ID. I decided to keep it simple and just print out some information for that recognized ID. My action grammar:<br /></p><p>atom returns [int value]<br /></p><p>&nbsp;&nbsp;&nbsp; :&nbsp;&nbsp;&nbsp; INT<br />&nbsp;&nbsp;&nbsp; |&nbsp;&nbsp;&nbsp; ID<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; {<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; printf(&quot;Position: \%d\nToken Index: \%d\nText: \%s\n&quot;, $ID.pos, $ID.index, $ID.text-&gt;chars);<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<br />&nbsp;&nbsp;&nbsp; |&nbsp;&nbsp;&nbsp; '(' expr ')'</p><p>As you can see, the rule for atom is looking for ID which is defined as ('a'..'z'|'A'..'Z')+. When it finds this alphabetic string it's going to print out the position of where it appeared on the line, its index and the value of the token (the matched text).</p><p>The action token ID.text is very similar to the Java equivalent, the difference being that it is a struct and to get to the characters you have to use the struct's chars variable. You can find the struct defined in antlr3string.h. <br /></p><p>There are a couple of other properties that you can use off of the token variables. Other than .text, you can use: (this is mostly for my own reference). ;-)<br /></p><ul><li>type</li><li>line</li><li>pos</li><li>channel</li><li>index</li><li>tree</li></ul>TTFN!<br />&nbsp;]]></description>
         <link>http://benjaminhalsted.com/blog/2008/02/antl3_actions_in_c.html</link>
         <guid>http://benjaminhalsted.com/blog/2008/02/antl3_actions_in_c.html</guid>
         <category>Code</category>
         <pubDate>Tue, 12 Feb 2008 08:22:05 -0800</pubDate>
      </item>
            <item>
         <title>Y! Q2/07 Hack Day</title>
         <description><![CDATA[<p>Today Yahoo! released the <a href="http://developer.yahoo.com/flash/maps" title="AS3 maps API">AS3 version</a> of their maps API. They also released the <a title="AS3 Maps: Flick-able and Spinnable" href="http://www.yswfblog.com/blog/2008/02/11/as3-maps-flick-able-and-spinnable/">hack</a> that Jon and I worked on back in Q2. Check it out, and if you don't have Flash9 and refuse to upgrade, you can try spinning and flicking your iPhone to simulate it*. You almost get the same effect.<br /></p><p>*You assume full responsibility for any damages done to your iPhone.&nbsp;</p>]]></description>
         <link>http://benjaminhalsted.com/blog/2008/02/y_q207_hack_day.html</link>
         <guid>http://benjaminhalsted.com/blog/2008/02/y_q207_hack_day.html</guid>
         <category>Code</category>
         <pubDate>Mon, 11 Feb 2008 20:49:38 -0800</pubDate>
      </item>
            <item>
         <title>Antlr3 + generated C + OSX</title>
         <description><![CDATA[<p>I've been a fan of Antlr for a while now. I've used it to generate intrinsic classes for ActionScript2 so that our team could build an incremental compiler. I just bought the Antlr3 <a href="http://pragprog.com/titles/tpantlr" target="_blank" title="The Definitive ANTLR Reference">book</a> (in PDF format) and have been going through the examples as I reach them. <br /></p><p>As I went through the book I decided that I wanted to combine learning Antlr with my recent LLVM fascination. LLVM is in C/C++ so I decided to use the 'C' output language option in Antlr. I haven't found any documentation on line on how to use the C API, but through some trials I've ported the first example in the book to C. <br /></p><p>The first big trial that I faced was that XCode defaults to C++ mode, which is fine for compiling C code as long as you use the right decorations. Some of the Antlr3C support lib uses 'or' which the preprocessor converts to '||'. I spent a day and found that you can disable this by using the '-fno-operator-names' compiler flag.</p><p>Most of the code is very similar to the Java version. The second problem I ran into is when you try to connect the dots between creating the lexer and the parser. In Java you just create a CommonTokenStream and pass the lexer into its constructor. In the C version you have to drill down the nested structs to find the token stream. It's not hard to find, it just takes way to long to drill down through the files.<br /></p>extern &quot;C&quot; {<br />#import &lt;antlr3.h&gt;<br />#import &quot;ExprLexer.h&quot;<br />#import &quot;ExprParser.h&quot;<br />}<br /><br />int main (int argc, char * const argv[]) {<br />&nbsp;&nbsp;&nbsp; if(argc != 2) {<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; printf(&quot;Which file do you want to parse?&quot;);<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; return 0;<br />&nbsp;&nbsp;&nbsp; }<br />&nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp; pANTLR3_INPUT_STREAM pInputStream = antlr3AsciiFileStreamNew((pANTLR3_UINT8)argv[1]);<br />&nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp; pExprLexer exprLex = ExprLexerNew(pInputStream);<br />&nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp; pANTLR3_COMMON_TOKEN_STREAM pTokenStream = antlr3CommonTokenStreamSourceNew(0, exprLex-&gt;pLexer-&gt;tokSource);<br />&nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp; pExprParser exprPar&nbsp; = ExprParserNew(pTokenStream);<br />&nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp; exprPar-&gt;prog(exprPar);<br />&nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp; return 0;<br />}]]></description>
         <link>http://benjaminhalsted.com/blog/2008/02/antlr3_generated_c_osx.html</link>
         <guid>http://benjaminhalsted.com/blog/2008/02/antlr3_generated_c_osx.html</guid>
         <category>Code</category>
         <pubDate>Mon, 11 Feb 2008 18:57:52 -0800</pubDate>
      </item>
            <item>
         <title>Smack The Server</title>
         <description><![CDATA[<p>One of the blogs that my wife reads (<a href="http://www.yarnharlot.ca/blog/archives/2007/11/09/one_for_the_geeks.html" target="_blank" title="The Yarn Harlot">The Yarn Harlot</a>) had a post recently about wanting to smack her server. So I spend 30 minutes and put together a stress reliever:<br /></p><p><a href="http://fullofstitches.com/smack_my_server/" target="_blank" title="Smack The Server">http://fullofstitches.com/smack_my_server/</a></p><p>Enjoy!&nbsp;</p>]]></description>
         <link>http://benjaminhalsted.com/blog/2007/11/smack_the_server.html</link>
         <guid>http://benjaminhalsted.com/blog/2007/11/smack_the_server.html</guid>
         <category>Life</category>
         <pubDate>Sat, 10 Nov 2007 20:51:11 -0800</pubDate>
      </item>
            <item>
         <title>Romance</title>
         <description><![CDATA[<p>Last night my wife and I were sitting on the couch. I was sprawled across it with my head in her lap and she was running her fingers through my hair. We were talking about the days activities and her focus changes to something in my hair. I watch her eyes, curiosity peaks and I ask her, &quot;What is it dear?&quot;. She replies, &quot;Your scalp, didn't your hair used to be thicker here?&quot;</p>]]></description>
         <link>http://benjaminhalsted.com/blog/2007/11/romance.html</link>
         <guid>http://benjaminhalsted.com/blog/2007/11/romance.html</guid>
         <category>Life</category>
         <pubDate>Tue, 06 Nov 2007 06:55:52 -0800</pubDate>
      </item>
            <item>
         <title>Wife went and runnoft</title>
         <description><![CDATA[<p>I had been working crazy hours this past month so I've encouraged my Wife to go to a couple of Church events to interact with adults. Right now she's off at a womens retreat, so I've got the kids for the weekend.<br /> </p><p>Today at about noon the kids and I walked around the local shopping area and later went out to dinner. At home we just lounged around, usually with one of the girls flopped accross me. At one point B (my 3 yr old girl) went and played with one of her dolls saying, &quot;Daddy, you're home!&quot; over and over again. She has another one dressed up like C (my 9 month old girl) and has her in bed with her right now.</p><p>I feel like watching a movie or something, but I need to get up for Church in the morning. TTFN.&nbsp;</p>]]></description>
         <link>http://benjaminhalsted.com/blog/2007/11/wife_went_and_runnoft.html</link>
         <guid>http://benjaminhalsted.com/blog/2007/11/wife_went_and_runnoft.html</guid>
         <category>Life</category>
         <pubDate>Sat, 03 Nov 2007 23:07:34 -0800</pubDate>
      </item>
            <item>
         <title>Seaside -- Bobbing</title>
         <description><![CDATA[<p>Well, I made it to the end of chapter four. I'd have gone on but <a href="http://www.swa.hpi.uni-potsdam.de" target="_blank">www.swa.hpi.uni-potsdam.de</a> seems to have died for the moment. The tutorial is writtem for Squeak which means that those of us running VisualWorks get to <strike>debug</strike> learn more. </p><p>Some of the subtle differences betwen Squeak and VisualWorks crop up. The Date objects in Squeak have a 'yesterday' and 'tomorrow' versus the Date object in VisualWorks which has a 'today' which you can add and subtract days from. OrderedCollections are different enough to make you go look up function names. </p><p>Hopefully the server comes back up so I can finish the other 6 chapters. KTHNXBAI!&nbsp;</p>]]></description>
         <link>http://benjaminhalsted.com/blog/2007/11/seaside_bobbing.html</link>
         <guid>http://benjaminhalsted.com/blog/2007/11/seaside_bobbing.html</guid>
         <category>Code</category>
         <pubDate>Sat, 03 Nov 2007 22:37:45 -0800</pubDate>
      </item>
            <item>
         <title>Seaside -- Sink or Swim</title>
         <description><![CDATA[<p>On their site they have a couple of examples, the 'easiest' is a counter. I have no idea how to replicate that in VisualWorks/Seaside. This is my first VisualWorks/Seaside app. Lets see how well it goes.</p><p>I've found a neat tutorial: http://www.swa.hpi.uni-potsdam.de/seaside/tutorial</p><p>Hopefully it explains some things. It seems objects have an odd lifespan. :-S&nbsp;</p>]]></description>
         <link>http://benjaminhalsted.com/blog/2007/11/seaside_sink_or_swim.html</link>
         <guid>http://benjaminhalsted.com/blog/2007/11/seaside_sink_or_swim.html</guid>
         <category>Code</category>
         <pubDate>Fri, 02 Nov 2007 18:00:33 -0800</pubDate>
      </item>
            <item>
         <title>Seaside -- Getting Wet</title>
         <description><![CDATA[<p>So last week I installed VisualWorks. Tonight I installed <a href="http://seaside.st/" target="_blank" title="SeaSide Home Page">Seaside</a> on it. All I had to do to install it was open up the StORE and select the latest SeasideForWebToolkit version and select &quot;Load&quot;. Towards the end it asked me a couple questions (admin id and password) then it was done. </p><p>Now I'm off to make my first Seaside app. TTFN<br /></p>]]></description>
         <link>http://benjaminhalsted.com/blog/2007/11/seaside_getting_wet.html</link>
         <guid>http://benjaminhalsted.com/blog/2007/11/seaside_getting_wet.html</guid>
         <category>Code</category>
         <pubDate>Fri, 02 Nov 2007 17:53:29 -0800</pubDate>
      </item>
            <item>
         <title>VisualWorks -- First Steps</title>
         <description><![CDATA[<p>Early this past week I installed VisualWorks (NonCommercial) to play with. I've used Dolphin Smalltalk before and liked how the system works. </p><p>Installing VisualWorks was easy enough, I filled out the form and was given access to the downloads page. The net installer didn't work so I used the CD ISO download (10 minute download on the cable modem). </p><p>I've been pleasantly suprised at the StORE that is in VisualWorks. If Dolphin Smalltalk had that sort of repository I couldn't imagine moving away from it. Dolphin is Win32 only and doesn't seem to have the repository. Ah well, I might see a VisualWorks purchase in my future.<br /></p>]]></description>
         <link>http://benjaminhalsted.com/blog/2007/11/seaside_first_steps.html</link>
         <guid>http://benjaminhalsted.com/blog/2007/11/seaside_first_steps.html</guid>
         <category>Code</category>
         <pubDate>Fri, 02 Nov 2007 17:44:29 -0800</pubDate>
      </item>
      
   </channel>
</rss>
