Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

omochimetaru omochi

🏠
Working from home
  • japan
  • tokyo
View GitHub Profile
@omochi
omochi / perm_recur.c
Created Dec 6, 2012
順列列挙でステップごとのメモリ確保無しでできると教わったのでやってみた
View perm_recur.c
//$ 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 Dec 17, 2012
順列列挙をイテレータ的に書く。再帰のと違ってユーザにコールバックが要らないのが良い。インターフェースは揃わなかった。
View perm_suc.c
//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 Apr 26, 2013
ARCとMRCを混ぜながらプログラムを書くための方法とその調査報告 ref: http://qiita.com/omochi@github/items/f27022d31e9914af30b8
View file0.txt
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.
View omochi-server.md

このページについて

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

サーバ

URL

View Vector2.ts
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;
View FsAsync.ts
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();
}
View node-send-patch-memo
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
View こんなかんじ
[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
View autojson_memo1.json.txt
{
// <T> Box
"Box": {
"type": "Let",
"params": ["value"],
"body": {
"type": "Class",
"fields": {
"value": "value"
}
View autojson_decoded.txt
SourceFile(
types={
Box=ClassDef(
let=[value]
name=null
fields=[
Field(
value=Ref(name=value)
)
]
You can’t perform that action at this time.