Skip to content

Instantly share code, notes, and snippets.

public void antiCleanup(String ksName, String cfName)
{
if (ksName.equals(Table.SYSTEM_KS))
throw new RuntimeException("Anti-cleanup of the system table is neither necessary nor wise");
Set<String> tableNames = Sets.newHashSet();
if (ksName == null)
{
for (Table table : Table.all())
tableNames.add(table.name);
=*= MySQL Group Replication =*=
===============================
The multi master plugin for MySQL is here. MySQL Group Replication
ensures virtual synchronous updates on any node in a group of MySQL
servers, with conflict handling and failure detection. Distributed
recovery is also in the package to ease the process of adding new
nodes to your server group.
In [2]: os.path.join(["foo", "bar"])
Out[2]: ['foo', 'bar']
In [3]:
In [3]: os.path.join("foo", "bar")
Out[3]: 'foo/bar'
#
# This monkeypatch will tell IRB completion to ignore methods that also
# happen to be in the "Object" class as most of the time I don't care
# about these. This hack only steps in when you've entered something like
# "foo." or "Foo." or "Foo::", otherwise you'll be working with the
# full list of methods, including the ones from Object. k?
#
Readline.completion_proc = proc do |input|
IRB::InputCompletor::CompletionProc.call(input).reject do |o|
#!/bin/bash
#
# sendkey.sh: Helps proliferate your SSH public key to hosts.
#
# Rick Branson <rick@diodeware.com>
# This code is released into the public domain.
#
if [ "$#" -lt 1 ]; then
echo "sendkey.sh: Sends id_rsa.pub as authorized_keys to remote host (over SSH)"
#!/usr/bin/ruby
#
# This benchmark test implements a simple threaded message queue writer backed
# by an SQLite3 database. It is modeled after a Twitter-like queue-per-destination
# message system which has N number of actors, each with a queue. The idea
# is to demonstrate a safe, disk-backed queueing system with a large number of
# queues. All of the queues are stored in a separate table in the database file.
#
# In 2009, by Rick Branson, Released into Public Domain.
#
/* omg -- a C program to average things -- by Rick Branson -- public domain 'n shit */
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#define BUFSZ 1024 * 32
#define ARRAY_ALLOC_SZ 1024 * 32
int main(int argc, char **argv)
#!/usr/bin/ruby
#
# benshee.rb: A multi-connection HTTP request generator
# (C) 2009 Rick Branson -- actually it's public domain.
#
require "rubygems"
require "eventmachine"
require "uri"
/******************************************************************************
* $Id: mapshape.c 8755 2009-03-10 13:35:19Z jlacroix $
*
* Project: MapServer
* Purpose: Implements support for shapefile access.
* Authors: Steve Lime and Frank Warmerdam
*
* Note:
* This code is entirely based on the previous work of Frank Warmerdam. It is
* essentially shapelib 1.1.5. However, there were enough changes that it was
// a little teaser
var libc = new FFI.DynamicLibrary("libc.dylib", FFI.DynamicLibrary.FLAGS.RTLD_NOW);
assertInstanceof(libc, FFI.DynamicLibrary);
var atofPtr = libc.get("atof");
assertInstanceof(atofPtr, FFI.Pointer);
assertFalse(atofPtr.isNull());
var atof = FFI.Internal.methodFactory(atofPtr, "double", [ "string" ]);