This file contains 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
instance Show Expression where | |
show e = showWithParen 0 e where | |
showWithParen _ (Symbol x) = x | |
showWithParen _ (Number x) = show x | |
showWithParen _ (Func name e) = name ++ "(" ++ show e ++ ")" | |
showWithParen w (Op op e1 e2) = head ++ showWithParen curOpWeight e1 ++ show op ++ showWithParen curOpWeight e2 ++ foot where | |
head = if w > curOpWeight then "(" else "" | |
foot = if w > curOpWeight then ")" else "" | |
curOpWeight = getOpWeight op |
This file contains 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
import Control.Monad | |
fizz = concat $ repeat ["", "", "Fizz"] | |
buzz = concat $ repeat ["", "", "", "", "Buzz"] | |
fizzbuzz = zipWith (++) fizz buzz | |
combine num "" = show num | |
combine _ str = str | |
main = forM_ (take 100 $ zipWith combine [1 ..] fizzbuzz) putStrLn |
This file contains 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
<html> | |
<head> | |
<title>Buddhabrot JS</title> | |
<script type="text/javascript" src="main.js"></script> | |
</head> | |
<body> | |
<canvas id="world" width="500" height="500"></canvas> | |
</body> | |
</html> |
This file contains 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
using System; | |
namespace MemoryLeakTest | |
{ | |
class MainClass | |
{ | |
public static void Main (string[] args) | |
{ | |
for (;;) { | |
var testArray = new TestStruct[500 * 500 * 50]; |
This file contains 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> | |
unsigned int bitreverse(unsigned int x) { | |
x = (x & 0x55555555)<<1 | (x & 0xaaaaaaaa)>>1; | |
x = (x & 0x33333333)<<2 | (x & 0xcccccccc)>>2; | |
x = (x & 0x0f0f0f0f)<<4 | (x & 0xf0f0f0f0)>>4; | |
x = (x & 0x00ff00ff)<<8 | (x & 0xff00ff00)>>8; | |
x = (x & 0x0000ffff)<<16 | (x & 0xffff0000)>>16; | |
return x; | |
} |
This file contains 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
{ | |
"とても|すごく": ["非常に", "極めて", "大変"], | |
"たくさん": "多く", | |
"今回の研究": "本研究", | |
"見る|見た|見て": ["検討する", "説明する"], | |
"(わ|分)かる": "断定の口調に変更する。", | |
"考えられる": ["考えられている", "断定の口調に変更する。"], | |
"感じる": ["推測される", "思われる"], | |
"かもしれ(ない|ません)": "可能性がある", | |
"どんどん": "急速に", |
This file contains 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
require 'rubygems' | |
require 'bindata' | |
class BasicLLDPPacket < BinData::Record | |
endian :big | |
uint48 :dst_mac | |
uint48 :src_mac, :value => 0x0180c200000e | |
uint16 :ether_type, :value => 0x88cc |
This file contains 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
Pod::Spec.new do |s| | |
s.name = 'CocoaSoundCloudAPI' | |
s.version = '1.0.2' | |
s.summary = 'A simple way to interact with the SoundCloud CocoaSoundCloudAPI.' | |
s.homepage = 'https://github.com/soundcloud/CocoaSoundCloudAPI' | |
s.author = { 'Ullrich Schäfer' => 'ullrich@soundcloud.com', | |
'Robert Böhnke' => 'robb@soundcloud.com', | |
'Tobias Kräntzer' => 'tk@soundcloud.com', | |
'Rob Siwek' => 'robert@soundcloud.com' } |
This file contains 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
Pod::Spec.new do |s| | |
s.name = "Audjustable" | |
s.version = "0.0.9" | |
s.summary = "A fast and extensible audio streamer for iOS and OSX with support for gapless playback and custom (non-HTTP) sources." | |
s.homepage = "http://tumtumtum.github.com/audjustable/" | |
s.license = 'MIT' | |
s.author = { "Thong Nguyen" => "tumtumtum@gmail.com" } | |
s.source = { :git => "https://github.com/tumtumtum/audjustable.git", :tag => s.version.to_s} | |
s.platform = :osx | |
s.requires_arc = true |
This file contains 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
var tuple = Tuple.Crate("hoge", 1); | |
// こうじゃなくて | |
var a = tuple.Item1; | |
var b = tuple.Item2; | |
var f = new Func<Tuple<string, int>, bool>(t => t.Item1.Length == t.Item2); | |
// こんな感じ | |
var (a, b) = tuple; |
OlderNewer