<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-65633101471927506</id><updated>2011-09-16T12:17:38.346-04:00</updated><category term='Story'/><category term='Geeky'/><category term='TV'/><category term='Profundity'/><category term='python'/><category term='Minions'/><category term='Linux'/><category term='family'/><category term='comics'/><category term='politics'/><category term='gtk'/><category term='Emacs'/><category term='Pop Culture'/><category term='Android'/><category term='writing'/><category term='Gnome'/><category term='Programming'/><category term='Open Source'/><title type='text'>Cracking Up At Work</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://upcracky.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/65633101471927506/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://upcracky.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Dale Wiles</name><uri>http://www.blogger.com/profile/12609080347734449263</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>34</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-65633101471927506.post-5897297494789587691</id><published>2011-08-01T23:36:00.003-04:00</published><updated>2011-08-01T23:56:57.998-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Programming'/><category scheme='http://www.blogger.com/atom/ns#' term='Linux'/><title type='text'>Hey Unix, How About a Date?</title><content type='html'>&lt;span style="font-size:130%;"&gt;The Problem&lt;/span&gt;.&lt;br /&gt;&lt;br /&gt;I needed a way to warn users that their passwords were about to expire.  To give them a sporting chance, I wanted to give them 2 weeks warning.&lt;br /&gt;&lt;br /&gt;I could get the current date with no problem.  Getting the password expire date was a bit of a pain, but I could figure it out.  The hard part was figuring out how close to the 2 week warning date they were.&lt;br /&gt;&lt;br /&gt;In a nut shell, doing math with dates is a royal pain.  You have abstract concepts like “July 4th” permanently glued to a large spinning rock which is whizzing around the Sun.&lt;br /&gt;&lt;br /&gt;Also, certain concepts that we're used to, such as 1 + 1 = 2, don't always hold up when doing date math.  January 31st + 2 months = March 31st.  No surprise.  How about January + 1 month.  That would be February 28th?  Or would it be March 3rd (31 days after January 31st)?  Add a month to February 28th and you get March 28th.  March 31st doesn't equal March&lt;br /&gt;28th.  Oh boy!&lt;br /&gt;&lt;span style="font-size:130%;"&gt;&lt;br /&gt;The Simple (Linux) Solution&lt;/span&gt;.&lt;br /&gt;&lt;br /&gt;The most common way to deal with dates is to convert them to a number, do some math, and then convert the number back to a date.  Unix (and Linux) system time is based on this concept.  Unix dates are implemented as the number of seconds since the January 1st, 1970.  In Unix parlance 1/1/1970 is called “the epoch”.&lt;br /&gt;&lt;br /&gt;If you have a version of Unix that uses the GNU version of the &lt;span style="font-weight: bold;"&gt;date&lt;/span&gt; command (almost all versions of Linux do), then date math becomes trivial.  The &lt;span style="font-weight: bold;"&gt;date&lt;/span&gt; command can convert to and from the epoch with relative ease.&lt;br /&gt;&lt;br /&gt;To convert “August 1st 2011” to seconds from the epoch use:&lt;br /&gt;&lt;br /&gt;  date -u -d "8/1/2011" +%s&lt;br /&gt;&lt;br /&gt;You should get 1312156800.&lt;br /&gt;&lt;br /&gt;To convert it back use:&lt;br /&gt;&lt;br /&gt;  date -u -d "1970-01-01 1312156800 seconds" '+%m/%d/%Y'&lt;br /&gt;&lt;br /&gt;You should get “08/01/2011”.&lt;br /&gt;&lt;br /&gt;The problem here is 2 fold:&lt;br /&gt;&lt;br /&gt;One, you're limited to dates between 1970 and 2038 for 32 bit computers.  If you have a 24 bit computer then you're good until somewhere around the year 292,277,026,296 so it's not really a restriction.&lt;br /&gt;&lt;br /&gt;The second problem is that most older OS's aren't running GNU &lt;span style="font-weight: bold;"&gt;date&lt;/span&gt;.  They have their own propriety versions of &lt;span style="font-weight: bold;"&gt;date&lt;/span&gt; that won't let you work with arbitrary dates.&lt;br /&gt;&lt;br /&gt;What I needed was a date converter that would work on many versions of *old* Unix.  Things like Solaris 5 and HP-UX 10.  These are nasty little beasts that barely have Bourne shell.  I also wasn't allowed to add more advanced scripting languages to the system so Perl and Python solutions were both out.&lt;br /&gt;&lt;br /&gt;I poked around on the Internet tubes and found a dearth of solutions.  Most of them used other languages.  Some gave example code that didn't handle leap years properly.  Others were built around precomputed tables.&lt;br /&gt;&lt;br /&gt;Time to step up to the plate.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt;My Solution.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Below is my solution.  Its date format is the number of days after January 1st, 1582.  That's the beginning of the Gregorian calendar and very few of my users are that old.&lt;br /&gt;&lt;br /&gt;Internally it's mostly AWK scripts glued together by Bourne shell.  It can handle dates up to 1/1/9794 and can probably go higher.  I've tested it and think it's pretty bullet proof.&lt;br /&gt;&lt;br /&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;#!/bin/sh -&lt;br /&gt;&lt;br /&gt;# Convert a date to/from the number of days after 1/1/1582 using only&lt;br /&gt;# basic Unix commands.  By &amp;quot;basic&amp;quot; I mean commands available on an&lt;br /&gt;# HP-UX 10 box.&lt;br /&gt;#&lt;br /&gt;# 1/1/1582 is the start of the Gregorian calendar.&lt;br /&gt;&lt;br /&gt;# Note: The Gregorian rules for leap years is:&lt;br /&gt;#&lt;br /&gt;#       If the year is a factor of 400&lt;br /&gt;#         It's a leap year.&lt;br /&gt;#       Else If the year is a factor of 100&lt;br /&gt;#         It's not a leap year.&lt;br /&gt;#       Else If the year is a factor of 4&lt;br /&gt;#         It's a leap year&lt;br /&gt;#       Else&lt;br /&gt;#         It's not a leap year.&lt;br /&gt;&lt;br /&gt;# This mostly uses awk because awk is much faster than using raw&lt;br /&gt;# Bourne shell.&lt;br /&gt;&lt;br /&gt;# To get a date from the Unix &amp;quot;seconds from the epoch&amp;quot; time use&lt;br /&gt;#   int($utime / (24 * 60 * 60)) + date_as_days(1970 1 1)&lt;br /&gt;#&lt;br /&gt;#   date_as_days(1970 1 1) = 141714 by the way.&lt;br /&gt;&lt;br /&gt;#&lt;br /&gt;# Return the number of days in the previous months.&lt;br /&gt;#&lt;br /&gt;# For example the second entry is the number of days in January.  The&lt;br /&gt;#   third entry is the combined number of days in January and&lt;br /&gt;#   February.&lt;br /&gt;#&lt;br /&gt;# The only parameter is the 4 digit year.&lt;br /&gt;#&lt;br /&gt;days_prev_month()&lt;br /&gt;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;echo $1 &amp;#124; awk '{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;year = $1&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;# Pick the number of days depending of whether its a leap year.&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if ((year % 4 == 0) &amp;amp;&amp;amp; (year % 100 != 0 &amp;#124;&amp;#124; year % 400 == 0)) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;print &amp;quot;0 31 60 91 121 152 182 213 244 274 305 335 366&amp;quot;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;} else {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;print &amp;quot;0 31 59 90 120 151 181 212 243 273 304 334 365&amp;quot;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;&amp;nbsp;&amp;nbsp;}'&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;#&lt;br /&gt;# Convert a date in to the number of days after 1/1/1582.&lt;br /&gt;#&lt;br /&gt;# The parameters are YYYY MM DD.&lt;br /&gt;#&lt;br /&gt;date_as_days()&lt;br /&gt;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;dad_month=$2; dad_day=$3&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;# Get the number of days consumed by the years and the number of&lt;br /&gt;&amp;nbsp;&amp;nbsp;# days remaining in the current year.&lt;br /&gt;&amp;nbsp;&amp;nbsp;set - `echo $1 &amp;#124; awk '{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;year = $1&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;# The modern calendar started in 1582.&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;year_days = int((year - 1581) * 365.25) - 365&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;cents = int((year - 1501) / 100)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;year_days -= cents&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;cents_400 = int((cents + 3) / 4)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;year_days += cents_400&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;print year, year_days&lt;br /&gt;&amp;nbsp;&amp;nbsp;}'`&lt;br /&gt;&amp;nbsp;&amp;nbsp;dad_year=$1; dad_year_days=$2&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;# Now add the month and day contributions.&lt;br /&gt;&amp;nbsp;&amp;nbsp;days_prev_month $dad_year &amp;#124; awk &amp;quot;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;BEGIN { day=$dad_day; month=$dad_month; year_days=$dad_year_days }&amp;quot;'&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{ whole_month_days=$month&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;print year_days + whole_month_days + day - 1 }'&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;#&lt;br /&gt;# Take the number of days since 1/1/1582 and convert it to&lt;br /&gt;# year, month, day&lt;br /&gt;#&lt;br /&gt;days_as_date()&lt;br /&gt;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;df_days=$1&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;# This awk script computes the year contributions to the date&lt;br /&gt;&amp;nbsp;&amp;nbsp;# and removes the effects of those years from df_days.&lt;br /&gt;&amp;nbsp;&amp;nbsp;set - `&lt;br /&gt;&amp;nbsp;&amp;nbsp;echo $df_days &amp;#124; awk '{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;df_days = $1;&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;# The first 400 year leap year in the Gregorian calendar is&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;# 1600 so we normalize our calculations from the first block&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;# of 400 years that ends on 1600.  That year is 1201.&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;# There are 139157 days between 1/1/1201 and 1/1/1582&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;#&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;# Note: We use 1201, not 1200 because we want the leap year to be the&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;#       *last* year of the 400, 100 or 4 year block.&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;n_days = df_days + 139157&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;# There is one leap year every 4 years.&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;days_per_quad_year = (365 * 4) + 1&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;# Years that end in 00 arent leap years.&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;days_per_cent = (days_per_quad_year * 25) - 1&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;# Unless its divisible evenly by 400.&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;days_per_quad_cent = (days_per_cent * 4) + 1&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;# Calculate the contributions of each year block.&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;quad_cents = int(n_days / days_per_quad_cent)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;n_days -= quad_cents * days_per_quad_cent&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;cents = int(n_days / days_per_cent)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if (cents == 4) { cents = 3 }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;n_days -= cents * days_per_cent&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;quad_years = int(n_days / days_per_quad_year)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;n_days -= quad_years * days_per_quad_year&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;years = int(n_days / 365)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if (years == 4) { years = 3 }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;n_days -= years * 365&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;df_year = 1201 + (400 * quad_cents) + (100 * cents) \&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;+ (4 * quad_years) + years&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;print n_days, df_year&lt;br /&gt;&amp;nbsp;&amp;nbsp;}'`&lt;br /&gt;&amp;nbsp;&amp;nbsp;df_n_days=$1; df_year=$2&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;# Get the day and month from the given year.&lt;br /&gt;&amp;nbsp;&amp;nbsp;set - `days_prev_month $df_year &amp;#124; awk &amp;quot;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;BEGIN{n_days=$df_n_days}&amp;quot;'&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{ df_month = 1&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;while (n_days &amp;gt;= $df_month) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;df_whole_month_days = $df_month&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;df_month++&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;df_day = 1 + n_days - df_whole_month_days&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;print (df_month - 1), df_day }'`&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;df_month=$1; df_day=$2&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;echo $df_year $df_month $df_day&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;# Some test code.  Feed it a number and get back a date.&lt;br /&gt;# Feed it a m/d/yyyy date and get back a number.&lt;br /&gt;#&lt;br /&gt;# Note the complete lack of error checks.&lt;br /&gt;if echo &amp;quot;$1&amp;quot; &amp;#124; egrep '/' &amp;gt;/dev/null 2&amp;gt;&amp;amp;1; then&lt;br /&gt;&amp;nbsp;&amp;nbsp;set - `echo $1 &amp;#124; tr '/' ' '`&lt;br /&gt;&amp;nbsp;&amp;nbsp;date_as_days $3 $1 $2&lt;br /&gt;else&lt;br /&gt;&amp;nbsp;&amp;nbsp;days_as_date $1 &amp;#124; awk '{ printf &amp;quot;%02d/%02d/%02d\n&amp;quot;, $2, $3, $1 }'&lt;br /&gt;fi&lt;br /&gt;&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/65633101471927506-5897297494789587691?l=upcracky.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://upcracky.blogspot.com/feeds/5897297494789587691/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=65633101471927506&amp;postID=5897297494789587691' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/65633101471927506/posts/default/5897297494789587691'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/65633101471927506/posts/default/5897297494789587691'/><link rel='alternate' type='text/html' href='http://upcracky.blogspot.com/2011/08/hey-unix-how-about-date.html' title='Hey Unix, How About a Date?'/><author><name>Dale Wiles</name><uri>http://www.blogger.com/profile/12609080347734449263</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-65633101471927506.post-2300512150671279012</id><published>2011-06-19T21:49:00.004-04:00</published><updated>2011-06-20T00:06:45.065-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Programming'/><category scheme='http://www.blogger.com/atom/ns#' term='gtk'/><category scheme='http://www.blogger.com/atom/ns#' term='python'/><title type='text'>Python, GTK, GL and Incantation.</title><content type='html'>&lt;p&gt;In computer terms, an “incantation” is a problem that can easily be     solved if you know the proper mystical invocation.  An incantation is     especially annoying if it's something that has to have been done many     times before, but no one as bothered to tell we mere mortals how they did     it.&lt;/p&gt;      &lt;p&gt;Linux suffers incantation at a near mystical level.  People who     write library code seem to take a sadistic pleasure in not telling     people how to use said library.&lt;/p&gt;      &lt;p&gt;I ran in to this in spades when I tried to use Python to hook up     the OpenGL graphics library to the GTK widget system.  I didn't have     too much trouble finding examples of hooking GTK to Python, the PyGtk     libraries are full of examples.  I didn't have too much trouble     finding OpenGL examples in Python.  Search for “PyOpenGL Demo” and     you'll probably find what you need.&lt;/p&gt;      &lt;p&gt;My problem came from trying to hook Python, Gtk and OpenGL together     as one big happy family.  I couldn't find one complete example on the     net.  I could find some pieces, but no complete example.&lt;/p&gt;      &lt;p&gt;To make a long story short, I finally found enough pieces, and read     enough source code to have a pretty good idea of how to get the job     done.  In true Linux fashion it turns out to be pretty easy.  The     documented code is at &lt;a href="http://modarnis.com/"&gt;my website&lt;/a&gt;.  Hopefully there is now one less incantation     in the world.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/65633101471927506-2300512150671279012?l=upcracky.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://upcracky.blogspot.com/feeds/2300512150671279012/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=65633101471927506&amp;postID=2300512150671279012' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/65633101471927506/posts/default/2300512150671279012'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/65633101471927506/posts/default/2300512150671279012'/><link rel='alternate' type='text/html' href='http://upcracky.blogspot.com/2011/06/in-computer-terms-incantation-is.html' title='Python, GTK, GL and Incantation.'/><author><name>Dale Wiles</name><uri>http://www.blogger.com/profile/12609080347734449263</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-65633101471927506.post-6436222844530481761</id><published>2010-11-08T22:10:00.003-05:00</published><updated>2010-11-08T22:17:40.990-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Programming'/><category scheme='http://www.blogger.com/atom/ns#' term='Emacs'/><title type='text'>Hideous Bloat and Active Links.</title><content type='html'>By popular demand I've expanded my Emacs wiki from one function to an unwieldy two.  The second function will scamper through a buffer and list all the active links found.&lt;br /&gt;&lt;br /&gt;I use the same regexp that I did in the previous article so it links on CamelCase.  To change the link style you just change the regexp.  If you end up writing too many support functions then you may want to use that "variable" thing that all the cool kids are talking about.&lt;br /&gt;&lt;span style="font-size:130%;"&gt;&lt;br /&gt;The Code&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;tt&gt;&lt;pre&gt;&lt;br /&gt;(defun list-active-links (link-re &amp;amp;optional is-active-link-p)&lt;br /&gt;  "Scan a buffer looking for links and list all the active links.&lt;br /&gt;&lt;br /&gt;LINK-RE is a regular expression which matches the link text.&lt;br /&gt;IS-ACTIVE-LINK-P is an optional function which takes the link text and&lt;br /&gt;returns true if the link is active.  If not provided, `file-exists-p' is&lt;br /&gt;used."&lt;br /&gt;  (let ((buffer-name "*ActiveLinks*")&lt;br /&gt;    (found-links ()))&lt;br /&gt;&lt;br /&gt;    (if (not is-active-link-p)&lt;br /&gt;    (setq is-active-link-p 'file-exists-p))&lt;br /&gt;&lt;br /&gt;    ;; Gather up all the potential links and whether they're active.&lt;br /&gt;    (save-excursion&lt;br /&gt;      (goto-char (point-min))&lt;br /&gt;      (while (re-search-forward link-re nil t)&lt;br /&gt;    (let ((link-text (match-string-no-properties 0)))&lt;br /&gt;      ;; If the link hasn't been checked, then save its value&lt;br /&gt;      ;; and whether or not it has an existing destination.&lt;br /&gt;      (if (not (assoc link-text found-links))&lt;br /&gt;          (setq found-links&lt;br /&gt;            (cons (cons link-text&lt;br /&gt;                (funcall is-active-link-p link-text))&lt;br /&gt;              found-links))))))&lt;br /&gt;&lt;br /&gt;    ;; Now list out the active links.&lt;br /&gt;    (if (get-buffer buffer-name)&lt;br /&gt;    (kill-buffer buffer-name))&lt;br /&gt;    (switch-to-buffer-other-window buffer-name)&lt;br /&gt;    (let ((active-links&lt;br /&gt;       ;; Remove any links that don't have an associated file.&lt;br /&gt;       (delq nil (mapcar (lambda (x) (and (cdr x) (car x)))&lt;br /&gt;                 found-links))))&lt;br /&gt;      (insert "#\n# The following links have destinations.\n#\n")&lt;br /&gt;      (save-excursion&lt;br /&gt;    (insert (mapconcat 'identity (sort active-links 'string&lt;) "\n")))&lt;br /&gt;      (not-modified)&lt;br /&gt;      (message "%d matches found." (length active-links)))))&lt;br /&gt;&lt;br /&gt;(defun check-active-links ()&lt;br /&gt;  (interactive)&lt;br /&gt;  (let ((link-re "\\&lt;[A-Z][a-z]+\\([A-Z][a-z]+\\)+\\&gt;"))&lt;br /&gt;    (list-active-links link-re)&lt;br /&gt;    ;; Note: At this point we're in the "*ActiveLinks* buffer.&lt;br /&gt;    (set (make-local-variable 'link-to-re) link-re)&lt;br /&gt;    (local-set-key&lt;br /&gt;     (kbd "C-c C-o")&lt;br /&gt;     (lambda ()&lt;br /&gt;       (interactive)&lt;br /&gt;       (link-to link-to-re "\\&lt;")))))&lt;/pre&gt;&lt;/tt&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/65633101471927506-6436222844530481761?l=upcracky.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://upcracky.blogspot.com/feeds/6436222844530481761/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=65633101471927506&amp;postID=6436222844530481761' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/65633101471927506/posts/default/6436222844530481761'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/65633101471927506/posts/default/6436222844530481761'/><link rel='alternate' type='text/html' href='http://upcracky.blogspot.com/2010/11/hideous-bloat-and-active-links.html' title='Hideous Bloat and Active Links.'/><author><name>Dale Wiles</name><uri>http://www.blogger.com/profile/12609080347734449263</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-65633101471927506.post-6241171764381661619</id><published>2010-11-07T00:39:00.003-04:00</published><updated>2010-11-08T22:18:27.642-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Programming'/><category scheme='http://www.blogger.com/atom/ns#' term='Emacs'/><title type='text'>Emacs, the Wiki and the Idiot.</title><content type='html'>Sir C.A.R. (Tony) Hoare once wrote:&lt;br /&gt;&lt;blockquote&gt;Inside every large problem, is a small problem—struggling to get out.&lt;br /&gt;&lt;/blockquote&gt;Someone else, stealing from H. L. Mencken, changed it to:&lt;br /&gt;&lt;blockquote&gt;Inside every large problem, is a small problem—struggling to get out. The solution to that problem is simple, elegant and wrong.&lt;br /&gt;&lt;/blockquote&gt;I tend to agree with the Thief.  The simple reality is that many problems don't have elegant solutions, try as we may to find them.  I ran into this when I tried to come up with a simple personal wiki.  Enjoy my exploits.&lt;span style="font-size:130%;"&gt;&lt;br /&gt;&lt;br /&gt;Dale Writes a Wiki&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;I think the wiki is one of the great software concepts of the last decade or so.  That's not hyperbole, I really think that making it easy to link documents together, in a casual and non-invasive way, is a brilliant and under-appreciated concept.&lt;br /&gt;&lt;br /&gt;Most wikis are web based.  This makes sense if you want the world to have access to the pages.  I was looking more for a personal solution.&lt;br /&gt;&lt;br /&gt;There are personal wikis that are stand alone applications, but most of them use a special format for your data.  This strikes me as, well, stupid.  Why would I lock up my data in a special format when a directory of text files should easily get the job done?&lt;br /&gt;&lt;br /&gt;I do a lot of my text editing in Emacs, so I started looking around for an wiki based in Emacs.  There are a few, but most of them are either unsupported, too elaborate or too invasive.  I wanted a way to link text from any kind of file, not just wiki files.  I wanted to be able to link comments in source code to documentation files to cake recipes if that's what works best.  I also wanted it to leave the rest of my Emacs environment alone.  I didn't want to enter Wiki-Mode just to put links in a Perl program.  I wanted to stay in Perl mode.&lt;br /&gt;&lt;br /&gt;The joy of being a programmer is, if you can't find it, you can always write it.  That's what I started out to do.&lt;br /&gt;&lt;br /&gt;At first I decided to play with [[bracket style links]].  Emacs Org Mode uses them and I like much about Org Mode, so I tried to emulate its style.&lt;br /&gt;&lt;br /&gt;The attempts where not too successful.  I pulled out some of Org Mode's handler code and started playing with it.  It's pretty invasive and doesn't work well with old versions of Emacs.  I use an old version of Emacs at work, and I wanted something small and easy to understand.&lt;br /&gt;&lt;br /&gt;My next idea was to write my own bracket style linking library.  At it's heart it would grab the text between [[]], convert it into a file name and then open the resulting file name.  194 lines of Elisp later and I had a working minor mode.  It could open files, web pages, internal links and even run commands.  I was very happy with it.  It was reasonably small and reasonably easy to understand and reasonably noninvasive.&lt;br /&gt;&lt;br /&gt;Because I'm a professional, I started to document my results.  The problem is, I'm a little bit insane.  Sometimes, when I'm working on a project, a little idiot voice calls from the fog of experience and tells me what I'm doing is wrong.  The Idiot never tells me what's right, it just picks at the back of my head until I accept, eventually, that my perfectly working code is "wrong".  Arg!&lt;br /&gt;&lt;br /&gt;The more I documented, the louder the Idiot got.  I got so frustrated that I put the code aside.  I'm a big believer in documentation by Idiot.  You take your code and ignore it for a few weeks or even months.  Then you come back and try to read it.  Every time to look at a bit of code and say "What idiot wrote this?" you either re-factor or document.  Maybe the Idiot could figure out what I couldn't.&lt;br /&gt;&lt;br /&gt;The Idiot was insidious.  It would go away for a week or so and then come out of the shadows to jeer hints.  It asked questions that I should have asked.  Do I need brackets?  Do I need to open web pages and run commands from links?  Are my needs the needs of others?  What's more important, abstract power or agility?  What is the DAO of the problem?  Why won't you see it!?&lt;br /&gt;&lt;br /&gt;This went for over a month.  Part of me was trying to find the right solution.  Part of me wanted me to finish what I had and get on with my life.&lt;br /&gt;&lt;br /&gt;Then, on a Sunday night, as a long work day loomed ahead, I was laying in my bed with my beloved wife and Charlie the metal eating dog.  From nowhere, it came to me.  All I really want is a way to take the word under the cursor and open a file with the same name.  Then it came to me.  What I really want is a way to grab an arbitrary blob of text under the cursor and then open up a file based on the text.  Then it came to me.  What I really want is a way to grab an arbitrary blob of text under the cursor and do something with it.  The Idiot had spoken!&lt;br /&gt;&lt;br /&gt;It's a cliche, but I really wanted to leap out of bed and start hacking away.  Alas, the days of 12 hour hackfests followed by 10 hour workdays are a thing of the past.  I had to go to sleep or I would die at my desk.  I had to go to work or I would be thrown into the street.  I had to get this program written or I would crack up.&lt;br /&gt;&lt;br /&gt;After work I lit in to my task.  One of the greatest pleasures in programming is simplifying.  The more I wrote, the smaller the program became.  Irrelevance fell like rain.  I was beginning to understand.  By the end, the entire program is 15 lines long.  24 lines if you include the code to hook it up to the key of your choice.&lt;br /&gt;&lt;br /&gt;It was simple, elegant and worked like a charm.  The Thief was wrong.  The Idiot stopped jeering.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt;Hooking Up the One Function Wiki&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;The simple solution is to take the text at the end of this article and append it to your .emacs.el file.&lt;br /&gt;&lt;br /&gt;To test it, fire up Emacs, and type "This is CamelCase text.".  Move your cursor to the link text "CamelCase" and type C-cC-o.  It should open up the file "CamelCase".&lt;br /&gt;&lt;br /&gt;If you want to use other link styles besides CamelCase or want to open files in different way, read the documentation.  Doing things like opening files in a specific directory or opening "CamelCase.txt" are trivial to implement.  You just need to do a little Elisp programming and away you go!&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt;The Text to Append.&lt;/span&gt;&lt;br /&gt;&lt;tt&gt;&lt;pre&gt;&lt;br /&gt;(defun link-to(link-re link-start-re &amp;amp;optional handle-link)&lt;br /&gt; "Grab the \"link\" under the cursor and open a file based on that link.&lt;br /&gt;&lt;br /&gt;LINK-RE is a regular expression which matches the link text.&lt;br /&gt;LINK-START-RE is a regular expression which matches the beginning, or text&lt;br /&gt;just before the link.&lt;br /&gt;HANDLE-LINK is an optional function which takes the link text and opens the&lt;br /&gt;link.  If not provided, `find-file' is called with the link text.&lt;br /&gt;&lt;br /&gt;This function is usually called via local-set-key with mode specific&lt;br /&gt;regular expressions.&lt;br /&gt;&lt;br /&gt;This example will grab a CamelCase link and open a file with the same&lt;br /&gt;name.&lt;br /&gt;&lt;br /&gt;   (global-set-key (kbd \"C-c C-o\")&lt;br /&gt;     (lambda ()&lt;br /&gt;       (interactive)&lt;br /&gt;       (link-to&lt;br /&gt;         \"&lt;[A-Z][a-z]+\\\\([A-Z][a-z]+\\\\)+&gt;\"&lt;br /&gt;     \"&lt;\")))  Note: The \"&lt;&gt;\"s above should have \"\\\" in front of them, but emacs&lt;br /&gt;thinks I want to print a key map when I try to include them in the help&lt;br /&gt;text.&lt;br /&gt;&lt;br /&gt;This example will grab an alphabetic string and do a google query on it.&lt;br /&gt;&lt;br /&gt;  (global-set-key (kbd \"C-c C-o\")&lt;br /&gt;    (lambda ()&lt;br /&gt;      (interactive)&lt;br /&gt;      (link-to&lt;br /&gt;        \"[a-z]+\" \"[^a-z]\")&lt;br /&gt;        (lambda (x)&lt;br /&gt;          (browse-url&lt;br /&gt;            (concat \"http://www.google.com/search?q=\" x)))))"&lt;br /&gt; (let ((here (point)) link-text&lt;br /&gt;   (case-fold-search nil))&lt;br /&gt;   (save-excursion&lt;br /&gt;     (or (re-search-backward link-start-re nil t)&lt;br /&gt;     (goto-char (point-min)))&lt;br /&gt;     (unless (re-search-forward link-re nil t)&lt;br /&gt;   (error "No tag found to end of file"))&lt;br /&gt;     (setq link-text (match-string-no-properties 0))&lt;br /&gt;     (if (or (&lt; (point) here)&lt;br /&gt;         (&gt; (- (point) (length link-text)) here))&lt;br /&gt;     (error "No tag found under cursor")))&lt;br /&gt;   (if handle-link&lt;br /&gt;   (funcall handle-link link-text)&lt;br /&gt;     (find-file link-text))))&lt;br /&gt;&lt;br /&gt;(global-set-key&lt;br /&gt;(kbd "C-c C-o")&lt;br /&gt;(lambda ()&lt;br /&gt;  ""&lt;br /&gt;  (interactive)&lt;br /&gt;  (link-to&lt;br /&gt;   "\\&amp;lt;[A-Z][a-z]+\\([A-Z][a-z]+\\)+\\&amp;gt;" "\\&amp;lt;"&lt;br /&gt;   ;; This regexp pair matches file names.&lt;br /&gt;   ;;"[a-zA-Z0-9/~_][a-zA-Z0-9/._]*[a-zA-Z0-9]" "[^a-zA-Z0-9/.~_]"&lt;br /&gt;   ;; This will open text files in your ~/Wiki directory.&lt;br /&gt;   ;;(lambda (x) (find-file (concat "~/Wiki/" x ".txt")))&lt;br /&gt;   )))&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;/tt&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/65633101471927506-6241171764381661619?l=upcracky.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://upcracky.blogspot.com/feeds/6241171764381661619/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=65633101471927506&amp;postID=6241171764381661619' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/65633101471927506/posts/default/6241171764381661619'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/65633101471927506/posts/default/6241171764381661619'/><link rel='alternate' type='text/html' href='http://upcracky.blogspot.com/2010/11/emacs-wiki-and-idiot.html' title='Emacs, the Wiki and the Idiot.'/><author><name>Dale Wiles</name><uri>http://www.blogger.com/profile/12609080347734449263</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-65633101471927506.post-1380332921209879395</id><published>2010-09-02T16:05:00.002-04:00</published><updated>2010-09-02T16:07:07.702-04:00</updated><title type='text'>Reading Web Pages From the Android SD Card</title><content type='html'>Android 1.6 (Donut) tries to make it impossible to read web pages from  the SD memory card.  Fortunately there is a flaw in their security that  lets a user create a specially formatted URL that allows access.  This  technique may work for other versions of Android but I've only tested it  on 1.6.&lt;br /&gt;&lt;br /&gt;This is an easy hack.  The only skill required is the  ability to drag and drop files from the computer to the phone and to  connect to this web page via the Android.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:180%;"&gt;Terminology&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;For the sake of simplicity the Android based phone is just going to be called the Android.  It reads easier.&lt;br /&gt;&lt;br /&gt;Local files are the files on the Android SD card.  Any references to "the card" mean the Android SD card.&lt;br /&gt;&lt;br /&gt;The Desktop is the computer that will be used to edit files and drag and drop the files to and from the Android.&lt;br /&gt;&lt;br /&gt;"The browser" is the browser on the Android.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:180%;"&gt;Overview&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;A  web page is created on a computer and moved to an arbitrary, but known  spot on the Android SD card.  A special URL is entered in the Android  browser which points to the page.  The page is made into a book mark by  bypassing the bookmark editor.  The web page can then be edited to point  to any other location on the SD card.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:180%;"&gt;The Direct Way&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;This  way is direct, but it involves a bit of typing on the Android keyboard.   Most people find the longer way easier to get correct.&lt;br /&gt;&lt;br /&gt;Put a web page the SD card.  This example will use the file &lt;span style="font-family:courier new;"&gt;webpages/index.html&lt;/span&gt;.&lt;br /&gt;&lt;br /&gt;Open the browser and type in the URL&lt;span style="font-family:courier new;"&gt; content://com.android.htmlfileprovider/sdcard/webpages/index.html&lt;/span&gt;.&lt;br /&gt;&lt;br /&gt;If  index.html shows up in the browser, go to the section "Saving as a Book  Mark".  If not, check the URL spelling and file location.  If the  problem can't be solved, use the longer way.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:180%;"&gt;The Longer But Less Fussy Way&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;This way requires creating a web page on the desktop and the ability to drag a file from the desktop to the Android.&lt;br /&gt;&lt;br /&gt;Open an editor ("notepad" will do) and paste the following text:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&amp;lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN"&amp;gt;&lt;br /&gt;&amp;lt;html&amp;gt;&lt;br /&gt;&amp;lt;head&amp;gt;&lt;br /&gt;&amp;lt;title&amp;gt;Found the sd card!&amp;lt;/title&amp;gt;&lt;br /&gt;&amp;lt;/head&amp;gt;&lt;br /&gt;&amp;lt;body&amp;gt;&lt;br /&gt;&amp;lt;h1&amp;gt;It worked!&amp;lt;/h1&amp;gt;&lt;br /&gt;&amp;lt;ul&amp;gt;&lt;br /&gt;&amp;lt;li&amp;gt;&amp;lt;a href="content://com.android.htmlfileprovider/sdcard/foo.html"&amp;gt;Self reference.&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;&amp;lt;li&amp;gt;&amp;lt;a href="webpages/index.html"&amp;gt;Relative links work also.&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;&amp;lt;li&amp;gt;&amp;lt;a href="http://upcracky.blogspot.com"&amp;gt;An external link.&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;&amp;lt;/ul&amp;gt;&lt;br /&gt;&amp;lt;/body&amp;gt;&lt;br /&gt;&amp;lt;/html&amp;gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Save the file as "foo.html".  This is just a temporary file and the name &lt;span style="font-weight: bold;"&gt;has&lt;/span&gt; to be "foo.html" or the rest of the steps won't work.&lt;br /&gt;&lt;br /&gt;Copy foo.html to the top level directory of the SD card.&lt;br /&gt;&lt;br /&gt;Unhook the Android from the Desktop.&lt;br /&gt;&lt;br /&gt;Connect to this blog entry via the Android browser and click on &lt;a href="content://com.android.htmlfileprovider/sdcard/foo.html"&gt;this URL&lt;/a&gt;.  foo.html should be displayed in the browser.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:180%;"&gt;Saving the Bookmark&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;While  display the web page in the browser, press the menu key.  Select  "Bookmarks".  Select "History".  Select "Today".  Find the entry for  "Found the SD Card!" and click on the star symbol on the right.  The  bookmark will be added to the browser with no further intervention.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Do  not use the "Edit bookmark" option.  Just opening the book mark editor  with this book mark may corrupt the link and it will stop working.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:180%;"&gt;Changing the Name of the Bookmark&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Since  the bookmark can't be directly edited, some cleverness is required to  move the SD web page and/or change the name of the bookmark.&lt;br /&gt;&lt;br /&gt;First  create a new web page and install it on the SD card in any arbitrary  folder.  Edit foo.html and add a link to the new page relative to this  page.  Bring up foo.html via the previous book mark.  Click on the link  to the new page.  Bookmark the new file.&lt;br /&gt;&lt;br /&gt;Once the new page is safely bookmarked, foo.html and it's bookmark can be deleted.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:180%;"&gt;Limitations&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The  one quirk that hasn't been figured out is how to jump to the middle of a  local web page.  Links such as bar.html work fine.  Links such as  bar.html#middle give an error.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/65633101471927506-1380332921209879395?l=upcracky.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://upcracky.blogspot.com/feeds/1380332921209879395/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=65633101471927506&amp;postID=1380332921209879395' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/65633101471927506/posts/default/1380332921209879395'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/65633101471927506/posts/default/1380332921209879395'/><link rel='alternate' type='text/html' href='http://upcracky.blogspot.com/2010/09/reading-web-pages-from-android-sd-card.html' title='Reading Web Pages From the Android SD Card'/><author><name>Dale Wiles</name><uri>http://www.blogger.com/profile/12609080347734449263</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-65633101471927506.post-340029327808055337</id><published>2010-08-29T01:40:00.010-04:00</published><updated>2010-09-02T16:09:53.757-04:00</updated><title type='text'>Dell OpenManage Under 64 Bit Red Hat Linux</title><content type='html'>This post was moved to &lt;a href="http://www.modarnis.com/Articles/Dell%20OpenManage%20Under%20Red%20Hat.html"&gt;here&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/65633101471927506-340029327808055337?l=upcracky.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://upcracky.blogspot.com/feeds/340029327808055337/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=65633101471927506&amp;postID=340029327808055337' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/65633101471927506/posts/default/340029327808055337'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/65633101471927506/posts/default/340029327808055337'/><link rel='alternate' type='text/html' href='http://upcracky.blogspot.com/2010/08/dell-openmanage-under-64-bit-red-hat.html' title='Dell OpenManage Under 64 Bit Red Hat Linux'/><author><name>Dale Wiles</name><uri>http://www.blogger.com/profile/12609080347734449263</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-65633101471927506.post-5884906534031596738</id><published>2010-07-22T22:21:00.002-04:00</published><updated>2010-07-22T22:32:47.574-04:00</updated><title type='text'>Beyond Help.</title><content type='html'>I'm a big fan of open source software.  I do most of my work on Linux and most of my programming is done using Perl.  I believe that open software has value and the more open our infrastructure is, the better it is for the world as a whole.&lt;br /&gt;&lt;br /&gt;As programmers go, I'm pretty good at what I do.  That gives me certain obligations, one of which is to give back to the open software movement when I can.&lt;br /&gt;&lt;br /&gt;I was given an opportunity today, but I don't think I'll be giving back in this case.&lt;br /&gt;&lt;br /&gt;As I mentioned before, I do a lot of programming in Perl.  Sometimes I need to create windows and buttons to make my programs pretty.  Enter GTK2.  It's a really nice package.  For what I do it's simple, reasonably clean and you can usually find an example out there that will give you a good head start.  Therein lies the rub.&lt;br /&gt;&lt;br /&gt;The example that I found was part of the GTK2-Perl Frequently Asked Question (FAQ) list.  I copied it over and tried to run it.  No go.  The example was using an older version of the library and it had a typo.  If only there were a programmer in the house!&lt;br /&gt;&lt;br /&gt;Hey!  I'm a programmer!   And I'm in the house!  It took me less that 15 minutes to get it up and running.  Yay me!&lt;br /&gt;&lt;br /&gt;Now comes the obligation part.  I'm using public code, so therefore I'm obligated to send the fixes in to the GTK2-Perl folk so the next person who comes along doesn't have to figure it out.  I connect to their bug tracker and try to enter a bug report, including the fix.&lt;br /&gt;&lt;br /&gt;No dice!  If you want the privilege of submitting a bug to them, you have to sign up to their web site.  That's stupid but I'll bite the bullet for betterment of open sourceyness.  I'm quite the patriot.&lt;br /&gt;&lt;br /&gt;Nope.  You not only have to sign up, but you have to give them an email address.  Oh, and they'll publish your email address guaranteeing that you'll get spammed off the planet!  It gets worse.  They suggest creating a throwaway account to handle the spamming.  What?  Why would I set up an account just to throw it away?&lt;br /&gt;&lt;br /&gt;In theory this is supposed to discourage spamming.  Is spamming in bug reports really that big a marketing vector?  Hey, my program is crashing, maybe penis enhancement will help!&lt;br /&gt;&lt;br /&gt;I know that people want an automated system here.  One that will block all spam without human intervention.  These people are idiots.  You have 2 choices.  Get casual bug reports that will do wonders for enhancing your project while dealing with the reality of spamming, or set up barriers that will keep most spam out and will do wonders for causing inbreeding on your project.&lt;br /&gt;&lt;br /&gt;I'll admit I don't have a lot of patience for this nonsense.  I'm not jumping through hoops to help you.  Besides, a better solution is trivial.&lt;br /&gt;&lt;br /&gt;Any bug report sent via the "outside" gets put in a queue until someone who's trusted takes a look at it.  Spam bug reports are rare and there are more than enough regulars on any project who will do the few seconds of grunt work for you.&lt;br /&gt;&lt;br /&gt;You could also use a one time key.  I connect to your bug tracker.  You email me a tracker-putter-inner-key.  You don't keep my email address, you just use it once to send me the key. I then use that key to submit the bug report.  If I need to add comments to that report, then I use the number again.  If I loose the number and want to add more comments then I have to sign up for an account and I become a regular user.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;As for the moral obligation to open source?  Here it is:&lt;br /&gt;&lt;br /&gt;In the GTK2-Perl FAQ, question 5.3, "Show me a simple example for Drag-n-Drop" you need to make 4 changes to get it to work under Perl, v5.10.0 and GTK2 version 1:1.221-4.&lt;br /&gt;&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Replace "&lt;span style="font-family: courier new;"&gt;Gtk2::Ex::Simple::List&lt;/span&gt;" with "&lt;span style="font-family: courier new;"&gt;Gtk2::SimpleList&lt;/span&gt;".  It occurs in 3 places, all near the top.&lt;/li&gt;&lt;li&gt;In the function "_move_from_to", change "&lt;span style="font-family: courier new;"&gt;for my $i (0 .. $#{ @{$fromlist-&gt;{data}}) {&lt;/span&gt;" to "&lt;span style="font-family: courier new;"&gt;for my $i (0 .. $#{$fromlist-&gt;{data}}) {&lt;/span&gt;".&lt;/li&gt;&lt;li&gt;Enjoy!&lt;br /&gt;&lt;/li&gt;&lt;/ol&gt;&lt;br /&gt;If someone wants to send this to the GTK2-Perl bug site, feel free, but watch out for the spam.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/65633101471927506-5884906534031596738?l=upcracky.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://upcracky.blogspot.com/feeds/5884906534031596738/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=65633101471927506&amp;postID=5884906534031596738' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/65633101471927506/posts/default/5884906534031596738'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/65633101471927506/posts/default/5884906534031596738'/><link rel='alternate' type='text/html' href='http://upcracky.blogspot.com/2010/07/beyond-help.html' title='Beyond Help.'/><author><name>Dale Wiles</name><uri>http://www.blogger.com/profile/12609080347734449263</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-65633101471927506.post-5542225054035862130</id><published>2010-05-23T17:52:00.006-04:00</published><updated>2010-05-26T22:56:09.297-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Gnome'/><category scheme='http://www.blogger.com/atom/ns#' term='Linux'/><title type='text'>Gators and Nautilus and DAVs, Oh My!</title><content type='html'>If you're here to get WebDAV working with Nautilus for HostGator, then just jump to the end of this article.  The solution is trivial.&lt;br /&gt;&lt;br /&gt;If you wish to bask in my purple prose, read on:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt;Introduction&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;I'm setting up a site on HostGator, which is a host provider of good repute.  It's starting as place to put some of my little code snippets that don't warrant a full blown project.  Who knows what it will turn in to.&lt;br /&gt;&lt;br /&gt;So far it's been basically a positive experience, but it's not without its shortcomings.  I'm trying to keep notes on dealing with HostGator so other people don't fall in to the same traps I've tripped.&lt;br /&gt;&lt;span style="font-size:130%;"&gt;&lt;br /&gt;&lt;/span&gt;One thing I ran into was getting WebDAV working with Linux.  Specifically Ubunto's "Karmic Kaola" under Gnome, using the Nautilus file manager.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt;Of DAVs and Nautali&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The first problem I ran into is that HostGator gives it's version of WebDAV the name "Web Disk".&lt;br /&gt;&lt;br /&gt;I don't mind them trying to make web interfaces seem a bit easier to deal with, but somewhere on the page they really should tell us that "Web Disk" is really just another name for WebDAV.&lt;br /&gt;&lt;br /&gt;Once you get that under your belt tracking down problems becomes a little easier.&lt;br /&gt;&lt;br /&gt;The next problem I ran into is, well, I'm trying to use Nautilus.&lt;br /&gt;&lt;br /&gt;Nautilus is the Gnome file manager.  For many users it's the entire interface to the disk.  It should, above all other things, be reasonably fast, accurate and reliable.  All else follows from that.&lt;br /&gt;&lt;br /&gt;Unfortunately Nautilus is notorious for running down rat holes while not getting the basics done right.  It has improved a lot in the last 2 years, but it still plays amateur night a few times too often.  This was one of those times.&lt;br /&gt;&lt;br /&gt;I went to the HostGator site and navigated down to the "Web Disk" page.  I selected Nautilus and followed its suggestions.  They wanted me to connect to the location "https://foo.com:2078".&lt;br /&gt;&lt;br /&gt;I did and I got "Could not display 'https://foo.com:2078'."&lt;br /&gt;&lt;br /&gt;Crud.&lt;br /&gt;&lt;br /&gt;I had no idea where to proceed from here.  Is it the instructions, or is my account screwed up, or maybe Nautilus is broke?&lt;br /&gt;&lt;br /&gt;Just to add to the confusion, HostGator has you create a user name when you create an account with them.  No big deal, I chose "wiles".  What they don't really make clear is that this user name isn't your domain user name.  If you register the domain "foo.com" and want mail to come to "wiles@foo.com" then you need to set up another account called "wiles@foo.com".  When I connect with Nautilus, should I use "wiles" or "wiles@foo.com"?  The correct answer is neither, but that part's not HostGator's fault.  More on that later.&lt;br /&gt;&lt;br /&gt;So now I have and unknown protocol, with an untrusted browser connecting to a possibly mis-configured account using an unknown user name.  You have to admit, it's kind of a challenge.  Right?&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt;I Prefer the Term "Challanged"&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;I'm not one to back down from a geek challenge, so into the fray I went.  I ended up spending over an hour chopping around the Internet tubes trying to figure out what's going on.  I got bits and pieces, but nothing I could really sink my teeth into.&lt;br /&gt;&lt;br /&gt;I also wasn't sure of the format of the URL.  For most services you can load in your user name into the URL and you don't have to type it in each time.  For example, if you're using File Transfer Protocol (ftp), and the URL is ftp://foo.com, then you can include your user name with ftp://wiles@foo.com.&lt;br /&gt;&lt;br /&gt;Does that work with "Web Disk"?  What if I'm supposed to be using wiles@foo.com.  Is it ftp://wiles@foo.com@foo.com or ftp://wiles%40foo.com@foo.com.&lt;br /&gt;&lt;br /&gt;"%" is the HTML escape character and "40" is is ASCII code for "@" in hexadecimal.  You knew that didn't you?  I think it's a real sign of progress when connecting to a web site only requires knowledge of arcane character encoding and 2 number bases.&lt;br /&gt;&lt;br /&gt;How about if I just create a bookmark in Nautilus, and then edit each variable separately and see if I can get anywhere?  Nautilus will handle the details right?  If you watch slasher moves there is always a part where some idiot says "lets split up!"  The music they play at that point  belongs here.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt;Scooby Do Takes and Ax to the Forehead&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;First, I'm not going to get anywhere until I figure out the real protocol being used.  "Web Disk" criminy!  Why not just call it "Disk Huggy Bunny" and be done with it.&lt;br /&gt;&lt;br /&gt;I went back to the HostGator page.  It listed a few other OSes and other browsers.  The Mac options were mysterious.  The Window options were baroque.  It's not looking good.  My last hope: Under Linux there was the option to use Nautilus's arch enemy "Konqueror".  I selected it and it offered a download for my system.  Anonymous downloads makes my toes itch, so instead I sent the file directly to a text editor to check it out.&lt;br /&gt;&lt;br /&gt;There, large as life, is the line "URL=webdavs://foo.com:2078".&lt;br /&gt;&lt;br /&gt;I now knew the protocol.  We were moving forward.&lt;br /&gt;&lt;br /&gt;I created the bookmark in Nautilus, set my user name, picked "Secure WebDAV (HTTPS)", and set the port.&lt;br /&gt;&lt;br /&gt;I'm not sure about the start folder.  Is it "/" or "/home/wiles" or "/public_html/wiles@foo.com"?  I held my nose and left it blank.&lt;br /&gt;&lt;br /&gt;I clicked connect and I'll be darned!  I got a password prompt!  Kewl.  I typed in my password and crossed my fingers.&lt;br /&gt;&lt;br /&gt;The error I got is "Could not display 'davs://wiles@foo.com:2078/'.  Error: Not a WebDAV enabled share.  Please select another view and try again."&lt;br /&gt;&lt;br /&gt;This is a truly beautiful error message.  First, it did *not* connect using "davs://wiles@foo.com:2078/" (more on that later).  Second, the share is, in fact, a WebDav enabled share.  And third, "Please select another view and try again." gives me absolutely no useful information.  It was a perfect storm of rotten interface.&lt;br /&gt;&lt;br /&gt;At this point I was pretty frustrated, and lets not kid ourselves, at this point most people have already given up.  Fortunately I'm not most people.  I'm a hard core uber-geek and I eat bad interfaces for breakfast!  Snort!&lt;br /&gt;&lt;br /&gt;I start creating bookmarks like they're going out of style.  I try every combination I can think of.  It's slow, it's tedious, it's everything a computer shouldn't be, but alas, are, and in the end, it was futile.  I could not get Nautilus to connect to my HostGator site.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt;Nautilus: A Weasel in Drag&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Hmmmm.  Do I trust Nautilus? Would I lend it $10 if it asked?  No.  No I would not.  Then why would I believe that its rotten bookmarks are doing what they say their doing?  It's time to go back to first principals and start over again.&lt;br /&gt;&lt;br /&gt;I knew, with reasonable confidence, that I'm trying to make a WebDav connection.  I also think that the "s" in WebDavs" stands for "secure", as in a Secure Socket Layer (SSL) connection.  When you drop the SSL requirement at HostGator, the socket number changes from 2078 to 2077.  That was enough for me to make another try.&lt;br /&gt;&lt;br /&gt;I fired up Nautilus, and in the "Location" bar I typed "webdav://wiles@foo.com:2077".  I got back "Nautilus cannot handle 'webdav' locations."  Wow.  What a nice, simple and useful error message.  Are we sure this is Nautilus talking?&lt;br /&gt;&lt;br /&gt;"WebDAV" isn't going to work, but I've also heard it called just "dav". I tried that.&lt;br /&gt;&lt;br /&gt;With "dav://wiles@foo.com:2077"  I got the password pop up!  I also got the "select another view" error message.  Arg!&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt;Blinky the Wonder Idiot&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;Then the dawn came.  Does anyone else see the huge blinking "Dale is an idiot!" sign in the previous paragraph?  It took me a while to see it.&lt;br /&gt;&lt;br /&gt;Even though it's the standard, and Nautilus is reacting to it, do I really know that the "wiles@" part of the URL is kosher?  What happens if I don't use it?&lt;br /&gt;&lt;br /&gt;Into the breach with "dav://foo.com:2077".  This time the pop up asked for user name and password.  I used "wiles" again and typed in my password.&lt;br /&gt;&lt;br /&gt;I connected like a 13 year old with an evangelist.  Son of a ...&lt;br /&gt;&lt;br /&gt;I had spent more than 4 hours trying to get this to work, and it all comes down to this one sentence.  It really doesn't make HostGator or Gnome/Linux look good does it?&lt;br /&gt;&lt;br /&gt;I wasn't where I want to be yet, so I kept pressing forward. I was going to get SSL working.&lt;br /&gt;&lt;br /&gt;"davs://foo.com:2078".  Yup.  I was in.  Sort of anticlimactic isn't it.&lt;br /&gt;&lt;br /&gt;One last thing.  I really wanted to be able to connect to HostGator by clicking on a shortcut on my desktop.&lt;br /&gt;&lt;br /&gt;The solution is trivial.  Right click on the desktop and select "create launcher".  Give it a name, and in the "Command" field type "nautilus davs://foo.com:2078" or "nautilus dav://foo.com:2077", depending on whether you want to use SSL or not.  (You do, unless it you can't get it working.)&lt;br /&gt;&lt;br /&gt;That's it.&lt;br /&gt;&lt;br /&gt;I'm sending this URL to HostGator so they can fix their documentation, but until they do, enjoy updating your HostGator sight via Nautilus.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/65633101471927506-5542225054035862130?l=upcracky.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://upcracky.blogspot.com/feeds/5542225054035862130/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=65633101471927506&amp;postID=5542225054035862130' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/65633101471927506/posts/default/5542225054035862130'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/65633101471927506/posts/default/5542225054035862130'/><link rel='alternate' type='text/html' href='http://upcracky.blogspot.com/2010/05/gators-and-nautilus-and-davs-oh-my.html' title='Gators and Nautilus and DAVs, Oh My!'/><author><name>Dale Wiles</name><uri>http://www.blogger.com/profile/12609080347734449263</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-65633101471927506.post-7553535487836374013</id><published>2009-10-18T13:32:00.002-04:00</published><updated>2009-10-18T13:56:46.972-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Geeky'/><category scheme='http://www.blogger.com/atom/ns#' term='Open Source'/><category scheme='http://www.blogger.com/atom/ns#' term='Android'/><title type='text'>Android Phone Home</title><content type='html'>&lt;span style="font-size:180%;"&gt;Getting Started&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;As some of you know, I've been playing with a new toy.&lt;br /&gt;&lt;br /&gt;Android is a new operating system from Google.  It's designed for cell phones and other small computers.  I've been learning to program it.&lt;br /&gt;&lt;br /&gt;For the first couple of months I was mostly working with the Android Software Development Kit (SDK) and the Android emulator.  With the emulator you can write and test Android applications (Aps) from the comfort of your computer.  As learning Android is like drinking from a fire hose, I wasn't going to invest any money on hardware until I knew I could get something done with it.&lt;br /&gt;&lt;br /&gt;I'm at the stage now where I can generate simple programs and I have some definite ideas where to go, so I decided to bite the bullet and buy an Android developer phone.&lt;br /&gt;&lt;br /&gt;I ordered my phone and a very few days it showed up.  Good job Google!&lt;br /&gt;&lt;br /&gt;I fired it up.  It munches away for a few seconds, then it tells me "No SIM" and just sits there.  Wha?&lt;br /&gt;&lt;br /&gt;I know what a SIM is.  It's a Subscriber Identity Module, which is a little piece of plastic that modern cell phones use to keep track of who you are.  Take a SIM out of one phone and put it into another, and the new phone now has the old phone's number.  Neat huh?&lt;br /&gt;&lt;br /&gt;I'm using this as a development platform.  I don't want to use it to make calls, so I don't need a SIM for it, right?  I'm sure that Google has provided an easy work around for this.  I'll just check the Internet tubes and find it.  Oy!  2 days later I had real access to my phone.&lt;br /&gt;&lt;br /&gt;The rest of this blog is designed to save the next poor swine the aggravation I went through in registering my phone.&lt;br /&gt;&lt;br /&gt;After checking around I found out that Google not only wants you to have a SIM card, but you also need a data plan on that SIM card!  I don't want a data plan, I don't need a data plan, And, at the rate the phone company rapes at, I can't afford a data plan!&lt;br /&gt;&lt;br /&gt;Then it just gets silly.  You only need the data plan for about 5 minutes, just long enough to connect to Google and register your phone.  After that you can chuck it out the window.  Oh, did I mention that the phone has WiFi?&lt;br /&gt;&lt;br /&gt;You need a data plan to register a phone to get to the WiFi, which you could use, if you could get to it, to register your phone!  You're killing me Google.  Your just killing me.&lt;br /&gt;&lt;br /&gt;Fortunately, if you have a regular SIM card (say from your current phone) and you're already running the Android SDK then it's not too hard to fire up WiFi on your phone and bypass the data plan requirement.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:180%;"&gt;Away We Go!&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;First we'll get your Linux box to see the phone via the USB cable.  I'm running CentOS 5, which is like Red Hat 5.  There are other guides out there for Windows and Ubuntu.  This guide is for CentOS.&lt;br /&gt;&lt;br /&gt;First install the Android SDK on your system.  Look around on the Internet for instructions.  You don't need everything under the sun, but you do need the "adb" (Android Debug Bridge) command.&lt;br /&gt;&lt;br /&gt;Plug your USB cable into your computer and your phone.&lt;br /&gt;&lt;br /&gt;Open a root shell on your computer.&lt;br /&gt;&lt;br /&gt;After a couple of seconds type "lsusb".  You should see a list of the devices attached via USB to your computer.  Somewhere in the list should be an entry for "High Tech Computer Corp."  "High Tech Computer" is HTC.  HTC makes your phone.  If you see it then you know that USB is up and running and can see your phone.&lt;br /&gt;&lt;br /&gt;The next question is does it see it as a phone or just a very expensive jump drive?&lt;br /&gt;&lt;br /&gt;Type "adb devices".  If you see an entry that begins with "HT" followed by a bunch of characters and the word "device", then skip to the next section.  If adb can't see your phone, then we need to tweak the USB daemon so that it does.&lt;br /&gt;&lt;br /&gt;This part took me a long time to get working.  Apparently CentOS is using an older version of udevd, which is the program that scans the computer looking for new USB toys being plugged in.&lt;br /&gt;&lt;br /&gt;Go in to /etc/udev/rules.d and look for a file named something like "90-android.rules".  The leading number varies.  It probably isn't there.  No problem.  You need to create/edit it until it looks like this.  Make sure it has the same permissions as the other files in the directory.&lt;br /&gt;&lt;br /&gt;&lt;pre style="font-family: courier new;"&gt;# This file lets Linux recognise my Android Developer Phone in&lt;br /&gt;# a way that the adb command can handle.&lt;br /&gt;# Uncomment one of the lines below and run:&lt;br /&gt;#    udevcontrol reload_rules&lt;br /&gt;#    adb devices&lt;br /&gt;# If it lists your phone, you're done.  If not comment out the&lt;br /&gt;# current line, uncomment the next line and run udevcontrol again.&lt;br /&gt;#&lt;br /&gt;# The 3rd line (usb_device) was the charm for me.&lt;br /&gt;#&lt;br /&gt;SUBSYSTEM=="usb", ATTR{idVendor}=="0bb4", MODE="0666"&lt;br /&gt;# SUBSYSTEM=="usb", SYSFS{idVendor}=="0bb4", MODE="0666"&lt;br /&gt;# SUBSYSTEM=="usb_device", SYSFS{idVendor}=="0bb4", MODE="0666"&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Follow the instructions in "90-android.rules" and you should end up with a visible Android phone.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:180%;"&gt;Connecting to the Phone&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;From the command line type: adb shell&lt;br /&gt;&lt;br /&gt;After a moment or two you should get a "$" prompt.  This means that you're in the phone talking as a regular user.&lt;br /&gt;&lt;br /&gt;Type "su".&lt;br /&gt;&lt;br /&gt;If the prompt changes from "$" to "#", then you're in as root.&lt;br /&gt;&lt;br /&gt;Type "exit" to return to a regular user.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:180%;"&gt;Bypassing the SIM check&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;There are two ways to do this:&lt;br /&gt;&lt;br /&gt;The first, and easiest, is to plug in a SIM card.  It doesn't matter that it doesn't have a data plan.  This is just to get past the check.&lt;br /&gt;&lt;br /&gt;The second, and I haven't tried this myself, is to fool the phone into thinking it passed the check.  Check out http://forum.xda-developers.com/showthread.php?t=452316 for instructions.&lt;br /&gt;&lt;br /&gt;Note, for the second technique, if you have a developer phone then you don't need to root break it.  Just type "su" at the adb shell prompt and you're root.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:180%;"&gt;Registering with out the Data Plan&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;At this point your phone should be at the registration screen.&lt;br /&gt;&lt;br /&gt;From adb, as a regular user, type:&lt;br /&gt;&lt;br /&gt;&lt;pre style="font-family: courier new;"&gt;am start -a android.intent.action.MAIN -n com.android.settings/.Settings&lt;/pre&gt;&lt;br /&gt;In a couple of seconds the "settings" screen should pop up on your phone.&lt;br /&gt;&lt;br /&gt;Set up your WiFi and hit the back arrow.  You're back at the registration, which you can now do via WiFi.&lt;br /&gt;&lt;br /&gt;If for some reason the settings screen doesn't pop up, try&lt;br /&gt;&lt;br /&gt;&lt;pre style="font-family: courier new;"&gt;setprop persist.service.adb.enable 1&lt;/pre&gt;&lt;br /&gt;and then try the settings command again.&lt;br /&gt;&lt;br /&gt;Once you're registered you may want to go to the Android market place and pull down an ap called "APNdroid".  It screws with the data plan APN so that your phone can't connect no matter how hard it tries.  Bite me AT&amp;amp;T.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:180%;"&gt;Using your Phone as a Jump Drive&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;One last thing, did you notice that your computer can see your phone as a jump drive but can't access it?  That's easy to fix.&lt;br /&gt;&lt;br /&gt;When you plug in your phone via USB, you'll notice a little USB forky type icon shows up in the upper left hand of the phone screen.  This is the notification area.  Pull it down with your finger.  Click on the USB notification and then click on "mount".  You're good to go!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/65633101471927506-7553535487836374013?l=upcracky.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://upcracky.blogspot.com/feeds/7553535487836374013/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=65633101471927506&amp;postID=7553535487836374013' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/65633101471927506/posts/default/7553535487836374013'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/65633101471927506/posts/default/7553535487836374013'/><link rel='alternate' type='text/html' href='http://upcracky.blogspot.com/2009/10/android-phone-home.html' title='Android Phone Home'/><author><name>Dale Wiles</name><uri>http://www.blogger.com/profile/12609080347734449263</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-65633101471927506.post-796696608120566172</id><published>2009-09-07T15:32:00.002-04:00</published><updated>2009-09-07T15:35:39.031-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Geeky'/><category scheme='http://www.blogger.com/atom/ns#' term='Programming'/><title type='text'>Spanking Dawkins's Weasel</title><content type='html'>One of the problems with learning a new programming language is coming up with interesting "beginner" programs.  Most beginning programs do something exciting like printing out "Howdy, Howdy, Howdy, Joe".  Heart stopping stuff ain't it?&lt;br /&gt;&lt;br /&gt;To ease this a bit, whenever I come up with an interesting idea for a beginner program, I'll write it up and you can give it a shot.&lt;br /&gt;&lt;br /&gt;My hands down favorite simple program is something called Dawkins's Weasel.&lt;br /&gt;&lt;br /&gt;Richard Dawkins is a evolutionary biologist from Oxford.  He wanted to come up with a program to show the difference between a random mutation and a random mutation with selection.  The result is a simple, straight forward program called "Dawkins's Weasel".&lt;br /&gt;&lt;br /&gt;Note: Whenever I say "letter" below, I mean letters and/or spaces.  Saying letter and/or space all over the place makes for a tedious read.&lt;br /&gt;&lt;br /&gt;First we start with a target sentence, which we'll call "Target".  This is what all good little sentences want to be when they grow up.  Dawkins used "methinks it is like a weasel" and so will we.&lt;br /&gt;&lt;br /&gt;Next we create a parent sentence called "Parent".  This is a gibberish sentence of random letters that is the same length as Target.  "y ksqmjwepqtgtyylmfexstvktpa" will work, as will "aaaaaaaaaaaaaaaaaaaaaaaaaaaa".&lt;br /&gt;&lt;br /&gt;Our goal is going to be to evolve Parent into Target.&lt;br /&gt;&lt;br /&gt;Parent will produce a litter of children.  The fittest of the litter will then become the next parent.  This continues until we produce a Parent that equals Target.  It's survival of the fittest and all that jazz.&lt;br /&gt;&lt;br /&gt;Unfortunately the sex life of a sentence is pretty dull.  The way a sentence has a baby sentence is by copying itself and then changing a single letter at random.  Not exactly the stuff of pornos.  We'll call the baby sentence "Child".&lt;br /&gt;&lt;br /&gt;As for who's the fittest?  We'll use something simple.  We'll count the number of letters in Child that match Target.  For example, the sentence "aaaaaaaaaaaaaaaaaaaaaaaaaaa" would score a 2.  "methinks it is like a measel" would score 27.  If there is more than one pick of the litter, choose one.  It doesn't matter how.&lt;br /&gt;&lt;br /&gt;That's pretty much it.  The only real variable you get to play with is the size of the litter.  If you start with a litter of 50 then you tend to finish in less that 100 generations.  Once you get the code working, starting dialing playing with the litter size to see how it effects the generation count.&lt;br /&gt;&lt;br /&gt;I'll try to keep my eye out for other interesting algorithms worthy of posting.  If you know of any that are fun, the add a comment.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/65633101471927506-796696608120566172?l=upcracky.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://upcracky.blogspot.com/feeds/796696608120566172/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=65633101471927506&amp;postID=796696608120566172' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/65633101471927506/posts/default/796696608120566172'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/65633101471927506/posts/default/796696608120566172'/><link rel='alternate' type='text/html' href='http://upcracky.blogspot.com/2009/09/spanking-dawkinss-weasel.html' title='Spanking Dawkins&apos;s Weasel'/><author><name>Dale Wiles</name><uri>http://www.blogger.com/profile/12609080347734449263</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-65633101471927506.post-2574554274976000415</id><published>2009-07-20T00:27:00.003-04:00</published><updated>2009-07-20T20:00:51.416-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='comics'/><category scheme='http://www.blogger.com/atom/ns#' term='family'/><category scheme='http://www.blogger.com/atom/ns#' term='writing'/><title type='text'>Back to (Paranoia) High School</title><content type='html'>Whelp, I'm back from vacation and all in one piece.  I'm a bit shell shocked, but all in all it was a good time.&lt;br /&gt;&lt;br /&gt;I'm not one of those people who really gos on vacation.  I more survive them.  My home life is driven from project to project so when I hit a vacation that I can't spend in front of the computer I'm kind of at a loss.&lt;br /&gt;&lt;br /&gt;However, my dearly beloved explained to me that my mother in-law put a lot of work into setting up this vacation, so my other option was to be in kind of a wheelchair, so vacate I did.&lt;br /&gt;&lt;br /&gt;The big problem was, we vacated to a dead zone.  No phones, no lights no motorcars, and &lt;span style="font-weight: bold;"&gt;no&lt;/span&gt; Internet.  That means no real way to do any writing.&lt;br /&gt;&lt;br /&gt;I hate writing with a pen.  My hand writing is a scrawl and it's sooo slow!  And once I'm back amongst the living, I have to transcribe it back into the computer.&lt;br /&gt;&lt;br /&gt;With writing on mashed up trees as a failure, I tried using a small laptop.  That kind of dominates the landscape and emphasized how much I'm ignoring my family.  Not smart for this wheelchair phobic.  I needed something sneaker.&lt;br /&gt;&lt;br /&gt;How about my phone?  It's got a 2 gig chip, supports text messaging and can hide in my hand.  Could I use that?&lt;br /&gt;&lt;br /&gt;Nope!  My phone does allow memos, but they have to be less than 100 characters.  Let me repeat that.  My crappy phone, with 2 gig available, won't even let you save a memo as long as a Twitter "tweet"!  Thrilling.&lt;br /&gt;&lt;br /&gt;I know!  I could use it as a voice recorder!  Yea, I could do that.  When I write I tend to talk out what I'm writing anyway.  I'll just talk into my phone and record everything!&lt;br /&gt;&lt;br /&gt;Unfortunately, with my current phone I have to shout to be heard.  Every time inspiration hit, my in-laws would hear me shouting to my invisible friend who hides in my hand.&lt;br /&gt;&lt;br /&gt;Now my in-laws think I'm nuts.&lt;br /&gt;&lt;br /&gt;I can live with that, but I also got to play with writer's block.  Such fun.&lt;br /&gt;&lt;br /&gt;Actually, it a weird sort of way I don't mind writer's block.  At least I don't mind having it once I've overcome it.  It's kind of like the old saw about smacking yourself with a hammer because it feels so good once you stop.  I sorta go through that.&lt;br /&gt;&lt;br /&gt;As you may or may not know, I used to write for a comic strip called &lt;a href="http://www.paranoiahigh.webs.com/"&gt;"Paranoia High"&lt;/a&gt; (Check it out.)  It was a lot of fun and Dave (the artist) is a friend of mine.&lt;br /&gt;&lt;br /&gt;After a while Dave took over the writing and I went on to fame as a geek blogger on them Internet tubes.&lt;br /&gt;&lt;br /&gt;To make a long story short, we fade the mics and queue the organ and it's a year or so later and I'm back to writing the strip.  Huzzah!  The only problem is, can I still write the strip?  Not &lt;span style="font-weight: bold;"&gt;May&lt;/span&gt; I, &lt;span style="font-weight: bold;"&gt;Can&lt;/span&gt; I?&lt;br /&gt;&lt;br /&gt;Ya see, when Dave consolidated the strip, I gave him a list of the ideas I had at the time.  No big deal, I have the list around somewhere and Dave has it too.  But old ideas aren't enough.  Can I come up with new ones?&lt;br /&gt;&lt;br /&gt;I could feel the tightening grip of initial dread.  What if my last creative idea was really my &lt;span style="font-weight: bold;"&gt;LAST CREATIVE IDEA&lt;/span&gt;!?!?  You civilians don't savvy the pain we creative types go through when we birth forth art and stuff.&lt;br /&gt;&lt;br /&gt;How can I explain it?  It's like Paris Hilton waking up and finding out her butt has run off and joined the Peace Corps.  No tush?  No job!  Writing is like that, except Paris's butt is our ideas.&lt;br /&gt;&lt;br /&gt;Hopefully that image will help you develop an appreciation for the written word.&lt;br /&gt;&lt;br /&gt;That analogy would have worked much better if it were a breast joke, but I couldn't think of any famous current women who are know for their big racks.  Maybe Micheal Jackson, but he's dead.&lt;br /&gt;&lt;br /&gt;Ms Proust is know for her rack, but she's a character in &lt;a href="http://www.paranoiahigh.webs.com/"&gt;"Paranoia High"&lt;/a&gt;.  You really should check it out.  (Note the reoccurring motif, that's the art baby!)&lt;br /&gt;&lt;br /&gt;So I started running through ideas.  Film strips?  I think that's from the old list.  Standardized tests?  Nope, the old list.  How about exploding frogs?  Damn!  School Principal Mike Ducacus?  Whoa!  Wrong decade!&lt;br /&gt;&lt;br /&gt;It was looking pretty bleak for new strips, but I stayed with it.  Football?  Feral students?  Sentient lunch meat?  Damn! Damn! Damn!  How about Hall Monitors?&lt;br /&gt;&lt;br /&gt;Hall Monitors?  Not on the old list.  Hmm.  Uniforms, Tazers, RoboCop, Juntas?  Yea.  Add "Hall Monitor" to the new list.&lt;br /&gt;&lt;br /&gt;After that things started to roll.  Walmart vs the school store?  New!  Texting NORAD?  Brand spanking new! "Shakespeare: The Musical!"  Oh yea baby.  We're back in action!&lt;br /&gt;&lt;br /&gt;Why are the in-laws looking at me?&lt;br /&gt;&lt;br /&gt;Oh yea, I'm shouting at my fist.&lt;br /&gt;&lt;br /&gt;They really think I'm nuts.&lt;br /&gt;&lt;br /&gt;I gotta get a new phone.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/65633101471927506-2574554274976000415?l=upcracky.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://upcracky.blogspot.com/feeds/2574554274976000415/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=65633101471927506&amp;postID=2574554274976000415' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/65633101471927506/posts/default/2574554274976000415'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/65633101471927506/posts/default/2574554274976000415'/><link rel='alternate' type='text/html' href='http://upcracky.blogspot.com/2009/07/back-to-paranoia-high-school.html' title='Back to (Paranoia) High School'/><author><name>Dale Wiles</name><uri>http://www.blogger.com/profile/12609080347734449263</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-65633101471927506.post-2484513067151799790</id><published>2009-07-07T00:21:00.002-04:00</published><updated>2009-07-07T00:36:50.679-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Geeky'/><category scheme='http://www.blogger.com/atom/ns#' term='Programming'/><category scheme='http://www.blogger.com/atom/ns#' term='Gnome'/><category scheme='http://www.blogger.com/atom/ns#' term='Profundity'/><category scheme='http://www.blogger.com/atom/ns#' term='Linux'/><title type='text'>A Window In The Ghetto.</title><content type='html'>One of the more baffling elements of Linux distributions is their constant relegation of scripting languages to the command line ghetto.&lt;br /&gt;&lt;br /&gt;On one side you have the all the wowwie zowie windowy programs, most of which are written, for no good &lt;span style="font-weight: bold;"&gt;technical&lt;/span&gt; reason, in C.  On the other hand you have thousands of useful Perl/Python/Java programs that rarely get used because they have command line interfaces.&lt;br /&gt;&lt;br /&gt;If we really want to harness the power of Gnome, then we need to make it easier to write Gnome programs in the most popular languages that Gnome supports.  These languages are scripting languages.&lt;br /&gt;&lt;br /&gt;Scripting exclusively for the command line almost made sense 10 years ago.  Old versions of scripting languages didn't really interface well with the Graphic User Interface (GUI) and Text User Interface (TUI) libraries.  You often had to have completely separate interpreters for GUI and non GUI interfaces.  Anyone remember perlx?&lt;br /&gt;&lt;br /&gt;Now days that's bunk.  Perl, Python and Java all have officially supported interfaces to GTK, and, in case you don't know, they're *MUCH* easier to use than the C interface.  I'm talking an order of magnitude!&lt;br /&gt;&lt;br /&gt;As for the TUI, how many tasks do server administrators do that would be made much easier with a simple curses interface?&lt;br /&gt;&lt;br /&gt;Python includes a Curses interface by default (it's why I learned Python).  Perl isn't too far behind with a very stable Curses package on CPAN.  This could be added to any distribution in a matter of minutes.  I'm not sure about Java, but if it doesn't exist it wouldn't take long to make one.&lt;br /&gt;&lt;br /&gt;The point being, that we have to start pushing distributions to include text and graphic interface libraries with the languages they support, and give them the &lt;span style="font-weight: bold;"&gt;same status&lt;/span&gt; as the language.  If the language is included by default, so are the GUI and TUI libraries.  Don't let your hot Molly Ringwald fantasies blind you.  The '80s are over.  We need better interfaces.&lt;br /&gt;&lt;br /&gt;Once the user base can depend on the libraries being there, we're going to open up Gnome to a whole to set of ideas.  These new programmers greatly out number the current set of Gnome C programmers.  They'll be able to fix user level problems that we hardcore programmers don't even know exist.&lt;br /&gt;&lt;br /&gt;If you're convinced at this point, then start pestering Ubuntu.  I think they're the closest to having all the pieces.  Then we can go after Debian and then we'll gang up on Red Hat.&lt;br /&gt;&lt;br /&gt;If you're not convinced, then let me over make my point with sort of a preemptive FAQ.&lt;br /&gt;&lt;span style="font-size:130%;"&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;* We didn't do it last time, why do it now?&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;OK, you lead with an Ace.&lt;br /&gt;&lt;br /&gt;First of all, modern bindings to the major scripting languages are dependable and stable.  This wasn't true before.&lt;br /&gt;&lt;br /&gt;Also, we're in a much more graphical time.  Most users consider dropping to the command line a failure of the interface.&lt;br /&gt;&lt;br /&gt;We need a bridge between the two.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt;&lt;span style="font-weight: bold;"&gt;* What if the bindings disappear?&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The odds of the supported bindings disappearing any time soon is negligible.  As for other bindings, if more people start using them, the more dependable they become.  Does anyone really expect "vim" or "sendmail" to disappear any time soon?&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt;&lt;span style="font-weight: bold;"&gt;* What's wrong with C?&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;Nothing, in it's place.  If I were to suggest dropping all the scripting languages and doing everything in C, I'd be laughed off the Internet.  Somehow we're supposed to believe that the argument is less absurd when you pop up a window.&lt;br /&gt;&lt;span style="font-size:130%;"&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;* Distribution X has the bindings in the "Extras" section.  What's wrong with that?&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;In the business world getting managers to allow "extras" on a system is a hard sell.  Damn few middle managers get fired for failing to innovate.&lt;br /&gt;&lt;br /&gt;Besides, if it's in it's own section then there must be something wrong with it.  Right?  Can I get back to you on that?&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt;&lt;span style="font-weight: bold;"&gt;* You can get all those bindings at site X.com.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;If the "Extra" argument is a hard sell, then the 3rd party site is a no-sale.  They're right on this one.&lt;br /&gt;&lt;br /&gt;A company pays for Red Hat license instead of using the free CentOs because it gives them someone to yell at if things go boom.  If you depend on 3rd party software then you get sent to finger pointing hell.&lt;br /&gt;&lt;br /&gt;I currently have a problem with my CentOS box at home.  I'm using CentOS repositories and a few other reliable sites.  Two sites depend on different versions of the same library.  I can't upgrade until I find and remove the conflicting programs.&lt;br /&gt;&lt;br /&gt;Run that past a manager and you'll be a Microsoft shop by the end of the day.&lt;br /&gt;&lt;br /&gt;Besides, if the software is trustworthy and useful then it would be include with the distribution.  Feel free to repeat this until your head explodes.  It's what they do in corporateland.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt;&lt;span style="font-weight: bold;"&gt;* If you want to use the OS, learn the commands!&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;If you want to make me learn a bunch of esoteric commands, I'm using another OS!&lt;br /&gt;&lt;br /&gt;Let's use the "chage" command as an example.  It's a pretty simple command which I use about once a year.  Every time I use it I have to look up the command flags, because I only use it once a year.&lt;br /&gt;&lt;br /&gt;Now wrap it in a curses interface.  I no longer have to use the man page.  "chage-curses" pops up the user's info, lets me change it.  It even uses a calendar to help me change the dates.  It then munches up the interface changes into a command line call which make the actual changes.&lt;br /&gt;&lt;br /&gt;Take it one step farther.  I am a hot shot l33t Hax0r.  I shouldn't be doing this peasant crap at all.  I create "chage-gtk" in 30 lines of Perl, and now my helper monkey does all the chaging while I hack the cosmos.&lt;br /&gt;&lt;span style="font-size:130%;"&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;* Surly you don't mean every scripting language?&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Yep I do.  For server admins the command line will live on forever.  It's the easiest way to make bulk or automated changes.&lt;br /&gt;&lt;br /&gt;Your average user isn't a server admin.  We need to stop dressing them up like one and making them dance for us.&lt;br /&gt;&lt;br /&gt;Every general purpose language that has a stable GUI and/or TUI and is already included in a distribution needs to have those bindings included.  We need to show non-Linux users, and other programmers that we're serious bout getting out of the 1980s.  That means that any general purpose language that can help us out needs to be embraced.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt;&lt;span style="font-weight: bold;"&gt;* What about languages that don't have stable GUI/TUI bindings?&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Most of the popular languages have had stable bindings for years.  Perl, Python and Java all have officially supported GTK/Gnome bindings.&lt;br /&gt;&lt;br /&gt;If a language only has a stable TUI, but not GUI binding, then just include the TUI.  If it has no stable bindings at all, then it remains command line only until it gets it's act together.&lt;br /&gt;&lt;span style="font-size:130%;"&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;* Some languages have GUI/TUI bindings that are a bitch to make into packages.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Let the developer of both the bindings and the language know that that's the reason the binding isn't being included.  Most will gladly fix their code or provide the distributions with packages.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt;&lt;span style="font-weight: bold;"&gt;* Jeez, our distribution is getting awfully big.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;One&lt;/span&gt;: The graphic libraries shouldn't really be that big, they're just interfaces to existing libraries.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Two&lt;/span&gt;: This move is important!  If going from a command line interface to a graphic interface is only being held back by a pack of Luddites, then Linux doesn't deserve to play with the big boys.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Three&lt;/span&gt;:  This is also an advantage that we seem to be afraid to exploit.  Does any other OS come with, by default, an easy way to create useful window based programs just using a text editor?  We shouldn't be hiding this feature, we should be shoving it down peoples throats!&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt;&lt;span style="font-weight: bold;"&gt;* Why should we include fooscript when real programmers use barscript?&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;You're an idiot.&lt;br /&gt;&lt;br /&gt;This isn't about the size of your digital penis, it's about removing completely artificial barriers from the users.  Gnome doesn't really serve the clever user well.  This problem is trivial to fix.  We need to do so in the most inclusive way.&lt;br /&gt;&lt;br /&gt;If Perl gets the job done for you, great!  If you like Python, no problem.  Someone at the Guile compound must have got laid because it's perked right up in the last few months.  Guess what?  It has both a curses and Gnome interface.  Welcome to the club Guile!  (Assuming your bindings don't suck.)&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt;&lt;span style="font-weight: bold;"&gt;* Real programmer program in C.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Actually they don't.  Most casual programmers start by looking at a program that almost does what they want, and then pick at it.  If the program is a script, it's much easier to play with.&lt;br /&gt;&lt;br /&gt;For the inquisitive user, in real terms, modern computers are less powerful then they were in the days of Dos and Unix.  Back then a curious user who had an itch, could scratch it with a batch file or shell script.  This new command was on par with anything else on the system.  If it was generally useful they could email it to anyone else and they could use the new command too.  Now days a clever user has to either waste monkey cycles writing in C or they have to have other users download the script-gui library package.&lt;br /&gt;&lt;span style="font-size:180%;"&gt;&lt;br /&gt;Pithy Summary&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;This is a stupid pointless wall, and it needs to come down!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/65633101471927506-2484513067151799790?l=upcracky.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://upcracky.blogspot.com/feeds/2484513067151799790/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=65633101471927506&amp;postID=2484513067151799790' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/65633101471927506/posts/default/2484513067151799790'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/65633101471927506/posts/default/2484513067151799790'/><link rel='alternate' type='text/html' href='http://upcracky.blogspot.com/2009/07/window-in-ghetto.html' title='A Window In The Ghetto.'/><author><name>Dale Wiles</name><uri>http://www.blogger.com/profile/12609080347734449263</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-65633101471927506.post-3293244527948307458</id><published>2009-06-23T20:31:00.003-04:00</published><updated>2009-06-23T21:32:49.296-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Geeky'/><category scheme='http://www.blogger.com/atom/ns#' term='Programming'/><category scheme='http://www.blogger.com/atom/ns#' term='Linux'/><title type='text'>Emacs: P3 Separate But Equal.</title><content type='html'>In the first post, we went over some basic theory.  In the second post we calibrated Emacs's concept of terminal color with the reality of our terminal program.  We also created a file called "color_test.el" which is useful for showing the common "faces" used in programming.&lt;br /&gt;&lt;br /&gt;I this part we'll explain what a "face" is and show to get terminal faces and display faces to play nice.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:180%;"&gt;Faces&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;A "face", in Emacs parlance, is all the characteristics of a piece of text.  This includes it's font, size, whether it's bold or italics and it's color.&lt;br /&gt;&lt;br /&gt;In the olden days, faces were created by hand.  They're not too bad once you get a hold of them and they're surprisingly flexible.&lt;br /&gt;&lt;br /&gt;Emacs faces can do all sorts of snazzy things like auto-detect whether they're on a terminal, change their color if the background color changes and invert themselves if they're on a black and white screen.  Here's an example taken from the Emacs Elisp manual, section "Elisp/Display/Faces/Defining Faces".&lt;br /&gt;&lt;PRE&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;(defface region&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;  `((((type tty) (class color))&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;     (:background "blue" :foreground "white"))&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;    (((type tty) (class mono))&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;     (:inverse-video t))&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;    (((class color) (background dark))&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;     (:background "blue"))&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;    (((class color) (background light))&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;     (:background "lightblue"))&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;    (t (:background "gray")))&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;  "Basic face for highlighting the region."&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;  :group 'basic-faces)&lt;/span&gt;&lt;br /&gt;&lt;/PRE&gt;&lt;br /&gt;Alas, you young punks don't wanna do it by hand.  You'd rather use Emacs's built in customizer.  Fair enough.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:180%;"&gt;The Customizer.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;I'm not going into a lot of detail here as there are other web resources dedicated to customizing Emacs.&lt;br /&gt;&lt;br /&gt;For the sake of this article we need to know:&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;  "M-x list-faces-display" shows you all the faces Emacs knows about.&lt;/li&gt;&lt;li&gt;Pressing &lt;return&gt; when your cursor is on the face name will let you edit it.&lt;/return&gt;&lt;/li&gt;&lt;li&gt;&lt;return&gt;In programming mode, all the fonts we care about begin with the wildly intuitive name "font-lock-".&lt;/return&gt;&lt;/li&gt;&lt;li&gt;&lt;return&gt;When you're customizing in terminal mode don't forget about "Weight Bold" and "Weight Light".  In most terminal emulators they give you extra colors to play with.&lt;/return&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:180%;"&gt;Multiple Customs.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;If you're using a new version of Emacs, you can go into the customizer, click on the "state" button and select "Show All Display Specs".  Then click on "Display" and choose "Check List".  This lets you select the modes that you want the changes for.  If this gets the job done, then you're done.  I've had trouble with edits in TTY mode stomping on my edits in display mode, so I like to keep the variables separate.&lt;br /&gt;&lt;br /&gt;After much (and I do mean multiple days) experimenting, I've chosen a more robust solution that is easier to maintain and is a lot harder to stomp on.&lt;br /&gt;&lt;br /&gt;Whenever you customize a face and save it, Emacs replaces the function "custom-set-faces" with a new version that has your changes in it.  The change is written into your custom file.  This file could be the end of your ~/.emacs file or the file named in the "custom-file" variable.  I'll use the generic "custom file" because I don't care where it actually is.&lt;br /&gt;&lt;br /&gt;The way I handle multiple customizations is to customize them via the customizer.  Then load the custom file back into Emacs and rename the custom-set-faces function so it only fires when you're in either terminal or display mode, but not both.&lt;br /&gt;&lt;br /&gt;It's very easy to do and it's mostly cut and paste.&lt;br /&gt;&lt;br /&gt;Load your Emacs custom file.  Before any "custom-set-faces" commands, add these 2 functions:&lt;br /&gt;&lt;PRE&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;(defun my-custom-set-faces-display (&amp;amp;rest faces)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;  "Load these faces if Emacs is in windows mode."&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;  (when window-system&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;    (apply 'custom-set-faces faces)))&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;(defun my-custom-set-faces-terminal (&amp;amp;rest faces)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;   "Load these faces if Emacs is in terminal mode."&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;   (when (not window-system)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;     (apply 'custom-set-faces faces)))&lt;/span&gt;&lt;br /&gt;&lt;/PRE&gt;&lt;br /&gt;Now look at your current "custom-set-faces" command.  Is it set up for display mode?  Then rename it to "custom-set-faces-display".  If it's for the terminal then rename it "custom-set-faces-terminal".  Now add an empty function call for the "other" function.  If you set custom-set-faces-display, then add "(custom-set-faces-terminal)".  If you set custom-set-faces-terminal, then add "(custom-set-faces-display)".&lt;br /&gt;&lt;br /&gt;Mine looks like this:&lt;br /&gt;&lt;PRE&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;(custom-set-faces-terminal&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;  '(font-lock-function-name-face&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;     ((t :foreground "LightlyDepressed" :weight bold)))&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;  '(font-lock-comment-face ((t :foreground "cyan"))))&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;(custom-set-faces-display)&lt;/span&gt;&lt;br /&gt;&lt;/PRE&gt;&lt;br /&gt;Now fire up Emacs in terminal mode (emacs -nw) and edit a face.  I'll make the font-lock-comment-face "Naval" colored for this example.  Then save the change.  Take a look at your custom file and you should see the color change in the function "custom-set-faces".  Here's my example:&lt;br /&gt;&lt;PRE&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;(custom-set-faces-terminal&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;  `(font-lock-function-name-face&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;     ((t :foreground "LightlyDepressed" :weight bold)))&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;  `(font-lock-comment-face ((t :foreground "cyan"))))&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;(custom-set-faces-display)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;(custom-set-faces&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;  ;; custom-set-faces was added by Custom -- don't edit or cut/paste it!&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;  ;; Your init file should contain only one such instance.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;  '(font-lock-comment-face ((t (:foreground "naval"))))&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;  '(font-lock-function-name-face&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;    ((t :foreground "LightlyDepressed" :weight bold))))&lt;/span&gt;&lt;br /&gt;&lt;/PRE&gt;&lt;br /&gt;Delete the old custom-set-faces-terminal.  Rename custom-set-faces to custom-set-faces-terminal, save your work and you're done.&lt;br /&gt;&lt;br /&gt;If you wish to edit your display faces, just fire Emacs up in display mode and run through the same process.&lt;br /&gt;&lt;br /&gt;There's no limit to the number of face sets you can add.  You can have a different face set for every day of the week if you want.  Just create a "my-custom-set-faces-" for any discriminator you want and rename custom-set-faces to match it.&lt;br /&gt;&lt;br /&gt;Hopefully my absurd 10 day journey into Emacs's faces has been rendered down into something useful for you.  Let me know if you found this helpful.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/65633101471927506-3293244527948307458?l=upcracky.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://upcracky.blogspot.com/feeds/3293244527948307458/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=65633101471927506&amp;postID=3293244527948307458' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/65633101471927506/posts/default/3293244527948307458'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/65633101471927506/posts/default/3293244527948307458'/><link rel='alternate' type='text/html' href='http://upcracky.blogspot.com/2009/06/emacs-p3-separate-but-equal.html' title='Emacs: P3 Separate But Equal.'/><author><name>Dale Wiles</name><uri>http://www.blogger.com/profile/12609080347734449263</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-65633101471927506.post-2780780626807622369</id><published>2009-06-22T20:06:00.004-04:00</published><updated>2009-06-22T20:22:57.500-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Geeky'/><category scheme='http://www.blogger.com/atom/ns#' term='Programming'/><category scheme='http://www.blogger.com/atom/ns#' term='Linux'/><title type='text'>Emacs: P2 Color Me LightlyDepressed.</title><content type='html'>Now that we have some color theory under our belt, let's calibrate Emacs's concept of color with the reality of the terminal's.&lt;br /&gt;&lt;br /&gt;First we have to get the real colors being displayed.  I'm using gnome-terminal which has a built in color picker.  If you're using a terminal that doesn't have it's own color picker, fire up "emacs -nw", do "M-X list-colors-display", then use something like "xmag" or gimp to get the color values.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:180%;"&gt;My Color List.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;From a gnome-terminal, select "Edit/Current Profile" from the menu.  From the "Default" screen, click on the "Colors" tab.  At the bottom of the screen you should see 2 rows of 8 colors.  The first row is the 8 colors that make up the terminal's pallet.  Left most is entry 0, right most is 7.  The second row are the colors you get when you print the first row using "bold".  Gnome-terminal has a 3rd row of colors that are the first row in "dark" mode, but you can't edit them.&lt;br /&gt;&lt;br /&gt;If Emacs was smarter about terminal colors you could tell it about all 3 rows of colors and it could use "bold" and "dark" version to increase the chance of it's making a good color choice.  Alas, were stuck with our one row of 8 colors.&lt;br /&gt;&lt;br /&gt;Click on each color in order, and write down their Red, Green and Blue (RGB) values.  For example, the 4th color in my pallet is kind of brown, with yellow below it.  It's RGB value is 170/85/0, so pallet entry 3 is 170/85/0.&lt;br /&gt;&lt;br /&gt;This is my list:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;  0    0   0   0&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;  1  170   0   0&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;  2    0 170   0&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;  3  170  85   0&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;  4    0   0 170&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;  5  170   0 170&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;  6    0 170 170&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;  7  170 170 170&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Once you have all 8 values, ask Emacs (in a terminal) for help on the variable "color-name-rgb-alist" (C-hv color-name-rgb-alist).  The help should list all the color names that Emacs knows and their RGB values.&lt;br /&gt;&lt;br /&gt;Scan the list for colors that match the gnome-terminal colors.  If you find a *perfect* match, put the color's name besides it's color in your list.  Only use the name if it's a perfect match.  0/0/0 was the only match for me.  I labeled color 0 "Black".&lt;br /&gt;&lt;br /&gt;For the rest of the colors, give them descriptive names that are &lt;span style="font-weight: bold;"&gt;not&lt;/span&gt; in color-name-rgb-list.  The last thing we need is 1 name for 2 colors.&lt;br /&gt;&lt;br /&gt; Here's my final list.&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;  Black            0    0   0   0&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;  Brick            1  170   0   0&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;  Greeny           2    0 170   0&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;  Brownish         3  170  85   0&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;  Naval            4    0   0 170&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;  DarkishMagenta   5  170   0 170&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;  NeonPee          6    0 170 170&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;  LightlyDepressed 7  170 170 170&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Now we have to get the colors into Emacs.  It turns out that that's pretty easy.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:180%;"&gt;RCS&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;First, make a backup of your ~/.emacs, just to be safe.  As an aside, because this series isn't nearly long enough, consider using RCS to backup any config files that you hand edit.  Under Emacs RCS is trivial to set up and use.  It's saved my monkey boy butt more times than I care to remember.&lt;br /&gt;&lt;br /&gt;To set up RCS for your ~/.emacs, make a directory called ~/RCS.  Then load your ~/.emacs file into Emacs.  Hit C-xvv.  That's it.  You're done.  Your ~/.emacs is now write protected and checked into ~/RCS.  To check out your file so you can edit it, load it into Emacs and hit C-xvv.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:180%;"&gt;Back to work.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Edit your ~/.emacs, and add the following code.  If your ~/.emacs has a custom-set-variables or custom-set-faces function, place this code before either.  Obviously you should use your own colors and names for the my-tty-color-define-8 commands.&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;  ;; Code for handling term based Emacs.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;  (defun my-tty-color-define-8 (name index rgb8)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;    "Set the tty pallet using 8 bit rgb values."&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;    (tty-color-define name index&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;         (mapcar (lambda (x) (+ x (* x 256))) rgb8)))&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;  (if (and (not window-system) (= 8 (length (tty-color-alist))))&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;      (progn&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;  (tty-color-clear)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;  (my-tty-color-define-8 "Black" 0 '(0 0 0))&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;  (my-tty-color-define-8 "Brick" 1 '(170 0 0))&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;  (my-tty-color-define-8 "Greeny" 2 '(0 170 0))&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;  (my-tty-color-define-8 "Brownish" 3 '(170 85 0))&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;  (my-tty-color-define-8 "Naval" 4 '(0 0 170))&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;  (my-tty-color-define-8 "DarkishMagenta" 5 '(170 0 170))&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;  (my-tty-color-define-8 "NeonPee" 6 '(0 170 170))&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;  (my-tty-color-define-8 "LightlyDepressed" 7 '(170 170 170))))&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Save your ~/.emacs file and exit.  Restart with "emacs -nw"  Type "M-x list-colors-display".  You should see your color names listed with the colors.&lt;br /&gt;&lt;br /&gt;This might not seem like much of an achievement, but you've actually taken a pretty big step.&lt;br /&gt;&lt;br /&gt;To check our your results, create a file called color_test.el in Emacs (-nw).  It should put you into "Emacs Lisp" mode automatically.  Now type in this program:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;  ;; Comments are in 'comment-face'.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;  ;; defun and defvar are in keyword-face.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;  (defun function-name-face (&amp;amp;optional is-in-type-face)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;    "string-face `constant-face' string-face"&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;    :builtin-face&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;    (error "warning-face"))&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;  (defvar variable-name-face)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;  ;; To see the "doc-face" go into "perl-mode".&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;  =pod&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;    This should be in doc-face.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;  =cut&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;The program itself doesn't work.  It's not even syntactically valid.  All it exists for is you show all various "faces" that Emacs uses when coloring code.&lt;br /&gt;&lt;br /&gt;To see doc-face, use "M-x perl-mode".&lt;br /&gt;&lt;br /&gt;How do you like them colors?  If you're happy happy, then you can skip post 3 of this series.  If, however, you're like me and think that Red is a horrible color for comment text, then await with baited breath the last installment of the Emacs color saga.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/65633101471927506-2780780626807622369?l=upcracky.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://upcracky.blogspot.com/feeds/2780780626807622369/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=65633101471927506&amp;postID=2780780626807622369' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/65633101471927506/posts/default/2780780626807622369'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/65633101471927506/posts/default/2780780626807622369'/><link rel='alternate' type='text/html' href='http://upcracky.blogspot.com/2009/06/emacs-color-me-lightlydepressed.html' title='Emacs: P2 Color Me LightlyDepressed.'/><author><name>Dale Wiles</name><uri>http://www.blogger.com/profile/12609080347734449263</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-65633101471927506.post-608367532300409922</id><published>2009-06-21T20:55:00.004-04:00</published><updated>2009-06-22T20:22:38.368-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Geeky'/><category scheme='http://www.blogger.com/atom/ns#' term='Programming'/><category scheme='http://www.blogger.com/atom/ns#' term='Linux'/><title type='text'>Emacs: P1: What Color Is My Painbow?</title><content type='html'>Last week I had a classic "Monkey Boy" moment.  I decided to adjust the colors in my text editor.  10 days later I'm finishing a 3 post blog on it.&lt;br /&gt;&lt;br /&gt;I worry myself some days.&lt;br /&gt;&lt;br /&gt;This first post is going to be mostly theory work.  Post 2 and 3 are more hands on.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:180%;"&gt;Laying the Ground Work.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;I use an editor called Emacs for most of my programming.  It's an old editor, but its one of the most powerful editors out there.  It also lets you edit files in display (windows) mode and from the shell (command.com for you Windows folks).&lt;br /&gt;&lt;br /&gt;Now days most of the editing is done in display mode.  No real surprise there.  However, there are times when working from the shell makes more sense.&lt;br /&gt;&lt;br /&gt;I routinely log into distant machines across slow connections.  I could pop up a virtual session and wait for the window in the virtual session and then wait for the editor in the window in the virtual session and then wait for the file in the editor in the window in the virtual session, or I can use text mode, where are complete screen refresh is around 2000 bytes.&lt;br /&gt;&lt;br /&gt;I hate waiting.  Its a no brainer.&lt;br /&gt;&lt;br /&gt;The down side of terminal mode is that you can only use characters to draw and you have a limited number of colors.  Both of these could be overcome with modern technology, but it ain't going to happen so we have to get used to it.&lt;br /&gt;&lt;br /&gt;Why do you have limited colors?  Well, the underling technology differences between a terminal from 20 years ago and a modern graphic display is pretty significant.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:180%;"&gt;RGB&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Colors are made by mixing various amounts of Red, Green and Blue (RGB) together.  If you crank up the RGB, you get bright colors, dial it down and you get dark.  Wikipedia has a nice write up on color depth so I won't go into it here.  The only thing you need to know is that by adjusting the RGB values you can change colors.&lt;br /&gt;&lt;br /&gt;On modern display you have absolute control of every dot on the screen.  Each one has it's own RGB setting which is independent of it's neighbor.&lt;br /&gt;&lt;br /&gt;Old school color terminals were more like "paint by numbers" projects.  You were given a pallet of colors (usually 8) that were hard wired into slots.  If you set the color to pallet slot 0 and then printed, you got black text.  If you printed in color 4 you might get blue.  Unfortunately for us, these are the terminals that most terminal emulators emulate.&lt;br /&gt;&lt;br /&gt;We have two problems when we want use Emacs in both terminal and display mode: First is that Emacs's support of terminal colors is functional, but not much more.  The second is that the friendly Emacs customizers don't like it when you're a switch hitter.  In fact they gets down right medieval on your monkey butt.  Well, this ain't monkey butt, this is monkey boy butt.  Accept no substitutions.&lt;br /&gt;&lt;span style="font-size:180%;"&gt;&lt;br /&gt;Terminal Colors&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;As I said before, most terminal emulators model the old style, 8 color pallets.  There are ways for a program to ask the emulator for the number of colors available, but there isn't any way to get the actual RGB of each color.&lt;br /&gt;&lt;br /&gt;What does Emacs do?  It guesses!  If you don't tell it otherwise Emacs assumes that you have an 8 color pallet with the following colors:&lt;br /&gt;&lt;br /&gt;&lt;PRE&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;  Slot  Name   Red Green Blue&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;  ---- ------- --- ----- ----&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;     0 black     0     0    0&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;     1 red     255     0    0&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;     2 green     0   255    0&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;     3 yellow  255   255    0&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;     4 blue      0     0  255&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;     5 magenta 255     0  255&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;     6 cyan      0   255  255&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;     7 white   255   255  255&lt;/span&gt;&lt;br /&gt;&lt;/PRE&gt;&lt;br /&gt;&lt;br /&gt;The numbers after the colors are how much Red Green and Blue that each color is supposed to have.  255 is the largest number you can express in 8 bits (1 byte) of data.  There are places internally where Emacs uses 16 bit (2 byte) RGB values which go from 0 to 65535.  I got bit by this more than a few times so I'll try to point them out, or gloss over them when I can.&lt;br /&gt;&lt;br /&gt;Emacs cares about the RGB values because you (the user) set colors by name not slot values.  If you set the color of something to "CadetBlue1" 152/245/255, then run in terminal mode, Emacs needs to figure out which of the eight colors CadetBlue1 is closest to.  It uses the RGB values to figure it out.&lt;br /&gt;&lt;br /&gt;Oh, by the way, the name "CadetBlue1" comes from a variable called "color-name-rgb-alist".  To see it's contents, fire up Emacs in display mode and type "M-x list-colors-display".  You'll see the colors and their names.&lt;br /&gt;&lt;br /&gt;Let's do some hands on.  From a terminal, type "emacs -nw".  It should start an Emacs session in the terminal.  In Emacs type "M-x list-colors-display".  You'll get a listing of the 8 colors that Emacs knows about.  Note: On some systems you get more than eight.  Lucky you.  The theory is still the same.&lt;br /&gt;&lt;br /&gt;If you're like me, you notice one thing first off.  These colors look nothing like their names!  The Red might be brick colored.  Yellow may look brown.  And my white has tattle tale gray!  What happened?&lt;br /&gt;&lt;br /&gt;Easy.  Emacs has no idea what colors your terminal's pallet is set to and it's guess stinks.  How do we handle the miss-match?&lt;br /&gt;&lt;br /&gt;One option is to change our terminal to Emacs's pallet.  Then we can vomit and claw our eyes out.  Basic colors tend to be rather harsh on the psyche.&lt;br /&gt;&lt;br /&gt;The second option is to tell Emacs what our terminal is really packing.  That's the subject of the next post.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/65633101471927506-608367532300409922?l=upcracky.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://upcracky.blogspot.com/feeds/608367532300409922/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=65633101471927506&amp;postID=608367532300409922' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/65633101471927506/posts/default/608367532300409922'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/65633101471927506/posts/default/608367532300409922'/><link rel='alternate' type='text/html' href='http://upcracky.blogspot.com/2009/06/emacs-what-color-is-my-painbow.html' title='Emacs: P1: What Color Is My Painbow?'/><author><name>Dale Wiles</name><uri>http://www.blogger.com/profile/12609080347734449263</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-65633101471927506.post-6425119791519650949</id><published>2009-06-08T00:39:00.000-04:00</published><updated>2009-06-08T00:46:44.831-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Profundity'/><title type='text'>Going Deaf at Duffs</title><content type='html'>Whenever anyone from the company has to come up to Buffalo on work, we have to feed them.&lt;br /&gt;&lt;br /&gt;This being Buffalo, and we being cliches, we inevitably drag them off to Duffs.&lt;br /&gt;&lt;br /&gt;The thinking goes like this: Person A comes to Buffalo.  Person A must want to try our local cuisine.  Our local cuisine consists of Chicken Wings and Beef on Weck.  Monday is Chicken Wings, Tuesday Weck.  Today is Monday.  Real men like hot Chicken Wings.  Duffs' wing are really hot!  We go to Duffs.&lt;br /&gt;&lt;br /&gt;Never mind the fact that there is more to Buffalo than Chicken Wings.  Ignore that fact that Person A may be here for is 10th time this year.  Obfuscate the fact that hot wings and good wings independent variables.  Me Buffalo, Me Wings, Me Hot, Me Duffs.  *Sigh*&lt;br /&gt;&lt;br /&gt;OK.  I don't have anything against Duffs.  Alright, it does remind me of a low rent vomitorium and the video games run on diesel, but besides that it's a nice enough place.  I'd just like to see a little more depth in our chow.&lt;br /&gt;&lt;br /&gt;But that's not why I'm writing today's blog.&lt;br /&gt;&lt;br /&gt;The last time we were in Duffs, a person came up to me and handed myself and a couple of other people at the table "deaf cards".&lt;br /&gt;&lt;br /&gt;For those of you who don't know, a deaf card is a card that allegedly deaf people hand out at airports as a way to beg for money.&lt;br /&gt;&lt;br /&gt;The card usually follows a certain formula:  First the introduction "I am a deaf person.", then the pitch "10 bucks would make me feel better about being deaf.", then a blessing "May god bless you for giving me 10 dollars." and then a graphic.  Usually the graphic is something like a cartoon angle or a peace sign.  I got a smiley face.&lt;br /&gt;&lt;br /&gt;The first thing that bothered me is, I'm no where near an airport.  We got rules!  You street beg on streets, airport beg in airports and PBS beg on the radio.  It's all part of the begging ecosystem.  What's next, Hare Krishna telethons?&lt;br /&gt;&lt;br /&gt;Also, I don't know that the person's deaf.  I have no problem giving help to the needy.  I'm well aware that with a disconcertingly small number of bad breaks, I could be out on the street.  This guy is Alpha/Omega.  Either I do good by helping someone out, or I'm encouraging a rodent to make a dishonest living by pretending to be deaf.&lt;br /&gt;&lt;br /&gt;Then I notice that everyone at my table is whispering.  Whispering?  Why would you whisper around a deaf person?  We're surrounded by the hearing?  If he's stone deaf, like he's professing, then he can't hear us.  If he can hear us, then he belongs in the slammer.&lt;br /&gt;&lt;br /&gt;And if we're afraid of people hearing us, then why aren't we whispering around the people at the tables all around us?  We've been blabbing for an hour.  They've heard every word!&lt;br /&gt;&lt;br /&gt;Then I had the big epiphany.  Why would I give someone $10 for being deaf?  This isn't like the 1820s where deaf people starved on street corners.  In modern societies there are very few jobs that aren't accessible to the deaf.  We have the technology and, I'd like to think, are more enlightened about deafness.  Rare is the person who thinks it's a punishment from god.&lt;br /&gt;&lt;br /&gt;I'm not saying there still isn't ignorance, I'm just saying it isn't the albatross it once was.&lt;br /&gt;&lt;br /&gt;Thinking about it, where I work, every jobs in the building save phone receptionist and security guard could be handled by someone stone deaf.  And even that, the security guard who monitors the cameras would have no problems.&lt;br /&gt;&lt;br /&gt;Knee jerk simpletons may pretend that I'm picking on deaf people here.  They're seeing what they want to see.  I freely concede that someone who has a sense, and looses it, suffers.  If they have an ability, they use an ability, they loose an ability, they have to adjust their life around the loss.  I just don't see where deafness would make an otherwise healthy person into a beggar.&lt;br /&gt;&lt;br /&gt;In some cases the loss is tragic.  Beethoven never heard is final symphonies.  In other cases, not so much.  A Sumo wrestling rarely depends on the sense of smell.  Neither would require you handing out cards.&lt;br /&gt;&lt;br /&gt;On the other hand, what about people who are born deaf?  They'll never hear music, but I'll never see magnetism.  Am I missing out?  No idea.  And maybe the born deaf experience a clarity of though and tranquility of mind that I'll never know in my noise filled head.  Again, no idea.  Either way it ain't worth $10.&lt;br /&gt;&lt;br /&gt;Because I pointed out that the deaf shouldn't be pitied, everyone at work now thinks that I'm a kitten burning poltroon of the worst stripe.  Far from feeling like a wag, I think that I'm being more enlightened than most.&lt;br /&gt;&lt;br /&gt;I also noticed that none of them gave the beggar any money.  Ya' hear what I'm saying?&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/65633101471927506-6425119791519650949?l=upcracky.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://upcracky.blogspot.com/feeds/6425119791519650949/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=65633101471927506&amp;postID=6425119791519650949' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/65633101471927506/posts/default/6425119791519650949'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/65633101471927506/posts/default/6425119791519650949'/><link rel='alternate' type='text/html' href='http://upcracky.blogspot.com/2009/06/going-deaf-at-duffs.html' title='Going Deaf at Duffs'/><author><name>Dale Wiles</name><uri>http://www.blogger.com/profile/12609080347734449263</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-65633101471927506.post-3318228651982783202</id><published>2009-06-03T00:58:00.000-04:00</published><updated>2009-06-03T01:20:44.970-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Geeky'/><category scheme='http://www.blogger.com/atom/ns#' term='Programming'/><category scheme='http://www.blogger.com/atom/ns#' term='Minions'/><title type='text'>Aw C'mon, be a Minion!</title><content type='html'>Come my minions!  Gather 'round me and do my bidding!!!&lt;br /&gt;&lt;br /&gt;Nuts!  That never works.&lt;br /&gt;&lt;br /&gt;I'm starting a minion list.  It's not a list of minions, it's a list of projects for my minions.&lt;br /&gt;&lt;br /&gt;I'm going Internet because minions are sparse on the ground around these parts.  I believe it's because my readership is made up of selfish swine who won't surrender their sense of personal identity for the betterment of me.  But I press on!  I'm brave that way.&lt;br /&gt;&lt;br /&gt;My minion list is a list of projects, usually computer projects, that strike me as a good idea, but I don't have time to do them.  It would be nice if a minion would do them (hint, hint).&lt;br /&gt;&lt;br /&gt;I've talked about the minion list in the abstract many times, but now I've decided to codify it.  That way, when someone else commercializes one of my ideas, say "Feels on Wheels" (I'll explain later), I can sue them for plenty cash.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt;Wanna Taste?&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;My first entry for the minion list is "Voice Messaging".  Voice Messaging is like Instant Messaging, augmented with sound.&lt;br /&gt;&lt;br /&gt;The concept is simple.  A person wants to send you a message.  Instead of typing, they have the option to record a message.  The message is sent to you, along with any typing they wish to do.  On your side your VM program converts the sound file to text and displays it like a normal IM.  If the speech conversion garbles it too badly, you just highlight the part you can't read and it plays that part of the sound file.&lt;br /&gt;&lt;br /&gt;This would rid the world of emoticons.  If you want to know how someone is feeling, play the sound file.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt;I Object!&lt;/span&gt;&lt;br /&gt;&lt;span&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;* &lt;span style="font-weight: bold;"&gt;Speech recognition sucks.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;You're right as far as you take it.  However, in this case we're not producing a finished document. It doesn't have to be perfect, just readable.  The recognition only has to be gud enuf 2 undrsAnd.  If you're unsure what was said, play the sound file.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;* What's to stop someone from saying one thing, but typing another?&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The conversion is done on the &lt;span style="font-weight: bold;"&gt;receiver's&lt;/span&gt; end.  The sender can send text along with the sound, but the final arbiter of the text is the receiver.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;* What's to stop someone from screaming obscenities or pulling other "funny" jokes.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Before playing a sound file, the program would normalize the sound levels.  It could even warn you if the original has loud points in it.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;* Couldn't someone just use the phone?&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Yea, but VM is closer to IM than a phone call.  The sender can send a VM, but you can ignore it until you're ready, just like IM.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;* What about people who don't stop yakking?&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Put a size limit on how big you'll receive.  Make it settable per person.  Even if someone does get carried away, it's still better than voice mail.&lt;br /&gt;&lt;br /&gt;Almost any sound player lets you replay selected parts of a file so you can deal with the witlings who leave 5 minute messages and wait till the end to mumble their contact information.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;* What file format should we use?&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;This is getting a bit low level, but something open format is an obvious requirement.  It turns out that there is an open format called Speex that gets the job done.&lt;br /&gt;&lt;br /&gt;A 14 second PCM, 16 bit, mono 48000 Hz .wav file is 1.4 meg.  Convert it to an .mp3 shrinks it to 123K.  Speex mauls it down to 66k.  All with no real loss of sound quality for what we're doing.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;* What about security?&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;As long as an open audio format is used, and you trust your audio player, then you're all set.  If you use an audio player that does odious stuff like pop up web browsers (oy!) then you're asking for trouble.  Playback should be based &lt;span style="font-weight: bold;"&gt;solely&lt;/span&gt; on the contents of the file, not it's extension.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;* What technology should the be built on?&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;I'd bet that most IM protocols allow file transfer.  It would simply be a case of the client programs handling audio file differently.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt;I Submit Like the Schweinhund I Am!&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;You have convinced me oh minion master.  I supplicate at your feet.  What is the first step?&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;For a start, someone could write a standalone application that reads Speex files and transcribes the contents.  Some college out there has to have information on phonetic translation.  Lets see what the state of the art is.&lt;br /&gt;&lt;br /&gt;After that, add playback of selected sections.  Once we have that settled then the rest would be cake, and how many masters let their minions have cake?&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/65633101471927506-3318228651982783202?l=upcracky.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://upcracky.blogspot.com/feeds/3318228651982783202/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=65633101471927506&amp;postID=3318228651982783202' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/65633101471927506/posts/default/3318228651982783202'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/65633101471927506/posts/default/3318228651982783202'/><link rel='alternate' type='text/html' href='http://upcracky.blogspot.com/2009/06/aw-cmon-be-minion.html' title='Aw C&apos;mon, be a Minion!'/><author><name>Dale Wiles</name><uri>http://www.blogger.com/profile/12609080347734449263</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-65633101471927506.post-2664184220125026009</id><published>2009-06-02T21:51:00.000-04:00</published><updated>2009-06-02T23:00:59.189-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Geeky'/><category scheme='http://www.blogger.com/atom/ns#' term='Programming'/><category scheme='http://www.blogger.com/atom/ns#' term='Linux'/><title type='text'>Sound Bite Me!</title><content type='html'>One of the true pleasures of programming is finding some niggling little problem and solving it with a simple bit of code.  If you can solve it in a couple of hours, even better.&lt;br /&gt;&lt;br /&gt;When I blog I tend to speak what I'm typing.  If it doesn't sound right when I say it, it probably wont sound right when you read it.&lt;br /&gt;&lt;br /&gt;One of the problems I have when I blog is that I talk faster than I type.  I talk faster than I think.  I start typing, and then I get a flash of inspiration.  I run the idea through my head, and then, half a virtual page later, I realize that I haven't written anything down.&lt;br /&gt;&lt;br /&gt;Then I have to try to recreate the idea from memory, but the flash is gone.  By the time I've rebuilt it, or accept that I've forgotten it, my original thought is out playing in the yard and won't come back.&lt;br /&gt;&lt;br /&gt;It frustrates the hell out of me.&lt;br /&gt;&lt;br /&gt;I started playing around with ideas to making blogging easier.&lt;br /&gt;&lt;br /&gt;At first I tried to check out the state of computer speech recognition.  I figured I'd just blab on in my blog, and then I'd go through and clean it up by hand.&lt;br /&gt;&lt;br /&gt;Computer speech recognition is still slow, expensive and it still sucks.  Trying to run a editing session without using a keyboard is slower than typing with 2 fingers.  I also wanted to blog via Linux, so firing up a Windows product ain't getting the job done.&lt;br /&gt;&lt;br /&gt;Next it tried to do some sort of integration of speech and text together.&lt;br /&gt;&lt;br /&gt;I envisioned loading a sound file into a sound editor, where I could chop it up and move it around.  While editing the sound, I'd join text to it.  When I moved a blob of sound, text that went with it would move to.  Eventually I'd piece a blog out of all my rattlings on.&lt;br /&gt;&lt;br /&gt;I still think that this is an interesting solution, but man, it would be some work!  I also I think I'd end up with a crappy sound editor linked to a crappy text editor.  No dice.&lt;br /&gt;&lt;br /&gt;I also had a minor epiphany.  I'm not going to keep these sound files around forever.  I'm just brain dumping to a file for a few minutes until I've finished typing my original though.  After that I can replay the recording and transcribe anything I think is useful.&lt;br /&gt;&lt;br /&gt;I already know how to &lt;a href="http://upcracky.blogspot.com/2008/12/how-to-capture-sound-from-analog.html"&gt;record from a mic on my Linux box&lt;/a&gt;.  Adding that to my new insight I wrote a shell script that turns on the sound recorder, dumps the contents of the microphone into a file and, when I stop recording, plays it back (that way I can tell if I forgot to turn on the mic or something).&lt;br /&gt;&lt;br /&gt;It worked like a charm!  Every time I needed to make a note, I just fired up the script, decided on a name for the sound file and away I went.  It was a little awkward, but a big step forward.&lt;br /&gt;&lt;br /&gt;I called the script "sound_bite".&lt;br /&gt;&lt;br /&gt;After than I needed to come up with a way to play back my sound bites, so I started adding flags to play the last sound bite or the first sound bite or list the sound bites and let me pick.  Then, another epiphany!  They're just frigging .wav files!  Maybe I could just double click on them in my file manager.  Oooo.  Me one smart monkey!&lt;br /&gt;&lt;br /&gt;Actually, once I got the file manager into the game, it cleaned up a lot of code.  I didn't have to tell the recorder where to put the sound files, I would always put them into the same directory and give them a time stamp for a name.  If I wanted to organize them better, I'd use the file manager to rename them or move them elsewhere.&lt;br /&gt;&lt;br /&gt;The only thing left was making it easier to use.  Typing in the command every time is a minor pain.  I needed a quicker way to access it.  That was easy too.&lt;br /&gt;&lt;br /&gt;I hooked up sound_bite to a shortcut which put all the .wave files into the directory "sound_bites".  I made another shortcut to bring up the file manager in "sound_bites" directory.  I'm sure I could come up with a few dozen little tweaks, I know enough to stop typing when I'm done.&lt;br /&gt;&lt;br /&gt;I'm now an official audio driven blogging fool!&lt;br /&gt;&lt;br /&gt;Here is the entire source code for sound_bite.  You may have to play with it a bit because the blogger code likes to play with it.&lt;br /&gt;&lt;br /&gt;Enjoy!&lt;br /&gt;&lt;br /&gt;&lt;tt&gt;&lt;br /&gt;#!/bin/sh&amp;nbsp;-&lt;br /&gt;&lt;br /&gt;#&amp;nbsp;Sound_bite:&amp;nbsp;Written&amp;nbsp;by&amp;nbsp;Dale&amp;nbsp;Wiles&amp;nbsp;6/2/09.&lt;br /&gt;&lt;br /&gt;#&amp;nbsp;Exit&amp;nbsp;if&amp;nbsp;an&amp;nbsp;error&amp;nbsp;occurs.&lt;br /&gt;set&amp;nbsp;-o&amp;nbsp;errexit&lt;br /&gt;&lt;br /&gt;if&amp;nbsp;[&amp;nbsp;$#&amp;nbsp;-eq&amp;nbsp;0&amp;nbsp;];&amp;nbsp;then&lt;br /&gt;&amp;nbsp;&amp;nbsp;cat&amp;nbsp;&amp;LT;&amp;LT;EOM&lt;br /&gt;Usage:&amp;nbsp;$0&amp;nbsp;directory&lt;br /&gt;&lt;br /&gt;Move&amp;nbsp;to&amp;nbsp;DIRECTORY&amp;nbsp;and&amp;nbsp;start&amp;nbsp;recording&amp;nbsp;a&amp;nbsp;wave&amp;nbsp;file&amp;nbsp;from&amp;nbsp;the&amp;nbsp;microphone.&lt;br /&gt;The&amp;nbsp;name&amp;nbsp;of&amp;nbsp;the&amp;nbsp;wave&amp;nbsp;file&amp;nbsp;is&amp;nbsp;yymmdd_hhmmss.wav.&lt;br /&gt;EOM&lt;br /&gt;else&amp;nbsp;&lt;br /&gt;&amp;nbsp;&amp;nbsp;sound_dir="$1"&lt;br /&gt;&amp;nbsp;&amp;nbsp;cd&amp;nbsp;"$sound_dir"&amp;nbsp;||&amp;nbsp;exit&amp;nbsp;1&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;#&amp;nbsp;Make&amp;nbsp;the&amp;nbsp;output&amp;nbsp;name&amp;nbsp;based&amp;nbsp;on&amp;nbsp;the&amp;nbsp;time,&amp;nbsp;down&amp;nbsp;to&amp;nbsp;the&amp;nbsp;second.&lt;br /&gt;&amp;nbsp;&amp;nbsp;#&amp;nbsp;That&amp;nbsp;way&amp;nbsp;I&amp;nbsp;can't&amp;nbsp;overwrite&amp;nbsp;existing&amp;nbsp;files.&lt;br /&gt;&amp;nbsp;&amp;nbsp;#&amp;nbsp;Alright,&amp;nbsp;in&amp;nbsp;theory&amp;nbsp;during&amp;nbsp;daylights&amp;nbsp;savings&amp;nbsp;time&amp;nbsp;it&amp;nbsp;could&lt;br /&gt;&amp;nbsp;&amp;nbsp;#&amp;nbsp;overwrite.&amp;nbsp;&amp;nbsp;I've&amp;nbsp;added&amp;nbsp;code&amp;nbsp;for&amp;nbsp;that&amp;nbsp;almost&amp;nbsp;impossable&amp;nbsp;situation.&lt;br /&gt;&amp;nbsp;&amp;nbsp;while&amp;nbsp;:;&amp;nbsp;do&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;out=`date&amp;nbsp;+%y%m%d_%H%M%S`.wav&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if&amp;nbsp;[&amp;nbsp;!&amp;nbsp;-e&amp;nbsp;$out&amp;nbsp;];&amp;nbsp;then&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;break&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;fi&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;echo&amp;nbsp;"Waiting...."&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;sleep&amp;nbsp;1&lt;br /&gt;&amp;nbsp;&amp;nbsp;done&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;echo&amp;nbsp;"Recording&amp;nbsp;$sound_dir/$out"&lt;br /&gt;&amp;nbsp;&amp;nbsp;sox&amp;nbsp;-t&amp;nbsp;alsa&amp;nbsp;default&amp;nbsp;-v&amp;nbsp;7&amp;nbsp;$out&lt;br /&gt;&amp;nbsp;&amp;nbsp;echo&amp;nbsp;"Playing&amp;nbsp;$sound_dir/$out"&lt;br /&gt;&amp;nbsp;&amp;nbsp;aplay&amp;nbsp;$out&lt;br /&gt;fi&lt;br /&gt;&lt;/tt&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/65633101471927506-2664184220125026009?l=upcracky.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://upcracky.blogspot.com/feeds/2664184220125026009/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=65633101471927506&amp;postID=2664184220125026009' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/65633101471927506/posts/default/2664184220125026009'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/65633101471927506/posts/default/2664184220125026009'/><link rel='alternate' type='text/html' href='http://upcracky.blogspot.com/2009/06/sound-bite-me.html' title='Sound Bite Me!'/><author><name>Dale Wiles</name><uri>http://www.blogger.com/profile/12609080347734449263</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-65633101471927506.post-7447193953618654399</id><published>2009-05-31T02:10:00.000-04:00</published><updated>2009-06-02T23:09:06.361-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Geeky'/><category scheme='http://www.blogger.com/atom/ns#' term='Pop Culture'/><category scheme='http://www.blogger.com/atom/ns#' term='TV'/><title type='text'>Spock's Two Fingered Monkey Freak</title><content type='html'>I went to see the new Star Trek movie, which is called, cleverly enough, "Star Trek".  Review in a sentence: Kinda fun in a Saturday morning cartoon sort of way, but it has some of the dumbest writing in the history of the world.&lt;br /&gt;&lt;br /&gt;If you're a fan, you've already seen it.  It's the second time for one of the guys I went with.  If you sorta like Star Trek then you can have fun between the winces.  If you're not a Star Trek fan... Hard to say.  A lot of people went to see the Transformers movie and it sucked.&lt;br /&gt;&lt;br /&gt;I'm not going to pick the film apart piece by piece.  It's not a terrible film.  But on the other hand, it ain't a great film either.  Besides, some people find my smartypants type reviews funny.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt;In To The Breach!  A' Spoiling I Shall Go!&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;This is supposed to be a reboot of the franchise.  OK.  I can live with that.  I'm not a big fan of movies like this.  The ones that show that one scene that defined everyone's character.  In real life there usually isn't one scene.  People grow over time and relationships grow with them.&lt;br /&gt;&lt;br /&gt;Oh well, this is mostly like real life actors running around like pissed off Muppet Babies, so we have to let that slide.&lt;br /&gt;&lt;br /&gt;My first kibitz is that it didn't feel like a Start Trek movie.  It has all the names and a few of the places, but the rest was generic shaky camera CGI.  The original Star Wars had it's feel.  The Star Trek movies, even the ones that sucked (and boy did some suck), still felt like Star Trek.  This one really didn't.&lt;br /&gt;&lt;br /&gt;It has the obligatory Kobayashi Maru (bite me, I looked up the spelling) simulator scene.  In the original universe Captain Kirk is the only person to beat the simulator.  W00t!  The universe is in awe.  He later confesses, in one of the most painfully stupid scenes in all of the Star Trek universe, the he cheated.  That's right, Captain James T. Kirk is not a great star ship captain, he's a cheating weasel.  Anyway, his defense?  He doesn't like to loose.  I hate blue balls but that doesn't give me the right to date rape.&lt;br /&gt;&lt;br /&gt;I wonder if a more qualified recruit was screwed out of his own ship because Kirk blew a professor to get to the top.  I'm sure that Diane Duane's written book about him.  "Lieutenant Pango: Boned by Kirk!"&lt;br /&gt;&lt;br /&gt;In this movie they change it up a bit.  In this version, Kirk cheats, but does so in such a psychotically obvious way that everyone knows he cheats.  There can be no other option.  He played "Duke Nukem" in god mode.  It's like he went to the final and yelling "I sure hope the second answer isn't 'Your mother and a horta!'.  Oh golly gee whiz, it is!  The guys in Animal House could cheat with more elan then he.&lt;br /&gt;&lt;br /&gt;In fact, it's not even cheating.  It's a psychopathic desire to fail.  I wouldn't want this clown running a space fairing warship with guns in the front.  I wouldn't want him driving a bus!  The last words I want to hear as I wing into a yawning chasm with a bus load of other victims isn't the driver saying "I sure hope this isn't a yawning chasm below us!".  It is Jimmy, but gravity is going to fix that in a couple of seconds.  Splat!&lt;br /&gt;&lt;br /&gt;Also, everything in this movie was dirty.  I know that we can use CGI to make things look like crap, but that doesn't mean we have to.  One of the things that I liked about the old Enterprise is they kept it clean.  Even the bad guys understood hygiene.  They may have had only had 3 sets, but they kept them swept and they brushed their teeth.&lt;br /&gt;&lt;br /&gt;Here, everything was filthy, everyone needed a shave and everyone needed a spanking!  Needing a shave isn't a special effect!&lt;br /&gt;&lt;br /&gt;I know it's supposed to make it more "adult", but it doesn't.  I've been (in the legal sense) an adult most of my life.  I've never worked in a place as dark and dank as the Romulan super-CGI-future-miner-ship.  I can see dark coal bins, but why wasn't there proper lighting on the bridge?  I have florescent lights in my cubical, and it doesn't have warp drive.&lt;br /&gt;&lt;br /&gt;And there were pipes everywhere!  I mean everywhere!  Remember, these ships are huge.  They don't hang with gravity.  The have all the room they need, but man they have a lot of pipes.  It's like the all of galactic space is run by Thomas the Tank Engine.  Enough with the steam punk.  In the future they have wallboard!&lt;br /&gt;&lt;br /&gt;And the people!  Yeek!  I've also worked with some pretty wretched people, but even in the worst of places, most people walk around with their asses blissfully board free.&lt;br /&gt;&lt;br /&gt;How about that high tech computer talk?  And when they start talking about computers, they made it sound like the Enterprise is written in AppleSoft BASIC.  Instead of saying plebeian stuff like "Captain, the subroutines are interfering with our, um, SoundBlaster 16, um, thousand.", they should use hip psychological terms like "Captain, someones' boned the computer's universe of discourse and it's gestalt is full of paradoxes."  It's bullshit, but it's future bullshit.&lt;br /&gt;&lt;br /&gt;Did I mention the space chicks?  Can we please have a movie with more than one female lead?  And could we not make them poon targets?&lt;br /&gt;&lt;br /&gt;In this film the nookie target was, of course, Uhura.  Spock gets his freak on with her in this flick.  And it isn't some Vulcan two finger smoochie.  Spock does it monkey style!  The thing is, it contributed nothing to the plot, it was gratuitous, and Spock looked too much like Kevin Nealon,  Yea, I bet "The Kev" has to beat the chicks off with a stick.&lt;br /&gt;&lt;br /&gt;Don't think I'm against hot SciFi bitches.  Wally Wood is my spirit animal.  Hell, lets do a full frontal nudity version of Star Trek where the Romulians perfect the lezbo ray and the Federation sets it's love guns on "lube".  I'm there with extra popcorn.&lt;br /&gt;&lt;br /&gt;But either do it or don't.  Lets see 'um naked, or give them roles that don't involve them playing kissy face all the time.&lt;br /&gt;&lt;br /&gt;How about weapons?  I know it's kewl and all, but why would you carry a sword that folds up into a tiny sword?  Wouldn't you use that space to carry a second gun?  Knives have their place.  I carry a geek army knife with me wherever I go.  But not for battle.  Any Marine worth their salt will tell you, if you carry a knife for combat, replace it with another clip of bullets.&lt;br /&gt;&lt;span style="font-size:130%;"&gt;&lt;br /&gt;Ze Plot!&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;I'm going to egress talking about the plot, such that it is.&lt;br /&gt;&lt;br /&gt;Do you remember the first "Pirates of the Caribbean" movie?  If the zombie pirates had just asked Will Turner to come with them and drop one drop of blood so they could be freed from the curse, and in exchange they would give him a bag of gold, he probably would have.  No muss, no fuss, just ask nicely.  The whole movie would have been about 10 minutes, including credits.&lt;br /&gt;&lt;br /&gt;Star Trek has one of those plots.&lt;br /&gt;&lt;br /&gt;An angry Romulan (who's really just a guy who needs a shave) comes back in time to oowie the Federation because Romulus's sun unexpectedly went nova (if you just heard a popping noise, it's the head of any physics major younger than Lord Kelvin).  He blames the Federation.&lt;br /&gt;&lt;br /&gt;Fair enough.&lt;br /&gt;&lt;br /&gt;He's a miner, so he comes back in his mining ship (a ship for digging dirt).  OK.  Most mining ships are kind of like lunch boxes with engines, they just move dirt.  Not Romulan mining ships.  These bastards are bigger than most planets and are covered with super death weapons.  Kind of like the Dodge Wrangler.  Most Dodge Wranglers are encrusted in torpedoes right?  That's why the get such rotten gas mileage.&lt;br /&gt;&lt;br /&gt;Any way.  Planet go boom.  Ships go boom.  Plot goes ARRRRRRG boom.  Spock gets jungle fever.  Roll credits.&lt;br /&gt;&lt;br /&gt;Um, why couldn't the Romulan guy come back through time, take his super-CGI-future-miner-ship back to Romulus and just tell everyone "Hey, I'm from the future, look at the date on my drivers license and how much I need a shave!  On stardate a hundred years from now, at around 3:15PM, the sun is going to go nova and melt our planet (pop pop pop!).  Write that date down.  No!  Use the red felt tip marker and underline it!  Now that that's settled, I happen to have this super-CGI-future-miner-ship that is chock full of 100 years in the future type technology.  What am I bid?"&lt;br /&gt;&lt;br /&gt;The whole movie would be about how this poor swine died from too many ticker tape parades while getting Romulan nookie while playing the stock market.&lt;br /&gt;&lt;br /&gt;I'm just saying.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt;I Conclude!&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Anyone who says this movie is more than a CGI pretty-bang is either a Trek fiend or they're going to grope you in the theater.  (Not that there's anything wrong with that.)  Last word?  Meh.  But a fun Meh.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/65633101471927506-7447193953618654399?l=upcracky.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://upcracky.blogspot.com/feeds/7447193953618654399/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=65633101471927506&amp;postID=7447193953618654399' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/65633101471927506/posts/default/7447193953618654399'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/65633101471927506/posts/default/7447193953618654399'/><link rel='alternate' type='text/html' href='http://upcracky.blogspot.com/2009/05/spocks-two-fingered-monkey-freak.html' title='Spock&apos;s Two Fingered Monkey Freak'/><author><name>Dale Wiles</name><uri>http://www.blogger.com/profile/12609080347734449263</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-65633101471927506.post-1752891898046338445</id><published>2009-05-26T00:21:00.000-04:00</published><updated>2009-05-26T00:32:34.299-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Geeky'/><category scheme='http://www.blogger.com/atom/ns#' term='Programming'/><title type='text'>Schleprock says: Lets Open that Id.</title><content type='html'>Through out my digital travels I tend to trip over more than my share of quirks, bugs and "obvious" ideas for improvements.  I'm gifted in a Schleprock sorta way.&lt;br /&gt;&lt;br /&gt;Unlike Schleprock (probably a pinko!) I also try to be a good netitizen and report what I find.&lt;br /&gt;&lt;br /&gt;The problem is there are too many barriers to being a good Samaritan.  The biggest one I run into is having to set up an account just to make a bug report.  I have 71 separate accounts to date, of which I really use 2 or 3.  I'm reticent to add more accounts just for the privilege of helping someone fix their code.&lt;br /&gt;&lt;br /&gt;I understand the reasoning for the accounts.  It's to cut down on Spam.  On the surface it looks like a good solution, but in reality it's almost as bad as the problem.  It cuts down on Spam, but it also cuts down on user participation.  No participation is killer for open source projects.&lt;br /&gt;&lt;br /&gt;One solution that I've seen it to allow anonymous posting, but have each posting validated before being passed through.  This is a great solution.  It allows anonymous posting, but puts a minor impediment in the way.  If you want fast turnaround, set up an account, if you can wait, then post anonymously.&lt;br /&gt;&lt;br /&gt;The only reasons validation isn't more popular are self important administrators, who don't make the time to deal with the human component of their project, or huge projects that legitimately generate a large number of anonymous emails.  These huge, anonymous, projects are fairly rare, and Spam filtering is easier for them than for normal mail.  The size of my penis is not a bug.&lt;br /&gt;&lt;br /&gt;But how do you deal with a site, that for some obsessive reason, wants you to set up an account.  If only you could create one Id and have an *OPEN* way to hand it around?  Open, Id?  Hmmmm.  OpenId?  It's got a nice ring to it.&lt;br /&gt;&lt;br /&gt;The OpenId project exists to solve the problem of having too damn many Ids.  It's really clever on how it solves it too.&lt;br /&gt;&lt;br /&gt;You start out by going to an OpenId provider and signing up for an Id.  Arg!  I know, you have to sign up for another account!  But this is the wish for more wishes.  Once you get an OpenId account, then you can use it on any OpenId enabled site that's out there.&lt;br /&gt;&lt;br /&gt;Let's say I'm trying to log on to newsite.com.  Newsite is OpenId aware.&lt;br /&gt;&lt;br /&gt;I type in my OpenId (http://upcracky.myopenid.com in my case).  Newsite then decodes my Id and redirects me to myopenid.com.  I log into myopenid.com using the password I set up there.  Once I'm logged in, I'm redirected back to newsite.com and I'm in.  If the password is good enough for myopenid.com it's good enough for newsite.com.&lt;br /&gt;&lt;br /&gt;In fact, I don't believe newsite.com ever sees my password.  They're probably pinkos!&lt;br /&gt;&lt;br /&gt;How do you get an OpenId.  One of the nice things about OpenId is, you may already have one.  If you have a gmail account, they're an OpenId provider (It's your email address and password.)  Yahoo is another.  If you don't have one of those, then web search for "OpenId Provider".  They're plentiful.  Hell, OpenIds are cheap.  You can make one for work and one for home and one for the kids and dog.&lt;br /&gt;&lt;br /&gt;The only real problems I've run into with OpenId are:&lt;br /&gt;&lt;br /&gt;1) They're not robust enough for super secure sites.  I don't use OpenId for banking.&lt;br /&gt;&lt;br /&gt;2) Not enough sites use it.  This one is easy to fix.  Whenever you have a site that is OpenId aware, use it.  If you have a site that's not OpenId aware, complain to the admins.  The code to implement your own OpenId log on is freely available on the net.  The more sites that have it, the more users that use it.  The more users that use it, the more sites that will get it.&lt;br /&gt;&lt;br /&gt;Seriously, if you have a ton of user IDs and passwords, then it behooves you to pester all the sites you know to set up OpenId.  If not, you'll end up like me, stooped over from the pain of dragging around all my BugZilla accounts.&lt;br /&gt;&lt;br /&gt;Wowzie wowzie woo woo.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/65633101471927506-1752891898046338445?l=upcracky.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://upcracky.blogspot.com/feeds/1752891898046338445/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=65633101471927506&amp;postID=1752891898046338445' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/65633101471927506/posts/default/1752891898046338445'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/65633101471927506/posts/default/1752891898046338445'/><link rel='alternate' type='text/html' href='http://upcracky.blogspot.com/2009/05/schleprock-says-lets-open-that-id.html' title='Schleprock says: Lets Open that Id.'/><author><name>Dale Wiles</name><uri>http://www.blogger.com/profile/12609080347734449263</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-65633101471927506.post-9188941904680093120</id><published>2009-05-16T17:19:00.000-04:00</published><updated>2009-05-18T19:58:46.325-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Geeky'/><category scheme='http://www.blogger.com/atom/ns#' term='Programming'/><category scheme='http://www.blogger.com/atom/ns#' term='Linux'/><title type='text'>Clones Ate My Files: A Sci-Fi Geek Thriller.</title><content type='html'>OK, so I'm banging out code for the betterment of my corporate overlords. It's a conceptually simple program: You give it a command and a list of servers and it runs the command against each server.&lt;br /&gt;&lt;br /&gt;Not impressed?  Well Monkey Boy doesn't get the corporate shekels without doing major mojo.  This program runs in parallel.  It juggles 64 instances of the command at a time.  It can ping all the severs on a netmare in less than a minute, keep track of the results and print them out in the order that they were input.  I get wet just thinking about it!&lt;br /&gt;&lt;br /&gt;All praise Monkey Boy right?  We'll I did run into a problem.  A sneaky problem that involved failed clones, suicidal files and a forgotten inheritance.  It's good stuff.  The problem is, if you don't program in Perl, you're not going to give a crap.  Oh well, I've never let my complete lack of an audience slow me down before.  Why start now?&lt;br /&gt;&lt;br /&gt;Like I said before, the beast is written in Perl.  Perl's not an elegant language, but if you need to leap out of the bushes, rape and strange a problem and get on with your life, then Perl's your language of choice.&lt;br /&gt;&lt;br /&gt;The basic layout is: Start a sub-process for the first 64 severs and have each one write to it's own temp file.  When one sub-process finishes, read it's results from the temp file and let the temp file disappear.  Then add a new sub-process for the next server.  Once all the servers are done, print out the results in order and accept smoochies from hot code groupies/naked underwear models.  Simple.&lt;br /&gt;&lt;br /&gt;The Boy of Monkey knew that he'd need lots of temporary files to hold command results.  He'd also like the files to go away by themselves when he's done with them.  Perl lept to his aid with &lt;span style="font-family:courier new;"&gt;File::Temp&lt;/span&gt;.  &lt;span style="font-family:courier new;"&gt;File::Temp&lt;/span&gt; is kind of the anonymous underage prostitute of programming.  When you say "Gimmie" it gives you access to the goodies and provides an assumed name.  When you're done using it, it disappears into the aether.  It all works great, until someone, or some&lt;span style="font-weight: bold;"&gt;thing&lt;/span&gt;, starts killing the temps prematurely.  Then you get a mystery to solve.  Foreshadowing!&lt;br /&gt;&lt;br /&gt;I got the code working and was getting ready to document (Yes, Monkey Boy is a pro, not documenting makes you a douche bag), when I though, what happens if the sever command can't run?  If the user misspells "ping" as "pong" will they get a reasonable message?&lt;br /&gt;&lt;br /&gt;Does&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;&lt;/span&gt;&lt;blockquote&gt;&lt;span style="font-family:courier new;"&gt;Couldn't open file '/tmp/multi.1d8&lt;wbr&gt;34.pid': No such file or directory&lt;/span&gt;&lt;/blockquote&gt;strike you as reasonable?  Me neither.  Nuts!&lt;br /&gt;&lt;br /&gt;The actual error message made sense to Monkey Boy.  He spawned the beast.   '&lt;span style="font-family:courier new;"&gt;/tmp/multi.1d83&lt;wbr&gt;4.pid&lt;/span&gt;' is one of the randomly generated temp file names.  When a sub-process finished, the program asked the temp handle for it's file name.  It tried to opened the file, but for some reason the file was gone!  Somehow the files were being killed before Monkus Boyus could get to them.  No one should know about these files.  They have specially constructed names, known only to the monkey... or the monkey's clone.&lt;br /&gt;&lt;br /&gt;The way you run a sub-process in Linux is using the &lt;span style="font-family:courier new;"&gt;fork()&lt;/span&gt; command.  You're running along happy as a clam, as if a mucus coated bivalve is your apotheoses of happiness, and then you hit &lt;span style="font-family:courier new;"&gt;fork()&lt;/span&gt;.  At that point your program is cloned.  You have 2 running copies of the code.  The only difference is that &lt;span style="font-family:courier new;"&gt;fork()&lt;/span&gt; will tell the parent the ID of it's child.  The child is handed the ID of 0, which tells it that it's the clone.&lt;br /&gt;&lt;br /&gt;This is kind of Star Trekie at this point ain't it?  We've got parents making 64 clones (top that Octomom!) and we've got children that are one bit away from being perfect copies of their parent.  It gets better.  The clone's next job is to call &lt;span style="font-family:courier new;"&gt;exec()&lt;/span&gt; which completely obliterates it and replaces it with another program.  It's this second program, the sever command, which does the real work I want done.&lt;br /&gt;&lt;br /&gt;A clone has one job.  It's job is to die and be forgotten.  Programming ain't for wussies!&lt;br /&gt;&lt;br /&gt;When all goes well, the program runs like a well oiled roach motel.  The clones check in, but never checkout.  They disappear on the spot and are never heard from again.&lt;br /&gt;&lt;br /&gt;That's when all goes well.  What happens when the &lt;span style="font-family:courier new;"&gt;exec()&lt;/span&gt; command fails?&lt;br /&gt;&lt;br /&gt;It's simple really, the clone lives on!  It also keeps it's copy of the temp files, which it believes it owns.  When it dies, it takes the temp files with it.  Clones can be selfish little pricks.&lt;br /&gt;&lt;br /&gt;Eventually the grieving parent checks on the child.  It notices that it's died and then tries to check the temp file for the reason.  The temp file is gone baby gone, it died at the hands of junior.  You can only die once in temp file land.&lt;br /&gt;&lt;br /&gt;As for the reason the &lt;span style="font-family:courier new;"&gt;exec()&lt;/span&gt; failed?  It was written into the temp file.  You know, the temp file that's in temp file heaven?  Hmm.  What to do?  What to do?&lt;br /&gt;&lt;br /&gt;Suddenly Monkey Boy (you remember Monkey Boy, he's the hero of this epic) has an insight.  When you delete a file it doesn't really disappear until the last program that has a hold of it lets go.  It's removed from the directory, so it can't be seen, but it's still out there, in limbo, awaiting for the sweet kiss of digital death.&lt;br /&gt;&lt;br /&gt;Who else is holding on to the file?  The parent of course!  The question was, could Monkey Boy get to the parent to cough up the handle and could it be used for reading?&lt;br /&gt;&lt;br /&gt;Detective Monkey Boy began investigating.  He checked the usual suspects.  "&lt;span style="font-family:courier new;"&gt;perdoc File::Temp&lt;/span&gt;" didn't provide much.  It was higher level than a kite.  The Internet tubes were blocked by flame wars and almost naked pictures of some platinum blond from California.  No go.  Detective Monkey Boy knew what he had to do.  He had to go (non-prequil) Jedi.  "Use the Source Luke!" is the rallying call of the Open Source movement.  But Monkey Boy's name ain't Luke.&lt;br /&gt;&lt;br /&gt;Into the source goes the hero.  Past lines of documentation.  Past obscure code references.  Further he goes, until he finds, what he knows in is heard must be, "&lt;span style="font-family:courier new;"&gt;use IO::Handle&lt;/span&gt;".  Rocken!&lt;br /&gt;&lt;br /&gt;For those that don't know, deep in the belly of the beast, a file comes down to little more than a number.  When you open up a file, voodoo happens, and an entry is put in a table called the File Descriptor Table.  What you deal with, either directly or through some Perl interface, is an entry in this table.  If you can figure out the index number to this table, you can find your file.  &lt;span style="font-family:courier new;"&gt;File::Temp&lt;/span&gt; was a cold fish, but what about it's ancestors? &lt;span style="font-family:courier new;"&gt;File::Temp&lt;/span&gt; inherits from &lt;span style="font-family:courier new;"&gt;IO::Handle&lt;/span&gt;.  To get to the real power, you got to seduce grandma.&lt;br /&gt;&lt;br /&gt;"Hey there Granny!"&lt;br /&gt;&lt;br /&gt;Once I go my hands on Granny's nodes (yech!) she gave up &lt;span style="font-family:courier new;"&gt;IO::Handle.  IO::Handle&lt;/span&gt; has the &lt;span style="font-family:courier new;"&gt;fileno()&lt;/span&gt; function.  You got the number, you get the data.&lt;br /&gt;&lt;br /&gt;After that it was just a hop, skip and a file dupe to get to the data so ingloriously killed off by the wayward clone.  It takes more than the death of a temp file to stop a motivated Monkey Boy!&lt;br /&gt;&lt;br /&gt;All praise Monkey Boy.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/65633101471927506-9188941904680093120?l=upcracky.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://upcracky.blogspot.com/feeds/9188941904680093120/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=65633101471927506&amp;postID=9188941904680093120' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/65633101471927506/posts/default/9188941904680093120'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/65633101471927506/posts/default/9188941904680093120'/><link rel='alternate' type='text/html' href='http://upcracky.blogspot.com/2009/05/clones-ate-my-files-sci-fi-geek.html' title='Clones Ate My Files: A Sci-Fi Geek Thriller.'/><author><name>Dale Wiles</name><uri>http://www.blogger.com/profile/12609080347734449263</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-65633101471927506.post-3329831574162342373</id><published>2009-04-26T20:12:00.000-04:00</published><updated>2009-04-26T20:32:14.924-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Pop Culture'/><category scheme='http://www.blogger.com/atom/ns#' term='TV'/><category scheme='http://www.blogger.com/atom/ns#' term='politics'/><title type='text'>What's your favorite color?  Wrong!</title><content type='html'>Some stories you have to type quickly or they'll be forgotten before you get them out on the Internet tubes.  This is one such story.&lt;br /&gt;&lt;br /&gt;First lets talk about beauty contests.&lt;br /&gt;&lt;br /&gt;Beauty contests are weird.  It's kind of like sex through a fish bowl.  You herd up some tall thin Aryans, shave everything below the eyebrows, tart them up to the nines and then pretend they've never had sex.&lt;br /&gt;&lt;br /&gt;Don't get me wrong.  I have no problem with hot babes parading around for the ogling.  If they had the "Top 50 Hottest Babes of any Medium Size Mall Take Off Their Tops and Wave at Dale" show, I'd probably watch.  Breasts are god's way of saying mammals are cool.&lt;br /&gt;&lt;br /&gt;Beauty contest are different.  The women don't look like women, really.  They're kind of like sexualise marshmallow peeps.  Ya know?&lt;br /&gt;&lt;br /&gt;They walk funny, they talk funny, they wave funny and they're all kind of, what's the best word?  Shiny!  They're all kind of shiny.&lt;br /&gt;&lt;br /&gt;It's like you just bought a new "Stepford Wife" and she's fresh out of the crate and still smells like a new car.  That's what beauty queens remind me of.&lt;br /&gt;&lt;br /&gt;Unfortunately, promoters of such shows can't stick to the crux of the show: pulchritude.  Instead, they try to bluff us by having things like a talent show and an IQ test.&lt;br /&gt;&lt;br /&gt;A leggy blond shooting skeet while playing a saxophone may be Americana, but the IQ tests make my brainstem hurt.&lt;br /&gt;&lt;br /&gt;The is current tempest in a tea pot is brewing over something that a Miss USA contestant said.  Carrie Prejean is Miss California.  Well, sorta.  She's only Miss California according to the Miss USA Pageant.  Jackie Geist is the Miss America Miss California.  Maybe someday we'll step through all of this and Miss Corleone will unite all the Miss Californias on the day of her son's christening, but until then, we have Carrie Prejean to kick around.&lt;br /&gt;&lt;br /&gt;Carrie was picked by the handicappers as the most likely to win this year.  How they did that I don't know.  Maybe they checked her teeth and rode her around the room a bit.  I'm sure it was something scientific.&lt;br /&gt;&lt;br /&gt;Alas, a well turned fetlock isn't enough.  Part of the absurdity that is the Miss USA contest is "Current Events".  I'm sure that they have a better name for it, but it's really just current events.  It's supposed to show us that Miss USA has brains as well as brawn.  We'll ignore the fact that double her IQ and add 10 lbs to her butt and any contestant is out on their tucus.  Brains don't fill a swimsuit.&lt;br /&gt;&lt;br /&gt;Anyway, Ms. Prejean was asked about current conservative bugaboo, gay marriage.  She blew it.  I mean comedicly.  I mean, not a pretty sight comedicly.  Post '60s Jerry Lewis is what we're talking here.&lt;br /&gt;&lt;br /&gt;In the end, she lost the contest.&lt;br /&gt;&lt;br /&gt;She blames, not the bad answering of the questions, not the fact that Kristen Dalton is a fine side of beef in her own right, but the fact that she wasn't wildly pro gay marriage.&lt;br /&gt;&lt;br /&gt;She might be right.  She's a bigot, but she might be right.&lt;br /&gt;&lt;br /&gt;Does anyone really think that if she had given a brilliantly argued defense of hetero only marriage, with the oratory skills of, say, Frederick Douglas, that she would have come out of that unscathed?&lt;br /&gt;&lt;br /&gt;It's academic because she answered like a gooney bird on Teflon, but the question is still there.&lt;br /&gt;&lt;blockquote&gt;Is it OK to ask a contestant a pure opinion question and then nail them because it's not &lt;span style="font-style: italic;"&gt;your&lt;/span&gt; opinion?&lt;br /&gt;&lt;/blockquote&gt;Obviously I believe the answer is "no".  If you ask me my favorite color, and don't like the one I choose, then piss off.&lt;br /&gt;&lt;br /&gt;If you ask me whether humans and dinosaurs lived together, and I say "yes", then you can gig me.  Not because you disagree with me, but because my evidence is crap.&lt;br /&gt;&lt;br /&gt;But if I say I'm against gay marriage because I'm a closet case and waking up at 3am with a junior chubby is scaring the dog, then I've answered your question.  I haven't lied.  I haven't selected part of a religious text to bash you with.  I've done my job and should get a cookie.  If some Z-level blogger (a blogger for god's sake!) doesn't like it, then maybe a better question is, "Who the hell cares about the opinion of a blogger?"  Just ask a blogger, we're meaningless.  (Did ya dig the irony there?)&lt;br /&gt;&lt;br /&gt;Please don't think that I care about Miss USA.  I think the entire contest could be done in a news break:  Ladies, line up please.  Thank you.  Pop your tops.  Very nice.  Great rack Miss Vermont, here's your crown.&lt;br /&gt;&lt;br /&gt;It's the farce I don't like.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/65633101471927506-3329831574162342373?l=upcracky.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://upcracky.blogspot.com/feeds/3329831574162342373/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=65633101471927506&amp;postID=3329831574162342373' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/65633101471927506/posts/default/3329831574162342373'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/65633101471927506/posts/default/3329831574162342373'/><link rel='alternate' type='text/html' href='http://upcracky.blogspot.com/2009/04/whats-your-favorite-color-wrong.html' title='What&apos;s your favorite color?  Wrong!'/><author><name>Dale Wiles</name><uri>http://www.blogger.com/profile/12609080347734449263</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-65633101471927506.post-2233302642872481686</id><published>2009-04-14T23:15:00.000-04:00</published><updated>2009-04-14T23:36:59.132-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='politics'/><title type='text'>Ten-four Mr. Heston</title><content type='html'>Every once in a while someone decides to hang up the Ten Commandments in a court house to let us know who's really in charge.&lt;br /&gt;&lt;br /&gt;This obviously violates the separation of church and state which is a no-no.  To get around this, they often invoke the canard that the Ten Commandments are the basis of western law and therefore it's OK to post away.&lt;br /&gt;&lt;br /&gt;Are they?  The Ten Commandments I mean.  I never gave it much though, and they never give specific examples.  I think it's because they don't know what the Ten Commandments actually say.  It's easier to thump a book than to read it.&lt;br /&gt;&lt;br /&gt;No problem, I gots the Internet tubes and half an hour.  How hard can it be?  I decided to check it out myself.&lt;br /&gt;&lt;br /&gt;First of all, it took me a few minutes to find the "real" Ten.  By real I mean the stuff of Charlton Heston.  I want "Thou shalt"s, not "You wills"!&lt;br /&gt;&lt;br /&gt;Once I got them, I decided to check them out.  Remember, I'm not talking whether the Ten Commandments are the word of god, or holy or even a good idea.  I just want to see if they're the basis of our law.  The law that you and I run into every day.  That's what's being professed.&lt;br /&gt;&lt;span style="font-size:180%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:180%;"&gt;The Ten Commandments&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;1. I am the LORD thy God, which have brought thee out of the land of Egypt, out of the house of bondage.&lt;br /&gt;&lt;br /&gt;     Thou shalt have no other gods before me.&lt;/blockquote&gt;Not a good start.  The United States Constitution is pretty hostile to the one true god bit.  You can worship as many gods as you can carry and make up a few of your own for emergencies.&lt;br /&gt;&lt;br /&gt;Also, god didn't bring the people of Japan out of Egypt.  Just saying.&lt;br /&gt;&lt;br /&gt;  &lt;blockquote&gt;2. Thou shalt not make unto thee any graven image, or any likeness of any thing that is in heaven above, or that is in the earth beneath, or that is in the water under the earth.&lt;br /&gt;&lt;br /&gt;     Thou shalt not bow down thyself to them, nor serve them: for I the LORD thy God am a jealous God, visiting the iniquity of the fathers upon the children unto the third and fourth generation of them that hate me;&lt;br /&gt;&lt;br /&gt;     And shewing mercy unto thousands of them that love me, and keep my commandments.&lt;/blockquote&gt;Whew!  This one goes all over the place.&lt;br /&gt;&lt;br /&gt;First, does it mean that you can't draw pictures of birds or fish?  I know that in the next paragraph you're told not to worship the images, but the first paragraph clearly tells you not to draw them in the first place.&lt;br /&gt;&lt;br /&gt;What happens if my Dad draws a fish?  Does it mean I'm screwed for 3 more generations?  No matter what I do I'm hosed?  For poppa's fish picture?&lt;br /&gt;&lt;br /&gt;Anyway, strike two.  We can engrave our butts off and sell them on late night TV.  Not part of the law of this land.&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;3. Thou shalt not take the name of the LORD thy God in vain; for the LORD will not hold him guiltless that taketh his name in vain.&lt;/blockquote&gt;Nope.  You may get fined by the FCC if you do it on TV.  If you do it in certain mid-east countries you may get your monkey ass stabbed, but it ain't the law 'round these parts.&lt;br /&gt;&lt;br /&gt;  &lt;blockquote&gt;4. Remember the sabbath day, to keep it holy.&lt;br /&gt;&lt;br /&gt;     Six days shalt thou labour, and do all thy work:&lt;br /&gt;&lt;br /&gt;     But the seventh day is the sabbath of the LORD thy God: in it thou shalt not do any work, thou, nor thy son, nor thy daughter, thy manservant, nor thy maidservant, nor thy cattle, nor thy stranger that is within thy gates:&lt;br /&gt;&lt;br /&gt;     For in six days the LORD made heaven and earth, the sea, and all that in them is, and rested the seventh day: wherefore the LORD blessed the sabbath day, and hallowed it.&lt;br /&gt;&lt;/blockquote&gt;Submitted for your approval: Football.&lt;br /&gt;&lt;br /&gt;Let's see a major politician come out against that.&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;5. Honour thy father and thy mother: that thy days may be long upon the land which the LORD thy God giveth thee.&lt;br /&gt;&lt;/blockquote&gt;If you're a kid, then you have to listen to your folks, but you don't have to honour them.  Once you're street legal then they can rot for all the state cares.&lt;br /&gt;&lt;br /&gt;Damn few laws about parent honouring.&lt;br /&gt;&lt;br /&gt;  &lt;blockquote&gt;6. Thou shalt not kill.&lt;/blockquote&gt;We may have a winner here!&lt;br /&gt;&lt;br /&gt;We do have lots of laws about killing.  The problem is, so does everyone else.  "Don't kill the locals." is probably the first rule that every culture comes up.  Well, maybe second to "Do what the big guy with the stick says."  Commandments are nice, but sticks hurt.&lt;br /&gt;&lt;br /&gt;So, this commandment doesn't set law, it simply reflects a common law.  No putting the cart before the horse.  Sorry.&lt;br /&gt;&lt;br /&gt;  &lt;blockquote&gt;7. Thou shalt not commit adultery.&lt;/blockquote&gt;&lt;br /&gt;I'm giving half a point for this.  It's hardly the basis of western law, it's more to do with blood lines, but we do get a holier-than-thou boner over adultery.&lt;br /&gt;&lt;br /&gt;Does anyone remember the Clinton impeachment?  I need to correct you all about that some day.&lt;br /&gt;&lt;br /&gt;  &lt;blockquote&gt;8. Thou shalt not steal.&lt;/blockquote&gt;Same argument as "Thou shalt not kill."  Sorry horse, back to the front of the cart.&lt;br /&gt;&lt;br /&gt;  &lt;blockquote&gt;9. Thou shalt not bear false witness against thy neighbour.&lt;/blockquote&gt;Nope!  We have this thing called a talk show.  People make bags of cash bearing false witness and none of them go to the slammer!&lt;br /&gt;&lt;br /&gt;If you do it in court you might get bit, but not on the streets.&lt;br /&gt;&lt;br /&gt;You know where you really hear false witness being borne?  Church!  Church and politics.  Misrepresenting an opponent's position?  That's false witness, kids.  Pretending to not remember something that we all know you do?  More false witness.  Pretending gay marriage will raise my taxes?  Can you guess what that's called?&lt;br /&gt;&lt;br /&gt;Is pretending that the Ten Commandments are the bases of western law a violation of the Ten Commandments? Whoo, irony!&lt;br /&gt;&lt;br /&gt; &lt;blockquote&gt;10. Thou shalt not covet thy neighbour's house, thou shalt not covet thy neighbour's wife, nor his manservant, nor his maidservant, nor his ox, nor his ass, nor any thing that is thy neighbour's.&lt;br /&gt;&lt;/blockquote&gt;At this point we hit "Epic Fail."  My god, is there anything more American than coveting?  Our entire economy is built on the covet.  If I could sell covets I'd make a fortune!  Oops!&lt;br /&gt;&lt;br /&gt;How do we compare successful religion?  Weirdness?  Meanness? Miracles per square pew?  Nope, size!  It's mega-church penis envy covet.&lt;br /&gt;&lt;br /&gt;Why do we care about Bill Gate's opinion on anything?  Is he wise?  Nope.  Clever?  Nah.  Filthy stinking rich!  Bingo!&lt;br /&gt;&lt;br /&gt;Thou shalt not covet?  Then death penalty for SUVs!  Sheesh!&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:180%;"&gt;Summary.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Adding it up, it doesn't look good for the Ten Commandments being the basis of our law.  Oh, lets face it.  It ain't!&lt;br /&gt;&lt;br /&gt;What's kind of interesting, is that very few proponents of Commandment posting have gone through the list like I have.  Do you think they know that they're bearing false witness?  Can't be.  My neighbor would never do that.  It's not Christian.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/65633101471927506-2233302642872481686?l=upcracky.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://upcracky.blogspot.com/feeds/2233302642872481686/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=65633101471927506&amp;postID=2233302642872481686' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/65633101471927506/posts/default/2233302642872481686'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/65633101471927506/posts/default/2233302642872481686'/><link rel='alternate' type='text/html' href='http://upcracky.blogspot.com/2009/04/ten-four-mr-heston.html' title='Ten-four Mr. Heston'/><author><name>Dale Wiles</name><uri>http://www.blogger.com/profile/12609080347734449263</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-65633101471927506.post-1664860575739733163</id><published>2009-04-10T21:56:00.000-04:00</published><updated>2009-04-10T22:05:16.790-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Geeky'/><category scheme='http://www.blogger.com/atom/ns#' term='Linux'/><title type='text'>Phoning it Home.</title><content type='html'>I have a Samsung SGH-A707 cell phone.  It's nothing amazing, but it has a few features that I like.&lt;br /&gt;&lt;br /&gt;One of them is voice memo.  I can hit a button and record a quick message on my phone.  Later, using Samsung's crappy PC Studio, I can pull the sound files off my phone and onto my Windows box.  From there it's a hop, skip and a Samba on to my beloved Linux box.&lt;br /&gt;&lt;br /&gt;The problem I have is that the files are in a format called ".amr".  Oy!  God forbid they use something standard.&lt;br /&gt;&lt;br /&gt;Fortunately it's not too hard to convert them to a format that the "sox" command can understand.  From there you can go to .wav, .mp3 or .ogg.&lt;br /&gt;&lt;br /&gt;First, get the sound file from your phone to your Linux box.  I can't get the bitpim program to work on my Red Hat box so I go via Windows.&lt;br /&gt;&lt;br /&gt;Once you have the file, I'll call it "foo.amr", on to your Linux box, use the program "amrnb-decoder" to convert it to raw format.&lt;br /&gt;&lt;br /&gt;amrnb-decoder was already on my Red Hat box.  You may have to hunt around for it.&lt;br /&gt;&lt;br /&gt;Decode the file with:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;  amrnb-decoder foo.amr foo.raw&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;This produces a raw, signed, 2 byte word, audio file at 8000 hertz.&lt;br /&gt;&lt;br /&gt;Convert it to an ogg file with:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;  sox -r 8000 -s -w foo.raw foo.ogg&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;You should be good to go.  If you change foo.ogg to foo.wav you'll get a wave file.  Creating an mp3 is left as an exorcise for the reader.&lt;br /&gt;&lt;br /&gt;You can simplify this a little bit by naming the raw file "foo.sw".  Sox sees files that end with ".sw" as being short hand for "raw, signed word" files so you don't have to include that info on the command line.&lt;br /&gt;&lt;br /&gt;You could do the above as:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;  amrnb-decoder foo.amr foo.sw&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;  sox -r 8000 foo.sw foo.ogg&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;If the volume of the final .ogg file is too low, use sox to increase it:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;  amrnb-decoder foo.amr foo.sw&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;  sox -v 7 -r 8000 foo.sw foo.ogg&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;For some reason all the other instructions sets I've seen have had dumb little typos in them.  Let me know if you find any here.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/65633101471927506-1664860575739733163?l=upcracky.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://upcracky.blogspot.com/feeds/1664860575739733163/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=65633101471927506&amp;postID=1664860575739733163' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/65633101471927506/posts/default/1664860575739733163'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/65633101471927506/posts/default/1664860575739733163'/><link rel='alternate' type='text/html' href='http://upcracky.blogspot.com/2009/04/phoning-it-home.html' title='Phoning it Home.'/><author><name>Dale Wiles</name><uri>http://www.blogger.com/profile/12609080347734449263</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-65633101471927506.post-4131690278604145440</id><published>2009-04-04T23:54:00.000-04:00</published><updated>2009-04-05T00:20:48.842-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Story'/><title type='text'>How to Die a Virgin.</title><content type='html'>I've run into a lot of people are afraid to commit anything to the Internet tubes until they have it perfect.  These people are idiots.&lt;br /&gt;&lt;br /&gt;Nothing is ever going to be perfect.  You just have to let it go.  If you hold on too tight you'll never get any better.&lt;br /&gt;&lt;br /&gt;It's like never dating until you get to be a great lay.  The only thing that happens is you end up with blue balls and a right arm that looks like Popeye's.&lt;br /&gt;&lt;br /&gt;Then you die a virgin.&lt;br /&gt;&lt;br /&gt;In keeping with the tradition of leaping before looking, I'm going start publishing some of my short stories.&lt;br /&gt;&lt;br /&gt;I'm not saying that they're good, but I'm having fun writing them.&lt;br /&gt;&lt;br /&gt;Here's an example:&lt;span style="font-size:130%;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;blockquote&gt;&lt;span style="font-size:130%;"&gt;Why I Am an Atheist, by Dale Wiles&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;br /&gt;One day, while sitting in the park, I was bathed in a heavenly light.&lt;br /&gt;&lt;br /&gt;"He who transcends time" himself descended on a beam of pure light and glory and spoke unto me.&lt;br /&gt;&lt;br /&gt;"Dale", he said in all voices at once, "guess what."&lt;br /&gt;&lt;br /&gt;"What?" I said.&lt;br /&gt;&lt;br /&gt;"That's what!" he replied, and disappeared.&lt;br /&gt;&lt;br /&gt;I've been a atheist ever since.&lt;/span&gt;&lt;/blockquote&gt;&lt;span style="font-size:100%;"&gt;C'mon, it's not like I didn't warn you.&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/65633101471927506-4131690278604145440?l=upcracky.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://upcracky.blogspot.com/feeds/4131690278604145440/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=65633101471927506&amp;postID=4131690278604145440' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/65633101471927506/posts/default/4131690278604145440'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/65633101471927506/posts/default/4131690278604145440'/><link rel='alternate' type='text/html' href='http://upcracky.blogspot.com/2009/04/how-to-die-virgin.html' title='How to Die a Virgin.'/><author><name>Dale Wiles</name><uri>http://www.blogger.com/profile/12609080347734449263</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-65633101471927506.post-4951433160131527604</id><published>2009-03-30T22:48:00.000-04:00</published><updated>2009-03-30T23:15:59.920-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='TV'/><title type='text'>Battlestar Galactica Really Sucked</title><content type='html'>I don't think I've ever missed the mark on a show as much as I have on Battlestar Galactica (BG).  I'm not trying to be the guy who doesn't like the popular show, I just really thought it sucked.&lt;br /&gt;&lt;br /&gt;I've liked shows that have bombed (Brisco County Jr.) and hated hits (Seinfeld), but I could always figure out why.  Sometimes it's me, sometimes it's them.  This time it was different.&lt;br /&gt;&lt;br /&gt;With Battlestar, a lot of people, from all walks of life, really liked this show.  People who's opinions I value, truly liked this show.&lt;br /&gt;&lt;br /&gt;Most went out of there way to point out that it wasn't Science Fiction, it was drama.  And they really like drama.&lt;br /&gt;&lt;br /&gt;One, Science Fiction can be drama.  Quit making excuses.&lt;br /&gt;&lt;br /&gt;Two, I love Science Fiction.  Hell, I love SciFi.  I think the coolest station in the world would be the "Naked SciFi Channel".  You take popular SciFi shows, rename them enough to avoid lawsuits, and then add plenty of nudity.  This week on "Space Trek" frisky space moths attack the "USS Stimulus Package."  MOTHSSSSS!&lt;br /&gt;&lt;br /&gt;Three, given that, I REALLY though BG sucked.  I mean A LOT!  The fact that 99% of you vehemently disagree with me leaves me baffled.&lt;br /&gt;&lt;br /&gt;I remember when it premiered.  I was going to watch it with an open mind. I needed something to fill the hole left by Babylon 5 and was looking forward to chatting about it on &lt;a href="http://www.slashdot.org"&gt;Slashdot&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;I watched the show and was amazed at how stupid it was.  I went on Slashdot and was amazed again at how positive the reviews were.  I couldn't, and still can't believe that we all watched the same premier.&lt;br /&gt;&lt;br /&gt;This is my memory of the show:&lt;br /&gt;&lt;br /&gt;People are hanging around being middle class.  A hot babe in red shows up wearing a "look I'm a hot babe in red" blinking neon sign.  Thank god for that because I can never notice attractive women myself.  This was PG porn for the mentally challenged.&lt;br /&gt;&lt;br /&gt;She chats with Rachel Ray or someone for a couple of seconds, and then she strangles a baby.  She strangles a baby.  A baby leaps on her hands and crushes it's larynx on her thumb.  Eshay anglestrays an abybay.  Nope can say that without sounding stupid.&lt;br /&gt;&lt;br /&gt;Anyway, she then has PG9 warm monkey sex with Steve Jobs and her ass lights up.  Yup, you heard me.  Her ass lights up.  Make notes, if you noticed that then you can be a doctor on the Galactica.&lt;br /&gt;&lt;br /&gt;We then hop aboard the Galactica where we find out that Uber-president Douglas Adams has placed all the middle managers, hairdressers and telephone sanitizers on one ship in an effort to get them the hell off the planet.&lt;br /&gt;&lt;br /&gt;There is only one rule to be part of the Galactica crew.  You must be a complete dick.  No semi-nads apply.&lt;br /&gt;&lt;br /&gt;Suddenly the Cylon robots attack and invade our suburbia lifestyle.  They're robots, but they look just like us, but have a different religion.  Then they knock things over.  Um guys... They weren't robots, they were Muslims.  Muslims in space.&lt;br /&gt;&lt;br /&gt;Back to the story.  The heroic space crackers try to defend our turf, only to find out that all the space fighters, from 12 different planets mind you, all run on IPod Nanos.  Oh, and Steve Jobs has gone commie.  Ouch!  Ouch!  Ouch!  Come back here Mister Brain!&lt;br /&gt;&lt;br /&gt;Why would all the ships use the same computers and what the hell would weapons systems have to do in space anyway?  Ships turn at, oh, max 40Gs (much more would liquefy the pilot).  Space bullets move at, oh, a zillion miles per second.  And in space they go in perfectly straight lines!  Put your gun on a gimbal and blast away with your l33t Atari 2600 skills.  You can't miss!  For this they need a computer?&lt;br /&gt;&lt;br /&gt;Now we go to the Galactica.  The Galactica is run by a big Zune.  Actually they don't have networked computers at all on the Galactica, so they can fight Cylons.  That's because having the ship's email on one network and the ships weapons of death on a second is too much like SciFi.  Yeesh!&lt;br /&gt;&lt;br /&gt;No one aboard knows who are Cylons and who are Christians (oop! humans).  The fact that one of the two has an ass full of Christmas lights never tips anyone off.  The fact that you really can't have 2 wildly distinct creatures that match down to the chromosomal level kind of slips by here too.  Do they have Cylon midichlorians?  That can't be good.&lt;br /&gt;&lt;br /&gt;Oh, and, spoiler alert, it turns out that the second in command, the unlikable Saul Tigh is in fact a gruff but unlovable alcoholic Cylon.  Picture Bender from Futurama, but, you know, not likable.  If he's a Cylon, couldn't he have just whizzed on a disk drive or something and had the Cylons win on the first day?  Bender would have whizzed.  He would have whizzed like a hero.&lt;br /&gt;&lt;br /&gt;Oh well, I'm done picking on the plot, and I'm only an hour or so into the show.  I don't mean to imply that your dumb for liking the show.  I love SciFi.  I'm just saying you're dumb for thinking it ain't SciFi.  It was Emo-SciFi.&lt;br /&gt;&lt;br /&gt;I watched BG for most of the first season.  For those who say that I bailed too early, let's review the plot of the whole series:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;&lt;/span&gt;&lt;blockquote&gt;Space Muslims knocked down the 12 space trade towers.  The only survivors are space Republicans, half of which are really space Muslims and everyone, down to the dust bunnies are dicks.  Everyone.  Space Bush goes decider and tortures the space Muslims and everyone is a dick and almost has emotions about it.  Then Obama gets elected and they all decide to land and become hippies and angles and ignore technology so they can get small pox and invent racism and ignore plot holes.&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;How did I do?&lt;br /&gt;&lt;br /&gt;One last jab, then I'll shut up.&lt;br /&gt;&lt;br /&gt;I'm getting really tired of show writers coming up with scenes and characters that are deep and mysterious and then slapping on some BS ending that leaves the viewers hanging.&lt;br /&gt;&lt;br /&gt;Apologists will mew about writing like this as being like "real life".  They claim it's depth.  It ain't.  It's just sloppy writing.&lt;br /&gt;&lt;br /&gt;Watch: &lt;span style="font-style: italic;"&gt;&lt;/span&gt;&lt;blockquote&gt;I usually work late Thursday nights, but tonight I came home early.  As I pulled to the curb in my Teal 78 Ford Fairmont I noticed that something was amiss.  There were no children on the streets, just their toys.  A small 3 legged dog trotted past me.  Across the street another 3 legged dog trotted past on 3 other legs.  Both glanced at each other knowingly.  Somewhere a midget laughed.  I picked up my mail.  All the letters were from Ed McMahon.  Each letter had a different spelling of my name.  Each had a different picture of Ed.  I entered the house.  My mother was gone!  My dear sweet mother!  Where could she be?  Then I remembered,  Thursday is her bowling night.&lt;/blockquote&gt;&lt;br /&gt;Pretty good huh?  Really deep with lots of loose ends?  It must show that I'm profound or something.&lt;br /&gt;&lt;br /&gt;That or it's easy to add neat stuff to a story and hard to make it all work.&lt;br /&gt;&lt;br /&gt;A &lt;a href="http://www.paranoiahigh.webs.com/"&gt;friend&lt;/a&gt; and I used to write comic books together.  In one story he wrote so much stuff that he couldn't tie it all together.  It ended with "The Ender Of Comics" walking in holding a sign that said "The End".  No matter what happened, when he showed up the comic ended.  Deep huh?  We were 16.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/65633101471927506-4951433160131527604?l=upcracky.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://upcracky.blogspot.com/feeds/4951433160131527604/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=65633101471927506&amp;postID=4951433160131527604' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/65633101471927506/posts/default/4951433160131527604'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/65633101471927506/posts/default/4951433160131527604'/><link rel='alternate' type='text/html' href='http://upcracky.blogspot.com/2009/03/battlestar-galactica-really-sucked.html' title='Battlestar Galactica Really Sucked'/><author><name>Dale Wiles</name><uri>http://www.blogger.com/profile/12609080347734449263</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-65633101471927506.post-4287005201913020290</id><published>2009-03-29T21:45:00.001-04:00</published><updated>2009-03-30T23:16:42.837-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Programming'/><title type='text'>Death By Wiki</title><content type='html'>One the biggest software concepts of the past decade is the wiki.    It's a really great concept that should have been invented 15 years ago.  We had the technology, but it took Ward Cunningham to figure it out.  Yay Ward!&lt;br /&gt;&lt;br /&gt;A wiki allows almost anyone to contribute to a project, and you get instant gratification when you do.  If you're reading a page, and see a typo, you can edit the page yourself, without waiting for a blessing from above.  Once you edit the page, then your edited page becomes the page everyone else sees.  Lookie what I did!&lt;br /&gt;&lt;br /&gt;Unfortunately one of the biggest strengths of the wiki is also it's Achilles' heel.  The great unwashed masses can maintain it, so, too often, the great unwashed masses are left to maintain it.  That doesn't work.&lt;br /&gt;&lt;br /&gt;Projects need leadership.  The leadership needs to hop out of the ivory towers now and then and spend some time hanging out with the peasants and documentation.&lt;br /&gt;&lt;br /&gt;I know it's boring.  I'd rather be spend time writing code than documentation.  Almost everyone would, but the docs got to be done.&lt;br /&gt;&lt;br /&gt;I'm seeing more and more projects that aren't really projects.  They're just inbred code excretions.  A new version of the code comes out, and you have no idea what it does, or how to use it.  Those in the know know how to use it, but the rest of us are stranded.&lt;br /&gt;&lt;br /&gt;In the inbreeder's mind once the project becomes popular someone will swan in and write the documentation.  Sometimes it's even worse and they try to make a virtue out of bad documentation by claiming that anyone that uses their code is a l33t h@x0rs and should read the source code.&lt;br /&gt;&lt;br /&gt;Adding to the problem, a project opens up a wiki.  This is supposed to magically fix all the documentation problems.  Users are supposed to gather like worker bees and create documentation.  The problem is that one user can't tell if another user's solution is good or a bad.  They have no high level view of the project.&lt;br /&gt;&lt;br /&gt;For a wiki to work, the project heads need to invest time in checking what the wiki writers are writing.  If someone puts something up that's a bad idea, it needs to be edited out and the writers need to know why.  If it's a good idea, it needs to get official praise so other users know it's a valid solution.&lt;br /&gt;&lt;br /&gt;There also needs to be an editor who chops out entries that are no longer relevant.  If version 2 has a bug, and version 3 fixes it, then a 2 page discussion on the version 2 bug is no longer needed.  Especially when the current code is version 10 and version 2 hasn't existed for 5 years.&lt;br /&gt;&lt;br /&gt;Wikis are a great tool for empowering non-technical users, but they're not babysitters.  If you write code for others, you have to listen to them.  If you don't you'll find your babysitter goes psycho and your project will die from "shaken code" syndrome.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/65633101471927506-4287005201913020290?l=upcracky.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://upcracky.blogspot.com/feeds/4287005201913020290/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=65633101471927506&amp;postID=4287005201913020290' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/65633101471927506/posts/default/4287005201913020290'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/65633101471927506/posts/default/4287005201913020290'/><link rel='alternate' type='text/html' href='http://upcracky.blogspot.com/2009/03/death-by-wiki.html' title='Death By Wiki'/><author><name>Dale Wiles</name><uri>http://www.blogger.com/profile/12609080347734449263</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-65633101471927506.post-3298822457457625966</id><published>2009-03-14T00:09:00.000-04:00</published><updated>2009-03-14T00:38:16.536-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='comics'/><title type='text'>The Watchmen are ... Old.</title><content type='html'>I went and saw "The Watchmen" movie last night.  It was an interesting experience.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt;First, to get my propers in.&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;I'm a middle age guy who's been reading comic books most of his life.  I love the medium, I love adventure stories and I think people who can't deal with pictures in their story books are idiots.  I'm a nerd, but I'm a literate nerd.&lt;br /&gt;&lt;br /&gt;When "The Watchmen" came out, it was a series of 12 comic books that told one well written story.  It had a beginning, built really well and had an OK ending.  A serialized novel in the best tradition.  Not bad.&lt;br /&gt;&lt;br /&gt;But what made it ground breaking was the time it was printed.  This was the mid 80s.  Comic books had become banal.  Before "The Watchmen" Batman fought "Cavity Creeps".  After, "My Pretty Pony" had abortions.  Actually, everyone had abortions and scabies and the heartbreak of psoriasis.  Watchmen was first, but everyone followed.&lt;br /&gt;&lt;br /&gt;That was 20 years ago.  A lot has passed since then.  The new cynicism of the 80s was replaced by the cartoon cynicism of Dennis Leary was replace by the parody of Steven Colbert.  We're not really buying it anymore.&lt;br /&gt;&lt;br /&gt;The "Dark Hero" is pretty much the norm in movies now a days.  Even though they drew it from "The Watchmen" the clones made it to the silver screen first.  As a move, "The Watchmen" is a copy of itself.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt;Overview&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Some books can be translated almost directly into a move.  "The Maltese Falcon" is an example.  Take the book, have the actors read from it and you pretty much have a movie.  Other books, like say, "The Bible" are going to require a bit of editing if you're going to pull in the popcorn crowd.  Unfortunately for the director, "The Watchmen" falls into the second category.&lt;br /&gt;&lt;br /&gt;While not particularly long by book standards, the novel spends a lot of time getting into the heads of half a dozen characters and taking the reader for a ride.  That was one of the things the made the novel so good.  People who enjoyed it don't talk about the plot, they talk about who they liked and disliked.&lt;br /&gt;&lt;br /&gt;To invoke the same feeling, a director would need to film the graphic novel, giving plenty of time for each characters and make a 14 hour movie.  Not many people will sit there eating Ju-Ju-Bes for 14 hours.&lt;br /&gt;&lt;br /&gt;The second option is to forget the depth of the novel and concentrate on making a movie.  Either make it more plot driven and trim back the character's emo, or trim back the number of characters.  It's counter-intuitive, but to get closer to the feel of the novel they needed to deviate farther from it.&lt;br /&gt;&lt;br /&gt;Unfortunately the director tried to have it both ways and it only sorta worked.  They spent a lot of money for "sorta".&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt;Details, From Good to Bad.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Patrick Wilson was perfect as Nite Owl.  I was really impressed by his acting and how solid his whole performance was.  Unfortunately, solid performances like that are often overlooked when they share a stage with a big blue CGI penis.&lt;br /&gt;&lt;br /&gt;The rest of the cast was good.  I though Jackie Earle Haley was very good as Walter Kovacs, and OK as Rorschach.&lt;br /&gt;&lt;br /&gt;As for layout, a lot of the shots came right out of the comic book.  Sometimes it works.  Sometimes it don't.  Either way it makes the fanbois (myself included) happy.&lt;br /&gt;&lt;br /&gt;The special effects were lots of CGI.  Wowie Zowie and all that rot.&lt;br /&gt;&lt;br /&gt;Ozymandias was inane.  I don't blame Matthew Goode, he had nothing to work with.  Ozymandias was an embarrassingly bad character in the novel and the movie made him worse.&lt;br /&gt;&lt;br /&gt;The most clueless decision made by the director was to give the caped vigilantes real super powers.  They could do things like punch holes in bricks and jump so high that It looked like they could fly.  Huh?  The whole point of this was that people didn't have powers.  They were just regular people.  Regular people can't walk the streets dealing out justice.  That's called assault.&lt;br /&gt;&lt;br /&gt;There were a lot of little tweaks to the dialog that didn't seem to add anything.  If you haven't read the novel you won't notice it, but that kind of stuff drives me crazy.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt;Egress&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The Watchman movie isn't a bad movie.  It's not a great movie either.  It is out of it' time.  What made the Watchmen special is long over, which is probably a good thing.&lt;br /&gt;&lt;br /&gt;As an experiment, I've decided that I'm going to the comic shop and pick up a bound reprint of the comic books that I read 20 years ago.  I want to see how much of what I remember was never in the novel, how much has been beaten to death by 2 decades of imitation, and how much doesn't work when read by a 48 year old man.&lt;br /&gt;&lt;br /&gt;It's going to be interesting.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/65633101471927506-3298822457457625966?l=upcracky.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://upcracky.blogspot.com/feeds/3298822457457625966/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=65633101471927506&amp;postID=3298822457457625966' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/65633101471927506/posts/default/3298822457457625966'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/65633101471927506/posts/default/3298822457457625966'/><link rel='alternate' type='text/html' href='http://upcracky.blogspot.com/2009/03/watchmen-are-old.html' title='The Watchmen are ... Old.'/><author><name>Dale Wiles</name><uri>http://www.blogger.com/profile/12609080347734449263</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-65633101471927506.post-4779479813108332651</id><published>2009-03-07T22:26:00.000-05:00</published><updated>2009-03-07T22:34:04.226-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Gnome'/><category scheme='http://www.blogger.com/atom/ns#' term='Linux'/><title type='text'>Just an Artist without a Canvas.</title><content type='html'>About 3 weeks ago I posted a question on a user form at gnomesupport.or&lt;wbr&gt;g.  The question was whether or not a particular widget (the Canvas) was being actively supported and, if not, how to replace it's functionality.&lt;br /&gt;&lt;br /&gt;After 3 weeks I've had 125 looks, but no answers.&lt;br /&gt;&lt;br /&gt;The problem is that it's not really a technical question, it's more of a "which direction is Gnome going" type question.  A regular user can't answer it.  It requires an opinion of someone higher up in the Gnome hierarchy.  Apparently they're not reading the forums.&lt;br /&gt;&lt;br /&gt;Gnomesupport.or&lt;wbr&gt;g is the official support forum for Gnome.  We need for people higher up to scan these boards once in a while or Gnome is going to suffer from "user rot".  If we don't know Gnome's direction, we waste time going in the wrong direction.  If it's wasted time, then why spend it on Gnome when I can be productive somewhere else?&lt;br /&gt;&lt;br /&gt;We seem to be falling into the "self maintaining user-base" fallacy.  It's been growing pervasive in many projects in the past few years.&lt;br /&gt;&lt;br /&gt;It goes something like this: Because users can share information, developers need only provide a platform for sharing and the users will take care of themselves.&lt;br /&gt;&lt;br /&gt;Um, that don't work.  Some questions can only be answered by the developer or someone who has a big picture view of a project.  A user can't tell another user the "correct" way to do some things unless they've received the word from someone higher up.&lt;br /&gt;&lt;br /&gt;I'm not saying that the people running Gnome should spend all day monitoring the user forums, that's petulant and wastes developer's time. However, someone with access to the top, should check the forums for questions that have been in the queue for more than a few days and don't have answers.  The questions that aren't being addressed by other users should be looked over and, if relevant, kicked up to the next level.&lt;br /&gt;&lt;br /&gt;There should also be someplace where people can have limited access to high level Gnomes (Uber-Gnomes?) to ask "big questions".  Things like "I'm thinking making Fortran bindings for Gnome, does anyone else think that's awesome?" or "I don't like sound server X, let's write a replacement." or "Hey Uber-Gnomes, what do you think is most needed in Gnome?"&lt;br /&gt;&lt;br /&gt;The place would need to have the participation of the higher ups for it to be useful.  Spending a year writing a replacement for sound server X, when there is already an official project in place to replace it with Y would be a colossal waste of time and programmers.  People need to know that before they waste time.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/65633101471927506-4779479813108332651?l=upcracky.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://upcracky.blogspot.com/feeds/4779479813108332651/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=65633101471927506&amp;postID=4779479813108332651' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/65633101471927506/posts/default/4779479813108332651'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/65633101471927506/posts/default/4779479813108332651'/><link rel='alternate' type='text/html' href='http://upcracky.blogspot.com/2009/03/just-artist-without-canvas.html' title='Just an Artist without a Canvas.'/><author><name>Dale Wiles</name><uri>http://www.blogger.com/profile/12609080347734449263</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-65633101471927506.post-6071376938026563453</id><published>2009-02-22T22:27:00.000-05:00</published><updated>2009-02-22T22:41:39.625-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='politics'/><title type='text'>Sometimes a Chimp is Just a Chimp</title><content type='html'>Has anyone, besides the pundits, been following the tempest in the tea pot that is the "dead chimp" cartoon?&lt;br /&gt;&lt;br /&gt;What happened is, a cartoonist named Sean Delonas drew &lt;a href="http://www.huffingtonpost.com/2009/02/18/new-york-post-chimp-carto_n_167841.html"&gt;a cartoon&lt;/a&gt; for the New York Post.&lt;br /&gt;&lt;br /&gt;The cartoon is clearly a reference to &lt;a href="http://www.huffingtonpost.com/2009/02/17/travis-the-chimp-shot-dea_n_167527.html"&gt;this event&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;I don't really have a big opinion on the actual cartoon.  It's the kind of "meh" humor that make up most political cartoons.&lt;br /&gt;&lt;br /&gt;The tempest is coming from elements of the "official" left who do the following: Cartoonist says Stimulus bill is written by a crazed chimp.  Barack Obama is the author of Stimulus bill.  Therefore Cartoonist says Barack Obama is a crazed chimp.  Racism.  See?&lt;br /&gt;&lt;br /&gt;Um, no.  No I don't.&lt;br /&gt;&lt;br /&gt;When I see the cartoon, all I see is what I think is the cartoonist is saying.  "The nasty liberal Stimulus bill is so icky poo that it must be written by a crazed chimp."  I don't see the "obvious" connection to racism.  Don't get me wrong, I get the argument.  I've listed it above.  I just don't buy into it.&lt;br /&gt;&lt;br /&gt;I don't profess that no one's ever portrayed Obama as a monkey.  There is the stupid "curious george obama tshirt" (google it), but I just don't think the Post cartoon is an example of it.&lt;br /&gt;&lt;br /&gt;What annoys me the most is how rabid the "official" left is on this.&lt;br /&gt;&lt;br /&gt;First of all, many of the blog posts that I've seen don't reference the original monkey incident.  That's dishonesty.  It's a single link and any blog that doesn't at least reference it is trying to with their point by deception.&lt;br /&gt;&lt;br /&gt;I also don't like the "agree with me or your a racist" attitude.  You can disagree with an opinion and not burn a cross.  I don't think that anyone that sees the cartoon as racist is a fool.  I just think that they're reading in something that isn't there.&lt;br /&gt;&lt;br /&gt;Before the tiring name calling starts, I'm a pretty hard core liberal.  I loath Rush, despised Bush and think that listening to Ann Coulter is like watching a post syphilitic Al Capone talk about Chicago in the "good old days".&lt;br /&gt;&lt;br /&gt;I've also seen these talking heads consume some of my best friends.  Friends who've I've respected all my life have become talking head wanna-bes.  They parrot the ideas ejaculated by media liars just to feel like they're in the know.  They know it's crap but it's easier than thinking.  I don't want to become one of those.&lt;br /&gt;&lt;br /&gt;My biggest fear is that the mainstream Democratic party is going to be taken over by the left wing equivalent of Rush and the party is going to be as far left as the Republicans are to the right.  If we walk off that cliff then we're not only going to be as big a pack of self righteous fools as the right, but we're also going to loose the support of the middle and get Daemon Reagan elected in 2012.&lt;br /&gt;&lt;br /&gt;I'm not a liberal because I can play games and shout down my opponents, I'm a liberal because I like being right.  If someone can show me where I'm wrong I'll change my opinion.  Until then, "Bad monkey, no banana!"&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/65633101471927506-6071376938026563453?l=upcracky.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://upcracky.blogspot.com/feeds/6071376938026563453/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=65633101471927506&amp;postID=6071376938026563453' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/65633101471927506/posts/default/6071376938026563453'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/65633101471927506/posts/default/6071376938026563453'/><link rel='alternate' type='text/html' href='http://upcracky.blogspot.com/2009/02/sometimes-chimp-is-just-chimp.html' title='Sometimes a Chimp is Just a Chimp'/><author><name>Dale Wiles</name><uri>http://www.blogger.com/profile/12609080347734449263</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-65633101471927506.post-969331629629322140</id><published>2009-02-15T20:17:00.000-05:00</published><updated>2009-02-15T20:32:11.675-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='comics'/><title type='text'>Getting real with "The Joker".</title><content type='html'>It may come as a shock to you all, but I'm kind of into comics.  A computer nerd AND a comic nerd?  What are the odds!&lt;br /&gt;&lt;br /&gt;For those who don't follow comics, about 20 years ago a 12 issue miniseries called "The Watchmen" came out.  It was gritty, it was profitable, it was copied.  Whoo boy was it copied!&lt;br /&gt;&lt;br /&gt;Unfortunately it was copied badly.  In the Watchmen reality the heroes get shot and villains get sent to jail.  The heroes stayed dead and the villains wait for parole.  Close enough for Jazz.&lt;br /&gt;&lt;br /&gt;In Watchmen copy world, heroes get shot, kicked, spit on and get their cars stolen.  Villains get laid.&lt;br /&gt;&lt;br /&gt;Not quite the same thing is it?&lt;br /&gt;&lt;br /&gt;Let me give you an example: Reality Batman Vs Reality Joker.&lt;br /&gt;&lt;br /&gt;In the DC world, Batman was recently killed.  Bruce Wayne ate some raw oysters in a month with an "r" in it or some such nonsense and now he's tits up in the morgue.&lt;br /&gt;&lt;br /&gt;This is the highlight of his life as of late.&lt;br /&gt;&lt;br /&gt;He's also been accused of being a child molester, had a pile of Robins killed, got his spine snapped, his stately manor burned to the ground and ended up playing second fiddle to the villain in all of his movies.  No wonder he's such a grouch!&lt;br /&gt;&lt;br /&gt;We all know that he's going to come back in a year or so.  It always follows the same script.&lt;br /&gt;&lt;ul&gt;&lt;li&gt;First all the heroes will get to emo.  All villains will have a drunken orgy.&lt;/li&gt;&lt;/ul&gt;&lt;ul&gt;&lt;li&gt;Then the heroes call each other names and fight over who gets to be the new Batman.  The villains will make a YouTube video of zombie Batman having sex with zombie Robin.&lt;/li&gt;&lt;/ul&gt;&lt;ul&gt;&lt;li&gt;A few heroes will run around in a Bat suit and fight crime.  A few of the villains will hire strippers to dress like Batman and slide up and down their Batpoles.&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;ul&gt;&lt;li&gt;None of the heroes will hit on Catwoman.  All of the villains have already hit on Catwoman.&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;Once the novelty wears off things will get back to normal.  We know it.  We wait for it.  We expect it.&lt;br /&gt;&lt;br /&gt;But this dog pile of sadness only happens to the heroes.  They never take a major dump on an A-list villain.  I'm not talking dropping some unremembered fad based villain like "The Rubic's Cuban" (the commie puzzler!)  I'm talking about a five star Alpha-Male villain.&lt;br /&gt;&lt;br /&gt;I elect "The Joker!"&lt;br /&gt;&lt;br /&gt;For the last few decades Batman has been little more that the Jokers butt monkey.  All the biggest Batman movies have really been Joker movies.  The best Batman graphic novels have be Joker based.  Best Batman cartoon voice?  Mark Hamill's Joker from "Batman: The Animated Series".&lt;br /&gt;&lt;br /&gt;The writers wizz on Batman constantly.  Batman has Robin.  The Joker gets Harley.  Robin is cute, but Harley puts out!  No wonder the Joker is always smiling.&lt;br /&gt;&lt;br /&gt;Batman spent his entire life studying to be Batman.  He know Bat-fu and is rich and has tons of cool Bat crap.  I get that.&lt;br /&gt;&lt;br /&gt;Superman is strange visitor from another planet who came to Earth with powers and abilities far beyond those of mortal men.  Ok.&lt;br /&gt;&lt;br /&gt;The Joker... is a dick.  That's it.  He's a dick.  He shows up one day, stops at the Good Will for a lavender jacket, acts like a dick and he's running with the big boys.&lt;br /&gt;&lt;br /&gt;Let's get real on his ass.&lt;br /&gt;&lt;br /&gt;Before we can smack down the Joker, we need a hero in his league.&lt;br /&gt;&lt;br /&gt;Joke vs Superman?  It would be one punch and then a large stain.  Joker can't hang with the S-man.&lt;br /&gt;&lt;br /&gt;Joker vs Batman?  Who's going to give Batman a banana when he's a good butt monkey?  Nah.  Batman has "issues" with Joker.  And by "issues" I mean he's a butt monkey.&lt;br /&gt;&lt;br /&gt;Wendy and Marvin from the Super Friends?  Maybe.  They all have the same fashion sense.  Up no.  They had Wonderdog.  Wonderdog was retarded, but he was a big dog and a big dog is more than a match for the Joker's bad fashion sense.  Hell, Gleek could probably kick the Joker's ass.&lt;br /&gt;&lt;br /&gt;Hmmm.&lt;br /&gt;&lt;br /&gt;I make up, and nominate "Melvin Palmowitz", better known as "The Completely Normal Guy."&lt;br /&gt;&lt;br /&gt;Here's the origin: Melvin works at a toll booth up on the Gotham interstate.  One day someone gives him a quarter with a Joker face on it.  Melvin says "Hey, this isn't president Obama, what's the deal?"&lt;br /&gt;&lt;br /&gt;It turns out to be a "Joker Quarter".  (You know you have a good police force when escaped criminals have time to mint coins.)  The Joker says that he sells them on late night infomercials and now Melvin has to be his new butt monkey because Batman keeps dieing and getting crippled.&lt;br /&gt;&lt;br /&gt;Everywhere Melvin goes, he sees the Joker grinning and looking threateningly at his children and making sawing signs on his throat when ever Melvin goes to stroke his pet alpaca (The Lockport Alpaca, come for the wool, stay for the mullet!)&lt;br /&gt;&lt;br /&gt;The police are, of course, oblivious to all this.  It's not like it's the 800th time the Jokers escaped.  It's not like he's wearing a lavender jacket.  It nothing like he's got a pancake white face and is the most recognizable villain in the entire world.  Nope.  No Jokers here.  Carry on!&lt;br /&gt;&lt;br /&gt;So Melvin is forced to go along with the Joker's next zany plot to kill millions of Americans, most of which have guns and would shoot the Joker the first time they saw him, yet oddly, they don't.&lt;br /&gt;&lt;br /&gt;Melvin is called to the warehouse where the Joker gets his evil shipments.  FedEx can find the Joker, the cops can't.&lt;br /&gt;&lt;br /&gt;The Joker is explaining his plans and dancing around and calling Melvin a butt monkey.  Melvin is wishing that the Gotham police had higher entrance requirements.&lt;br /&gt;&lt;br /&gt;Melvin sees a big pair of scissors sitting by the shipping receivable receipts.  He picks up the scissors, sneaks up behind the Joker and stabs him in the neck.  No big speeches.  No fancy Vulcan neck stab.  Just a plain old American puncture, the way god wants a neck stabbed!&lt;br /&gt;&lt;br /&gt;The Joker, being a dick in a lavender jacket, is not known for his stab proof neck.  He gets a "Did you?  Are those scissors in my neck?" look on his face, and falls over dead.&lt;br /&gt;&lt;br /&gt;Melvin, realizing he is no longer a butt monkey, wipes off his finger prints from the scissors, drives home and pets his wife and alpaca.  We never hear from Melvin again!  The Joker says dead!&lt;br /&gt;&lt;br /&gt;There's no way Melvin would get caught.  The cops show up and see Joker dead.  They're happy!  They're hanging around the crime scene singing and dancing and putting funny hats on the Joker's corpse.  The Joker has killed something like 1000 cops at one time or the other.  They're not going to lift a finger to find his killer.&lt;br /&gt;&lt;br /&gt;What would Batman do?  Cry?  Would he swoop in and threaten stoolies until he was too pooped to swoop?  That wouldn't get him anywhere.  What do stoolies know about toll takers?&lt;br /&gt;&lt;br /&gt;He could use his alleged amazing deductive powers.  Deduct a way!  Warehouses have millions of people tracking through them, and the cops won't stop doing a conga line around the stiff, so Batman's screwed.&lt;br /&gt;&lt;br /&gt;Besides, doesn't Batman have other, bigger criminals to fail to catch.  Maybe the Joker was killed by that probabilistic villain "The Rock/Paper and/or Scissor" (He'll kick your ass 1 out of 3 times.)  Nope, it's just Melvin and a found pair of scissors.&lt;br /&gt;&lt;br /&gt;Like it?  I think if they're trying to make comics more "realistic" then this story works.  The Joker is just a dick.  Sometimes dicks get stabbed.&lt;br /&gt;&lt;br /&gt;Really.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/65633101471927506-969331629629322140?l=upcracky.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://upcracky.blogspot.com/feeds/969331629629322140/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=65633101471927506&amp;postID=969331629629322140' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/65633101471927506/posts/default/969331629629322140'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/65633101471927506/posts/default/969331629629322140'/><link rel='alternate' type='text/html' href='http://upcracky.blogspot.com/2009/02/getting-real-with-joker.html' title='Getting real with &quot;The Joker&quot;.'/><author><name>Dale Wiles</name><uri>http://www.blogger.com/profile/12609080347734449263</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-65633101471927506.post-4025551348943788207</id><published>2009-01-25T18:16:00.000-05:00</published><updated>2009-01-25T18:32:47.111-05:00</updated><title type='text'>The Semi-Cult of "Super Jail"</title><content type='html'>"Super Jail" is a cartoon on Cartoon Network's "Adult Swim".&lt;br /&gt;&lt;br /&gt;The premise is that Super Jail itself is a Super Max prison.  It's physically isolated so prisoners actually have a lot of freedom to run around and have fun and on occasion start a riot and slaughter each other.  That's pretty much the plot of every episode.&lt;br /&gt;&lt;br /&gt;The art is virtuously ugly.  They try to make the ugly art part of the ugly feel of the cartoon.  The sort of succeed, but it's still ugly.&lt;br /&gt;&lt;br /&gt;The mindset is above "Assy McGee" (as is everything) but below "Metalocalypse".  They all pale compared to "Secret Squirrel".&lt;br /&gt;&lt;br /&gt;All in all it's just another show on "Adult Swim".  Watch it if you want, but don't kill yourself getting to the TV.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;However...&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;There is more to Super Jail than meets the eye.  Something culty.&lt;br /&gt;&lt;br /&gt;At the end of each episode a character name "Jacknife" escapes.  Who cares, right?  It turns out that, indirectly, a lot of people do.&lt;br /&gt;&lt;br /&gt;The next Super Jail begins with Jacknife being recaptured.  Each episode the capture is elaborate and different.  This isn't Bart Simpson writing something new on a blackboard, it's a whole new intro.  It's these intros have developed their own cult following.&lt;br /&gt;&lt;br /&gt;For example, the episode called "Mr. Grumpy-Pants" has the following intro:&lt;br /&gt;&lt;br /&gt;Open on a children's hospital in winter.  Shot of a ward full of dying children.  Hey look, it's Santy Claus!  Nope, it's Santy Jacknife.  Santy Jacknife steals all the kids meds.  A medical monitor turns into Jailbot, the ruthless, unstoppable prisoner retrieval robot.  Jailbot chases Jacknife.  Jacknife uses sick children as obstacles.  Sick children are run over by Jailbot.  Jacknife is cornered.  All the remaining children are crying.  Jailbot is touched.  Jailbot turns into a sleigh, strangles Jacknife into submission and flys off while projecting a hologram of reindeer in front of the sleigh.  It really was Santa Claus!  We love you, Jailbot!&lt;br /&gt;&lt;br /&gt;But wait!  There's more!&lt;br /&gt;&lt;br /&gt;Que the rocking theme music.  It's 30 seconds of pure garage rock.  Pretty munch anyone with a Stratocaster, a Fender "Champ" and a history of fuzz petal abuse could do the same.  You gotta crank up the fuzz.  I think fuzzy rock could save both music and the Internet.&lt;br /&gt;&lt;br /&gt;During the theme, our antihero Jacknife is dangling by his wrist from Jailbot, who is now a helicopter.  As Jailbot flies back to Super Jail, scenery flies by, all of which is new and warrants notice.&lt;br /&gt;&lt;br /&gt;After that, I've got a 50/50 chance of changing the channel.  I'm not alone.  I've run into a few people who hate the show, but always watch the intro.  The show isn't developing a cult following, the show's intro is.&lt;br /&gt;&lt;br /&gt;There are people who are waiting for the theme to be turned into a full song so they can buy it off the net.  They have no intention of buying the Super Jail DVD, they just want the theme.&lt;br /&gt;&lt;br /&gt;If the theme doesn't suck when they fill it out, and it isn't strangled by Digital Rights Management (DRM), I may even buy it.&lt;br /&gt;&lt;br /&gt;You can watch the intros to Super Jail at www.adultswim.com.  I think entire episodes are there, but I've never watched one all the way through.&lt;br /&gt;&lt;br /&gt;It's a cult thing.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/65633101471927506-4025551348943788207?l=upcracky.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://upcracky.blogspot.com/feeds/4025551348943788207/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=65633101471927506&amp;postID=4025551348943788207' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/65633101471927506/posts/default/4025551348943788207'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/65633101471927506/posts/default/4025551348943788207'/><link rel='alternate' type='text/html' href='http://upcracky.blogspot.com/2009/01/semi-cult-of-super-jail.html' title='The Semi-Cult of &quot;Super Jail&quot;'/><author><name>Dale Wiles</name><uri>http://www.blogger.com/profile/12609080347734449263</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-65633101471927506.post-869452951715783398</id><published>2008-12-12T22:48:00.000-05:00</published><updated>2008-12-12T23:18:10.743-05:00</updated><title type='text'>How to Capture Sound From an Analog Microphone in ALSA Using Linux.</title><content type='html'>&lt;span style="font-size:180%;"&gt;Intro&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;This is, in the compute biz, what we call a "wid".  Wid is short for "What I Did".  Not a lot of theory, I just show you what I did to record sound from my crappy on board VIA 8237 sound chip using Linux and a $10 microphone.&lt;br /&gt;&lt;br /&gt;The sound isn't professional by any stretch of the imagination, but it's great for voice notes and sending messages.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:180%;"&gt;The Prep&lt;/span&gt;.&lt;br /&gt;&lt;br /&gt;This assumes that you already have ALSA hooked up and sound is working.&lt;br /&gt;&lt;br /&gt;Start your output volume at mid-range.  The level coming in from microphones varies wildly.  You don't want it too low or you'll miss it if you get it working and you don't want it too high and have it blow a speaker.&lt;br /&gt;&lt;br /&gt;Find a test .wav file and play it with the "&lt;span style="font-family:courier new;"&gt;aplay&lt;/span&gt;" command.  This is just to make sure everything is working.  You can search for wave files on your Linux box with the command&lt;br /&gt;&lt;br /&gt;  &lt;span style="font-family:courier new;"&gt; locate wav | egrep 'wav$'&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;If you can't find one, pull something down from the Net.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:180%;"&gt;Hook Up the Microphone.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Plug in your microphone to the proper port on your sound card.  It's usually red or pink and often has a little, hard to read, glyph of a microphone beside it.&lt;span style="font-size:180%;"&gt;&lt;br /&gt;&lt;br /&gt;Set Up the Mixer.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt;Start alsamixer.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;I use the command line &lt;span style="font-family:courier new;"&gt;alsamixer&lt;/span&gt; to activate the microphone.  A graphic mixer might get the job done, but I don't feel like fiddling around them.&lt;br /&gt;&lt;br /&gt;I put &lt;span style="font-family:courier new;"&gt;alsamixer&lt;/span&gt; in it's own window so I can tweak things while testing.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt;Use the TAB key to set the "View" Mode to "All".&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Some of the capture options show up in the playback screen.  To minimize looking for the right setting, view all of them at once.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt;Turn on the Required Options.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;This is the list of options that I believe need to be set.  Because different sound chips boot up in different modes this list may not be complete.  Also, the values I list are just values that work for me.  There's nothing magic about the them.&lt;br /&gt;&lt;br /&gt;Use the arrow keys to move from option to option.&lt;br /&gt;&lt;br /&gt;Move to the "Mic" option.  Hit the space bar.  The work "CAPTUR" should show up in red.  I set the level to 71.&lt;br /&gt;&lt;br /&gt;Select "Mic Boost".  If it's listed as off (under "Item"), then press the "M" key to turn it on.&lt;br /&gt;&lt;br /&gt;If you've plugged your microphone into a jack in the front panel of your computer, (make *SURE* the panel is wired up), then use the "M" key to turn on "Mic Front Input".&lt;br /&gt;&lt;br /&gt;If you have more than one microphone port, make sure "Mic Select" is set to the proper microphone.  I use Mic1.&lt;br /&gt;&lt;br /&gt;Select "Capture".  Hit the space bar.  The work "CAPTUR" should show up in red.  I set the level to 67.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:180%;"&gt;Try a Capture.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Now to try a capture.  I use the following, which captures sound from the  microphone and plays it out the speakers (with a slight delay).  It keeps running until you exit with Control-C, so you can keep it running while you tweak things.&lt;br /&gt;&lt;br /&gt;   &lt;span style="font-family:courier new;"&gt;arecord -f dat -t wav -D hw:0,0 - | aplay -&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The hw:0,0 comes from Card 0, Device 0, which I got from&lt;br /&gt;&lt;br /&gt;   &lt;span style="font-family:courier new;"&gt;arecord --list-devices&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Don't worry if the sound is too soft.  You can fix that with sound processing software.  Make sure you have "Mic Boost" on if your chip supports it.&lt;br /&gt;&lt;br /&gt;To save your sound to a .wav file, use:&lt;br /&gt;&lt;br /&gt;   &lt;span style="font-family:courier new;"&gt;arecord -f dat -t wav -D hw:0,0 foo.wav&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;From there you convert it as you see fit.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:180%;"&gt;What I Really Use.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;At this point almost any sound program should work for you.  I'm pretty hardcore command line, so I use "&lt;span style="font-family:courier new;"&gt;sox&lt;/span&gt;" to tweak the sound.&lt;br /&gt;&lt;br /&gt;To turn up the sound on a .wav file under &lt;span style="font-family:courier new;"&gt;Sox&lt;/span&gt; use something like&lt;br /&gt;&lt;br /&gt;   &lt;span style="font-family:courier new;"&gt;sox foo.wav -v 7 bar.wav&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Because &lt;span style="font-family:courier new;"&gt;sox&lt;/span&gt; can also do audio capture while tweaking the volume I do both in one command.&lt;br /&gt;&lt;br /&gt;   &lt;span style="font-family:courier new;"&gt;sox -t alsa default -v 7 foo.wav ; aplay foo.wav&lt;/span&gt;&lt;span style="font-size:180%;"&gt;&lt;br /&gt;&lt;br /&gt;Outro.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;This is as far as I've gotten and all seems well.  I'm sure I'll use this technology to change the world, but for now I'm having too much fun singing bad Sinatra.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/65633101471927506-869452951715783398?l=upcracky.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://upcracky.blogspot.com/feeds/869452951715783398/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=65633101471927506&amp;postID=869452951715783398' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/65633101471927506/posts/default/869452951715783398'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/65633101471927506/posts/default/869452951715783398'/><link rel='alternate' type='text/html' href='http://upcracky.blogspot.com/2008/12/how-to-capture-sound-from-analog.html' title='How to Capture Sound From an Analog Microphone in ALSA Using Linux.'/><author><name>Dale Wiles</name><uri>http://www.blogger.com/profile/12609080347734449263</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-65633101471927506.post-1487037468521709021</id><published>2008-10-10T22:35:00.001-04:00</published><updated>2008-10-10T22:55:48.481-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Programming'/><category scheme='http://www.blogger.com/atom/ns#' term='Gnome'/><category scheme='http://www.blogger.com/atom/ns#' term='Linux'/><title type='text'>Gnome Needs a Scripting Language.</title><content type='html'>Gnome needs a scripting language that fills the same scripting role in Gnome that Bourne shell fills for the command line.&lt;br /&gt;&lt;br /&gt;A few days back I wrote a little script that pops up a window, gets some input from the keyboard, runs a program and then exits.  I banged it out in about 2 hours in Perl using the Gtk2 library.  Piece o' cake.&lt;br /&gt;&lt;br /&gt;The problem is that I really can't distribute the program.  Even if I assume that all Gnome systems have Perl, it's not safe to assume that they all have the Gtk2 libraries installed.&lt;br /&gt;&lt;br /&gt;If I want to make my little script available I'm going to have to rewrite it in C?  That can't be right!  Linux always has scripts.  It's one of the things that separates Linux from the lower beasts!&lt;br /&gt;&lt;br /&gt;I decided to check out the current state of Gnome scripting on Google.  Um, we're exactly where we were a decade ago.  10 years ago people were bitching about the lack of an official scripting language for Gnome and we're still bitching today.&lt;br /&gt;&lt;br /&gt;Let's stop bitching and fix this insult to Gnomehood.  For now we'll call the language "gscript" to save typing.  If there is already a "gscript", then accept my apologies and lets get on with life.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;font-size:130%;" &gt;What Gscript Needs to Be.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Here is a list of what I think gscript needs, in approximate order of importance.&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;It has to exist.  This first entry isn't as stupid as it sounds.  Good Gnome interfaces have existed for many of the existing scripting languages for years, but none of these scripts/interfa&lt;wbr&gt;&lt;wbr&gt;ces are *guaranteed* to be there.  Seriously, in the past decade, how many GTK/script have you used?  For it to be useful, gscript has to come with Gnome.  If you're using Gnome, then gnome-terminal may be optional, gscript is required!&lt;/li&gt;&lt;/ul&gt;&lt;ul&gt;&lt;li&gt;It needs to be a &lt;span style="font-weight: bold;"&gt;Gnome&lt;/span&gt; scripting language, not just another scripting language that comes with Gnome.  This is *important*!  There has to has interfaces to all major parts of Gnome, not just GTK.  Things like GConf and EggTrayIcon and user menus have to be accessible to gscript.  When a new version of Gnome comes out, it comes with a synced version of gscript.  It's not optional.&lt;/li&gt;&lt;/ul&gt;&lt;ul&gt;&lt;li&gt;It should have useful defaults.  Banging out a simple script should be, well simple.  About as simple as this:&lt;/li&gt;&lt;/ul&gt;&lt;blockquote&gt;#!/usr/bin/gscr&lt;wbr&gt;ipt&lt;br /&gt;&lt;br /&gt;init;&lt;br /&gt;guts = gtkbutton(label&lt;wbr&gt;&lt;wbr&gt; =&gt; "Hello World", callback =&gt; exit);&lt;br /&gt;    ; Note: A default also menu gets created here.&lt;br /&gt;    start_app(body =&gt; guts);&lt;br /&gt;&lt;/blockquote&gt;&lt;ul&gt;&lt;li&gt;It should work with both GTK and Gnome.  I'm not really sure what separates GTK from Gnome, but if the script doesn't need the Gnome stuff, then it should be able to use just GTK.&lt;/li&gt;&lt;/ul&gt;&lt;ul&gt;&lt;li&gt;It should do things the Gnome way.  One of the big bitches about Gnome is there's always a new way to do something.  No one ever explains, in simple terms, why the new way is better and how to use it properly.  If the right way to read a keypress from an international keyboard is to use the foobar interface, then gscript uses the foobar interface.&lt;/li&gt;&lt;/ul&gt;&lt;ul&gt;&lt;li&gt;  Gscript should be simple.  We're not trying to replace C or Python or COBOL.  The day will never come when 90% of Gnome is written in gscript.  It should exist to fill the niche that shell scripts do on the command line.  Anything else is gravy.&lt;/li&gt;&lt;/ul&gt;&lt;ul&gt;&lt;li&gt;Gscript shouldn't be too simple.  We've all worked with languages that are so simple that they're useless.  It should have all the control structures of a real language with scoped variables and real data types.  At a minimum it should have native lists, hashes, numbers and strings (anything else?).  It should also have modules and classes to handle medium size programming.  GTK-Bash would be a lousy choice.&lt;/li&gt;&lt;/ul&gt;&lt;ul&gt;&lt;li&gt;It should be embeddable.  Gnome is moving to things like cellphones.  Why not kill two birds with one stone?  Embeddable languages are useful and this will help keep the language small and simple.&lt;/li&gt;&lt;/ul&gt;&lt;ul&gt;&lt;li&gt;Screw the ASCII code.  Enough already!  International support should be the default, not an add on.  Those strange voices across the big salty pond are other programmers.  If they speak Chinese then they should be able to script in Chinese.&lt;/li&gt;&lt;/ul&gt;&lt;ul&gt;&lt;li&gt;Screw C!  Most scripters don't come from a C background anymore because they don't need to.  Computers are a zillion times faster than they were when I was a whelp, and no one is going to put gscript code in the kernel.  Gscript should be fast enough to be useful.  After that ease of use and flexibility are paramount.&lt;/li&gt;&lt;/ul&gt;&lt;ul&gt;&lt;li&gt;Lets not create a new language unless we have to.  I believe we can leverage an existing language.&lt;/li&gt;&lt;/ul&gt;&lt;ul&gt;&lt;li&gt;If we have to create a new language, lets go for it!  A lot of current languages are anachronistic retreads of boring old languages.  Why strive to suck?&lt;/li&gt;&lt;/ul&gt;&lt;span style="font-size:130%;"&gt;&lt;span style="font-weight: bold;"&gt;My Opinion on Existing Options.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Let's run through some of the existing options.  Despite my list above, most of what's needed already exists.  It's just not included with Gnome by default.&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt; Perl or Python : Both of these play very nice with Gnome/GTK.  The problem I see with these two languages are that they're both serious overkill for this problem.  Also choosing one over the other would come with a pre-built pissing contest.  I don't want to see their GTK libraries curtailed.  I personally use Perl::Gtk2 and love it.  I just don't think they would be the best fit for gscript.&lt;/li&gt;&lt;/ul&gt;&lt;ul&gt;&lt;li&gt;Tcl/GTk : Tcl tries too hard to be simple, which makes it painful for all but the smallest of programs.  If it scaled better it would have taken over the world by now.  Gscript should strive to be what Tcl/Tk failed to be.&lt;/li&gt;&lt;/ul&gt;&lt;ul&gt;&lt;li&gt;Zenity : Its great for popping up windows in shell scripts, but it doesn't really let you run actual scripts.  A new gscript programmer would be able to implement zenity in about a day.&lt;/li&gt;&lt;/ul&gt;&lt;ul&gt;&lt;li&gt;lua-gtk, guile-gnome and ruby-Gnome2 : Of all the languages I talk about, these 3 strike me as the most plausible.  They fit most, if not all of the requirements, they have and existing community and, according to &lt;a href="http://www.gtk.org/language-bindings.html"&gt;http://www.gtk.&lt;/a&gt;&lt;wbr&gt;&lt;wbr&gt;&lt;a href="http://www.gtk.org/language-bindings.html"&gt;org/language-bi&lt;/a&gt;&lt;wbr&gt;&lt;wbr&gt;&lt;a href="http://www.gtk.org/language-bindings.html"&gt;ndings.html&lt;/a&gt;, they already have viable bindings.  Anyone with experience care to chime in?&lt;/li&gt;&lt;/ul&gt;&lt;ul&gt;&lt;li&gt; Squeek : Aw c'mon.  The official Gnome scripting language being Smalltalk would rock!  We could write Gnome scripts that expand programmer's minds and then go give the KDE folks noogies.  Pull this off and we P0WN by existing.  It may not be the most practical of the choices, but I'll bet it would be the most fun.&lt;/li&gt;&lt;/ul&gt;&lt;ul&gt;&lt;li&gt;SomeOther : I'm open to suggestions.  Give me your opinions.  Any other projects already started?  Just remember Gscript is not trying to replace all the other scripting languages.  We just need a good choice that we can get officially distributed with Gnome.&lt;/li&gt;&lt;/ul&gt;&lt;span style="font-size:130%;"&gt;&lt;span style="font-weight: bold;"&gt;In Summary.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Gnome not having an window aware scripting language is a decade old embarrassment.  It goes against all that is Linux.  The embarrassment is compounded by the fact that we have a lot of options that are ready to go, or could be ready to go in, literally, a matter of days.  We just need to choose one.&lt;br /&gt;&lt;br /&gt;Once a language is chosen, then the only big step is getting it included with the Gnome base packages.  Anyone have an in with the Gnome "powers that be"?  If not, then wanna write a script to storm a castle?&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/65633101471927506-1487037468521709021?l=upcracky.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://upcracky.blogspot.com/feeds/1487037468521709021/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=65633101471927506&amp;postID=1487037468521709021' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/65633101471927506/posts/default/1487037468521709021'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/65633101471927506/posts/default/1487037468521709021'/><link rel='alternate' type='text/html' href='http://upcracky.blogspot.com/2008/10/do-you-see-what-i-see.html' title='Gnome Needs a Scripting Language.'/><author><name>Dale Wiles</name><uri>http://www.blogger.com/profile/12609080347734449263</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry></feed>
