Skip to content

Instantly share code, notes, and snippets.

花火~ 最高な俺たちと糞コードの海

written by mizchi at 小物エンジニアの会.

最高の夏の花火について 花火

自己紹介

@kohyama
kohyama / clojure-exercises.md
Last active October 19, 2017 08:54
Clojure Exercises / Clojure 演習
@shoyan
shoyan / mock_simple_test_1.0.1.php
Last active December 19, 2015 23:28
SimpleTestのMockを使ったテストのサンプル。 1.0.1はマニュアルのやり方とは違う(function returnsが定義されていない)のでこういう風にやらないといけない。
<?php
/*
* SimpleTestのmockサンプル
* SimpleTest version 1.0.1
*/
@kachayev
kachayev / topological.py
Last active December 30, 2022 10:21
Topological sort with Python (using DFS and gray/black colors)
# Simple:
# a --> b
# --> c --> d
# --> d
graph1 = {
"a": ["b", "c", "d"],
"b": [],
"c": ["d"],
"d": []
}
@relax-more
relax-more / gist:5779915
Created June 14, 2013 06:40
[Hive] 実行結果をそのままファイルに出力する
$ hive -S -e ‘select * from tbl_a limit 100′ > hive_result.txt
@chomado
chomado / perfect.ml
Created May 26, 2013 18:23
n 以下の完全数をリストで返す
(* 完全数: 自分自身を除く約数の和がその数自身になる *)
(* n以下の整数一覧を並べたリスト *)
(* enumerate: int -> int list *)
let rec enumerate n = if n <= 0 then [] else n :: enumerate (n-1)
(* n 以下の完全数をリストで返す *)
(* perfect : int -> int list *)
let perfect n =
let perfectp n =
@takawitter
takawitter / LZ77.java
Created May 14, 2013 00:12
「高速文字列解析の世界」を参考に、LZ77実装してみた。非常に単純な実装で、compress1はマッチする文字列を元配列をなめて求める方式。compress2は文字出現位置をマップで持つ方式。 Wikipedia日本語タイトルをTrieに格納してできたTail配列に対してやってみると、513万文字が435万文字になった。 compress1が31.7秒、compress2が8.9秒。ウィンドウサイズは8192。
import java.io.IOException;
import java.util.HashMap;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
public class LZ77 {
public static void compress1(CharSequence src, Appendable out, int windowSize)
throws IOException{
@aamine
aamine / HorizVert.md
Last active December 5, 2024 08:40
RDBの縦持ちテーブルと横持ちテーブル、およびその変換について

テーブルの縦持ち横持ちについて

横持ちテーブルと縦持ちテーブル

横持ちはいわゆる「普通の」データの持ちかたのこと。 例えばレコードごとにa, b, c, dの4つの属性を持つ テーブルを作る場合、次のようなテーブルが横持ちテーブルである。

@thelibrarian
thelibrarian / Fixing XCode Command Line Tools.md
Last active November 6, 2017 03:28
How to fix compile errors with the XCode command line tools on Mac OS X. Solves problems such as failing to find Framework header files (e.g. ruby.h).

The Problem

If you have installed the standalone Command Line Tools for XCode on your Mac (i.e. without having XCode.app installed), some of these tools can get a bit confused due to a couple of oversights on Apple's part in finalising the setup.

Note: all commands below will need to be run from an Administrator account, or by an account with appropriate permission in /etc/sudoers.

The Solution

1. Failing to Find Frameworks

Sometime when compiling against the preinstalled Frameworks (e.g. Ruby or Python), various tools will inexplicable fail to find header files that are quite clearly there. This is caused by the fact that no XCode has been selected for the command-line tools. Wait, I hear you cry, I don't have XCode installed! Indeed, but you nonetheless need to select one, and point it somewhere where the command line tools exist, like so

go 1.1 scheduler

where

src/pkg/runtime proc.c asm_*.s

design