<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" version="2.0">
  <channel>
    <title>Brad Pauly's Blog</title>
    <link>http://bradpauly.com/rss.xml</link>
    <description>Brad Pauly's Blog</description>
    <language>en-us</language>
    <atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/BradPauly" /><feedburner:info xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" uri="bradpauly" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><item>
      <pubDate>Fri, 24 Apr 2009 05:50:01 +0000</pubDate>
      <title>Intentional Email</title>
      <link>http://bradpauly.com/posts/15-Intentional-Email</link>
      <guid>http://bradpauly.com/posts/15-Intentional-Email</guid>
      <description>&lt;p&gt;Addiction is like email. With my apologies to &lt;a href="http://www.cafepress.com/blixytees.10117492"&gt;Why&lt;/a&gt; for borrowing. Email has become the default action while online. At least it has for me and I&amp;#8217;m guessing many others. What are we looking for when we check email every few moments? After watching &lt;a href="https://peepcode.com/products/email"&gt;Lars Pind&amp;#8217;s screencast on PeepCode&lt;/a&gt; I decided to try to back off on the checking.&lt;/p&gt;
&lt;p&gt;It hasn&amp;#8217;t been long so I don&amp;#8217;t have much to report. Yet. The interesting thing so far has been that I am more aware of how often I used to check. Earlier today I was in line at &lt;span class="caps"&gt;REI&lt;/span&gt; waiting to exchange some shoes and was ready to reach into my pocket to grab my iPhone and check email. Instead I took a deep breath and looked around at my surroundings. I didn&amp;#8217;t really need to check my email, it was just the default action. The other thing that I have noticed is that emailing has become more intentional. I am really focused on it when I am doing it. The goal is two times a day. I&amp;#8217;m not sure how that will work out, but I&amp;#8217;m giving it a shot. I&amp;#8217;ll report back more after a while.&lt;/p&gt;
&lt;p&gt;In the mean time I highly recommend checking out Lars Pind on &lt;a href="http://coachtvblog.com/"&gt;Coach TV&lt;/a&gt;. I think he is on to something.&lt;/p&gt;</description>
    </item>
    <item>
      <pubDate>Thu, 19 Feb 2009 21:54:45 +0000</pubDate>
      <title>Sliding Puzzle Problem</title>
      <link>http://bradpauly.com/posts/14-Sliding-Puzzle-Problem</link>
      <guid>http://bradpauly.com/posts/14-Sliding-Puzzle-Problem</guid>
      <description>&lt;p&gt;Yesterday, during an interview, I was asked how to programatically solve a &lt;a href="http://en.wikipedia.org/wiki/Sliding_puzzle"&gt;sliding puzzle&lt;/a&gt;. Given a mixed up puzzle, solve it and output a list of moves that would take you to the solution. After working it through for a bit we seemed to have a decent approach and moved on to other questions and interview stuff. However, thinking about it later in the day, I realized we missed something. I enjoy puzzles and programming, so last night I decided to look at it again and actually write the program.&lt;/p&gt;
&lt;p&gt;When first posed, my first thought was too complex to write. I wanted to, given the current possible moves, decide which one would take me closer to the solution. My interviewer was kind enough to point out that this gets tricky quickly and wasn&amp;#8217;t a very good idea. It&amp;#8217;s true. I have played with these types of puzzles before, but it was doubtful that I could remember the strategy in the moment. Let alone a strategy that could be implemented in code. With some coaxing &amp;#8220;How many possible positions are there?&amp;#8221; and something like &amp;#8220;Instead of a smart monkey, how about a monkey named Brute.&amp;#8221; Yes, of course, it would be easy for a computer to try all the moves until the solution was reached. And this is where we missed a step, sorta.&lt;/p&gt;
&lt;p&gt;The brute force method would be to start with the original, mixed up, state of the puzzle and make one of the available moves. Repeat until solved. If there is ever more than one available move just take the first because you are going to try the others later. The problem is that you could move A to B in the first move and then back in the second step. This would continue until the end of time. We never really got into the implementation of choosing a move so this it isn&amp;#8217;t fair to say that we missed this. More like we never got to it. I did when I was working on the code.&lt;/p&gt;
&lt;p&gt;When faced with choosing a move, I randomly pick one of the available moves. This works for the puzzles I tried it with. After chewing on the puzzle for a while, I get it back into the state it started in. Cool. Unlike the original problem I am not tracking the moves taken to get back to the solved state. I may work on that at a later date.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;A slightly smarter monkey?&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="http://gist.github.com/67091"&gt;I posted the code on github&lt;/a&gt; if you want to take a look. I&amp;#8217;ve already had some ideas about how to improve it. Looking at the output of solving a small puzzle, I noticed that it was one move away in a few steps, but the random move picker picked the wrong move. So one possibility, instead of randomly picking a move, would be to try each of the possible moves in turn and checking if it solves the puzzle. If it doesn&amp;#8217;t &amp;#8220;undo&amp;#8221; that move and the others. If none of them solve the puzzle, go back to picking one randomly. This would slow down the selection process but might speed up the solution.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Larger puzzles&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;I have only tested with 2&amp;#215;2, 2&amp;#215;3 and 3&amp;#215;3 puzzles so far. (I&amp;#8217;m going to let the 4&amp;#215;4 run while I go run some errands.) It&amp;#8217;s no surprise that as the size of the puzzle increases, the amount of time needed to solve it goes up. It would be interesting to run the same puzzle a bunch of times and compare solution times and number of moves needed to get to the solution between different move picking strategies. Okay, I might be spending more time on this than I should. I had a lot of fun with it though!&lt;/p&gt;</description>
    </item>
    <item>
      <pubDate>Sat, 31 Jan 2009 01:30:28 +0000</pubDate>
      <title>Luna is now on GitHub</title>
      <link>http://bradpauly.com/posts/13-Luna-is-now-on-GitHub</link>
      <guid>http://bradpauly.com/posts/13-Luna-is-now-on-GitHub</guid>
      <description>&lt;p&gt;Finally! I created the project on GitHub a few months ago, added the first file a month ago and tonight I added the rest of the files. If you grab the source you should be able to have your own blog, just like this one, up and running in short order. What I need to do next is create some rake tasks to make the setup a little easier. If you check it out, please let me know!&lt;/p&gt;
&lt;p&gt;http://github.com/bpauly/luna&lt;/p&gt;</description>
    </item>
    <item>
      <pubDate>Fri, 23 Jan 2009 03:12:29 +0000</pubDate>
      <title>New Year's Resolution: Keep Trying</title>
      <link>http://bradpauly.com/posts/12-New-Year-s-Resolution-Keep-Trying</link>
      <guid>http://bradpauly.com/posts/12-New-Year-s-Resolution-Keep-Trying</guid>
      <description>&lt;p&gt;After being out of the country for five weeks with somewhat limited internet access I returned to find all sorts of comment spam on my blog. I also realized that I haven&amp;#8217;t posted, or worked on the code, since October! When I first started Luna I had hoped to make regular posts and additions to the code. Today, instead of feeling bad about not doing what I originally set out to do, I got back on the horse and gave it another shot.&lt;/p&gt;
&lt;p&gt;I&amp;#8217;m not a fan of New Year&amp;#8217;s Resolutions. They tend to set you up for failure because they are too big and it is difficult to change. This year, however, I have one that I like: Keep trying. That&amp;#8217;s it. Don&amp;#8217;t beat yourself up because you faltered. Brush yourself off and try again. It isn&amp;#8217;t a big deal. Trying is what may eventually get you there.&lt;/p&gt;
&lt;p&gt;So here I am, trying again. This is my first post in over three months. I&amp;#8217;ve also made code changes, including:&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;Replace http authentication with old method (don&amp;#8217;t like the dialog box)&lt;/li&gt;
	&lt;li&gt;Admin link at the bottom of the page&lt;/li&gt;
	&lt;li&gt;Cleanup of admin pages (input forms and some admin links for easy access)&lt;/li&gt;
	&lt;li&gt;Add a delete link to comments when you are logged in&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;I still haven&amp;#8217;t gotten the code up on GitHub, but I will, eventually.&lt;/p&gt;</description>
    </item>
    <item>
      <pubDate>Fri, 17 Oct 2008 22:40:44 +0000</pubDate>
      <title>RSS Feed</title>
      <link>http://bradpauly.com/posts/11-RSS-Feed</link>
      <guid>http://bradpauly.com/posts/11-RSS-Feed</guid>
      <description>&lt;p&gt;You can now subscribe to my shiny new &lt;a href="http://feeds.feedburner.com/BradPauly"&gt;&lt;span class="caps"&gt;RSS&lt;/span&gt; Feed&lt;/a&gt;. I decided that an &lt;span class="caps"&gt;XML&lt;/span&gt; feed would be relatively quick and easy to build, so I rolled up my sleeves and went for it. The link is to a feedburner feed, however, you can also visit /rss.xml and get it.&lt;/p&gt;
&lt;p&gt;My posts seem to be getting shorter and shorter. I think I&amp;#8217;m spending more time writing the code than the posts and that isn&amp;#8217;t saying much. Next time I&amp;#8217;ll try to be more verbose about what I set out to do and what I did.&lt;/p&gt;</description>
    </item>
    <item>
      <pubDate>Thu, 09 Oct 2008 19:14:21 +0000</pubDate>
      <title>SPAM strategy = FAIL</title>
      <link>http://bradpauly.com/posts/10-SPAM-strategy-FAIL</link>
      <guid>http://bradpauly.com/posts/10-SPAM-strategy-FAIL</guid>
      <description>&lt;p&gt;It was working well for a while but some bot latched on to my first post and managed to figure out how to post comments. The rest of the posts seem to be okay, but I was getting tired of deleting all of them from the first one. So until I come up with a new plan (I don&amp;#8217;t like image captchas) comments are disabled.&lt;/p&gt;</description>
    </item>
    <item>
      <pubDate>Mon, 06 Oct 2008 05:56:41 +0000</pubDate>
      <title>iPhone compatiblity</title>
      <link>http://bradpauly.com/posts/9-iPhone-compatiblity</link>
      <guid>http://bradpauly.com/posts/9-iPhone-compatiblity</guid>
      <description>&lt;p&gt;&lt;strong&gt;update&lt;/strong&gt; &amp;#8211; The iPhone optimized version of Luna is now live on this server. Visit it from your iPhone to check it out. Please let me know what you think!&lt;/p&gt;
&lt;p&gt;I&amp;#8217;ve been having a hard time deciding what to build next in Luna. Better comment management, a git repository,  an iPhone version of the site? Well, it looks like an iPhone version is going to win out over the rest. I started to put together a very simple iPhone layout and hope to have it live in the next few days. There are a ton of blog posts about iPhone website design. My inspiration came from &lt;a href="http://www.engageinteractive.co.uk/blog/2008/06/19/tutorial-building-a-website-for-the-iphone/"&gt;this post&lt;/a&gt;. With some luck you will be able to read and comment on this site from your iPhone in the very near future.&lt;/p&gt;</description>
    </item>
    <item>
      <pubDate>Thu, 18 Sep 2008 06:04:14 +0000</pubDate>
      <title>Configuration and Authentication</title>
      <link>http://bradpauly.com/posts/8-Configuration-and-Authentication</link>
      <guid>http://bradpauly.com/posts/8-Configuration-and-Authentication</guid>
      <description>&lt;p&gt;It&amp;#8217;s Wednesday night, my GF has major corporate happenings going on, I&amp;#8217;m watching some Railscasts and Battlestar Galactica  on the Apple TV, I&amp;#8217;m drinking some wine&amp;#8230; You get the idea, code is being written. I&amp;#8217;m doing some cleanup on Luna. I&amp;#8217;m changing the authentication so it uses &lt;a href="http://api.rubyonrails.org/classes/ActionController/HttpAuthentication/Basic/ControllerMethods.html#M000610"&gt;authenticate_or_request_with_http_basic&lt;/a&gt;. A nicely descriptive, albeit not short, method name. I&amp;#8217;m also moving constants out of environment.rb and into a a &lt;span class="caps"&gt;YAML&lt;/span&gt; file, called luna.yml. Both of these changes come from Railscasts.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://railscasts.com/episodes/82-http-basic-authentication"&gt;&lt;span class="caps"&gt;HTTP&lt;/span&gt; Basic Authentication&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="http://railscasts.com/episodes/85-yaml-configuration-file"&gt;&lt;span class="caps"&gt;YAML&lt;/span&gt; configuration file&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;The &lt;span class="caps"&gt;HTTP&lt;/span&gt; authentication simplifies what was already a simple authentication scheme and the &lt;span class="caps"&gt;YAML&lt;/span&gt; config is a great way to organize application specific settings.&lt;/p&gt;
&lt;p&gt;Great stuff from from &lt;a href="http://railscasts.com/"&gt;Ryan Bates and Railscasts&lt;/a&gt;.&lt;/p&gt;</description>
    </item>
    <item>
      <pubDate>Thu, 04 Sep 2008 07:05:09 +0000</pubDate>
      <title>Inspiration in Waves</title>
      <link>http://bradpauly.com/posts/7-Inspiration-in-Waves</link>
      <guid>http://bradpauly.com/posts/7-Inspiration-in-Waves</guid>
      <description>&lt;p&gt;It&amp;#8217;s late and I&amp;#8217;m tired and I thought I was done when I uploaded the formatting changes. But then I finished that and was thinking about comment spam and decided to do a quick test. I think it&amp;#8217;s going to work.&lt;/p&gt;
&lt;h4&gt;Hidden empty text field&lt;/h4&gt;
&lt;p&gt;We&amp;#8217;ll see how it works. I read a number of posts about this technique and some said to use a text field and visually hide it while others said a hidden field would do the trick. The idea is that a spam bot will enter text into every field so when there is text in that field, it is likely spam. I added an occupation attribute to the Comment model and it is invalid unless it is blank. My fingers are crossed. I&amp;#8217;m hoping that does the trick.&lt;/p&gt;</description>
    </item>
    <item>
      <pubDate>Thu, 04 Sep 2008 06:28:19 +0000</pubDate>
      <title>Formatting with RedCloth</title>
      <link>http://bradpauly.com/posts/6-Formatting-with-RedCloth</link>
      <guid>http://bradpauly.com/posts/6-Formatting-with-RedCloth</guid>
      <description>&lt;p&gt;Finally, &lt;a href="http://textile.thresholdstate.com/"&gt;Textile&lt;/a&gt; formatting with &lt;a href="http://whytheluckystiff.net/ruby/redcloth/"&gt;RedCloth&lt;/a&gt; has arrived. It was super easy to implement. I have a helper function that takes a string argument and returns html. Bingo. I edited some of the older posts, added a little formatting and I&amp;#8217;m pretty happy with it.&lt;/p&gt;
&lt;h4&gt;Short post&lt;/h4&gt;
&lt;p&gt;That&amp;#8217;s all I have for this post. There are a few things that I&amp;#8217;d like to get done next. Get a git repository up and add some simple spam prevention. I don&amp;#8217;t know which one I will get to first, but I hope to have another update soon.&lt;/p&gt;</description>
    </item>
  </channel>
</rss>

