<?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>Neural Network Design blog &#187; code images</title>
	<atom:link href="http://janbogaerts.name/index.php/tag/code-images/feed/" rel="self" type="application/rss+xml" />
	<link>http://janbogaerts.name</link>
	<description>My take on neural networks, AI and more</description>
	<lastBuildDate>Thu, 15 Dec 2011 18:43:57 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Structured editors: a first impression</title>
		<link>http://janbogaerts.name/index.php/2010/12/20/structured-editors-a-first-impression/</link>
		<comments>http://janbogaerts.name/index.php/2010/12/20/structured-editors-a-first-impression/#comments</comments>
		<pubDate>Mon, 20 Dec 2010 15:58:20 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[.net]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[code editor]]></category>
		<category><![CDATA[code images]]></category>
		<category><![CDATA[designers]]></category>
		<category><![CDATA[editing]]></category>
		<category><![CDATA[interface]]></category>
		<category><![CDATA[structured editor]]></category>
		<category><![CDATA[WPF]]></category>

		<guid isPermaLink="false">http://janbogaerts.name/index.php/2010/12/20/structured-editors-a-first-impression/</guid>
		<description><![CDATA[For a while now, I’ve been working fairly intensely with the designer and it’s many structured editors. Long enough for me to get a feeling for them and find a good rhythm in working with them. So I thought it perhaps time to put down my experiences and ideas for future improvements. To tell you [...]]]></description>
			<content:encoded><![CDATA[<p>For a while now, I’ve been working fairly intensely with the designer and it’s many structured editors. Long enough for me to get a feeling for them and find a good rhythm in working with them. So I thought it perhaps time to put down my experiences and ideas for future improvements.<br />
To tell you the  truth, I took a big risk when I decided to make all the editors, including the one for code, as <a href="http://en.wikipedia.org/wiki/Structure_editor" target="_blank">structured editors</a> (aka not text-based). The reasons are simple:</p>
<ul>
<li>I had never made something like that, while I had plenty of experience <a href="http://users.telenet.be/GeneCompiler/" target="_blank">designing languages</a>,</li>
<li>I didn’t really know what the end product would look like or how it would behave,</li>
<li>and apart from some ‘UML designers’ that render classes, I had never used such a thing for editing code myself.</li>
</ul>
<p>So then, what made me decide to use this approach instead of the more conventional and traditional way of using text?  First of, a major part of the answer lies in the previous statement <img class="wlEmoticon wlEmoticon-winkingsmile" style="border-style: none;" src="http://janbogaerts.name/wp-content/uploads/2010/12/wlEmoticon-winkingsmile.png" alt="Winking smile" /> . Other reasons were:</p>
<ul>
<li>Guided editors (can) lower the entrance level, when done properly (something I needed,… seriously).</li>
<li>I new I would be needing some good debuggers (lessons learned!!). I could try and incorporate these into some existing editors, or turn out one of my own. At the time, it seemed a better idea to have full control from top to bottom, if I wanted to do this properly.</li>
<li>I had a bit of experience working in WPF, which gave me some confidence that it was possible.</li>
<li>Also, I came across this, <a href="http://blogs.msdn.com/b/kirillosenkov/archive/2009/09/08/first-videos-of-the-structured-editor-prototype.aspx" target="_blank">rather serious attempt at structured editors </a>(originally for C#), which raised my hopes as well.</li>
<li>Did I already mention you that I was hoping this would make things a bit simpler for other people to understand?</li>
</ul>
<p>In the end, it turns out I am glad I decided to use this approach, though not exactly for the reasons as previously stated.<a href="http://janbogaerts.name/wp-content/uploads/2010/12/image.png"><img style="background-image: none; padding-left: 0px; padding-right: 0px; display: inline; float: right; padding-top: 0px; border-width: 0px;" title="image" src="http://janbogaerts.name/wp-content/uploads/2010/12/image_thumb.png" border="0" alt="image" width="111" height="142" align="right" /></a> Except perhaps for the debugging, which really was fairly easy to implement this way. No, the thing that convinced me was the way that it changes how you program. This didn’t happen over night, I only began noticing this the last couple of months, after some 1,5 years of (trying to) program this way.<br />
So what changed: well, over time, when I needed a ‘variable’, instead of thinking ‘variable’ I began to think ‘purple’. This is a shift from thinking in words to thinking in color. The best evidence for this, came in the form of me, continually trying to put a conditional in an assignment as if it were a global (cause I thought I had picked up a global). If you look at the picture to the right, you can probably understand why I erred: the blue colors are just to close to each other.<br />
What’s more, over time I also began to think more and more in visual structures instead of ‘if-else’ or ‘while-do’. When I think about an ‘if’, I think:</p>
<p><a href="http://janbogaerts.name/wp-content/uploads/2010/12/image1.png"><img style="background-image: none; margin: 0px auto 10px; padding-left: 0px; padding-right: 0px; display: block; float: none; padding-top: 0px; border-width: 0px;" title="image" src="http://janbogaerts.name/wp-content/uploads/2010/12/image_thumb1.png" border="0" alt="image" width="461" height="155" /></a> In short, when programming, I am thinking more and more in terms of: blue square, red hexagon, white circle with line below (the conditional part),… Or in other words, it feels as if I am programming like building with <a href="http://www.lego.com/en-gb/default.aspx" target="_blank">Lego</a> blocks!!! <img class="wlEmoticon wlEmoticon-smile" style="border-style: none;" src="http://janbogaerts.name/wp-content/uploads/2010/12/wlEmoticon-smile.png" alt="Smile" /><br />
I can’t explain exactly how or why this is, but it appears to free the mind for thinking about other stuff. At times, I find myself, just mindlessly putting blocks together to build up the picture that I had previously constructed in my head.  Very pleasing.</p>
<p>So, as a first try, I am very happy with the result, well enough for me to continue this path, and with some minor corrections here and there, keep the design. That is not to say there isn’t room for improvement, I have bucket-loads already of those, just not the time, so most of these will not be for the near future.  Others might be implemented sooner, depending on needs.</p>
<p>Basically, most of the concerns are centered round work speed (the number of movements and clicks required for an operation), maintainability and overview:</p>
<h4>Speed</h4>
<ul>
<li>To start with, the toolbox needs some redesign. I currently have 2 pages: one for general items, and a separate tab for all the instructions. I find myself continually switching between the 2, which is time consuming and unnecessary. The solution is simple: split them up in separate toolboxes.</li>
<li>The toolbox currently only supports drag-drop operations. So to get 5 objects of the same type, you need to perform 5 drags. Better would be to have a ‘paint’ tool, like graphical apps, and many (UML) designers have.</li>
<li>The code designer really could use some more keyboard support, so it can be used like a regular text editor (sort of). This seems a logical next step to do, just haven’t gotten there yet.</li>
<li>I have been thinking a lot about using WPF’s new <a href="http://www.davidezordan.net/blog/?p=1136" target="_blank">multi-touch libraries</a> to add support for using 2 mice while coding. I don’t really make use of the left hand during the GUI coding, apart from the occasional copy/paste or editing a label. At times, I could definitely work with 2 hands at the same time. It’s a bit like using both hands for searching and placing blocks.<br />
I had also thought about using this new <a href="http://www.xbox.com/en-GB/kinect" target="_blank">kinect</a> toy, which appears to have been <a href="http://www.engadget.com/2010/11/16/kinect-hack-explained-follow-along-at-home-guide-lets-you-rever/" target="_blank">hacked</a> already for PC usage. This would even resemble more like building with Lego (or like <a href="http://singularityhub.com/2010/12/10/mit-uses-xbox-kinect-to-create-cheap-minority-report-interface-video/" target="_blank">Tom cruise is doing in Minority report</a>) . But then I figured: ok how would you feel after 2 weeks of keeping  your arms up in the air? Ok, I don’t know how I’d feel after 2 weeks like that, but my shoulders and neck definitely do!!!<br />
So that plan was canceled.</li>
</ul>
<h4>Overview</h4>
<ul>
<li>As I’ve previously mentioned, I often simply recreate the picture that’s already in my head. The annoying thing is that the designer only shows a small part of the object (algorithm) that I’m working on, while at times I have more a need for a birds view approach. That’s why I added the zoom support, but more can be done such as:
<ul>
<li>make the code templates (the drawings) a bit smaller. I’m no good at designing, which shows.</li>
<li>provide a bread-crumb like ability (for drilling down and going back up again), much like the windows file explorer provides using it’s breadcrumb approach for directories.  I could use this for sub blocks.</li>
<li>See what I can do about providing support for multiple screens.</li>
<li>Buy a new big sized monitor, but given the massive resources at my disposal, that’s not an option <img class="wlEmoticon wlEmoticon-sadsmile" style="border-style: none;" src="http://janbogaerts.name/wp-content/uploads/2010/12/wlEmoticon-sadsmile.png" alt="Sad smile" /></li>
</ul>
</li>
<li>Also previously stated: some of the colors can use a little tuning, the same perhaps for some shapes, to make them more distinguishable from each other.</li>
<li>Currently, the drop area for the arguments is displayed as a simple, single square. The thing is: the argument requirements are known for each instruction, so it’s perfectly possible to display a custom set of boxes, with correct labels, for each instruction. This, by the way, would also free some space, since no drop area needs to be shown when all arguments are provided.</li>
<li>I could also try to implement some sort of 3D-view on the network model, but I think I’ll need to extend my skill-set for that one.</li>
</ul>
<h4>Maintainability</h4>
<p>The single major issue I have with code maintainability is concerning documentation. I added support for this by allowing to add some ‘rich-text’ string to each neuron. The idea being that you’d put all the comments concerning what’s going on, in there. Unfortunately, it doesn’t really work very well for code documentation because:</p>
<ul>
<li>neurons can be reused. This is different compared to regular text code: when this is compiled, each line of code will get it’s own output (or better, each compiled instruction corresponds with exactly 1 location within the text). With this neural network however, things are a bit different: it’s perfectly possible to use the same assignment in 2 (or more) different places. This is something I do extensively, by the way, to speed up coding and to keep the nr of links down.  What I noticed is this: though the code is shareable, the reason usually isn’t. I am currently solving this by stacking the different comments in the same text-blob, when needed. But better solutions are possible.</li>
<li>I also find it annoying having to select an object in order to see it’s comments within the code view. It appears to be easier/better when you can quickly scan a document for all comments and read the one you need, without thinking about selection.</li>
</ul>
<p>To solve this, I have been thinking about adding support for comments within the ‘project’ documents. These would maintain and display (as call-out balloons) all the comments for the neurons that they contain. The location of the comments would be determined by the comments themselves, so they can be floating, closest to the neuron that they are attached to. This would also allow me to display the comments, even if the actual neurons aren’t visible, but collapsed.</p>
<h4>Final note</h4>
<p>As a final note, for those who would like to build their own structured editor in WPF, perhaps a word of advice: <a href="http://msdn.microsoft.com/en-us/library/system.windows.controls.itemscontrol.aspx" target="_blank">stay away from</a> ItemsControl or any of it’s descendants. The paradigm sounds grate: manage a list of items and display them any way you want through styling and templates. What’s not mentioned is that this only works for 10 objects or so. Any more, and your app slows down to a crawl or worse: crashes just as bad as the good old win32 apps would, perhaps even worse at times. Instead, go lower level: inherit from panel and roll out your own Measure/Arrange or go even further down and overwrite the rendering routines.</p>
 <img src="http://janbogaerts.name/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=513" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://janbogaerts.name/index.php/2010/12/20/structured-editors-a-first-impression/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The new code editor</title>
		<link>http://janbogaerts.name/index.php/2010/05/08/the-new-code-editor/</link>
		<comments>http://janbogaerts.name/index.php/2010/05/08/the-new-code-editor/#comments</comments>
		<pubDate>Sat, 08 May 2010 16:59:22 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[N²D]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[code editor]]></category>
		<category><![CDATA[code images]]></category>

		<guid isPermaLink="false">http://janbogaerts.name/index.php/2010/05/08/the-new-code-editor/</guid>
		<description><![CDATA[Note: Deprecated! The new code editor is beginning to work:]]></description>
			<content:encoded><![CDATA[<blockquote><p><em><strong>Note: Deprecated</strong></em>!</p></blockquote>
<p>The new code editor is beginning to work:</p>
<p><a href="http://janbogaerts.name/wp-content/uploads/2010/05/image2.png"><img style="border-right-width: 0px; margin: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://janbogaerts.name/wp-content/uploads/2010/05/image_thumb2.png" width="870" height="258" /></a></p>
<p><a href="http://janbogaerts.name/wp-content/uploads/2010/05/image3.png"><img style="border-bottom: 0px; border-left: 0px; margin: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://janbogaerts.name/wp-content/uploads/2010/05/image_thumb3.png" width="688" height="519" /></a></p>
 <img src="http://janbogaerts.name/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=232" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://janbogaerts.name/index.php/2010/05/08/the-new-code-editor/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

