<?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>Blog &#187; javascript</title>
	<atom:link href="http://antimatter15.com/wp/tag/javascript/feed/" rel="self" type="application/rss+xml" />
	<link>http://antimatter15.com/wp</link>
	<description>this title probably isn&#039;t very original</description>
	<lastBuildDate>Fri, 23 Jul 2010 21:21:18 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>JavaScript &lt;canvas&gt; to (Animated) GIF</title>
		<link>http://antimatter15.com/wp/2010/07/javascript-to-animated-gif/</link>
		<comments>http://antimatter15.com/wp/2010/07/javascript-to-animated-gif/#comments</comments>
		<pubDate>Fri, 23 Jul 2010 21:19:54 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Ajax Animator]]></category>
		<category><![CDATA[Computing]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[actionscript]]></category>
		<category><![CDATA[as3gif]]></category>
		<category><![CDATA[documentation]]></category>
		<category><![CDATA[flash]]></category>
		<category><![CDATA[gif]]></category>
		<category><![CDATA[gifencoder]]></category>
		<category><![CDATA[github]]></category>
		<category><![CDATA[glif]]></category>
		<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://antimatter15.com/wp/?p=1202</guid>
		<description><![CDATA[I&#8217;ve tried this before but it didn&#8217;t work. &#60;canvas&#62; can&#8217;t do toDataURL(&#8216;image/gif&#8217;), and the primitive GLIF library couldn&#8217;t do much so I never had the opportunity to test my gif-merging code that I had. But I&#8217;m at it again, this time, porting it from the AS3GIF library, an awesomely comprehensive bitmap to binary gif encoder [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignright" src="http://github.com/antimatter15/jsgif/raw/master/Demos/converted_animation.gif" alt="This is the GIF which was generated from the canvas." width="300" height="150" /></p>
<p><img src="http://github.com/antimatter15/jsgif/raw/master/Demos/raw_canvas.png" alt="This is the raw canvas element saved as a non-animated PNG" /></p>
<p>I&#8217;ve <a href="http://antimatter15.com/wp/2009/08/webworkers-canvas-glif-gifencoder-client-side-animated-gif-generation/">tried this before</a> but it didn&#8217;t work. &lt;canvas&gt; can&#8217;t do toDataURL(&#8216;image/gif&#8217;), and the primitive GLIF library couldn&#8217;t do much so I never had the opportunity to test my gif-merging code that I had. But I&#8217;m at it again, this time, porting it from the AS3GIF library, an awesomely comprehensive bitmap to binary gif encoder that even supports LZW compression (and the patent has luckily expired. Yay!). AS3Gif is supposed to &#8220;play and encode animated GIFs&#8221;, but since web pages can usually natively play GIFs fine, it&#8217;s only a port of the GIFEncoder portions of the library. And it works really well. The rest of this post is copied from the<a href="http://github.com/antimatter15/jsgif"> Github readme</a>. Interesting how the w2_embed/anonybot embed post was a blog post turned into readme, this is a readme turned into blogpost. I&#8217;ll start with a link to the Github repo anyway:</p>
<p><a href="http://github.com/antimatter15/jsgif">http://github.com/antimatter15/jsgif</a></p>
<h3>Basic Usage</h3>
<p>Since it pretty much <em>is</em> GIFEncoder, you could consult the <a href="http://code.google.com/p/as3gif/wiki/How_to_use#The_GIFEncoder">as3gif how-to page</a></p>
<p>But there are some differences so I&#8217;ll cover it here anyway.<img class="alignright" src="http://github.com/antimatter15/jsgif/raw/master/Demos/clock.gif" alt="This is the GIF which was generated from the canvas." width="150" height="150" /></p>
<p>You first need to include the JS files. It&#8217;s probably best if you include it in this order, but it shouldnt&#8217; matter too much.</p>
<pre><code>&lt;script type="text/javascript" src="LZWEncoder.js"&gt;&lt;/script&gt;
&lt;script type="text/javascript" src="NeuQuant.js"&gt;&lt;/script&gt;
&lt;script type="text/javascript" src="GIFEncoder.js"&gt;&lt;/script&gt;
</code></pre>
<p>If you want to render the gif through an inline <code>&lt;img&gt;</code> tag or try to save to disk or send to server or anything that requires<br />
conversion into a non-binary string form, you should probably include <code>b64.js</code> too.</p>
<pre><code>&lt;script type="text/javascript" src="b64.js"&gt;&lt;/script&gt;
</code></pre>
<p>Simple enough right? Now to convert stuff to GIF, you need to have a working  or at least some imageData-esque array.</p>
<pre><code>&lt;canvas id="bitmap"&gt;&lt;/canvas&gt;
&lt;script&gt;
  var canvas = document.getElementById('bitmap');
  var context = canvas.getContext('2d');
  context.fillStyle = 'rgb(255,255,255)';
  context.fillRect(0,0,canvas.width, canvas.height); //GIF can't do transparent so do white

  context.fillStyle = "rgb(200,0,0)";
  context.fillRect (10, 10, 75, 50);   //draw a little red box
</code></pre>
<p>Now we need to init the GIFEncoder.</p>
<pre><code>  var encoder = new GIFEncoder();
</code></pre>
<p><em>If</em> you are making an animated gif, you need to add the following</p>
<pre><code>  encoder.setRepeat(0); //0  -&gt; loop forever
                        //1+ -&gt; loop n times then stop
  encoder.setDelay(500); //go to next frame every n milliseconds
</code></pre>
<p>Now, you need to tell the magical thing that you&#8217;re gonna start inserting frames (even if it&#8217;s only one).</p>
<pre><code>  encoder.start();
</code></pre>
<p>And for the part that took the longest to port: adding a real frame.</p>
<pre><code>  encoder.addFrame(context);
</code></pre>
<p>In the GIFEncoder version, it accepts a Bitmap. Well, that doesn&#8217;t exist in Javascript (natively, anyway) so instead, I use what I feel is a decent analogue: the canvas context. However, if you&#8217;re in a situation where you don&#8217;t have a real <code>&lt;canvas&gt;</code> element. That&#8217;s <em>okay</em>. You can set the second parameter to true and pass a imageData.data-esque array as your first argument. So in other words, you can do <code>encoder.addFrame(fake_imageData, true) </code>as an alternative. However, you <em>must</em> do an <code>encoder.setSize(width, height);</code> before you do any of the addFrames if you pass a imageData.data-like array. If you pass a canvas context, then that&#8217;s all okay, because it will automagically do a setSize with the canvas width/height stuff.</p>
<p>Now the last part is to finalize the animation and get it for display.</p>
<pre><code>  encoder.finish();
  var binary_gif = encoder.stream().getData() //notice this is different from the as3gif package!
  var data_url = 'data:image/gif;base64,'+encode64(binary_gif);
</code></pre>
<h3>Docs</h3>
<p>Each of the files exposes a single global (see, at least it&#8217;s considerate!). But since there&#8217;s three files, that means that there&#8217;s three globals. But two of them are more of supporting libraries that I don&#8217;t totally understand or care about enough to document. So I&#8217;m just gonna document GIFEncoder.</p>
<p><code>new GIFEncoder()</code> This is super parent function. You really don&#8217;t need the <code>new</code> keyword because It&#8217;s not really even using any special inheritance pattern. It&#8217;s a closure that does some <code>var blah = exports.blah = function blah(){</code> for no good reason. Anyway, it returns an object with a bunch of methods that the section will be devoted to documenting. Note that I&#8217;ve never tested more than half of these, so good luck.</p>
<p><code>Boolean start()</code> This writes the GIF Header and returns <code>false</code> if it fails.</p>
<p><code>Boolean addFrame(CanvasRenderingContext2D context)</code> This is the magical magic behind everything. This adds a frame.</p>
<p><code>Boolean addFrame(CanvasPixelArray image, true)</code> This is the magical magic behind everything. This adds a frame. This time you need<br />
you pass <code>true</code> as the second argument and then magic strikes and it loads your canvas pixel array (which can be a real array, I dont care and I think the program has learned from my constant apathy to also not care). But note that if you do, you must first manually call<br />
<code>setSize</code> which is happily defined just below this one.</p>
<p><code>void setSize(width, height)</code> Sets the canvas size. It&#8217;s supposed to be private, but I&#8217;m exposing it anyway. Gets called automagically as the size of the first frame if you don&#8217;t do that crappy hacky imageData.data hack.</p>
<p><code>void setDelay(int milliseconds)</code> the number of milliseconds to wait on each frame</p>
<p><code>void setDispose(int code)</code> Sets the GIF frame disposal code for the last added frame and any subsequent frames. Default is 0 if no transparent color has been set, otherwise 2. I have no clue what this means so I just copypasted<br />
it from the actionscript docs.</p>
<p><code>void setFrameRate(Number fps)</code> Sets frame rate in frames per second. Equivalent to <code>setDelay(1000/fps)</code>. I think that&#8217;s stupid.</p>
<p><code>void setQuality(int quality)</code> Sets quality of color quantization (conversion of images to the maximum 256 colors allowed by the GIF specification). Lower values (minimum = 1) produce better colors, but slow processing significantly. 10 is the default, and produces good color mapping at reasonable speeds. Values greater than 20 do not yield significant improvements in speed. BLAH BLAH BLAH. Whatever</p>
<p><code>void setRepeat(int iter)</code> Sets the number of times the set of GIF frames should be played. Default is 1; 0 means play indefinitely. Must be invoked before the first image is added.</p>
<p><code>void setTransparent(Number color)</code> Sets the transparent color for the last added frame and any subsequent frames. Since all colors are subject to modification in the quantization process, the color in the final palette for each frame closest to the given color becomes the transparent color for that frame. May be set to null to indicate no transparent color.</p>
<p><code>ByteArray finish()</code> Adds final trailer to the GIF stream, if you don&#8217;t call the finish method the GIF stream will not be valid.</p>
<p><code>String stream()</code> Yay the only function that returns a non void/boolean. It&#8217;s the magical stream function which should have been a getter which JS does support but I didnt&#8217; feel like making it a getter because getters are so weird and inconsistent. Like sure there&#8217;s the nice pretty <code>get</code> thing but I think IE9/8 doesn&#8217;t implement it because it&#8217;s non standard or something and replaced it with a hideously ugly blah blah. So Anyway, it&#8217;s a function. It returns a byteArray with three writeByte functions that you wouldn&#8217;t care about and a <code>getData()</code> function which returns a binary string with the GIF. There&#8217;s also a <code>.bin</code> attribute which contains an array with the binary stuff that I don&#8217;t care about.</p>
<h3>WebWorkers</h3>
<p>The process isn&#8217;t really the fastest thing ever, so you should use WebWorkers for piecing together animations more than a few frames long. You can find the rest of the WebWorkers section on the actual readme, because the rest is just a huge block of code with comments.</p>
<p><a href="http://github.com/antimatter15/jsgif">http://github.com/antimatter15/jsgif</a></p>
]]></content:encoded>
			<wfw:commentRss>http://antimatter15.com/wp/2010/07/javascript-to-animated-gif/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>gravity</title>
		<link>http://antimatter15.com/wp/2010/06/gravity/</link>
		<comments>http://antimatter15.com/wp/2010/06/gravity/#comments</comments>
		<pubDate>Fri, 11 Jun 2010 03:05:28 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[buzzword]]></category>
		<category><![CDATA[canvas]]></category>
		<category><![CDATA[game]]></category>
		<category><![CDATA[html5]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[raphael]]></category>

		<guid isPermaLink="false">http://antimatter15.com/wp/?p=982</guid>
		<description><![CDATA[Here&#8217;s my foray into the flash-esque html5 game arena. It&#8217;s a simple game built initially in &#60;canvas&#62; but later scrapped for Raphael because I guess it&#8217;s something more suitable for svg than canvas. The interface is fairly simple, you click to start the game, where your projectile is sent off at the velocity relative to [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://antimatter15.com/misc/gravity2.html"><img class="alignnone size-full wp-image-1013" title="gravity2 screenshot" src="http://antimatter15.com/wp/wp-content/uploads/2010/05/antimatter15.com-misc-gravity2.html-Chromium_044.png" alt="" width="547" height="644" /></a></p>
<p><a href="http://antimatter15.com/misc/gravity2.html">Here&#8217;s my foray into the flash-esque html5 game arena</a>. It&#8217;s a simple game built initially in &lt;canvas&gt; but later scrapped for Raphael because I guess it&#8217;s something more suitable for svg than canvas. The interface is fairly simple, you <strong>click to start the game</strong>, where your projectile is sent off at the velocity relative to green blob in the center. Once it&#8217;s launched, the projectile is affected by the gravitational field of all the planets in some fairly pretty near-orbits. Once the projectile is in motion, <strong>clicking drops a new planet</strong> at where your cursor is, <strong>holding down makes the planet grow</strong>. The objective is to have the projectile not accelerate off the screen.</p>
<p>As per <a href="http://en.wikipedia.org/wiki/Kepler's_laws_of_planetary_motion">Kepler&#8217;s laws</a>, getting near a planet produces the <a href="http://en.wikipedia.org/wiki/Gravity_assist">&#8220;gravitational slingshot&#8221;</a> effect. Since the projectile tends to fly toward the center of planets, a magical <a href="http://en.wikipedia.org/wiki/Divide_by_zero">divide-by-zero</a> causes the infinite acceleration toward doom.</p>
<p>As with several other of my  recent projects, it supports various configuration options via the url query string. If you don&#8217;t know how it works, basically, you append ?opt1=val1&amp;opt2&#8230; to the url. Example: <a href="http://antimatter15.com/misc/gravity2.html?grav=4">gravity2.html?grav=4</a> , simply <a href="http://antimatter15.com/misc/gravity2.html?fastest">gravity2.html?fastest</a> or a combo of <a href="http://antimatter15.com/misc/gravity2.html?fastest&amp;grav=4&amp;random">gravity2.html?fastest&amp;grav=4&amp;random</a>. The current options are <em>fastest</em> to prevent the targeting of 80fps (accepts no args), <em>target</em> the target fps (obviously can not be used with fastest, in the case, <em>fastest</em> takes precedence) and it accepts one numerical argument, the default is 80. <em>grav</em> accepts one numerical argument, the default is 4 and is the attraction of the planets (<a href="http://antimatter15.com/misc/gravity2.html?grav=0">zero isn&#8217;t very fun</a>). <em>random </em>makes the planets start off in random places rather than the predefined magical positioning.</p>
<p>Feel free to post highscores in the comments.</p>
]]></content:encoded>
			<wfw:commentRss>http://antimatter15.com/wp/2010/06/gravity/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>μwave: updates</title>
		<link>http://antimatter15.com/wp/2010/06/%ce%bcwave-updates/</link>
		<comments>http://antimatter15.com/wp/2010/06/%ce%bcwave-updates/#comments</comments>
		<pubDate>Thu, 03 Jun 2010 18:34:26 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Microwave]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Wave]]></category>
		<category><![CDATA[ajax]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[google wave]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[microwave]]></category>
		<category><![CDATA[tasty food]]></category>
		<category><![CDATA[update]]></category>
		<category><![CDATA[wave]]></category>

		<guid isPermaLink="false">http://antimatter15.com/wp/?p=1001</guid>
		<description><![CDATA[Over a few days, things can change fairly quickly. There have been several speed improvements, a new Forum-Style blip rendering option which arranges blip linearly by the time edited with each containing a formatted quote of the parent to establish context. Attachments are now fully supported, including thumbnails and download links. The operations engine was [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://antimatter15.com/wp/wp-content/uploads/2010/06/microwave62.png"><img class="alignright size-full wp-image-1004" title="μwave June 2 Wave View" src="http://antimatter15.com/wp/wp-content/uploads/2010/06/microwave62.png" alt="" width="319" height="535" /></a><a href="http://antimatter15.com/wp/wp-content/uploads/2010/06/microwave62s.png"><img class="alignnone size-full wp-image-1005" title="Microwave June 2 Search" src="http://antimatter15.com/wp/wp-content/uploads/2010/06/microwave62s.png" alt="" width="319" height="535" /></a></p>
<p><a href="http://antimatter15.com/wp/2010/05/%CE%BCwave-lightweight-mobile-wave-client/">Over a few days,</a> things can change fairly quickly. There have been several <strong>speed improvements</strong>, a new <strong>Forum-Style blip rendering</strong> option which arranges blip linearly by the time edited with each containing a formatted quote of the parent to establish context. <strong>Attachments</strong> are now fully supported, including thumbnails and download links. The operations engine was totally rewritten which uses asynchronous XMLHttpRequest, a new callback based system and support for a batch operations (which means fewer requests and faster responses). A wavelet header containing a list of all participants in the entire wave has been added, as well as an <strong>Add Participant </strong>button. A <strong>specialized, extremely fast gadget viewer </strong>was added, which allows for blazingly fast rendering of two popular gadgets (and more will come), it works by bypassing the entire gadget infrastructure and loading trusted code directly inline with the DOM. There is a &#8220;New Wave&#8221; button which allows people to <strong>create new waves directly from the client</strong>. The OAuth backend was authenticated with google, for more secure login transactions. Blips have a <strong>new context menu</strong> which allows for features such as <strong>Delete Blip, Edit Blip and Change Title</strong>. A <a href="http://antimatter15.com/misc/read/?googlewave.com!w+mrqWFs0vA">full changelog can be found here</a>.</p>
<p><a href="http://micro-wave.appspot.com">Try it out.</a></p>
]]></content:encoded>
			<wfw:commentRss>http://antimatter15.com/wp/2010/06/%ce%bcwave-updates/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>2.3KB JS Library with ajax, animation, dom manipulation, json encoding</title>
		<link>http://antimatter15.com/wp/2010/03/2-3kb-js-library-with-ajax-animation-dom-manipulation-json-encoding/</link>
		<comments>http://antimatter15.com/wp/2010/03/2-3kb-js-library-with-ajax-animation-dom-manipulation-json-encoding/#comments</comments>
		<pubDate>Sun, 07 Mar 2010 21:29:06 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[library]]></category>
		<category><![CDATA[vX JS]]></category>

		<guid isPermaLink="false">http://antimatter15.com/wp/?p=931</guid>
		<description><![CDATA[vX was an old project which aimed to do lots of nifty things in the least code possible (3KB without gzip!), but among its goals, developer friendliness wasn&#8217;t present. So now, I made a new library, this one is 5KB before gzip, and supports most of what vX does, but with DOM manipulation as well, in a [...]]]></description>
			<content:encoded><![CDATA[<p>vX was an old project which aimed to do lots of nifty things in the least code possible (3KB without gzip!), but among its goals, developer friendliness wasn&#8217;t present. So now, I made a new library, this one is 5KB before gzip, and supports most of what vX does, but with DOM manipulation as well, in a jquery-like manner, and animations with queuing and easing. The new library (which doesn&#8217;t yet have a name) aims to be really lightweight (which really doesn&#8217;t matter much), while being more developer friendly.</p>
<p>For example, I can select all elements with the class &#8220;test&#8221; using _.cls(&#8220;test&#8221;), and make them purple by doing _.cls(&#8220;test&#8221;).css(&#8220;color&#8221;,&#8221;purple&#8221;) similar to jQuery. I can do _.id(&#8220;yay&#8221;).load(&#8220;lib.js&#8221;) to load something using ajax. Creating elements is pretty easy too, say I want to load a random script, I can do _.create(&#8220;script&#8221;).attr(&#8220;src&#8221;,&#8221;url&#8221;).appendTo(_.tag(&#8220;body&#8221;)) and I can add events to something using _.tag(&#8220;button&#8221;).index(0).on(&#8220;click&#8221;,function(e){alert(&#8220;yay&#8221;)}).</p>
<p>Here&#8217;s a nice little demo of what it can do <a href="http://jsbin.com/owuge/31">http://jsbin.com/owuge/31</a></p>
<p>I intended to post this back in March 7th, but I was working on a rewrite of the library, which would be a tiny bit larger but implement CSS-selectors and be easier to maintain.</p>
]]></content:encoded>
			<wfw:commentRss>http://antimatter15.com/wp/2010/03/2-3kb-js-library-with-ajax-animation-dom-manipulation-json-encoding/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Wave Reader 4.6 &#8211; Insanely Fast Edition</title>
		<link>http://antimatter15.com/wp/2010/01/wave-reader-4-6/</link>
		<comments>http://antimatter15.com/wp/2010/01/wave-reader-4-6/#comments</comments>
		<pubDate>Fri, 15 Jan 2010 04:08:01 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Wave]]></category>
		<category><![CDATA[Wave Reader]]></category>
		<category><![CDATA[fast]]></category>
		<category><![CDATA[google wave]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[wave]]></category>
		<category><![CDATA[wave reader]]></category>
		<category><![CDATA[woot]]></category>

		<guid isPermaLink="false">http://antimatter15.com/wp/?p=913</guid>
		<description><![CDATA[Loading a 500 blip wave in Google&#8217;s GWT Client takes 3:34 to get to a usable state (Where the scroll bar works) on a 3ghz Core2 Duo (whose extra core admittedly won&#8217;t do much). It also uses 972 MB of RAM. Loading the same wave in my Wave Reader, takes 678 milliseconds. A 315x speed-up. [...]]]></description>
			<content:encoded><![CDATA[<p>Loading a 500 blip wave in Google&#8217;s GWT Client takes 3:34 to get to a usable state (Where the scroll bar works) on a 3ghz Core2 Duo (whose extra core admittedly won&#8217;t do much). It also uses 972 MB of RAM.</p>
<p>Loading the same wave in my Wave Reader, take<strong>s 678 milliseconds. A 315x speed-up</strong>. Also, my client is totally unoptimized, pure 30KB of javascript. On top of those features, <strong>anyone can view waves<span style="font-weight: normal;">, without a google account, </span>individual blips can be linked </strong>to, it supports rendering almost everything Wave can, that is <strong>gadgets, inline replies, nesting, </strong>font color/size, italics, bold, everything you could probably expect. Interestingly, when you add an attachment to Wave, and delete the parent blip, it still stores the attachment on the current wave state, and this client can display/link to them without using Playback. There is an option to <strong>generate plain simple HTML</strong> for turning a Wave into a standalone page or Website. <strong>Private waves can be exposed read-only as a website</strong> simply by adding the gwavereader@googlewave.com username.</p>
<p>Using it is simple, take  a Wave https://wave.google.com/wave/#restored:wave:<strong>googlewave.com!w%252Br5lewFqCA</strong> and then put it after the Wave Reader URL http://antimatter15.com/misc/wave/read.html?<strong>googlewave.com!w%252Br5lewFqCA</strong><br /> And magically you have a super awesome URL to link to.</p>
<p>You can learn some tricks on how to use it to do some more awesome things <a href="http://antimatter15.com/misc/wave/read.html?googlewave.com!w%252BrnG0vaFXA">http://antimatter15.com/misc/wave/read.html?googlewave.com!w%252BrnG0vaFXA</a> such as the before mentioned HTML generation.</p>
<p>Samples (Some random waves):<br /> <a href="http://antimatter15.com/misc/wave/read.html?googlewave.com!w%252Br5lewFqCA">http://antimatter15.com/misc/wave/read.html?googlewave.com!w%252Br5lewFqCA</a> (New for 4.6 Inline reply support)<br /> <a href="http://antimatter15.com/misc/wave/read.html?Ze3l0mj0A">http://antimatter15.com/misc/wave/read.html?Ze3l0mj0A</a><br /> <a href="http://antimatter15.com/misc/wave/read.html?oPg9HfEXE&amp;beta">http://antimatter15.com/misc/wave/read.html?oPg9HfEXE&amp;beta</a><br /> <a href="http://antimatter15.com/misc/wave/read.html?Mu9eK7j2H">http://antimatter15.com/misc/wave/read.html?Mu9eK7j2H</a><br /> <a href="http://antimatter15.com/misc/wave/read.html?AhbL5fooD&amp;beta">http://antimatter15.com/misc/wave/read.html?AhbL5fooD&amp;beta</a><br /> <a href="http://antimatter15.com/misc/wave/read.html?googlewave.com!w+UDMZOGpSG">http://antimatter15.com/misc/wave/read.html?googlewave.com!w+UDMZOGpSG</a></p>
]]></content:encoded>
			<wfw:commentRss>http://antimatter15.com/wp/2010/01/wave-reader-4-6/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Wave Unread Navigator</title>
		<link>http://antimatter15.com/wp/2009/12/wave-unread-navigator/</link>
		<comments>http://antimatter15.com/wp/2009/12/wave-unread-navigator/#comments</comments>
		<pubDate>Sun, 13 Dec 2009 17:42:59 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Wave]]></category>
		<category><![CDATA[chrome]]></category>
		<category><![CDATA[chrome extension]]></category>
		<category><![CDATA[clone]]></category>
		<category><![CDATA[gmail]]></category>
		<category><![CDATA[google wave]]></category>
		<category><![CDATA[greasemonkey]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[navigator]]></category>
		<category><![CDATA[userscript]]></category>
		<category><![CDATA[wave]]></category>

		<guid isPermaLink="false">http://antimatter15.com/wp/?p=899</guid>
		<description><![CDATA[I made an extension which shows a green sign (like gmail) on the side whenever there are blips outside the viewport. It allows you to quickly and effectively use keyboard navigation without blindly checking above and below, or generally scroll without needing to guess the position. It comes as a Chrome Extension and also as [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://antimatter15.com/wp/wp-content/uploads/2009/12/screenshot_050.png"><img class="size-full wp-image-898 alignright" title="screenshot_050" src="http://antimatter15.com/wp/wp-content/uploads/2009/12/screenshot_050.png" alt="screenshot_050" width="291" height="259" /></a>I made an extension which shows a green sign (like gmail) on the side whenever there are blips outside the viewport. It allows you to quickly and effectively use keyboard navigation without blindly checking above and below, or generally scroll without needing to guess the position.</p>
<p>It comes as a <a href="https://chrome.google.com/extensions/detail/jncflgepcddhcejhofdojlkjgjhcfmpc">Chrome Extension</a> and also as a <a href="http://antimatter15.com/misc/wave/wavenavigation.user.js">Greasemonkey Userscript</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://antimatter15.com/wp/2009/12/wave-unread-navigator/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
		<item>
		<title>ShinyTouch/JS</title>
		<link>http://antimatter15.com/wp/2009/08/shinytouchjs/</link>
		<comments>http://antimatter15.com/wp/2009/08/shinytouchjs/#comments</comments>
		<pubDate>Sat, 29 Aug 2009 02:17:23 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[ShinyTouch]]></category>
		<category><![CDATA[Touchscreens]]></category>
		<category><![CDATA[actionscript]]></category>
		<category><![CDATA[algorithm]]></category>
		<category><![CDATA[canvas]]></category>
		<category><![CDATA[complicated]]></category>
		<category><![CDATA[elitist]]></category>
		<category><![CDATA[flash]]></category>
		<category><![CDATA[future]]></category>
		<category><![CDATA[hideous]]></category>
		<category><![CDATA[html 5]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[js]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[port]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[shiny]]></category>
		<category><![CDATA[ugly]]></category>
		<category><![CDATA[video]]></category>
		<category><![CDATA[webcam]]></category>

		<guid isPermaLink="false">http://antimatter15.com/wp/?p=799</guid>
		<description><![CDATA[Yay for yet another demo that strives to mix an mash almost everything HTML5 related! ShinyTouch in JS dumps the stuff from a &#60;video&#62; tag with ogg encoded video (well, almost all video from linux is ogg encoded so it&#8217;s just whatever format i got first from cheese). It gets dumped into &#60;canvas&#62; and getImageData [...]]]></description>
			<content:encoded><![CDATA[<p>Yay for yet another demo that strives to mix an mash almost everything HTML5 related! ShinyTouch in JS dumps the stuff from a &lt;video&gt; tag with ogg encoded video (well, almost all video from linux is ogg encoded so it&#8217;s just whatever format i got first from cheese). It gets dumped into &lt;canvas&gt; and getImageData does it&#8217;s magic.</p>
<p>Interestingly, if you don&#8217;t use the video and just do data from a raw image, you get upwards of 125fps on V8. Adding the video, it ceases to work on Chromium (maybe a linux thing? <a href="http://code.google.com/p/chromium/issues/detail?id=16225">this</a> tells me it&#8217;s just linux, but you can never be so sure).</p>
<p><em>//At this point, run away as the algorithm gets messy and hackish</em></p>
<p>So the thing just searches from right to left up to down within the quad. When it finds a column of something that fits the rgb range of the finger that is larger than a certain threshold, it checks for a reflection from the point. If it detects a reflection then yay! it throws the data at the perspective warper (based on a python one which is based on a C# one and though it would probably be easier to port from C# to JS making long chains of derivative work is fun). If there wasnt a reflection then it logs that and if that number is larger than some othe rthreshold then it kills the scanning and goes on with it&#8217;s life. The reflection algorithm just takes the point 5 pixels to the right and assumes that would be a reflection if there was one and a point 15px above and 5px to the left (nasty stuff) and takes the hue value from their RGB values. It takes the absolute value of the difference of the hue values multiplied by 100 (or 200 in the python version) and compares it with a preset configuration variable.</p>
<p>So now that that horrible algorithm which was just whatever came to my little totally untrained mind first. But it works semi-decently, at least for me. But you can hopefully see how nasty it&#8217;s inner workings are and it inspires people to clean it up. It&#8217;s quite a bit more readable than the Python version and only 200 lines of JS so it won&#8217;t be <em>too</em> hard to understand.</p>
<p>But since HTML5 has no Video capture thing for webcams, and my webcam doesn&#8217;t work with flash so I can&#8217;t use that canvas&lt;-flash webcam bridge i built, uh, almost 2 years ago. So now you just get to gaze at my finger moving for like 20 seconds!</p>
<p><a href="http://antimatter15.com/misc/shiny/shinytouch.html">http://antimatter15.com/misc/shiny/shinytouch.html</a></p>
]]></content:encoded>
			<wfw:commentRss>http://antimatter15.com/wp/2009/08/shinytouchjs/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Freemovie/JS: Pure Javascript SWF Generator</title>
		<link>http://antimatter15.com/wp/2009/08/freemoviejs/</link>
		<comments>http://antimatter15.com/wp/2009/08/freemoviejs/#comments</comments>
		<pubDate>Mon, 17 Aug 2009 16:12:28 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Ajax Animator]]></category>
		<category><![CDATA[Other]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[flash]]></category>
		<category><![CDATA[freemovie]]></category>
		<category><![CDATA[future]]></category>
		<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://antimatter15.com/wp/?p=751</guid>
		<description><![CDATA[I&#8217;m making a crude python script that translates PHP to JS rather hideously. It probably will not work on any other codebase. It was a script quickly hacked together to one purpose. Freemovie is FreeMovie is an SWF generator library written in PHP and ported to Ruby. FreeMovie can be used to develop Web and [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m making a crude python script that translates PHP to JS rather hideously. It probably will not work on any other codebase. It was a script quickly hacked together to one purpose.</p>
<p><a href="http://sourceforge.net/projects/freemovie/">Freemovie </a>is</p>
<blockquote><p>FreeMovie is an SWF generator library written in PHP and ported to Ruby. FreeMovie can be used to develop Web and desktop aplications.</p></blockquote>
<p><span style="text-decoration: line-through;">Speaking of the Ruby port, I can&#8217;t find it. So if anyone finds it, I think it might be useful somewhere.</span> Found it in the CVS, it&#8217;s really incomplete compared to the PHP version.</p>
<p>The machine translated code (Not *entirely* autogenerated, I wrote a line or two of it) is not too hideous, the tabbing is slightly off, but it&#8217;s at least mostly readable. It was a lot worse 2 hours ago (half of the lines had indentation, other without any, debugging comments everywhere saying useless and distracting things).</p>
<p>The translator is only 107 lines of (hideous code, though the language is beautiful, I guess if you loved JS enough, you could try running the program though <a href="http://www.skulpt.org/">skulpt</a>) python (+ 20 or so in another file to change chr() to String.fromCharCode, etc). After that, it uses 6 PHP compatibility functions and 5 from the PHP.js project to cover the features that I&#8217;m too lazy to  put in the compiler or are just not features in JS.</p>
<p><a href="http://antimatter15.com/misc/freemovie/js/demo/fm-demo-0.htm">http://antimatter15.com/misc/freemovie/js/demo/fm-demo-0.htm</a></p>
<p>The above demo generates a flash image entirely client-side, though the resulting base64 encoded data is sent to be decoded on the server since you can&#8217;t load a SWF from a data-url. If someone finds out how, it would be cool to tell me.</p>
<p>A big issue though, is that for some odd reason half the shapes don&#8217;t work. The ones in the demo work, but all filled shapes, and the circles/arcs do not work.</p>
]]></content:encoded>
			<wfw:commentRss>http://antimatter15.com/wp/2009/08/freemoviejs/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Distributed Computing Take III</title>
		<link>http://antimatter15.com/wp/2008/12/distributed-computing-take-iii/</link>
		<comments>http://antimatter15.com/wp/2008/12/distributed-computing-take-iii/#comments</comments>
		<pubDate>Tue, 30 Dec 2008 21:19:10 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Distributed]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[algorithm]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[pi]]></category>
		<category><![CDATA[wikipedia]]></category>

		<guid isPermaLink="false">http://antimatter15.110mb.com/wp/?p=347</guid>
		<description><![CDATA[I donno why, but i&#8217;m revisiting this. I was trawling across Wikipedia one day, and I got to the article about Pi. I tried distributing Pi a while ago, actually, before I did the hashes. But I never ended up implementing it because it didn&#8217;t seem feasable, as all the algorithims I encountered (or tried [...]]]></description>
			<content:encoded><![CDATA[<p>I donno why, but i&#8217;m revisiting this. I was trawling across Wikipedia one day, and I got to the article about Pi. I tried distributing Pi a while ago, actually, before I did the hashes. But I never ended up implementing it because it didn&#8217;t seem feasable, as all the algorithims I encountered (or tried porting) required lots of memory, something very hard to distribute for this scenario. But this time, I found <a href="http://en.wikipedia.org/wiki/Computing_%C3%8F%C2%80#Digit_extraction_methods">these</a>. Looking through them, and googling in the process, I found <a href="http://www.omegacoder.com/?p=91">http://www.omegacoder.com/?p=91</a>, and ported it over to Javascript. It was relatively slow compared to the SuperPi implementation in Javascript, but it was easily distributed.</p>
<p>One problem though, is that it gets slower every iteration (to find the net block of digits). Finding .<span style="font-size: small;">141592653 will be roughly 20ms faster than the next 9 digits (it processes in blocks of 9). Not only would it take longer, but it occupied 100% of the CPU, and it would pop up that ever-annoying &#8220;This script may make your computer non responsive&#8221; window. So I implemented <a href="http://www.julienlecomte.net/blog/2007/10/28/">this</a> pattern to make it not lock up any browser other than Chrome (and possibly WebKit Nightly).</span></p>
<p><span style="font-size: small;">Still, it would take up 100% of the CPU. I ran it overnight and got to digit 17,000.</span></p>
<p><span style="font-size: small;">Eventually, it would take about half an hour for a single iteration (at the 20000th digit). With web-based distributed computing, I can&#8217;t rely much more time than what Google Analytics reports to be 00:02:24 (my Average Time on Site). And that&#8217;s half an hour with a 3ghz Intel Core 2 Duo (it&#8217;s dual core, but the script, is single threaded). </span></p>
<p><span style="font-size: small;">I then split the function into smaller parts. the main function was split up, and the loops were divided across users. Now, it can scale easily. It uses virtually no visible CPU. and fits well into that 2 minute timeframe.</span></p>
<p><span style="font-size: small;">Try it out <a href="http://www.antimatter15.com/misc/pisect/test.htm">here</a>, but don&#8217;t stay too long, because i only set there to be 500 &#8220;jobs&#8221;.<br />
</span></p>
]]></content:encoded>
			<wfw:commentRss>http://antimatter15.com/wp/2008/12/distributed-computing-take-iii/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Controlling A Native App from a Javascript Desktop</title>
		<link>http://antimatter15.com/wp/2008/08/controlling-a-native-app-from-a-javascript-desktop/</link>
		<comments>http://antimatter15.com/wp/2008/08/controlling-a-native-app-from-a-javascript-desktop/#comments</comments>
		<pubDate>Fri, 29 Aug 2008 17:13:37 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[ajax]]></category>
		<category><![CDATA[ExtJS]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[remote desktop]]></category>
		<category><![CDATA[vnc]]></category>

		<guid isPermaLink="false">http://antimatter15.110mb.com/wp/?p=272</guid>
		<description><![CDATA[Well, I worked on a sort of VNC-like solution to controlling native desktop applications from a remote PC. It&#8217;s an interesting concept, I settled with something less than easy to use, and less than really feasable. It&#8217;s a Proof of concept, and it&#8217;s likely I won&#8217;t work on it again (Like ForkSwif). It is an [...]]]></description>
			<content:encoded><![CDATA[<p>Well, I worked on a sort of VNC-like solution to controlling native desktop applications from a remote PC. It&#8217;s an interesting concept, I settled with something less than easy to use, and less than really feasable. It&#8217;s a Proof of concept, and it&#8217;s likely I won&#8217;t work on it again (Like ForkSwif).</p>
<p>It is an application (module) on a hacked Ext 2.0 Desktop example that uses Ajax (Polling) to query a local PHP proxy to query a remote desktop. The remote desktop is running some software (powered by .NET sadly&#8230;) that captures the window&#8217;s contents, does a diff to see if there are modifications and where (only sends updates to changed parts of the screen, sorta like VNC). It base64 encodes it and sends it along HTTP to the proxy, which sends it to the javascript client.</p>
<p>The client can send events to be repeated on the remote desktop, currently only left mousedown and mouseup (so, basically only clicking), but using the Keyboard should be easy enough.</p>
<p>I imagine that a more feasable option is to create a javascript X11 client, taking proxied connections to a X session under SSH so it is better with window-specificness, and an overall more stable platform, so you could also run multiple applications simultaneously on the desktop.</p>
<p>here&#8217;s an early screenshot:</p>
<div class="wp-caption alignnone" style="width: 809px"><img title="Controlling A native desktop app from a javascript desktop" src="http://i92.photobucket.com/albums/l30/antimatter15/jsvnc.png" alt="Controlling A native desktop app from a javascript desktop" width="799" height="333" /><p class="wp-caption-text">Controlling A native desktop app from a javascript desktop (early build)</p></div>
<p>Files here:</p>
<p><a href="../../misc/coolstuff.zip" target="_blank">http://antimatter15.110mb.com/misc/coolstuff.zip</a></p>
<p>Extract desktop2 to your Apache server, start Windows Calculator (or another app of your choosing). Run Screen.exe, type the app title, press &#8220;Get Handle&#8221; and check the &#8220;Run Server&#8221; box. Navigate to the desktop.html (on your PHP-enabled apache), and start the &#8220;NV Window&#8221; app.</p>
<p>To be able to control the app, you have to set it to your network ip (not localhost) on a VM or a different computer. and configure sample.js at line 191.</p>
<p>proxy: &#8220;gdat.php?url=&#8221;,<br />
updateurl : &#8220;<a href="http://localhost:12345/" target="_blank">http://localhost:12345</a>&#8220;,<br />
baseurl : &#8220;<a href="http://localhost:12345/base" target="_blank">http://localhost:12345/base</a>&#8220;,<br />
showimg : false,<br />
uinterval: 1000,<br />
updater: null,<br />
xoffset: -8,<br />
yoffset: -28,</p>
<p>change localhost to the server&#8217;s IP. And tick &#8220;Control Desktop&#8221;</p>
<p>Note that you need firebug.</p>
<p>If i can think of a name for the app, i&#8217;ll be sure to creakte a google code project for it. so if anyone want&#8217;s the source, think of a name for it.</p>
]]></content:encoded>
			<wfw:commentRss>http://antimatter15.com/wp/2008/08/controlling-a-native-app-from-a-javascript-desktop/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>
<!-- WP Super Cache is installed but broken. The path to wp-cache-phase1.php in wp-content/advanced-cache.php must be fixed! -->