This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'thread' | |
class Actor | |
def initialize(send_queue, recv_queue) | |
@send_queue = send_queue | |
@recv_queue = recv_queue | |
end | |
def send(sym, *args) | |
@send_queue.push([sym,*args]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rubygems' | |
require 'builder' | |
xml = Builder::XmlMarkup.new | |
@recent_items = [ | |
{:title => "Item Title", | |
:description => "Item Description", | |
:pub_date => Date.today, | |
:guid => "10893750189756019760127", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rubygems' | |
require 'builder' | |
xml = Builder::XmlMarkup.new | |
@recent_items = [ | |
{:title => "Item Title", | |
:description => "Item Description", | |
:pub_date => Date.today, | |
:guid => "10893750189756019760127", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bitstring = <<-BITS | |
110101001110100001100101101000000101010111101110 | |
011010011111011001100101011100101111001101101001 | |
011101001111100110100000011011110110011010100000 | |
110001011110010001101001111011101110001011110101 | |
011100101110011111101000101000000111011101101111 | |
111101010110110011100100101000000110110001101001 | |
111010110110010110100000011101000110111110100000 | |
011101001110100011100001111011101110101110100000 | |
011010010111010011110011101000001111001111110101 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; Some fairly nasty elisp for a very simple purpose: to set up a new clojure-project | |
;; and run clojure-project in it. For those of us who Know Not The Ways Of Maven. | |
(defun clojure-project-setup (path) | |
"Set up a project structure for clojure-project and copy any | |
interesting-looking jars into lib/." | |
(interactive (list | |
(ido-read-directory-name | |
"Project root: " | |
(locate-dominating-file default-directory "~")))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
=begin | |
I worked through this Getting Started guide on 2011-07-08, on an | |
up-to-date Debian Squeeze desktop with ruby 1.9.2-p180 installed via | |
RVM, and Sproutcore 1.6.0.rc.2 installed via Rubygems. The Getting | |
Started guide was the first literature on Sproutcore I exposed myself | |
to. I've interspersed notes about where I got confused in =begin/=end | |
blocks throughout, mostly in the form of rhetorical questions as they | |
appeared in my mind at the time. I did not watch the screencast. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ lein version | |
Leiningen 1.6.2 on Java 1.6.0_18 OpenJDK 64-Bit Server VM | |
$ lein new foo | |
Created new project in: /home/zander/scratch/foo | |
Look over project.clj and start coding in foo/core.clj | |
$ cd foo | |
$ lein deps | |
Copying 1 file to /home/zander/scratch/foo/lib | |
$ time lein test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* For instance... */ | |
#define BUFSIZE 1024 | |
pa_simple *init_pulse(int *perror) | |
{ | |
/* The sample type to use. | |
This gives us 2 channels of 8 bits per channel. */ | |
static const pa_sample_spec ss = { | |
.format = PA_SAMPLE_U8, | |
.rate = 44100, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""doff | |
Touches its forelock. | |
""" | |
from random import randint | |
from mercurial import commands | |
commands.norepo += " doff" | |
greetings=[ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[0;32minfo: Loading facts in bytemark[0m | |
[0;37mdebug: importing '/usr/share/puppet/modules/bma2_dev/manifests/init.pp' in environment production[0m | |
[0;37mdebug: Automatically imported bma2_dev from bma2_dev into production[0m | |
[0;37mdebug: importing '/usr/share/puppet/modules/bma2/manifests/init.pp' in environment production[0m | |
[0;37mdebug: Automatically imported bma2 from bma2 into production[0m | |
[0;37mdebug: Failed to load library 'selinux' for feature 'selinux'[0m | |
[0;37mdebug: Scope(Class[Bma2]): Retrieving template bma2/bma2.vhost.erb[0m | |
[0;37mdebug: template[/usr/share/puppet/modules/bma2/templates/bma2.vhost.erb]: Bound template variables for /usr/share/puppet/modules/bma2/templates/bma2.vhost.erb in 0.00 seconds[0m | |
[0;37mdebug: template[/usr/share/puppet/modules/bma2/templates/bma2.vhost.erb]: Interpolated template /usr/share/puppet/modules/bma2/templates/bma2.vhost.erb in 0.00 seconds[0m |
OlderNewer