<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:dc="http://purl.org/dc/elements/1.1/" version="2.0"><channel><description>I’m not too worried about it.</description><title>Topher Cyll</title><generator>Tumblr (3.0; @cyll-blog)</generator><link>https://blog.cyll.org/</link><item><title>Hello (Distributed) World: Designing Software that Spreads P2P</title><description>&lt;p&gt;What if simply being connected to a LAN or even the Internet gave you access to any application ever run on any other computer? What if your computer could automatically retrieve and launch those applications, no matter how complex, using a simple hashed-based identifier? What if the right software just arrived at the right time?&lt;/p&gt;

&lt;p&gt;Answering these questions is part of our goal with &lt;a href="http://bit.ly/skynet-survey"&gt;Skynet&lt;/a&gt;&lt;sup id="fnref:skynet"&gt;&lt;a href="#fn:skynet" class="footnote-ref" role="doc-noteref"&gt;1&lt;/a&gt;&lt;/sup&gt; and Spin, the distributed programming language on which Skynet is built. When a user needs a new Spin application, Skynet seamlessly retrieves it from a peer on the local network or the Internet.&lt;/p&gt;

&lt;p&gt;To make this possible, applications written in Spin are structured a little differently.&lt;/p&gt;

&lt;h2&gt;Hash everything&lt;/h2&gt;

&lt;p&gt;To start with, every part of a Spin application is identified by its &lt;a href="http://en.wikipedia.org/wiki/SHA-1"&gt;SHA-1&lt;/a&gt; digest. We refer to these identifiers as uuids.&lt;sup id="fnref:uuid"&gt;&lt;a href="#fn:uuid" class="footnote-ref" role="doc-noteref"&gt;2&lt;/a&gt;&lt;/sup&gt; These uuids let Skynet locate and download parts of applications over our peer-to-peer network and trust the results without needing to trust other peers.&lt;/p&gt;

&lt;h2&gt;Portrait of a fluid application&lt;/h2&gt;

&lt;p&gt;A Spin application is broken into several chunks. The most important of these is the application&amp;rsquo;s descriptor. This descriptor is, in some sense, the head of the application. In order to spawn an application, the spawning process must have a copy of the application&amp;rsquo;s descriptor.&lt;/p&gt;

&lt;p&gt;However, the descriptor doesn&amp;rsquo;t contain any code. Instead, it contains information such as the name and version. It can even include a description or icon. Most importantly, it contains a list of required dependencies specified by uuid.&lt;/p&gt;

&lt;p&gt;An application will not start unless all of its dependencies are available. These dependencies may be any kind of resource. One of them will be its own code segment.&lt;/p&gt;

&lt;p&gt;The uuid of the descriptor itself uniquely identifies the entire application.&lt;/p&gt;

&lt;h2&gt;Save space, save bandwidth&lt;/h2&gt;

&lt;p&gt;Like dynamically &lt;a href="http://en.wikipedia.org/wiki/Library_%28computing%29"&gt;linked&lt;/a&gt; native code, our dependency system saves space by storing each library or resource at most once, no matter how many applications depend on it. Just as importantly, each dependency will only ever be downloaded once.&lt;/p&gt;

&lt;h2&gt;Dependable dependency resolution&lt;/h2&gt;

&lt;p&gt;Like a statically linked executable, a Spin application will always use the exact dependencies it was compiled against. A library cannot be updated out from under an application and introduce unexpected behavior (or new bugs). If an application depends on a buggy library, it must be re-released in order to take advantage of a patched version.&lt;/p&gt;

&lt;p&gt;Using exact dependencies was a difficult decision. Tight and loose coupling both have advantages. In general, modern operating systems encourage dynamic linking. This can help them conserve space and RAM while making system updates easier for conventional software.&lt;/p&gt;

&lt;p&gt;Our hash-based distribution model already provided those benefits. In the end, we chose exact dependencies because it made our software easier to reason about and seemed to produce more reliable applications.&lt;sup id="fnref:services"&gt;&lt;a href="#fn:services" class="footnote-ref" role="doc-noteref"&gt;3&lt;/a&gt;&lt;/sup&gt;&lt;/p&gt;

&lt;h2&gt;Hello world as a fluid application&lt;/h2&gt;

&lt;p&gt;The simplest Spin application is a folder containing two &lt;em&gt;.spin&lt;/em&gt; source files.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;hello-world/
  main.spin
  metadata.spin
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;First &lt;em&gt;metadata.spin&lt;/em&gt; is compiled and then run, returning a partial application descriptor. Then, all spin files except &lt;em&gt;metadata.spin&lt;/em&gt; are compiled and included in the code segment.&lt;/p&gt;

&lt;h2&gt;Creating the descriptor&lt;/h2&gt;

&lt;p&gt;Here&amp;rsquo;s a simple &lt;em&gt;metadata.spin&lt;/em&gt; file:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;'{ type: 'application }
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;As you can see, you don&amp;rsquo;t have to specify much.&lt;sup id="fnref:types"&gt;&lt;a href="#fn:types" class="footnote-ref" role="doc-noteref"&gt;4&lt;/a&gt;&lt;/sup&gt; The compiler automatically adds other basic fields. It infers the application name from the directory and calculates the dependency uuids during compilation. The dependencies are stored under the &amp;ldquo;required-uuids&amp;rdquo; key and the &amp;ldquo;data-uuid&amp;rdquo; key specifies which of them is the code segment.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;'{
  commit-status: "later"
  commit-timestamp: 1281558040
  data-uuid: "0a0ac5781c34c69dac3996103c540e265ec81e67"
  imported-metadata-uuids: '{}
  major-version: 0
  micro-version: "2010.223.73240"
  minor-version: 0
  modification-timestamp: 1281558040
  name: "hello-world"
  payloads: '{}
  required-sizes: '{0a0ac5781c34c69dac3996103c540e265ec81e67: 276}
  required-sizes-total: 276
  required-uuids: '["0a0ac5781c34c69dac3996103c540e265ec81e67"]
  type: "application"
  version: '[0, 0, "2010.223.73240", "later", 0]
}
&lt;/code&gt;&lt;/pre&gt;

&lt;h2&gt;The moment we&amp;rsquo;ve all been waiting for&amp;hellip;&lt;/h2&gt;

&lt;p&gt;All applications have a spawn entry point that defaults to &amp;ldquo;main.&amp;rdquo; That is, when spawned, execution begins at the top of the &lt;em&gt;main.spin&lt;/em&gt; file.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;Log.as('green, "Hello distributed world.")
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;And that&amp;rsquo;s the simplest fluid application.&lt;sup id="fnref:log"&gt;&lt;a href="#fn:log" class="footnote-ref" role="doc-noteref"&gt;5&lt;/a&gt;&lt;/sup&gt; Like all Spin applications, this version of the &amp;ldquo;hello-world&amp;rdquo; application is uniquely identifiable by its uuid.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;3bd42a425d8b3d45d569527b88ec87f040db6257
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Those 40 characters describe a complete application, waiting to be fetched from the network and launched on any computer running Skynet.&lt;/p&gt;

&lt;p&gt;&lt;a href="http://bit.ly/skynet-survey"&gt;&lt;img src="http://skynet-loves-you.com/images/logo-right.png" alt="Skynet Logo"/&gt;&lt;/a&gt;
&lt;/p&gt;&lt;center&gt;&lt;a href="http://bit.ly/skynet-survey"&gt;Learn more about Skynet and help make it great.&lt;/a&gt;&lt;/center&gt;

&lt;div class="footnotes" role="doc-endnotes"&gt;
&lt;hr&gt;&lt;ol&gt;&lt;li id="fn:skynet" role="doc-endnote"&gt;
&lt;p&gt;Skynet is peer-to-peer desktop software designed to connect computers directly to each other so that their owners can seamlessly share media with friends and collaborate with colleagues. &lt;a href="#fnref:skynet" class="footnote-backref" role="doc-backlink"&gt;↩︎&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;

&lt;li id="fn:uuid" role="doc-endnote"&gt;
&lt;p&gt;This differs from IETF definition. Unlike IETF Version 5 UUIDs, we do not truncate the value to 128 bits. In addition, we will be transitioning to SHA-256 in the future. To distinguish the two definitions, we write ours as &amp;ldquo;uuid&amp;rdquo; in all lowercase. &lt;a href="#fnref:uuid" class="footnote-backref" role="doc-backlink"&gt;↩︎&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;

&lt;li id="fn:services" role="doc-endnote"&gt;
&lt;p&gt;Of course, not all relationships are suitable for exact linking. For example, communication with system services happens over loosely coupled messaging. These relationships must be declared and versioned to allow system upgrades. Applications whose service version requirements cannot be met, cannot be run. &lt;a href="#fnref:services" class="footnote-backref" role="doc-backlink"&gt;↩︎&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;

&lt;li id="fn:types" role="doc-endnote"&gt;
&lt;p&gt;Applications can be spawned, unlike &amp;ldquo;libraries,&amp;rdquo; but are always started explicitly, unlike &amp;ldquo;services.&amp;quot; &lt;a href="#fnref:types" class="footnote-backref" role="doc-backlink"&gt;↩︎&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;

&lt;li id="fn:log" role="doc-endnote"&gt;
&lt;p&gt;Spin does support writing to standard out, but in practice logging is almost always better. Consider that many running Skynet instances have no terminal attached to their standard out, but all support remote log viewing over our peer-to-peer network. &lt;a href="#fnref:log" class="footnote-backref" role="doc-backlink"&gt;↩︎&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;

&lt;/ol&gt;&lt;/div&gt;</description><link>https://blog.cyll.org/post/943403226</link><guid>https://blog.cyll.org/post/943403226</guid><pubDate>Thu, 12 Aug 2010 15:23:00 -0400</pubDate></item><item><title>If You Can't Make It Fast, Make It Parallel</title><description>&lt;p&gt;Building your own programming language is a lot of work, and you can&amp;rsquo;t do everything at once. Sometimes you know exactly how to make your language better, but other considerations take priority.&lt;/p&gt;

&lt;p&gt;We know how to make our programming language Spin&lt;sup id="fnref:spin"&gt;&lt;a href="#fn:spin" class="footnote-ref" role="doc-noteref"&gt;1&lt;/a&gt;&lt;/sup&gt; a heck of a lot faster, but working on its first killer app &lt;a href="http://skynet-loves-you.com"&gt;Skynet&lt;/a&gt;, is more important. Which brings me to a confession&amp;hellip;&lt;/p&gt;

&lt;h2&gt;We&amp;rsquo;re no faster than Ruby 1.8&lt;/h2&gt;

&lt;p&gt;I love Ruby, but I consider it an established low water mark for language performance. Ruby is just fast enough to use for real work, but developers can and will complain about performance. As a language designer &lt;em&gt;you really want to be at least a little faster than Ruby 1.8.&lt;/em&gt;&lt;sup id="fnref:ruby"&gt;&lt;a href="#fn:ruby" class="footnote-ref" role="doc-noteref"&gt;2&lt;/a&gt;&lt;/sup&gt;&lt;/p&gt;

&lt;p&gt;Fear not! We built Spin for distributed programming. And once we had applications talking to applications over asynchronous &lt;a href="http://en.wikipedia.org/wiki/Message_passing"&gt;messages&lt;/a&gt;, we started to want modules within those applications to communicate the same way.&lt;sup id="fnref:distributed"&gt;&lt;a href="#fn:distributed" class="footnote-ref" role="doc-noteref"&gt;3&lt;/a&gt;&lt;/sup&gt;&lt;/p&gt;

&lt;p&gt;Instead of building objects that have methods, sometimes we built threads that respond to messages. Before we knew it our language was designed around lightweight threads and shared-nothing message passing.&lt;/p&gt;

&lt;p&gt;Spin could be faster, but in the meantime, it&amp;rsquo;s got a saving grace.&lt;/p&gt;

&lt;h2&gt;An idle Skynet has 160 green threads&lt;/h2&gt;

&lt;p&gt;It spikes &lt;em&gt;way&lt;/em&gt; higher than that while doing active work.&lt;sup id="fnref:threads"&gt;&lt;a href="#fn:threads" class="footnote-ref" role="doc-noteref"&gt;4&lt;/a&gt;&lt;/sup&gt; All of those &lt;a href="http://en.wikipedia.org/wiki/Green_threads"&gt;green threads&lt;/a&gt; are mapped to a smaller number of native threads. Unlike some other languages, Spin actually get faster every time Intel or AMD releases on new multi-core monster&amp;hellip; if you run it on that new computer.&lt;/p&gt;

&lt;p&gt;So our language isn&amp;rsquo;t a speed demon, but software written in it scales &lt;em&gt;beautifully.&lt;/em&gt;&lt;sup id="fnref:io"&gt;&lt;a href="#fn:io" class="footnote-ref" role="doc-noteref"&gt;5&lt;/a&gt;&lt;/sup&gt; It&amp;rsquo;s an interesting position to be in. Skynet completely pegs both cores of my Macbook Pro when starting, but it boots twice as fast as if we&amp;rsquo;d gone with a more conventional language design.&lt;/p&gt;

&lt;p&gt;I can&amp;rsquo;t wait for Spin to be faster, but in the meantime it&amp;rsquo;s good enough that it&amp;rsquo;s parallel. When we improve our language performance, the threads running on every core get faster. And if numbers of cores grows faster than megahertz, well, then I&amp;rsquo;ll really be glad we went parallel.&lt;sup id="fnref:cores"&gt;&lt;a href="#fn:cores" class="footnote-ref" role="doc-noteref"&gt;6&lt;/a&gt;&lt;/sup&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="http://skynet-loves-you.com"&gt;&lt;img src="http://skynet-loves-you.com/images/logo-right.png" alt="Skynet Logo"/&gt;&lt;/a&gt;&lt;/p&gt;

&lt;div class="footnotes" role="doc-endnotes"&gt;
&lt;hr&gt;&lt;ol&gt;&lt;li id="fn:spin" role="doc-endnote"&gt;
&lt;p&gt;Spin is a horribly confusing codename for our language since there are so many other projects already using that name. We promise to rename it as soon as we have a million developers (or sooner ;-). &lt;a href="#fnref:spin" class="footnote-backref" role="doc-backlink"&gt;↩︎&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;

&lt;li id="fn:ruby" role="doc-endnote"&gt;
&lt;p&gt;Ever since Ruby 1.9, Ruby itself is now faster than Ruby 1.8. Go Ruby! &lt;a href="#fnref:ruby" class="footnote-backref" role="doc-backlink"&gt;↩︎&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;

&lt;li id="fn:distributed" role="doc-endnote"&gt;
&lt;p&gt;More on our slide into distributed programming later. &lt;a href="#fnref:distributed" class="footnote-backref" role="doc-backlink"&gt;↩︎&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;

&lt;li id="fn:threads" role="doc-endnote"&gt;
&lt;p&gt;Virtually all of the 160 steady state green threads are in a wait state, so CPU consumption is minimal. And since green threads are relatively cheap, spinning up more isn&amp;rsquo;t a big deal either. &lt;a href="#fnref:threads" class="footnote-backref" role="doc-backlink"&gt;↩︎&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;

&lt;li id="fn:io" role="doc-endnote"&gt;
&lt;p&gt;Not to mention that IO is performed in specially allocated native threads, so you never accidentally block a UI update or working thread just because you&amp;rsquo;re reading a large file. &lt;a href="#fnref:io" class="footnote-backref" role="doc-backlink"&gt;↩︎&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;

&lt;li id="fn:cores" role="doc-endnote"&gt;
&lt;p&gt;Today, even a decent desktop has four cores. Starting in August you&amp;rsquo;ll be able to order a &lt;a href="http://www.apple.com/macpro/"&gt;Mac Pro&lt;/a&gt; with twelve cores and SMT for 24 threads of execution. Imagine how much faster Spin would be on one of those! &lt;a href="#fnref:cores" class="footnote-backref" role="doc-backlink"&gt;↩︎&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;

&lt;/ol&gt;&lt;/div&gt;</description><link>https://blog.cyll.org/post/880597454</link><guid>https://blog.cyll.org/post/880597454</guid><pubDate>Fri, 30 Jul 2010 14:15:30 -0400</pubDate></item><item><title>Practical Ruby Projects</title><description>&lt;p&gt;
My Ruby book &lt;a href="http://www.apress.com/book/view/159059911X"&gt;Practical Ruby
Projects: Ideas for the Eclectic Programmer&lt;/a&gt; is in stores!
&lt;/p&gt;

&lt;center&gt;
&lt;img src="http://cyll.org/images/book.gif"/&gt;&lt;br/&gt;&lt;i&gt;(Practical Ruby Projects)&lt;/i&gt;
&lt;/center&gt;

&lt;p&gt;
I&amp;rsquo;ve been writing for the past year, and I&amp;rsquo;m crazy about the result.
This is the sort of book that I love to read, and hopefully that
shines through.
&lt;/p&gt;

&lt;p&gt;
Practical Ruby Projects is based on a few ideas:
&lt;/p&gt;

&lt;ul&gt;&lt;li&gt;&amp;ldquo;Hands on&amp;rdquo; is always better.&lt;/li&gt;
&lt;li&gt;You can cover more if you trust your reader to know the basics.&lt;/li&gt;
&lt;li&gt;Programming can be creative and exciting.&lt;/li&gt;
&lt;li&gt;Getting started is hard. Anything that makes that easy is good.&lt;/li&gt;
&lt;/ul&gt;&lt;p&gt;
This book covers a lot of projects (all done in Ruby, of course!):
&lt;/p&gt;

&lt;ul&gt;&lt;li&gt;Animation&lt;/li&gt;
&lt;li&gt;Music&lt;/li&gt;
&lt;li&gt;Simulation&lt;/li&gt;
&lt;li&gt;Turn Based Startegy Games&lt;/li&gt;
&lt;li&gt;RubyCocoa&lt;/li&gt;
&lt;li&gt;Genetic Algorithms&lt;/li&gt;
&lt;li&gt;Implementing Lisp&lt;/li&gt;
&lt;li&gt;Parsing&lt;/li&gt;
&lt;/ul&gt;&lt;p&gt;
PS- All the &lt;a href="http://cyll.org/PracticalRubyProjects.zip"&gt;source code&lt;/a&gt; is available under the MIT license!
&lt;/p&gt;</description><link>https://blog.cyll.org/post/92581392</link><guid>https://blog.cyll.org/post/92581392</guid><pubDate>Fri, 04 Jan 2008 00:00:00 -0500</pubDate><category>tech</category></item><item><title>Making Ruby into PHP</title><description>&lt;p&gt;
Sometimes a web framework is just over kill. Maybe it&amp;rsquo;s a one off dynamic page, maybe you don&amp;rsquo;t want the memory footprint of a whole framework running for only a small component of your whole site.
&lt;/p&gt;

&lt;p&gt;
mod_ruby and eruby can get you a lot of what PHP gives you if you&amp;rsquo;re
into that and don&amp;rsquo;t mind the setup. There&amp;rsquo;s the added perk that you
won&amp;rsquo;t have to write PHP.
&lt;/p&gt;

&lt;p&gt;
But what if you want something similar, but quick and simple and
you&amp;rsquo;re willing to use CGI?  Here&amp;rsquo;s a neat little trick.
&lt;/p&gt;

&lt;p&gt;
First save this text into a file called &amp;ldquo;rubyhp.rb&amp;rdquo; in your cgi-bin
directory.
&lt;/p&gt;

&lt;pre style="code"&gt;
require &lt;font color="#bc8f8f"&gt;'erb'&lt;/font&gt;
require &lt;font color="#bc8f8f"&gt;'cgi'&lt;/font&gt;

cgi = &lt;font color="#228b22"&gt;CGI&lt;/font&gt;.new
print &lt;font color="#bc8f8f"&gt;"Content-type: text/html\n\n"&lt;/font&gt;
print &lt;font color="#228b22"&gt;ERB&lt;/font&gt;.new(&lt;font color="#228b22"&gt;DATA&lt;/font&gt;.read).result(binding)
&lt;/pre&gt;

&lt;p&gt;
Leave this file unexecutable, so your web server won&amp;rsquo;t serve it. Then
create your PHP style Ruby file like this.
&lt;/p&gt;

&lt;pre style="code"&gt;
&lt;font color="#b22222"&gt;#&lt;/font&gt;&lt;font color="#b22222"&gt;!/usr/bin/ruby                                                                 
&lt;/font&gt;require &lt;font color="#bc8f8f"&gt;'rubyhp'&lt;/font&gt;
__END__
&amp;lt;html&amp;gt;
 &amp;lt;body&amp;gt;
  &amp;lt;% cgi.params.each &lt;font color="#a020f0"&gt;do&lt;/font&gt; |key, value| %&amp;gt;
   &amp;lt;%= key %&amp;gt;: &amp;lt;%= value %&amp;gt;&amp;lt;br /&amp;gt;
  &amp;lt;% &lt;font color="#a020f0"&gt;end&lt;/font&gt; %&amp;gt;
  &amp;lt;% &lt;font color="#a020f0"&gt;if&lt;/font&gt; cgi.params.empty? %&amp;gt;
   Sorry, please enter some cgi parameters. How about "?foo=baz"?
  &amp;lt;% &lt;font color="#a020f0"&gt;end&lt;/font&gt; %&amp;gt;
 &amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;
&lt;/pre&gt;

&lt;p&gt;
Name this file &amp;ldquo;test.rb&amp;rdquo; and save it in your same cgi-bin
directory. Make it executable and you&amp;rsquo;re done. You can write whatever
erb you want after the __END__ line, without needing to worry about
setting up anything fancy. And you have access to a parsed CGI object
through the variable &amp;lsquo;cgi&amp;rsquo;.
&lt;/p&gt;

&lt;p&gt;
Does CGI still have a place in modern web work? I&amp;rsquo;m don&amp;rsquo;t know. But I
do still use it for quick dynamic pages on cyll.org like the &lt;a href="http://cyll.org/bandnames.shtml"&gt;Computer Science Bandname
Generator&lt;/a&gt;. This little trick makes life a little easier for me
when I do.
&lt;/p&gt;</description><link>https://blog.cyll.org/post/92581374</link><guid>https://blog.cyll.org/post/92581374</guid><pubDate>Sat, 26 Aug 2006 00:00:00 -0400</pubDate><category>tech</category></item><item><title>Stupid IRB Tricks</title><description>&lt;p&gt;
This post reflects some tricks I sent out in a mail to &lt;a href="http://pdxruby.org"&gt;PDX.rb&lt;/a&gt; and some others I posted on my Intel internal Ruby blog. There&amp;rsquo;s nothing terribly novel here, but if you haven&amp;rsquo;t stumbled on these yet, they might save you some time.
&lt;/p&gt;

&lt;p&gt;
Your .irbrc file gives you a lot of control over what your IRB looks like each time it starts. Here&amp;rsquo;s what my .irbrc file looks like:
&lt;/p&gt;

&lt;pre&gt;
require 'irb/completion'
ARGV.concat [ "--readline", "--prompt-mode", "simple" ]

class Object
  def mymethods
    (self.methods - self.class.superclass.instance_methods).sort
  end
end
&lt;/pre&gt;

&lt;p&gt;
The first two lines turn on tab completion. If you don&amp;rsquo;t have this on
already, turn it on now! It only works when IRB can figure out the
type of expressions, but it helps make the interpreter more
friendly. Type &lt;i&gt;[].&lt;/i&gt; and hit tab to see the array methods tab
complete.
&lt;/p&gt;

&lt;p&gt;
The second chunk sets up an useful introspection function that Ben and
I came up with. It allows me to type foo.mymethods and get only the
methods that are defined for foo, but not the methods defined in its
superclass, which I find is often what I want (and sorted!). This is
important because sometimes Ruby&amp;rsquo;s humane interface means the number
of methods can be a little overwhelming.
&lt;/p&gt;

&lt;p&gt;
Oh, and one other tip!  If you&amp;rsquo;re doing interactive shell scripting in
irb, you&amp;rsquo;ll often get into situations where the huge list of files
you&amp;rsquo;re copying, or text-replacing or whatever is printing after every
command since most Ruby commands return values.  Waiting for hundreds
of lines to print after each command can start to drive you nuts.
Thankfully, you can shut off this echoing behavior in irb by typing:
&lt;/p&gt;

&lt;pre&gt;
conf.echo = nil
&lt;/pre&gt;

&lt;p&gt;
Those are all the tricks I can think of, but there must be more out
there&amp;hellip;
&lt;/p&gt;</description><link>https://blog.cyll.org/post/92581326</link><guid>https://blog.cyll.org/post/92581326</guid><pubDate>Fri, 26 May 2006 00:00:00 -0400</pubDate><category>tech</category></item><item><title>Comp Sci Bands</title><description>&lt;p&gt;
Can&amp;rsquo;t think of a name for your new Computer-Science-Rock Band? &lt;a href="http://cyll.org/bandnames.shtml"&gt;Try the Geek Chic Bandname Generator&lt;/a&gt;. It produces gems like&amp;hellip;
&lt;/p&gt;

&lt;ul&gt;&lt;li&gt;Bjarne Stroustrup and the Harvard Architectures&lt;/li&gt;
&lt;li&gt;Alan Kay and the Loop Invariants&lt;/li&gt;
&lt;li&gt;James Gosling and the Traveling Salesmen&lt;/li&gt;
&lt;li&gt;Alonzo Church and the Regular Expressions&lt;/li&gt;
&lt;li&gt;Donald Knuth and the Dining Philosophers&lt;/li&gt;
&lt;/ul&gt;</description><link>https://blog.cyll.org/post/92581313</link><guid>https://blog.cyll.org/post/92581313</guid><pubDate>Sun, 19 Mar 2006 00:00:00 -0500</pubDate><category>tech</category></item><item><title>A Quine Is A Quine Is A Quine</title><description>&lt;p&gt;
After re-reading Ken Thompson&amp;rsquo;s &lt;a href="http://www.acm.org/classics/sep95/"&gt;Reflections on Trusting Trust&lt;/a&gt;, I decided to write a Ruby quine.
&lt;/p&gt;

&lt;p&gt;
A quine is a &amp;ldquo;program that generates a copy of its own source text as its complete output.&amp;rdquo; I decided to use the classic Lisp quine as a foundation.
&lt;/p&gt;

&lt;pre style="code"&gt;
(lambda (x) (list x (list (quote quote) x))) (quote (lambda (x) (list x (list (quote quote) x)))))
&lt;/pre&gt;

&lt;p&gt;
This is what I came up with:
&lt;/p&gt;

&lt;pre style="code"&gt;
def x(s); puts %Q{#{s} x(%q{#{s}})}; end; x(%q{def x(s); puts %Q{#{s} x(%q{#{s}})}; end;})
&lt;/pre&gt;

&lt;p&gt;
The &lt;a href="http://www.nyx.net/~gthompso/quine.htm"&gt;Quine Page&lt;/a&gt; doesn&amp;rsquo;t have any Ruby Quines, but there are a bunch on the &lt;a href="http://www.rubygarden.org/ruby?RubyQuines"&gt;Ruby Quines&lt;/a&gt;
page. If you remove the extra spaces from my quine, it&amp;rsquo;s 84 characters. The shortest Ruby quine known is 28 characters:
&lt;/p&gt;

&lt;pre style="code"&gt;
puts &amp;lt;&amp;lt;2*2,2
puts &amp;lt;&amp;lt;2*2,2
2
&lt;/pre&gt;

&lt;p&gt;
Pretty cute!
&lt;/p&gt;</description><link>https://blog.cyll.org/post/92581311</link><guid>https://blog.cyll.org/post/92581311</guid><pubDate>Fri, 10 Mar 2006 00:00:00 -0500</pubDate><category>tech</category></item></channel></rss>
