<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom"
	xml:lang="en">
	<title>Idris's e-dribble</title>
	<subtitle>Online journal hosted at SDF</subtitle>
        <link rel="alternate" type="text/html" href="http://id.motd.org/index.php"/>
        <link rel="self" type="application/atom+xml" href="http://id.motd.org/atom.xml"/>
	<updated>2010-08-25T03:34:54-00:00</updated>
	<author>
	<name>D Idris Wilkinson</name>
	<uri>http://id.motd.org/index.php</uri>
	<email>id@we3b2.org</email>
	</author>
	<id>tag:idrisse-dribble,2010:Idrisse-dribble</id>
	<generator uri="http://www.pivotlog.net" version="Pivot - 1.40.6: 'Dreadwind'">Pivot</generator>
	<rights>Copyright (c) 2010, Authors of Idris's e-dribble</rights>
	
	
	
	<entry>
		<title>Embedded Brainfuck Canvas</title>
		<link rel="alternate" type="text/html" href="http://id.motd.org/pivot/entry.php?id=28" />
		<updated>2010-08-25T02:48:00-00:00</updated>
		<published>2010-08-25T02:48:00-00:00</published>
		<id>tag:idrisse-dribble,2010:Idrisse-dribble.28</id>
		<link rel="related" type="text/html" href=""  />
		<summary type="text">Brainfuck is a turing-complete programming language and abstract machine which has only eight operators.

	I’ve written a greasemonkey script which searches webpages for specially formatted brainfuck programs, and turns them into graphics by running a brainfuck interpreter and piping the output of the program to an HTML 5 canvas element.

	Full details of the implementation are available on my website, where the embedded brainfuck canvas greasemonkey script can also be downloaded.

	Here is an example program:

☸⠠⠐++++++++++++++++[}++++++++++++++++{-]}[{.+}-]{[-.]

	And here is what it looks like when it runs:</summary>
        <content type="html" xml:lang="en" xml:base="http://id.motd.org/pivot/entry.php?id=28"><![CDATA[
                <p>Brainfuck is a turing-complete programming language and abstract machine which has only eight operators.</p>

	<p>I&#8217;ve written a greasemonkey script which searches webpages for specially formatted brainfuck programs, and turns them into graphics by running a brainfuck interpreter and piping the output of the program to an <span class="caps">HTML</span> 5 canvas element.</p>

	<p><a href="http://id.8x.cc/shit/bfc/">Full details of the implementation</a> are available on my website, where <a href="http://id.8x.cc/shit/bfc/bfc.user.js">the embedded brainfuck canvas greasemonkey script</a> can also be downloaded.</p>

	<p>Here is an example program:</p>

<pre>☸⠠⠐++++++++++++++++[}++++++++++++++++{-]}[{.+}-]{[-.]</pre>

	<p>And here is what it looks like when it runs: <img src="http://id.motd.org/images/brainfuck-spectrum.png" style="border:0px solid" title="Brainfuck Spectrum program" alt="Brainfuck Spectrum program" class="pivot-image" /></p>	<p>I&#8217;ve also made a couple of modifications to the language, firstly the ability to enter hex numbers 0 to F, as well as using unicode braille symbols to enter numbers 0 to 255. Secondly, the eight operators can be written using unicode trigrams, to make the program look nicer. The following trigram/braille brainfuck program draws a smiley face: <img src="http://id.motd.org/images/brainfuck-smiley.png" style="border:0px solid" title="Brainfuck Smiley" alt="Brainfuck Smiley" class="pivot-image" />:</p>

	<p>☸⠐⠐☵☴☵☴☵☴☵☴☵☴☵☴☵<br />
⠑☵⠏☰☶☴☳☵☲☷☵☵☵⠎☶<br />
☴☴☴☴☳☵⣔☵⠎☶☴☳☵☲<br />
☷☴⠬☵☴☴☳☵☵☵☵☲☷<br />
⠑☵⠏☰☶☴☳☵☲☷☵☵<br />
☵☵⡄☶☵☱☳☴☲☷☳<br />
⠆☵☱☴☶☵☱☳☴☲<br />
☷☳⡘☵☱☴☶☵☱<br />
☳☴☲☷☳⠆☵☱<br />
☴☶☵☱☳☴☲<br />
☷☳⠉☵☱☴<br />
☶☵☱☳☴<br />
☲☷☴⠆<br />
☶☵☳<br />
☴☲<br />
☷</p>

	<p>See <a href="http://id.8x.cc/shit/bfc/">the embedded brainfuck canvas</a> page for full details on how to embed a brainfuck program into a webpage.</p>

	<p>If you have installed the script, below here you should be able to see some running brainfuck machines! Otherwise, you&#8217;ll just see the code <img src='http://id.motd.org/extensions/emoticons/trillian/e_01.gif' alt=':-)' align='middle'/><br />
<pre>
<code>☸⠐⠐☵☴☵☴☵☴☵☴☵☴☵☴☵
⠑☵⠏☰☶☴☳☵☲☷☵☵☵⠎☶
☴☴☴☴☳☵⣔☵⠎☶☴☳☵☲
☷☴⠬☵☴☴☳☵☵☵☵☲☷
⠑☵⠏☰☶☴☳☵☲☷☵☵
☵☵⡄☶☵☱☳☴☲☷☳
⠆☵☱☴☶☵☱☳☴☲
☷☳⡘☵☱☴☶☵☱
☳☴☲☷☳⠆☵☱
☴☶☵☱☳☴☲
☷☳⠉☵☱☴
☶☵☱☳☴
☲☷☴⠆
☶☵☳
☴☲
☷</code></pre></p>
		]]></content>
		<author>
			<name>id</name>
		</author>
	</entry>
	
	
	
	<entry>
		<title>Unicode Fancy Font Converter</title>
		<link rel="alternate" type="text/html" href="http://id.motd.org/pivot/entry.php?id=27" />
		<updated>2010-08-03T20:01:00-00:00</updated>
		<published>2010-08-03T20:01:00-00:00</published>
		<id>tag:idrisse-dribble,2010:Idrisse-dribble.27</id>
		<link rel="related" type="text/html" href=""  />
		<summary type="text">Ⓣⓗⓔⓢⓔ 𝐖𝐨𝐫𝐝𝐬 𝔸𝕣𝕖 𝓐𝓵𝓵 𝕴𝖓 𝖳𝗁𝖾 𝚂𝚊𝚖𝚎 ⒣⒯⒨⒧ 𝓕𝓸𝓷𝓽-𝓕𝓪𝓬𝓮

	Invisible in most major operating systems until recently, the unicode specification defines a bunch of weird tables which are intended to be used as mathematical variables, for people who are not satisfied with good old a to z, a′ to z′, a′′ to z′′, etc.

	Many of these are composed of the full roman alphabet, meaning a fun hack is possible which allows you to type with a weird font in places where you cannot normally use formatting – such as a filename, facebook status, or anywhere you can type unicode text.

	I’ve made a little script which allows you to enter some text and have it transformed into the silly font of your choosing.

	Weird Unicode Font Converter – just copy and paste the outputted red text into somewhere inappropriate.</summary>
        <content type="html" xml:lang="en" xml:base="http://id.motd.org/pivot/entry.php?id=27"><![CDATA[
                <p>Ⓣⓗⓔⓢⓔ 𝐖𝐨𝐫𝐝𝐬 𝔸𝕣𝕖 𝓐𝓵𝓵 𝕴𝖓 𝖳𝗁𝖾 𝚂𝚊𝚖𝚎 ⒣⒯⒨⒧ 𝓕𝓸𝓷𝓽-𝓕𝓪𝓬𝓮</p>

	<p>Invisible in most major operating systems until recently, the unicode specification defines a bunch of weird tables which are intended to be used as mathematical variables, for people who are not satisfied with good old a to z, a′ to z′, a′′ to z′′, etc.</p>

	<p>Many of these are composed of the full roman alphabet, meaning a fun hack is possible which allows you to type with a weird font in places where you cannot normally use formatting &#8211; such as a filename, facebook status, or anywhere you can type unicode text.</p>

	<p>I&#8217;ve made a little script which allows you to enter some text and have it transformed into the silly font of your choosing.</p>

	<p><a href="http://id.8x.cc/random/fancy/fancy.php">Weird Unicode Font Converter</a> &#8211; just copy and paste the outputted red text into somewhere inappropriate.</p>	<p>I&#8217;ve found these tables to work with Ubuntu 10.4, Windows Vista, using Firefox 3.5 or later, but not with anything older than that, not with chrome, and not with Android.</p>
		]]></content>
		<author>
			<name>id</name>
		</author>
	</entry>
	
	
	
	<entry>
		<title>M3G whack-a-mouse</title>
		<link rel="alternate" type="text/html" href="http://id.motd.org/pivot/entry.php?id=26" />
		<updated>2010-07-14T13:37:00-00:00</updated>
		<published>2010-07-14T13:37:00-00:00</published>
		<id>tag:idrisse-dribble,2010:Idrisse-dribble.26</id>
		<link rel="related" type="text/html" href=""  />
		<summary type="text">A silly game for mobile phones that I’ve been working on. It’s about half finished at the moment, but getting there.</summary>
        <content type="html" xml:lang="en" xml:base="http://id.motd.org/pivot/entry.php?id=26"><![CDATA[
                <p>A silly game for mobile phones that I&#8217;ve been working on. It&#8217;s about half finished at the moment, but getting there.</p>

	<p><object width="425" height="344"><param name="movie" value="http://www.youtube.com/v/AvrVZTM6F38&hl=en&fs=1"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/AvrVZTM6F38&hl=en&fs=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="344"></embed></object></p>	<p>The way I&#8217;ve designed the engine, it&#8217;ll be easy to add additional levels without making any code changes. There are actually only a few hundred lines of java code &#8211; most of the work is done in blender.</p>

	<p>It&#8217;s sad that Java on mobile phones seems to be dying before I&#8217;ve had a chance to release my first game, with totally unportable smartphone platforms taking over. I really like M3G. Android&#8217;s 3D <span class="caps">API</span> is so barren and useless in comparison to all the high-level features of M3G.</p>

	<p>Perhaps once I&#8217;ve learnt enough Android programming, I&#8217;ll be able to write a tutorial and comparison between the two platforms.</p>
		]]></content>
		<author>
			<name>id</name>
		</author>
	</entry>
	
	
	
	<entry>
		<title>Transcoding video for Motorola Droid on Linux</title>
		<link rel="alternate" type="text/html" href="http://id.motd.org/pivot/entry.php?id=25" />
		<updated>2010-04-03T10:52:00-00:00</updated>
		<published>2010-04-03T10:52:00-00:00</published>
		<id>tag:idrisse-dribble,2010:Idrisse-dribble.25</id>
		<link rel="related" type="text/html" href=""  />
		<summary type="text">There’s a neat video player available for android called yxFlash, which can play a wide variety of formats that the built-in player cannot. The droid does a decent job of playing back foreign video formats such as wmv, divx, flv, mkv, but sadly it doesn’t quite have enough grunt to play back high resolution clips smoothly.

	So, here’s how to use ffmpeg in Linux to transcode and resize pretty much any video to a format that the Motorola Droid or Milestone plays with the greatest ease – h264 &amp; aac. The command also resizes the video to 480 pixels high, so it’s the right size for the droid / milestone’s screen.</summary>
        <content type="html" xml:lang="en" xml:base="http://id.motd.org/pivot/entry.php?id=25"><![CDATA[
                <p>There&#8217;s a neat video player available for android called <a href="http://www.androlib.com/android.application.kr-mobilesoft-yxflash-qEnD.aspx">yxFlash</a>, which can play a wide variety of formats that the built-in player cannot. The droid does a decent job of playing back foreign video formats such as wmv, divx, flv, mkv, but sadly it doesn&#8217;t quite have enough grunt to play back high resolution clips smoothly.</p>

	<p>So, here&#8217;s how to use ffmpeg in Linux to transcode and resize pretty much any video to a format that the Motorola Droid or Milestone plays with the greatest ease &#8211; h264 & aac. The command also resizes the video to 480 pixels high, so it&#8217;s the right size for the droid / milestone&#8217;s screen.</p>	<p>Firstly find out the width and height of the video so we can figure out what the new width must be in order to keep the aspect ratio when resizing to 480 pixels high:</p>

	<p><code>ffplay -stats -vn -an file.flv 2&#62;&#38;1 | perl -lne &#39;if(/\s(\d+)x(\d+),/){print &#34;$1\t$2&#34;}&#39;</code></p>

	<p>Calculate the new width = (480/height) * width.</p>

	<p>Then go ahead and transcode the video:</p>

	<p><code>ffmpeg -i file.flv -s 640x480 -vcodec libx264 -b 480k -acodec libfaac -ab 96k -sameq -pass 1 file.mp4</code></p>

	<p>Where 640 is the new width from the calculation above.</p>

	<p><a href="http://id.motd.org/pivot/code/droidify-video.sh">Here</a> is a script which does the above. Run it with a video&#8217;s filename as the single parameter, and a [whatever].mp4 file will be created. Tested in Ubuntu 9. <sup>(Doesn&#8217;t work in 8 unless you change libx264 with x264, and libfaac with aac, after having recompiled ffmpeg to have aac support!)</sup></p>

<div style="font-size:85%; background-color: #F8F6F6; border-color: #000000; border-style: solid; border-width: 1px;height: px;  margin: 0; margin-bottom: 2px; margin-top: 10px; overflow: auto; width: 100%;">
<pre class="bash" style="font-family:monospace;"><ol><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #666666; font-style: italic;">#!/bin/bash</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> </div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #007800;">info</span>=$<span style="color: #7a0874; font-weight: bold;">&#40;</span>ffplay <span style="color: #660033;">-stats</span> <span style="color: #660033;">-vn</span> <span style="color: #660033;">-an</span> <span style="color: #ff0000;">&quot;$1&quot;</span> <span style="color: #000000;">2</span><span style="color: #000000; font-weight: bold;">&gt;&amp;</span><span style="color: #000000;">1</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">perl</span> <span style="color: #660033;">-lne</span> <span style="color: #ff0000;">&#8216;if(/s(d+)x(d+)[ ,]/){print &quot;$1t$2&quot;}&#8217;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #007800;">width</span>=<span style="color: #000000; font-weight: bold;">`</span><span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$info</span>&quot;</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">cut</span> -f1<span style="color: #000000; font-weight: bold;">`</span></div></li><li style="font-weight: bold; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #007800;">height</span>=<span style="color: #000000; font-weight: bold;">`</span><span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$info</span>&quot;</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">cut</span> -f2<span style="color: #000000; font-weight: bold;">`</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #007800;">newwidth</span>=<span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">perl</span> <span style="color: #660033;">-e</span> <span style="color: #ff0000;">&quot;print int(<span style="color: #007800;">$width</span> * (480/<span style="color: #007800;">$height</span>))&quot;</span><span style="color: #000000; font-weight: bold;">`</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> </div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #666666; font-style: italic;"># some codecs require width to be a multiple of 16 :-</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #007800;">padding</span>=<span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">perl</span> <span style="color: #660033;"><del>e</span> <span style="color: #ff0000;">&quot;print (16</del>(<span style="color: #007800;">$newwidth</span> % 16));&quot;</span><span style="color: #000000; font-weight: bold;">`</span></div></li><li style="font-weight: bold; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #007800;">$padding</span> == <span style="color: #000000;">16</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span> ; <span style="color: #000000; font-weight: bold;">then</span> <span style="color: #007800;">stretched</span>=<span style="color: #007800;">$newwidth</span> ; <span style="color: #000000; font-weight: bold;">else</span> <span style="color: #007800;">stretched</span>=<span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">expr</span> <span style="color: #007800;">$padding</span> + <span style="color: #007800;">$newwidth</span><span style="color: #000000; font-weight: bold;">`</span> ; <span style="color: #000000; font-weight: bold;">fi</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> </div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #c20cb9; font-weight: bold;">ffmpeg</span> <span style="color: #660033;">-i</span> <span style="color: #ff0000;">&quot;$1&quot;</span> <span style="color: #660033;">-s</span> <span style="color: #800000;">${stretched}</span>x480 <span style="color: #660033;">-vcodec</span> libx264 <span style="color: #660033;">-b</span> 480k <span style="color: #660033;">-acodec</span> libfaac <span style="color: #660033;">-ab</span> 96k <span style="color: #660033;">-sameq</span> <span style="color: #660033;">-pass</span> <span style="color: #000000;">1</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$(echo &quot;$1&quot; | perl -pe &#8216;s/.w+$/.mp4/&#8217;)</span>&quot;</span> </div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> </div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #660033;">-e</span> ffmpeg2pass-0.log <span style="color: #7a0874; font-weight: bold;">&#93;</span> ; <span style="color: #000000; font-weight: bold;">then</span> <span style="color: #c20cb9; font-weight: bold;">rm</span> ffmpeg2pass-0.log ; <span style="color: #000000; font-weight: bold;">fi</span></div></li><li style="font-weight: bold; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #660033;">-e</span> x264_2pass.log <span style="color: #7a0874; font-weight: bold;">&#93;</span> ; <span style="color: #000000; font-weight: bold;">then</span> <span style="color: #c20cb9; font-weight: bold;">rm</span> x264_2pass.log ; <span style="color: #000000; font-weight: bold;">fi</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> </div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> </div></li></ol></pre>
</div>

	<p>Of course you can use this to batch convert a bunch of videos in the usual linux way:</p>

	<p><code>for i in *.flv ; do droidify-video.sh &#34;$i&#34; ; done</code></p>
		]]></content>
		<author>
			<name>id</name>
		</author>
	</entry>
	
	
	
	<entry>
		<title>Rapid prototyping: fire husky</title>
		<link rel="alternate" type="text/html" href="http://id.motd.org/pivot/entry.php?id=23" />
		<updated>2009-12-22T11:45:00-00:00</updated>
		<published>2009-12-22T11:45:00-00:00</published>
		<id>tag:idrisse-dribble,2010:Idrisse-dribble.23</id>
		<link rel="related" type="text/html" href=""  />
		<summary type="text">Direct link</summary>
        <content type="html" xml:lang="en" xml:base="http://id.motd.org/pivot/entry.php?id=23"><![CDATA[
                <p><a href="http://blog.hellobard.com/2008/11/01/fire-husky-1-rapid-prototyping/">Direct link</a></p>	<p>Rapid prototyping is a subject that seems to keep returning to my attentionsphere. Until repraps are precise enough to be useful, here&#8217;s one guy&#8217;s experiences with producing plastic objects from 3D computer models.</p>
		]]></content>
		<author>
			<name>id</name>
		</author>
	</entry>
	
	
	
	<entry>
		<title>Poking around firefox's bookmarks store: places.sqlite</title>
		<link rel="alternate" type="text/html" href="http://id.motd.org/pivot/entry.php?id=22" />
		<updated>2009-12-21T23:00:00-00:00</updated>
		<published>2009-12-21T23:00:00-00:00</published>
		<id>tag:idrisse-dribble,2010:Idrisse-dribble.22</id>
		<link rel="related" type="text/html" href=""  />
		<summary type="text">Today I wanted to retrieve some bookmarks that I made the other day on my home computer, from far away. Thankfully I can access my pooter over SSH, allowing me to poke around inside it on the command line.

	Older versions of firefox stored bookmarks in XML files, which made it easy to rifle through them on the shell. Newfangled firefox uses sqlite files however, which makes accessing this data a bit harder.

	Here’s some quick commands you can run to extract your precious URLs from firefox’s places.sqlite file.</summary>
        <content type="html" xml:lang="en" xml:base="http://id.motd.org/pivot/entry.php?id=22"><![CDATA[
                <p>Today I wanted to retrieve some bookmarks that I made the other day on my home computer, from far away. Thankfully I can access my pooter over <span class="caps">SSH</span>, allowing me to poke around inside it on the command line.</p>

	<p>Older versions of firefox stored bookmarks in <span class="caps">XML</span> files, which made it easy to rifle through them on the shell. Newfangled firefox uses sqlite files however, which makes accessing this data a bit harder.</p>

	<p>Here&#8217;s some quick commands you can run to extract your precious URLs from firefox&#8217;s places.sqlite file.</p>	<p>You&#8217;ll need sqlite3:</p>

	<p><code>sudo apt-get install sqlite3</code></p>

	<p>First, cd into your firefox profile dir, where the places.sqlite file resides:</p>

	<p><code>cd ~/.mozilla/firefox/*default/</code></p>

	<p>To gain a list of all bookmark folders in this profile, do this:</p>

	<p><code>sqlite3 places.sqlite &#34;select id,title from moz_bookmarks where type=2&#34;</code></p>

	<p>Choose the folder whose URLs you want to list, noting its ID from the left column of the output from above . Use this ID in the next query instead of 92363:</p>

	<p><code>IDS=$( sqlite3 places.sqlite &#34;select fk from moz_bookmarks where parent=92363&#34; )</code></p>

	<p>Finally, get the <span class="caps">URL</span> associated with each ID:</p>

	<p><code>for i in $IDS ; do sqlite3 places.sqlite &#34;select url from moz_places where id=$i&#34; ; done</code></p>

	<p>Now you should have a neat list of URLs. These can be opened in firefox by simply specifying them as arguments on the command line. (So add <code>firefox $( ... )</code> around the previous command).</p>

	<p>Here&#8217;s how it looked for me:</p>

	<p>
<div style="font-size:85%; background-color: #F8F6F6; border-color: #000000; border-style: solid; border-width: 1px;height: 500px;  margin: 0; margin-bottom: 2px; margin-top: 10px; overflow: auto; width: 100%;">
<pre class="text" style="font-family:monospace;"><ol><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">id@hms-borange:~$ cd ~/.mozilla/firefox/*default</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">id@hms-borange:~/.mozilla/firefox/19xwzg4w.default$ sqlite3 places.sqlite &quot;select id,title from moz_bookmarks where type=2&quot;1|</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">2|Bookmarks Menu</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">3|Bookmarks Toolbar</div></li><li style="font-weight: bold; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">4|Tags</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">5|Unsorted Bookmarks</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">12|Latest Headlines</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">15|Ubuntu and Free Software links</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">22|Mozilla Firefox</div></li><li style="font-weight: bold; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">67|</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">70|All Bookmarks</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">194|e-dribble</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">2024|JOBS</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">3026|Nedroid Picture Diary</div></li><li style="font-weight: bold; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">36522|The Register</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">49621|jubs</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">92363|maemoo</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">id@hms-borange:~/.mozilla/firefox/19xwzg4w.default$ IDS=$( sqlite3 places.sqlite &quot;select fk from moz_bookmarks where parent=92363&quot; )</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">id@hms-borange:~/.mozilla/firefox/19xwzg4w.default$ for i in $IDS ; do sqlite3 places.sqlite &quot;select url from moz_places where id=$i&quot; ; done</div></li><li style="font-weight: bold; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">http://maemo.org/maemo_release_documentation/maemo4.1.x/node4.html#SECTION00432000000000000000</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">http://www.forum.nokia.com/Tools_Docs_and_Code/Tools/Platforms/Maemo/</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">http://maemo.org/development/sdks/maemo_2-2-gregale/</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">http://maemo.org/development/documentation/tutorials/Maemo_2_2_Tutorial/#settingup</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">http://scratchbox.org/download/scratchbox-apophis/</div></li><li style="font-weight: bold; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">http://repository.maemo.org/stable/gregale/</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">http://repository.maemo.org/stable/gregale/i386/</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">http://repository.maemo.org/stable/gregale/armel/</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> </div></li></ol></pre>
</div>
</p>
		]]></content>
		<author>
			<name>id</name>
		</author>
	</entry>
	
	
	
	<entry>
		<title>img2braille</title>
		<link rel="alternate" type="text/html" href="http://id.motd.org/pivot/entry.php?id=21" />
		<updated>2009-10-17T03:57:00-00:00</updated>
		<published>2009-10-17T03:57:00-00:00</published>
		<id>tag:idrisse-dribble,2010:Idrisse-dribble.21</id>
		<link rel="related" type="text/html" href=""  />
		<summary type="text">I’ve just made a little php script which renders an image as braille, using the unicode characters 0×2800 – 0×28FF. Here’s some sample output:

	⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⠻⠻⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿
⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡟⠀⠀⠘⠿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠿⠿⣿
⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡧⢀⠀⠀⠉⠀⢸⡟⣿⣟⡿⠻⠛⠛⠋⠁⠠⣾⣿
⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡷⠀⠀⠀⠀⠀⠘⣴⡿⡼⠋⠀⠈⠀⠀⣀⣴⣿⣿
⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡟⢀⣤⠆⡶⣶⡄⠀⠛⠛⠀⣀⣀⠀⠀⠀⢡⣿⣿⣿
⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣷⠉⠄⠀⠀⠛⠓⠀⠀⠀⡼⠻⡫⠁⣦⣀⢸⣿⣿⣿
⢿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡏⢶⠗⠿⠀⠀⠀⢲⠶⠀⠀⠠⣀⣀⣾⢻⣾⣿⣿⣿
⣼⣿⣿⣿⡿⣹⣿⣿⣿⢏⣿⣿⢳⣌⠑⠤⣦⣤⠔⠚⠦⣀⣀⡄⠛⠛⢻⣾⣿⣿⣿⣿
⣿⣿⣿⣿⣵⣿⣿⣿⣯⣾⡿⣿⡘⣿⣿⡲⢼⣿⣿⠷⢶⠾⡿⠷⠒⣀⣩⣿⣿⣿⣿⣿
⣿⣿⣿⣿⣿⣿⡿⢧⣿⣯⣿⣽⢿⣮⡙⠿⣶⣽⡿⣧⣀⠀⠈⠙⠛⣿⣿⣿⣿⣿⣿⣿
⣿⣿⣿⣿⣿⡏⣱⣿⣽⣿⡿⣅⠀⠉⠙⠲⣤⣝⣻⣷⣦⣥⡀⠲⠿⣛⣿⣿⣿⣿⣿⣿
⣿⣿⣿⣿⡟⣠⣿⡿⣿⣿⣷⡿⠿⣶⣶⣿⣦⣤⡈⠉⠊⢍⡛⠗⣛⣋⣵⣿⣿⣿⣿⣿
⣿⣿⣿⣿⢮⣿⣿⣥⣤⣿⣦⣶⣿⢿⣿⣿⡟⣟⣻⣟⡦⠀⣉⣉⣠⠄⠻⠿⣿⣿⣿⣿
⣿⣿⣿⣷⡀⣿⣿⢿⣿⣿⠉⣩⣴⣟⣿⣟⣥⢹⡿⠠⠻⠚⠋⠉⠁⢀⠀⠀⠀⢀⠀⠈
⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣾⣧⣾⣤⣤⣴⣶⣶⣶⣦⣾⣷⣶⣿⣿⣷⣾</summary>
        <content type="html" xml:lang="en" xml:base="http://id.motd.org/pivot/entry.php?id=21"><![CDATA[
                <p>I&#8217;ve just made a little php <a href="http://id.8x.cc/random/img2braille">script which renders an image as braille</a>, using the unicode characters 0&#215;2800 &#8211; 0&#215;28FF. Here&#8217;s some sample output:</p>

	<p>⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⠻⠻⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿<br />
⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡟⠀⠀⠘⠿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠿⠿⣿<br />
⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡧⢀⠀⠀⠉⠀⢸⡟⣿⣟⡿⠻⠛⠛⠋⠁⠠⣾⣿<br />
⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡷⠀⠀⠀⠀⠀⠘⣴⡿⡼⠋⠀⠈⠀⠀⣀⣴⣿⣿<br />
⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡟⢀⣤⠆⡶⣶⡄⠀⠛⠛⠀⣀⣀⠀⠀⠀⢡⣿⣿⣿<br />
⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣷⠉⠄⠀⠀⠛⠓⠀⠀⠀⡼⠻⡫⠁⣦⣀⢸⣿⣿⣿<br />
⢿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡏⢶⠗⠿⠀⠀⠀⢲⠶⠀⠀⠠⣀⣀⣾⢻⣾⣿⣿⣿<br />
⣼⣿⣿⣿⡿⣹⣿⣿⣿⢏⣿⣿⢳⣌⠑⠤⣦⣤⠔⠚⠦⣀⣀⡄⠛⠛⢻⣾⣿⣿⣿⣿<br />
⣿⣿⣿⣿⣵⣿⣿⣿⣯⣾⡿⣿⡘⣿⣿⡲⢼⣿⣿⠷⢶⠾⡿⠷⠒⣀⣩⣿⣿⣿⣿⣿<br />
⣿⣿⣿⣿⣿⣿⡿⢧⣿⣯⣿⣽⢿⣮⡙⠿⣶⣽⡿⣧⣀⠀⠈⠙⠛⣿⣿⣿⣿⣿⣿⣿<br />
⣿⣿⣿⣿⣿⡏⣱⣿⣽⣿⡿⣅⠀⠉⠙⠲⣤⣝⣻⣷⣦⣥⡀⠲⠿⣛⣿⣿⣿⣿⣿⣿<br />
⣿⣿⣿⣿⡟⣠⣿⡿⣿⣿⣷⡿⠿⣶⣶⣿⣦⣤⡈⠉⠊⢍⡛⠗⣛⣋⣵⣿⣿⣿⣿⣿<br />
⣿⣿⣿⣿⢮⣿⣿⣥⣤⣿⣦⣶⣿⢿⣿⣿⡟⣟⣻⣟⡦⠀⣉⣉⣠⠄⠻⠿⣿⣿⣿⣿<br />
⣿⣿⣿⣷⡀⣿⣿⢿⣿⣿⠉⣩⣴⣟⣿⣟⣥⢹⡿⠠⠻⠚⠋⠉⠁⢀⠀⠀⠀⢀⠀⠈<br />
⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣾⣧⣾⣤⣤⣴⣶⣶⣶⣦⣾⣷⣶⣿⣿⣷⣾</p>	<p>The braille unicode table is 256 characters, with every possible arrangement of the 8 dots in a 2&#215;4 cell. Sadly, the order of the symbols is not completely consistent with the arrangement of the dots if interpreted as binary numbers. This is because braille characters are usually only six dots, and not eight. Therefore, the first six dots are given priority in the table and are arranged:</p>

	<p>1 4<br />
2 5<br />
3 6<br />
7 8</p>

	<p>...instead of:</p>

	<p>1 5<br />
2 6<br />
3 7<br />
4 8</p>

	<p>...which would be much neater mathematically.</p>

	<p>The 7th and 8th bits are sort of extended-braille, and I&#8217;m not even sure if they are actually used in any language or if they&#8217;re just included in the table for completeness. </p>

	<p>If you take this slightly inconsistent arrangement into account however, it is of course possible to use the braille table to generate arbitrary raster images. It&#8217;s a new take on ascii-art, which allows a lot of detail to be crammed into a text-image in a clean and consistent way.</p>

	<p>Here is the link to the <a href="http://id.8x.cc/random/img2braille">img2braille</a> upload converter hosted on my playpen webspace.</p>

<div style="font-size:65%;">⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣀⡀⢀⣀⠀⠀⣀⣀⣀⣀⣀⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣀⣤⣤⣶⣦⣤⣤⣤⣴⣶⣿⣿⣿⣿⣝⣿⢉⢈⡿⣿⣯⣷⣿⣿⣻⣿⣿⣶⣶⣦⣤⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠒⠾⠿⠿⠿⠿⠿⣿⣿⣿⣿⣿⣿⣿⣿⡿⡿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣷⣶⣶⣦⣤⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠒⠒⠂⠂⠢⠠⠰⠚⡋⢰⣵⣿⣿⣿⣾⣿⣿⣿⣟⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⢿⣿⣿⣿⣿⣷⣦⣄⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠰⡀⣂⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠉⣿⣿⣿⣿⣿⣿⣿⡿⣿⣿⣯⣈⣴⣤⣄⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢠⢆⣋⢹⢻⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣦⣄⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⡀⢀⡁⠂⠈⠸⣱⣸⣿⣿⣿⣿⣿⣿⣿⢿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣟⣿⣿⣟⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣷⣦⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⠎⠀⠀⠀⠐⢌⠛⠈⠃⢿⣾⣿⡟⣿⣿⡏⣼⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⣩⡿⣿⣿⡿⣿⣿⣿⣿⣿⣿⣿⡿⠻⠆⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢰⡟⠀⠀⠀⠀⠀⠀⠀⠀⠀⡺⣿⠋⠀⣿⣿⢰⢿⣿⣿⣿⣿⣿⣿⣿⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣹⣿⣿⣮⡻⣿⣿⣿⣿⣿⣿⣷⣨⣦⡄⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠀⣰⣏⣡⣀⠀⠀⠀⠀⠀⠀⠀⠀⣾⡿⠀⢠⣿⡗⣠⣿⣿⣿⣿⣿⣟⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣇⢀⣹⣿⣮⡙⠿⣿⣿⣿⣿⣿⣿⣿⣆⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⢠⣿⣿⠿⠯⠄⠀⠀⠀⠀⠀⠀⣾⣿⣇⠀⢸⣿⣿⣿⣿⣿⣿⣿⣿⣽⣿⣿⣯⣽⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣭⣶⣌⡙⠦⣤⣉⠻⢿⣿⣿⣿⣿⡇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⢼⣿⠋⢀⣠⠀⠸⢷⣶⣄⣀⠀⠿⣿⣿⠀⣖⣿⣿⣿⣿⣿⢿⣿⢼⣿⣿⣿⣆⣟⣿⣿⣿⣿⢟⡼⢿⣿⣾⣿⣿⣿⣿⣿⣿⣿⣿⣶⣿⣶⡙⠳⣵⣶⣿⢿⣿⠿⠇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⢸⡇⢈⡡⣶⣷⡀⢸⣿⣿⣿⣿⣷⣤⡉⠈⠉⣿⣿⣿⣿⣿⣾⣿⣿⣿⣟⣷⣿⣿⣿⣿⣿⡛⠭⠀⠁⣤⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣾⡻⣿⣇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠸⡇⣄⠐⠨⢾⣷⡈⢿⣿⣿⣿⣿⣿⣷⠀⠀⠘⣿⣿⣿⣿⠇⣿⣿⣿⣾⣿⣿⣿⣿⣿⠷⠄⠀⠒⢮⣿⣿⣿⣿⣿⡿⢿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣄⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠄⢈⠉⠐⠈⠘⠷⠄⠙⠻⠿⠿⢿⣿⠇⠀⠀⣾⣿⣿⣿⣽⣿⣿⣿⣿⢿⣿⡿⠿⠇⡀⠀⡰⠾⣿⣿⡿⣿⣿⢿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣷⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠓⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠋⠀⠀⠀⠽⣿⣿⣿⣿⣿⣿⢃⣼⣾⣿⣿⣿⣿⣷⣶⣮⣻⣾⣿⣿⣷⣼⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡄⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢫⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣠⡴⢼⣷⣿⣿⣿⣿⣿⣷⣽⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⠿⣿⡮⣻⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣄⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣀⠀⠀⠀⠀⠀⠀⠀⠀⡶⣾⣷⣶⣼⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⠟⠿⢿⣿⣿⣿⣿⠿⠟⣀⣶⣿⢯⣇⣘⣎⢿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡆⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠡⠀⠀⠀⠐⣿⣿⡗⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠶⠦⡐⣦⣤⣴⣤⣶⣿⣿⣿⡿⠶⡛⢟⣷⢻⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡷⣿⣆⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠃⠀⢸⣉⣁⣈⣿⠿⣿⣿⣿⣿⣿⡟⠛⠛⡿⠋⠰⠀⠀⠘⠿⣿⣿⣿⠿⡿⣿⠷⠾⣷⣶⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡋⠹⣿⣷⣤⡀⠀⠀⠀⠀⠀⠀⠀
⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠗⢆⠀⠀⢿⣿⣿⣿⣷⣾⣿⣿⡿⠛⠀⡀⠈⠠⡄⠀⡀⠀⠀⠀⣊⣻⡛⢿⣿⣿⣿⣷⣶⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣟⠀⠀⣿⣿⣿⣷⣦⣄⡀⠀⠀⠀⠀
⡻⣷⣦⣄⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠁⢤⢀⠀⠀⠀⠙⣿⣿⡿⠛⠛⠉⠰⠆⠟⠻⠟⠀⠃⢀⠙⠀⠀⠑⢮⣷⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠿⢿⣿⣿⣿⡿⠉⠉⠀⠀⣿⣿⣿⣿⣿⣿⣷⣄⠀⠀⠀
⠀⠉⠻⠿⠿⣿⣷⠶⡢⠤⣀⠀⠀⡠⠀⠀⠀⠶⣬⣶⣒⣴⣦⣼⣋⡀⠀⡤⠶⣴⢢⣶⡆⣤⠄⡀⠀⠀⢀⣀⢳⣦⣽⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⡏⠀⠀⠉⠁⠀⠀⠀⠀⠀⠀⣿⣿⣿⣿⣿⣿⣿⣯⣿⣦⡄
⣀⣴⣂⠀⠀⠀⠀⠀⢀⣀⣲⡿⠶⡄⠀⠀⠀⠀⠈⢿⣿⣿⣿⣿⣿⣿⣶⣶⡰⡤⢠⣧⡀⣁⠀⠑⠀⠀⢸⣟⣿⣿⣿⣿⣿⣿⣿⣿⡿⢿⣿⣿⣿⣿⣿⠋⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠰⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣷
⣿⣿⣿⣾⣧⣶⠾⠛⠋⠉⠛⢿⣿⠃⠀⠀⠀⠀⠀⠈⣿⣏⢻⠟⠉⠀⠀⠼⠓⠛⠾⣿⣧⣽⣿⡀⣦⣼⣿⣿⣽⣾⣟⡿⣿⣿⣿⣿⣿⣿⣿⢟⡟⠉⢀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣻⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿
⣿⣿⣿⣿⠋⠀⠀⠀⠀⠀⣠⣮⡏⠀⠀⠀⠀⠀⠀⠀⢸⣿⠀⠀⠀⠀⠀⠀⠀⠀⠀⢾⣿⣿⣿⣿⣹⣿⣿⣿⣿⣿⣮⣟⢾⣟⠿⣿⣿⣿⣿⣷⣮⠻⡆⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣸⣿⣿⣿⣿⣿⣿⣿⣿⣿⣯⣿
⣿⣿⡿⠋⠀⠀⠀⢀⣠⣾⣿⠟⠀⠀⠀⠀⠀⠀⠀⠀⠀⢿⡇⠀⠀⠀⠀⠀⠀⠀⢀⡼⠙⠛⢿⣿⣷⣿⣿⣿⣿⣿⣿⣿⣷⣯⡻⣮⣟⢿⣿⣟⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣹⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿
⣿⣿⣅⡀⣀⣴⣶⣿⣿⡿⠉⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠘⣿⠀⠀⠀⠀⠀⠴⠀⠀⠀⠀⠀⠀⢹⣿⣿⣿⣿⣿⣾⣿⣿⣿⣿⣿⣮⡙⢗⠌⠃⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿
⣿⣿⣿⣿⣿⣿⣿⣿⠟⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢻⣇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣀⣿⣿⣿⣿⣿⣿⣯⢿⣿⣿⣿⣿⣿⠂⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢠⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿
⣿⣿⣿⣿⣿⠟⠛⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢸⣿⠀⠀⠀⠀⠀⠀⣠⠶⠛⠋⠉⠻⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠋⠙⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠹⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣧
⠿⠿⣛⠉⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠸⣿⡇⠀⠀⠀⠀⠀⠁⠀⠀⠀⠀⠀⣿⢹⣿⣿⣿⣿⣿⣿⣿⡿⡏⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠸⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡟
⣿⣧⡄⠂⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣰⣿⣷⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣿⢼⣿⣿⣿⣿⣿⣿⣿⣷⡵⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿
⣿⣿⣿⣷⣤⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠙⢿⣿⣿⣷⣤⣤⣤⣤⣤⣤⣤⣤⣤⣿⠟⠉⣿⣿⣿⣿⣿⣿⣿⢿⠂⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣀⣀⣀⠀⠸⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿
⣿⣿⣿⣿⣿⣷⣷⣶⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣔⠋⣿⣿⣿⣿⣿⣿⣿⣿⣿⡷⠶⣿⡶⢦⡶⠿⣿⠏⠹⣧⣿⠷⠶⣤⢠⠶⢦⢶⣠⠴⠶⢤⡀⡤⠶⠶⣄⡾⠉⠻⣿⠶⣿⡴⠶⡾⠿⣿⡿⠿⡿⠿⣿⣿⣿⣿⣿
⣿⣿⣿⣿⣿⣿⣿⣿⠛⣷⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠠⣿⣷⣿⣿⣿⣿⣿⣿⣿⣿⣿⡇⠀⣿⡇⢸⡇⠀⣿⡇⢰⣿⡇⠸⠇⠘⣿⠀⢨⣼⡇⠀⠷⠀⣿⡇⠸⢧⡼⣿⠀⢸⣿⠀⣿⡇⠀⣷⠀⣿⡇⢰⡇⠀⣿⣿⣿⣿⡟
⣿⣿⣿⣿⣿⣿⣿⣿⣴⣿⣧⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡇⠀⣿⡇⢸⡇⠀⣿⡇⢸⣿⡇⢸⡟⢛⣿⠀⢸⠸⡇⠀⣿⠛⣿⡟⢲⡄⢹⣿⠀⢸⣿⠀⣿⡇⠀⣿⠀⣿⡇⠘⠇⠀⣿⣽⣿⣿⣟
⣿⣿⣿⣿⡿⠿⠿⠿⠿⠵⠦⠤⠤⠤⠠⠀⠀⠀⠀⠀⠀⢿⣿⣿⣿⣿⣿⡴⠿⠼⠷⠼⣷⣤⣿⣧⣼⣧⣤⢿⡷⠤⠿⠳⠤⠤⠞⠹⠦⠾⠁⠙⠦⠥⠶⠋⠳⠤⠤⠞⠙⠦⠬⠿⠤⠿⠧⢤⣿⣤⣿⣟⡛⠋⣠⡿⠌⠈⠻⣿
⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⢿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿</div>
		]]></content>
		<author>
			<name>id</name>
		</author>
	</entry>
	
	
	
	<entry>
		<title>Console image viewer: pbmtoascii</title>
		<link rel="alternate" type="text/html" href="http://id.motd.org/pivot/entry.php?id=20" />
		<updated>2009-09-29T19:42:00-00:00</updated>
		<published>2009-09-29T19:42:00-00:00</published>
		<id>tag:idrisse-dribble,2010:Idrisse-dribble.20</id>
		<link rel="related" type="text/html" href=""  />
		<summary type="text">Here’s a neat one-liner I just came up with for those times that you’re stuck at the unix/linux console and really need to peek at an image file but cannot use X11.</summary>
        <content type="html" xml:lang="en" xml:base="http://id.motd.org/pivot/entry.php?id=20"><![CDATA[
                <p>Here&#8217;s a neat one-liner I just came up with for those times that you&#8217;re stuck at the unix/linux console and really need to peek at an image file but cannot use X11.</p>	<p>This method depicts the image in monochrome ascii art, so is pretty useless for images with any amount of detail or subtlety in them.</p>

	<p>It uses imagemagick to convert the input image to an array of monochrome pbm files, using a range of brightness values from 50% up to 150%. It then uses asciitopbm to depict the image using ascii characters. When you execute the command, you will first see a very dark image, which will gradually become very bright. Hopefully at some point in between these two extremes, the shape of whatever is in the image will become apparent.</p>

	<p><code>for i in `seq 50 5 150` ; do convert banana.jpg -thumbnail 80 -modulate $i pbm:- | pbmtoascii - ; done</code></p>

	<p>If you&#8217;d like to try this out now, first download the sample banana:</p>

	<p><code>wget http://id.chaosnet.org/junk/banana.jpg</code></p>

	<p><sub>Banana source <a href="http://www.flickr.com/photos/ramdac/372469203/sizes/l/#cc_license">© Jason Gulledge</a> creative commons</sub></p>
		]]></content>
		<author>
			<name>id</name>
		</author>
	</entry>
	
	
	
	<entry>
		<title>Animal Disco</title>
		<link rel="alternate" type="text/html" href="http://id.motd.org/pivot/entry.php?id=19" />
		<updated>2009-06-21T12:13:00-00:00</updated>
		<published>2009-06-21T12:13:00-00:00</published>
		<id>tag:idrisse-dribble,2010:Idrisse-dribble.19</id>
		<link rel="related" type="text/html" href=""  />
		<summary type="text">Another silly Java3D app, this time some wolves and rhinos (with Parkinson’s) dancing at a disco in a grassy plain.

	


	The movement simply rotates and displaces each animal by a small random amount each frame, so it’s totally unrealistic but I think that makes it funny.</summary>
        <content type="html" xml:lang="en" xml:base="http://id.motd.org/pivot/entry.php?id=19"><![CDATA[
                <p>Another silly Java3D app, this time some wolves and rhinos (with Parkinson&#8217;s) dancing at a disco in a grassy plain.</p>

	<p><!-- error: You haven't included [[ thickbox:head ]] in your templates. --><p style="text-align:center;"><a href='http://id.motd.org/images/animaldisco_copy1.jpg' class="thickbox" title="Rhinos and wolves gyrating in a field" rel="entry-19" ><img src="http://id.motd.org/images/animaldisco_copy1.thumb.jpg" border="1" alt="Rhinos and wolves gyrating in a field" title="Rhinos and wolves gyrating in a field"  class='pivot-popupimage'/></a></p>


	<p>The movement simply rotates and displaces each animal by a small random amount each frame, so it&#8217;s totally unrealistic but I think that makes it funny.</p>	<p><applet archive="http://id.chaosnet.org/junk/AnimalDisco.jar" width="512" height="640" code="WanderPlane" > You&#8217;ll need Java and Java3D. </applet> </p>

	<p>As usual, <a href="http://www.java.com/en/download/">Java</a> and <a href="https://java3d.dev.java.net/binary-builds.html">Java3D</a> are needed, and source code is in the <a href="http://id.chaosnet.org/junk/AnimalDisco.jar">jar</a>.</p>

	<p><a href="http://www.turbosquid.com/FullPreview/Index.cfm/ID/318361">Thanks</a> <a href="http://www.turbosquid.com/3d-models/free-rhino-3d-model/206350">turbosquid</a>!</p>
		]]></content>
		<author>
			<name>id</name>
		</author>
	</entry>
	
	
	
	<entry>
		<title>SexFlip v0.2</title>
		<link rel="alternate" type="text/html" href="http://id.motd.org/pivot/entry.php?id=18" />
		<updated>2009-06-19T21:32:00-00:00</updated>
		<published>2009-06-19T21:32:00-00:00</published>
		<id>tag:idrisse-dribble,2010:Idrisse-dribble.18</id>
		<link rel="related" type="text/html" href=""  />
		<summary type="text">Using the default makehuman settings, I’ve created a new model for SexFlip Pro v0.2.

	I created three models; one with androgynous features, one with a penis and one with breasts. The extra bits were removed from the latter two meshes, leaving floating private parts, the scale of which can be controlled separately as in SexFlip v0.1.</summary>
        <content type="html" xml:lang="en" xml:base="http://id.motd.org/pivot/entry.php?id=18"><![CDATA[
                <p>Using the default <a href="http://www.makehuman.org/">makehuman</a> settings, I&#8217;ve created a new model for SexFlip Pro v0.2.</p>

	<p>I created three models; one with androgynous features, one with a penis and one with breasts. The extra bits were removed from the latter two meshes, leaving floating private parts, the scale of which can be controlled separately as in SexFlip v0.1.</p>

	<p><!-- error: You haven't included [[ thickbox:head ]] in your templates. --><p style="text-align:center;"><a href='http://id.motd.org/images/sexflip-0.2.png' class="thickbox" title="Trannie simulator v0.2" rel="entry-18" ><img src="http://id.motd.org/images/sexflip-0.thumb.png" border="1" alt="Trannie simulator v0.2" title="Trannie simulator v0.2"  class='pivot-popupimage'/></a></p>
	<p>The boobs and willy can still be scaled to ridiculous proportions, but they don&#8217;t float away so much any more. The seams of the breasts are awful, though.</p>

	<p><applet archive="http://id.chaosnet.org/junk/SexFlip-0.2.jar" width="512" height="640" code="BoobEmerge" > You&#8217;ll need Java and Java3D. </applet> </p>

	<p>Again, <a href="http://www.java.com/en/download/">Java</a> and <a href="https://java3d.dev.java.net/binary-builds.html">Java3D</a> are needed, and program source and models can be found in the <a href="http://id.chaosnet.org/junk/SexFlip-0.2.jar">jar</a>.</p>

	<p>The only bit of programming that had me scratching my head was figuring out how to scale a Shape3D in java from a specific point, rather than scaling the model around point 0,0,0 as is the default behaviour. In blender for example, you can choose to scale around the cursor rather than around 0,0,0. A brief google search didn&#8217;t yield any tips on how to do this, and I&#8217;m sure the functionality must exist in the <span class="caps">API</span>, but it&#8217;s eluded me. So instead I did as follows:</p>

	<ol>
		<li> Create a vector representing the centre point of the scale transform, let&#8217;s call it C. </li>
		<li> Multiply this vector by the scale factor, S, resulting in a vector D. </li>
		<li> Apply the scale transformation (S) to your shape as normal. </li>
		<li> Subtract vector D from C, giving E. </li>
	</ol>
	<ol>
		<li> Apply a translation transformation to your shape, using the vector E to specify the translation.</li>
	</ol>

	<p>In other words, subtract the distance that the shape gets displaced, from its starting point. Or in Javanese:</p>

<div style="font-size:85%; background-color: #F8F6F6; border-color: #000000; border-style: solid; border-width: 1px;height: px;  margin: 0; margin-bottom: 2px; margin-top: 10px; overflow: auto; width: 100%;">
<pre class="java" style="font-family:monospace;"><ol><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">Transform3D t <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> Transform3D<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> </div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #666666; font-style: italic;">// Making the shape 10 times bigger</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #000066; font-weight: bold;">double</span> scale <span style="color: #339933;">=</span> <span style="color: #cc66cc;">10.0</span><span style="color: #339933;">;</span></div></li><li style="font-weight: bold; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">t.<span style="color: #006633;">setScale</span><span style="color: #009900;">&#40;</span> scale <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> </div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #666666; font-style: italic;">// Scaling around the point 0, 0.085, -0.41</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">Vector3f center <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> Vector3f<span style="color: #009900;">&#40;</span> 0.0f, 0.085f, <span style="color: #339933;">-</span>0.41f <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> </div></li><li style="font-weight: bold; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #666666; font-style: italic;">// Duplicate the centre vector and scale it</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">Vector3f scaledCenter <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> Vector3f<span style="color: #009900;">&#40;</span> center <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> </div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">scaledCenter.<span style="color: #006633;">scale</span><span style="color: #009900;">&#40;</span> <span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">float</span><span style="color: #009900;">&#41;</span> scale <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> </div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #666666; font-style: italic;">// Subtract one from the other</span></div></li><li style="font-weight: bold; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">center.<span style="color: #006633;">sub</span><span style="color: #009900;">&#40;</span> scaledCenter <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> </div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #666666; font-style: italic;">// Combine the translation and scaling into one transform operation</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">t.<span style="color: #006633;">setTranslation</span><span style="color: #009900;">&#40;</span> center <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> </div></li><li style="font-weight: bold; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #666666; font-style: italic;">// Finally, apply the transform to the shape</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">willy.<span style="color: #006633;">setTransform</span><span style="color: #009900;">&#40;</span> t <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> </div></li></ol></pre>
</div>

	<p>My code&#8217;s a little different so that might not work without tweaking. Feel free to share a better way of scaling around a point in Java3D if you know it.</p>
		]]></content>
		<author>
			<name>id</name>
		</author>
	</entry>
	
	
	
	<entry>
		<title>Virtua Transgenderism</title>
		<link rel="alternate" type="text/html" href="http://id.motd.org/pivot/entry.php?id=17" />
		<updated>2009-06-18T10:26:00-00:00</updated>
		<published>2009-06-18T10:26:00-00:00</published>
		<id>tag:idrisse-dribble,2010:Idrisse-dribble.17</id>
		<link rel="related" type="text/html" href=""  />
		<summary type="text">Continuing my voyage in java 3D, I’ve added some interactivity to this applet allowing one to alter the scale of an incredibly crude box-person’s mammaries and genetalia. 

	The boobs can be scaled from invisible, through mere nipples up to bazongas, but if you make them too big they float away and turn into giant spectacles!

	Similarly, the willy can be sized from invisible, to giant clitorus, through to a respectable package. Again, if you make it too big it will get heavy and fall off.</summary>
        <content type="html" xml:lang="en" xml:base="http://id.motd.org/pivot/entry.php?id=17"><![CDATA[
                <p>Continuing my voyage in java 3D, I&#8217;ve added some interactivity to this applet allowing one to alter the scale of an incredibly crude box-person&#8217;s mammaries and genetalia. </p>

	<p>The boobs can be scaled from invisible, through mere nipples up to bazongas, but if you make them too big they float away and turn into giant spectacles!</p>

	<p>Similarly, the willy can be sized from invisible, to giant clitorus, through to a respectable package. Again, if you make it too big it will get heavy and fall off.</p>

	<p><!-- error: You haven't included [[ thickbox:head ]] in your templates. --><p style="text-align:center;"><a href='http://id.motd.org/images/sexflip0.1.png' class="thickbox" title="SexFlip v0.1 Transgenderism Simulator" rel="entry-17" ><img src="http://id.motd.org/images/sexflip0.thumb.png" border="1" alt="SexFlip v0.1 Transgenderism Simulator" title="SexFlip v0.1 Transgenderism Simulator"  class='pivot-popupimage'/></a></p>
	<p>Okay it&#8217;s pretty bizarre, but it wasn&#8217;t my idea. Blame <a href="http://www.bobhobbs.com/">Bob Hobbs</a>. His instructions were:</p>

	<blockquote>
		<p>> I am late for my bum session, where I be a bum. The session is due to last all day.<br />
 <br />
Think again, sparkle.<br />
 <br />
You have until 11:59pm to complete and send to me a J2ME application <span class="caps">JAR</span> file with the following specification:<br />
 <br />
NAME: Mobile SexFlip Pro<br />
DESCRIPTION: The user is presented with a sexy model and has the option to change the model’s sex at will. The user can separately control whether the model has male or female boobs, face, hairdo and front bottom.<br />
 <br />
Begin.</p>
	</blockquote>

	<p>I haven&#8217;t <em>quite</em> met the specifications, but this is only version 0.1! </p>

	<p><applet archive="http://id.chaosnet.org/junk/SexFlip.jar" width="512" height="640" code="BoobEmerge" > You&#8217;ll need Java and Java3D. </applet> </p>

	<p>Again, you will need <a href="http://www.java.com/en/download/">Java</a> and <a href="https://java3d.dev.java.net/binary-builds.html">Java3D</a> for this to work and source code can be found in the <a href="http://id.chaosnet.org/junk/SexFlip.jar">jar</a>.</p>
		]]></content>
		<author>
			<name>id</name>
		</author>
	</entry>
	
	
	
	<entry>
		<title>Beyond XY</title>
		<link rel="alternate" type="text/html" href="http://id.motd.org/pivot/entry.php?id=16" />
		<updated>2009-06-16T17:12:00-00:00</updated>
		<published>2009-06-16T17:12:00-00:00</published>
		<id>tag:idrisse-dribble,2010:Idrisse-dribble.16</id>
		<link rel="related" type="text/html" href=""  />
		<summary type="text">I’ve been playing about with Java3D and have made a little spinning lady with boobs that disappear and re-appear.

	I think there’s a niche for adult 3D mobile phone games just waiting to be exploited. Sadly most content carriers have an Apple flavoured puritanical view of interactive entertainment, and won’t touch erotic games with a Short.MAX_VALUE length bargepole mesh.

	


	This crappy applet (source code contained within jar) marks the beginning of my adventure in 3D programming.</summary>
        <content type="html" xml:lang="en" xml:base="http://id.motd.org/pivot/entry.php?id=16"><![CDATA[
                <p>I&#8217;ve been playing about with Java3D and have made a little spinning lady with boobs that disappear and re-appear.</p>

	<p>I think there&#8217;s a niche for adult 3D mobile phone games just waiting to be exploited. Sadly most content carriers have an Apple flavoured puritanical view of interactive entertainment, and won&#8217;t touch erotic games with a Short.MAX_VALUE length bargepole mesh.</p>

	<p><!-- error: You haven't included [[ thickbox:head ]] in your templates. --><p style="text-align:center;"><a href='http://id.motd.org/images/ladyspin.png' class="thickbox" title="Sketchy spinning Java3D lady" rel="entry-16" ><img src="http://id.motd.org/images/ladyspin.thumb.png" border="1" alt="Sketchy spinning Java3D lady" title="Sketchy spinning Java3D lady"  class='pivot-popupimage'/></a></p>


	<p>This crappy applet (source code contained within <a href="http://id.chaosnet.org/junk/LadySpin.jar">jar</a>) marks the beginning of my adventure in 3D programming.</p>	<p><applet archive="http://id.chaosnet.org/junk/LadySpin.jar" width="512" height="512" code="SpinObject" > < PARAM name="foo" value="bar"> </applet> </p>

	<p>FYI: You will need <a href="http://www.java.com/en/download/">Java</a> and <a href="https://java3d.dev.java.net/binary-builds.html">Java3D</a> for this to work.</p>
		]]></content>
		<author>
			<name>id</name>
		</author>
	</entry>
	
	
	
	<entry>
		<title>Command line arguments in wxWidgets</title>
		<link rel="alternate" type="text/html" href="http://id.motd.org/pivot/entry.php?id=15" />
		<updated>2009-04-04T07:23:00-00:00</updated>
		<published>2009-04-04T07:23:00-00:00</published>
		<id>tag:idrisse-dribble,2010:Idrisse-dribble.15</id>
		<link rel="related" type="text/html" href=""  />
		<summary type="text">The wxCmdLineParser documentation is nice enough, but as is so often the case with programming library docs, they don’t provide any decent examples. 

	We learn by example, so here’s a very short yet fully working program showing how to parse and use command line arguments in your wxWidgets program.</summary>
        <content type="html" xml:lang="en" xml:base="http://id.motd.org/pivot/entry.php?id=15"><![CDATA[
                <p>The <a href="http://docs.wxwidgets.org/2.6/wx_wxcmdlineparser.html#wxcmdlineparsersetdesc">wxCmdLineParser documentation</a> is nice enough, but as is so often the case with programming library docs, they don&#8217;t provide any decent examples. </p>

	<p>We learn by example, so here&#8217;s a very short yet fully working program showing how to parse and use command line arguments in your wxWidgets program.</p><div style="font-size:85%; background-color: #F8F6F6; border-color: #000000; border-style: solid; border-width: 1px;height: 500px;  margin: 0; margin-bottom: 2px; margin-top: 10px; overflow: auto; width: 100%;">
<pre class="c" style="font-family:monospace;"><ol><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #339933;">#include&lt;wx/wx.h&gt;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #339933;">#include&lt;wx/cmdline.h&gt;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #339933;">#include&lt;iostream&gt;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> </div></li><li style="font-weight: bold; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">using namespace std<span style="color: #339933;">;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> </div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">class cmd <span style="color: #339933;">:</span> public wxApp <span style="color: #009900;">&#123;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> </div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> <span style="color: #993333;">void</span> processArgs<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span></div></li><li style="font-weight: bold; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> </div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">  wxCmdLineEntryDesc cmdLineDesc<span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #009900;">&#123;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> </div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">   <span style="color: #009900;">&#123;</span>wxCMD_LINE_OPTION<span style="color: #339933;">,</span> </div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">     wxT<span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;f&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> </div></li><li style="font-weight: bold; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">     wxT<span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;foo&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> </div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">     wxT<span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;Foo factor desired&quot;</span><span style="color: #009900;">&#41;</span> </div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">   <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> </div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">   <span style="color: #009900;">&#123;</span>wxCMD_LINE_PARAM<span style="color: #339933;">,</span>  </div></li><li style="font-weight: bold; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">     NULL<span style="color: #339933;">,</span> </div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">     NULL<span style="color: #339933;">,</span> </div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">     wxT<span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;Files to grault&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">     wxCMD_LINE_VAL_STRING<span style="color: #339933;">,</span> </div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">     wxCMD_LINE_PARAM_MULTIPLE</div></li><li style="font-weight: bold; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">   <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> </div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">   <span style="color: #009900;">&#123;</span>wxCMD_LINE_SWITCH<span style="color: #339933;">,</span> wxT<span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;z&quot;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> </div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">   <span style="color: #009900;">&#123;</span>wxCMD_LINE_NONE<span style="color: #009900;">&#125;</span></div></li><li style="font-weight: bold; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">  <span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> </div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">  wxCmdLineParser parser <span style="color: #009900;">&#40;</span>cmdLineDesc<span style="color: #339933;">,</span> argc<span style="color: #339933;">,</span> argv<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">  parser.<span style="color: #202020;">Parse</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> </div></li><li style="font-weight: bold; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">  <span style="color: #666666; font-style: italic;">// That&#8217;s it! Now do stuff with the args:</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> </div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">  <a href="http://www.opengroup.org/onlinepubs/009695399/functions/cout.html"><span style="color: #000066;">cout</span></a> <span style="color: #339933;">&lt;&lt;</span> endl <span style="color: #339933;">&lt;&lt;</span> <span style="color: #ff0000;">&quot;Number of params: &quot;</span> <span style="color: #339933;">&lt;&lt;</span> parser.<span style="color: #202020;">GetParamCount</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&lt;&lt;</span> endl<span style="color: #339933;">;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">  <a href="http://www.opengroup.org/onlinepubs/009695399/functions/cout.html"><span style="color: #000066;">cout</span></a> <span style="color: #339933;">&lt;&lt;</span> <span style="color: #ff0000;">&quot;Param 1: &quot;</span> <span style="color: #339933;">&lt;&lt;</span> parser.<span style="color: #202020;">GetParam</span><span style="color: #009900;">&#40;</span><span style="color: #0000dd;">0</span><span style="color: #009900;">&#41;</span>.<span style="color: #202020;">mb_str</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&lt;&lt;</span> endl<span style="color: #339933;">;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">  <a href="http://www.opengroup.org/onlinepubs/009695399/functions/cout.html"><span style="color: #000066;">cout</span></a> <span style="color: #339933;">&lt;&lt;</span> <span style="color: #ff0000;">&quot;Param 2: &quot;</span> <span style="color: #339933;">&lt;&lt;</span> parser.<span style="color: #202020;">GetParam</span><span style="color: #009900;">&#40;</span><span style="color: #0000dd;">1</span><span style="color: #009900;">&#41;</span>.<span style="color: #202020;">mb_str</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&lt;&lt;</span> endl<span style="color: #339933;">;</span></div></li><li style="font-weight: bold; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">  <a href="http://www.opengroup.org/onlinepubs/009695399/functions/cout.html"><span style="color: #000066;">cout</span></a> <span style="color: #339933;">&lt;&lt;</span> <span style="color: #ff0000;">&quot;Param 3: &quot;</span> <span style="color: #339933;">&lt;&lt;</span> parser.<span style="color: #202020;">GetParam</span><span style="color: #009900;">&#40;</span><span style="color: #0000dd;">2</span><span style="color: #009900;">&#41;</span>.<span style="color: #202020;">mb_str</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&lt;&lt;</span> endl<span style="color: #339933;">;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">  wxString optf<span style="color: #339933;">;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">  parser.<span style="color: #202020;">Found</span><span style="color: #009900;">&#40;</span> wxT<span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;f&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #339933;">&amp;</span>optf<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">  <a href="http://www.opengroup.org/onlinepubs/009695399/functions/cout.html"><span style="color: #000066;">cout</span></a> <span style="color: #339933;">&lt;&lt;</span> <span style="color: #ff0000;">&quot;Option f: &quot;</span> <span style="color: #339933;">&lt;&lt;</span> optf.<span style="color: #202020;">mb_str</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&lt;&lt;</span> endl<span style="color: #339933;">;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">  <a href="http://www.opengroup.org/onlinepubs/009695399/functions/cout.html"><span style="color: #000066;">cout</span></a> <span style="color: #339933;">&lt;&lt;</span> <span style="color: #ff0000;">&quot;Option z? &quot;</span> <span style="color: #339933;">&lt;&lt;</span> parser.<span style="color: #202020;">Found</span><span style="color: #009900;">&#40;</span> wxT<span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;z&quot;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span> <span style="color: #339933;">&lt;&lt;</span> endl<span style="color: #339933;">;</span></div></li><li style="font-weight: bold; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> </div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> <span style="color: #009900;">&#125;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> </div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> bool OnInit<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">  processArgs<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></div></li><li style="font-weight: bold; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> </div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">  exit<span style="color: #009900;">&#40;</span><span style="color: #0000dd;">0</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> <span style="color: #009900;">&#125;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> </div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span></div></li><li style="font-weight: bold; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> </div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">IMPLEMENT_APP<span style="color: #009900;">&#40;</span>cmd<span style="color: #009900;">&#41;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> </div></li></ol></pre>
</div>

	<p>The &#8220;eek&#8220;iest looking part of that is the construction of the wxCmdLineEntryDesc array which spans lines 11 to 30.</p>

	<p>This is just an array of wxCmdLineEntryDesc structs, each of which specifies some description of a command line option. For example:</p>

	<p><code>{wxCMD_LINE_SWITCH, wxT(&#34;z&#34;) }</code></p>

	<p>is the simplest of these: it states that a &#8216;z&#8217; switch can be specified when running the program.</p>

	<p><code>
{wxCMD_LINE_OPTION,
  wxT(&#34;f&#34;),
  wxT(&#34;foo&#34;),
  wxT(&#34;Foo factor desired&#34;)
}</code></p>

	<p>specifies that an option -f, which can also be written &#8212;foo, takes an argument.</p>

	<p>The other array on lines 19 to 25 specifies command line parameters &#8211; these are any remaining arguments which don&#8217;t have switches before them, usually things like filenames. </p>

	<p>Most of the options in these structs can be omitted by placing a <span class="caps">NULL</span> instead.</p>

	<p> </p>

	<p>The clever thing about the parser is that it will construct a complete &#8220;usage&#8221; message for your program, simply from the description you provide in these arrays. E.g, if I just run the above program, it automatically constructs the message:</p>

	<blockquote>
		<p><pre>id@betty:~/tmp/wx/cmd&#62; ./cmd
Usage: cmd [-f &#60;str&#62;] [-z] Files to grault...
  -f, --foo=&#60;str&#62;	Foo factor desired
  -z             	
The required parameter &#39;Files to grault&#39; was not specified.</pre></p>
	</blockquote>

	<p> <br />
If I provide some arguments, the following output occurs:</p>

	<blockquote>
		<p><pre>id@betty:~/tmp/wx/cmd&#62; ./cmd -f severe -z text.txt words.txt clogs.txt
 
Number of params: 3
Param 1: text.txt
Param 2: words.txt
Param 3: clogs.txt
Option f: severe
Option z? 1
</pre></p>
	</blockquote>

	<p> </p>

	<p>The simplest possible example is below:</p>

<div style="font-size:85%; background-color: #F8F6F6; border-color: #000000; border-style: solid; border-width: 1px;height: px;  margin: 0; margin-bottom: 2px; margin-top: 10px; overflow: auto; width: 100%;">
<pre class="c" style="font-family:monospace;"><ol><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #339933;">#include&lt;wx/wx.h&gt;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #339933;">#include&lt;wx/cmdline.h&gt;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #339933;">#include&lt;iostream&gt;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> </div></li><li style="font-weight: bold; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">using namespace std<span style="color: #339933;">;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> </div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">class cmd <span style="color: #339933;">:</span> public wxApp <span style="color: #009900;">&#123;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> </div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> bool OnInit<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span></div></li><li style="font-weight: bold; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">  wxCmdLineEntryDesc desc<span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #009900;">&#123;</span> <span style="color: #009900;">&#123;</span>wxCMD_LINE_OPTION<span style="color: #339933;">,</span> wxT<span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;f&quot;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#125;</span> <span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">  wxCmdLineParser parser <span style="color: #009900;">&#40;</span>desc<span style="color: #339933;">,</span> argc<span style="color: #339933;">,</span> argv<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">  parser.<span style="color: #202020;">Parse</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> </div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">  wxString optf<span style="color: #339933;">;</span></div></li><li style="font-weight: bold; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">  parser.<span style="color: #202020;">Found</span><span style="color: #009900;">&#40;</span> wxT<span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;f&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #339933;">&amp;</span>optf<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">  <a href="http://www.opengroup.org/onlinepubs/009695399/functions/cout.html"><span style="color: #000066;">cout</span></a> <span style="color: #339933;">&lt;&lt;</span> optf.<span style="color: #202020;">mb_str</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&lt;&lt;</span> endl<span style="color: #339933;">;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">  exit<span style="color: #009900;">&#40;</span><span style="color: #0000dd;">0</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> <span style="color: #009900;">&#125;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> </div></li><li style="font-weight: bold; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> </div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">IMPLEMENT_APP<span style="color: #009900;">&#40;</span>cmd<span style="color: #009900;">&#41;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> </div></li></ol></pre>
</div>

	<p>This is compiled with:</p>

	<blockquote>
		<p><pre>g++ simplecmd.cpp `wx-config --cflags --libs` -o simple</pre></p>
	</blockquote>

	<p> </p>

	<p>More info can be found in <a href="http://docs.wxwidgets.org/2.6/wx_wxcmdlineparser.html">the docs</a>, but do note that if you&#8217;re going to be using the wxString with conventional C++ / stdlib, you&#8217;ll have to use the mb_str() method as I have done above, otherwise you&#8217;ll only get the first char of the string. More info on converting to and from wxStrings is in the wxWidgets <a href="http://wiki.wxwidgets.org/Converting_everything_to_and_from_wxString#wxString_to_char.2A">wiki</a>.</p>
		]]></content>
		<author>
			<name>id</name>
		</author>
	</entry>
	
	
	
	<entry>
		<title>Bash programming pitfalls &amp; solutions</title>
		<link rel="alternate" type="text/html" href="http://id.motd.org/pivot/entry.php?id=14" />
		<updated>2009-04-04T02:09:00-00:00</updated>
		<published>2009-04-04T02:09:00-00:00</published>
		<id>tag:idrisse-dribble,2010:Idrisse-dribble.14</id>
		<link rel="related" type="text/html" href=""  />
		<summary type="text">Direct link</summary>
        <content type="html" xml:lang="en" xml:base="http://id.motd.org/pivot/entry.php?id=14"><![CDATA[
                <p><a href="http://wooledge.org:8000/BashPitfalls">Direct link</a></p>
		]]></content>
		<author>
			<name>id</name>
		</author>
	</entry>
	
	
	
	<entry>
		<title>ALGEBRAIC! Adventure time</title>
		<link rel="alternate" type="text/html" href="http://id.motd.org/pivot/entry.php?id=13" />
		<updated>2009-04-02T21:02:00-00:00</updated>
		<published>2009-04-02T21:02:00-00:00</published>
		<id>tag:idrisse-dribble,2010:Idrisse-dribble.13</id>
		<link rel="related" type="text/html" href=""  />
		<summary type="text">Direct link</summary>
        <content type="html" xml:lang="en" xml:base="http://id.motd.org/pivot/entry.php?id=13"><![CDATA[
                <p><a href="http://www.youtube.com/watch?v=LNVYWJOEy9A">Direct link</a></p>
		]]></content>
		<author>
			<name>id</name>
		</author>
	</entry>
	
	
	
</feed>
