http://guides.rubyonrails.org/migrations.html
- add_column
- add_index
- change_column
- change_table
- create_table
- drop_table
| #!/usr/bin/env python | |
| import ssl | |
| import json | |
| import socket | |
| import struct | |
| import binascii | |
| def send_push_message(token, payload): | |
| # the certificate file generated from Provisioning Portal | 
| package main | |
| import ( | |
| "crypto/rand" | |
| "flag" | |
| "log" | |
| mrand "math/rand" | |
| "net" | |
| "os" | |
| "os/signal" | 
http://guides.rubyonrails.org/migrations.html
| class A | |
| def disp : String | |
| "call A" | |
| end | |
| end | |
| class B | |
| def disp : String | |
| "call B" | |
| end | 
| abstract class Parent #同じシグネチャなので、abstractを通して、制約をつける | |
| abstract def disp | |
| end | |
| class A < Parent | |
| def disp : String | |
| "call A" | |
| end | |
| end | 
| module Indexable(T) | |
| def threadpool_map(workers : Int = 8, chunk_size : Int? = nil, &func : T -> R) forall T, R | |
| mutex = Thread::Mutex.new | |
| cs = chunk_size || (self.size**0.5).ceil.to_i | |
| Array(R).build(self.size) do |result| | |
| index = 0 | |
| threads = Array.new(workers) { | |
| Thread.new do | |
| a = b = 0 | |
| loop do | 
| EHSIZE = 0x34 | |
| PHSIZE = 0x20 | |
| PH_FILESZ_OFF = 0x10 | |
| PH_MEMSZ_OFF = 0x14 | |
| CODE_OFF = EHSIZE + PHSIZE | |
| REAL_CODE_OFF = 0x08000000 + CODE_OFF | |
| elf_header = | |
| # e_ident[0] = 0x7F # EI_MAGIC1 | |
| # e_ident[1] = "E" # EI_MAGIC2 | 
| #include <errno.h> | |
| #include <stdio.h> | |
| #include <string.h> | |
| #include <stdlib.h> | |
| #include <net/route.h> | |
| #include <sys/types.h> | |
| #include <sys/ioctl.h> | |
| int main(char** args) { | |
| int sockfd; | 
| ; ModuleID = 'hello' | |
| @.str = private constant [14 x i8] c"Hello, World!\00" | |
| declare i32 @puts(i8* nocapture) nounwind | |
| define i32 @main() { | |
| %1 = call i32 @puts(i8* getelementptr inbounds ([14 x i8]* @.str, i32 0, i32 0)) | |
| ret i32 0 | |
| } | 
| # Based on http://matthiaseisen.com/articles/graphviz/ | |
| import graphviz as gv | |
| styles = { | |
| 'graph': { | |
| 'label': 'Network Map', | |
| 'fontsize': '16', | |
| 'fontcolor': 'white', |