<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Eureka Man &#187; Coding</title>
	<atom:link href="http://eurekaman.com/category/coding/feed" rel="self" type="application/rss+xml" />
	<link>http://eurekaman.com</link>
	<description>Pure Gold</description>
	<lastBuildDate>Mon, 28 Jun 2010 05:38:49 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Paul Graham&#8217;s new compiler</title>
		<link>http://eurekaman.com/paul-grahams-new-compiler</link>
		<comments>http://eurekaman.com/paul-grahams-new-compiler#comments</comments>
		<pubDate>Mon, 26 Mar 2007 09:39:07 +0000</pubDate>
		<dc:creator>Eureka Man</dc:creator>
				<category><![CDATA[Business]]></category>
		<category><![CDATA[Coding]]></category>
		<category><![CDATA[Ideas]]></category>
		<category><![CDATA[Meta-Ideas]]></category>

		<guid isPermaLink="false">http://eurekaman.com/57</guid>
		<description><![CDATA[At Startup School, Paul Graham told us of Y Combinator&#8217;s new policy for funding teams:

Photo by ybboey
If you don&#8217;t have a good idea, no problem, he&#8217;ll give you one &#8211; as long as you&#8217;re awesome.  Oh to be Paul Graham.  To have teams of shit hot coders fighting to be accepted by you [...]]]></description>
			<content:encoded><![CDATA[<p>At <a href="http://startupschool.org/">Startup School</a>, Paul Graham told us of <a href="http://www.ycombinator.com/">Y Combinator</a>&#8217;s new policy for funding teams:</p>
<p><a href="http://flickr.com/photos/biao/433305036/" title="Photo Sharing"><img src="http://farm1.static.flickr.com/160/433305036_1af6752d12.jpg" width="500" height="375" alt="03-10-07_2243.jpg" /></a><br/><br />
Photo by <a href="http://www.flickr.com/people/biao/">ybboey</a></p>
<p>If you don&#8217;t have a good idea, no problem, he&#8217;ll give you one &#8211; as long as you&#8217;re awesome.  Oh to be Paul Graham.  To have teams of shit hot coders fighting to be accepted by you so that they can work on your idea <a href="http://ycombinator.com/faq.html">all summer, for minimum wage</a>.  He has created the world&#8217;s first <a href="http://en.wikipedia.org/wiki/Natural_language">ultra-high-level</a> compiler. I&#8217;m being disingenuous of course.  This compiler has (at least two) minds of it&#8217;s own, and Paul doesn&#8217;t really mind if it doesn&#8217;t do what he asks just as long as there&#8217;s a fair chance it will make him some money.</p>
<p>Here&#8217;s his full pres:<br />
<embed style="width:400px; height:326px;" id="VideoPlayback" type="application/x-shockwave-flash" src="http://video.google.com/googleplayer.swf?docId=-8113251929727785438&#038;hl=en" flashvars=""> </embed></p>
]]></content:encoded>
			<wfw:commentRss>http://eurekaman.com/paul-grahams-new-compiler/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>For all the Prolog kids</title>
		<link>http://eurekaman.com/for-all-the-prolog-kids</link>
		<comments>http://eurekaman.com/for-all-the-prolog-kids#comments</comments>
		<pubDate>Thu, 08 Feb 2007 02:51:10 +0000</pubDate>
		<dc:creator>Eureka Man</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[Practical]]></category>
		<category><![CDATA[Prolog]]></category>
		<category><![CDATA[Quick Links]]></category>
		<category><![CDATA[Search]]></category>

		<guid isPermaLink="false">http://eurekaman.com/for-all-the-prolog-kids</guid>
		<description><![CDATA[Anyone&#8230;&#8230;&#8230;..?  Anyway, gotapi.com now has Prolog docs, thanks to me.
]]></description>
			<content:encoded><![CDATA[<p>Anyone&#8230;&#8230;&#8230;..?  Anyway, <a href="http://gotapi.com/">gotapi.com</a> now has Prolog docs, thanks to me.</p>
]]></content:encoded>
			<wfw:commentRss>http://eurekaman.com/for-all-the-prolog-kids/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Towards multi-touch in the browser</title>
		<link>http://eurekaman.com/towards-multi-touch-in-the-browser</link>
		<comments>http://eurekaman.com/towards-multi-touch-in-the-browser#comments</comments>
		<pubDate>Wed, 31 Jan 2007 06:49:24 +0000</pubDate>
		<dc:creator>Eureka Man</dc:creator>
				<category><![CDATA[Apple]]></category>
		<category><![CDATA[Coding]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Net]]></category>
		<category><![CDATA[Standards]]></category>
		<category><![CDATA[UI]]></category>
		<category><![CDATA[Web Apps]]></category>

		<guid isPermaLink="false">http://eurekaman.com/towards-multi-touch-in-the-browser</guid>
		<description><![CDATA[
If, as it seems, the iPhone&#8217;s software will all come from Apple then all the development fun will happen in the browser, in particular in whatever version of Safari the shiny little device ships with.  And it will be fun if Apple give us, as developers, access the right information.  I&#8217;m talking here [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.flickr.com/photos/r0wb0t/375204485/" title="Photo Sharing"><img src="http://farm1.static.flickr.com/179/375204485_183305155c_o.png" width="359" height="65" alt="But will it have a breakthough event API?" /></a></p>
<p>If, as it seems, the <a href="http://www.apple.com/iphone/">iPhone&#8217;s</a> software will all come from Apple then all the development fun will happen in the browser, in particular in whatever version of Safari the shiny little device ships with.  And it <em>will</em> be fun if Apple give us, as developers, access the right information.  I&#8217;m talking here about that information coming from the user&#8217;s fingers.  After all, who wouldn&#8217;t want to create the kind of effortlessly intuitive interfaces the <a href="http://www.ted.com/tedtalks/tedtalksplayer.cfm?key=j_han">Jeff Han</a> showed off in his TED talk?</p>
<p>Will they let us though?  There are a few directions Apple could go here.</p>
<ol>
<li>Be scrooges and filter out multiple touches before they get to us, only letting the user interact with web pages one finger at a time, the others controlling scrolling probably.  <strong>Web Dev Chorus: Booooo!</strong></li>
<li>Give us the raw events from all touches but leave it up to us to do the hard lifting of working out which <code>mousedown</code>/<code>mousemove</code>/<code>mouseup</code> events came from the same finger. <strong>Web Dev Chorus: Grumble, Grumble, even huger javascript libraries, Grumble</strong></li>
<li>Generously preprocess the input data for us and label <code>mouse*</code> Events with unique &#8220;device&#8221; identifier.  <strong>Web Dev Chorus: Yaaay!! Go Apple!</strong></li>
</ol>
<p>The iPhone <a href="http://pogue.blogs.nytimes.com/2007/01/13/ultimate-iphone-faqs-list-part-2/">definitely has javascript</a> (and may have flash), but that&#8217;s not enough.  Javascript&#8217;s current way of getting information from pointing devices like a mouse, what&#8217;s called the DOM API, has no way of distinguishing between clicks from multiple sources (nor does Flash for that matter).  Neither <a href="http://www.w3.org/TR/DOM-Level-3-Events/">DOM 3</a> nor <a href="http://www.whatwg.org/specs/web-apps/current-work/#events">Web Apps 1.0</a> has added any properties to the event object to deal with multiple pointing devices.  At a minimum it would be nice to standardize on a new field of the event object that uniquely identifies the input device for the duration of a <code>mousedown</code>/<code>mousemove</code>/<code>mouseup</code> cycle.</p>
<p>I would imagine Apple will not be that pushed to let javascript know about multi-touch.  It will only detract from their own installed apps and introduce potentially low standard interfaces that would nonetheless be associated with their brand.  However the problem will certainly come to the fore as other companies follow Apple into the multi-touch field.  We might as well think about what we&#8217;d like now.</p>
<p><strong>Update:</strong> <a href="http://lists.whatwg.org/pipermail/whatwg-whatwg.org/2007-January/009213.html">Dave Hyatt from the Safari team replies&#8230;</a></p>
<blockquote><p>I&#8217;ll have much more to say about this in the coming months.</p></blockquote>
<p>&#8230;which makes me cautiously optimistic.  It must be pretty exciting to be him right now.</p>
]]></content:encoded>
			<wfw:commentRss>http://eurekaman.com/towards-multi-touch-in-the-browser/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Commenting Ruby in Xcode</title>
		<link>http://eurekaman.com/commenting-ruby-in-xcode</link>
		<comments>http://eurekaman.com/commenting-ruby-in-xcode#comments</comments>
		<pubDate>Sat, 09 Dec 2006 06:34:02 +0000</pubDate>
		<dc:creator>Eureka Man</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[Ruby]]></category>

		<guid isPermaLink="false">http://eurekaman.com/commenting-ruby-in-xcode</guid>
		<description><![CDATA[UPDATE: The new TextWrangler 2.2 has Ruby highlighting. Yay!
Coding Ruby in Xcode on a Mac?  Like the built-in syntax highlighting but wondering why the apple+/ shortcut makes C comments, not Ruby comments?  The following might save you a few minutes digging.
Find and open this file:
/Library
  /Application&#160;Support
    /Apple
   [...]]]></description>
			<content:encoded><![CDATA[<blockquote><p><strong>UPDATE:</strong> The new <a href="http://www.barebones.com/products/textwrangler/">TextWrangler 2.2</a> has Ruby highlighting. Yay!</p></blockquote>
<p>Coding Ruby in Xcode on a Mac?  Like the built-in syntax highlighting but wondering why the apple+/ shortcut makes C comments, not Ruby comments?  The following might save you a few minutes digging.</p>
<p>Find and open this file:</p>
<pre>/Library
  /Application&nbsp;Support
    /Apple
      /Developer&nbsp;Tools
        /Scripts
          /10-User Scripts
            /30-Comments
              /10-un_commentLines.pl</pre>
<p>Replace this...</p>
<div class="igBar"><span id="lperl-3"><a href="#" onclick="javascript:showPlainTxt('perl-3'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">PERL:</span>
<div id="perl-3">
<div class="perl">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;"># determine the type of file we have by looking for the #! line at the top</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;"># careful--it might already be commented out!</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$commentString</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$fileString</span> =~ <a href="http://www.perldoc.com/perl5.6/pod/func/m.html"><span style="color: #000066;">m</span></a>!^<span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$perlCmt</span>|<span style="color: #0000ff;">$cCmt</span><span style="color: #66cc66;">&#41;</span>?<span style="color: #808080; font-style: italic;">#\!\s*.*?/perl|^($perlCmt|$cCmt)?#\!\s*.*?/sh!) {</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #0000ff;">$commentString</span> = <span style="color: #0000ff;">$perlCmt</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #0000ff;">$commentString</span> = <span style="color: #0000ff;">$cCmt</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#125;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>...with this...</p>
<div class="igBar"><span id="lperl-4"><a href="#" onclick="javascript:showPlainTxt('perl-4'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">PERL:</span>
<div id="perl-4">
<div class="perl">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$fileName</span> = <span style="color: #ff0000;">"%%%{PBXFilePath}%%%"</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;"># determine the type of file we have by looking for the #! line at the top</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;"># careful--it might already be commented out!</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;"># Otherwise look at the file extension</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$commentString</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$fileString</span> =~ <a href="http://www.perldoc.com/perl5.6/pod/func/m.html"><span style="color: #000066;">m</span></a>!^<span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$perlCmt</span>|<span style="color: #0000ff;">$cCmt</span><span style="color: #66cc66;">&#41;</span>?<span style="color: #808080; font-style: italic;">#\!\s*.*?/perl|^($perlCmt|$cCmt)?#\!\s*.*?/sh!</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">||&nbsp; <span style="color: #0000ff;">$fileName</span> =~ <a href="http://www.perldoc.com/perl5.6/pod/func/m.html"><span style="color: #000066;">m</span></a>!\.<span style="color: #66cc66;">&#40;</span>rb|pl|sh<span style="color: #66cc66;">&#41;</span>$!<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #0000ff;">$commentString</span> = <span style="color: #0000ff;">$perlCmt</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #0000ff;">$commentString</span> = <span style="color: #0000ff;">$cCmt</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#125;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Restart Xcode.  Now commenting should work properly.</p>
]]></content:encoded>
			<wfw:commentRss>http://eurekaman.com/commenting-ruby-in-xcode/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Where&#8217;s my negation?</title>
		<link>http://eurekaman.com/wheres-my-negation</link>
		<comments>http://eurekaman.com/wheres-my-negation#comments</comments>
		<pubDate>Sun, 26 Nov 2006 05:35:48 +0000</pubDate>
		<dc:creator>Eureka Man</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[Questions]]></category>
		<category><![CDATA[Regular Expressions]]></category>

		<guid isPermaLink="false">http://eurekaman.com/wheres-my-negation</guid>
		<description><![CDATA[Anybody interested in a programming puzzle? Des? Warning: This post is full of seemingly incomprehensible strings of symbols that programmers call regular expressions, which actually do something very useful.  If that doesn't turn you on, better to quit now.  If you're still here, consider this...
Have you ever wondered why programming languages that have [...]]]></description>
			<content:encoded><![CDATA[<p>Anybody interested in a programming puzzle? <a href="http://www.destraynor.com/serendipity/index.php?/archives/104-Programming-Puzzle-2-Steve-Returns.html">Des</a>? Warning: This post is full of seemingly incomprehensible strings of symbols that programmers call regular expressions, which actually do something very useful.  If that doesn't turn you on, better to quit now.  If you're still here, consider this...</p>
<p>Have you ever wondered why programming languages that have good regular expression support (Perl, Javascript, Ruby, etc.) nevertheless omit syntax for negation or conjunction within regexes?   I'm sure there must be a good reason for this.  Has it been found that people just don't intuitively get what negation does to a regex?  Are language  designers unwilling to complicate their syntax?  Are they avoiding the processing it takes to complement or intersect finite state machines?  They do compile to finite state machines, right?</p>
<p>Let me give you an example of where negation would be useful.  Say I'm scanning through some text for some sub-sections which have been explicitly quoted.  If the delimiting characters are angle brackets then I can write <code>/<([^>]*)>/</code>.  The bit in the middle <code>[^>]</code> matches any character which is not a '<code>></code>'.  This is a limited form of negation on a single character.  Taken as a whole the expression says: Find me the strings of non-'<code>></code>' characters which are surrounded by a '<code><</code>' on the left and a '<code>></code>' on the right.  So far so good.</p>
<p>But what if the sub-sections I'm interested in are bounded by multi-character strings? '<code><<<</code>' and '<code>>>></code>' for argument's sake.  In analogy to the example above I want to be able to write <code>/<<<(?^.*>>>.*)>>>/</code>.  I've invented some syntax for negation here: (?^R) means match anything that the regex R doesn't match.  The R in my example (<code>.*>>>.*</code>) matches any string that contains the sequence '<code>>>></code>' so the expression as a whole says: Find me the strings that do not contain '<code>>>></code>' that are bordered by '<code><<<</code>' on the left and '<code>>>></code>' on the right.   Now, in this example, the same can be accomplished with a "lazy star" (if your programming language supports that) which just makes the regex non-greedy within the bounding strings: <code>/<<<(.*?)>>>/</code>.  But I would much rather state the patterns I'm looking for declaratively than change the ambiguity-resolution mechanism of the processor.  Why can't I?</p>
<p>Any <a href="http://www.xrce.xerox.com/competencies/content-analysis/fsCompiler/fssyntax.html#tilde">finite-state toolkit</a> with regex support has syntax for negation and conjunction.  Do you know of any programming languages that do?  If not, why not?</p>
]]></content:encoded>
			<wfw:commentRss>http://eurekaman.com/wheres-my-negation/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
