std::set phoenix;
phoenix.key_comp();
"""Provides a utility to inject environment variables into argparse definitions. | |
Currently requires explicit naming of env vars to check for""" | |
import argparse | |
import os | |
# Courtesy of http://stackoverflow.com/a/10551190 with env-var retrieval fixed | |
class EnvDefault(argparse.Action): | |
"""An argparse action class that auto-sets missing default values from env | |
vars. Defaults to requiring the argument.""" |
Below content is authored by Darian Shirazi for forbes.com -- I'm just saving it for the record/sharing post-removal
Original from forbes.com 2013-08-19 13:43. Retrieved from yahoo cache 2013-08-22 00:20
From the movie Boiler Room: "Hey these are the D&B cards. These are our leads...These are good leads. People on these cards buy stock."
import java.net.InetSocketAddress; | |
public class TestDns { | |
public static void main(String[] args) { | |
System.out.println(sun.net.InetAddressCachePolicy.get()); | |
InetSocketAddress unresolved = InetSocketAddress.createUnresolved("10.228.174.223", 8020); | |
System.out.println(unresolved.toString()); // prints 10.228.174.223:8020 | |
System.out.println(unresolved.getHostName()); // prints 10.228.174.223:8020 |
<?php | |
namespace CHH; | |
trait MetaObject | |
{ | |
protected static $metaClass; | |
static function setMetaClass(MetaClass $metaClass) | |
{ |
Rough way to determine number of buckets/classes to split a dataset into, for frequency distribution analysis / histograms:
2ⁿ⁻¹ < α < 2ⁿ
where α is the size of the dataset.
In other words, find a power of 2 that yields a number just larger than the size of your dataset. Decrementing this power would yield a number smaller.
var fs = require('fs'); | |
var http = require('http'); | |
var path = require('path'); | |
var console = require('sys'); | |
var url = require('url'); | |
var Script = process.binding('evals').Script; | |
var couchURL = url.parse(process.argv[2]), | |
couchUser = process.argv[3], | |
couchPass = process.argv[4], |
#!/usr/bin/env ruby | |
require 'oyster' | |
spec = Oyster.spec do | |
name "tsp -- Generate 1x1 PNG files with a particular background colour and opacity" | |
description <<-EOS | |
tsp is a command-line utility for generating 1x1 pixel PNG files with a given | |
background colour and opacity. Due to the relative lack of support for RGBA | |
amongst web browsers, it's useful to be able to generate background images |
###John Hughes, Institutionen f ̈or Datavetenskap, Chalmers Tekniska H ̈ogskola, 41296 G ̈oteborg, SWEDEN. rjmh@cs.chalmers.se
This paper dates from 1984, and circulated as a Chalmers memo for many years. Slightly revised versions appeared in 1989 and 1990 as [Hug90] and [Hug89]. This version is based on the original Chalmers memo nroff source, lightly edited for LaTeX and to bring it closer to the published versions, and with one or two errors corrected. Please excuse the slightly old-fashioned type-setting, and the fact that the examples are not in Haskell!
##Abstract
As software becomes more and more complex, it is more and more important to structure it well. Well-structured software is easy to write, easy to debug, and provides a collection of modules that can be re-used to reduce future programming costs. Conventional languages place conceptual limits on the way problems can be modularised. Functional languages push those limits back. In this paper we show that t
/** | |
* SuperDynamicHeadMode for http://paintwithnigelfarage.com | |
* | |
* Paste this script into browser's JS console. | |
* | |
* Controls: | |
* press/hold z to smallify Nigel | |
* press/hold x to embiggenate Nigel | |
*/ |