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
package main | |
import "log" | |
import "fmt" | |
import "bytes" | |
type BitSet struct { | |
bits []uint64 | |
length uint64 | |
} |
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
# A horrible hack to enable _ as placeholders in Ruby, similar to block behavior | |
# in Scala. | |
# | |
# Obviously breaks if used across multiple threads, though probably in subtle | |
# ways. The break can be mitigated by instead wrapping the arguments in an | |
# instance of something and then doing instance_exec, where _ is a method on | |
# the instance, but this messes up the block's binding. | |
# | |
# There's probably a way around it all, but it's honestly not worth the trouble | |
# and the typing saved isn't worth the utter confusion anything like this would |
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
#ifndef NSObject_QTestObject_h_58095849_FEC4_4085_8A11_C6B2C7A2EBFB | |
#define NSObject_QTestObject_h_58095849_FEC4_4085_8A11_C6B2C7A2EBFB | |
#import <Foundation/Foundation.h> | |
extern id const QBlockTest; | |
typedef id (^QTestCase)(); | |
@interface NSObject (QTestObject) |
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 ruby -WKu | |
require 'stringio' | |
module MD3View | |
def run_view(*) ; raise NotImplementedError ; end | |
end | |
begin | |
require("#{File.dirname $0}/md3view.rb") |
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
type signalFunc func() | |
type waitFunc func() | |
// signalWaitFuncs returns a signalFunc and a waitFunc. Calling the returned | |
// waitFunc blocks until the signalFunc is called. | |
func signalWaitFuncs() (signalFunc, waitFunc) { | |
port := make(chan bool) | |
return func() { port <- true }, func() { <-port } | |
} |
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 ruby | |
require 'fileutils' | |
require 'sqlite3' | |
require 'cgi' | |
HELP_TEXT = <<-EOS | |
build-gsc-docset [options...] |
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
template <int OCTETS_> | |
struct utf8_bits_t | |
{ | |
enum : int | |
{ | |
OCTETS = OCTETS_, | |
OFFSET = 6 * (OCTETS - 1), | |
}; | |
enum : uint32_t |
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
#include <stdint.h> | |
#include <stdio.h> | |
#define OBJ_UNUSED_BITS_MAX 8 | |
static uint32_t obj_unused_bits[OBJ_UNUSED_BITS_MAX] = { 0 }; | |
int obj_first_unused() | |
{ | |
// Based off the code at Sean Eron Anderson's bit twiddling hacks page, in |
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
/* Subset of config.hh */ | |
#ifndef __SNOW_COMMON__CONFIG_HH__ | |
#define __SNOW_COMMON__CONFIG_HH__ | |
#pragma GCC diagnostic push | |
#pragma GCC diagnostic ignored "-Wundef" | |
#if defined(__APPLE__) | |
# include <TargetConditionals.h> | |
#endif |
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
/* | |
Copyright (c) 2014 Noel Raymond Cower. | |
This file is part of Rusalka VM. | |
Rusalka VM is free software: you can redistribute it and/or modify | |
it under the terms of the GNU General Public License as published by | |
the Free Software Foundation, either version 3 of the License, or | |
(at your option) any later version. |