Skip to content

Instantly share code, notes, and snippets.

@ranha
ranha / out1
Created October 13, 2011 03:13
Dartでファイルから1バイト読み込もうとする
dartcでコンパイルしようとした場合次のようになる
ranha@ranha:~/dart_full/dart$ ./out/Debug_ia32/dartc ~/dart/read1bytefromfile.dart
file:/home/ranha/dart/read1bytefromfile.dart/read1bytefromfile.dart:9: no such type "File"
8: main() {
9: var f = new File("read1bytefromfile.dart",false);
file:/home/ranha/dart/read1bytefromfile.dart/read1bytefromfile.dart:9: New expression does not resolve to a constructor
8: main() {
9: var f = new File("read1bytefromfile.dart",false);
@ranha
ranha / 4.2.1
Created October 16, 2011 10:42
prog.c
/Users/ranha/c_misc/embed% gcc --version
i686-apple-darwin11-llvm-gcc-4.2 (GCC) 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.1.00)
Copyright (C) 2007 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
/Users/ranha/c_misc/embed% gcc -fno-toplevel-reorder -c prog.c
/Users/ranha/c_misc/embed% gobjdump -s prog.o
@ranha
ranha / nyan.c
Created November 23, 2011 11:53
#include <stdio.h>
struct T {
struct S {
int s;
} s;
};
int main()
{
template<typename T>
void f(T,T){}
int main()
{
f("",0);
return 0;
}
@ranha
ranha / nyan
Created March 26, 2012 13:29
azu
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
int f();
int main();
void g();
int f(void)
{
@ranha
ranha / nyan.c
Created March 27, 2012 04:14
azu
/Users/ranha/c_misc/souwa% gcc --version
i686-apple-darwin11-llvm-gcc-4.2 (GCC) 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.1.00)
Copyright (C) 2007 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
/Users/ranha/c_misc/souwa% gcc -Wall -Wextra nyan.c
/Users/ranha/c_misc/souwa% ./a.out
1 + 2 + 3 + 4 + 5
@ranha
ranha / hoge.hs
Created April 8, 2012 14:30
hoge
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE KindSignatures #-}
data Hask :: * -> * where
App :: Hask (a -> b) -> Hask a -> Hask b
Abs :: (Hask a -> Hask b) -> Hask (a -> b)
ValB :: Bool -> Hask Bool
ValS :: String -> Hask String
@ranha
ranha / nyan.c
Created May 26, 2012 13:11
hoge
#include <stdio.h>
#include <setjmp.h>
#define HEAP 5000
const int N = 10;
enum Tag {
ask_depth,
answer
};
@ranha
ranha / aznyn.tex
Created October 20, 2012 06:44
latex
\documentclass{minimal}
\newread\file
\newcommand{\content}{}
\begin{document}
\immediate \typeout{here1}
\immediate\openin\file=http://404.org
\immediate \typeout{here2}
\immediate\read\file to \content
\immediate \typeout{here3}
\immediate\closein\file