<?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>CSDGN</title>
	<atom:link href="http://www.csdgn.org/feed" rel="self" type="application/rss+xml" />
	<link>http://www.csdgn.org</link>
	<description>Tale of the Lazy Programmer.</description>
	<lastBuildDate>Fri, 20 Aug 2010 09:31:30 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Custom Java Look and Feel</title>
		<link>http://www.csdgn.org/db/314</link>
		<comments>http://www.csdgn.org/db/314#comments</comments>
		<pubDate>Fri, 20 Aug 2010 09:31:30 +0000</pubDate>
		<dc:creator>Chase-san</dc:creator>
				<category><![CDATA[Informative]]></category>
		<category><![CDATA[computer]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://www.csdgn.org/?p=314</guid>
		<description><![CDATA[I wanted to create a custom Java Look and Feel for a game I was working on. Of course I could have created my own windowing system (Again), however I didn&#8217;t feel up to this. Java already has a very use able and very complete windowing system, all I cared about was changing how it [...]]]></description>
			<content:encoded><![CDATA[<p>I wanted to create a custom Java Look and Feel for a game I was working on. Of course I could have created my own windowing system (Again), however I didn&#8217;t feel up to this. Java already has a very use able and very complete windowing system, all I cared about was changing how it looked.</p>
<p>Of course my first thought was to just overwrite the paintComponent of everything I wanted to change&#8230;. but what about text? How do I get rid of those borders, the amount of work to get even simple functionality for the simplest of tools is annoying, just think if you made overwrote a list. Very painful!</p>
<p>Well of course I realized this and stopped to look for a better alternative. I know Java has pluggable Look and Feel. But I had never put much leg work into figuring out how to make my own, and all the other releases out in the wild looked monstrous and complex.</p>
<p>So I googled around, finding nothing on the actual &#8216;how&#8217; of creating a custom theme. I decided to look at the Runtimes Environments own Look and Feels. This was a great idea. After only a bit of intense searching I found what I was looking for.</p>
<p><strong> javax.swing.plaf.basic.BasicLookAndFeel</strong></p>
<p>Well, I thought to myself. That looks mightly useful, but there is to much there. I need to cut things down some. A little googling I found a rather minimal if old custom look and feel and that helped me on making my own. Of course they use many things that are rendered unneeded in the latest JRE. Basically, override the obvious stuff. getDescription, getID, getName, isNativeLookAndFeel, and isSupportedLookAndFeel. Then hit the guts by overriding the initClassDefaults, this will put you well on your way to a custom UI. Of course then make your own versions of the XXYYUI.java classes, say BasicButtonUI is an example.</p>
<p>I recommended using the Basic as the parent classes for your L&amp;F. It becomes somewhat difficult if you do not do so. Since it covers most of the basic events and such Java covers.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.csdgn.org/db/314/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Things I miss in Java and C++</title>
		<link>http://www.csdgn.org/db/298</link>
		<comments>http://www.csdgn.org/db/298#comments</comments>
		<pubDate>Sun, 01 Aug 2010 20:08:37 +0000</pubDate>
		<dc:creator>Chase-san</dc:creator>
				<category><![CDATA[News]]></category>
		<category><![CDATA[c++]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://www.csdgn.org/?p=298</guid>
		<description><![CDATA[What I miss from C++ There are a handful of things I honestly miss in Java. Mostly because I am a bit twiddler. For example, this fun bit of C++. The only way to do this in java is big and messy and slow, for multiple reasons. Java lacks anything that allows the simple automatic [...]]]></description>
			<content:encoded><![CDATA[<p><strong>What I miss from C++</strong><br />
There are a handful of things I honestly miss in Java. Mostly because I am a bit twiddler.</p>
<p>For example, this fun bit of C++. The only way to do this in java is big and messy and slow, for multiple reasons. Java lacks anything that allows the simple automatic memory sharing behavior this shows, you have to convert between types. This is mostly because of Java&#8217; type safety. I sigh and say, &#8220;OKAY, fine, that just how you are, you are very type safe, this is the result.&#8221; However, there is something else, <strong>which Java doesn&#8217;t have an excuse to not have!</strong> Unsigned types, honestly. How hard is it to add unsigned types, unsigned types are useful, for far more reasons than something like this. Almost every network protocol in the whole of existence uses unsigned data. Usually data in most binary data formats are unsigned. I guess they didn&#8217;t expect people writing in this to access the filesystem, use a network. I guess that is possible. Maybe they didn&#8217;t think anyone who used Java would ever want to have unsigned data (wrong, as you can see by my case).</p>
<p><strong>
<pre>"The omission of unsigned integral types from Java is somewhat controversial, but they are in fact inessential, if perhaps convenient nonetheless."</pre>
<p></strong></p>
<p>Convenient, definitely, inessential, somewhat so, Unwanted, definitely not.</p>
<pre>
//C++
struct {
	union {
		union {
			uint16_t r16_1;
			struct {
				uint8_t r8_1;
				uint8_t r8_2;
			};
		};
		union {
			uint16_t r16_2;
			struct {
				uint8_t r8_3;
				uint8_t r8_4;
			};
		};
		uint32_t r32_1;
	};
} registers;
</pre>
<p>For you who are not in the know, when it comes to C++, union basically allows you to share memory between two variables. This is useful for many things, but the above is what I use it for the most. What it does in this case, because they are anonymous unions and structs, allows me to share memory between the 8&#8242;s the 16&#8242;s and the 32, so changing one would change the ones that are built on top of it, or under it. Changing r8_1 would change r16_1 and r32_1, but changing r16_1 could only change r32_1 and r8_1/r8_2. Which allows me to do fancy stuff.<br />
<code><br />
registers.r8_1 = 0xF;<br />
registers.r8_2 = 0x1F;<br />
printf("%04X", registers.r16_1);<br />
</code><br />
Would produce &#8220;1F0F&#8221;. This is pretty straight forward in this case but this next one is less so.<br />
<code><br />
registers.r8_2 = 3 << 2;<br />
registers.r16_1 = registers.r16_1 >> 3;<br />
registers.r8_1 = registers.r8_2 << 1;<br />
printf("%04X", registers.r16_1);<br />
</code><br />
What does this produce? Can you even begin to guess? I can but I have been doing this a long time. It produces &#8220;0102&#8243;, or 0&#215;0102. We put 0x0C into r8_2 which makes it 0x0C00, rightshift 3, puts one bit over the byte border, so now r8_2 is only 0&#215;1, and r8_1 is 0&#215;80. But we take that 1 in r8_2 and left shift it 1 and assign that to our r8_1, which becomes 2.</p>
<p>Another thing I miss from C++ is the numerated enumerations.</p>
<pre>
enum {
	a, b, c, d, e, f
}
</pre>
<p>This is another victim of the strong typing however, since while these map to integers in C++, a=0, b=1. In java they are unmappable. (Does casting work?)</p>
<p><strong>What I miss from Java.</strong><br />
Its somewhat more simplistic syntax and class system. Unfortunately, that wouldn&#8217;t work in C++, since there are hard defined uses for headers and source files. Without headers, libraries would be impossible (that is to say, hooking would be impossible, since headers provide the map required to access the compiled code). Without source files, compiling wouldn&#8217;t happen. (That is to say, source files are more required than header files).</p>
<p>Aside from that, the thing I probably miss the most from Java would have to be some of syntax sugar.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.csdgn.org/db/298/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Programming This and That</title>
		<link>http://www.csdgn.org/db/286</link>
		<comments>http://www.csdgn.org/db/286#comments</comments>
		<pubDate>Wed, 23 Jun 2010 08:44:04 +0000</pubDate>
		<dc:creator>Chase-san</dc:creator>
				<category><![CDATA[News]]></category>
		<category><![CDATA[games]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[story]]></category>

		<guid isPermaLink="false">http://www.csdgn.org/?p=286</guid>
		<description><![CDATA[I seem to do much chatting about things other than programming. Mostly because I usually find programming so routine there is no real point for me to talk about it. Lately I have written and tested a simple Regex engine (works well, but lacks many advanced features). A Math expression parser (works well), a cross [...]]]></description>
			<content:encoded><![CDATA[<p>I seem to do much chatting about things other than programming. Mostly because I usually find programming so routine there is no real point for me to talk about it.</p>
<p>Lately I have written and tested a simple Regex engine (works well, but lacks many advanced features). A Math expression parser (works well), a cross platfrom irc bot framework (no advanced features), a 3D OpenGL Java based programming game (incomplete), written a kD-Tree implementation (works), mucked about with image formats. Awhile ago I even tried my hand at a Gameboy interpreting emulator (never finished).</p>
<p>I have been considering if I should try making a game of some sort. I am not really lacking in skill in programming, however most current generation gamers want not only gameplay, but graphics. That is where I hit a speed bump. I can ignore those for the most part (you know since it is just for fun, if I like). I have even caught myself practicing what I would say if I had to sell my programming skills to a game developer.</p>
<p>Sorta like so. &#8220;It all depends on the scope of your project. If you want a massive 3D system, with character models with an adaptive IK animation system and complex physics system, well I probably can&#8217;t do that.. Well actually I probably could, but I would be really annoyed, that is to say, I wouldn&#8217;t want to do it. Since that is a difficulty well beyond a single developer.&#8221;</p>
<p>Did I mention such a system would be a pain to write? Well it would be. Since I would have to look up how many things worked, and perhaps even new api for the animations and graphic system (directx/opengl scene graphing) and integrate a physics library.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.csdgn.org/db/286/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Why art is frustrating</title>
		<link>http://www.csdgn.org/db/283</link>
		<comments>http://www.csdgn.org/db/283#comments</comments>
		<pubDate>Tue, 08 Jun 2010 23:38:31 +0000</pubDate>
		<dc:creator>Chase-san</dc:creator>
				<category><![CDATA[Informative]]></category>
		<category><![CDATA[art]]></category>

		<guid isPermaLink="false">http://www.csdgn.org/?p=283</guid>
		<description><![CDATA[I was asked this by a friend. Why is art so frustrating? Good question. It didn&#8217;t take me long to find an answer however. I have been over this question several times with myself already. I am the sort of personal perfectionist that given any task, I can master it very quickly. That is, if [...]]]></description>
			<content:encoded><![CDATA[<p>I was asked this by a friend. Why is art so frustrating? Good question.</p>
<p>It didn&#8217;t take me long to find an answer however. I have been over this question several times with myself already. I am the sort of personal perfectionist that given any task, I can master it very quickly. That is, if I put my full mind to it. However this only applies to left brain tasks, or logical step by step tasks. Perhaps being able to add or remove steps here and there, but all point a, to b, to c, to d.</p>
<p>Art, isn&#8217;t a simple step by step process. However much one wishes it could be. In fact it does not really have &#8216;steps&#8217; at all except for the levels of build up (skeleton -> sketch -> re-sketch -> ink -> color). But this helps little with the actual process of doing each of those steps. Logical thinking is all step to step thinking. Sort of like a computer. You do this, then this, and then this. Creative thinking is more of a big picture, creating connections, and the like. Needless, we would be lost without either side. However the right (creative) brain rarely gets exercised as much as the left.</p>
<p>Because of this we are usually left with childlike ability in drawing, since that is usually when we &#8216;stop&#8217; to goto school. Not to say schools don&#8217;t have art classes. But they do little to actually develop the creative right brain, instead focusing on much less frustrating left brain &#8216;artistic tasks&#8217;. Such as paper-mache, or other crafts.</p>
<p>The only way to get around this is to exercise the right brain. Drawing aimlessly and losing track of time in the process usually involves this. Its hard work, and you need to do it daily to &#8216;catch&#8217; up. Even if it is non-sensual drawings. Other types usually involve visualizing objects in 3D and drawing them. Drawing what you see. Coming up with creative designs for whatever your interest is (cars, bikes, planes, birds, clothing, computers, etc).</p>
<p>P.S. There are other things that are also frustrating to learn, but not because of creativity requirements, but due to the scope of knowledge required. Such as language learning, and other areas you know little in (this is also another reason for art, studying anatomy helps, but isn&#8217;t as beneficial as observation).</p>
]]></content:encoded>
			<wfw:commentRss>http://www.csdgn.org/db/283/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Netbook of Feats</title>
		<link>http://www.csdgn.org/db/280</link>
		<comments>http://www.csdgn.org/db/280#comments</comments>
		<pubDate>Mon, 12 Apr 2010 15:50:51 +0000</pubDate>
		<dc:creator>Chase-san</dc:creator>
				<category><![CDATA[News]]></category>

		<guid isPermaLink="false">http://www.csdgn.org/?p=280</guid>
		<description><![CDATA[Some may of noticed (assuming I have any readers), that I have a database searchable version of the netbook of feats up. I went out of my way considerably to parse it and its balance scoring. There are many values that can be sorted by I do not have UI for. So expect me to [...]]]></description>
			<content:encoded><![CDATA[<p>Some may of noticed (assuming I have any readers), that I have a database searchable version of the netbook of feats up. I went out of my way considerably to parse it and its balance scoring. There are many values that can be sorted by I do not have UI for. So expect me to add UI for these in the future.</p>
<p>Each part of the balance is split up differently. All sorted in an purely numeric InnoDB table. The full text searches only the name, short description, categories, and copyright name (MyIsam). Please be nice to it.</p>
<p>It is missing a few of the feats that had html in its description. I will add those manually at some point.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.csdgn.org/db/280/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
