<?xml version="1.0" encoding="utf-8"?>
<feed version="0.3" xmlns="http://purl.org/atom/ns#">
<link rel="alternate" type="text/html" href="http://emergent.unpythonic.net/"/>

<title>Jeff Epler's blog</title>
<modified>2012-05-14T14:15:56Z</modified>
<tagline>Photos, electronics, cnc, and more</tagline>
<author><name>Jeff Epler</name><email>jepler@unpythonic.net</email></author>
<entry>
<title>LG Optimus S on ting MVNO</title>
<issued>2012-05-14T14:15:56Z</issued>
<modified>2012-05-14T14:15:56Z</modified>
<id>http://emergent.unpythonic.net/01337004956</id>
<link rel="alternate" type="text/html" href="http://emergent.unpythonic.net/01337004956"/>
<content type="text/html" mode="escaped">
&lt;div style=&quot;float:right;clear:right&quot;&gt;&lt;!-- lg-optimus-s.jpg--&gt;&lt;div class=albumouter style=width:306px id=&gt;&lt;div class=albumimage style=&quot;width:186px;margin-left:60px;&quot;&gt;&lt;a href=&quot;http://media.unpythonic.net/emergent-files/01337004956/lg-optimus-s.jpg&quot; class=&quot;thickbox&quot; rel=&quot;album&quot; title=&quot;LG Optimus S (LG-LS670)&quot;&gt;&lt;img src=&quot;http://media.unpythonic.net/emergent-files/01337004956/lg-optimus-s-small.jpg&quot; width=180 height=300&gt;&lt;/a&gt;&lt;div &gt;&lt;div style=&quot;float: right&quot; &gt;&lt;a href=&quot;http://media.unpythonic.net/emergent-files/01337004956/lg-optimus-s.jpg&quot;&gt;&lt;img class=zoom src=&quot;http://media.unpythonic.net/emergent-files/default/zoom.png&quot;&gt;&lt;/a&gt;&lt;/div&gt;&lt;a href=&quot;http://media.unpythonic.net/emergent-files/01337004956/lg-optimus-s.jpg&quot;&gt;LG Optimus S (LG-LS670)&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;
&lt;/div&gt;
I finally talked Ingrid into switching from Sprint to &lt;a href=&quot;https://ting.com&quot;&gt;ting&lt;/a&gt;.  After deliberation, she decided to go with the
cheapest Android phone, the LG Optimus S (LG-LS670).  My good experience with
&lt;a href=&quot;http://emergent.unpythonic.net/01328842550&quot;&gt;my HTC Detail&lt;/a&gt; must have helped her decide to give
ting a try.

&lt;p&gt;Her old phone was an LG Remarq (feature phone with slider keyboard), but the
service on Sprint was costing her $82 a month, and she was starting to want
smartphone features like decent access to Google calendars and her e-mail.
Well, she can have it all, and for only about $30 a month on ting!

&lt;p&gt;If this article helps you decide to switch to ting, please consider using &lt;a href=&quot;https://zbss01lj1.ting.com/&quot;&gt;my referral code&lt;/a&gt; to get $25 off your phone
(and $25 off a monthy bill for me!)</content>
</entry>
<entry>
<title>Hosting Troubles</title>
<issued>2012-05-02T00:31:11Z</issued>
<modified>2012-05-02T00:31:11Z</modified>
<id>http://emergent.unpythonic.net/01335918671</id>
<link rel="alternate" type="text/html" href="http://emergent.unpythonic.net/01335918671"/>
<content type="text/html" mode="escaped">
My shared hosting server apparently burned down, fell over, and
&lt;strong&gt;then&lt;/strong&gt; sank into the swamp.  It looks like my
main blog is back, but images and css are still missing.  Ugh.  Hopefully
in another day or two everything will be back to normal.</content>
</entry>
<entry>
<title>dusub: Subtract two 'du'-style listings</title>
<issued>2012-04-04T12:54:44Z</issued>
<modified>2012-04-04T12:54:44Z</modified>
<id>http://emergent.unpythonic.net/01333544084</id>
<link rel="alternate" type="text/html" href="http://emergent.unpythonic.net/01333544084"/>
<content type="text/html" mode="escaped">
Life is a constant war against the limited size of backup media.  Here
is my next weapon in the fight: dusub.  Save a &lt;tt&gt;du&lt;/tt&gt; listing
today, then find out tomorrow or next week what's been growing:
&lt;pre&gt;dusub olddu newdu&lt;/pre&gt;
Positive numbers in the output represent an item that grew since olddu;
negative numbers represent a decrease in size since olddu.

&lt;p&gt;Presently, dusub only knows how to deal with plain du, not 'du -h'.
&lt;p&gt;&lt;b&gt;Files currently attached to this page:&lt;/b&gt;
&lt;table cellpadding=5&gt;&lt;col&gt;&lt;col style=&quot;text-align: right&quot;&gt;&lt;tr bgcolor=#eeeeee&gt;&lt;td&gt;&lt;a href=&quot;http://media.unpythonic.net/emergent-files/01333544084/dusub.py&quot;&gt;dusub.py&lt;/a&gt;&lt;/td&gt;&lt;td&gt;1.4kB&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;p&gt;</content>
</entry>
<entry>
<title>Google Literal Search for Firefox</title>
<issued>2012-03-14T15:04:14Z</issued>
<modified>2012-03-14T15:04:14Z</modified>
<id>http://emergent.unpythonic.net/01331737454</id>
<link rel="alternate" type="text/html" href="http://emergent.unpythonic.net/01331737454"/>
<content type="text/html" mode="escaped">
&lt;a onclick=&quot;window.external.AddSearchProvider('http://media.unpythonic.net/emergent-files/01331737454/google-literal-search.xml')&quot;&gt;Click here&lt;/a&gt; to add
&amp;quot;google literal search&amp;quot; to your list of search engines in firefox.  This is
about like the original google search engine that ships with most versions
of firefox, except that it specifies the tbs=li:1 parameter so that
the search is literal.

&lt;p&gt;If you'd like to look directly at the .xml file that specifies the search
provider, it's &lt;a href=&quot;http://media.unpythonic.net/emergent-files/01331737454/google-literal-search.xml&quot;&gt;google-literal-search.xml&lt;/a&gt;.
</content>
</entry>
<entry>
<title>Concept: Using rolling shutter for digital IS</title>
<issued>2012-03-13T14:26:04Z</issued>
<modified>2012-03-13T14:26:04Z</modified>
<id>http://emergent.unpythonic.net/01331648764</id>
<link rel="alternate" type="text/html" href="http://emergent.unpythonic.net/01331648764"/>
<content type="text/html" mode="escaped">
&lt;div style=&quot;float:right;clear:right&quot;&gt;&lt;!-- 220px-Turboprop_Rolling_Shutter.jpg--&gt;&lt;div class=albumouter style=width:306px id=&gt;&lt;div class=albumimage style=&quot;width:226px;margin-left:40px;&quot;&gt;&lt;img src=&quot;http://media.unpythonic.net/emergent-files/01331648764/220px-Turboprop_Rolling_Shutter.jpg&quot;&gt;&lt;br&gt;&lt;span&gt;Rolling shutter image of propeller blades (from Wikipedia)&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;
&lt;/div&gt;
I make no claim that this idea is original, but I wanted to write it down
anyway.

&lt;p&gt;Take an ordinary CMOS digital camera sensor with a &lt;a href=&quot;http://en.wikipedia.org/wiki/Rolling_shutter&quot;&gt;rolling shutter&lt;/a&gt; and since it only costs
a few cents, add accelerometers and gyros.

&lt;p&gt;Now, instead of merely capturing each row from the sensor into a finished
image, record each row from the sensor separately, along with its location on
the sensor and the time the capture started and ended; record this and the
accelerometer and gyroscope data.

&lt;p&gt;When you've got enough processing power available (in the camera if you have
it, on a general-purpose computer if you don't), use [the integral of] the
accelerometer and gyro data to estimate the orientation and position of each
row within a larger image, refine it by using any overlap between rows to
align them.  Once all rows have an initial placement, refine the placements
repeatedly until the best fit is achieved.   Paint all the rows onto a larger
canvas, trim the result down and interpolate at any spots you didn't cover.
&lt;a href=&quot;http://freecode.com/projects/ale&quot;&gt;ALE&lt;/a&gt; and &lt;a href=&quot;http://hugin.sourceforge.net/&quot;&gt;hugin&lt;/a&gt; have some excellent algorithms for these steps,
though there are probably some additional tricks and wrinkles when all the
input images are 1d.

&lt;p&gt;You can even incorporate multiple complete scans of the sensor in this way,
adding information without increasing smearing due to motion of the camera.
This information can either be used to reduce sensor noise or increase output
resolution using ALE algorithms.

&lt;p&gt;You could also do your best without having accelerometers and gyros: use any
simple motion estimate (such as zero between the first and second rows, and
the previous alignment-based estimate from row N-1..N for row N..N+1) as
input to the alignment step.

&lt;p&gt;Finally, an altered CMOS sensor that reads out in an interlaced fashion (or
other &amp;quot;non-linear&amp;quot; fashion) would be even better, because the first few rows
read out would be spread over the sensor, &amp;quot;pinning down&amp;quot; rows that are read
later.  For instance, if the initial stride is 16 rows on a 1024-row sensor and
the full exposure time is 1/8s then the basic geometry of the scene is captured
in just 2ms (relatively little motion being possible in this time) and
subsequent rows read will have the opportunity for overlap with both rows
&amp;quot;above&amp;quot; and &amp;quot;below&amp;quot; during the initial alignment phase.
</content>
</entry>
<entry>
<title>Cancellation error</title>
<issued>2012-03-07T15:42:39Z</issued>
<modified>2012-03-07T15:42:39Z</modified>
<id>http://emergent.unpythonic.net/01331134959</id>
<link rel="alternate" type="text/html" href="http://emergent.unpythonic.net/01331134959"/>
<content type="text/html" mode="escaped">
I was recently reminded of the importance of choosing numeric algorithms that
don't behave catastrophically for certain inputs.  One example is the
calculation of 1-cos(θ) for small θ.  In this case, cos(θ) is very close to 1,
leading to a &lt;a href=&quot;http://en.wikipedia.org/wiki/Loss_of_significance&quot;&gt;large
cancellation error&lt;/a&gt; in the subtraction step.

&lt;p&gt;&lt;img src=&quot;http://media.unpythonic.net/emergent-files/01331134959/cancelerr.png&quot;&gt;</content>
</entry>
<entry>
<title>WWVB CRT mock-up</title>
<issued>2012-03-06T01:41:06Z</issued>
<modified>2012-03-06T01:41:06Z</modified>
<id>http://emergent.unpythonic.net/01330998066</id>
<link rel="alternate" type="text/html" href="http://emergent.unpythonic.net/01330998066"/>
<content type="text/html" mode="escaped">
The plan is to be able to watch the &lt;a href=&quot;http://emergent.unpythonic.net/01325805161&quot;&gt;leap second&lt;/a&gt;
on some manner of wwvb-controlled clock of my own making.

&lt;p&gt;To that end, Chris gifted me with a compact B&amp;amp;W CRT from Goodwill, and I picked
up a &lt;a href=&quot;http://www.batsocks.co.uk/products/Other/TellyMate.htm&quot;&gt;TellyMate&lt;/a&gt;, which can display 38x25 text on a TV.

&lt;p&gt;Ignoring for the moment the difficulty of receiving the WWVB signal when
all the interference from a CRT TV is right nearby, I've created a mock-up
of what the display will look like (except that the font won't be nearly so
good looking as this):

&lt;p&gt;

&lt;pre width=38 class=&quot;term&quot;&gt;

         0123456789
   0.. 9 M01100000M  Minute  = 30
  10..19 000000111M  Hour    = 07
  20..29 000000110M  YDay    = 66
  30..39 011000010M  DUT1    = +0.3
  40..49 001100000M  Year    = 2008
  50..59 100001000&lt;span class=&quot;cursor&quot;&gt;M&lt;/span&gt;_ nols LY nodst
   
  &lt;span class=&quot;twox&quot;&gt;Local time:&lt;/span&gt;
  &lt;span class=&quot;twox&quot;&gt;1:31:00.0 AM&lt;/span&gt;

  &lt;span class=&quot;twox&quot;&gt;Thu Mar 6 2008&lt;/span&gt;
  UTC-0600 (CST)
   

&lt;/pre&gt;

&lt;p&gt;At the top, the WWVB data is displayed, along with its interpretation.  The
previous minute and the current minute are mixed, with the cursor indicating
the most recently read second of data.  Whatever piece of data is currently
being read or will next be read will be blanked out until all bits are
received (for instance, during seconds 0..8, &amp;quot;minute&amp;quot; will be blank;
from 9..18, &amp;quot;hour&amp;quot; will be blanked).

&lt;p&gt;Most of the time the &amp;quot;_&amp;quot; shown after second 59 will be blank.
During a leap minute it will be &amp;quot;_&amp;quot; and during the leap second it will
read &amp;quot;M&amp;quot;.

&lt;p&gt;Below, in larger lettering, the local time will be displayed.  I think I can
achieve 10 updates per second, so I'll show tenths but not hundredths (or, say,
thirtieths).  The UTC offsets for standard and daylight saving time will be
hardcoded (so if I move to Colorado to be closer to WWVB I'll have to fix my
firmware).

&lt;p&gt;The WWVB receiver and decoder is written and passes my tests.  I have yet to
write the display code (and optimize it--I can transmit fewer than 500
characters and control codes per 1/10 second to the tellymate), and I also have
to work out how to get enough reception that having the WWVB display is not a
big old waste of time.  (or maybe I'll just display a simulated WWVB signal
instead—with a disclaimer, of course.  stop looking at me like that.)
</content>
</entry>
<entry>
<title>Every once in a while, ssh is too slow</title>
<issued>2012-03-06T01:35:28Z</issued>
<modified>2012-03-06T01:35:28Z</modified>
<id>http://emergent.unpythonic.net/01330997728</id>
<link rel="alternate" type="text/html" href="http://emergent.unpythonic.net/01330997728"/>
<content type="text/html" mode="escaped">

I'm using my OLPC XO-1 as a music server which allows anyone in the household
the ability to play, stop, pause, adjust volume, and so on.  This was first
done by 'ssh olpc ...', but there's a substantial delay between issuing
the action and its effect.  So I wrote a simple web service that does the same
thing.  It turns out that most of the time is ssh overhead that's not present
in a http connection.

&lt;p&gt;&lt;pre&gt;
$ time ssh olpc /home/olpc/bin/cmus-playpause
real  0m0.522s
$ time wget -O /dev/null http://olpc:8000/playpause
real  0m0.066s
&lt;/pre&gt;

&lt;p&gt;It's nothing like the &lt;a href=&quot;http://emergent.unpythonic.net/01330399156&quot;&gt;384x speedup I got&lt;/a&gt;
the last time I was complaining about the olpc's performance, but it's still
nothing to sneeze at.
</content>
</entry>
</feed>

