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
import random | |
for alpha in (0.3,0.5,0.7): | |
t1=[] | |
random.seed(149) or [t1.append(0) for i in range(0, 20-int(alpha*20))] and [t1.append(1) for i in range(0, int(alpha*20))] and random.shuffle(t1) | |
print "\ndensity: %f\nt= 0 "%alpha,"".join(map((lambda x:str(x)+" "), t1)) | |
for i in range(1,21): | |
t2=[] | |
[t2.append((0,0,0,1,1,1,0,1)[int("".join(map(str, map((lambda x:t1[x]), j-1<0 and (19,0,1) or j+1>=20 and (18,19,0) or (j-1,j,j+1)))),2)]) for j in range(0,20)] | |
t1=t2[:] | |
print "t=%2d "%i,"".join(map((lambda x:str(x)+" "), t2)) |
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
int speaker=11; | |
#define Do 523 | |
#define Re 587 | |
#define Mi 659 | |
#define Fa 698 | |
#define So 783 | |
#define Ra 880 | |
#define Si 987 | |
#define DoU 1046 |
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
void setup() | |
{ | |
int i; | |
for(i=2; i<=11; i++) { | |
pinMode(i, OUTPUT); | |
} | |
} | |
void loop() | |
{ |
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
int pov[10][10] = { | |
{0,1,1,1,1,1,1,1,1,1}, | |
{1,0,0,0,1,0,0,0,0,0}, | |
{1,0,0,0,1,0,0,0,0,0}, | |
{1,0,0,0,1,0,0,0,0,0}, | |
{0,1,1,1,1,1,1,1,1,1}, | |
}; | |
void setup() | |
{ |
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
.data | |
.align 4 | |
x: .long 1, 2, 1, 2, 1 | |
.text | |
.globl main | |
main: | |
push $5 | |
push $x | |
push $1 |
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
$(".favorited .dogear").parent("div").children("div.content").children("div").children("div").children("div").children("ul").children("li").children("a").children("b").children(".unfavorite").click() |
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
// 点灯時間 | |
const int msec = 1; | |
const int num = 8; | |
const int row[num] = {11, 12, 14, 15, 16, 17, 18, 19}; | |
const int col[num] = {2, 3, 4, 5, 6, 7, 8, 9}; | |
void setup() { | |
for (int i = 0; i < num; i++) | |
pinMode(row[i], OUTPUT); // 行側のピンの初期化 | |
for (int i = 0; i < num; i++) |
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 <Sprite.h> | |
#include <Matrix.h> | |
Matrix mtx = Matrix(3, 5, 4); | |
Sprite I = Sprite( // スプライト 1 文字目 | |
8, 7, |
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 <Sprite.h> | |
#include <Matrix.h> | |
Matrix mtx = Matrix(3, 5, 4); | |
Sprite I1 = Sprite( // スプライト 1 文字目 | |
8, 8, | |
B00000000, |
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 -*- | |
Plugin.create(:mikutter_tmux) do | |
on_update do |service, message| | |
message.each do |m| | |
begin | |
m.to_s.sub(/(.)/) { '\\' + $1 } | |
m.to_s.sub("#", "#") | |
system("tmux set status-right '#[fg=cyan][@" + m.idname + "] " + "#[fg=green]" + m.to_s[0,80] + "#[default]'") | |
rescue => ex | |
puts ex.message |
OlderNewer