<?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>occasionally useful &#187; musing</title>
	<atom:link href="http://blog.maxaller.name/category/musing/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.maxaller.name</link>
	<description>ruby, ubuntu, etc</description>
	<lastBuildDate>Sun, 11 Jul 2010 07:01:36 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.5</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Grandparent of Ruby and Java: Eiffel and friends</title>
		<link>http://blog.maxaller.name/2010/07/grandparent-of-ruby-and-java-eiffel-and-friends/</link>
		<comments>http://blog.maxaller.name/2010/07/grandparent-of-ruby-and-java-eiffel-and-friends/#comments</comments>
		<pubDate>Sun, 11 Jul 2010 07:01:36 +0000</pubDate>
		<dc:creator>Max</dc:creator>
				<category><![CDATA[musing]]></category>
		<category><![CDATA[eiffel]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://blog.maxaller.name/?p=293</guid>
		<description><![CDATA[I'm curious about the effort involved in writing a new programming language, and hence have been doing a little research (including watching Guy Steele's now-famous and amusing Growing a Language lecture).  I know I want to target the NekoVM (primarily one of the targets of haxe, for now), but what languages should I base [...]]]></description>
			<content:encoded><![CDATA[<p>I'm curious about the effort involved in writing a new programming language, and hence have been doing a little research (including watching Guy Steele's now-famous and amusing <a target="_blank" href="http://www.catonmat.net/blog/growing-a-language-by-guy-steele/">Growing a Language</a> lecture).  I know I want to target the <a target="_blank" href="http://nekovm.org/">NekoVM</a> (primarily one of the targets of <a target="_blank" href="http://haxe.org/">haxe</a>, for now), but what languages should I base it on?  One of the languages I've heard a good deal about about, mainly based on its design-by-contract principles, is Eiffel.</p>
<p>(even if you're not interested in building a new language, learning about programming languages and their design decisions increases our understanding of them and, hopefully, our proficiency with them)<br />
<span id="more-293"></span><br />
What is Eiffel?  Is it another language that lives solely in academia?  Is there anything particularly interesting about it?</p>
<p>It's a static, strongly typed language, and...the rest of its characteristics you can read about on Wikipedia.</p>
<p>From a historical perspective, it's interesting to see some of the key features in Eiffel make their way into Java and Ruby, and to see which features didn't.</p>
<p>For example, Eiffel has a notion of abstract classes, except they're called "deferred" classes and use the <code>deferred</code> keyword.  Ruby has no abstract classes, though you could simply make the constructor throw an exception, I suppose.</p>
<p>More interestingly, Eiffel supports multiple inheritance, but neither Ruby nor Java do  (though Scala supports something similar).  How does it evade the <a target="_blank" href="http://en.wikipedia.org/wiki/Diamond_inheritance">diamond inheritance problem</a>?  Eiffel doesn't support argument overloading, like Java does; so if two parent classes have the same method, it won't compile.  Instead, you have to resolve the name conflict by renaming one or both of the conflicting parent methods in your subclass.</p>
<p>Like Java (1.5 and later, at least), you can't override a parent method without explicitly stating it, except instead of with an <code>@Override</code> annotation at the site of the override, you declare the override at the start of the class with <code>redefine</code>.</p>
<p>Like Scala, Eiffel holds the Uniform Access Principle close -- Eiffel lets you redefine an argument-less method in an ancestor as an attribute in the current class.</p>
<p>Like Scala, Eiffel has a <code>void</code> type, and it is a descendant of ALL reference types, which allows you to pass void into any function expecting a reference type.</p>
<p>Unlike Ruby, Java, and Scala, the only structuring tool is a class -- no interfaces, mixins, traits, interfaces, or modules.</p>
<p>Like Java, Eiffel has a notion of a <code>once</code> routine.  Java's equivalent is the static initializer block (static {}).  Ruby has a similar pattern, using ||=, to initialize a value once.  (Scala also has a notion of lazily evaluated methods/attributes)</p>
<p>Unlike Java, Eiffel does not allow you to cast an object to another type (though you can always try to assign one object to a variable of a type and it will 'cast' it).</p>
<p>And so on.  If this piqued your interest in the ancestor of two big languages of today, check out the <a href="http://archive.eiffel.com/doc/online/eiffel50/intro/language/tutorial-00.html" target="_blank">tutorial</a>.  The first 2-3 chapters are a bit dry and apparently a little self-absorbed in places (it's not just a language, it's a process! they say), but still a good read/skim.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.maxaller.name/2010/07/grandparent-of-ruby-and-java-eiffel-and-friends/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Banks and OAuth support</title>
		<link>http://blog.maxaller.name/2009/08/banks-and-oauth-support/</link>
		<comments>http://blog.maxaller.name/2009/08/banks-and-oauth-support/#comments</comments>
		<pubDate>Tue, 25 Aug 2009 03:16:00 +0000</pubDate>
		<dc:creator>Max</dc:creator>
				<category><![CDATA[just for fun]]></category>
		<category><![CDATA[musing]]></category>

		<guid isPermaLink="false">http://blog.maxaller.name/?p=170</guid>
		<description><![CDATA[For fun, I decided to ping all of my financial companies (Bank Of America, CapitalOne, Chase, EmigrantDirect, INGDirect, Vanguard) about their plans for OAuth support.  I don't know how many of you use the wonderful service known as Mint, but I like it a lot.  Unfortunately, a part of me died when I [...]]]></description>
			<content:encoded><![CDATA[<p>For fun, I decided to ping all of my financial companies (Bank Of America, CapitalOne, Chase, EmigrantDirect, INGDirect, Vanguard) about their plans for OAuth support.  I don't know how many of you use the wonderful service known as <a href="http://www.mint.com">Mint</a>, but I like it a lot.  Unfortunately, a part of me died when I gave them my username/password for my banking sites.  And INGDirect is secure enough that Mint can't even interface with them!  Sorta cool.</p>
<p>Anyway, here's what the institutions said:<br />
<span id="more-170"></span></p>
<table border="0">
<tbody>
<tr>
<th>Company</th>
<th>Response</th>
</tr>
<tr>
<td>Bank Of America</td>
<td>
<p>Thank you for your suggestions regarding Online Banking. We value your opinion. The information you provided us will be forwarded to the appropriate department for ongoing evaluations of Online Banking.</p>
</td>
</tr>
<tr>
<td>CapitalOne</td>
<td>
<p>Thanks for your message.</p>
</td>
</tr>
<tr>
<td>Chase</td>
<td>
<p>In response to your inquiry, I will forward your suggestion to our development team for further consideration.</p>
</td>
</tr>
<tr>
<td>EmigrantDirect</td>
<td>
<p>Thank you for your feedback. We will certainly share your comments with the appropriate people within the organization.</p>
</td>
</tr>
<tr>
<td>INGDirect</td>
<td>
<p>We appreciate your feedback! Your suggestion will be forwarded to the appropriate area for review.</p>
</td>
</tr>
<tr>
<td>Vanguard</td>
<td>
<p>Thank you for your recent feedback concerning the OAuth protocol.  At this time, we do not have any immediate plans to support OAuth.</p>
<p>Your thoughts have been forwarded to the appropriate area for review. We are constantly accepting ideas for improvement on our site, and it's often through recommendations such as yours that enhancements are made.</p>
</td>
</tr>
</tbody>
</table>
<p>Originally this was going to be a more exciting post...but I guess I was too optimistic <img src='http://blog.maxaller.name/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /> </p>
<p>On the bright side, it makes me happy to be a customer of Vanguard's, now.  Their response was the only one that wasn't simply "thanks, we'll forward that to the appropriate party".  Even though their answer was pretty much "no", it came back quickly and concisely -- it took only like two hours turnaround, whereas most of the others took 2-3 days.</p>
<p>Also, Bank of America/CapitalOne/Chase sort of piss me off in that they *require* you to use their crappy internal messaging system, even for interacting with the company in as mundane a way as this.  Not only that, but I wasn't even notified when they'd replied.  Am I really supposed to sign into my bank website every day to check for messages?</p>
<p>Does your bank plan on supporting OAuth?  Let's raise the awareness a bit so we can get even more cool online tools for managing finances!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.maxaller.name/2009/08/banks-and-oauth-support/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Web server output generation design patterns</title>
		<link>http://blog.maxaller.name/2009/08/web-server-output-generation-styles/</link>
		<comments>http://blog.maxaller.name/2009/08/web-server-output-generation-styles/#comments</comments>
		<pubDate>Mon, 10 Aug 2009 07:00:25 +0000</pubDate>
		<dc:creator>Max</dc:creator>
				<category><![CDATA[musing]]></category>

		<guid isPermaLink="false">http://blog.maxaller.name/?p=157</guid>
		<description><![CDATA[There are several styles of content generation that I know of so far...I'm reviewing them because I'm looking to see if there could be something better.
Flat-file
Example: plain ol' PHP
PHP, at its simplest, doesn't have any separation at all -- you can, if you choose, have all the programming/form-processing logic in the same file that renders [...]]]></description>
			<content:encoded><![CDATA[<p>There are several styles of content generation that I know of so far...I'm reviewing them because I'm looking to see if there could be something better.</p>
<p><strong>Flat-file</strong></p>
<p><em>Example: plain ol' PHP</em></p>
<p>PHP, at its simplest, doesn't have any separation at all -- you can, if you choose, have all the programming/form-processing logic in the same file that renders the output to the browser.  While simple, if you're creating a full website, this can be cumbersome and confusing.</p>
<p><span id="more-157"></span></p>
<p><strong>Component Paradigm<br />
</strong></p>
<p><em>Example: Java EE/JSF</em></p>
<p>Each page is an Application (code).  Each Application has an Application Layout (html).  Each Application Layout has a number of slots.  The Application has logic that designates what Pagelets go into what slots, and what layout a particular Pagelet should use.  Each Pagelet (code) has a number of layouts (html), only one of which is rendered per request.  When the request is in the Application stage, there is only one thread, and the application puts into the request object most of what the pagelets will likely need (pagelets can do computations and service requests themselves too, of course, but it's hard to share the results between pagelets)</p>
<p>Phew.  So the cool part about this design is that the pagelet components are (in theory) reusable.  Additionally, all of the pagelets can be executed in parallel, which (since Java uses native threads) can result in major performance improvements.  The application doesn't need to designate the pagelet-slot mappings in code -- it can be configured in XML (lovely...).  On the other hand, since the pagelets are executed in parallel, this makes flushing content to the browser before the page is done rendering somewhat challenging.</p>
<p>I haven't explored enough to tell, but it looks like Java's offerings are heavily component-biased, with solutions like <a href="http://tapestry.apache.org/tapestry5/" target="_blank">Tapestry</a> that look potentially interesting.</p>
<p><strong>MVC</strong></p>
<p><em>Examples: Ruby on Rails, Merb, Ramaze, Sinatra (sorta), CakePHP, CodeIgniter<br />
</em></p>
<p>The request is mapped to a particular method in a class, with this class being called the Controller.  This method performs some computations required for display, then renders the View, which consists of a template typically wrapped in a layout (another template that provides the header and footer).  The template can include other shared templates, called <em>partials</em> in Rails-speak, but are generally just template includes.  Models are essentially wrappers for database objects (see <a href="http://en.wikipedia.org/wiki/Object-relational_mapping" target="_blank">ORM</a>s).  Models aren't really specific to MVC -- any time you're calling a method instead of writing out a SQL query by hand you're probably using a model (or a utility class -- but that would be sucky).</p>
<p>In conclusion...</p>
<p>What other stuff out there, good or bad, exists or could exist?  I'm planning on exploring, at least with my mind and possibly with code, what some of the other alternatives are.  Anyone have any experience with other web design patterns that would like to share?</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.maxaller.name/2009/08/web-server-output-generation-styles/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Design pattern/flow for building a website</title>
		<link>http://blog.maxaller.name/2009/07/design-patternflow-for-building-a-website/</link>
		<comments>http://blog.maxaller.name/2009/07/design-patternflow-for-building-a-website/#comments</comments>
		<pubDate>Mon, 20 Jul 2009 02:55:55 +0000</pubDate>
		<dc:creator>Max</dc:creator>
				<category><![CDATA[musing]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://blog.maxaller.name/?p=155</guid>
		<description><![CDATA[So here's how I normally do things:

Do as much of the models as possible in this first pass, skipping validation but including schema stuff
Stick a couple things into the controllers that I think I'll need
Build out some of the views, giving them some basic styles
Revisit the models to add validation, helper methods
Build out the rest [...]]]></description>
			<content:encoded><![CDATA[<p>So here's how I normally do things:</p>
<ol>
<li>Do as much of the models as possible in this first pass, skipping validation but including schema stuff</li>
<li>Stick a couple things into the controllers that I think I'll need</li>
<li>Build out some of the views, giving them some basic styles</li>
<li>Revisit the models to add validation, helper methods</li>
<li>Build out the rest of the views, give them real styles</li>
<li>Muse about specs, then give up before starting</li>
<li>Put more stuff into the controllers</li>
<li>Iterate on random components until you're done</li>
</ol>
<p>Needless to say, I'm getting to the point where my lack of organization kills my mini-projects before I hit step 4, sometimes even sooner than that.  So I'm going to try a slightly more...conventional (or widely suggested, at least) approach:</p>
<ol>
<li>Create controllers with just enough information so that your pages will display.  No setting variables yet or other logic!</li>
<li>Fill out the views with as much HTML and fake data as you need.  Site have a sign-in page?  Leave a link to "force sign-in" the user that simply sets them to an authenticated state.  All it should do is set a session variable</li>
<li>Spec out the models.  Don't check for validation yet, just check for core functionality, i.e. there is a User table, the first user has a name of Foo and email of bar@baz.com, etc.</li>
<li>Fill out your model code so that the specs pass -- this includes migrations with sample data (these can be removed in a later migration).</li>
<li>Spec out your controllers/views.</li>
<li>Fill out your controllers/views so they pass specs.</li>
<li>Do the rest of the little things that need doing, like validation, error messaging, authentication, styling, etc.</li>
<li>Revel in having finished a project.</li>
</ol>
<p>Hopefully I'll get further than step 3 this way! I'm going to try to focus more on content/frontend instead of getting bogged down in the backend, and I want to actually write specs.</p>
<p>Any comments/suggestions?</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.maxaller.name/2009/07/design-patternflow-for-building-a-website/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>XSLT is a giant pain</title>
		<link>http://blog.maxaller.name/2009/04/xslt-is-a-giant-pain/</link>
		<comments>http://blog.maxaller.name/2009/04/xslt-is-a-giant-pain/#comments</comments>
		<pubDate>Sun, 19 Apr 2009 20:06:11 +0000</pubDate>
		<dc:creator>Max</dc:creator>
				<category><![CDATA[just for fun]]></category>
		<category><![CDATA[musing]]></category>
		<category><![CDATA[xml]]></category>
		<category><![CDATA[xslt]]></category>

		<guid isPermaLink="false">http://blog.maxaller.name/?p=136</guid>
		<description><![CDATA[Some of you may be aware that XML+XSLT 1.0 can be rendered directly by modern browsers (even IE6!), which led me to thinking that it may be a good idea to give it a try and see how good or bad it was.

The process: for a given page (say, a search page), pull the data [...]]]></description>
			<content:encoded><![CDATA[<p>Some of you may be aware that XML+XSLT 1.0 can be rendered directly by modern browsers (even IE6!), which led me to thinking that it may be a good idea to give it a try and see how good or bad it was.</p>
<p><span id="more-136"></span></p>
<p>The process: for a given page (say, a search page), pull the data out of the database that you need in the controller and then output all the raw data as XML needed to generate the page in the template.  For a search page this would be the search results, the user's name (if signed in), etc.  Then you have your XSLT stylesheets.  Since this is all client-side, each one you have generates a request.  If you have one stylesheet that renders the initial page, and that stylesheet requires 4 other stylesheets...well, you have 5 requests right there just to display the page.</p>
<p>These other stylesheets <em>should </em>be mostly static, I'd hope.  In my mockup I didn't have to make any of them dynamic, but then I wasn't trying to do anything super advanced.  Anyway, Thin is smart enough to send 304s for the unmodified XSLTs, so at least that's good...</p>
<p>Other notes: one <em>can </em>do server-side rendering, but that's not the point of this exercise -- I want to do pure non-Javascript client-side rendering.  Unfortunately this also rules out XSLT 2.0, which was only finalized in January 2007 and would probably ease some of the pain.</p>
<p>Anyway, time for Code!</p>
<h1>Code</h1>
<h2>Adding HTML elements based on data</h2>
<p>...is a pain.  See <a href="http://pastie.org/451499" target="_blank">here</a> for my solution of preserving dropdown selections after a search (i.e. you search in a particular category and that category shows up in the dropdown on the end page).  Grotesquely verbose?  Why, yes it is!  I don't think there's a better way, either -- it would be acceptable to have a function that outputted XHTML instead of a template, but I think that's that's a 2.0-feature only.</p>
<h2>Changing values based on data</h2>
<p>This one isn't <a href="http://pastie.org/451607" target="_blank">quite so bad</a>, actually.  As with the previous example, though, you'll notice that you can't pull data in from the query parameters -- it has to be pulled in from the XML.  The original request has access to the query parameters, immediate requests <em>could </em>have access to the query parameters (since the original request url is passed in to immediate requests as the referrer), but non-immediate requests couldn't have any access to the query parameters at all whatsoever.</p>
<p>So what does this mean?  <em>All </em>data needs to be in the XML.  Not just product search results and personalization data, but also what the search query was, what the category was, what the sort order was, etc. if you plan on displaying any of that information.  Ugh!</p>
<h2>Preserving query parameters in links</h2>
<p>Guess what, more fun!  Check <a href="http://pastie.org/451619" target="_blank">this</a> out.  This is for pagination of search results -- all parameters needs to be preserved except for the page, which obviously changes.  Since this time the data needs to be stored in the attribute of another tag, we have to capture the template call into a variable first.  Cool, huh?</p>
<p>If anyone knows of a better way to do any of this with XSLT 1.0, please do let me know.  I am quite the novice and am just posting my discoveries thus far.  No guarantees of completeness.</p>
<h1>Other issues</h1>
<h2>Javascript/jQuery</h2>
<p>I was trying to figure out how to pull data from the original XML sheet via JavaScript, but it seems that JavaScript only has access to the rendered XHTML.  I could do an AJAX call to re-fetch the XML sheet and operate on that, but that seems silly to me.  I've tried looking for a cross-browser non-plugin solution but I don't think jQuery offers anything in this way.</p>
<h1>Discussion</h1>
<p>In regular HTML, you have HTML, CSS, and JS -- typically referred to as Structure, Display, and Behavior.  But really, HTML is typically structure and data combined, plus elements of display.  XML+XSLT is nice in theory because it explicitly breaks up structure/display and data.  But how much does that really buy you?  On modern MVC-style web frameworks, the controller passes data to the view/template so that the data can be rendered.  But with XML-XSLT the controller renders XML so that the client can transform that XML using the XSLTs you provide.  What's the point of emitting XML when you could just emit XHTML?  Frankly, data and structure don't *need* to be separated -- if you want just the data, then you need to set up a web service.  Frameworks like Ruby on Rails make this trivial.</p>
<p>So I guess the main benefit of separating data and structure the way XML and XSLT does is it means for the same XML, you can have different sets of XSLTs.  But wait...actually, you can't.  You embed the references for stylesheets for the XML file IN the XML file itself, i.e. the XML file says use this XSLT to render me.  So...if you want to switch XSLTs, you have to modify the XML file, which means you have to make the XML file content dynamically generated, which means you might as well use a fully-featured templating language on the server side.</p>
<h1>Conclusion</h1>
<p>XML+XSLT may have its uses, but general web applications is not one of them...</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.maxaller.name/2009/04/xslt-is-a-giant-pain/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Starting new projects</title>
		<link>http://blog.maxaller.name/2009/03/starting-new-projects/</link>
		<comments>http://blog.maxaller.name/2009/03/starting-new-projects/#comments</comments>
		<pubDate>Wed, 01 Apr 2009 00:00:07 +0000</pubDate>
		<dc:creator>Max</dc:creator>
				<category><![CDATA[musing]]></category>

		<guid isPermaLink="false">http://blog.maxaller.name/?p=87</guid>
		<description><![CDATA[So I know I'm not the only dev who does this, but I tend to start a lot of projects -- and not finish them.  I'm coming up with a checklist of things that I want to make sure I do before getting involved in any new projects.
Read on for some of the initial [...]]]></description>
			<content:encoded><![CDATA[<p>So I know I'm not the only dev who does this, but I tend to start a lot of projects -- and not finish them.  I'm coming up with a checklist of things that I want to make sure I do before getting involved in any new projects.</p>
<p>Read on for some of the initial questions you should ask yourself, and what to do next.</p>
<h1><span id="more-87"></span>Questions</h1>
<h2>Is it useful?</h2>
<p>No, really, would anyone use it?  Would you personally use it?  Would people like you use it?  Who is your audience?  Would they use it? ... ask them?</p>
<h2>Is it <em>sufficiently </em>useful?</h2>
<p>Is the problem this application aims to solve painful/time-consuming/hard enough that people will actively search out an application that does what yours does?  If they have any problems with your application, how probable are they to going back to what they were doing before?</p>
<h2>Is it unique?</h2>
<p>If it's a great idea, there's a fair chance someone has thought of it before.  Put in a solid 20 minutes (or more) of searching for a product that does what you want to make.  Pretend that you already made your product -- what terms would you use to search for it, besides the name?</p>
<h2>Is it <em>sufficiently</em> unique?</h2>
<p>So your idea is original -- but is it <em>really </em>original?  A social networking website with one additional feature is not sufficiently unique.  A news aggregation website with customizable themes is not sufficiently unique.  A script that performs the same stuff as another script but is 5-10% faster is not sufficiently unique.</p>
<h2>Is the project small enough that you can do it with the team you have?</h2>
<p>The team you have may be just yourself, it may be 3 guys, may be as high as 5 guys.  Can you make the project a success with the team size (and members) you have?  Can you <em>finish</em> the project with the team you have?</p>
<h2>Is it fun?</h2>
<p>No, really -- this is a key factor in whether you'll be able to stay mentally and emotionally involved in the project.  Do you think you'd enjoy working on it?  Spend 10 minutes staring at the ceiling or jotting down some ideas while thinking about the project.  Reduce and translate the ideas to the smallest number of features that you'd need to make a "1.0" version of the project.  Will it be fun to implement those features?  Or will it start to seem like real work after only a few minutes of development?</p>
<h1>What next?</h1>
<p>Are all of the above questions answerable with an emphatic "Yes!"?  Then continue on to the below steps...</p>
<h2>Plan more!</h2>
<p>Odds are you haven't written anything down yet.  Go ahead and do it, and do it by hand -- not to set it in stone, but rather I've found that to get my creative energies going you have to write it down.  And put it to paper because a) you write slower than you type, and so this forces you to think more about what you're writing and what you will be writing next, and b) paper has fewer email notifications and instant messages popping up...</p>
<h2>Bounce your idea</h2>
<p>Reduce your game plan to something succinct and organized, then pitch it to friends, families, coworkers, and members of your target audience.  Do they think it sounds useful?  Would they use it?</p>
<h2>Sit on it</h2>
<p>Any time you make a big decision, it usually helps to sit on it for a while.  Pick a length of time -- 1 day, 3 days, a week -- during which you only plan.  No coding!  It's hard to think through general flow and architecture when you're making it up as you go along.  Then spend another day or two where you don't even plan about it.  Just let the ideas float around in your head.</p>
<h1>Stay in the game</h1>
<p>How to keep focused -- in the next post!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.maxaller.name/2009/03/starting-new-projects/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Accessing GM_xmlhttprequest from event handlers bound by jQuery</title>
		<link>http://blog.maxaller.name/2009/01/accessing-gm_xmlhttprequest-from-event-handlers-bound-by-jquery/</link>
		<comments>http://blog.maxaller.name/2009/01/accessing-gm_xmlhttprequest-from-event-handlers-bound-by-jquery/#comments</comments>
		<pubDate>Fri, 02 Jan 2009 05:42:05 +0000</pubDate>
		<dc:creator>Max</dc:creator>
				<category><![CDATA[jquery]]></category>
		<category><![CDATA[musing]]></category>
		<category><![CDATA[scripts]]></category>

		<guid isPermaLink="false">http://giftswappo.com/wordpress/?p=58</guid>
		<description><![CDATA[So I like jQuery.  And I like Greasemonkey.  I especially like the ability of Greasemonkey's ajax calls to go cross-domain.  But how do I get access to this functionality in my event handlers?  Calling GM_xmlhttprequest in a method that doesn't execute while the Greasemonkey sandbox is still alive doesn't work.  [...]]]></description>
			<content:encoded><![CDATA[<p>So I like jQuery.  And I like Greasemonkey.  I especially like the ability of Greasemonkey's ajax calls to go cross-domain.  But how do I get access to this functionality in my event handlers?  Calling GM_xmlhttprequest in a method that doesn't execute while the Greasemonkey sandbox is still alive doesn't work.  At first I didn't think it was possible, but I discovered a way...using setInterval.</p>
<p><span id="more-58"></span>So here's the problem.  You want something like this:</p>
<pre lang="Javascript">$(function(){
  $("a").click(function(){
    GM_xmlhttprequest({url: "http://www.google.com/", method: 'GET'});
  });
});</pre>
<p>or something, right?  But that doesn't work because by the time the $'s DOM ready event fired, Greasemonkey is <em>gone</em>.  So what do you do?  Well...keep Greasemonkey around, but in a limited capacity.  Okay okay, here's the code:</p>
<pre lang="Javascript">var ajaxQueue = [];
var processAjaxQueue = function(){
  if (ajaxQueue.length > 0) {
    for (ajax in ajaxQueue) {
      var obj = ajaxQueue[ajax];
      // http://diveintogreasemonkey.org/api/gm_xmlhttprequest.html
      GM_xmlhttpRequest(obj);
    }
    ajaxQueue = [];
  }
}
setInterval(function(){
  processAjaxQueue();
}, 100);

function gmAjax(obj){
  ajaxQueue.push(obj);
}</pre>
<p>So now you call gmAjax instead of GM_xmlhttprequest (with the same argument) and it'll get fired off within the next 100ms.  Neat huh?  And if you're worried about security (which you should be) -- I've tested this myself, and gmAjax isn't acccessible anywhere outside of the Greasemonkey sandbox.  Huzzah, mission accomplished.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.maxaller.name/2009/01/accessing-gm_xmlhttprequest-from-event-handlers-bound-by-jquery/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Startling Discovery</title>
		<link>http://blog.maxaller.name/2008/10/startling-discovery/</link>
		<comments>http://blog.maxaller.name/2008/10/startling-discovery/#comments</comments>
		<pubDate>Tue, 28 Oct 2008 21:00:27 +0000</pubDate>
		<dc:creator>Max</dc:creator>
				<category><![CDATA[musing]]></category>

		<guid isPermaLink="false">http://giftswappo.com/wordpress/?p=39</guid>
		<description><![CDATA[So I have made a startling discovery -- the plastic cap on the end of your shoelaces is called an aglet.
]]></description>
			<content:encoded><![CDATA[<p>So I have made a startling discovery -- the plastic cap on the end of your shoelaces is called an <a href="http://en.wikipedia.org/wiki/Aglet" target="_blank">aglet</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.maxaller.name/2008/10/startling-discovery/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Game ideas?</title>
		<link>http://blog.maxaller.name/2008/10/game-ideas/</link>
		<comments>http://blog.maxaller.name/2008/10/game-ideas/#comments</comments>
		<pubDate>Fri, 03 Oct 2008 04:26:31 +0000</pubDate>
		<dc:creator>Max</dc:creator>
				<category><![CDATA[games]]></category>
		<category><![CDATA[idea]]></category>
		<category><![CDATA[just for fun]]></category>
		<category><![CDATA[musing]]></category>

		<guid isPermaLink="false">http://giftswappo.com/wordpress/?p=38</guid>
		<description><![CDATA[Well, another day, another quest for game ideas.  An online game would be fun to make, but my problem is always I think too damn big.  My last idea was a Utopia clone, and I got so far as to create a scripting language that compiled into Ruby, but I just never got [...]]]></description>
			<content:encoded><![CDATA[<p>Well, another day, another quest for game ideas.  An online game would be fun to make, but my problem is always I think too damn <em>big</em>.  My last idea was a <a href="http://games.swirve.com/UTOPIA/index.php" target="_blank">Utopia</a> clone, and I got so far as to create a scripting language that compiled into Ruby, but I just never got around to finishing it.  What would be nice is a game that's fun in its simplicity -- simple to play, simple to program, just something you spend half an hour or an hour on a day, tops.  There'd be a way to interact with other people easily; there'd be chat rooms and forums, and discernible "hot spots" where a lot of people were chatting or posting messages.  But the most important thing is core gameplay: unique, rewarding, and fun.  I'll get right on that...</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.maxaller.name/2008/10/game-ideas/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Reading a lot</title>
		<link>http://blog.maxaller.name/2008/07/reading-a-lot/</link>
		<comments>http://blog.maxaller.name/2008/07/reading-a-lot/#comments</comments>
		<pubDate>Tue, 01 Jul 2008 23:15:37 +0000</pubDate>
		<dc:creator>Max</dc:creator>
				<category><![CDATA[musing]]></category>

		<guid isPermaLink="false">http://giftswappo.com/wordpress/?p=28</guid>
		<description><![CDATA[Hey all.  I've had a lot of free time on my hands lately, so I've been splitting that between watching TV, reading online articles, and designing Stick Diablo (name pending).  There's a lot of interesting news out there though...if you're curious about what I'm checkin' out, take a look at my shared Google [...]]]></description>
			<content:encoded><![CDATA[<p>Hey all.  I've had a lot of free time on my hands lately, so I've been splitting that between watching TV, reading online articles, and designing Stick Diablo (name pending).  There's a lot of interesting news out there though...if you're curious about what I'm checkin' out, take a look at my shared Google Reader list, <a href="https://www.google.com/reader/shared/09742805629936696465" target="_blank">here</a>.  Hope you find something interesting!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.maxaller.name/2008/07/reading-a-lot/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
