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 ( | |
"compress/gzip" | |
"fmt" | |
"image/jpeg" | |
"log" | |
"os" | |
) |
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
// | |
// main.m | |
// BitmapAverage | |
// | |
// Created by Alex Nichol on 4/8/14. | |
// Copyright (c) 2014 Alex Nichol. All rights reserved. | |
// | |
#import <Foundation/Foundation.h> | |
#import <Accelerate/Accelerate.h> |
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 <stdio.h> | |
#include <stdint.h> | |
#include <stdlib.h> | |
#include <stdbool.h> | |
void print_chars(uint64_t num); | |
bool isvischar(char ch); | |
int main(int argc, const char * argv[]) { | |
if (argc != 2) { |
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
#!/bin/bash | |
setupAccept () { | |
$1 -P INPUT ACCEPT | |
$1 -P OUTPUT ACCEPT | |
$1 --flush | |
$1 -A INPUT -i lo -j ACCEPT | |
$1 -A OUTPUT -o lo -j ACCEPT |
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
# Take a binary tree of depth D, where the lowest nodes have 1 bit, the second lowest have 2 bits, etc. | |
# This script finds the number of bits in a tree of depth D. | |
if process.argv.length isnt 3 | |
console.log 'Usage: coffee calc.coffee <depth>' | |
process.exit() | |
depth = parseInt process.argv[2] | |
count = 0 | |
for i in [0...depth] |
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
fs = require 'fs' | |
fs.readFile 'letters.txt', (err, buffer) -> processFile buffer.toString() | |
processFile = (s) -> | |
counts = {} | |
lines = s.split '\n' | |
for line in lines | |
if counts[line]? | |
counts[line]++ |
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
Page = require './page' | |
Session = require '../session' | |
Transfer = require '../transfer' | |
tar = require 'tar-stream' | |
url = require 'url' | |
getTarName = (path) -> | |
result = path.match /\/([^\/]*)$/ | |
str = if result? then result[1] else path | |
if str[str.length - 1] is '/' |
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
__ZN13FancyReturner7BaseRefEv: # the regular | |
00000001000014a0 pushq %rbp | |
00000001000014a1 movq %rsp, %rbp | |
00000001000014a4 movq %rdi, 0xfffffffffffffff8(%rbp) | |
00000001000014a8 movq 0xfffffffffffffff8(%rbp), %rdi | |
00000001000014ac addq $0x8, %rdi | |
00000001000014b3 movq %rdi, %rax | |
00000001000014b6 popq %rbp | |
00000001000014b7 ret | |
00000001000014b8 nopl (%rax,%rax) |
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
import 'dart:io'; | |
typedef void EmptyFunc(); | |
typedef void OneFunc(List<String> _); | |
myMain1(List<String> _) { | |
} | |
myMain2() { | |
} |
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
import 'dart:io'; | |
void main(List<String> args) { | |
if (args.length != 1) { | |
print('Usage: dart prof.dart <list|switch>'); | |
exit(1); | |
} | |
if (args[0] == 'list') { | |
for (int j = 1; j < 128; j++) { | |
for (int i = 0; i < 100000; i++) { |
OlderNewer