Skip to content

Instantly share code, notes, and snippets.

View omochi's full-sized avatar
🏠
Working from home

omochimetaru omochi

🏠
Working from home
  • Qoncept, Inc
  • Yokohama
View GitHub Profile
@omochi
omochi / perm_recur.c
Created December 6, 2012 17:33
順列列挙でステップごとのメモリ確保無しでできると教わったのでやってみた
//$ gcc -std=m9 perm.c
#include<stdio.h>
#include<stdlib.h>
void swap_int(int *a,int *b){
int t = *a;
*a = *b;
*b = t;
}
void print_int_array(int array[],int num){
printf("[ ");
@omochi
omochi / perm_suc.c
Created December 17, 2012 15:10
順列列挙をイテレータ的に書く。再帰のと違ってユーザにコールバックが要らないのが良い。インターフェースは揃わなかった。
//gcc -std=c99
#include<stdio.h>
#include<stdlib.h>
void swap_int(int *a,int *b){
int t = *a;
*a = *b;
*b = t;
}
void reverse_int_array(int array[],int num){
for(int i=0;i<num/2;i++){
@omochi
omochi / file0.txt
Created April 26, 2013 21:00
ARCとMRCを混ぜながらプログラムを書くための方法とその調査報告 ref: http://qiita.com/omochi@github/items/f27022d31e9914af30b8
How do I think about ARC? Where does it put the retains/releases?
Try to stop thinking about where the retain/release calls are put and think about your application algorithms instead. Think about “strong and weak” pointers in your objects, about object ownership, and about possible retain cycles.

このページについて

私が運営しているマインクラフトサーバのアナウンスページです。 ユーザの方々への連絡に使用しています。 更新情報については、 ページ左のRevisionsからdiffを参照してください。

サーバ

URL

import Vector3 = require("./Vector3");
class Vector2 {
constructor(public x: number, public y: number){
}
toVector3(z: number): Vector3{
return new Vector3(this.x, this.y, z);
}
}
export = Vector2;
class FsAsync {
static readFile: (filename: string, encoding: string) => Promise<string>;
private static _init() {
FsAsync.readFile = <any>Promise.promisify(fs.readFile);
}
private static __init = FsAsync._init();
}
SendStream.prototype.stream = function(path, options){
// TODO: this is all lame, refactor meeee
var finished = false;
var self = this;
var res = this.res;
var req = this.req;
console.log("SendStream [" + path + "] stream, res.socket [" +res.socket+"]");
// pipe
[omochi@omochi-macmini2 work]$ bsr checkout
connecting... : /Users/omochi/Dropbox/project/binstore/test01/repo
connected
fetch file list: current = 1
fetch file list: focus = latest
current: 1, focus: 2
compute plan
diff num: 14
! mod x del: .DS_Store: 6148 bytes => repo: 6148 bytes
--- x new: 01.png: 6184 bytes
{
// <T> Box
"Box": {
"type": "Let",
"params": ["value"],
"body": {
"type": "Class",
"fields": {
"value": "value"
}
SourceFile(
types={
Box=ClassDef(
let=[value]
name=null
fields=[
Field(
value=Ref(name=value)
)
]