<?xml version="1.0" encoding="utf-8"?>
        <?xml-stylesheet type="text/css" href="http://mackdanz.net/"?>
<rss version="2.0"
 xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
 xmlns:dc="http://purl.org/dc/elements/1.1/"
 xmlns:admin="http://webns.net/mvcb/"
 xmlns:atom="http://www.w3.org/2005/Atom"
>
<channel>
<title>commit --amend</title>
<atom:link href="http://mackdanz.net/rss.xml" rel="self" type="application/rss+xml" />
<link>http://mackdanz.net</link>
<description>Erik Mackdanz's onanisms about software, etc.</description>
<dc:language>en-us</dc:language>
<dc:creator>Erik</dc:creator>
<dc:date>2009-01-04T18:59:39-06:00</dc:date>
<admin:generatorAgent rdf:resource="http://nanoblogger.sourceforge.net" />

<item>
<link>http://mackdanz.net/archives/2009/01/index.html#e2009-01-04T18_53_50.txt</link>
<guid isPermaLink="true">http://mackdanz.net/archives/2009/01/index.html#e2009-01-04T18_53_50.txt</guid>
<title>An advanced cryptanalysis problem</title>
<dc:date>2009-01-04T18:53:50-06:00</dc:date>
<dc:creator>Erik</dc:creator>

<description><![CDATA[<p>Can you break the code of the JC Penney gift receipt?  One digit isn't
represented below - can you deduce its encoded value anyway?  Select the
contents of the box below (drag over it) for the answer.</p>

<p style="border:solid 1px #000; color:#fff">
1=Q, 2=W, 3=E (probably - look at your keyboard), 4=R, 5=T, 6=Y, 7=U, 8=I,
9=O, 0=P
</p>

<p><img src="images/rcptOne.png"></p>
<p><img src="images/rcptTwo.png"></p>
<p><img src="images/rcptThree.png"></p>]]></description>

</item>
<item>
<link>http://mackdanz.net/archives/2008/12/index.html#e2008-12-20T09_27_26.txt</link>
<guid isPermaLink="true">http://mackdanz.net/archives/2008/12/index.html#e2008-12-20T09_27_26.txt</guid>
<title>Do users matter?</title>
<dc:date>2008-12-20T09:27:26-06:00</dc:date>
<dc:creator>Erik</dc:creator>

<description><![CDATA[<p>The title is facetious, but it got your attention, no?</p>

<p>My day job is in a hard-core Windows shop.  How hard-core?  A visiting exec recently told
us in a meeting that once chaired a committee whose purpose was to "advance
the spread of Microsoft technologies throughout the enterprise".</p>

<p>Yesterday the consequences of this culture were set in sharp relief by this
conversation.  For context, SSIS is a technology used mostly for loading flat
files into databases, and it's meant to be a replacement for the older DTS
platform.</p>

<blockquote>
<p>Erik:  Hey, Lydia, can you help me with this SSIS error?</p>

<p>Lydia:  Maybe.  I've played with SSIS, but usually I'm in a hurry so I bust
out a DTS package instead.</p>

<p>Erik:  I feel better to hear you say that.  Everytime I change an SSIS package, it
takes hours and hours.  It's so over-engineered.  I think Shane originally
pushed for us to use this instead of, say, a BULK INSERT.</p>

<p>Lydia:  Oh no, Shane wouldn't have done that.  The last time I mentioned using
SSIS, the whole team (and Shane) told me not to go there [stop-sign hand
gesture], that we don't need the complexity.</p>

<p>Erik:  I see.  Well, if I can't get around this error, could I convert this to
DTS or a BULK INSERT?</p>

<p>Lydia:  If we have to, we can.  But really, we <em>should</em> be using SSIS.
Eventually, DTS will be retired, so we <em>should</em> use SSIS instead.  Use
SSIS if at all possible...</p>
</blockquote>

<p>See how that works?  We have a proven technology that we like and can work
in very quickly.  But the vendor is taking it away, so we really
<em>should</em> use the over-engineered, non-productive solution, since
eventually we'll have no choice.</p>

<p>As the token Linux guy in the office, I get pigeon-holed as a
Microsoft-hater.  I'm not, really, but that's the stereotype.  Exchanges like
this, though, hardly make me
want to "advance the spread of Microsoft technologies".</p>]]></description>

</item>
<item>
<link>http://mackdanz.net/archives/2008/12/index.html#e2008-12-14T20_59_21.txt</link>
<guid isPermaLink="true">http://mackdanz.net/archives/2008/12/index.html#e2008-12-14T20_59_21.txt</guid>
<title>Comprehensive source backup</title>
<dc:date>2008-12-14T20:59:21-06:00</dc:date>
<dc:creator>Erik</dc:creator>

<description><![CDATA[<p>I've wanted a way to back up all my projects to offsite storage in the
laziest way possible.  Here's the function in, you guessed it, my .bashrc:</p>

<div style="background-color: rgb(0, 0, 0); color: rgb(255, 255, 255);">
<font color="#ffff00"><b>&nbsp;1 </b></font><font color="#00ffff"><b># Back up all repos off site</b></font><br>
<font color="#ffff00"><b>&nbsp;2 </b></font>function bak {<br>
<font color="#ffff00"><b>&nbsp;3 </b></font>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="#00ffff"><b># mount my project partition</b></font><br>
<font color="#ffff00"><b>&nbsp;4 </b></font>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;m1<br>
<font color="#ffff00"><b>&nbsp;5 </b></font><br>
<font color="#ffff00"><b>&nbsp;6 </b></font>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="#00ffff"><b># Find and iterate all git repos</b></font><br>
<font color="#ffff00"><b>&nbsp;7 </b></font>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;sudo find /* -type d -name <font color="#ff40ff"><b>&quot;.git&quot;</b></font>&nbsp;|<br>
<font color="#ffff00"><b>&nbsp;8 </b></font>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;while read repo; do<br>
<font color="#ffff00"><b>&nbsp;9 </b></font><br>
<font color="#ffff00"><b>10 </b></font>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="#00ffff"><b># Ignore these repos</b></font><br>
<font color="#ffff00"><b>11 </b></font>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[ $repo == <font color="#ff40ff"><b>&quot;/home/erik/tests/ffExtOne/.git&quot;</b></font>&nbsp;] &amp;&amp; continue<br>
<font color="#ffff00"><b>12 </b></font>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[ $repo == <font color="#ff40ff"><b>&quot;/home/erik/tests/ffExtTwo/ext/.git&quot;</b></font>&nbsp;] &amp;&amp; continue<br>
<font color="#ffff00"><b>13 </b></font>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[ $repo == <font color="#ff40ff"><b>&quot;/home/erik/tests/glibOne/.git&quot;</b></font>&nbsp;] &amp;&amp; continue<br>
<font color="#ffff00"><b>14 </b></font>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[ $repo == <font color="#ff40ff"><b>&quot;/home/erik/djangosites/yystclair/.git&quot;</b></font>&nbsp;] &amp;&amp; continue<br>
<font color="#ffff00"><b>15 </b></font>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[ $repo == <font color="#ff40ff"><b>&quot;/mnt/hda1/devel/projects/gnc/repo/.git&quot;</b></font>&nbsp;] &amp;&amp; continue<br>
<font color="#ffff00"><b>16 </b></font>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[ $repo == <font color="#ff40ff"><b>&quot;/mnt/hda1/devel/gitSandbox/.git&quot;</b></font>&nbsp;] &amp;&amp; continue<br>
<font color="#ffff00"><b>17 </b></font>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[ $repo == <font color="#ff40ff"><b>&quot;/mnt/hda1/devel/gitSandbox/ignoreTest/.git&quot;</b></font>&nbsp;] &amp;&amp; continue<br>
<font color="#ffff00"><b>18 </b></font><br>
<font color="#ffff00"><b>19 </b></font>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="#00ffff"><b># Send repo to remote server</b></font><br>
<font color="#ffff00"><b>20
</b></font>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;sudo
rsync --verbose --stats --compress --relative --progress --recursive --times
--delete $repo rsync://xxx.net/MyRsyncHomeForSource<br>
<font color="#ffff00"><b>21 </b></font>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;done<br>
<font color="#ffff00"><b>22 </b></font>}<br>
</div>

<p>It works by scanning the entire filesystem for .git directories, and
<code>rsync</code>'ing them to my offsite location.  By using the
<code>--relative</code> flag, the full paths are copied under a single remote
rsync location, instead of just .git (which would collide with prior .git's).
The full path is enough to remind me what's in each repository.</p>

<p>When I create a new repo for a project, I don't have to take a single extra
step to make sure it's part of the source backup.  I can optionally specify repos to
ignore, but the function errs on the side of inclusion.</p>

<p>It took about 20 minutes to run the first time.  Since subsequent backups
will be diffs, it will be faster in the future.  Using <code>locate</code>
instead of <code>find</code> could speed up the process, as long as I was sure
to <code>updatedb</code> prior to pushing to make sure that any brand-new
repos were included.</p>]]></description>

</item>
<item>
<link>http://mackdanz.net/archives/2008/11/index.html#e2008-11-23T23_17_14.txt</link>
<guid isPermaLink="true">http://mackdanz.net/archives/2008/11/index.html#e2008-11-23T23_17_14.txt</guid>
<title>The mysteries of GLib</title>
<dc:date>2008-11-23T23:17:14-06:00</dc:date>
<dc:creator>Erik</dc:creator>

<description><![CDATA[<p>The more I explore GLib, the more difficulty I have with its design
choices.  I'll certainly find GLib useful, and I'm not dismissing it, but some
promises have not been fulfilled.</p>

<h3>The not-so-quiet main loop</h3>
<p>GLib provides an interesting main loop feature, which allows your programs
(console, daemon, not just UI) to be event-driven instead of procedural.  What
seems limiting is that only file descriptors can be event sources.  Everyone
knows that in Unix, everything is a file, right?  So, why would you want an
event source that's not a file descriptor?  Oh, maybe because I'd like to
declare events in the "user space" of my program, and not solely on low-level
IO events.</p>

<p>The rationale given is that the Unix <code>poll()</code> function is the
heart of the main loop.  By using poll, the call is supposed to block until an
interesting event occurs, sparing your CPU the incessant fast loop cycles.
The only problem is, poll() doesn't work that way.  Even the Unix man page
seems confused about what the <code>POLLIN</code> flag means.</p>

<blockquote>
POLLIN   There is data to read.
</blockquote>

<p>The behavior of poll() with POLLIN, however, is that it returns immediately
with a POLLIN revent even when there is no data to read.  That's because
POLLIN really means "calling read() now won't block because the device is
ready".  POLLIN does not mean that there is data to read.  This means your
GLib app's <code>check()</code> must also call read() on every iteration to
discern if there is actually data to read.  It also means the CPU-saving
long-blocking-until-an-event is actually a tight, wasteful quick-spinning
loop.  Maybe I should just put blocking read()s into dedicated threads.</p>

<h3>Abstracting the wrong thing</h3>

<p>So, since GLib is cross-platform, it abstracts away the platform-specific
code, right?  Not so with sockets.  While a GIOChannel provides wrappers to do
things like read a line from a file descriptor, there is no method given to
create the file descriptor in the first place.  So, to use sockets, I still
need the #ifdef's for Windows-vs-Unix that I would write if I wasn't using a
portability library.</p>

<p>The funny thing is, reading a line from a socket file descriptor (using
<code>recv()</code>) is already the same on Windows/Unix.  The priority seems
to have been on making common interfaces for all file descriptors
(files/sockets/pipes) instead of making common interfaces for the OS's in
question (Windows/Unix).</p>

<h3>One last thing...</h3>
<p>GTK's combo boxes are oogly.  Shoot, they're weird on Linux.  There's no
effort to use a native widget in Windows, and I'm sure on a Mac it looks even
less native.  Am I missing something here?  Is there something special about
MFC's licensing that forbids creating a GTK wrapper and requires a total
re-write?  It seems petty, and it's not a GLib-specific issue, but it could be
a enough to make me look at a different library for cross-platform UI
development.</p>

<h3>In conclusion</h3>
<p>Again, GLib appears great and I'm sure I'll use it.  You get regex, a
lexical scanner, and plenty of collection types.  I just hope that when I
explore those corners I won't encounter so many gotchas.</p>]]></description>

</item>
<item>
<link>http://mackdanz.net/archives/2008/11/index.html#e2008-11-16T13_38_09.txt</link>
<guid isPermaLink="true">http://mackdanz.net/archives/2008/11/index.html#e2008-11-16T13_38_09.txt</guid>
<title>IRC done right with ii</title>
<dc:date>2008-11-16T13:38:09-06:00</dc:date>
<dc:creator>Erik</dc:creator>

<description><![CDATA[<p>IRC is a guilty pleasure.  Logically, I know I've never gotten any value
out of it.  It's largely vacuous chat.  Hanging out on ##c on freenode, any
reasonable lurkers like myself are mesmerized by the comedy of people who are a)
students trying to get homework "help" or b) embittered veterans who enjoy helping
people like Nurse Ratchet enjoys helping her patients.</p>

<p>Nonetheless, I can't stay away.  I guess I like the activity clicking down
my screen every few seconds - I feel important and connected (don't think
about that too hard).</p>

<p><a href="http://www.suckless.org/programs/ii.html" target="_blank">ii</a> 
is the only IRC client that has made sense to me.  Rather
than try to wrap the protocol into a custom interface with a custom scripting
setup, <code>ii</code> gives you the protocol as a filesystem, and lets you
define your own interface & pluggability through standard tools or shell
capabilities.  And at &lt; 500 lines of dependency-free code, it's light as a
feather.</p>

<p><a href="/images/ii.png"><img src="/images/ii.png" width="375" height="260"></a></p>

<p>So, how to use <code>ii</code> effectively?  You guessed it, I have a shell
function!  The function sends the output of one channel to the console,
formatted my way (= no presence messages or timestamps).  <code>screen</code>
is used to set up multiple windows.</p>

<p>Sending a message requires
<code>echo</code>'ing to a flat file, but since I'm a lurker it's fine with me
if it's hard to accidentally spam a channel when I think a different window is
focused (a sadly common thing in a tiling window manager).</p>

<p>Here's the shell function from my .bashrc</p>

<div style="background-color:#000;color:#fff">
<font color="#00ffff"><b># Usage: jn \#\#c&nbsp;&nbsp;-- or -- jn \#\#c irc.freenode.net</b></font><br>
<font color="#00ffff"><b># First form defaults to irc.freenode.net</b></font><br>
<br>
<font color="#00ffff"><b>function</b></font>&nbsp;<font color="#00ffff"><b>jn {</b></font><br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="#00ffff"><b>IRCNAME</b></font>=aurous<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="#00ffff"><b># init</b></font><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="#00ffff"><b>IRC_HOST</b></font>=irc.freenode.net<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="#ffff00"><b>if </b></font><font color="#ffff00"><b>[</b></font>&nbsp;<font color="#8080ff"><b>$2</b></font>&nbsp;<font color="#ffff00"><b>]</b></font><font color="#ffff00"><b>;</b></font>&nbsp;<font color="#ffff00"><b>then</b></font><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="#00ffff"><b>IRC_HOST</b></font>=<font color="#8080ff"><b>$2</b></font><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="#ffff00"><b>fi</b></font><br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="#00ffff"><b>SERVER_ROOT</b></font>=~/irc/<font color="#8080ff"><b>$IRC_HOST</b></font><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="#00ffff"><b>CHANNEL_ROOT</b></font>=<font color="#8080ff"><b>$SERVER_ROOT</b></font>/<font color="#8080ff"><b>$1</b></font><br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="#00ffff"><b># Truncate old irc log to last few lines</b></font><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="#ffff00"><b>if </b></font><font color="#ffff00"><b>[</b></font>&nbsp;<font color="#ffff00"><b>-f</b></font>&nbsp;<font color="#8080ff"><b>$CHANNEL_ROOT</b></font>/out <font color="#ffff00"><b>]</b></font><font color="#ffff00"><b>;</b></font>&nbsp;<font color="#ffff00"><b>then</b></font><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="#ffff00"><b>tail</b></font>&nbsp;<font color="#ffff00"><b>-n</b></font>&nbsp;<font color="#ff40ff"><b>1000</b></font>&nbsp;<font color="#8080ff"><b>$CHANNEL_ROOT</b></font>/out <font color="#ffff00"><b>&gt;</b></font>&nbsp;<font color="#8080ff"><b>$CHANNEL_ROOT</b></font>/outnew<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="#ffff00"><b>rm</b></font>&nbsp;<font color="#8080ff"><b>$CHANNEL_ROOT</b></font>/out<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="#ffff00"><b>mv</b></font>&nbsp;<font color="#8080ff"><b>$CHANNEL_ROOT</b></font>/outnew <font color="#8080ff"><b>$CHANNEL_ROOT</b></font>/out<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="#ffff00"><b>fi</b></font><br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="#00ffff"><b># Start ii for this server if not running</b></font><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="#00ffff"><b>#if&nbsp;&nbsp; ! ( ii procs&nbsp;&nbsp; get command-line&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;started with same server</b></font><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if<font color="#ffff00"><b>(</b></font>&nbsp;<font color="#ffff00"><b>[</b></font>&nbsp;<font color="#ffff00"><b>!</b></font>&nbsp;<font color="#ffff00"><b>&quot;</b></font><font color="#ff6060"><b>`pgrep ii </b></font><font color="#ffff00"><b>|</b></font><font color="#ff6060"><b>&nbsp;</b></font><font color="#ffff00"><b>xargs</b></font><font color="#ff6060"><b>&nbsp;-I xxx </b></font><font color="#ffff00"><b>echo</b></font><font color="#ff6060"><b>&nbsp;/proc/xxx/cmdline </b></font><font color="#ffff00"><b>|</b></font><font color="#ff6060"><b>&nbsp;</b></font><font color="#ffff00"><b>xargs</b></font><font color="#ff6060"><b>&nbsp;-I xxx </b></font><font color="#ffff00"><b>grep</b></font><font color="#ff6060"><b>&nbsp;</b></font><font color="#8080ff"><b>$IRC_HOST</b></font><font color="#ff6060"><b>&nbsp;xxx`</b></font><font color="#ffff00"><b>&quot;</b></font>&nbsp;<font color="#ffff00"><b>]</b></font>&nbsp;<font color="#ffff00"><b>)</b></font><font color="#ffff00"><b>;</b></font>&nbsp;then <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ii -n <font color="#8080ff"><b>$IRCNAME</b></font>&nbsp;-s <font color="#8080ff"><b>$IRC_HOST</b></font>&nbsp;<font color="#ffff00"><b>&amp;</b></font><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="#ffff00"><b>sleep</b></font>&nbsp;<font color="#ff40ff"><b>1</b></font><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;fi<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="#00ffff"><b># Join the channel</b></font><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="#ffff00"><b>echo</b></font>&nbsp;<font color="#ffff00"><b>&quot;</b></font><font color="#ff40ff"><b>/j </b></font><font color="#8080ff"><b>$1</b></font><font color="#ffff00"><b>&quot;</b></font>&nbsp;<font color="#ffff00"><b>&gt;</b></font>&nbsp;<font color="#8080ff"><b>$SERVER_ROOT</b></font>/in<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="#ffff00"><b>sleep</b></font>&nbsp;<font color="#ff40ff"><b>1</b></font><br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="#00ffff"><b># Check that we're connected to the channel</b></font><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="#ffff00"><b>if </b></font><font color="#ffff00"><b>[</b></font>&nbsp;<font color="#ffff00"><b>-f</b></font>&nbsp;<font color="#8080ff"><b>$CHANNEL_ROOT</b></font>/out <font color="#ffff00"><b>]</b></font><font color="#ffff00"><b>;</b></font>&nbsp;<font color="#ffff00"><b>then</b></font><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="#00ffff"><b># tail</b></font><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="#ffff00"><b>tail</b></font>&nbsp;<font color="#ffff00"><b>-f</b></font>&nbsp;<font color="#8080ff"><b>$CHANNEL_ROOT</b></font>/out <font color="#ffff00"><b>|</b></font>&nbsp;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="#ffff00"><b>while </b></font><font color="#ffff00"><b>read</b></font><font color="#ffff00"><b>&nbsp;</b></font><font color="#ffff00"><b>ln</b></font><font color="#ffff00"><b>;</b></font><font color="#ffff00"><b>&nbsp;</b></font><font color="#ffff00"><b>do</b></font>&nbsp;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="#00ffff"><b>#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;strip presence lns&nbsp;&nbsp; strip date/time stamp&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; let grep hilite nicks</b></font><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="#ffff00"><b>echo</b></font>&nbsp;<font color="#8080ff"><b>$ln</b></font>&nbsp;<font color="#ffff00"><b>|</b></font>&nbsp;<font color="#ffff00"><b>grep</b></font>&nbsp;<font color="#ffff00"><b>-v</b></font>&nbsp;<font color="#ffff00"><b>&quot;</b></font><font color="#ff40ff"><b>\-\!\-</b></font><font color="#ffff00"><b>&quot;</b></font>&nbsp;<font color="#ffff00"><b>|</b></font>&nbsp;<font color="#ffff00"><b>sed</b></font>&nbsp;<font color="#ffff00"><b>-e</b></font>&nbsp;<font color="#ffff00"><b>'</b></font><font color="#ff40ff"><b>s/^.................//</b></font><font color="#ffff00"><b>'</b></font>&nbsp;<font color="#ffff00"><b>|</b></font>&nbsp;<font color="#ffff00"><b>grep</b></font>&nbsp;<font color="#ffff00"><b>&quot;</b></font><font color="#ff40ff"><b>&lt;</b></font><font color="#ff6060"><b>\(</b></font><font color="#ff40ff"><b>.*</b></font><font color="#ff6060"><b>\)</b></font><font color="#ff40ff"><b>&gt;</b></font><font color="#ffff00"><b>&quot;</b></font><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="#ffff00"><b>done</b></font><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="#ffff00"><b>else</b></font><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="#ffff00"><b>echo</b></font>&nbsp;Failure, couldnt <font color="#ffff00"><b>read</b></font>&nbsp;<font color="#8080ff"><b>$CHANNEL_ROOT</b></font>/out, probably no such channel<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="#ffff00"><b>fi</b></font><br>
<font color="#00ffff"><b>}</b></font><br>
<br>
</font>
</div>]]></description>

</item>
<item>
<link>http://mackdanz.net/archives/2008/11/index.html#e2008-11-09T21_34_37.txt</link>
<guid isPermaLink="true">http://mackdanz.net/archives/2008/11/index.html#e2008-11-09T21_34_37.txt</guid>
<title>Handing over the keys</title>
<dc:date>2008-11-09T21:34:37-06:00</dc:date>
<dc:creator>Erik</dc:creator>

<description><![CDATA[<p>A couple of years ago I was nuts about <a href="http://www.dotnetnuke.com"
target="_blank">DotNetNuke</a>.  I followed the releases, learned all the
little corners of it, and even wrote a <a href="http://auro.us"
target="_blank">to-do app for sale</a>.  Now, everything's changed.  I don't
even have Windows readily accessible, let alone the development tools that
make hacking on DotNetNuke fun.  This is fine with me - after tasting <a
href="http://www.djangoproject.com" target="_blank">Django</a>,
I know now how elegant web framworks can be.</p>

<p>I've been committed to DotNetNuke, though, since I did a DNN brochure site
for a friend who makes and sells high-end purses.  I've hung onto some crappy
shared DNN hosting, and secretly hoped that Meg wouldn't ask for anything too
complicated.  Raw deal for Meg and me both.</p>

<p>So, my weekend project was to move her site from DNN into Django.  This has
several advantages:</p>
<ul>
<li>No database (with Django, you add the DB when you need it)
<li>Much simpler maintenance.
<li>An interesting technology
<li>Sensible URL's
<li>A <code>wget</code> will pull a working static site
</ul>

<h2>Wget it?</h2>

<p>Let me elaborate on that last point.  Meg and I are considering "handing
the keys" of the site over to another guy, for reasons entirely unrelated to
technology.  How do you do that?</p>

<p>It's certainly not right to just give the new developer, a stranger, your
DNN credentials and say "Have fun" (and anyway, this wouldn't relieve me of my
DNN hosting).  It's slightly less cruel to do this with a Django site.  
Alternatively, I may convert the Django extract into PHP, the
lowest common denominator.  I'm
starting to think that the humane thing to do is to zip up a static web site,
and let them set up the templating in their favorite technology (and hosted
elsewhere).  </p>

<p>Which brings me to a flaw in DotNetNuke: You can't do this.  You can't
<code>wget</code> a site and expect to navigate through the returned content
and have the same experience as navigating in the original site.  DNN uses
redirects and has a complicated URL scheme.</p>

<p>Django, which makes URL design a first-class business process, makes your
site easy to <code>wget</code>.</p>

<h2>The lesson</h2>
<p>There's a moral in here, and I'm still trying to put my finger on it.
Candidates:
<ul>
<li>Don't use convoluted web frameworks with required databases and crusty,
redirecting URL schemes.
<li>Use only the most popular technologies.
<li>Design for transfer - use any technology that makes <code>wget</code>'ing
the site into raw HTML easy.
</ul>

<p>Unfortunately, the world of web development is so diverse in terms of both
framework selection and the talent/experience pool, that it's very difficult to make a site that's easy to
transfer to a new guy with an unknown skill set.</p>

<p>Have you had an experience like this?  What did you do to resolve it?  What lesson did you draw from
it?</p>]]></description>

</item>
<item>
<link>http://mackdanz.net/archives/2008/11/index.html#e2008-11-03T22_06_03.txt</link>
<guid isPermaLink="true">http://mackdanz.net/archives/2008/11/index.html#e2008-11-03T22_06_03.txt</guid>
<title>The latest web development stack</title>
<dc:date>2008-11-03T22:06:03-06:00</dc:date>
<dc:creator>Erik</dc:creator>

<description><![CDATA[<p>I've been using a new web development stack</p>
<a href="/images/screen.gif"><img src="/images/screenThumb.gif"></a>
<ul>For web technologies:
<li><a href="http://www.djangoproject.com/">Django</a> - A nice framework.
After some work, I've learned how to leverage URL's and templating, without
the cruft of models, and without the admin module.
<li><a href="http://jquery.com/">jQuery</a> - dang, this is a time-saver.
Just learn it.
</ul>
<ul>And for editing:
<li><a href="http://www.vim.org">Vim</a> - Omni-complete is perfect for web
development - it closes my HTML tags and intelligently suggests CSS keys and
appropriate values.  Also, I've learned how to use the <code>:mksession</code>
to preserve an editing layout.
<li><a href="http://www.tatanka.com.br/ies4linux/page/Main_Page">ies4linux</a>
under <a href="http://www.winehq.org/">Wine</a> to test IE6 concurrently with
Firefox.
<li><a href="http://www.suckless.org/dwm/">dwm</a> - I fought with Awesome 3
long enough to jump ship.  dwm does everything I want, and nothing more.]]></description>

</item>
<item>
<link>http://mackdanz.net/archives/2008/10/index.html#e2008-10-26T19_26_36.txt</link>
<guid isPermaLink="true">http://mackdanz.net/archives/2008/10/index.html#e2008-10-26T19_26_36.txt</guid>
<title>On simple APIs</title>
<dc:date>2008-10-26T19:26:36-06:00</dc:date>
<dc:creator>Erik</dc:creator>

<description><![CDATA[<p>I <a href="/archives/2008/08/index.html#e2008-08-10T13_18_19.txt">wrote</a>
about my effort to learn sockets programming properly.  For two weeks, every
day, I wrote a simple socket server in C, from memory as much as possible.</p>

<p>It paid off this last week at work, when I finished a draft of a proxy
server that sits between an existing server and a Flash client.  A proxy is
both a server and a client, so all my new skills were used, albeit in C# not
C.  The nice thing about sockets is that the API is fairly standard for all
technologies - Unix and Windows have similar C API's, and all higher level
languages simply wrap around them.</p>

<p>I'm so glad I learned the C first, since the standard API is lean.  There
are about 6 - 8 functions to learn to use.</p>

<p>Had I attacked this issue starting with C#, I'm certain I would have
failed.  The "user-friendly" wrappers contain a lot of distracting material.
Furthermore, the MSDN documentation for class members always includes a program that does
eight things, instead of being distilled down to the one thing I want to
do.</p>

<p>So, here's to the distillation of problems down to their simplest atoms.
I'll take bind(), accept(), and send() over SocketInformation,
SocketInformationOptions, SocketFlags, and SocketOptionName any day.</p>]]></description>

</item>
<item>
<link>http://mackdanz.net/archives/2008/10/index.html#e2008-10-19T21_00_26.txt</link>
<guid isPermaLink="true">http://mackdanz.net/archives/2008/10/index.html#e2008-10-19T21_00_26.txt</guid>
<title>Maker Faire 2008</title>
<dc:date>2008-10-19T21:00:26-06:00</dc:date>
<dc:creator>Erik</dc:creator>

<description><![CDATA[<p>How much fun is the <a href="http://makerfaire.com/" target="_blank">Maker
Faire</a>?  My 5-year-old had as much fun as I did,
making it a perfect father-daughter geek outing.</p>

<p>I missed the <a
href="http://www.arduino.cc/" target="_blank">Arduino</a> talk, 
which is doubly-sad since I really need a kick in the pants to take mine out
of the box and use it.</p>

<p><a href="/images/maker/combat.jpg"><image
src="/images/maker/combatThumb.jpg"></a><br>Robot carnage</p>

<p><a href="/images/maker/music.jpg"><image
src="/images/maker/musicThumb.jpg"></a><br>Tesla coils play the "Dr. Who"
theme.  Inhaling the ozone in the top row, my kiddo said "It smells sweet,
Daddy."  Good girl.</p>

<p><a href="/images/maker/r2d2.jpg"><image
src="/images/maker/r2d2Thumb.jpg"></a><br>Saying hi to R2-D2</p>

<p><a href="/images/maker/muertos.jpg"><image
src="/images/maker/muertosThumb.jpg"></a><br>Decorating a Day-of-the-Dead head</p>

<p><a href="/images/maker/musicBike.jpg"><image
src="/images/maker/musicBikeThumb.jpg"></a><br>A self-amplifying art-bike adorned with music box players</p>

<p><a href="/images/maker/peacockBike.jpg"><image
src="/images/maker/peacockBikeThumb.jpg"></a><br>The "Austin Bike Zoo" had its full menagerie</p>

<p><a href="/images/maker/snakeBike.jpg"><image
src="/images/maker/snakeBikeThumb.jpg"></a><br>The rattlesnake bike</p>]]></description>

</item>
<item>
<link>http://mackdanz.net/archives/2008/10/index.html#e2008-10-12T20_07_26.txt</link>
<guid isPermaLink="true">http://mackdanz.net/archives/2008/10/index.html#e2008-10-12T20_07_26.txt</guid>
<title>Writing portable apps under Gentoo</title>
<dc:date>2008-10-12T20:07:26-06:00</dc:date>
<dc:creator>Erik</dc:creator>

<description><![CDATA[<p>For a previous C project for work, I developed a Windows app on Linux.  The
clunky workflow:</p>
<ul>
<li>Write the entire app in Linux, being careful to use only the C Standard
Library.
<li>Move the source onto a Windows box.
<li>Using <a href="http://www.eclipse.org/" target="_blank">Eclipse</a>,<a
href="http://www.eclipse.org/cdt/" target="_blank">CDT</a>, and <a
href="http://www.mingw.org/" target="_blank">MinGW</a>, coerce a working
build.
<li>If cross-platform changes were needed, make the edits twice.
</ul>

<p>You can imagine this workflow is unsustainable for projects larger than my
little console app.  Fortunately, I'm now set up to do the whole shebang on
my Gentoo box, using MinGW and <a href="http://www.winehq.org/"
target="_blank">Wine</a>.  Tonight, I've compiled and run a Windows-specific
app completely from Linux.</p>

<p><img src="/images/cc.png"></p>

<p>Gentoo makes this setup easy, although it's probably a bigger production
than it needs to be.  I simply followed Gentoo's <a
href="http://gentoo-wiki.com/HOWTO_MinGW" target="_blank">MinGW HOWTO</a> to
the letter, and had no issues.</p>

<p>By big production, I mean that instead of providing a quick-and-dirty Windows-specific
solution, they've gone after the entire problem of cross-compiling for any
architecture, with a single, enormous <a
href="http://gentoo-wiki.com/HOWTO_Cross_Compile" target="_blank">"CrossDev
platform"</a>.  One day, I'm sure I'll see the benefit of this framework.
Among other things, it's meant to simplify the cross-compilation of
dependencies (say, a UI library).</p>

<p>I haven't yet accomplished a full Autotools build that can compile a Linux
or Windows app based on a configure script flag.  It's high on my list, to be
sure.</p>

<p>I'm completely stoked at the idea of compiling native apps for all major
platforms.  I don't want to be religious about portability.  I just know that
some programming problems aren't that hard if you plan the solution from the
start.</p>

<p>Any cross-compiling devs out there?  What experiences have you had?</p>]]></description>

</item>
</channel>
</rss>
