<?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>Quarterflash Designs &#187; Coding</title>
	<atom:link href="http://quarter-flash.com/wp/category/coding/feed/" rel="self" type="application/rss+xml" />
	<link>http://quarter-flash.com/wp</link>
	<description>The ramblings of a new writer</description>
	<lastBuildDate>Sun, 04 Jul 2010 02:39:16 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Interesting message from Mono C# compiler</title>
		<link>http://quarter-flash.com/wp/2010/07/03/interesting-message-from-mono-c-compiler/</link>
		<comments>http://quarter-flash.com/wp/2010/07/03/interesting-message-from-mono-c-compiler/#comments</comments>
		<pubDate>Sun, 04 Jul 2010 02:36:43 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Coding]]></category>

		<guid isPermaLink="false">http://quarter-flash.com/wp/?p=48</guid>
		<description><![CDATA[ List&#60;Position&#62; result;
 
 // insert the questions into a structure to make them easy to search
 while ((line = data.ReadLine ()) != null) {
 //Console.WriteLine (&#8221;{0}&#8221;, line);
 string[] words = line.Split(delimiters, StringSplitOptions.RemoveEmptyEntries);
 wordPosition = 0;
 
 foreach (string word in words) {
 if ((result = noSig.Find(word)).Count != 0)
 significant = true;
 else
 significant = [...]]]></description>
			<content:encoded><![CDATA[<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"><span style="white-space: pre;"> </span>List&lt;Position&gt; result;</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"><span style="white-space: pre;"> </span></div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"><span style="white-space: pre;"> </span>// insert the questions into a structure to make them easy to search</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"><span style="white-space: pre;"> </span>while ((line = data.ReadLine ()) != null) {</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"><span style="white-space: pre;"> </span>//Console.WriteLine (&#8221;{0}&#8221;, line);</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"><span style="white-space: pre;"> </span>string[] words = line.Split(delimiters, StringSplitOptions.RemoveEmptyEntries);</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"><span style="white-space: pre;"> </span>wordPosition = 0;</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"><span style="white-space: pre;"> </span></div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"><span style="white-space: pre;"> </span>foreach (string word in words) {</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"><span style="white-space: pre;"> </span>if ((result = noSig.Find(word)).Count != 0)</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"><span style="white-space: pre;"> </span>significant = true;</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"><span style="white-space: pre;"> </span>else</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"><span style="white-space: pre;"> </span>significant = false;</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"><span style="white-space: pre;"> </span>//Console.WriteLine (&#8221;{0}: {1} {2} ({3}))&#8221;, lineCount, wordPosition, word, significant);</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">
<p><span style="white-space: pre;"> </span>Position p</p>
<p>= new Position (lineCount, wordPosition++, significant);</p></div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"><span style="white-space: pre;"> </span>wordTree.Add (word, p);</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"><span style="white-space: pre;"> </span>}</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"><span style="white-space: pre;"> </span>lineCount++;</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"><span style="white-space: pre;"> </span>}</div>
<div>First off, hard to believe it&#8217;s been so long since I posted here.</div>
<div>I ran across an interesting little problem the latest C# compiler for mono has in analyzing this bit of code:</div>
<pre><span style="white-space: pre;"> </span>List&lt;Position&gt; result;</pre>
<pre><span style="white-space: pre;"> </span>// insert the questions into a structure to make them easy to search</pre>
<pre><span style="white-space: pre;"> </span>while ((line = data.ReadLine ()) != null) {</pre>
<pre><span style="white-space: pre;">   </span>string[] words = line.Split(delimiters, StringSplitOptions.RemoveEmptyEntries);</pre>
<pre><span style="white-space: pre;">   </span>wordPosition = 0;</pre>
<pre><span style="white-space: pre;">   </span>foreach (string word in words) {</pre>
<pre><span style="white-space: pre;">     </span>if (<span style="color: #ff0000;">(result = noSig.Find(word)).Count</span> != 0)</pre>
<pre><span style="white-space: pre;">       </span>significant = true;</pre>
<pre><span style="white-space: pre;">     </span>else</pre>
<pre><span style="white-space: pre;">       </span>significant = false;</pre>
<pre><span style="white-space: pre;">     </span>Position p = new Position (lineCount, wordPosition++, significant);</pre>
<pre><span style="white-space: pre;">     </span>wordTree.Add (word, p);</pre>
<pre><span style="white-space: pre;">   </span>}</pre>
<pre><span style="white-space: pre;">   </span>lineCount++;</pre>
<pre><span style="white-space: pre;"> </span>}</pre>
<div>This code gives me the warning:</div>
<div>The variable &#8216;result&#8217; is assigned but never used (CS0219)</div>
<div>The code shown in red is obviously using the variable. A bit indirectly, perhaps.</div>
<div>Since I had been editing code and renaming variables I thought that I had just missed one, so I deleted it. Which caused the next problem, that the variable result was not defined :)</div>
<div>Not a big deal, I just found it amusing.</div>
]]></content:encoded>
			<wfw:commentRss>http://quarter-flash.com/wp/2010/07/03/interesting-message-from-mono-c-compiler/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>GTK# Tutorial</title>
		<link>http://quarter-flash.com/wp/2008/08/03/gtk-tutorial/</link>
		<comments>http://quarter-flash.com/wp/2008/08/03/gtk-tutorial/#comments</comments>
		<pubDate>Sun, 03 Aug 2008 16:45:20 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Coding]]></category>

		<guid isPermaLink="false">http://quarter-flash.com/wp/2008/08/03/gtk-tutorial/</guid>
		<description><![CDATA[I&#8217;ve decided, as I may have mentioned before, that I plan on using C# and GTK# built using MonoDevelop as my cross-platform platform of choice. I&#8217;ve always had one problem with this &#8211; getting the GUI to be responsive.
You have to understand that I&#8217;ve been programming a long time (the first program I wrote I [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve decided, as I may have mentioned before, that I plan on using C# and GTK# built using MonoDevelop as my cross-platform platform of choice. I&#8217;ve always had one problem with this &#8211; getting the GUI to be responsive.</p>
<p>You have to understand that I&#8217;ve been programming a <strong>long</strong> time (the first program I wrote I had to flip the toggle switches on the front panel to toggle in the 0&#8217;s and 1&#8217;s), but just about everything I&#8217;ve done has been command line based. Mostly utility programs, programs that operate behind the scenes, programs that are used by other developers or systems people &#8211; in short, nothing graphical in nature. This is a whole new issue for me.<span id="more-22"></span></p>
<p>So, of course,  the first thing you do is hit Google, or the C#/GTK# pages looking for a tutorial on how to do this. I found a problem here &#8211; there are a lot of tutorials, but they&#8217;re relatively static. That is, they show how to put a button and a text display on a page, press the button and update the text display. Those tutorials work, but they don&#8217;t expand well.</p>
<p>I&#8217;m working on programs that put up a display, take some input, and then go off and do some work. This work is supposed to give feedback to the user so they know what&#8217;s happening. The tutorials I found don&#8217;t do that.</p>
<p>Thus was born this tutorial in which I use Glade# to develop the interface and then use GTK# to run a simple little program that picks a number between 1 and 10,000 and then tries to determine what that number is. While it&#8217;s guessing, it&#8217;s updating the GUI to show the current guessed number and how many guesses it&#8217;s taken so far.</p>
<p>I don&#8217;t claim that this is extensible to the most complex program, it&#8217;s worked for this tutorial and now I&#8217;m off to implement this method in a larger program to see how well it works there.</p>
<p>I&#8217;ve included links to a MonoDevelop and a VS2005 solution. Please download and give them a try. Feedback is most welcome.</p>
<p>Hopefully someone will find this useful.</p>
<p><a title="MonoDevelop Solution for the tutorial" href="http://quarter-flash.com/wp/wp-content/uploads/2008/08/gtkgladetutorial-mdstar.gz">MonoDevelop Solution for the tutorial</a></p>
<p><a title="VS2005 Solution for the tutorial" href="http://quarter-flash.com/wp/wp-content/uploads/2008/08/gtkgladetutorial-slntar.gz">VS2005 Solution for the tutorial</a></p>
]]></content:encoded>
			<wfw:commentRss>http://quarter-flash.com/wp/2008/08/03/gtk-tutorial/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>.NET command line parsing</title>
		<link>http://quarter-flash.com/wp/2008/07/22/net-command-line-parsing/</link>
		<comments>http://quarter-flash.com/wp/2008/07/22/net-command-line-parsing/#comments</comments>
		<pubDate>Tue, 22 Jul 2008 19:44:07 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Coding]]></category>

		<guid isPermaLink="false">http://quarter-flash.com/wp/?p=19</guid>
		<description><![CDATA[For a project I&#8217;m working on I needed an assembly that would easily parse a command line.
&#8220;A command line? What&#8217;s that?&#8221;  you might ask. I understand that most of the programs you run always start up with a GUI that you can then use to set up all your parameters. This is not always the [...]]]></description>
			<content:encoded><![CDATA[<p>For a project I&#8217;m working on I needed an assembly that would easily parse a command line.</p>
<p>&#8220;A command line? What&#8217;s that?&#8221;  you might ask. I understand that most of the programs you run always start up with a GUI that you can then use to set up all your parameters. This is not always the Right Thing to do. A lot of what I program are utility programs that do things to files in a scripted (or batch) mode. GUIs, in this case, just get in the way.  Thus the command line &#8211; you tell the program what to do when you start it up and it never talks to you again.</p>
<p>For example:</p>
<pre> playMP3 --directory /myhome/music --background true</pre>
<p>The convention is that a long name option has two preceding &#8211; (dash) characters and a short name option (a single character) has a single preceding dash character.</p>
<p><span id="more-19"></span>There are certainly a lot of options out there for doing this sort of thing, but I can be sort of an odd person &#8211; if I&#8217;m using a language, I want to <strong>use</strong> the language;  not write in a language I&#8217;m comfortable in and just use the syntax of the new language.</p>
<p>That may be a difficult concept to visualize if you&#8217;re not a programmer. Hopefully someone can comment and give an example in the non-programming world, but I can give a programming example. I once worked with a programmer that had done most of his work in COBOL and he was very good at it. Times change, and he needed to be programming in C. C is <strong>not</strong> like COBOL at all. It is, after all, meant to do different things.This person wrote C programs and they compiled and they worked</p>
<p>However, one look at his source and you could tell that his mind was still writing COBOL. He wasn&#8217;t taking advantage of many of the features that C has and the program was structured as if it were in COBOL. He got the job done, but it could have been done better.</p>
<p>So, to get back on track, I was looking for an assembly that could do command line processing that externally looked like all the other command line processing I was familiar with, but internally it was written as a C# program.</p>
<p>I searched <a href="http://google.com" title="Google Search Engine" target="_blank">Google</a> and found a lot of candidates, but one named <a href="http://www.codeplex.com/commandline" title="Command Line Parser Library" target="_blank">Command Line Parser Library</a> seemed to fit the bill very well. I downloaded and compiled it, sorted out the documentation, and started using it.</p>
<p>Well, I&#8217;m an iterative developer and as I expanded the utility program I was writing I found that this particular assembly was not capable of doing one thing I needed it to do. No worries, there are a lot of choices out there so I went back to Google and did some more looking. I found that the assembly I was already using really was easy to use and was so close to being what I needed that I contacted the author and talked to him about it.</p>
<p>He asked me to make an entry on the web site and he&#8217;d try to sort out how to accomplish what I needed. He already had a similar feature, used for trailing arguments, but I needed to be able to do things just a bit different. If he didn&#8217;t have the time and/or inclination to add this feature then I was prepared to delve in to the code to add it myself.</p>
<p>However, just today he released a new version with my feature added. Very cool.</p>
<p>He apologized for it taking so long, but since I knew he was working on it, the time it took hadn&#8217;t bothered me. Not having this feature hadn&#8217;t been holding me up because I  had a lot of other development to work on. Now I can go back and update the code and take advantage of this newly added feature.</p>
<p>Why am I blogging about this? Just because I think it&#8217;s important to acknowledge that a substantial amount of good work is going on in the small development shops. If he&#8217;s like me (and it sounds like he is) the definition of &#8220;development shop&#8221; is him sitting in front of his computer in the basement or spare room whenever you have the time to work on writing code for fun. He&#8217;s not getting paid for this, he&#8217;s scratching an itch and that&#8217;s something I can identify with.</p>
]]></content:encoded>
			<wfw:commentRss>http://quarter-flash.com/wp/2008/07/22/net-command-line-parsing/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ImageResizer</title>
		<link>http://quarter-flash.com/wp/2007/11/04/imageresizer/</link>
		<comments>http://quarter-flash.com/wp/2007/11/04/imageresizer/#comments</comments>
		<pubDate>Sun, 04 Nov 2007 22:26:50 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[photography]]></category>

		<guid isPermaLink="false">http://quarter-flash.com/wp/?p=16</guid>
		<description><![CDATA[This is part 3 of the Open Source Takeover series.  I had to make a change to the user interface as I didn&#8217;t understand how a couple of the widgets were meant to be used. Here&#8217;s the new and, pending some input from actual users, final look of the application:

I spent a lot of [...]]]></description>
			<content:encoded><![CDATA[<p>This is part 3 of the Open Source Takeover series.  I had to make a change to the user interface as I didn&#8217;t understand how a couple of the widgets were meant to be used. Here&#8217;s the new and, pending some input from actual users, final look of the application:</p>
<p><img src="http://quarter-flash.com/ResizerScreen2.png" title="Final User Interface" alt="Final User Interface" height="269" width="650" /></p>
<p><span id="more-16"></span>I spent a lot of Saturday and Sunday trying to sort out how to do the configuration in an easier manner than the original writer and was having a lot of difficulties sorting it out. I finally found something called <a href="http://sourceforge.net/projects/nini/">Nini</a> that is working just fine.</p>
<p>So, I still have to tie changes in the UI back to the configuration file and then forklift the code from the original project into this one. I started a new project because a) I wanted a slightly different name, and b) it was easy to keep the original, working code separate from my changes.</p>
<p>I ran across a couple of open source Windows installers so, hopefully, by the end of the week I&#8217;ll have this ready to distribute.</p>
]]></content:encoded>
			<wfw:commentRss>http://quarter-flash.com/wp/2007/11/04/imageresizer/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Open Source Takeover, part 2</title>
		<link>http://quarter-flash.com/wp/2007/11/03/open-source-takeover-part-2/</link>
		<comments>http://quarter-flash.com/wp/2007/11/03/open-source-takeover-part-2/#comments</comments>
		<pubDate>Sat, 03 Nov 2007 16:36:53 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[photography]]></category>

		<guid isPermaLink="false">http://quarter-flash.com/wp/?p=15</guid>
		<description><![CDATA[I now have a working resizer/watermarker, but it only works if I manually edit the configuration file. This is because the original author had a separate config program and that was written with some sort of code generator. That&#8217;s not a bad thing, mind you, except for the fact that the code it generates is [...]]]></description>
			<content:encoded><![CDATA[<p>I now have a working resizer/watermarker, but it only works if I manually edit the configuration file. This is because the original author had a separate config program and that was written with some sort of code generator. That&#8217;s not a bad thing, mind you, except for the fact that the code it generates is rife with absolute pixel positions and that makes it difficult to add on new elements.</p>
<p><span id="more-15"></span>When I finally got that straight in my head, I decided to integrate the two programs in to one. I think the original thought was that the actual resizer was meant to be a command line sort of thing and there wasn&#8217;t a need for a user interface. Since it always opened up some sort of a dialog to tell you what it had done or to ask a question or two, I decided that making it a graphical program from the start would be OK.</p>
<p>So, I fired up the interface editor and came up with this:</p>
<p><img src="http://quarter-flash.com/ResizerScreen.png" title="Proposed user interface for the resizer program" alt="Proposed user interface for the resizer program" border="0" /></p>
<p>The one thing that&#8217;s not correct yet is the Max Size element. Obviously we don&#8217;t want fractional sizes. I think that&#8217;s a setting in the widget, but I&#8217;m not quite there yet. That is the next step, tieing the new interface to the existing code.</p>
<p>One thing that might not be evident from that screenshot is that the bottom element is a status bar, in which the user will see the images fly by as the resizer works.</p>
<p>Thoughts? Does it look OK?  GUI design is definitely <strong>not</strong> my strong point, so I won&#8217;t be offended by people that want to make it more usable.</p>
<p>Stay tuned.</p>
]]></content:encoded>
			<wfw:commentRss>http://quarter-flash.com/wp/2007/11/03/open-source-takeover-part-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Open Source Takeover</title>
		<link>http://quarter-flash.com/wp/2007/10/29/open-source-takeover/</link>
		<comments>http://quarter-flash.com/wp/2007/10/29/open-source-takeover/#comments</comments>
		<pubDate>Mon, 29 Oct 2007 15:05:11 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[photography]]></category>

		<guid isPermaLink="false">http://quarter-flash.com/wp/?p=14</guid>
		<description><![CDATA[OK, so it&#8217;s not that dramatic &#8211; but here&#8217;s the story.
I&#8217;ve recently gotten involved with a group called &#60;a href=&#8221;http://eons.com&#8221; target=&#8221;_blank&#8221;&#62;Eons&#60;/a&#62;, a website that&#8217;s targeted toward the over 50 folks. I&#8217;m involved in the Better Photography group, and the subject came up about someone&#8217;s image being &#8220;borrowed&#8221; by a different person without permission.
So, I went [...]]]></description>
			<content:encoded><![CDATA[<p>OK, so it&#8217;s not that dramatic &#8211; but here&#8217;s the story.</p>
<p>I&#8217;ve recently gotten involved with a group called &lt;a href=&#8221;http://eons.com&#8221; target=&#8221;_blank&#8221;&gt;Eons&lt;/a&gt;, a website that&#8217;s targeted toward the over 50 folks. I&#8217;m involved in the <em>Better Photography</em> group, and the subject came up about someone&#8217;s image being &#8220;borrowed&#8221; by a different person without permission.</p>
<p>So, I went off the to web to look for some sort of utility that would be able to resize and watermark images. I found a resizer program (named, appropriately enough, Resizer) and an article on creating both image and text watermarks. The Resizer program was up for adoption as the person who wrote it was no longer interested in maintaining it. He had written it for a specific purpose and the program was no longer needed.</p>
<p>I contacted him about adopting it and after the appropriate conversations, he passed it on to me. I added three features to it (reduced DPI, image watermarking, text watermarking) and it&#8217;s now working. I don&#8217;t have it available for download quite yet as it&#8217;s currently set up as two separate programs &#8211; one to edit the config, one to resize images. In the process of fixing the config I came to the conclusion that I needed to integrate the two programs as I don&#8217;t want to plot pixels to place items on the dialog by using pixel counts.</p>
<p>One other thing that prevents me from putting up at the moment is that it&#8217;s a .NET program (and yes, it runs on both Windows and Linux) but I don&#8217;t have a good install for it yet. I have a link or two to investigate for an install program, but I&#8217;ve not quite gotten that far.</p>
<p>All that being said, if you have .NET installed on your Windows or Linux box and don&#8217;t mind a little hand-editing of the config file, then drop me a line and I&#8217;ll zip up the two programs for you to try out.</p>
]]></content:encoded>
			<wfw:commentRss>http://quarter-flash.com/wp/2007/10/29/open-source-takeover/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Starting the book</title>
		<link>http://quarter-flash.com/wp/2007/09/08/starting-the-book/</link>
		<comments>http://quarter-flash.com/wp/2007/09/08/starting-the-book/#comments</comments>
		<pubDate>Sat, 08 Sep 2007 14:59:15 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[book]]></category>

		<guid isPermaLink="false">http://quarter-flash.com/wp/?p=10</guid>
		<description><![CDATA[I&#8217;m glad I have a mentor in this process.
Right now he has the confidence in me that I don&#8217;t (yet.)  I&#8217;m just having a hard time getting started. The first chapter is all about getting set up. Since the book is about coding you have to have some tools installed to get working.
Since I&#8217;ve already [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m glad I have a mentor in this process.</p>
<p>Right now he has the confidence in me that I don&#8217;t (yet.)  I&#8217;m just having a hard time getting started. The first chapter is all about getting set up. Since the book is about coding you have to have some tools installed to get working.</p>
<p><span id="more-10"></span>Since I&#8217;ve already been annoyed at books and articles that say &#8220;Here&#8217;s what I&#8217;m using, if you don&#8217;t use this you&#8217;re on your own&#8221;<strong>and</strong> I&#8217;m writing a platform independent How-To, I feel as if I at least need to show how to set up the environment for the two primary platforms: Windows and Linux.</p>
<p>The problem is this: I&#8217;m not the expert on Windows and I have to find a Windows box that doesn&#8217;t already have some sort of Visual Studio installed on it already. I should have the virgin Windows box resolved as my work desktop is dual boot system and it&#8217;s only been booted into Windows once. It just means that I have to pay very close attention to the steps involved in downloading and installing the free version of VS.</p>
<p>Also, in the book, do I use screen shots? After all, it&#8217;s a web page, so it&#8217;s subject to change at any time and having pictures of something that doesn&#8217;t exist isn&#8217;t very helpful. But without pictures, what do I call those areas on the screen?  Since the free versions of VS are targeted to a specific language, the page they show has separate visual areas for each of the choices (VC#, VB, VC++, etc) and you pick your &#8220;natural language&#8221; (English, Chinese, etc) and then it starts the download.</p>
<p>I just don&#8217;t have the terminology to describe what to do on that page.</p>
<p>My mentor says that I should be targeting the book to beginning to intermediate programmers. I don&#8217;t have an issue with that, but it&#8217;s been a long time since I was a beginner so how detailed do I make the installation instructions? How much do I presume they do (or should) know, and at what point is what they need to do outside the scope of the book?</p>
<p>I really think this will all get easier (hey, you in the back,  stop laughing) as I go on and I start to get a feel for how it all goes together.</p>
<p>Stay tuned, hilarity is sure to ensue.</p>
]]></content:encoded>
			<wfw:commentRss>http://quarter-flash.com/wp/2007/09/08/starting-the-book/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Yes, I&#8217;m still alive</title>
		<link>http://quarter-flash.com/wp/2007/07/30/yes-im-still-alive/</link>
		<comments>http://quarter-flash.com/wp/2007/07/30/yes-im-still-alive/#comments</comments>
		<pubDate>Mon, 30 Jul 2007 15:52:29 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Coding]]></category>

		<guid isPermaLink="false">http://quarter-flash.com/wp/?p=7</guid>
		<description><![CDATA[As you can tell, I&#8217;m really bad at this writing thing.
I&#8217;m currently working on a couple of .NET projects. The first is to instantiate a rendition of a galaxy by using the rules for creating a planetary system using the rules found in Universe, a RPG originally created by SPI.
I pretty much have the code [...]]]></description>
			<content:encoded><![CDATA[<p>As you can tell, I&#8217;m really bad at this writing thing.</p>
<p>I&#8217;m currently working on a couple of .NET projects. The first is to instantiate a rendition of a galaxy by using the rules for creating a planetary system using the rules found in Universe, a RPG originally created by SPI.</p>
<p><span id="more-7"></span>I pretty much have the code written to create a galaxy and I just need a way to display it to ensure that all those numbers actually turn out to create nice systems and to have some visual feedback on how they look.</p>
<p>In order to do that, I&#8217;m working on the next (and parallel) project. I have a book that creates a 3D engine based on OpenGL. I am, in essence, translating that in to C#. It&#8217;s interesting to see what sort of things people who code in C/C++ do and assume.</p>
<p>I know, I used to be one of them :)</p>
<p>The most difficult thing to &#8220;translate&#8221; is the assumption that anything can be a stream of bytes. For example, reading the header of an archive file in the author&#8217;s code is just, essentially,</p>
<p>struct header {char sig[5]; int major; int minor;} h;<br />
fread(&amp;h, sizeof(h), fp);</p>
<p>This causes a problem in C# &#8211; mainly because pointers aren&#8217;t safe code. So I end up reading the header an entity at a time. *And* I have to account for padding.<br />
There&#8217;s an extra 3 bytes after the sig because ints have to be on a 4 byte boundary.</p>
<p>Thus I&#8217;ve created version 2 of the archive file that will treat it a bit differently. I can still read the old format, but if any changes are made it will write a new format file.</p>
<p>At any rate, once I have a display system for the galaxy then I can worry about how to evolve this into a game.</p>
<p>Next time (which should be a few months sooner that the lag between these last two posts) I&#8217;ll post up what tools I&#8217;m using to build this stuff. It&#8217;s just that it&#8217;s at home now and I&#8217;m stealing time from work to post this up.</p>
]]></content:encoded>
			<wfw:commentRss>http://quarter-flash.com/wp/2007/07/30/yes-im-still-alive/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>An old fashioned guy, revisited</title>
		<link>http://quarter-flash.com/wp/2007/01/12/an-old-fashioned-guy-revisited/</link>
		<comments>http://quarter-flash.com/wp/2007/01/12/an-old-fashioned-guy-revisited/#comments</comments>
		<pubDate>Fri, 12 Jan 2007 14:34:01 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[Ramblings]]></category>

		<guid isPermaLink="false">http://quarter-flash.com/wp/?p=6</guid>
		<description><![CDATA[If you search long enough you can eventually find what you&#8217;re looking for.
I do have to wonder, however, why some people  have to make things so difficult.

So, it turns out that if I look for a tutorial on just plain GTK then it&#8217;s easier to find what I&#8217;m looking for. On first blush it&#8217;s [...]]]></description>
			<content:encoded><![CDATA[<p>If you search long enough you can eventually find what you&#8217;re looking for.</p>
<p>I do have to wonder, however, why some people  have to make things so difficult.</p>
<p><span id="more-6"></span></p>
<p>So, it turns out that if I look for a tutorial on just plain GTK then it&#8217;s easier to find what I&#8217;m looking for. On first blush it&#8217;s not all that easy to design a form using GTK. There are a lot of fiddly bits to get all lined up to make it work.</p>
<p>Now, I&#8217;ll admit right here that I&#8217;m not at one with graphical design (using graphical tools to create things) but to my way of thinking there is a lot of non-intuitive stuff going on.</p>
<p>When I first tried putting a menu on the form, I dragged it on and it promptly expanded to be full size &#8211; it took up the entire window. Now, that might be OK if the new object was resizable, but it&#8217;s not. It turns out that you need containers for all your widgets. This just seems counter-intuitive to me, but now that I know (or at least have an idea of) how it works, I&#8217;ll give using GTK another shot. I had switched back to using Windows Forms for a couple of reasons. The first, of course, is that the GTK version wasn&#8217;t making sense. Secondly, I&#8217;ll give the designers at Microsoft kudos for how they implemented their stuff. It is much simpler and straight forward to implement than the folks at GTK came up with. Thirdly, since this is meant to be a cross platform application I wasn&#8217;t sure I wanted to mess around with adding a GTK requirement for the Windows folks.</p>
<p>I don&#8217;t know enough yet about distributing ECMA 334 applications yet, so that last point my be a non-issue. Far more important, to me, is the ease of programming. Especially as GTK seems so convoluted. I&#8217;ll try an example here to show you.</p>
<p><strong>Windows Forms</strong></p>
<pre>public class RSSMenu : MainMenu
{
MenuItem miFile;
MenuItem miFileOpen;
MenuItem miFileClose;
MenuItem miFileExit;

public RSSMenu()
{
miFile = new MenuItem("&#038;File");
MenuItems.Add(miFile);

miFileOpen = new MenuItem("&#038;Open");
miFileClose = new MenuItem("&#038;Close");
miFileExit = new MenuItem("&#038;Exit");

miFile.MenuItems.Add(miFileOpen);
miFile.MenuItems.Add(miFileClose);
miFile.MenuItems.Add(new MenuItem("-"));
miFile.MenuItems.Add(miFileExit);

miFileOpen.Click += new EventHandler(miFileOpen_Click);
miFileClose.Click += new EventHandler(miFileClose_Click);
miFileExit.Click += new EventHandler(miFileExit_Click);

}

public void miFileOpen_Click(object sender, EventArgs e)
{
}</pre>
<pre>}</pre>
<p>Note how easy it is to add items to a menu and event handlers to the widgets.<br />
<strong> GTK</strong></p>
<pre>menu = gtk_menu_new ();

/* Next we make a little loop that makes three menu-entries for "test-menu".
* Notice the call to gtk_menu_shell_append.  Here we are adding a list of
* menu items to our menu.  Normally, we'd also catch the "clicked"
* signal on each of the menu items and setup a callback for it,
* but it's omitted here to save space. */

for (i = 0; i < 3; i++)
{
/* Copy the names to the buf. */
sprintf (buf, "Test-undermenu - %d", i);

/* Create a new menu-item with a name... */
menu_items = gtk_menu_item_new_with_label (buf);

/* ...and add it to the menu. */
gtk_menu_shell_append (GTK_MENU_SHELL (menu), menu_items);

/* Do something interesting when the menuitem is selected */
g_signal_connect_swapped (G_OBJECT (menu_items), "activate",
G_CALLBACK (menuitem_response),
(gpointer) g_strdup (buf));

/* Show the widget */
gtk_widget_show (menu_items);
}

/* This is the root menu, and will be the label
* displayed on the menu bar.  There won't be a signal handler attached,
* as it only pops up the rest of the menu when pressed. */
root_menu = gtk_menu_item_new_with_label ("Root Menu");

gtk_widget_show (root_menu);

/* Now we specify that we want our newly created "menu" to be the menu
* for the "root menu" */
gtk_menu_item_set_submenu (GTK_MENU_ITEM (root_menu), menu);</pre>
</pre>
<pre>/* Create a menu-bar to hold the menus and add it to our main window */
menu_bar = gtk_menu_bar_new ();

gtk_widget_show (menu_bar);

/* Create a button to which to attach menu as a popup */
button = gtk_button_new_with_label ("press me");
g_signal_connect_swapped (G_OBJECT (button), "event",
G_CALLBACK (button_press),
G_OBJECT (menu));

gtk_widget_show (button);

/* And finally we append the menu-item to the menu-bar -- this is the
* "root" menu-item I have been raving about =) */
gtk_menu_shell_append (GTK_MENU_SHELL (menu_bar), root_menu);

/* always display the window as the last step so it all splashes on
* the screen at once. */
gtk_widget_show (window);</pre>
<p>The GTK code came from a tutorial located at <a href="http://www.gtk.org/tutorial/x1579.html">http://www.gtk.org/tutorial/x1579.html</a>. Note that I am not criticizing his programming techniques here, just contrasting the two methods.</p>
]]></content:encoded>
			<wfw:commentRss>http://quarter-flash.com/wp/2007/01/12/an-old-fashioned-guy-revisited/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>An old fashioned guy</title>
		<link>http://quarter-flash.com/wp/2007/01/07/an-old-fashioned-guy/</link>
		<comments>http://quarter-flash.com/wp/2007/01/07/an-old-fashioned-guy/#comments</comments>
		<pubDate>Sun, 07 Jan 2007 22:17:34 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[Ramblings]]></category>

		<guid isPermaLink="false">http://quarter-flash.com/wp/?p=4</guid>
		<description><![CDATA[I&#8217;m attempting to use ECMA 334 (.Net or Mono &#8211; in my case, Mono) to create some cross-platform applications. Before striking out on my own programs I decided to attempt to run through an exercise in a book to create their application first, especially as it&#8217;s something I can use.
 The book is [i]Practical Mono[/i] [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m attempting to use ECMA 334 (.Net or Mono &#8211; in my case, Mono) to create some cross-platform applications. Before striking out on my own programs I decided to attempt to run through an exercise in a book to create their application first, especially as it&#8217;s something I can use.</p>
<p><span id="more-4"></span> The book is [i]Practical Mono[/i] by Mark Momone (APress) and the application is an RSS reader. This is application useful to me because I should be able to modify it to store the feeds in a common place on my server. Currently I&#8217;m using Thunderbird to read the RSS feeds I&#8217;m interested in, which works fine, but since the RSS info is stored locally I have to coordinate which things I&#8217;ve read where, etc. Having a common storage area would alleviate this problem.</p>
<p>OK, now that you have the background here&#8217;s my beef:  The book uses System.Windows.Forms (that&#8217;s fine) but I want to use GTK#.  In order to create the menus for the application the book puts it all in code. Any tutorials that reference creating menus using GTK# want me to use the graphical tool to do that.</p>
<p>I&#8217;m minimally competent in using designer interfaces. Actually, using the word &#8220;minimally&#8221; might be giving myself too much credit. My brain just doesn&#8217;t work that way. Simple stuff I&#8217;m OK with. I&#8217;m using MonoDevelop for the application work and I can muddle through that OK. But grab a picture of a control and put it on a page and then edit it? I just don&#8217;t see it.</p>
<p>As an aside, I was in some sort of &#8220;play nice with others&#8221; training at work (and got in trouble for stating that &#8220;sometimes I think other people are idiots because they are&#8221;, but never mind that) and the instructor used a bit of video tape with MLK&#8217;s &#8220;I have a dream&#8221; speech. After she was done with the clip, she was talking about how the words he used invoked a visual response. I told her that it didn&#8217;t for me. Yes, the words were inspiring, but I didn&#8217;t see pictures in my mind. Turns out everyone else did. I think this is just another aspect of my having issues with what appears to me to be complicated visual cues.</p>
<p>Oh, and I get my daughter to use The Gimp/Photoshop to fix up images for me. If it&#8217;s more than cropping or changing the size I just don&#8217;t get it. All those layers? Just more opportunity for me to get lost in a maze of twisty little passages, all alike.<br />
Am I the only person left who wants to write code instead of using drag and drop? I&#8217;ve wondered if it&#8217;s just something built into my brain or if all those years of only having a command line have ossified my brain paths into ruts that I can no longer see out of as I wander down the aisles of new development.</p>
]]></content:encoded>
			<wfw:commentRss>http://quarter-flash.com/wp/2007/01/07/an-old-fashioned-guy/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
