集合S (台集合と呼ぶ) と二項演算 • : S → S を与えられたとき、
- 任意の a, b, c ∈ S に対して、 (a • b) • c = a • (b • c) [結合法則]
- ある元 e ∈ S が存在し、任意の a ∈ S に対して e • a = a • e = a [単位元の存在]
を満たすとき モノイド という。 (文脈におおじて二項演算の記号は省略される)
import Signal | |
import List | |
import Graphics.Element(Element) | |
import Graphics.Collage as G | |
import Time as T | |
import Color | |
import Debug | |
-- model |
require 'twitter' | |
puts "Open browser and run below script in Console." | |
puts "$('.app-settings, .access').find('span:not(.heading):lt(2)').map(function(){ return $(this).text() }).toArray().join(':')" | |
print "Source: " | |
source_token = gets.chomp.split(':') | |
print "Target: " | |
target_token = gets.chomp.split(':') | |
print "Name: " | |
name = gets.chomp |
Vagrant.configure(2) do |config| | |
config.vm.box = "ubuntu/trusty64" | |
config.vm.provision :shell, inline: <<-SHELL | |
if [ ! -f ~/.installed ] | |
then | |
sudo apt-get update | |
sudo apt-get -y install texlive | |
sudo apt-get -y install texlive-lang-cjk | |
sudo apt-get -y install dvipsk-ja | |
sudo apt-get -y install gv |
// ==UserScript== | |
// @name Project Euler: Translate Into Japanese | |
// @namespace https://gist.github.com/45deg/5551106ee5aa24f39e1d | |
// @version 0.1 | |
// @description odz.sakura.ne.jp/projecteuler/ から日本語訳を取ってきて追加するスクリプト | |
// @author zakuro | |
// @run-at document-end | |
// @match https://projecteuler.net/problem=* | |
// @grant GM_xmlhttpRequest | |
// ==/UserScript== |
(function(){ | |
var img = new Image(); | |
var c = document.createElement('canvas');document.body.appendChild(c); | |
var ctx = c.getContext("2d"); | |
img.src = document.images[0].src; | |
img.onload = function(){ c.width = img.width; c.height=img.height; | |
ctx.drawImage(img, 0, 0); | |
var data = ctx.getImageData(0, 0, img.width, img.height).data; | |
var arr = []; var pos = [];console.log(img.width,img.height); var are = []; | |
for(var i = 0; i < img.width * img.height; i++){ |
import random | |
import string | |
import sys | |
import base64 | |
alphabets = string.lowercase + string.uppercase | |
base64s = set(alphabets + '0123456789' + '+' + '/') | |
appeared = set() | |
for i in range(100000): |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <unistd.h> | |
#include <string.h> | |
#include <syslog.h> | |
int main(int argc, char const* argv[]) | |
{ | |
int pid = 0; | |
int status; |
Cluster Node.js v5.1.0 Manual & Documentation https://nodejs.org/api/cluster.html
var cluster = require('cluster');
var http = require('http');
var numCPUs = require('os').cpus().length;
if (cluster.isMaster) {
// Fork workers.
for (var i = 0; i < numCPUs; i++) {