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
Read this file first. | |
Then read the comments at the top of parity_test.c | |
Then read the comments above each algorithm implementation in parity.c | |
So there I was talking about efficient implemetation of fundamental functions | |
with Palmer over at SiFive. Back in the day, I used to participate in informal | |
contests on rec.games.programmer to see who could craft the most efficient | |
implementations for population count or bit reversal or bit-blitting. For | |
programmer types, it's great fun. |
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
// dsdm.dsdm | |
// | |
// DSD/Message : Like Partial Regexes, but for Message Flows | |
// | |
// This file introduces some of the concepts of DSD/Message, a language for describing the content and intent of message flows | |
// between cooperating distributed systems. DSD/Message (aka DSD/M) is used by protocol designers to succinctly define the content | |
// of protocol messages in loosely coupled systems. It defines two messaging patterns: EVENT and REQUEST / RESPONSE which behave | |
// like you might imagine. DSD/M also includes a macro capability to allow developers to easily reuse message constructions. The | |
// VARIANT construction allows developers to unambiguously denote changes in message structure based on specific values of specific | |
// message omponents. (Don't worry, this is a simple concept, it just sounds complicated when described formally.) |
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
# example.dsd | |
# | |
# This file contains a "DSD Message." DSD stands for "Dynamic Structured Data." | |
# It is a specification for messages that look a little like JSON, but have | |
# comments and a few features that makes it slightly easier to parse on small | |
# (8-bit) CPUs. But don't worry about that right now. This document is meant | |
# to give you the "flavour" of DSD without weighing you down with specifics. | |
# The first thing you'll notice about DSD is that (like JSON) virtually every | |
# DSD message you'll likely see is a dictionary (pretty much the same thing |
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
var states = [ | |
{ name: "Alabama" }, | |
{ name: "Alaska" }, | |
{ name: "Arizona" }, | |
{ name: "Arkansas" }, | |
{ name: "California" }, | |
{ name: "Colorado" }, | |
{ name: "Connecticut" }, | |
{ name: "Delaware" }, | |
{ name: "Florida" }, |
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
// HashRouter.js - an object that routes through a table to an object + method | |
// based on a the "hash" portion of a http(s) URL. Designed to be much, much | |
// simpler than the Backbone router. | |
// Copyright (c) 2015 Meadhbh S. Hamrick | |
// | |
// Permission is hereby granted, free of charge, to any person obtaining a copy | |
// of this software and associated documentation files (the "Software"), to deal | |
// in the Software without restriction, including without limitation the rights | |
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
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
{ | |
"production": { | |
"port": 80, | |
"httpsify": true | |
}, | |
"staging": { | |
"port": 8080, | |
"default": "http://127.0.0.1:19000", | |
"hosts": [ | |
{ "host": "#lo", "target": "http://127.0.0.1:19002" }, |
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
// lifecycle.js | |
// | |
// This example demonstrates how to start, use and eventually shut down a node.js server. Many | |
// node tutorials will tell you to completely restart a node process when changing a http | |
// server's behavior. This is good advice, since it can limit the effect of memory leaks and | |
// you don't have to worry about cross-version side effects on your business logic. But | |
// every now and again you'll run across a situation where it's impractical to restart a | |
// node process to upgrade server behaviour. For instance, we once made an "intelligent" | |
// proxy that would change it's logging and routing behaviour based on whether it (or we) | |
// thought an attack was happening. |
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
# raspiuser | |
# | |
# Having a fixed username / password combination is generally considered | |
# insecure. This script renames the default 'pi' user to one of your own | |
# choosing (please choose a name other than 'pi'.) Run it as root, passing | |
# the new username as the first parameter: | |
# | |
# sudo ./raspihork testuser | |
# |
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
# Figure out how big the input image is | |
GEO_INPUT=`identify $1 | cut -f 3 -d ' '` | |
X_INPUT=`echo $GEO_INPUT | cut -f 1 -d x` | |
Y_INPUT=`echo $GEO_INPUT | cut -f 2 -d x` | |
# Slice off a 2 pixel wide strip from the left side of the image | |
# Store as temp.jpg | |
convert $1 -crop 2x${Y_INPUT}+0+0 temp.jpg | |
# Now trim off the top of the temp.jpg. But we have to create a new image |
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
; ddn.ddn | |
; | |
; This document describes the Dynamic Data Notation (DDN). DDN is a superset | |
; of JavaScript Object Notation and fills a similar role. It differs from JSON | |
; in a few important ways: | |
; | |
; * DDN supports comments. Semi-colons (;), hash markes (#) and C++ style | |
; "slash slash" di-graphs (//) all begin a "to the end of the line" style | |
; comment. C-style "slash splat" (/*) and "splat slash" (*/) digraphs | |
; enclose bounded comments. |