<?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>Triptych &#187; Administrator</title>
	<atom:link href="http://andrewwooldridge.com/blog/index.php/author/administrator/feed/" rel="self" type="application/rss+xml" />
	<link>http://andrewwooldridge.com/blog</link>
	<description>Building games on the web. (And other cool stuff)</description>
	<lastBuildDate>Tue, 17 Jan 2012 07:25:37 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.2</generator>
		<item>
		<title>Super Simple Drag and Drop with YUI</title>
		<link>http://andrewwooldridge.com/blog/2011/05/17/super-simple-drag-and-drop-with-yui/</link>
		<comments>http://andrewwooldridge.com/blog/2011/05/17/super-simple-drag-and-drop-with-yui/#comments</comments>
		<pubDate>Tue, 17 May 2011 20:03:22 +0000</pubDate>
		<dc:creator>Administrator</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://andrewwooldridge.com/blog/2011/05/17/</guid>
		<description><![CDATA[As you begin to build interactive web applications, you will undoubtedly want to experiment with Drag and Drop. No js library worth its salt would overlook this, but YUI really makes this easy to do and easy to extend to your needs. You can take some time to go dig around in YUI&#8217;s documentation which [...]]]></description>
			<content:encoded><![CDATA[<p>As you begin to build interactive web applications, you will undoubtedly want to experiment with Drag and Drop. No js library worth its salt would overlook this, but YUI really makes this easy to do and easy to extend to your needs.  You can take some time to go dig around in <a href="http://developer.yahoo.com/yui/3/dd/#simpledd">YUI&#8217;s documentation</a> which will serve you very well, but if you just want to see how this might work, here&#8217;s a simple example for you:</p>
<p><iframe style="width: 100%; height: 300px" src="http://jsfiddle.net/triptych/7hVzq/embedded/"></iframe></p>
<p>Basically we have two divs &#8211; #dragme and #dropme. We include &#8220;dd-drag&#8221; and &#8220;dd-drop&#8221; in the use statement to pick up the drag-and-drop functionality. This goes without saying that you need to include YUI:</p>
<div class="codesnip-container" >&lt;script src=&#8221;<a href="http://yui.yahooapis.com/3.3.0/build/yui/yui-min.js">http://yui.yahooapis.com/3.3.0/build/yui/yui-min.js</a>&#8221;<br />
    charset=&#8221;utf-8&#8243;&gt;&lt;/script&gt;</div>
<p>Note we also can listen in on what&#8217;s going on with these drag and drop elements &#8211; they emit all kinds of interesting information (see the docs) as you move your drag element around and move it over the drop element. For this demo I simply added two event listeners &#8211; one for when the drag element is over the drop element (making the div turn yellow) and when you actually drop your element in the right place (making the drop div turn orange).</p>
<p>As I said, there&#8217;s a lot of things going on behind the scenes, and you can do all kinds of great tricks with drag and drop from YUI &#8211; including things like constraining the element&#8217;s field of movement, and having a drag &#8220;shim&#8221; &#8211; meaning a semi-transparent element that &#8220;stands in&#8221; for the real one so that the browser does not slow to a crawl when you try to drag some complex component around. </p>
<p>The way drag and drop is implemented in YUI really show&#8217;s off the power of the library. You can even dynamically make something &#8220;draggable&#8221; by just using a &#8220;plugin&#8221; &#8211; which is a snippet of reusable YUI code that enhances whatever node it is attached to. </p>
]]></content:encoded>
			<wfw:commentRss>http://andrewwooldridge.com/blog/2011/05/17/super-simple-drag-and-drop-with-yui/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Updating YUI &#8220;page&#8221; in progress.</title>
		<link>http://andrewwooldridge.com/blog/2011/05/17/updating-yui-page-in-progress/</link>
		<comments>http://andrewwooldridge.com/blog/2011/05/17/updating-yui-page-in-progress/#comments</comments>
		<pubDate>Tue, 17 May 2011 17:20:38 +0000</pubDate>
		<dc:creator>Administrator</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://andrewwooldridge.com/blog/2011/05/17/</guid>
		<description><![CDATA[I&#8217;m finally getting around to updating my YUI page (look up there on the toolbar next to Unity and Contact). I hope to get all my related articles in there and also add great YUI links from around the web as well. If you know of a great article on YUI please let me know [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m finally getting around to updating my <a href="http://andrewwooldridge.com/blog/yui3/">YUI page</a> (look up there on the toolbar next to Unity and Contact). I hope to get all my related articles in there and also add great YUI links from around the web as well. If you know of a great article on YUI please let me know in the comments and I&#8217;ll add it (with credits).</p>
]]></content:encoded>
			<wfw:commentRss>http://andrewwooldridge.com/blog/2011/05/17/updating-yui-page-in-progress/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Build a Spreadsheet Driven Web Page with YUI,YQL, and Google Docs</title>
		<link>http://andrewwooldridge.com/blog/2011/05/05/build-a-spreadsheet-driven-web-page-with-yuiyql-and-google-docs/</link>
		<comments>http://andrewwooldridge.com/blog/2011/05/05/build-a-spreadsheet-driven-web-page-with-yuiyql-and-google-docs/#comments</comments>
		<pubDate>Thu, 05 May 2011 22:08:49 +0000</pubDate>
		<dc:creator>Administrator</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://andrewwooldridge.com/blog/2011/05/05/</guid>
		<description><![CDATA[I originally had an idea to create this article many moons ago, but never got around to it because during my interaction with Google Spreadsheets led to much frustration. However, it appears that a very smart fellow by the name of Martin Angelov wrote an article for Tutorialzine called &#8220;Dynamic FAQ Section w/ jQuery, YQL, [...]]]></description>
			<content:encoded><![CDATA[<p>I originally had an idea to create this article many moons ago, but never got around to it because during my interaction with Google Spreadsheets led to much frustration. However, it appears that a very smart fellow by the name of Martin Angelov wrote an article for Tutorialzine called &#8220;<a href="http://tutorialzine.com/2010/08/dynamic-faq-jquery-yql-google-docs/">Dynamic FAQ Section w/ jQuery, YQL, and Google Docs</a>&#8221; which cut through a lot of the complexity I was inadvertently  adding to my version. I highly recommend you take a moment and read that article before proceeding, because frankly I&#8217;m lazy and I&#8217;ll assume you did!</p>
<p>My version of this code changes very little except that we will use YUI &#8211; and dispense with the quote removal aspects, because YUI takes care of that for you.</p>
<p>Start out by making a spreadsheet like <a href="https://spreadsheets.google.com/ccc?key=0Al25RpMEgV12dExTeXgtamNqYXZlOTlUNDJSLTgwQlE&#038;hl=en">this one</a>.</p>
<p>You can try out the YQL query yourself with <a href="http://y.ahoo.it/7+c5SiRG">this link</a>.</p>
<p>Now publish it as a web page like the linked article describes and get the CVS share url.</p>
<p>Check out the code below and replace the spreadsheet url that you have created with the default one of mine:</p>
<p><iframe style="width: 100%; height: 300px" src="http://jsfiddle.net/triptych/FYNEp/embedded/"></iframe></p>
<p>Hit run and you should see your spreadsheet data showing up on the fiddle!</p>
<p>This is very powerful and way moreso than the linked article suggests. First of all you can also link a FORM to a spreadsheet. You might do this to allow certain users to input data into your spreadsheet in a way that insulates them from actually seeing the spreadsheet, or accidently making destructive changes. You might also create a very simple blog this way by creating a spreadsheet form that includes the title, content, etc. When you submit the form it would update your spreadsheet. You then have a website that grabs the output of that spreadsheet and displays either say the list of titles (a certain YQL query) or say the page details. You could get pretty elaborate with this.</p>
<p>Another use-case might be say a data-drive web game. You have all the monsters&#8217; images, hit points, colors, locations, etc defined in your spreadsheet. Then you could consume that information on the fly with say a canvas-based web game.  </p>
<p>The key idea I want you to get here is that you can now easily do:  Form->Spreadsheet->YUI+YQL->JSON->Website  with basically no complicated server database.  Huge idea!</p>
]]></content:encoded>
			<wfw:commentRss>http://andrewwooldridge.com/blog/2011/05/05/build-a-spreadsheet-driven-web-page-with-yuiyql-and-google-docs/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Build a Chrome App with YUI (2)</title>
		<link>http://andrewwooldridge.com/blog/2011/05/04/build-a-chrome-app-with-yui-2/</link>
		<comments>http://andrewwooldridge.com/blog/2011/05/04/build-a-chrome-app-with-yui-2/#comments</comments>
		<pubDate>Wed, 04 May 2011 19:59:49 +0000</pubDate>
		<dc:creator>Administrator</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://andrewwooldridge.com/blog/2011/05/04/</guid>
		<description><![CDATA[If you haven&#8217;t ready part 1 yet, no sweat. Just jump to the bottom of this post and click away, I&#8217;ll just hang out here till you are done. Back now? Great. I enjoyed that short break. This week it&#8217;s about getting back to the basics. I&#8217;ve been trying to get this app built for [...]]]></description>
			<content:encoded><![CDATA[<p>If you haven&#8217;t ready part 1 yet, no sweat. Just jump to the bottom of this post and click away, I&#8217;ll just hang out here till you are done.</p>
<p>Back now? Great. I enjoyed that short break.</p>
<p>This week it&#8217;s about getting back to the basics. I&#8217;ve been trying to get this app built for quite a while now, and I&#8217;ve managed to distill down the concepts I want to create for the first version. Essentially, you will have a set of &#8220;cards&#8221;. These cards represent the games that you might want to play at any given point in time. Each card will have a brief description as well as some stats about how many times you&#8217;ve played this game (if you launched it through Thwakr). You will also have a concept of a profile, which will allow you to set up your name, perhaps store user ids if you want (no passwords though). </p>
<p>For now, that&#8217;s it. Sign up. Log in, see some cards (that are games), click to play them, and record the play stats.  This may seem like a trivially small feature set, but we will see just how much work it&#8217;ll take to get this far.   For today I basically created the base HTML page with some markup for the cards, the profile, the about panel, and.. that&#8217;s about it.</p>
<p>You can see the source <a href="https://github.com/triptych/thwakr/blob/master/src/alpha/web/index.html">here</a>. </p>
<p>What I am hoping to do is get the functionality working first. Before I even think about the UI, and getting it all prettied up.  The first step in this is working on the HTML semantics. If you do this first, it helps you to think about the logical groupings in your app. What things are related, what kinds of clickable elements you want, etc etc. If you can get this down first, you will be a long way toward making your app a reality. Dont try to think about all the fancy CSS, or javascript interactivity. Think about how you want things to relate to one another, and how to organize them.</p>
<p>I&#8217;ve also decided to no use an special framework outside of just plain YUI + some gallery items for convenience. Perhaps in a later iteration but for now I really really just want to get it to &#8220;work&#8221;.  Also, we havent talked much about the Chrome app aspect of this at all yet. That will come later, as it actually is only a small part of the overall development thanks to browser makers working to make extensions to their browsers work as regular HTML, CSS, js pages. We&#8217;ll also cover some promising sites like <a href="http://crossrider.com/">Crossrider</a> which is kinda like PhoneGap only for cross browser extensions.</p>
<p>Next steps will be to begin building up some basic javascript objects which we will subsequently be using to harness together our application. I am conflicted about this because I know of a way that is &#8220;comfortable&#8221; to me, and I know of the way that is more &#8220;right&#8221;. (Via YUI Base).  I&#8217;ll keep you posted as to which way I go with this.</p>
<p>Previous article: <a href="http://andrewwooldridge.com/blog/2011/04/17/build-a-chrome-app-with-yui-1/">Part 1</a>.<br />
Next Article: Not yet.</p>
]]></content:encoded>
			<wfw:commentRss>http://andrewwooldridge.com/blog/2011/05/04/build-a-chrome-app-with-yui-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Dynamic Google Web Fonts via Javascript</title>
		<link>http://andrewwooldridge.com/blog/2011/05/02/dynamic-google-web-fonts-via-javascript/</link>
		<comments>http://andrewwooldridge.com/blog/2011/05/02/dynamic-google-web-fonts-via-javascript/#comments</comments>
		<pubDate>Mon, 02 May 2011 18:29:31 +0000</pubDate>
		<dc:creator>Administrator</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://andrewwooldridge.com/blog/2011/05/02/</guid>
		<description><![CDATA[I am a big fan of simplicity. Code you can just drop into a page and get going is way more useful than code you have to sit down and figure out all the configurations, different files to include, etc etc. I ran across this snippet while looking at the javascript libraries that Google now [...]]]></description>
			<content:encoded><![CDATA[<p>I am a big fan of simplicity. Code you can just drop into a page and get going is way more useful than code you have to sit down and figure out all the configurations, different files to include, etc etc. I ran across this snippet while looking at the javascript libraries that Google now hosts (including YUI3 now!). </p>
<p>Basically, if you want an easy way to insert dynamic web fonts on to your page, you can simply find the names of the fonts you want, and drop a variation of this code below into your site. Of course you need to do some CSS styling as well &#8211; but it takes out much of the tedious boilerplate code you may have had to write. Before using this code, however you should read up a bit on the <a href="http://code.google.com/apis/webfonts/docs/webfont_loader.html">Loader Library</a> details, so you understand what&#8217;s going on and potentially set it up to better suit your needs. </p>
<p><iframe style="width: 100%; height: 300px" src="http://jsfiddle.net/triptych/nRYef/embedded/"></iframe></p>
]]></content:encoded>
			<wfw:commentRss>http://andrewwooldridge.com/blog/2011/05/02/dynamic-google-web-fonts-via-javascript/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Build A Chrome App with YUI &#8211; (1)</title>
		<link>http://andrewwooldridge.com/blog/2011/04/17/build-a-chrome-app-with-yui-1/</link>
		<comments>http://andrewwooldridge.com/blog/2011/04/17/build-a-chrome-app-with-yui-1/#comments</comments>
		<pubDate>Sun, 17 Apr 2011 08:20:59 +0000</pubDate>
		<dc:creator>Administrator</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://andrewwooldridge.com/blog/2011/04/17/</guid>
		<description><![CDATA[A while back I was hoping to start a series of posts about &#8220;make it with YUI&#8221;. I wanted to feature fun mini-widgets and components built with YUI that would be useful to website builders. But the thing is, I was never really motivated to build anything &#8211; because I was not using it myself. [...]]]></description>
			<content:encoded><![CDATA[<p> A while back I was hoping to start a series of posts about &#8220;make it with YUI&#8221;. I wanted to feature fun mini-widgets and components built with YUI that would be useful to website builders. But the thing is, I was never really motivated to build anything &#8211; because I was not using it myself. It was an example for its own sake, which in the end leaves you sorta hollow. Instead I&#8217;ve been wanting to build a website that also lives as a &#8220;Chrome App&#8221; or &#8220;web app&#8221; &#8211; meaning it should behave like an application, but live at a certain URL. (And perhaps even have some elevated capabilities). I knew I was going to build this completely with YUI, so why not use this time as a way to teach more about YUI at the same time?</p>
<p>Why not indeed. So starting today I&#8217;ll begin posting a kinda developer diary / tutorial as I try to build an application called &#8220;Thwakr&#8221;. What does this app do? Well, as I build this app, it will become pretty obvious.  So, for today I simply have a few links for you:</p>
<p><a href="http://www.yuiblog.com/blog/2011/04/01/a-recipe-for-a-yui-3-application/">Recipe for a YUI Application</a><br />
<a href="http://msdn.microsoft.com/en-us/scriptjunkie/gg576919.aspx">Building Reusable Widgets with YUI3</a><br />
<a href="http://alloy.liferay.com/">Alloy UI</a></p>
<p>I&#8217;m basically in the planning stages.  I will need to use localstorage, drag and drop, and several things like toolbars, etc. This has led me to consider using Alloy UI for the intial version. I can get pretty far with this, as well as maintain my own code in YUI3.3. </p>
<p>I&#8217;m also going with a concept of &#8220;it always works&#8221; &#8211; though I don&#8217;t know the technical term for it. But what it means is that no matter what I check in, the basic premise always works and you do not see broken links, or have dead-end behaviors.</p>
<p>If you want to follow development of the SRC for this app, then bookmark this github link: <a href="https://github.com/triptych/thwakr/tree/master/src/alpha/web">https://github.com/triptych/thwakr/tree/master/src/alpha/web</a></p>
]]></content:encoded>
			<wfw:commentRss>http://andrewwooldridge.com/blog/2011/04/17/build-a-chrome-app-with-yui-1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Hidden YUI Gem &#8211; Frame (YUI abstraction for using iframes)</title>
		<link>http://andrewwooldridge.com/blog/2011/04/14/hidden-yui-gem-frame/</link>
		<comments>http://andrewwooldridge.com/blog/2011/04/14/hidden-yui-gem-frame/#comments</comments>
		<pubDate>Thu, 14 Apr 2011 23:44:45 +0000</pubDate>
		<dc:creator>Administrator</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://andrewwooldridge.com/blog/2011/04/14/</guid>
		<description><![CDATA[Once again as I dig deeper into YUI, I have unearthed another gem. This one will be very useful to you if you work with iframes at all. And you probably will if you ever decide to create embeddable content into other websites &#8211; because iframes give you a convenient way to insulate your own [...]]]></description>
			<content:encoded><![CDATA[<p>Once again as I dig deeper into YUI, I have unearthed another gem. This one will be very useful to you if you work with iframes at all. And you probably will if you ever decide to create embeddable content into other websites &#8211; because iframes give you a convenient way to insulate your own code from the CSS and JS of the &#8220;host&#8221; site. This module is called Y.Frame and is currently buried inside the HTML Rich Text Editor. I don&#8217;t know why these useful components are often placed inside another larger element, but I imagine it has to do with the fact that Editor probably is the first bit of code to use Frame. Eventually, if other components use it as well, it&#8217;ll probably be moved up to its own level.</p>
<p>Regardless, you can take advantage of it Today, given that you can just .use() it. Here&#8217;s some code:</p>
<p><iframe style="width: 100%; height: 300px" src="http://jsfiddle.net/triptych/7HHph/embedded/"></iframe></p>
<p>Now for a brief explanation.  There are several config settings that can simplify most of how you&#8217;d want to create an iframe. Y.Frame goes beyond this however an allows you to include CSS, linked CSS, set the DOCTYPE, insert some initial HTML and fire an event back when it is finished. You can even set it up so that any events that are triggered in the child iframe get sent up into the parent YUI instance so it can do interesting things like mess with the DOM, etc.</p>
<p>I&#8217;ve only barely scratched the surface of this component myself, but it already will replace a bunch of my own code. Note that it&#8217;s still in &#8220;beta&#8221; and even has some bugs (for some reason the &#8220;name&#8221; ATTR is supposed to set a classname on the iframe, but right now does &#8220;nothing&#8221; However the beauty of YUI is that you can file <a href="http://yuilibrary.com/projects/yui3/ticket/2530114#properties">bugs</a> since it is OSS).  I encourage you to take a look at the source, and of the editor source as well to see an example of how this is being used, and I encourage you to take advantage of this component yourself instead of hand-coding because it takes care of many IE specific problems.</p>
<p>Have you found a &#8220;hidden gem&#8221; in YUI? Let me know!</p>
]]></content:encoded>
			<wfw:commentRss>http://andrewwooldridge.com/blog/2011/04/14/hidden-yui-gem-frame/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>YUI via command line with YUI-REPL</title>
		<link>http://andrewwooldridge.com/blog/2011/04/07/yui-via-command-line-with-yui-repl/</link>
		<comments>http://andrewwooldridge.com/blog/2011/04/07/yui-via-command-line-with-yui-repl/#comments</comments>
		<pubDate>Thu, 07 Apr 2011 20:02:18 +0000</pubDate>
		<dc:creator>Administrator</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://andrewwooldridge.com/blog/2011/04/07/</guid>
		<description><![CDATA[Dav Glass is someone who you should make it a point to meet someday. Down-to-earth, smiling, and brilliant. One of the things I really find impressive is his ability to take your assumptions about tech and toss them out the door and show you how much cooler things could be. One of his recent projects [...]]]></description>
			<content:encoded><![CDATA[<p>Dav Glass is someone who you should make it a point to meet someday. Down-to-earth, smiling, and brilliant. One of the things I really find impressive is his ability to take your assumptions about tech and toss them out the door and show you how much cooler things could be. </p>
<p>One of his recent projects is something called <a href="https://github.com/davglass/yui-repl">YUI-REPL</a>.  Essentially this is a command-line instance of YUI that you can use to test code, debug issues, and try out lots of interesting features of YUI without having to deal with a browser or having a page hosted somewhere.  In order to try this out, you need to get <a href="http://nodejs.org/">node.js</a> working as well as <a href="http://npmjs.org/">npm</a>.   Node.js is essentially a &#8220;server side&#8221; version of a javascript runtime that can load documents, do complex tasks, and lots of things outside the scope of this post. Suffice to say, if you have not been reading about Node.js you need to spend the weekend getting up to speed. NPM is a package manager that allows you to load cool utilities and features that Node.js uses and can take care of all the dependancies each of those utilities may need in order to run.</p>
<p>YUI-REPL is very similar to the <a href="http://nodejs.org/docs/v0.3.1/api/repl.html">REPL in node.js</a>. You launch it via calling &#8220;yui3&#8243; and you now have an interactive command line that lets you load in websites, load in YUI javascript code, call other YUI modules into your code via &#8220;use&#8221; statements, and all kinds of other interesting things. For instance here is a call to <a href="http://developer.yahoo.com/yql/">YQL</a> that I created <a href="http://andrewwooldridge.com/blog/2011/04/07/creating-your-own-yql-webservice-with-no-server/">in my previous post</a> &#8212; it works flawlessly here and actually represtents another use case for this REPL &#8212; debugging your web services.  Mind blown yet?</p>
<p><img src="https://img.skitch.com/20110407-m3rnxbterb6dnehyhtxb121jkc.jpge" alt="YQL query and response." /></p>
<p>Here is a snippet from @davglass that highlights the load feature of YUI-REPL:</p>
<p><script src="https://gist.github.com/906348.js?file=example.txt"></script></p>
<p>Which loads this script:</p>
<p><script src="https://gist.github.com/906348.js?file=include.js"></script></p>
<p>And <a href="http://dl.dropbox.com/u/5669457/YUI3-REPL-2.mov">here is a screencast of YUI-REPL in action</a>.</p>
<p>In terms of what sort of future YUI-REPL will have, I have heard that there may be plans to fold it back into the core YUI library somehow &#8211; so that you&#8217;ll be able to use it anytime as well as having more developers taking a look at the code and adding new features. One in particular may be to allow you to pipe info into and out of the app like any other UNIX command &#8211; so you could imagine writing some interesting shell scripts or QA testing of your site via a single command line.  </p>
<p>I encourage you to go grab a copy yourself and check it out!</p>
]]></content:encoded>
			<wfw:commentRss>http://andrewwooldridge.com/blog/2011/04/07/yui-via-command-line-with-yui-repl/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
<enclosure url="http://dl.dropbox.com/u/5669457/YUI3-REPL-2.mov" length="1108948" type="video/quicktime" />
		</item>
		<item>
		<title>Creating your own YQL Webservice with No Server!</title>
		<link>http://andrewwooldridge.com/blog/2011/04/07/creating-your-own-yql-webservice-with-no-server/</link>
		<comments>http://andrewwooldridge.com/blog/2011/04/07/creating-your-own-yql-webservice-with-no-server/#comments</comments>
		<pubDate>Thu, 07 Apr 2011 18:22:53 +0000</pubDate>
		<dc:creator>Administrator</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://andrewwooldridge.com/blog/2011/04/07/</guid>
		<description><![CDATA[In a previous article I talked about making your own &#8220;web services&#8221; using javascript, data tables and YQL. Just a few minutes ago someone shared with me another bit of information that I realized could allow anyone to create a webservice with &#8220;NO&#8221; server of your own at all! Using github&#8217;s Gist service, you could [...]]]></description>
			<content:encoded><![CDATA[<p>In a <a href="http://andrewwooldridge.com/blog/2010/11/16/create-your-own-webservice-with-js-and-yql/">previous article</a> I talked about making your own &#8220;web services&#8221; using javascript, data tables and YQL. Just a few minutes ago someone shared with me another bit of information that I realized could allow anyone to create a webservice with &#8220;NO&#8221; server of your own at all!  Using github&#8217;s Gist service, you could create an XML file just via typing into a textbox (or copy-pasting from some other code &#8211; or even forking the one I have below!).</p>
<p>Here&#8217;s the YQL console command:</p>
<div class="codesnip-container" ><a href="http://developer.yahoo.com/yql/console/?q=use%20%22https%3A%2F%2Fgist.github.com%2Fraw%2F908359%2F3809546edb9241be39cb7cb10b9c2534e4ef4efc%2Fxplevel.xml%22%20as%20xpl%3B%20select%20">http://developer.yahoo.com/yql/console/?q=use%20%22https%3A%2F%2Fgist.github.com%2Fraw%2F908359%2F3809546edb9241be39cb7cb10b9c2534e4ef4efc%2Fxplevel.xml%22%20as%20xpl%3B%20select%20</a>*%20from%20xpl%20where%20basexp%3D%22100%22%20and%20numlevels%3D%2210%22%20%3B</div>
<p>For your copy/paste ease:<br />
<textarea rows="10" cols="60">http://developer.yahoo.com/yql/console/?q=use%20%22https%3A%2F%2Fgist.github.com%2Fraw%2F908359%2F3809546edb9241be39cb7cb10b9c2534e4ef4efc%2Fxplevel.xml%22%20as%20xpl%3B%20select%20*%20from%20xpl%20where%20basexp%3D%22100%22%20and%20numlevels%3D%2210%22%20%3B</textarea></p>
<p>Please see my <a href="http://andrewwooldridge.com/blog/2010/11/16/create-your-own-webservice-with-js-and-yql/">previous article</a> about the details of that service, and how to create your own. The crux of what I want to mention is this:</p>
<div class="codesnip-container" ><a href="https://gist.github.com/raw/908359/3809546edb9241be39cb7cb10b9c2534e4ef4efc/xplevel.xml">https://gist.github.com/raw/908359/3809546edb9241be39cb7cb10b9c2534e4ef4efc/xplevel.xml</a></div>
<p>Which is part of <a href="https://gist.github.com/908359">this gist</a>.<br />
Do you get how amazing this is? With literally no server of your own, and with a few carefully set up YQL statements, you can build a complex web service that you could share with anyone to do literally &#8220;anything&#8221; with other services, pages, data, etc.  </p>
<p>I hope you go from &#8220;whatever&#8221; to &#8220;WTF!&#8221; as fast as I did.</p>
<p>If you want to imagine some more mind-blowing things &#8212; check out the API docs for the javascript you can execute in  your open data table.</p>
<p><a href="http://developer.yahoo.com/yql/guide/yql-javascript-objects.html">http://developer.yahoo.com/yql/guide/yql-javascript-objects.html</a></p>
<p>Why are not more minds being totally blown by this?</p>
]]></content:encoded>
			<wfw:commentRss>http://andrewwooldridge.com/blog/2011/04/07/creating-your-own-yql-webservice-with-no-server/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Games in YUI: Moving Around</title>
		<link>http://andrewwooldridge.com/blog/2011/03/28/games-in-yui-moving-around/</link>
		<comments>http://andrewwooldridge.com/blog/2011/03/28/games-in-yui-moving-around/#comments</comments>
		<pubDate>Mon, 28 Mar 2011 17:13:37 +0000</pubDate>
		<dc:creator>Administrator</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://andrewwooldridge.com/blog/2011/03/28/</guid>
		<description><![CDATA[Part of the stated goal of this blog is to allow you to explore web technologies in creating games. Often I get off in the weeds with various web techniques, or some game news, so I&#8217;m hoping to narrow the focus a bit on helping you build web-based games using HTML, CSS, JS, and other [...]]]></description>
			<content:encoded><![CDATA[<p>Part of the stated goal of this blog is to allow you to explore web technologies in creating games. Often I get off in the weeds with various web techniques, or some game news, so I&#8217;m hoping to narrow the focus a bit on helping you build web-based games using HTML, CSS, JS, and other technologies like Node.js.</p>
<p>For the attention impaired amongst you, here&#8217;s the code up front:<br />
<iframe style="width: 100%; height: 300px" src="http://jsfiddle.net/triptych/am5u6/embedded/"></iframe></p>
<p>So, to try things out, click to the Result tab, move your mouse into the tan area (the little green box should turn blue) and use your arrow keys to move the little box around.  What do you think? No big deal right? Well, actually it was surprisingly involved .</p>
<p>First off I would like to thank Luke Smith for his work on the YUI Gallery item: Arrow Event. Without it, this would have been much more involved, and to be honest I built some keyboard controls for a canvas based rpg I created, and as soon as you have to deal with different browsers, things get complicated quickly. </p>
<p>The purpose of this code is to show you how you might create a movable element in a web game using the browser&#8217;s arrow keys. YUI has this amazing feature that allows you to create your own &#8220;events&#8221; &#8211; called <a href="http://developer.yahoo.com/yui/3/examples/event/event-synth-arrow.html">synthetic events</a>. I encourage you to check out that example as the example is not only very useful for games, but learning how to create your own events will be a handy tool for wiring up your game logic. </p>
<p>If you look at the modules I included, you&#8217;ll see <strong>node</strong>, <strong>transition</strong>, <strong>event-mouseenter</strong>, and <strong>gallery-event-arrow</strong>. Let&#8217;s run through these quickly. I use node, obviously, because I want to access elements on the page. I often wonder why node just doesnt come &#8220;for free&#8221;, and I remember there&#8217;s <a href="http://yui.yahooapis.com/3.3.0/build/simpleyui/simpleyui-min.js">SimpleYUI </a>which does that for you (it includes most of the very common modules you&#8217;d need for most of your javascript needs). I use transition because I want my little box to move around smoothly. If you look at the code, for every &#8220;move&#8221; event &#8211; we transition to a new location vs just setting the XY coordinates directly. </p>
<p>The two includes left are <strong>event-mouseenter</strong> and <strong>gallery-event-arrow</strong>. I use <a href="http://developer.yahoo.com/yui/3/event/#mouseentermouseleave">event-mouseenter</a> to try to force &#8220;focus&#8221; on the outer view. Focus is something that is a problem with events that you&#8217;ll have to deal with when you create games. I try to force focus on page load, and whenever the mouse moves over my game area. I try to avoid having to click into the play area, because there may be other elements in that view that listen for a click event, and may interfere with the action of &#8220;getting focus&#8221;.   Note, you could also have used &#8220;<a href="http://developer.yahoo.com/yui/3/event/#hover">hover</a>&#8221; which is a rollup of <strong>mouseenter</strong> and <strong>mouseleave</strong>.</p>
<p>The real meat of this article is related to <a href="http://yuilibrary.com/gallery/show/event-arrow">gallery-event-arrow</a>. Luke has abstracted out the work needed to accept arrow key presses, as well as listening across browsers for holding the key down vs just tapping the arrow key.  There are some gotchas that I ran into that I want to mention here. First off, I had to add a tabindex to the little box (of ID=&#8221;a&#8221;). This allows things that normally would not get &#8220;focus&#8221; and therefore events to actually get sent to the right element. Secondly once that element has focus, it has this convenient little focus box around it. I don&#8217;t know about you, but I don&#8217;t really want to have a little focus box around my game elements, unless there&#8217;s a specific reason, so in my CSS I added an #a:focus which does two things. It changes the box color to blue, so you know your box is movable, and I also suppressed the &#8220;outline&#8221; attribute. Thirdly, I ran into a bug where things would not work at all in Chrome. Initially I did not set the top: and left: attributes in CSS to the #a element. This resulted in Chrome trying to get the left and top attributes from getStyle() and getting &#8220;NaN&#8221;.  You could probably find another way to get around this limitation in Chrome &#8211; and I encourage you to do so. As a matter of fact, I encourage you to go fork this &#8220;fiddle&#8221;, find some cool way to use this code, and let me know what you come up with!</p>
<p>If you have any questions or comments please let me know! I wrote this while also attending a conference, so if something is goofy or my sentences seem to kinda run into nowhere, please feel free to ding me and I&#8217;ll fix em right up.</p>
]]></content:encoded>
			<wfw:commentRss>http://andrewwooldridge.com/blog/2011/03/28/games-in-yui-moving-around/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

