ameoba's New Writeupshttp://everything2.com/?node=New%20Writeups%20Atom%20Feed&foruser=ameoba2004-10-10T19:53:46ZOctober 10, 2004 (thing)http://m.everything2.com/user/ameoba/writeups/October+10%252C+2004ameobahttp://m.everything2.com/user/ameoba2004-10-10T19:53:46Z2004-10-10T19:53:46Z<a href="/title/Basted+egg">Basted egg</a>s.<br>
<br>
Always a promising way to start an adventure; getting thrown out of a bar at <a href="/title/last+call">last call</a> and having Richard say "Let's get some <a href="/title/basted+eggs">basted eggs</a>". Next thing you know, we're at <a href="/title/Denny%2527s">Denny's</a>.<br>
<br>
Just in case you're not sure what a <a href="/title/basted">basted</a> <a href="/title/egg">egg</a> is, don't feel alone. Nobody really knows for sure. If you ask a dozen <a href="/title/short+order+cook">short order cook</a>s you'll get a dozen different interpretations. The only constant is that it is an <a href="/title/egg">egg</a> that is somehow cooked. Currently, the <a href="/title/dishwasher">dishwasher</a> at my Denny's is the only one who has a definate idea of what "basted egg" really means; I think it somehow involves <a href="/title/fried+eggs">frying</a> & steaming simultaniously.<br>
<br>
Back to last night. I was a man on a mission; I knew, walking in the door, that I was going to make a serious order - something not on the menu, something defnately not "good" for me.<br>
<br>
<ul>
<li><a href="/title/Water">Water</a>
<li><a href="/title/Coffee">Coffee</a>
<li><a href="/title/Seasoned">Seasoned</a> <a href="/title/French+Fries">French Fries</a>
<li>a side order of <a href="/title/Bacon">Bacon</a>
<li>Fried <a href="/title/Chicken+Strip">Chicken Strip</a>s
<li>with a bowl of<!-- close unclosed tag --></li><!-- close unclosed tag --></li><!-- close unclosed tag --></li><!-- close unclosed tag --></li><!-- close unclosed tag --></li><!-- close unclosed tag --></li><!-- close unclosed tag --></ul>…The UNIX Philosophy (idea)http://m.everything2.com/user/ameoba/writeups/The+UNIX+Philosophyameobahttp://m.everything2.com/user/ameoba2002-11-20T17:37:06Z2002-11-20T17:37:06Z<a href="/title/Mike+Gancarz">Mike Gancarz</a>'s book <a href="/title/The+UNIX+Philosophy">The UNIX Philosophy</a> (Digital Press, 1995) describes many of the ideas and conventions that have made <a href="/title/unix">unix</a> a great sytem. It starts with a short run down of the history, quickly getting to the meat of things, discussion of the major ideas of <a href="/title/Unixdom">Unixdom</a> and illustrations of why they are such good ideas. While many of the ideas may seem relatively obvious to anyone who's worked with the system before, it makes an excellent introduction to the traditions of the Unix world, as well as an excelent bit of <a href="/title/advocacy">advocacy</a> for why the Unix way is the <a href="/title/Right+Way">Right Way</a>.<br>
<br><br>
Listed in the first chapter, the following nine points are the key <a href="/title/tenets">tenets</a>:<br>
<ol>
<li><b><a href="/title/Small+is+beautiful">Small is beautiful</a></b>
<li><b>Make each program do one thing</b>
<li><b>Build a <a href="/title/prototype">prototype</a> as soon as possible</b>
<li><b>Choose <a href="/title/portability">portability</a> over efficiency</b>
<li><b>Store numerical data in flat <a href="/title/ASCII">ASCII</a> files</b>
<li><b>Use software <a href="/title/leverage">leverage</a> to your advantage</b>
<li><b>Use <a href="/title/shell+script">shell script</a>s to increase leverage and<!-- close unclosed tag --></b><!-- close unclosed tag --></li><!-- close unclosed tag --></li><!-- close unclosed tag --></li><!-- close unclosed tag --></li><!-- close unclosed tag --></li><!-- close unclosed tag --></li><!-- close unclosed tag --></li><!-- close unclosed tag --></ol>…How to shotgun a beer (idea)http://m.everything2.com/user/ameoba/writeups/How+to+shotgun+a+beerameobahttp://m.everything2.com/user/ameoba2002-06-05T19:33:51Z2002-06-05T19:33:51ZSince everything goes better with <a href="/title/ASCII+art">ASCII art</a>, I feel that I should provide a nice diagram to emphasise some of the finer points of hole placement.<br>
<br>
<pre>
/
/
============
) (
| |
| <a href="/title/BEER">BEER</a> |
| |
| |
hole goes here -->> \ |
_/ |
\__________/
</pre>
<br>
As for the hole itself, I used to be fond of a three slice technique where the first (and longest) cut was made along the length of the can, with two <a href="/title/perpendicular">perpendicular</a> cuts made along the bottom resulting in two angled flaps which, when pressed into the can, make an aproximately <a href="/title/equilateral">equilateral</a> triangle. Alternately, you can make the cut along the width of the can first and then make the cut perpendicular to it, requiring only two cuts.<br>
<br>…Mandelbrot set (thing)http://m.everything2.com/user/ameoba/writeups/Mandelbrot+setameobahttp://m.everything2.com/user/ameoba2002-04-03T18:06:49Z2002-04-03T18:06:49ZAnd here's another implimentation in some -very- ugly <a href="/title/Python">Python</a>. It is the result of trying to compose <a href="/title/Mandelbrot+Set">Mandelbrot Set</a> entirely of <a href="/title/List+Comprehension">List Comprehension</a>s. Almost got there, but I couldn't manage to <a href="/title/shoehorn">shoehorn</a> the core <a href="/title/iteration">iteration</a> into a <a href="/title/list+comp">list comprehension</a>, so I was forced to use <a href="/title/reduce">reduce</a> there.<br>
<br>
As I said, this is ugly; it looks more like <a href="/title/scheme">scheme</a> than python. There's some whitespace added, but (excluding the import) the whole <a href="/title/program">program</a> is a single <a href="/title/statement">statement</a>.<br>
<br>
This requires a python newer than 2.1, due to the use of <a href="/title/nested+scopes">nested scopes</a>. With 2.2 or newer, the import statement is unneeded.
<br>
thx to <a href="/title/jamesc">jamesc</a> for his shades <a href="/title/string">string</a>.
<br><br><br>
<pre>
#!/usr/bin/env python
from __future__ import nested_scopes
(lambda ITERS, BOUND, SCALE, RMIN, RMAX, IMIN, IMAX, STEP, SHADES,WRITE,LOG:
[r for r in range( RMIN*SCALE, RMAX*SCALE, STEP) if
WRITE('\n') or
[i for i in range(IMIN*SCALE, IMAX*SCALE, STEP) if
(lambda j : WRITE(SHADES[int(LOG(j<!-- close unclosed tag --></pre>…Foreign Accent Syndrome (thing)http://m.everything2.com/user/ameoba/writeups/Foreign+Accent+Syndromeameobahttp://m.everything2.com/user/ameoba2002-03-02T13:18:39Z2002-03-02T13:18:39ZMy god, this is a recognized medical condition?<br>
<br>
A number of years ago, <a href="/title/the+morning+after">the morning after</a> a particularly high dose of <a href="/title/DXM">DXM</a>, I awoke to find myself speaking in a bad accent that I could not shake. Everything I said came out sounding like a high-school drama student who had seen too much <a href="/title/Monty+Python">Monty Python</a>. A friend of mine, who had grown up in the UK, described the accent as that of a "Middle-aged <a href="/title/Southeast+Asia">Southeast Asia</a>n man sent off to <a href="/title/boarding+school">boarding school</a> in <a href="/title/Cambridge">Cambridge</a> during early <a href="/title/puberty">puberty</a>".<br>
<br>
I was stuck like this for about a week. Beyond the annoyance (which itself nearly built to the level of a named psychological condition) of not speaking in my own voice there was the ridicule of those around me. I think I managed to piss off everyone I knew, and mostly stopped talking 'till normalcy resumed. (considering the antisocial behavior associated with DXM addiction, it wasn't really that big of a stretch) <br>
<br>
<br>
Maybe getting those <a href="/title/CAT+scan">CAT scan</a>s wouldn't be such a bad idea.list comprehension (idea)http://m.everything2.com/user/ameoba/writeups/list+comprehensionameobahttp://m.everything2.com/user/ameoba2002-02-11T14:53:09Z2002-02-11T14:53:09ZOne of <a href="/title/Python">Python</a>'s <a href="/title/functional+programming">functional programming</a> constructs, and quite possibly the easiest to grasp. It essentially applies some <a href="/title/expression">expression</a> to each element of an <a href="/title/iterator">iterator</a> (usually a <a href="/title/list">list</a> or a <a href="/title/tuple">tuple</a>) and places the result, if it meets some condition, in a new <a href="/title/list">list</a> which it returns. It can be thought of as a <a href="/title/map">map</a>() with an implied <a href="/title/filter">filter</a>(), but I just like to think of it as a list comprehension.<br>
<br>
<u><b>syntax :</b></u>
<blockquote><pre>
[<i>expression</i> for <i>item1</i> in <i>sequence1</i>
for <i>item2</i> in <i>sequence2</i>
for <i>item3</i> in <i>sequence3</i>
...
for <i>itemN</i> in <i>sequenceN</i>
if <i>condition</i>]
</pre>
</blockquote><br>
<br>
<b><u>Example<!-- close mismatched tag --></u></b><br><br>
Lets say one has the <a href="/title/string">string</a> <tt>"(<a href="/title/foo">foo</a>)(<a href="/title/bar">bar</a>)(<a href="/title/baz">baz</a>)"</tt> and one wishes to obtain the list <tt>["foo", "bar", "baz"]</tt> from it. Simply using the <a href="/title/split">split</a>() <a href="/title/method">method</a> of the string doesn't quite take care of…