This file contains hidden or 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
# m=arms, n=biddings, h=trials | |
simulation <- function(m,n,h,binom,pois,strategies) { | |
ss <- length(strategies) | |
score <- list() | |
bid <- list() | |
for (i in 1:ss) { score[[i]] <- rep(0,n) } | |
for (t in 1:h) { | |
for (i in 1:ss) { |
This file contains hidden or 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
------------------------------------------------------------ | |
-- Quantum Shogi Program in Haskell | |
------------------------------------------------------------ | |
module Main where | |
import System.Environment | |
import Data.Maybe | |
import Data.List | |
import Data.Char |
This file contains hidden or 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>テスト</title> | |
<meta charset="UTF-8"> | |
<script type="text/javascript" src="http://code.jquery.com/jquery-1.10.0.min.js"></script> | |
</head> | |
<body> | |
<div class="mytest"> | |
<iframe class="mytest1" style="position:absolute;left:0;top:0;" src="./sample.html" frameborder=0 width=510 height=400 scrolling=no></iframe> | |
<div class="mytest2" style="position:absolute;left:0;top:0;width:510px;height:400px;" frameborder=0 width=510 heigh\ |
This file contains hidden or 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
library('rzmq') | |
context = init.context() | |
sock1 = init.socket(context,"ZMQ_PUSH") | |
bind.socket(sock1,"ipc:///test1") | |
sock2 = init.socket(context,"ZMQ_PULL") | |
bind.socket(sock2,"ipc:///test2") | |
nw <- 10000 |
This file contains hidden or 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
sub mycmp { | |
my $an = @{$a->[1]}+@{$a->[2]}; | |
my $bn = @{$b->[1]}+@{$b->[2]}; | |
my $n = $an<$bn ? $an : $bn; | |
foreach my $i (0..$n-1) { | |
my $aa = $a->[$i%2+1][$i/2]; | |
my $bb = $b->[$i%2+1][$i/2]; | |
my $res = $aa=~/^\d+$/ && $bb=~/^\d+$/ ? $aa <=> $bb : $aa cmp $bb; | |
return $res if ($res!=0); | |
} |
This file contains hidden or 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> | |
#include <stdlib.h> | |
#include <time.h> | |
#include <assert.h> | |
#include <unistd.h> | |
#include <zmq.hpp> | |
const int max_peer = 3; |
This file contains hidden or 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> | |
#include <sys/time.h> | |
#include <ev.h> | |
const int log_size = 10000; | |
double log[log_size]; | |
int log_index=0; | |
double now_usec() { | |
timeval tv; |
This file contains hidden or 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
# -*- coding: utf-8 -*- | |
require 'erb' | |
require 'uri' | |
require 'yaml' | |
require 'nokogiri' | |
require 'open-uri' | |
require 'fileutils' | |
require 'pathname' | |
require 'gepub' |
This file contains hidden or 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 _stage = null; | |
var _width = 640; | |
var _height = 480; | |
var _ip = ""; | |
var _port = 0; | |
var _sid = 0; | |
var _r = 240; | |
var _g = 240; |
This file contains hidden or 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
class coro { // コルーチンもどき | |
protected: | |
int coro_state; | |
public: | |
coro():coro_state(0){} | |
virtual ~coro(){} | |
void init() {coro_state=0;} | |
}; | |
#define begin switch(coro_state){ case 0: | |
#define end default: break;} |