This file contains hidden or 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
enum Foo { | |
case north, south, east, west | |
case foo(Int), bar(Int) | |
case foo(Int) | |
case foo = 1 | |
func foo() { | |
switch self { | |
case .foo: | |
case .foo(let x): |
This file contains hidden or 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
foo.sort { | |
} | |
foo .sort { | |
} | |
foo.sort() | |
foo .sort() | |
sort { | |
} |
This file contains hidden or 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
// javac AOTSample.java | |
// jaotc *.class | |
// time java AOTSample | |
// time java -XX:AOTLibrary=./unnamed.so AOTSample | |
public class AOTSample { | |
public static class Cons<T> { | |
private final T value; | |
private final Cons<T> next; |
This file contains hidden or 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
class A { | |
final int x = 1; | |
public boolean foo() { | |
return "a2" == ("a" + (x + 1)); | |
} | |
} |
This file contains hidden or 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 <stdlib.h> | |
#include <stdint.h> | |
#include <string.h> | |
#include <math.h> | |
#include <time.h> | |
/* 一様分布に従う疑似乱数値を返す */ | |
static uint64_t uniform1(void); | |
static uint64_t uniform2(void); |
This file contains hidden or 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
// http://qiita.com/bellbind/items/50954258e262fd7c6bd1 | |
function uniq1(A, i = 0, r = [], h = A[i], l = r.length) { | |
if (i === A.length) return r; | |
return uniq1(A, i + 1, l === 0 ? [h] : h === r[l - 1] ? r : [...r, h]); | |
} | |
function uniq2(array) { | |
const result = []; |
This file contains hidden or 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
# coding: utf-8 | |
# たとえば次のような関数を考える。 | |
def foo(array_or_hash) | |
if array_or_hash.respond_to?(:values) | |
# Hashっぽい | |
array_or_hash.values.join(", ") | |
else | |
# きっとArray |
This file contains hidden or 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
$ ag patchelf pkgs -l | |
pkgs/games/adom/default.nix | |
pkgs/games/nexuiz/default.nix | |
pkgs/games/ut2004demo/builder.sh | |
pkgs/games/planetaryannihilation/default.nix | |
pkgs/games/tremulous/default.nix | |
pkgs/games/zandronum/default.nix | |
pkgs/games/zandronum/bin.nix | |
pkgs/games/xonotic/default.nix | |
pkgs/games/ue4demos/default.nix |
This file contains hidden or 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
$nixpkgs_dir = File.expand_path("~/src/nixpkgs") | |
def git(*arguments) | |
options = if arguments.last.kind_of? Hash | |
options = arguments.pop | |
else | |
{} | |
end | |
nixpkgs_dir = if options.include?(:nixpkgs_dir) |
This file contains hidden or 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
class Tuple<T, R> { | |
} | |
class Bar<T> { | |
public Bar<Tuple<T, T>> d() { | |
return null; | |
} | |
public void bar() { | |
Bar<Integer> x = d().d().d().d().d().d().d().d().d().d().d().d().d().d().d().d().d().d().d().d().d().d().d().d().d().d().d().d().d().d().d().d().d().d().d().d().d().d().d().d(); |