We have some systems at work that use the database as a queue. I've been thinking about this a bit. So have other people.
// Boilerplate | |
function objectUnion(definer) { | |
var defined = 0, length = 0, isDefined = false, definitions, key; | |
definitions = definer(function() { | |
var names = arguments, fold; | |
if(isDefined) { | |
throw new TypeError('This objectUnion has already been defined'); | |
} | |
function Ctor() {} |
#!/usr/bin/ruby | |
require 'twitter' | |
require 'marky_markov' | |
def tweets | |
block = Twitter.user_timeline("joedamato", count: 200) | |
text = block.map(&:text) | |
max = block.last.id | |
until block.empty? |
This is a handy bit of code I've written more than once. I thought I'd throw it in here so I can refer back to it later. Basically, it lets you read a config file to produce a Clojure map. The config files themselves can contain one or more forms, each of which can be either a map or a list. Maps are simply merged. Lists correspond to invocations of extension points, which in turn produces a map, which is merged along with everything else.
Consider the following files:
names.edn
Hello scala, my old friend | |
I've come to take you home again | |
Because a feature slowly creeping | |
left me plagued with doubts and weeping | |
and the version that was tagged in the repo | |
just has to go | |
it lacks the signs of soundness | |
On sleepless nights I hacked alone | |
applying ant and other tools of stone |
Links for essays ref'd in http://blog.fogus.me/2009/03/11/seven-books/
- On the Criteria to Be Used in Decomposing Systems Into Modules – David Parnas
- A Note On Distributed Computing – Jim Waldo, Geoff Wyant, Ann Wollrath, Sam Kendall
- The Next 700 Programming Languages – P. J. Landin
- Can Programming Be Liberated from the von Neumann Style? – John Backus
- Reflections on Trusting Trust – Ken Thompson
- Lisp: Good News, Bad News, How to Win Big – Richard Gabriel
- An Experimental Evaluation of the Assumption of Independence in Multiversion Programming – John Knight and Nancy Leveson
- [Arguments and Results –
A lot of math grad school is reading books and papers and trying to understand what's going on. The difficulty is that reading math is not like reading a mystery thriller, and it's not even like reading a history book or a New York Times article.
The main issue is that, by the time you get to the frontiers of math, the words to describe the concepts don't really exist yet. Communicating these ideas is a bit like trying to explain a vacuum cleaner to someone who has never seen one, except you're only allowed to use words that are four letters long or shorter.
What can you say?
// Searching for large ModAux instances can be extremely slow. | |
// See this version for a faster solution: https://gist.github.com/4108026 | |
import shapeless._, Nat._ | |
trait FizzBuzz[N <: Nat] { | |
def steps: List[String] | |
def show = println(steps.reverse.mkString("\n")) | |
} |
@include handhelds { | |
table.responsive { | |
width: 100%; | |
thead { | |
display: none; | |
} | |
tr { | |
display: block; | |
} | |
td, th { |