<?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:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Neil Dickson's Blog</title>
	<atom:link href="http://ndickson.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://ndickson.wordpress.com</link>
	<description>PwnOS, PwnIDE, and most everything else I'm up to</description>
	<pubDate>Tue, 08 Jul 2008 03:44:35 +0000</pubDate>
	<generator>http://wordpress.org/?v=MU</generator>
	<language>en</language>
			<item>
		<title>Inventor IDE (PwnIDE) Alpha 3 Finally Out!</title>
		<link>http://ndickson.wordpress.com/2008/07/07/inventor-ide-pwnide-alpha-3-finally-out/</link>
		<comments>http://ndickson.wordpress.com/2008/07/07/inventor-ide-pwnide-alpha-3-finally-out/#comments</comments>
		<pubDate>Tue, 08 Jul 2008 03:36:10 +0000</pubDate>
		<dc:creator>Neil Dickson</dc:creator>
		
		<category><![CDATA[General]]></category>

		<category><![CDATA[PwnIDE]]></category>

		<guid isPermaLink="false">http://ndickson.wordpress.com/?p=37</guid>
		<description><![CDATA[
PwnIDE is now named Inventor IDE and version Alpha 3 is now out after the most significant changes between releases yet.
This release is very buggy and hogs RAM to no end.  However, the language data is complete, the parser is  much more resilient and faster, and the design is better suited than ever [...]]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p style="text-align:center;"><img class="aligncenter" src="http://www.codecortex.com/ide/Inventor.png" alt="Inventor IDE" /></p>
<p>PwnIDE is now named <a href="http://www.codecortex.com/ide/">Inventor IDE</a> and version Alpha 3 is now out after the most significant changes between releases yet.</p>
<p>This release is very buggy and hogs RAM to no end.  However, the language data is complete, the parser is  much more resilient and faster, and the design is better suited than ever for multi-language support when that comes about.  Also, the UI no longer looks like dozens of lava lamps exploded on the screen.  It&#8217;s moving toward looking somewhat professional.</p>
<p>The bugs are getting sorted out and the RAM use has already gone down a bit, but won&#8217;t be down to reasonable levels until Alpha 5 or later.  Alpha 4 is also a big one, getting built-in assembling working, but probably with a much shorter timeline than Alpha 3.  Big things are coming in near future versions.</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/ndickson.wordpress.com/37/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/ndickson.wordpress.com/37/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ndickson.wordpress.com/37/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ndickson.wordpress.com/37/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/ndickson.wordpress.com/37/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/ndickson.wordpress.com/37/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/ndickson.wordpress.com/37/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/ndickson.wordpress.com/37/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/ndickson.wordpress.com/37/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/ndickson.wordpress.com/37/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/ndickson.wordpress.com/37/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/ndickson.wordpress.com/37/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ndickson.wordpress.com&blog=1158540&post=37&subd=ndickson&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://ndickson.wordpress.com/2008/07/07/inventor-ide-pwnide-alpha-3-finally-out/feed/</wfw:commentRss>
	
		<media:content url="http://a.wordpress.com/avatar/ndickson-128.jpg" medium="image">
			<media:title type="html">Neil Dickson</media:title>
		</media:content>

		<media:content url="http://www.codecortex.com/ide/Inventor.png" medium="image">
			<media:title type="html">Inventor IDE</media:title>
		</media:content>
	</item>
		<item>
		<title>Pointers and Other Data Types</title>
		<link>http://ndickson.wordpress.com/2008/04/24/pointers-and-other-data-types/</link>
		<comments>http://ndickson.wordpress.com/2008/04/24/pointers-and-other-data-types/#comments</comments>
		<pubDate>Fri, 25 Apr 2008 00:55:15 +0000</pubDate>
		<dc:creator>Neil Dickson</dc:creator>
		
		<category><![CDATA[General]]></category>

		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://ndickson.wordpress.com/?p=35</guid>
		<description><![CDATA[Every once in a while, I come across something in someone&#8217;s code that is technically correct, but rather odd in such a way that leads me to believe that there are many programmers out there who are not really comfortable with pointers or relations between data types.  An example I&#8217;ve run across a few times [...]]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Every once in a while, I come across something in someone&#8217;s code that is technically correct, but rather odd in such a way that leads me to believe that there are many programmers out there who are not really comfortable with pointers or relations between data types.  An example I&#8217;ve run across a few times is something like:</p>
<pre>char myString[10];
int myFunction(char* text);
...
int blah = myFunction((char*)myString);</pre>
<p>In case you&#8217;re wondering what&#8217;s odd, myString is already of type &#8220;char*&#8221;, so the typecast is redundant and misleading.  Someone only looking at the function call might look at it and wonder &#8220;Why is myString not a char* in the first place?&#8221;.</p>
<p>That brings me to something I&#8217;ve heard several people say before, that typecasting can take a lot of time.  Actually, typecasting one pointer type to another pointer type takes literally no time, because they are identical under the hood.  Typecasting a signed integer to an unsigned integer of the same size or vice versa also takes no time for the same reason.  If the compiler is smart, typecasting an integer type to a smaller integer type should also take no time, and the opposite is at most one instruction taking one clock cycle or less.  Typecasting between floating point types can take slightly longer, but still less than 10 clock cycles.  Sometimes, though, you need to operate on the actual representation of a floating point number, which can be gotten like &#8220;*((DWORD*)&amp;myFloat)&#8221;, which, as confusing as it looks, also takes no time (or almost no time in some situations).</p>
<p>A pointer is an unsigned integer variable with the same size as the current CPU address size, since it holds an address.  If you&#8217;re making a 64-bit program, it&#8217;s 8 bytes (effectively a QWORD, or unsigned long long); if you&#8217;re making a 32-bit program, it&#8217;s 4 bytes (effectively a DWORD, or unsigned long).  However, C syntax can make this fairly difficult to see.  For example:</p>
<pre>long* pArray;
long* pArray2 = pArray+16;
long* pArray3 = &amp;pArray[16];
</pre>
<p>In this case, pArray2 is an unsigned integer with a value that is actually 64 more than pArray, not 16 more.  That&#8217;s because the C compiler assumes that you mean to get the address of the long at index 16 into the array, not offset 16, and since a long is 4 bytes, index 16 is 64 bytes past the beginning of the array.  As such, pArray3 has the same value as pArray2.  This, though, leads to some more interesting examples:</p>
<pre>long elementA = pArray[16];
long elementB = 16[pArray];</pre>
<p>Both of these lines are valid, but they may or may not have the same value.  If the compiler assumes that 16 in the latter case is a char*, then the result could be different than if it assumes that it&#8217;s a long*.  However, if you find yourself doing the latter, please step away from the keyboard and rethink what you&#8217;re doing.  At least it&#8217;s not as ambiguous as:</p>
<pre>a += a+++++a+a++;</pre>
<p>That line is valid in C and Java, and different C compilers will definitely give different results, and Java gives a different result yet again.  (In case you&#8217;re curious, it&#8217;s a bit easier to read as &#8220;a += (a++)+(++a)+(a++);&#8221;.)  Now I&#8217;m just rambling, though, so let&#8217;s get back on track.  I saw a line of code a couple of weeks ago that went something like:</p>
<pre>BYTE* data;
...
WORD a = (WORD)(data[6] &amp; 0xFF) + (WORD)(((data[7] &amp; 0xFF)&lt;&lt;8)&amp;0xFFFF);</pre>
<p>I actually didn&#8217;t realize immediately what the big line was doing (though the real one was even more complicated), because getting a WORD (16 bits) from an array of BYTEs (8 bits) is as simple as either one of the following three lines.</p>
<pre>a = data[6] + data[7]&lt;&lt;8;
a = ((WORD*)data)[3];
a = *((WORD*)(data+6));
</pre>
<p>The first one might be more familiar, and it&#8217;s the most similar to the original, but the latter two are actually more intuitive if you&#8217;re thinking about what actually needs to happen.  In memory, there are 2 consecutive bytes, with the least significant one first (unless you&#8217;re on some embedded system that still uses big-endian).  All you need to do is move those two bytes into variable &#8220;a&#8221;.  That&#8217;s what either of the last two lines does.  The first line gets the value of one byte, gets the value of the other byte and shifts it over a byte, adds the two bytes together to get the number that you had in the first place, and <em>then</em> move it into the variable.  In C, the latter two may look a bit more confusing, but in assembly language, they are much simpler, whereas if you wrote assembly that does something like the first line, people might start to giggle.</p>
<p>Another area of confusion comes with complicated types and the use of &#8220;const&#8221;, because many are not familiar with how to read the type.</p>
<pre>char const * * const myVariable[5];</pre>
<p>myVariable is an array of constant pointers to non-constant pointers to constant chars.  The reading of the type starts at the variable name and goes to the right (for the array brackets), then to the left (for the rest).  Added confusion comes with that it is valid to place the first &#8220;const&#8221; before &#8220;char&#8221; in the above line, and it would still be an &#8220;array of &#8230; pointers to constant chars&#8221;.  What&#8217;s more interesting is that since the name of the array is interpreted as its address, and its address can&#8217;t change, myVariable is also a constant pointer to constant pointers to non-constant pointers to constant chars.  Some compilers get very messed up in different ways when trying to deal with typecasts and &#8220;const&#8221; in different places in a type, but there are usually workarounds to those bugs.  It gets weirder with multi-dimensional arrays, though.  Take, for example:</p>
<pre>char my2DArray[123][456];</pre>
<p>my2DArray is an array of 123 arrays of 456 chars.  There&#8217;s nothing particularly exciting about that.  However, it&#8217;s partly equivalent to a constant pointer to constant pointers to chars.  As such, my2DArray[3] is a constant pointer to chars.  The key difference is that my2DArray[3] is not a pointer, in that it is not in memory, it is just an address.  &#8220;my2DArray[3]&#8221; is actually equivalent to &#8220;((const char*)my2DArray)+3*456&#8243;.  There is no array of pointers, only a single array of 123*456 chars with some fancy syntax.  That&#8217;s why if you pass a multidimensional array as a parameter (which would probably be silly) or pass a pointer to one (which would be less silly), you need to specify the size of all dimensions except the last (though you can have the size be the value of another parameter).  The compiler needs to know what to multiply by when indexing into it.  To sidestep the whole issue, you could use an actual array of pointers to chars or use a single-dimensional array and do the indexing yourself.</p>
<p>I find that in most of these cases, it&#8217;s easiest for me to think of things in terms of how it will appear in memory, since then it&#8217;s just a matter of finding the right addresses and moving what needs to be moved, but that takes some time to get used to.  Either way, there are a lot of interesting quirks with pointers and other data types.</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/ndickson.wordpress.com/35/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/ndickson.wordpress.com/35/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ndickson.wordpress.com/35/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ndickson.wordpress.com/35/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/ndickson.wordpress.com/35/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/ndickson.wordpress.com/35/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/ndickson.wordpress.com/35/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/ndickson.wordpress.com/35/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/ndickson.wordpress.com/35/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/ndickson.wordpress.com/35/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/ndickson.wordpress.com/35/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/ndickson.wordpress.com/35/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ndickson.wordpress.com&blog=1158540&post=35&subd=ndickson&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://ndickson.wordpress.com/2008/04/24/pointers-and-other-data-types/feed/</wfw:commentRss>
	
		<media:content url="http://a.wordpress.com/avatar/ndickson-128.jpg" medium="image">
			<media:title type="html">Neil Dickson</media:title>
		</media:content>
	</item>
		<item>
		<title>New Website, Screensaver, and Parsing Fun</title>
		<link>http://ndickson.wordpress.com/2008/03/22/new-website-screensaver-and-parsing-fun/</link>
		<comments>http://ndickson.wordpress.com/2008/03/22/new-website-screensaver-and-parsing-fun/#comments</comments>
		<pubDate>Sat, 22 Mar 2008 06:24:30 +0000</pubDate>
		<dc:creator>Neil Dickson</dc:creator>
		
		<category><![CDATA[General]]></category>

		<category><![CDATA[Programming]]></category>

		<category><![CDATA[PwnIDE]]></category>

		<guid isPermaLink="false">http://ndickson.wordpress.com/?p=34</guid>
		<description><![CDATA[
Code Cortex now has a new website (which will be getting more content over the next month or so).  All future PwnIDE releases will happen there.
Also of note is that the Code Cortex Screensaver has now been released.  It&#8217;s fixed at 20 frames per second, and modern CPUs should easily be able to handle it [...]]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p align="center"><img src="http://www.codecortex.com/images/logo_white.png" alt="Code Cortex Logo" height="204" width="540" /></p>
<p><a href="http://www.codecortex.com/" title="Code Cortex Website">Code Cortex now has a new website</a> (which will be getting more content over the next month or so).  All future <a href="http://www.codecortex.com/ide/" title="PwnIDE Home Page">PwnIDE releases</a> will happen there.</p>
<p>Also of note is that the <a href="http://www.codecortex.com/more/" title="Code Cortex Screensaver">Code Cortex Screensaver</a> has now been released.  It&#8217;s fixed at 20 frames per second, and modern CPUs should easily be able to handle it (since an older CPU I was testing on was easily able to run it at more than 20 frames per second after I optimized it).  The source code for it is released as a sample project with PwnIDE, and on <a href="http://code.google.com/p/cortexsaver/">Google Code Hosting</a>.  The video tutorial and the heavily debated speed comparison will be coming; I&#8217;ve just been side-tracked with a lot of other things.  I&#8217;ve implemented and compared versions in assembly, C/C++ (both VisualC++ and GCC), and Java.  The results are quite surprising, but you&#8217;ll have to wait a bit longer to see them in the videos.</p>
<p>I recently released what I&#8217;m calling <a href="http://www.codecortex.com/ide/downloads/PwnIDE.zip" title="PwnIDE 0.2.2b Download">PwnIDE 0.2.2b</a>, with many bugs fixed from version 0.2.2.  The reason that it&#8217;s not 0.2.3 is that I&#8217;ve got 2 particular requirements for 0.2.3, namely proper support for external libraries (e.g. the Windows API) and a new language data format (which shouldn&#8217;t change any functionality until 0.2.4).</p>
<p>To support external libraries by parsing include files for those libraries, there also needs to be support for code elements without doc comments.  To support code elements without doc comments, all datatypes need to be identified before variables can be identified properly.  That means the code parser needs to change significantly from it&#8217;s current single-pass approach to a multi-pass approach.  Ironically, this should make initially parsing the code <i>significantly</i> faster, solving the long load time problem.  (The reason for that has to do with the observer pattern notifying everything whenever anything is parsed in the single-pass approach.)  This also gives me an excuse to organize the language handling code much better than the current all-in-one-file approach (see <a href="http://code.google.com/p/pwnide/source/browse/trunk/language/MASM.java" title="One big file">MASM.java</a>).  Overall, things should be much better&#8230; after a lot of work.</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/ndickson.wordpress.com/34/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/ndickson.wordpress.com/34/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ndickson.wordpress.com/34/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ndickson.wordpress.com/34/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/ndickson.wordpress.com/34/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/ndickson.wordpress.com/34/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/ndickson.wordpress.com/34/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/ndickson.wordpress.com/34/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/ndickson.wordpress.com/34/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/ndickson.wordpress.com/34/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/ndickson.wordpress.com/34/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/ndickson.wordpress.com/34/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ndickson.wordpress.com&blog=1158540&post=34&subd=ndickson&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://ndickson.wordpress.com/2008/03/22/new-website-screensaver-and-parsing-fun/feed/</wfw:commentRss>
	
		<media:content url="http://a.wordpress.com/avatar/ndickson-128.jpg" medium="image">
			<media:title type="html">Neil Dickson</media:title>
		</media:content>

		<media:content url="http://www.codecortex.com/images/logo_white.png" medium="image">
			<media:title type="html">Code Cortex Logo</media:title>
		</media:content>
	</item>
		<item>
		<title>Do not buy from HP</title>
		<link>http://ndickson.wordpress.com/2007/12/28/do-not-buy-from-hp/</link>
		<comments>http://ndickson.wordpress.com/2007/12/28/do-not-buy-from-hp/#comments</comments>
		<pubDate>Fri, 28 Dec 2007 21:05:36 +0000</pubDate>
		<dc:creator>Neil Dickson</dc:creator>
		
		<category><![CDATA[General]]></category>

		<category><![CDATA[Programming]]></category>

		<category><![CDATA[PwnIDE]]></category>

		<guid isPermaLink="false">http://ndickson.wordpress.com/2007/12/28/do-not-buy-from-hp/</guid>
		<description><![CDATA[Over the past 4 to 5 months, I have had an HP (Hewlett-Packard) laptop.  It worked fairly normally for a couple of weeks.
Then, the wireless card started not working some of the time.  Then within a few days, it rarely if ever worked.  Many people on the HP support forums seemed to have the same [...]]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Over the past 4 to 5 months, I have had an HP (Hewlett-Packard) laptop.  It worked fairly normally for a couple of weeks.</p>
<p>Then, the wireless card started not working some of the time.  Then within a few days, it rarely if ever worked.  Many people on the HP support forums seemed to have the same problem.  Apparently there was a problem with the laptop motherboards in the summer, because of which major devices (e.g. the screen) would just fail.  HP then fixed the motherboards&#8230; for all devices except the wireless card.</p>
<p>So, I got a USB wireless adapter.  It wasn&#8217;t perfect, and didn&#8217;t get the greatest reception, but it sufficed until two days ago.  Just two days ago, my laptop wouldn&#8217;t boot.  I don&#8217;t mean that it got to the Windows loading screen and told me there was a problem.  I don&#8217;t mean that it got the the BIOS loading screen and told me that it couldn&#8217;t find the OS.  I mean that the screen stays off, not even on and black, but completely off.  The lights on the keyboard light up, the DVD drive does its power on self test, and then after about 20 seconds, it resets and does the same thing again.  Then yesterday, it would stay on for about 1 second.  Today, it won&#8217;t turn on at all.</p>
<p>A friend of mine had the same issue with his laptop not booting, but with a brand new HP laptop.  He sent in his laptop to get fixed, and they told him that nothing was wrong with it, then sent it to the wrong person.  In all, it took over a month to get his laptop back, and when he finally got it back, although it would boot, HP had installed Vista, and didn&#8217;t give him the registration key for it.</p>
<p>Now I&#8217;m going to have to send mine away to get fixed, and so I may lose much of my work on the screen saver.  I got the neurons with a pulsating glow.  Hopefully I can recreate that once I get my laptop back.</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/ndickson.wordpress.com/33/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/ndickson.wordpress.com/33/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ndickson.wordpress.com/33/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ndickson.wordpress.com/33/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/ndickson.wordpress.com/33/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/ndickson.wordpress.com/33/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/ndickson.wordpress.com/33/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/ndickson.wordpress.com/33/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/ndickson.wordpress.com/33/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/ndickson.wordpress.com/33/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/ndickson.wordpress.com/33/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/ndickson.wordpress.com/33/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ndickson.wordpress.com&blog=1158540&post=33&subd=ndickson&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://ndickson.wordpress.com/2007/12/28/do-not-buy-from-hp/feed/</wfw:commentRss>
	
		<media:content url="http://a.wordpress.com/avatar/ndickson-128.jpg" medium="image">
			<media:title type="html">Neil Dickson</media:title>
		</media:content>
	</item>
		<item>
		<title>Screen saver progress</title>
		<link>http://ndickson.wordpress.com/2007/12/25/screen-saver-progress/</link>
		<comments>http://ndickson.wordpress.com/2007/12/25/screen-saver-progress/#comments</comments>
		<pubDate>Tue, 25 Dec 2007 17:53:52 +0000</pubDate>
		<dc:creator>Neil Dickson</dc:creator>
		
		<category><![CDATA[General]]></category>

		<category><![CDATA[Programming]]></category>

		<category><![CDATA[PwnIDE]]></category>

		<guid isPermaLink="false">http://ndickson.wordpress.com/2007/12/25/screen-saver-progress/</guid>
		<description><![CDATA[The Code Cortex screen saver is coming along better than expected, and if all goes as planned, it should be ready in time for January.  It currently renders 87,000 semi-transparent spheres in the form of the Code Cortex cube of neurons comfortably at 20 frames/second (more than a screen saver really needs) and the rendering [...]]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>The <a href="http://www.codecortex.com/">Code Cortex</a> screen saver is coming along better than expected, and if all goes as planned, it should be ready in time for January.  It currently renders 87,000 semi-transparent spheres in the form of the <a href="http://www.codecortex.com/images/logo.png">Code Cortex cube of neurons</a> comfortably at 20 frames/second (more than a screen saver really needs) and the rendering is done completely on the CPU.  It needs a processor that supports SSE3, and I&#8217;m running it on one of the two cores of my 1.6GHz CPU (I could have it use multiple threads, but it doesn&#8217;t need it right now).</p>
<p>It looks mildly cool right now, but hopefully it will look phenomenal and tax the CPU to the max (possibly both cores) once it&#8217;s done, and then the comparison with the C and C++ versions will be well worth while.</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/ndickson.wordpress.com/32/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/ndickson.wordpress.com/32/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ndickson.wordpress.com/32/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ndickson.wordpress.com/32/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/ndickson.wordpress.com/32/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/ndickson.wordpress.com/32/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/ndickson.wordpress.com/32/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/ndickson.wordpress.com/32/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/ndickson.wordpress.com/32/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/ndickson.wordpress.com/32/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/ndickson.wordpress.com/32/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/ndickson.wordpress.com/32/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ndickson.wordpress.com&blog=1158540&post=32&subd=ndickson&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://ndickson.wordpress.com/2007/12/25/screen-saver-progress/feed/</wfw:commentRss>
	
		<media:content url="http://a.wordpress.com/avatar/ndickson-128.jpg" medium="image">
			<media:title type="html">Neil Dickson</media:title>
		</media:content>
	</item>
		<item>
		<title>PwnOS Design Document</title>
		<link>http://ndickson.wordpress.com/2007/12/14/pwnos-design-document/</link>
		<comments>http://ndickson.wordpress.com/2007/12/14/pwnos-design-document/#comments</comments>
		<pubDate>Fri, 14 Dec 2007 07:10:59 +0000</pubDate>
		<dc:creator>Neil Dickson</dc:creator>
		
		<category><![CDATA[PwnOS]]></category>

		<guid isPermaLink="false">http://ndickson.wordpress.com/2007/12/14/pwnos-design-document/</guid>
		<description><![CDATA[I&#8217;ve now completed the first version of the PwnOS design document.  Development can move forward now that the design has been fairly well cemented.
The design in the document does not reflect the current state of the code.  Significant differences include that the design is to be for 64-bit code, not 32-bit, and page memory will [...]]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>I&#8217;ve now completed the first version of the <a href="http://www.neildickson.com/os/downloads/PwnOS.docx">PwnOS design document</a>.  Development can move forward now that the design has been fairly well cemented.</p>
<p>The design in the document does not reflect the current state of the code.  Significant differences include that the design is to be for 64-bit code, not 32-bit, and page memory will be managed in 2MB pages by disabling the lowest level of page tables instead of 64KB simulated pages made by handling real pages in groups of 16.  Also, there will be a large, read-only area devoted to libraries common to all processes.</p>
<p>Also included in the document are a brief analysis of high-performance computing and a comparison with other operating systems.</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/ndickson.wordpress.com/31/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/ndickson.wordpress.com/31/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ndickson.wordpress.com/31/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ndickson.wordpress.com/31/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/ndickson.wordpress.com/31/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/ndickson.wordpress.com/31/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/ndickson.wordpress.com/31/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/ndickson.wordpress.com/31/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/ndickson.wordpress.com/31/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/ndickson.wordpress.com/31/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/ndickson.wordpress.com/31/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/ndickson.wordpress.com/31/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ndickson.wordpress.com&blog=1158540&post=31&subd=ndickson&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://ndickson.wordpress.com/2007/12/14/pwnos-design-document/feed/</wfw:commentRss>
	
		<media:content url="http://a.wordpress.com/avatar/ndickson-128.jpg" medium="image">
			<media:title type="html">Neil Dickson</media:title>
		</media:content>
	</item>
		<item>
		<title>PwnIDE Alpha!</title>
		<link>http://ndickson.wordpress.com/2007/12/14/pwnide-alpha/</link>
		<comments>http://ndickson.wordpress.com/2007/12/14/pwnide-alpha/#comments</comments>
		<pubDate>Fri, 14 Dec 2007 06:34:20 +0000</pubDate>
		<dc:creator>Neil Dickson</dc:creator>
		
		<category><![CDATA[General]]></category>

		<category><![CDATA[Programming]]></category>

		<category><![CDATA[PwnIDE]]></category>

		<guid isPermaLink="false">http://ndickson.wordpress.com/2007/12/14/pwnide-alpha/</guid>
		<description><![CDATA[After a few all-nighters and a bit of banging my head against the wall, PwnIDE Alpha has finally been released.  It&#8217;s taken a lot of time and a lot of work, but the results are worth it.
I will be creating a small part of a larger set of video tutorials for PwnIDE over the next [...]]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>After a few all-nighters and a bit of banging my head against the wall, <a href="http://www.codecortex.com/ide/">PwnIDE Alpha</a> has finally been released.  It&#8217;s taken a lot of time and a lot of work, but the results are worth it.</p>
<p>I will be creating a small part of a larger set of video tutorials for PwnIDE over the next few weeks.  Stay tuned; they will make clear the useful features of PwnIDE and how best to use them.  Plus you&#8217;ll get a cool screensaver out of it.<br />
There are many parts of it that still do not work for the simple reason that they haven&#8217;t been written yet, so I won&#8217;t yet accept bug reports.  However, I will accept feature requests, with the disclaimer that I have thought through a very large portion of what will be in PwnIDE Beta and even 1.0, and many things are not as they will be.  I&#8217;ve also released a <a href="http://www.neildickson.com/ide/downloads/PwnIDE Paper.doc" title="PwnIDE Paper">draft paper</a> on the motivations, design, status, and future plans for PwnIDE.  It&#8217;s not a full design document, but does give some insight into its operation.</p>
<p>This is a big milestone in a very long road for <a href="http://www.codecortex.com/">Code Cortex</a>.  I&#8217;m looking forward to the next big steps.  They&#8217;ll be pretty awesome if they work out.</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/ndickson.wordpress.com/30/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/ndickson.wordpress.com/30/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ndickson.wordpress.com/30/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ndickson.wordpress.com/30/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/ndickson.wordpress.com/30/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/ndickson.wordpress.com/30/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/ndickson.wordpress.com/30/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/ndickson.wordpress.com/30/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/ndickson.wordpress.com/30/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/ndickson.wordpress.com/30/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/ndickson.wordpress.com/30/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/ndickson.wordpress.com/30/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ndickson.wordpress.com&blog=1158540&post=30&subd=ndickson&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://ndickson.wordpress.com/2007/12/14/pwnide-alpha/feed/</wfw:commentRss>
	
		<media:content url="http://a.wordpress.com/avatar/ndickson-128.jpg" medium="image">
			<media:title type="html">Neil Dickson</media:title>
		</media:content>
	</item>
		<item>
		<title>Delete!</title>
		<link>http://ndickson.wordpress.com/2007/11/21/delete/</link>
		<comments>http://ndickson.wordpress.com/2007/11/21/delete/#comments</comments>
		<pubDate>Wed, 21 Nov 2007 07:54:17 +0000</pubDate>
		<dc:creator>Neil Dickson</dc:creator>
		
		<category><![CDATA[PwnIDE]]></category>

		<guid isPermaLink="false">http://ndickson.wordpress.com/2007/11/21/delete/</guid>
		<description><![CDATA[Deletion of things like functions now works in version 0.1.15, which you can get on the downloads page.  
Due to priorities from the course I&#8217;m using as an excuse to work on PwnIDE, I must drop the &#8220;Find Usages&#8221; feature from the initial alpha release, and I&#8217;m leaving &#8220;Go To Definition&#8221; as it is (only [...]]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Deletion of things like functions now works in version 0.1.15, which you can get on <a href="http://www.neildickson.com/ide/downloads/" title="PwnIDE Download">the downloads page</a>.  <img src="http://www.neildickson.com/smile.gif" alt="Smile" height="17" width="17" /></p>
<p>Due to priorities from the course I&#8217;m using as an excuse to work on PwnIDE, I must drop the &#8220;Find Usages&#8221; feature from the initial alpha release, and I&#8217;m leaving &#8220;Go To Definition&#8221; as it is (only supporting symbols with headers), so that leaves just shift up/down of headers, and copy/paste of headers before alpha.  For the course, I&#8217;ll also need to put in a menu option to run NaturalDocs, and SVN update/commit, but I might not release those features until they&#8217;re less buggy and more useful.</p>
<p>Also, the draft paper is ready, but it won&#8217;t get reviewed until November 28th, and I&#8217;d like a bit of review by others before I post it.</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/ndickson.wordpress.com/29/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/ndickson.wordpress.com/29/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ndickson.wordpress.com/29/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ndickson.wordpress.com/29/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/ndickson.wordpress.com/29/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/ndickson.wordpress.com/29/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/ndickson.wordpress.com/29/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/ndickson.wordpress.com/29/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/ndickson.wordpress.com/29/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/ndickson.wordpress.com/29/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/ndickson.wordpress.com/29/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/ndickson.wordpress.com/29/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ndickson.wordpress.com&blog=1158540&post=29&subd=ndickson&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://ndickson.wordpress.com/2007/11/21/delete/feed/</wfw:commentRss>
	
		<media:content url="http://a.wordpress.com/avatar/ndickson-128.jpg" medium="image">
			<media:title type="html">Neil Dickson</media:title>
		</media:content>

		<media:content url="http://www.neildickson.com/smile.gif" medium="image">
			<media:title type="html">Smile</media:title>
		</media:content>
	</item>
		<item>
		<title>D-Wave Demo 2</title>
		<link>http://ndickson.wordpress.com/2007/11/20/d-wave-demo-2/</link>
		<comments>http://ndickson.wordpress.com/2007/11/20/d-wave-demo-2/#comments</comments>
		<pubDate>Tue, 20 Nov 2007 05:39:52 +0000</pubDate>
		<dc:creator>Neil Dickson</dc:creator>
		
		<category><![CDATA[D-Wave]]></category>

		<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://ndickson.wordpress.com/2007/11/20/d-wave-demo-2/</guid>
		<description><![CDATA[The second big D-Wave demo was just a few days ago (November 13th, 2007).  This time, they demonstrated some image recognition in conjunction with one of the world&#8217;s leading experts thereof, whose image recognition company was recently bought out by Google.   
The chip demonstrated this time was a 28-qubit chip, but like [...]]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>The second big D-Wave demo was just a few days ago (November 13th, 2007).  This time, they demonstrated some image recognition in conjunction with one of the world&#8217;s leading experts thereof, whose image recognition company was recently bought out by Google.   <img src="http://www.neildickson.com/smile.gif" alt="Smile" height="17" width="17" /></p>
<p>The chip demonstrated this time was a 28-qubit chip, but like on &#8220;Whose Line Is It Anyway?&#8221;, the points don&#8217;t necessarily matter (yet).  I don&#8217;t know for certain the relevant numbers of this chip, but the relevant numbers of the 16-qubit chip in February (as Geordie presented on his blog back in March) were 6, being the largest number of variables for which any quadratic unconstrained binary optimisation problem of that size can be solved, and 42, being the number of tunable superconducting devices on the chip.  In a nutshell, 6 bits of &#8220;useful&#8221; output and 42<em>x</em> bits of input (the usefulness of which is not as easy to determine, and <em>x</em> being the number of bits of precision).  One might ask &#8220;Why only 6 useful bits of output when it&#8217;s a 16-qubit chip?&#8221; but this discrepancy is due to limits on the physics impacting the chip design in ways that I don&#8217;t fully understand.  As a completely different example of this sort of discrepancy, the &#8220;7-qubit&#8221; joke made by some research group with NMR (i.e. by constructing a molecule and shooting lasers at it) has only 2 useful bits of output (i.e. the factor 3 in binary is 11) and 4 useful bits of input (i.e. the input number 15 in binary is 1111).</p>
<p>That sort of splitting hairs aside, I&#8217;m quite amazed at some of the poorly-written news articles this time around, with gems of illogic like this excerpt from <a href="http://www.guardian.co.uk/technology/2007/nov/15/news.google" title="D-Wave Demo Article from The Guardian">The Guardian</a>:</p>
<blockquote><p> &#8220;Have commercial quantum computers finally arrived? &#8230; A Google scientist seems to hope so but, unfortunately, the answer is probably no. Dr Hartmut Neven, Google&#8217;s expert on image searching, was involved in a demonstration of quantum computing on Monday - even though most scientists are extremely doubtful that any real quantum computing took place.&#8221;</p></blockquote>
<p>So&#8230;&#8230; is The Guardian implying that this guy who&#8217;s &#8220;Google&#8217;s expert on image searching&#8221; just got hit in the head repeatedly to the point where he believes whatever D-Wave told him?  That makes NO SENSE!  He&#8217;s one of the world&#8217;s top experts on image recognition.  Give him a bit of credit!  Regardless of what this pool of &#8220;most scientists&#8221; that seem not to have said anything but to The Guardian thinks of D-Wave, some world-class expert on something practical seems to think that D-Wave can help out with this practical application at which he&#8217;s an expert!  I think any startup company that can get a commendation like that is probably bound for big success.  Must&#8230;. stop&#8230;. ranting&#8230;. *sigh*</p>
<p>Anyway, there&#8217;s been a lot of confusion among non-experts about what problems D-Wave is and isn&#8217;t still facing.  By problems, I mean things for which a solution is still unclear.  Some of these things that aren&#8217;t problems as I&#8217;m defining the word here may still take a lot of work, but they have a potential solution known.  I&#8217;d just like to clear up some of the confusion people have when asking me about D-Wave.</p>
<ul>
<li>Cooling a chip to 4 milliKelvin (0.004 degrees Celsius above absolute zero) is not a big problem for D-Wave, since refrigeration technology has come a long way in the past few decades and D-Wave has several experts on this subject.</li>
<li>Chip fabrication is not a big problem for D-Wave (as far as I know).  They could probably have a chip with 100,000 qubits  made without much trouble; it just wouldn&#8217;t work without having tried chips of smaller sizes first.</li>
<li>Reducing the size of the whole shebang to a manageable size (e.g. less than room-sized) is probably not a big problem for D-Wave.  I don&#8217;t know the details of this, but I&#8217;m fairly certain that they&#8217;ve got it covered.</li>
<li>Power consumption by the cooling system is not a problem.  The cooling system may take a while to cool the chip, but once it&#8217;s there, as Geordie has said on his blog several times, very little power is needed.</li>
<li>Controlling a chip from conventional computers isn&#8217;t a problem for D-Wave in one sense, and may or may not be in another (I don&#8217;t know the details).  The actual communication is not a major problem at all.  This sort of thing is, however, why there is a projected huge jump in the number of qubits from a small number like 16 or 28 to a big number like 512 or 1024.  It&#8217;s not like they are just stating impressive figures for no reason.</li>
<li>Making use of D-Wave&#8217;s system as a client-side programmer shouldn&#8217;t be too hard at all.  The software team at D-Wave has a pretty good system in place to provide a few simple APIs for programmers (and possibly non-programmers) to make use of the system.  You don&#8217;t need to understand transistors to program for a conventional computer, so you don&#8217;t need to understand qubits to program for a quantum computer.</li>
<li>Scott Aaronson is not a problem for D-Wave.  He is not a physicist of any sort, let alone a quantum physicist, and he doesn&#8217;t appear to be a particularly good computer scientist.  Computer Science is an APPLIED science, and he seemingly wouldn&#8217;t know how to apply any computer science if his life depended on it.  If he could produce ANYthing to actually make use of the pointless nonsense he spouts, then he&#8217;d be a computer scientist; until then he&#8217;s just a surly mathematician and a wannabe computer scientist.  (I do think the quantum mechanical analysis of roast beef would&#8217;ve been awesome, though.)</li>
<li>Chip design is probably not a problem for D-Wave, in that every chip-design-related issue that came up while I was at D-Wave got solved before I even knew that it was an issue related to chip design.  Saying that they&#8217;ve got some good experts on this is an understatement.</li>
<li>Funding may or may not be a problem for D-Wave.  As Geordie (or Herb?) said in some quotation in some article I read, if they don&#8217;t get to around 512 qubits by the end of 2008, they could be in trouble.</li>
<li>The actual quantum physics of it, I haven&#8217;t the slightest clue as to whether it&#8217;ll be a problem or not, because I don&#8217;t understand more than the &#8220;dumbed-down&#8221; versions of the quantum physics behind the chips.  I do know (from some experimental results that will be presented at several universities shortly) that the chips aren&#8217;t acting based on classical physics, as Geordie has said on his blog a few times.  That doesn&#8217;t necessarily mean that there will be speedup from the quantum physics, but it can&#8217;t hurt.</li>
</ul>
<p>D-Wave, in one sense, is actually fairly safe.  Supposing the quantum physics doesn&#8217;t scale up at all, they can still (much more easily, in fact) have a certain speedup simply from using superconducting components instead of semiconductor components, not to mention an even bigger improvement in computational power units per electrical power unit.  Supposing even that fails, they should still have some of the best software in the world for solving these tough problems.  If that fails, they&#8217;re out of luck, but unless that happens, I&#8217;ll be rooting for them, regardless of where I&#8217;m working.  I may end up back there someday, or if I do a startup with <a href="http://www.codecortex.com/" title="Code Cortex">Code Cortex</a>, I may even end up indirectly helping them out.</p>
<p>Anyway, hats off to D-Wave for their second big demo, and I can&#8217;t wait to see any video/images of it online.  Best of luck on the road ahead.</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/ndickson.wordpress.com/28/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/ndickson.wordpress.com/28/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ndickson.wordpress.com/28/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ndickson.wordpress.com/28/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/ndickson.wordpress.com/28/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/ndickson.wordpress.com/28/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/ndickson.wordpress.com/28/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/ndickson.wordpress.com/28/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/ndickson.wordpress.com/28/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/ndickson.wordpress.com/28/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/ndickson.wordpress.com/28/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/ndickson.wordpress.com/28/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ndickson.wordpress.com&blog=1158540&post=28&subd=ndickson&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://ndickson.wordpress.com/2007/11/20/d-wave-demo-2/feed/</wfw:commentRss>
	
		<media:content url="http://a.wordpress.com/avatar/ndickson-128.jpg" medium="image">
			<media:title type="html">Neil Dickson</media:title>
		</media:content>

		<media:content url="http://www.neildickson.com/smile.gif" medium="image">
			<media:title type="html">Smile</media:title>
		</media:content>
	</item>
		<item>
		<title>Handling &#8220;Global&#8221; KeyEvents</title>
		<link>http://ndickson.wordpress.com/2007/11/19/handling-global-keyevents/</link>
		<comments>http://ndickson.wordpress.com/2007/11/19/handling-global-keyevents/#comments</comments>
		<pubDate>Mon, 19 Nov 2007 06:19:29 +0000</pubDate>
		<dc:creator>Neil Dickson</dc:creator>
		
		<category><![CDATA[Programming]]></category>

		<category><![CDATA[PwnIDE]]></category>

		<guid isPermaLink="false">http://ndickson.wordpress.com/2007/11/19/handling-global-keyevents/</guid>
		<description><![CDATA[So after much painful trial-and-error combined with months of Google-searching in an attempt to handle certain KeyEvents in a &#8220;global&#8221; way, I&#8217;ve FINALLY found a way to do it.  This sort of handling is needed in Java in order for operations like undo, redo, and save to work regardless of what component has keyboard focus.  [...]]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>So after much painful trial-and-error combined with months of Google-searching in an attempt to handle certain KeyEvents in a &#8220;global&#8221; way, I&#8217;ve FINALLY found a way to do it.  This sort of handling is needed in Java in order for operations like undo, redo, and save to work regardless of what component has keyboard focus.  As painful as it was to find the solution to this, the solution itself is remarkably simple:</p>
<pre>KeyboardFocusManager focusManager = KeyboardFocusManager.getCurrentKeyboardFocusManager();
focusManager.addKeyEventDispatcher(new KeyEventDispatcher(){
	public boolean dispatchKeyEvent(KeyEvent e) {
		return handleCommonShortcuts(e);
	}
});</pre>
<p>handleCommonShortcuts(e) is a function I wrote to check if the KeyEvent is for something like undo, redo, or save, and if so, do it and return true, else return false.  I wish that this had been a bit easier to find, but I&#8217;m glad that it works now, and without having to add a KeyListener to every single one of the 100&#8217;s of components that might be present in an PwnIDE window at any given time.  <img src="http://www.neildickson.com/smile.gif" alt="Smile" height="17" width="17" /></p>
<p>Now I can get back to implementing the remaining header operations before alpha, since they are dependent on such a handler.</p>
<p>In other news, I&#8217;ve written the draft copy of a paper on PwnIDE alpha, and after it is reviewed by fellow students, I will post a copy of the final version.</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/ndickson.wordpress.com/27/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/ndickson.wordpress.com/27/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ndickson.wordpress.com/27/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ndickson.wordpress.com/27/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/ndickson.wordpress.com/27/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/ndickson.wordpress.com/27/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/ndickson.wordpress.com/27/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/ndickson.wordpress.com/27/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/ndickson.wordpress.com/27/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/ndickson.wordpress.com/27/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/ndickson.wordpress.com/27/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/ndickson.wordpress.com/27/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ndickson.wordpress.com&blog=1158540&post=27&subd=ndickson&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://ndickson.wordpress.com/2007/11/19/handling-global-keyevents/feed/</wfw:commentRss>
	
		<media:content url="http://a.wordpress.com/avatar/ndickson-128.jpg" medium="image">
			<media:title type="html">Neil Dickson</media:title>
		</media:content>

		<media:content url="http://www.neildickson.com/smile.gif" medium="image">
			<media:title type="html">Smile</media:title>
		</media:content>
	</item>
	</channel>
</rss>