<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title>Disqus - Latest Comments for steveharris</title><link>http://disqus.com/by/steveharris/</link><description></description><atom:link href="http://disqus.com/steveharris/comments.rss" rel="self"></atom:link><language>en</language><lastBuildDate>Thu, 17 Jan 2008 14:27:18 -0000</lastBuildDate><item><title>Re: Implementing a great final project</title><link>http://e168f07.7fff.com/2007/12/22/implementing-a-great-final-project/#comment-83819</link><description>&lt;p&gt;I'm deploying the RESTful acts_as_authenticated, which (if I'm understanding what I'm seeing) uses a cookie.&lt;/p&gt;&lt;p&gt;I'm following Alameda's example (chapter 6) -- in his controllers, he restricts every request to only the records "owned" by the current_user, e.g.:&lt;/p&gt;&lt;p&gt;  def index&lt;br&gt;    exercises = current_user.exercises.find(:all)&lt;br&gt;    ...&lt;br&gt;  end&lt;/p&gt;&lt;p&gt;But this appears to violate the REST statelessness principle.&lt;/p&gt;&lt;p&gt;Sigh.  Back to the drawing board...&lt;/p&gt;&lt;p&gt;- Steve&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">steveharris</dc:creator><pubDate>Thu, 17 Jan 2008 14:27:18 -0000</pubDate></item><item><title>Re: Assignment 4; due Nov. 11</title><link>http://e168f07.7fff.com/assignments/assignment-4/#comment-7543</link><description>&lt;p&gt;fta ???&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">steveharris</dc:creator><pubDate>Fri, 02 Nov 2007 09:57:33 -0000</pubDate></item><item><title>Re: Assignment 4; due Nov. 11</title><link>http://e168f07.7fff.com/assignments/assignment-4/#comment-7286</link><description>&lt;p&gt;For the quiz:&lt;/p&gt;&lt;p&gt;- you just want us to fill out the table and email it to you?  &lt;br&gt;- as an attachment?  in the body?&lt;br&gt;- if, for a given line, the foreign key is in standard Rails format, just leave that column blank?&lt;br&gt;- ok to abbreviate "habtm"?&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">steveharris</dc:creator><pubDate>Thu, 01 Nov 2007 17:00:12 -0000</pubDate></item><item><title>Re: Your one-liners?</title><link>http://e168f07.7fff.com/2007/10/24/your-one-liners/#comment-7215</link><description>&lt;p&gt;Proposed 1-liner:&lt;/p&gt;&lt;p&gt;Hash#invert returns a new hash where the keys of the new hash are the values of the old hash, and vice-versa.  If the original hash contains multiple keys that map to the same value, the new hash will contain a single entry for that value (now the new key) and which of the original keys becomes the new value is not predictable.&lt;/p&gt;&lt;p&gt;Write a one-liner which inverts a hash, but where each value in the new hash is an array containing all the keys of the original hash.&lt;/p&gt;&lt;p&gt;Now, write a one-liner like the above, but if there is only one (new) value, it should be a simple value, not an array.&lt;/p&gt;&lt;p&gt;- Steve&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">steveharris</dc:creator><pubDate>Thu, 01 Nov 2007 11:26:09 -0000</pubDate></item><item><title>Re: D&amp;#8217;oh! My numlock issue was . . .</title><link>http://e168f07.7fff.com/2007/10/17/doh-my-numlock-issue-was/#comment-5521</link><description>&lt;p&gt;Nope.  When you go to disqus and enter text into their input box, they preview it for you -- in the preview (and on their site) the backslashes appear, but here they are clobbered.&lt;/p&gt;&lt;p&gt;PS:  Any special plans for Halloween lecture?&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">steveharris</dc:creator><pubDate>Thu, 18 Oct 2007 13:47:41 -0000</pubDate></item><item><title>Re: D&amp;#8217;oh! My numlock issue was . . .</title><link>http://e168f07.7fff.com/2007/10/17/doh-my-numlock-issue-was/#comment-5520</link><description>&lt;p&gt;I'm trying one more time, but this time I'm posting from &lt;a href="http://e168f07.disqus.com/" rel="nofollow noopener" target="_blank" title="http://e168f07.disqus.com/"&gt;http://e168f07.disqus.com/&lt;/a&gt; (rather than &lt;a href="http://e168f07.7fff.com/)" rel="nofollow noopener" target="_blank" title="http://e168f07.7fff.com/)"&gt;http://e168f07.7fff.com/)&lt;/a&gt; -- I hope the backslashes will be preserved this way.&lt;/p&gt;&lt;p&gt;Here's the regex in extended format:&lt;/p&gt;&lt;p&gt;regex = /&lt;br&gt;\b([aeiou]) # vowel at start of word&lt;br&gt;| # or&lt;br&gt;([^aeiouq])(u)\B # non-(vowel-or-q) followed by 'u' (not at end of word)&lt;br&gt;| # or&lt;br&gt;([^aeio]|qu)([aeio])\B # non-vowel or 'qu' followed by (non-u) vowel (not at end of word)&lt;br&gt;/ix&lt;/p&gt;&lt;p&gt;And here it is in a single line (paste into irb):&lt;/p&gt;&lt;p&gt;regex=/\b([aeiou])|([^aeiouq])(u)\B|([^aeio]|qu)([aeio])\B/i&lt;/p&gt;&lt;p&gt;t = "did you know that if you mix equal parts of gasoline and frozen orange juice concentrate you can make napalm"&lt;/p&gt;&lt;p&gt;t.gsub(regex){ ($2||$4||"") + "UB" + ($1||$3||$5) }&lt;/p&gt;&lt;p&gt;&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">steveharris</dc:creator><pubDate>Thu, 18 Oct 2007 13:43:50 -0000</pubDate></item><item><title>Re: D&amp;#8217;oh! My numlock issue was . . .</title><link>http://e168f07.7fff.com/2007/10/17/doh-my-numlock-issue-was/#comment-5516</link><description>&lt;p&gt;Drat.  all the backslash chars have been ripped out.  Here's the one-liner again, but replace each Z with a back-slash:&lt;/p&gt;&lt;p&gt;regex=/Zb([aeiou])|([^aeiouq])(u)ZB|([^aeio]|qu)([aeio])ZB/i&lt;/p&gt;&lt;p&gt;&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">steveharris</dc:creator><pubDate>Thu, 18 Oct 2007 13:35:45 -0000</pubDate></item><item><title>Re: D&amp;#8217;oh! My numlock issue was . . .</title><link>http://e168f07.7fff.com/2007/10/17/doh-my-numlock-issue-was/#comment-5513</link><description>&lt;p&gt;New subject: regex for ubbi dubbi&lt;/p&gt;&lt;p&gt;(I originally posted this as a "Start New Topic" on &lt;a href="http://e168f07.disqus.com/" rel="nofollow noopener" target="_blank" title="http://e168f07.disqus.com/"&gt;http://e168f07.disqus.com/&lt;/a&gt;, and it appeared there, but it never showed up here or on any RSS feed, so I am postin it again).&lt;/p&gt;&lt;p&gt;# Here's a regex and gsub for doing ubbi dubbi transformations.&lt;br&gt;#&lt;br&gt;# Features:&lt;br&gt;# - only inserts UB before first of a sequence of vowels&lt;br&gt;# - does not insert UB before single final vowel (silent vowel)&lt;br&gt;# - does not insert UB between 'q' and 'u'&lt;br&gt;# - inserts upper-case UB for readability&lt;br&gt;#&lt;br&gt;# Here's the regex in "extended" notation (sigh -- the in-line comments should all be indented so they line up, but when I enter them into this blog comment system, all the spaces are squeezed out -- use your imagination!)&lt;/p&gt;&lt;p&gt;regex = /&lt;br&gt;\b([aeiou]) # vowel at start of word&lt;br&gt;| # or&lt;br&gt;([^aeiouq])(u)\B # non-(vowel-or-q) followed by 'u' (not at end of word)&lt;br&gt;| # or&lt;br&gt;([^aeio]|qu)([aeio])\B # non-vowel or 'qu' followed by (non-u) vowel (not at end of word)&lt;br&gt;/ix&lt;/p&gt;&lt;p&gt;# here's the same regex in one line (easier to paste into irb):&lt;/p&gt;&lt;p&gt;regex=/\b([aeiou])|([^aeiouq])(u)\B|([^aeio]|qu)([aeio])\B/i&lt;/p&gt;&lt;p&gt;# and here's the string and the gsub:&lt;/p&gt;&lt;p&gt;t = "did you know that if you mix equal parts of gasoline and frozen orange juice concentrate you can make napalm"&lt;/p&gt;&lt;p&gt;t.gsub(regex){ ($2||$4||"") + "UB" + ($1||$3||$5) }&lt;/p&gt;&lt;p&gt;# explanation: ($2||$4||"")&lt;br&gt;#&lt;br&gt;# $2 refers to whatever was matched by the 2nd paren group of the regex. If the match did not involve the 2nd paren group (e.g., if it was a match for a vowel at the start of a word), then $2 is nil.&lt;br&gt;#&lt;br&gt;# So, the chain of logical short-circuit ORs will return either:&lt;br&gt;#&lt;br&gt;# - $2 -- the non-(vowel-or-q) that preceded a 'u'&lt;br&gt;# - $4 -- the non-vowel-or-qu that preceded a (non-u) vowel&lt;br&gt;# - "" (the empty string)&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">steveharris</dc:creator><pubDate>Thu, 18 Oct 2007 13:30:28 -0000</pubDate></item><item><title>Re: Instances of the class Class</title><link>http://e168f07.7fff.com/2007/10/13/instances-of-the-class-class/#comment-5278</link><description>&lt;p&gt;I don't recall exactly, late yesterday afternoon.  My post appeared almost immediately, both on &lt;a href="http://e168f07.disqus.com" rel="nofollow noopener" target="_blank" title="e168f07.disqus.com"&gt;e168f07.disqus.com&lt;/a&gt; and on &lt;a href="http://e168f07.7fff.com" rel="nofollow noopener" target="_blank" title="e168f07.7fff.com"&gt;e168f07.7fff.com&lt;/a&gt; -- it just takes a while for Google reader to get the feed.&lt;/p&gt;&lt;p&gt;What confused me was seeing (in Google Reader) posts on the old feed, and none on the new (disqus) feed --I wondered if it was working.  But now I see -- followups to old posts remain with the old feed, and new posts go to disqus.&lt;/p&gt;&lt;p&gt;I hear the Sox have a new slugger named "Casey"  ;-)&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">steveharris</dc:creator><pubDate>Tue, 16 Oct 2007 11:21:42 -0000</pubDate></item><item><title>Re: Instances of the class Class</title><link>http://e168f07.7fff.com/2007/10/13/instances-of-the-class-class/#comment-5208</link><description>&lt;p&gt;Well, how about that, my comment just showed up!&lt;br&gt;Guess I'm just impatient.  :-)&lt;br&gt;&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">steveharris</dc:creator><pubDate>Mon, 15 Oct 2007 15:24:54 -0000</pubDate></item><item><title>Re: Instances of the class Class</title><link>http://e168f07.7fff.com/2007/10/13/instances-of-the-class-class/#comment-5206</link><description>&lt;p&gt;Hi John,&lt;/p&gt;&lt;p&gt;None of the more recent comments have appeared in &lt;a href="http://e168f07.disqus.com" rel="nofollow noopener" target="_blank" title="e168f07.disqus.com"&gt;e168f07.disqus.com&lt;/a&gt;, or in the RSS feed.&lt;/p&gt;&lt;p&gt;- Steve&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">steveharris</dc:creator><pubDate>Mon, 15 Oct 2007 15:14:04 -0000</pubDate></item></channel></rss>