https://wbawakate.connpass.com/event/64967/
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
// http://aperiodic.net/phil/scala/s-99/ | |
// P06: Find out whether a list is a palindrome. | |
// Example: | |
// scala> isPalindrome(List(1, 2, 3, 2, 1)) | |
// res0: Boolean = true | |
import scala.annotation.tailrec | |
object P06 { |
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
sealed abstract class Tree | |
case class Branch(value: Int, left: Tree, right: Tree) extends Tree | |
case object Empty extends Tree | |
object TreeObject { | |
def max(tree: Tree): Int = tree match { | |
case Branch(v, l, r) => math.max(math.max(v, this.max(l)), this.max(r)) | |
case Empty => 0 | |
} |
広義
- 処理の単位(Tx)を固めたブロックをチェーンさせるデータ構造を持ったDB
- 上記DBをネットワーク上で複数ノードが保持
狭義
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
# -*- coding: utf-8 -*- | |
from PIL import Image | |
dth, lth = 50, 175 | |
marks = {'dark': 'X', 'light': '_', 'unknown': '?'} | |
def get_pix(filename): | |
with Image.open(filename) as img: |
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
#! /bin/bash | |
year=`date +%Y` | |
month=`date +%m` | |
day=`date +%d` | |
if [ ! -e ~/memos/$year"_"$month ]; then | |
mkdir ~/memos/$year"_"$month | |
fi |
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
#! /bin/bash | |
year=`date +%Y` | |
month=`date +%m` | |
day=`date +%d` | |
weekday=5 | |
next_weekstartday=3 | |
if [ -z $1 ]; then |
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
# -*- coding: utf-8 -*- | |
import socket | |
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) | |
s.connect(('zerois-o-reiwa.seccon.jp', 23615)) | |
for num in range(100): | |
data = '' | |
while data[:2] != '0=': | |
data = s.recv(1024) |
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
# -*- coding: utf-8 -*- | |
import os | |
from PIL import Image | |
import numpy as np | |
def find_edge(pix_line, pix_th): | |
edge1, edge2 = 0, len(pix_line) | |
for i, pix in enumerate(pix_line): |