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
Tom Moertel <[email protected]> | |
2013-12-16 | |
We are given the following problem: | |
Given a text file with 999,999 lines, one number per line, | |
numbers in random order from 1 to 1,000,000 but a single number is | |
missing, figure out what number is missing. | |
Source: http://blog.moertel.com/posts/2013-12-14-great-old-timey-game-programming-hack.html#comment-1165807320 |
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
Tom Moertel <[email protected]> | |
2013-12-14 | |
The following proof is a solution to the exercise I offered to readers | |
in the following blog post: | |
"A Great Old-Timey Game-Programming Hack" | |
http://blog.moertel.com/posts/2013-12-14-great-old-timey-game-programming-hack.html | |
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
Summary: A few days ago, some Chromecast-supporting Android apps | |
started crashing upon launch. Other Android apps, notably YouTube, | |
remain unaffected, as do iOS apps and Chromecast support in Chrome | |
(see table below). Today, I discovered that these crashes go away | |
when I remove the SONOS BRIDGE device that connects my SONOS audio | |
system to the same network. | |
My hypothesis: There is some interaction between the Chromecast | |
device-discovery logic and the SONOS bridge's presence on the network | |
that causes the problem. The most likely explanation for why these |
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
# Transforming the vanilla recursive fib into the iterative DP version | |
# through a series of mechanical steps. | |
# | |
# For more on converting recursive algorithms into iterative ones, see: | |
# http://blog.moertel.com/posts/2013-05-11-recursive-to-iterative.html | |
# original function | |
def fib(n): |
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
library(ggplot2) | |
library(scales) | |
library(plyr) | |
library(reshape2) | |
disk_errors <- read.csv("disk_errors.csv", header=F) | |
names(disk_errors) <- c("byte_offset", "bit", "a", "b") | |
disk_errors <- mutate(disk_errors, | |
bit = factor(bit), |
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
#!/usr/bin/env python | |
# | |
# Compare two disk images for bit differences. | |
# Usage: ./cmpdisks.py diskA.dsk diskB.dsk | |
# | |
# Tom Moertel <[email protected]> | |
# 2012-04-29 | |
import sys |
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
class x { | |
notify { xn: message => "x" } | |
} | |
define y() { | |
notify { yn: message => "y", require => Class["x"] } | |
} | |
y { "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
# The Puppet definition below produces following error when called as | |
# set_up_service_with_ssh_key("X"): | |
# | |
# err: Could not create ssh key Y for X: user X doesn't exist | |
# | |
# But the ssh_authorized_key resource requires User["X"]. | |
# Am I missing something? | |
define set_up_service_with_ssh_key($service_name) { |
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
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" | |
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> | |
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"> | |
<head> | |
<base href="http://yapc10.org/yn2009/" /> | |
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> | |
<meta http-equiv="Content-Language" content="en" /> | |
<meta name="keywords" content="" /> | |
<meta name="description" content="" /> | |
<link rel="alternate" type="application/atom+xml" title="YAPC|10" |
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
From: Tom Moertel <[email protected]> | |
To: Perl trainers and instructors:; | |
Reply-To: [email protected] | |
Subject: YAPC|10: CALL FOR COURSES | |
At YAPC|10, we're handling courses and training a bit differently than | |
at previous YAPCs. We are making the official Call For Courses soon, | |
but because you have led Perl training at past YAPCs or have indicated | |
interest in offering courses at YAPC|10, we wanted to let you know | |
directly. If you know of anybody else who would want to know, please |
NewerOlder