<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-4530032316029937887</id><updated>2011-12-05T11:54:08.118-08:00</updated><category term='linux'/><category term='flash'/><category term='cloud-backup'/><category term='data visualization'/><category term='desktop'/><category term='gentoo'/><category term='neko'/><category term='kde'/><category term='gentoo linux &apos;data visualization&apos;'/><category term='delicious'/><category term='haxe'/><title type='text'>disfunksioneel</title><subtitle type='html'>Random scribbling about programming, linux, haxe, flash, etc.</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://disfunksioneel.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4530032316029937887/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://disfunksioneel.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>dirk</name><uri>http://www.blogger.com/profile/13454659715452137722</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>13</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-4530032316029937887.post-5663134669129279530</id><published>2011-04-28T00:49:00.000-07:00</published><updated>2011-04-28T02:40:41.940-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='delicious'/><category scheme='http://www.blogger.com/atom/ns#' term='cloud-backup'/><title type='text'>backing up your delicious bookmarks</title><content type='html'>As some may have heard, &lt;a href="http://www.delicious.com/"&gt;delicious&lt;/a&gt; is being acquired by &lt;a href="http://www.avos.com/"&gt;AVOS&lt;/a&gt;. You can transfer your bookmarks, but I decided to make a backup of my bookmarks, just in case.&lt;br /&gt;&lt;br /&gt;The quickest way I could think of, was using the RSS feed.&lt;br /&gt;&lt;br /&gt;Log into your account on the web and get the URL for the "Private RSS Feed" at the bottom of the page. Change the last part of the URL to be larger than the number of bookmarks you have saved on delicious.&lt;br /&gt;&lt;br /&gt;Ex. change &lt;pre&gt;"http://feeds.delicious.com/v2/rss/user_bob?count=&lt;span style="color: #990000;"&gt;15&lt;/span&gt;"&lt;/pre&gt;to &lt;pre&gt;"http://feeds.delicious.com/v2/rss/user_bob?count=&lt;span style="color: #990000;"&gt;1000&lt;/span&gt;"&lt;/pre&gt;in the URL.&lt;br /&gt;&lt;br /&gt;You can safe the page your browser displays when you enter the URL, or you can use wget or another utility to download the feed. &lt;br /&gt;&lt;br /&gt;The data is now in your hands and it's up to you to keep it safe.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4530032316029937887-5663134669129279530?l=disfunksioneel.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://disfunksioneel.blogspot.com/feeds/5663134669129279530/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4530032316029937887&amp;postID=5663134669129279530' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4530032316029937887/posts/default/5663134669129279530'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4530032316029937887/posts/default/5663134669129279530'/><link rel='alternate' type='text/html' href='http://disfunksioneel.blogspot.com/2011/04/backing-up-you-delicious-bookmarks.html' title='backing up your delicious bookmarks'/><author><name>dirk</name><uri>http://www.blogger.com/profile/13454659715452137722</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4530032316029937887.post-4426346687156766241</id><published>2011-04-06T14:13:00.000-07:00</published><updated>2011-04-07T04:43:40.575-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='gentoo linux &apos;data visualization&apos;'/><title type='text'>High resolution dependency graph</title><content type='html'>I generated a high resolution Gentoo Linux package dependency graph.&lt;br /&gt;&lt;br /&gt;Packages are ordered according to their complete Gentoo package name. The result is that the graph shows groupings of packages with lots of dependencies or reverse dependencies. These groupings typically fall under dev-*, kde-*, gnome-*, x11-libs or media-*.&lt;br /&gt;&lt;br /&gt;Text labels are only generated for packages with more that 10 dependencies or reverse dependencies. The numbers in brackets after the package name, is the number of dependencies followed by the number of reverse dependencies.&lt;br /&gt;&lt;br /&gt;&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-lh_QaxVc3Ww/TZzPNGGoGMI/AAAAAAAAAE4/m5jySScncdA/s1600/graph.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" height="320" src="http://2.bp.blogspot.com/-lh_QaxVc3Ww/TZzPNGGoGMI/AAAAAAAAAE4/m5jySScncdA/s320/graph.jpg" width="320" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;Packages grouped by categories (1600x1600)&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;A package of particular interest is app-text/sword. It has a total of 165 reverse dependencies!! This is very large number of packages that depends on app-text/sword! All of the packages that depends on app-text/sword seems to be different modules specifically for sword.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4530032316029937887-4426346687156766241?l=disfunksioneel.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://disfunksioneel.blogspot.com/feeds/4426346687156766241/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4530032316029937887&amp;postID=4426346687156766241' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4530032316029937887/posts/default/4426346687156766241'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4530032316029937887/posts/default/4426346687156766241'/><link rel='alternate' type='text/html' href='http://disfunksioneel.blogspot.com/2011/04/high-resolution-dependency-graph.html' title='High resolution dependency graph'/><author><name>dirk</name><uri>http://www.blogger.com/profile/13454659715452137722</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/-lh_QaxVc3Ww/TZzPNGGoGMI/AAAAAAAAAE4/m5jySScncdA/s72-c/graph.jpg' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4530032316029937887.post-6986676906695700094</id><published>2011-04-04T13:53:00.000-07:00</published><updated>2011-04-05T11:25:15.348-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='gentoo'/><category scheme='http://www.blogger.com/atom/ns#' term='linux'/><category scheme='http://www.blogger.com/atom/ns#' term='data visualization'/><title type='text'>A nice picture of (dependency) hell</title><content type='html'>&lt;a href="http://en.wikipedia.org/wiki/Dependency_hell"&gt;"Dependency hell"&lt;/a&gt; refers the difficulty that arise when installing a software package that requires a lot of other software packages to be installed. The required software packages (or dependencies) may themselves require other software packages to be installed.&lt;br /&gt;&lt;br /&gt;To give a better idea of why this can be difficult, I created the following graph.&lt;br /&gt;&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-3JwaJkoNl5s/TZowcxUz8GI/AAAAAAAAAEo/wOeUwX23b08/s1600/graph_small.jpg" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" style="margin-left: auto; margin-right: auto;"&gt;&lt;img alt="circle graph of software dependencies" border="0" id="BLOGGER_PHOTO_ID_5591835158168989794" src="http://3.bp.blogspot.com/-3JwaJkoNl5s/TZowcxUz8GI/AAAAAAAAAEo/wOeUwX23b08/s400/graph_small.jpg" style="display: block; height: 400px; margin: 0px auto 10px; text-align: center; width: 400px;" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;63988 Dependencies between 14319 software packages&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;This graph shows the dependencies between software packages in the &lt;a href="http://www.gentoo.org/"&gt;Gentoo Linux&lt;/a&gt; operating system. In total there are 14319 packages with 63988 dependencies between them! &lt;br /&gt;&lt;br /&gt;Packages are drawn on the circumference of the circle and a dependency is indicated by a line draw from one package to another. The color of a package is randomly generated, while the color of a line is determined by the package that is required by the other packages. &lt;br /&gt;&lt;br /&gt;Every package has a line starting on the rim of the circle drawn radially outwards. The length of the line is determined by the amount of other packages that depend on the package.&lt;br /&gt;&lt;br /&gt;Here is a closeup of a small part of the graph:&lt;br /&gt;&lt;a href="http://4.bp.blogspot.com/-5jpm5W7vNFg/TZozShBhmFI/AAAAAAAAAEw/mhzcpLKlOgU/s1600/graph_snip.jpg"&gt;&lt;img alt="circle graph of software dependencies" border="0" id="BLOGGER_PHOTO_ID_5591838280529320018" src="http://4.bp.blogspot.com/-5jpm5W7vNFg/TZozShBhmFI/AAAAAAAAAEw/mhzcpLKlOgU/s400/graph_snip.jpg" style="cursor: pointer; display: block; height: 334px; margin: 0px auto 10px; text-align: center; width: 400px;" /&gt;&lt;/a&gt;The most common dependencies are development tools. This is a list of the 15 packages with the most reverse dependencies:&lt;br /&gt;&lt;br /&gt;&lt;table&gt;&lt;tbody&gt;&lt;tr&gt;&lt;th style="text-align: left;"&gt;Package&lt;/th&gt;&lt;th style="text-align: left;"&gt;# of reverse dependencies&lt;/th&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;dev-lang/perl&lt;/td&gt;&lt;td style="text-align: left;"&gt;1559&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;dev-util/pkgconfig&lt;/td&gt;&lt;td style="text-align: left;"&gt;1195&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;dev-lang/python&lt;/td&gt;&lt;td style="text-align: left;"&gt;1047&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;x11-libs/gtk+&lt;/td&gt;&lt;td style="text-align: left;"&gt;1042&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;sys-devel/libtool&lt;/td&gt;&lt;td style="text-align: left;"&gt;950&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;app-arch/unzip&lt;/td&gt;&lt;td style="text-align: left;"&gt;878&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;sys-devel/automake&lt;/td&gt;&lt;td style="text-align: left;"&gt;818&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;sys-devel/autoconf&lt;/td&gt;&lt;td style="text-align: left;"&gt;766&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;dev-libs/glib&lt;/td&gt;&lt;td style="text-align: left;"&gt;652&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;x11-libs/qt-gui&lt;/td&gt;&lt;td style="text-align: left;"&gt;612&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;virtual/jdk&lt;/td&gt;&lt;td style="text-align: left;"&gt;588&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;sys-apps/sed&lt;/td&gt;&lt;td style="text-align: left;"&gt;575&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;x11-libs/libX11&lt;/td&gt;&lt;td style="text-align: left;"&gt;545&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;app-admin/eselect-python&lt;/td&gt;&lt;td style="text-align: left;"&gt;496&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;dev-util/cmake&lt;/td&gt;&lt;td style="text-align: left;"&gt;455&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;The graph was created with data obtained from the Gentoo Portage tree and drawn using the Python Image Libray (PIL).&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4530032316029937887-6986676906695700094?l=disfunksioneel.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://disfunksioneel.blogspot.com/feeds/6986676906695700094/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4530032316029937887&amp;postID=6986676906695700094' title='9 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4530032316029937887/posts/default/6986676906695700094'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4530032316029937887/posts/default/6986676906695700094'/><link rel='alternate' type='text/html' href='http://disfunksioneel.blogspot.com/2011/04/linux-software-dependencies.html' title='A nice picture of (dependency) hell'/><author><name>dirk</name><uri>http://www.blogger.com/profile/13454659715452137722</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/-3JwaJkoNl5s/TZowcxUz8GI/AAAAAAAAAEo/wOeUwX23b08/s72-c/graph_small.jpg' height='72' width='72'/><thr:total>9</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4530032316029937887.post-4673038553590629887</id><published>2010-12-09T08:06:00.000-08:00</published><updated>2010-12-09T08:12:56.519-08:00</updated><title type='text'>Working towards software quality</title><content type='html'>Software quality remains to be an illusive topic. It's hard to define, measure or enforce.&lt;br /&gt;&lt;br /&gt;One way to to define software quality is how well functional and non functional requirements are met. This implies that requirements exists and are accurate. It also implies that the quality of the software changes whenever the requirements change! This is typically the type of software quality that will keep your manager and your client happy, for the time being...&lt;br /&gt;&lt;br /&gt;For software that will be used and modified after the initial requirements have been satisfied (most software fall into this category), quality needs to be measured on a deeper level. Aspects like maintainability, changeability, testing, etc comes into play. This however remains hard to measure and enforce.&lt;br /&gt;&lt;br /&gt;There are however certain things that contributes to software quality that aren't that hard to measure or implement. Here is a list with some of those things:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Requirements&lt;/li&gt;&lt;li&gt;Software design&lt;/li&gt;&lt;li&gt;Coding standards&lt;/li&gt;&lt;li&gt;Version control&lt;/li&gt;&lt;li&gt;Bug tracking&lt;/li&gt;&lt;li&gt;Source code documentation&lt;/li&gt;&lt;li&gt;Code reviews&lt;/li&gt;&lt;li&gt;Automated clean builds&lt;/li&gt;&lt;li&gt;Automated testing&lt;/li&gt;&lt;li&gt;Code analysis tools&lt;/li&gt;&lt;li&gt;Config management&lt;/li&gt;&lt;li&gt;User interaction&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;It may be worthwhile to elaborate on topics such as requirements, design and documentation. These are things that can cause considerable overhead when done incorrectly. It a good idea to approach requirements, designs and documentation as tools that are used to arrive at a certain point. As such they contribute to the quality of the software, but does not necessarily represents the system in its current state.&lt;br /&gt;&lt;br /&gt;Having all of the above mentioned things in place will not equate to high quality software. It still remains something that needs to be propagated and pursued by all involved parties.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4530032316029937887-4673038553590629887?l=disfunksioneel.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://disfunksioneel.blogspot.com/feeds/4673038553590629887/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4530032316029937887&amp;postID=4673038553590629887' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4530032316029937887/posts/default/4673038553590629887'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4530032316029937887/posts/default/4673038553590629887'/><link rel='alternate' type='text/html' href='http://disfunksioneel.blogspot.com/2010/12/working-towards-software-quality.html' title='Working towards software quality'/><author><name>dirk</name><uri>http://www.blogger.com/profile/13454659715452137722</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4530032316029937887.post-6831576368349900839</id><published>2010-03-15T06:02:00.000-07:00</published><updated>2010-03-15T06:13:37.758-07:00</updated><title type='text'>Deep indentation</title><content type='html'>Having many levels of indentation can seriously hamper readability (and thus the understandability) of code. These indentation levels are normally a result of nested conditional statements and try-catch blocks.&lt;br /&gt;&lt;br /&gt;&lt;h2&gt;How many levels are too many?&lt;/h2&gt; Many people feel that &lt;span style="font-weight: bold;"&gt;4 levels&lt;/span&gt; of indentation is the limit. This is not a hard rule, but serves as a good guideline.&lt;br /&gt;&lt;br /&gt;Another guideline is that your source file should never contain a line of code that gets &lt;span style="font-weight: bold;"&gt;wrapped around&lt;/span&gt; or needs &lt;span style="font-weight: bold;"&gt;side scrolling&lt;/span&gt;. Unfortunately this is dependant on your screen resolution and font size. For some people the limit is at 80 characters (the Linux kernel uses this measure) other people feel that this measure is outdated and wastes screen real estate.&lt;br /&gt;&lt;br /&gt;The basic idea is that whenever the amount of indentation levels make it &lt;span style="font-weight: bold;"&gt;difficult to understand&lt;/span&gt; the code, it's too many.&lt;br /&gt;&lt;br /&gt;&lt;h2&gt;How do I fix it?&lt;/h2&gt;One way suggested in &lt;span style="font-style: italic;"&gt;“Refactoring: Improving the Design of Existing Code”&lt;/span&gt; by Martin Fowler is replacing the conditional with Guard Clauses. Ex.&lt;br /&gt;&lt;div class="code"&gt;&lt;pre&gt;method body&lt;br /&gt;if condition1 is true&lt;br /&gt;  if condition2 is true&lt;br /&gt;     …&lt;br /&gt;  else&lt;br /&gt;     …&lt;/pre&gt;&lt;/div&gt;can be replaced with&lt;br /&gt;&lt;div class="code"&gt;&lt;pre&gt;method body&lt;br /&gt;if condition1 is false&lt;br /&gt;  return&lt;br /&gt;if condition2 is true&lt;br /&gt;  …&lt;br /&gt;else&lt;br /&gt;  …&lt;/pre&gt;&lt;/div&gt;Sometimes it is possible to rework the logic of the method. You may find that some conditionals are excessive or that it can be simplified further.&lt;br /&gt;&lt;br /&gt;Many times though, this is an indication that other problems exist in your code. Things like methods that are too big, constant testing for null, using lots of “Type Codes”, implementing different states in one object, etc. In a lot of these cases, addressing the other problems will also fix the problem of multiple indentation levels.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4530032316029937887-6831576368349900839?l=disfunksioneel.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://disfunksioneel.blogspot.com/feeds/6831576368349900839/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4530032316029937887&amp;postID=6831576368349900839' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4530032316029937887/posts/default/6831576368349900839'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4530032316029937887/posts/default/6831576368349900839'/><link rel='alternate' type='text/html' href='http://disfunksioneel.blogspot.com/2010/03/code-smell-for-week-deep-indentation.html' title='Deep indentation'/><author><name>dirk</name><uri>http://www.blogger.com/profile/13454659715452137722</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4530032316029937887.post-7870127963775904802</id><published>2010-03-08T00:29:00.000-08:00</published><updated>2010-03-08T00:36:54.190-08:00</updated><title type='text'>Method stubs and Unused Code</title><content type='html'>&lt;p"&gt;A common thing we all do is creating stub methods on a class and implementing methods we do not immediately use. Both can lead to errors and incorrect results in parts of the code that use method stubs or (previously) unused code. &lt;h2&gt;Method Stubs&lt;/h2&gt;  &lt;p&gt;&lt;b&gt;Method stubs&lt;/b&gt; are functions that aren't implemented. The method body is normally empty, or returns a hard coded value in order to compile. Luckily they are easy to spot. There's nothing wrong in using method stubs when writing and testing the initial interface of a class, but no method stubs should be left hanging around in your code! If you do have method stubs, this can be corrected in one of two ways:&lt;/p&gt;  &lt;ol&gt;&lt;li&gt;&lt;p&gt;Remove the method stub&lt;/p&gt; &lt;/li&gt;&lt;li&gt;&lt;p&gt;Implement the method stub&lt;/p&gt; &lt;/li&gt;&lt;/ol&gt;  &lt;p&gt;Most of the time you should remove it. You should only implement a method stub if it is actually used!&lt;/p&gt;&lt;h2&gt;Unused Code&lt;/h2&gt;&lt;p&gt;Another problem that is more difficult to spot is &lt;b&gt;unused (and untested) code&lt;/b&gt;. If you are writing a library that are used by other people you cannot easily determine what methods are used and which ones are not. In this case your test cases should test all methods (actually all code paths).&lt;/p&gt;  &lt;p&gt;The best way of avoiding unused methods, is to only create a method when you need it. This is stating the obvious, but we all tend to implement methods we don't use immediately (or ever). Lets look at an example:&lt;/p&gt;  &lt;p&gt;A common class we all need and code at some stage is a Vector class. There are many well defined operations that can be performed on a vector, like calculating the length, converting it to a unit vector, addition, subtraction, dot product, cross product, etc. It is very easy to quickly go and define a vector and all the methods for working with it.&lt;/p&gt;  &lt;p&gt;Chances are good that you do not immediately need all the methods that you thought up for you class and that that they will contain bugs. Once again, there are two ways of solving this:&lt;/p&gt;  &lt;ol&gt;&lt;li&gt;&lt;p&gt;Use the method (in a test case)&lt;/p&gt;  &lt;/li&gt;&lt;li&gt;&lt;p&gt;Remove the method&lt;/p&gt; &lt;/li&gt;&lt;/ol&gt;&lt;p&gt;Option 1 should be executed if you still foresee that it is very likely that the method will be used in the near future or if the implementation entailed a large investment of effort. Most of the time you should strongly consider removing the method.&lt;/p&gt;&lt;p&gt;To sum it up: When writing code, be minimalistic, when using existing code, remove clutter.&lt;/p&gt;  &lt;p style="margin-bottom: 0cm;"&gt;Regards&lt;/p&gt; &lt;p style="margin-bottom: 0cm;"&gt;Dirk&lt;/p&gt; &lt;/p"&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4530032316029937887-7870127963775904802?l=disfunksioneel.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://disfunksioneel.blogspot.com/feeds/7870127963775904802/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4530032316029937887&amp;postID=7870127963775904802' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4530032316029937887/posts/default/7870127963775904802'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4530032316029937887/posts/default/7870127963775904802'/><link rel='alternate' type='text/html' href='http://disfunksioneel.blogspot.com/2010/03/method-stubs-and-unused-code.html' title='Method stubs and Unused Code'/><author><name>dirk</name><uri>http://www.blogger.com/profile/13454659715452137722</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4530032316029937887.post-1162130479313964786</id><published>2010-02-22T02:09:00.001-08:00</published><updated>2010-02-22T02:17:05.885-08:00</updated><title type='text'>Code Smells</title><content type='html'>&lt;div  style="font-family:Times New Roman;"&gt;&lt;p style="margin: 0pt;"&gt;&lt;span style="font-size:100%;"&gt;From &lt;a href="http://en.wikipedia.org/wiki/Code_smell" id="dcu4" title="Wikipedia"&gt;Wikipedia&lt;/a&gt;:  &lt;/span&gt;&lt;i&gt;&lt;span style="font-size:100%;"&gt;“In computer programming, code smell is any symptom in the source code of a program that possibly indicates a deeper problem.”&lt;/span&gt;&lt;/i&gt;&lt;/p&gt;&lt;p style="margin: 0pt;"&gt; &lt;/p&gt;&lt;p style="margin: 0pt;"&gt;&lt;span style="font-size:100%;"&gt;We all need to get things done and most of the time we need to do them in a hurry. Unfortunately the result is that our code are not always a clean as it should be. Fortunately we are not alone in this world and other people experience the same problems that we do.&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0pt;"&gt;&lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0pt;"&gt;&lt;b&gt;&lt;span style="font-size:100%;"&gt;Code Smells&lt;/span&gt;&lt;/b&gt;&lt;span style="font-size:100%;"&gt; are one of those things that can help us to identify when we are doing things that may hurt ourselves in the future. We may not always be able to fix them, but whenever you encounter a &lt;/span&gt;&lt;span style="font-size:100%;"&gt;Code Smell&lt;/span&gt;&lt;span style="font-size:100%;"&gt;, see if you can either justify it or fix it.&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0pt;"&gt;&lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0pt;"&gt;&lt;span style="font-size:100%;"&gt;Code Smells are not the problem themselves, but they indicate that other problems exist in the code. Solving them is important, but it is even more important to understand why they are bad.&lt;/span&gt;&lt;/p&gt;&lt;h2&gt;&lt;span style="font-size:130%;"&gt;Code Smell for the week: Huge methods/functions&lt;/span&gt;&lt;/h2&gt;&lt;p style="margin: 0pt;"&gt;&lt;span style="font-size:100%;"&gt;Whenever a method becomes too big it gets &lt;/span&gt;&lt;b&gt;&lt;span style="font-size:100%;"&gt;hard to follow the logic&lt;/span&gt;&lt;/b&gt;&lt;span style="font-size:100%;"&gt; of the method. Such a method should be broken down into smaller methods that groups together related functionality. If the refactored methods then contains unrelated functionality, consider moving them to separate classes.&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0pt;"&gt;&lt;span style="font-size:100%;"&gt;When doing the refactoring of big methods, it is common to encounter problems like the constant use of a shared variable throughout the method. This is in its own a Code Smell and may be mentioned at a later stage.&lt;/span&gt;&lt;/p&gt;&lt;h3&gt;&lt;span style="font-size:100%;"&gt;When is a method TOO big? &lt;/span&gt;&lt;/h3&gt;&lt;p style="margin: 0pt;"&gt;&lt;span style="font-size:100%;"&gt;The size of a method is not the only determining factor. Whenever your method performs &lt;/span&gt;&lt;b&gt;&lt;span style="font-size:100%;"&gt;more than one definable thing&lt;/span&gt;&lt;/b&gt;&lt;span style="font-size:100%;"&gt;, it's probably too big.&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0pt;"&gt;&lt;span style="font-size:100%;"&gt;Another telling factor is the levels of &lt;/span&gt;&lt;b&gt;&lt;span style="font-size:100%;"&gt;indentation&lt;/span&gt;&lt;/b&gt;&lt;span style="font-size:100%;"&gt; within the method. If you start having more than 4 levels of indentation in one method, you have good reason to believe that the method is too big. In methods that are too big, it can become very hard to follow the indentation levels.&lt;/span&gt;&lt;/p&gt;&lt;h3&gt;&lt;span style="font-size:100%;"&gt;Some things to consider:&lt;/span&gt;&lt;/h3&gt;&lt;ol type="1"&gt;&lt;li&gt;&lt;span style="font-size:100%;"&gt;Don't overdo it. Functions that are too small can hamper the readability of the code.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:100%;"&gt;Don't expose functions to the global name space unless needed.&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;&lt;p style="margin: 0pt;"&gt; &lt;/p&gt;&lt;p style="margin: 0pt;"&gt;&lt;span style="font-size:100%;"&gt;Please discuss Code Smells amongst each other. It is often more important to know why code smells are bad rather than knowing how to fix them. Knowing why they are bad will most likely result in us producing less Code Smells.&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4530032316029937887-1162130479313964786?l=disfunksioneel.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://disfunksioneel.blogspot.com/feeds/1162130479313964786/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4530032316029937887&amp;postID=1162130479313964786' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4530032316029937887/posts/default/1162130479313964786'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4530032316029937887/posts/default/1162130479313964786'/><link rel='alternate' type='text/html' href='http://disfunksioneel.blogspot.com/2010/02/codesmells.html' title='Code Smells'/><author><name>dirk</name><uri>http://www.blogger.com/profile/13454659715452137722</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4530032316029937887.post-2153259392261950384</id><published>2009-09-03T14:46:00.000-07:00</published><updated>2009-09-07T12:43:44.063-07:00</updated><title type='text'>From the attic</title><content type='html'>Most programmers have a stash of old software projects somewhere. I decided to go and dig up those projects I have and commit them on github. They can all be found &lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Minesweeper (c++)&lt;/span&gt;&lt;br /&gt;I wrote Minesweeper because of my ego back in 2002. A friend of mine was going on about how difficult it is to implement minesweeper, so I decided to see how difficult it could really be. It can now be found &lt;a href="http://github.com/dirkcuys/attic/tree/master/mines"&gt;here&lt;/a&gt;. Here is a screenshot of what it looks like:&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_HGpDbFeo-MU/SqA7zXbAj-I/AAAAAAAAAC4/wCMfP3iczn8/s1600-h/minesweeper.png"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; cursor: pointer; width: 400px; height: 316px;" src="http://4.bp.blogspot.com/_HGpDbFeo-MU/SqA7zXbAj-I/AAAAAAAAAC4/wCMfP3iczn8/s400/minesweeper.png" alt="" id="BLOGGER_PHOTO_ID_5377363708727037922" border="0" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Tetris (c++)&lt;/span&gt;&lt;br /&gt;This is another classic. Every aspiring game programmer (overeager teenager) have probably written a clone of Tetris. This was my attempt, it's called Blockys Bow, can't remember why I called it that? You can find the source &lt;a href="http://github.com/dirkcuys/attic/tree/master/tetris"&gt;here&lt;/a&gt; &lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_HGpDbFeo-MU/SqA-GDgsDGI/AAAAAAAAADA/N0TzBff0zCw/s1600-h/blockysbow.png"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; cursor: pointer; width: 400px; height: 313px;" src="http://3.bp.blogspot.com/_HGpDbFeo-MU/SqA-GDgsDGI/AAAAAAAAADA/N0TzBff0zCw/s400/blockysbow.png" alt="" id="BLOGGER_PHOTO_ID_5377366228822920290" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Connect More than Three (java)&lt;/span&gt;&lt;br /&gt;I enjoyed playing the plastic version of this game, so I decided that that's enough reason to create an intangible one. This was done in Java, some of my first &lt;a href="http://github.com/dirkcuys/attic/tree/master/connect4"&gt;code&lt;/a&gt; therein.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_HGpDbFeo-MU/SqVfmWzGUgI/AAAAAAAAADI/vZfM19RcBh4/s1600-h/connectmorethan3.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 320px; height: 400px;" src="http://3.bp.blogspot.com/_HGpDbFeo-MU/SqVfmWzGUgI/AAAAAAAAADI/vZfM19RcBh4/s400/connectmorethan3.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5378810442523496962" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Snake (java)&lt;/span&gt;&lt;br /&gt;Last and probably least as well. At some time in my life I was clearly bored, didn't have many friends or more disturbingly found it interesting enough, who knows? Point being, I implemented a snake like game in java. As you can see from the screen shot below, everything didn't work like is should. Enjoy the &lt;a href="http://github.com/dirkcuys/attic/tree/master/snake-java"&gt;source&lt;/a&gt; if you want.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_HGpDbFeo-MU/SqVhHwh3kqI/AAAAAAAAADQ/iGxGXMdI-i0/s1600-h/snake.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 326px; height: 373px;" src="http://2.bp.blogspot.com/_HGpDbFeo-MU/SqVhHwh3kqI/AAAAAAAAADQ/iGxGXMdI-i0/s400/snake.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5378812115877860002" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Well, that's all for today. If I receive any motivation (in the form of comments or your projects on github) I'll dig up that stash of pascal code thats lying around somewhere.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4530032316029937887-2153259392261950384?l=disfunksioneel.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://disfunksioneel.blogspot.com/feeds/2153259392261950384/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4530032316029937887&amp;postID=2153259392261950384' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4530032316029937887/posts/default/2153259392261950384'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4530032316029937887/posts/default/2153259392261950384'/><link rel='alternate' type='text/html' href='http://disfunksioneel.blogspot.com/2009/09/from-attic.html' title='From the attic'/><author><name>dirk</name><uri>http://www.blogger.com/profile/13454659715452137722</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_HGpDbFeo-MU/SqA7zXbAj-I/AAAAAAAAAC4/wCMfP3iczn8/s72-c/minesweeper.png' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4530032316029937887.post-6899353174261095057</id><published>2009-05-03T15:16:00.000-07:00</published><updated>2009-05-03T14:42:06.408-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='haxe'/><title type='text'>A visual haXe example</title><content type='html'>This example will show you how to create a simple maize-style background in haXe like the picture below:&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_HGpDbFeo-MU/Sez2syKk_EI/AAAAAAAAACI/5ZZ8Lq8VXoY/s1600-h/maize.png"&gt;&lt;img style="margin:0 10px 10px 0;cursor:pointer; cursor:hand;width: 400px; height: 300px;" src="http://2.bp.blogspot.com/_HGpDbFeo-MU/Sez2syKk_EI/AAAAAAAAACI/5ZZ8Lq8VXoY/s400/maize.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5326903708513270850" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;First we need to create the maize graphic. We do this by extending the flash.display.Sprite class. Lets call the derived class MaizeBackground. &lt;br /&gt;&lt;br /&gt;&lt;div class="code"&gt;&lt;pre&gt;class MaizeBackground extends flash.display.Sprite&lt;br /&gt;{&lt;br /&gt;    public function new()&lt;br /&gt;    {&lt;br /&gt;        super();&lt;br /&gt;    }&lt;br /&gt;}&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;This will create an empty sprite that does not show anything. In order to add some graphics we must either add another flash.display.DisplayObject containing some graphics to the sprite (like a Bitmap, MovieClip or another Sprite) or we must draw something on this sprite using the graphics property of the sprite. &lt;br /&gt;&lt;br /&gt;We are going to use the graphics property of the Sprite. So lets add a method called redraw to our class and use this to draw the maize. We should call to this method in the constructor:&lt;br /&gt;&lt;br /&gt;&lt;div class="code"&gt;&lt;pre&gt;class MaizeBackground extends flash.display.Sprite&lt;br /&gt;{&lt;br /&gt;    public function new()&lt;br /&gt;    {&lt;br /&gt;        super();&lt;br /&gt;        redraw();&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    public function redraw()&lt;br /&gt;    {&lt;br /&gt;        graphics.beginFill(0xFFFFFF, 1.0);&lt;br /&gt;        graphics.drawRect(0, 0, 800, 600);&lt;br /&gt;&lt;br /&gt;        var color : Int = 0x000000;&lt;br /&gt;        for (y in 0...60)&lt;br /&gt;        {&lt;br /&gt;            color = color ^ 0xFFFFFF;&lt;br /&gt;            for (x in 0...80)&lt;br /&gt;            {&lt;br /&gt;                var prev = false;&lt;br /&gt;                if ( Math.random() &lt; 0.10 &amp;&amp; !prev )&lt;br /&gt;                {&lt;br /&gt;                    graphics.beginFill(color, 1.0);&lt;br /&gt;                    prev = true;&lt;br /&gt;                }&lt;br /&gt;                else&lt;br /&gt;                {&lt;br /&gt;                    graphics.beginFill(color ^ 0xFFFFFF, 1.0);&lt;br /&gt;                    prev = false;&lt;br /&gt;                }&lt;br /&gt;                graphics.drawRect(x*10, y*10, 10, 10);&lt;br /&gt;            }&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        var filterArray = new Array();&lt;br /&gt;        filterArray.push(new flash.filters.BlurFilter(5, 5, 9));&lt;br /&gt;        filters = filterArray;&lt;br /&gt;    }&lt;br /&gt;}&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;The logic for the redraw method is reasonably straight forward. We look at the maize as being divided into rows and columns.&lt;br /&gt;&lt;ol&gt;&lt;br /&gt;&lt;li&gt;Step through the image row by row.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Alternate between black and white rows&lt;/li&gt;&lt;br /&gt;&lt;li&gt;For every column in the row there is a small possibility of drawing the inverted color.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Finally we apply a blur filter to make the crude maize look a little better.&lt;/li&gt;&lt;br /&gt;&lt;/ol&gt;&lt;br /&gt;&lt;br /&gt;An important thing to note is that the filters only get applied when we assign something to the filters property of a flash.display.DisplayObject. If we simply pushed the new BlurFilter to the filters property, the filter would not have been applied.&lt;br /&gt;&lt;br /&gt;Save this class in a text file called MaizeBackground.hx&lt;br /&gt;&lt;br /&gt;Now we need to create a main class and add the sprite to the stage. Create a class called MaizeExample:&lt;br /&gt;&lt;br /&gt;&lt;div class="code"&gt;&lt;pre&gt;class MaizeExample&lt;br /&gt;{&lt;br /&gt;    static function main()&lt;br /&gt;    {&lt;br /&gt;        flash.Lib.current.addChild(new MaizeBackground());&lt;br /&gt;    }&lt;br /&gt;}&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;Save this class in a text file called MaizeExample.hx&lt;br /&gt;&lt;br /&gt;Finally we need to create a compile file for the haXe compiler and compile the swf. Create a file called compile.hxml with the following contents:&lt;br /&gt;&lt;br /&gt;&lt;div class="code"&gt;&lt;br /&gt;-swf maize.swf&lt;br /&gt;-swf-version 9&lt;br /&gt;-main MaizeExample&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;Save the file in the same directory as MaizeBackground.hx and MaizeExample.hx and run haxe in that directory.&lt;br /&gt;&lt;br /&gt;This should produce a swf file that can be opened using Adobe's flash player or browser plugin.&lt;br /&gt;&lt;br /&gt;The MaizeBackground example could benefit from many improvements:&lt;br /&gt;&lt;ul&gt;&lt;br /&gt;&lt;li&gt;Add size properties to determine the size of the maize.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Play around with the different filters available in the flash.filters package&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Change the size of the cells to be determined by a property&lt;/li&gt;&lt;br /&gt;&lt;li&gt;etc&lt;/li&gt;&lt;br /&gt;&lt;/ul&gt;&lt;br /&gt;&lt;br /&gt;Any comments or suggestions are more than welcome!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4530032316029937887-6899353174261095057?l=disfunksioneel.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://disfunksioneel.blogspot.com/feeds/6899353174261095057/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4530032316029937887&amp;postID=6899353174261095057' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4530032316029937887/posts/default/6899353174261095057'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4530032316029937887/posts/default/6899353174261095057'/><link rel='alternate' type='text/html' href='http://disfunksioneel.blogspot.com/2009/04/visual-haxe-example.html' title='A visual haXe example'/><author><name>dirk</name><uri>http://www.blogger.com/profile/13454659715452137722</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_HGpDbFeo-MU/Sez2syKk_EI/AAAAAAAAACI/5ZZ8Lq8VXoY/s72-c/maize.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4530032316029937887.post-535637195258905889</id><published>2009-03-19T10:52:00.000-07:00</published><updated>2010-10-19T13:15:41.219-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='gentoo'/><category scheme='http://www.blogger.com/atom/ns#' term='haxe'/><category scheme='http://www.blogger.com/atom/ns#' term='neko'/><title type='text'>Installing NekoVM and haXe on Gentoo</title><content type='html'>Installing NekoVM and haXe on gentoo is done best by using the ebuilds provided by Daniel Turing.&lt;br /&gt;&lt;br /&gt;To install the overlay, you need Layman and Subversion. Have a look at &lt;a href="http://www.gentoo.org/proj/en/overlays/userguide.xml"&gt;Gentoo Overlays: Users' Guide&lt;/a&gt; to set up layman if you haven't done so already and make sure you have emerged subversion.&lt;br /&gt;&lt;br /&gt;Manually download the text file &lt;a href="http://svn.xinf.org/haxe-gentoo-overlay/layman-haxe.txt"&gt;layman-haxe.txt&lt;/a&gt; using your browser or wget:&lt;br /&gt;&lt;br /&gt;&lt;div class="code"&gt;$ wget http://svn.xinf.org/haxe-gentoo-overlay/layman-haxe.txt&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;Open up the text file with your favourite editor and replace the line&lt;br /&gt;&lt;br /&gt;src="http://xinf.org/haxe-gentoo-overlay"&lt;br /&gt;&lt;br /&gt;with&lt;br /&gt;&lt;br /&gt;src="http://svn.xinf.org/haxe-gentoo-overlay"&lt;br /&gt;&lt;br /&gt;alternativeliy use&lt;br /&gt;&lt;br /&gt;&lt;div class="code"&gt;$ mv layman-haxe.txt layman-haxe.backup&lt;br /&gt;$ sed 's#src="http://#src="http://svn.#g' layman-haxe.backup &gt; layman-haxe.txt&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;now check out the overlay using&lt;br /&gt;&lt;br /&gt;&lt;div class="code"&gt;$ layman -o file:///path/to/file/layman-haxe.txt -f&lt;br /&gt;$ layman -o file:///path/to/file/layman-haxe.txt -a haxe&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;You can now install the neko, haxe and swfmill that's in the overlay using&lt;br /&gt;&lt;br /&gt;&lt;div class="code"&gt;$emerge neko haxe swfmill&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;To install the latest version of NekoVM (1.8.0 at the time of this writing), you first have to create a local overlay. Follow the instructions on &lt;a href="http://en.gentoo-wiki.com/wiki/Overlays"&gt;gentoo-wiki.com&lt;/a&gt; to do this.&lt;br /&gt;&lt;br /&gt;Create the following directories in your local overlay: dev-lang dev-lang/neko dev-lang/neko/files&lt;br /&gt;&lt;br /&gt;Copy 50_mod_neko.conf and 50neko from the layman haxe overlay into the dev-lang/neko/files directory. Copy &lt;a href="http://pastebin.com/f1a3cb6b6"&gt;this text&lt;/a&gt; into dev-lang/neko/files/neko-1.8.0-gentoo.patch. Copy neko-1.7.1-r1.ebuild from the layman haxe overlay to dev-lang/neko/neko-1.8.0-r1.ebuild.&lt;br /&gt;(update: &lt;a href="http://pastebin.com/Gu14t1M0"&gt;here&lt;/a&gt; is a link for the patch for neko 1.8.1)&lt;br /&gt;&lt;br /&gt;Download &lt;a href="http://nekovm.org/download"&gt;neko-1.8.0.tar.gz&lt;/a&gt; into your distfiles directory. All that's left to do is to generate the manifest file. Use&lt;br /&gt;&lt;br /&gt;&lt;div class="code"&gt;$ ebuild neko-1.8.0-r1.ebuild digest&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;to generate the digest file. You will need to execute this command as a user with privileges to write to the dev-lang/neko directory.&lt;br /&gt;&lt;br /&gt;Now you can emerge the latest version of neko!&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Update:&lt;/span&gt; the haxe and neko ebuild together with the patches can now be found at &lt;a href="http://github.com/dirkcuys/gentoo_overlay"&gt;github&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4530032316029937887-535637195258905889?l=disfunksioneel.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://disfunksioneel.blogspot.com/feeds/535637195258905889/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4530032316029937887&amp;postID=535637195258905889' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4530032316029937887/posts/default/535637195258905889'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4530032316029937887/posts/default/535637195258905889'/><link rel='alternate' type='text/html' href='http://disfunksioneel.blogspot.com/2009/03/installing-nekovm-and-haxe-on-gentoo.html' title='Installing NekoVM and haXe on Gentoo'/><author><name>dirk</name><uri>http://www.blogger.com/profile/13454659715452137722</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4530032316029937887.post-898738671891635150</id><published>2009-02-14T01:17:00.000-08:00</published><updated>2009-03-19T10:43:32.763-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='linux'/><category scheme='http://www.blogger.com/atom/ns#' term='desktop'/><category scheme='http://www.blogger.com/atom/ns#' term='kde'/><title type='text'>Over to KDE4.2</title><content type='html'>After some initial &lt;span class="blsp-spelling-corrected" id="SPELLING_ERROR_0"&gt;struggles&lt;/span&gt; (&lt;a href="http://www.gossamer-threads.com/lists/gentoo/user/181090"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_1"&gt;gentoo&lt;/span&gt;-user mailing list&lt;/a&gt;) I have managed to update to &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_2"&gt;KDE&lt;/span&gt;4.2.&lt;br /&gt;&lt;br /&gt;I will not say that this applies to everyone, nor will I make a sweeping statement like "&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_3"&gt;KDE&lt;/span&gt; is back", but, &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_4"&gt;KDE&lt;/span&gt; is back on my desktop and I'm &lt;span class="blsp-spelling-corrected" id="SPELLING_ERROR_5"&gt;reasonably&lt;/span&gt; happy with it!&lt;br /&gt;&lt;br /&gt;I'm using a &lt;span class="blsp-spelling-corrected" id="SPELLING_ERROR_6"&gt;reasonably&lt;/span&gt; dated machine, &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_7"&gt;AMD&lt;/span&gt; &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_8"&gt;Athlon&lt;/span&gt; &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_9"&gt;XP&lt;/span&gt; 2500, &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_10"&gt;NVidia&lt;/span&gt; &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_11"&gt;GeForce&lt;/span&gt; &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_12"&gt;FX&lt;/span&gt; 5200 128MB and 640MB &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_13"&gt;DDR&lt;/span&gt;333. Not the greatest machine, but after disabling all desktop effects, things are running quite smooth.&lt;br /&gt;&lt;br /&gt;I decided to give the new Kickoff menu a go since KDE4.1.3. Although it's not what I am used to, it is still not something that will completely deter me from using &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_14"&gt;KDE&lt;/span&gt;4. After all, if I really can't adapt, I can always go back to the classic style menu.&lt;br /&gt;&lt;br /&gt;There is however a few things that I think could be improved. The first thing is adding shortcuts to the bottom panel. I always keep a few icons in my panel - &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_15"&gt;konsole&lt;/span&gt;, the home folder and &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_16"&gt;firefox&lt;/span&gt; at least. When I wish to add an icon to the panel , the widgets need to be unlocked. I feel that even when the widgets are locked, you should still be able to add icons to the panel. Having different context menus depending on the locked status of the widgets are a big confusing. For me the main advantage of locking the widgets is the absence of that configuration bar next to desktop applets. But, this is also no show stopper, I only need to add &lt;span class="blsp-spelling-corrected" id="SPELLING_ERROR_17"&gt;shortcuts&lt;/span&gt; for my favourite applications once.&lt;br /&gt;&lt;br /&gt;Another thing didn't work that great was &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_18"&gt;Okular&lt;/span&gt;. I opened &lt;a href="http://www.elpauer.org/stuff/learning_cmake.pdf"&gt;"Learning &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_19"&gt;CMake&lt;/span&gt;"&lt;/a&gt;, but it was painfully slow. I haven't had time to test it with another &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_20"&gt;PDF&lt;/span&gt; reader like &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_21"&gt;xpdf&lt;/span&gt; or &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_22"&gt;kpdf&lt;/span&gt;, so maybe it's just the &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_23"&gt;PDF&lt;/span&gt; document?&lt;br /&gt;&lt;br /&gt;But overall I'm impressed with &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_24"&gt;KDE&lt;/span&gt;4.2. From now on this will most &lt;span class="blsp-spelling-corrected" id="SPELLING_ERROR_25"&gt;definitely&lt;/span&gt; be my default desktop!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4530032316029937887-898738671891635150?l=disfunksioneel.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://disfunksioneel.blogspot.com/feeds/898738671891635150/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4530032316029937887&amp;postID=898738671891635150' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4530032316029937887/posts/default/898738671891635150'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4530032316029937887/posts/default/898738671891635150'/><link rel='alternate' type='text/html' href='http://disfunksioneel.blogspot.com/2009/02/kde42.html' title='Over to KDE4.2'/><author><name>dirk</name><uri>http://www.blogger.com/profile/13454659715452137722</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4530032316029937887.post-1145476835460835545</id><published>2008-11-12T12:47:00.000-08:00</published><updated>2009-03-19T10:44:05.525-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='haxe'/><category scheme='http://www.blogger.com/atom/ns#' term='flash'/><title type='text'>Open source flash workflow</title><content type='html'>I needed to do a project in flash and I needed to find a way to do so on my favourite OS - gentoo linux.&lt;br /&gt;&lt;br /&gt;After browsing through a lot of google search results, and links on &lt;a href="http://osflash.org/"&gt;osflash.org&lt;/a&gt; I found what I was looking for. Unfortunately I could not find a single utility to do everything, but true to the linux spirit I found multiple separate utilities that could be used to accomplish what I wanted.&lt;br /&gt;&lt;br /&gt;First and most important is &lt;a href="http://www.haxe.org/"&gt;haXe&lt;/a&gt;. haXe is a open source web programming language. It can compile to javascript, php and swf and the syntax and semantics felt familiar enough for me (I'm used to C++). Using haXe you can produce swf files that can be opened using Adobe's flash player.&lt;br /&gt;&lt;br /&gt;The second important utility that I found was &lt;a href="http://swfmill.org/"&gt;swfmill&lt;/a&gt;. swfmill compiles xml and resources into swf. This is very usefull as it allows you to build resource libraries that you can use from your haXe code.&lt;br /&gt;&lt;br /&gt;I decided to use make as the build system - didn't want to learn too many new things at once.&lt;br /&gt;&lt;br /&gt;I used vim as my code editor since I wanted to test what doing a whole project in vim would be like and syntax highlighting exists for haXe!&lt;br /&gt;&lt;br /&gt;For graphics I used a combination of gimp and inkscape.&lt;br /&gt;&lt;br /&gt;This combination of utilities enabled me to create a flash application without needing to buy the Flash SDK, windows, photoshop or anything for that matter. It could also be possible to target an older version of flash like flash 7, which could then be opened using the open source gnash!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4530032316029937887-1145476835460835545?l=disfunksioneel.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://disfunksioneel.blogspot.com/feeds/1145476835460835545/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4530032316029937887&amp;postID=1145476835460835545' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4530032316029937887/posts/default/1145476835460835545'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4530032316029937887/posts/default/1145476835460835545'/><link rel='alternate' type='text/html' href='http://disfunksioneel.blogspot.com/2008/11/open-source-flash-workflow.html' title='Open source flash workflow'/><author><name>dirk</name><uri>http://www.blogger.com/profile/13454659715452137722</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4530032316029937887.post-4650023472688772426</id><published>2008-10-20T12:20:00.000-07:00</published><updated>2009-03-19T10:44:49.463-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='haxe'/><category scheme='http://www.blogger.com/atom/ns#' term='flash'/><title type='text'>Putting haXe to wood</title><content type='html'>After using &lt;a href="http://www.haxe.org/"&gt;haXe&lt;/a&gt; for a personal project and finding it quite useful I decided to do a little write-up on what I did.&lt;br /&gt;&lt;br /&gt;Being related to a certain individual (my sister) with a dream to establish an "audio visual print and digital" magazine (&lt;a href="http://www.post-box.blogspot.com/"&gt;PostBox&lt;/a&gt;), the duty of creating the digital part was naturally bestowed upon me. I needed to create a cross-platform DVD interface (the kind of interface you view on you pc, not your dvd player).&lt;br /&gt;&lt;br /&gt;The DVD contains photos, music, video and articles from various artists. All of this content needed to be handled in an efficient way that works on any PC regardless of the software installed (read codecs). This led me to flash.&lt;br /&gt;&lt;br /&gt;But this didn't completely satisfy me, I also had another consideration: I am most at home in a linux environment (gentoo specifically) and I wished to do all the work in this environment. (okay, so I like the idea of free software as well)&lt;br /&gt;&lt;br /&gt;This led me to haXe! After taking a look at the community and trying haXe out for a play project (which I may still finish someday), I decided that this was the tool to use.&lt;br /&gt;&lt;br /&gt;I have had to solve many problems (some with plenty of time, other with way too little sleep and a tight deadline) and I wish to discuss some of those.&lt;br /&gt;&lt;br /&gt;In this series of posts I wish to discuss the following topics:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;The flash linux workflow&lt;/li&gt;&lt;li&gt;Getting started with haXe&lt;/li&gt;&lt;li&gt;Creating a generic audio player&lt;/li&gt;&lt;li&gt;Creating a generic gallery&lt;/li&gt;&lt;li&gt;Shared libraries in haXe&lt;/li&gt;&lt;li&gt;Preparing video and audio for use with flash&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;And for those asking the obvious question - I will make the source code that I'm not too embarrassed about available under some open source license, BSD or GPL.&lt;br /&gt;&lt;br /&gt;Please leave all your suggestions and any questions you may have!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4530032316029937887-4650023472688772426?l=disfunksioneel.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://disfunksioneel.blogspot.com/feeds/4650023472688772426/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4530032316029937887&amp;postID=4650023472688772426' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4530032316029937887/posts/default/4650023472688772426'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4530032316029937887/posts/default/4650023472688772426'/><link rel='alternate' type='text/html' href='http://disfunksioneel.blogspot.com/2008/10/putting-haxe-to-wood.html' title='Putting haXe to wood'/><author><name>dirk</name><uri>http://www.blogger.com/profile/13454659715452137722</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry></feed>
