- Raspberry Pi 3(他のでも動くと思う)
- AS-289R2 プリンタシールド
- 配線用ジャンパケーブル少々
- Python3パッケージ
- qrcode (QRコード生成)
- serial (シリアル通信)
- WiringPi (GPIO制御など)
- imagemagick
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
require 'mini_magick' | |
shiftbit = 2 | |
filename = ARGV[0] | |
bname = File.basename(filename, '.*') | |
img = MiniMagick::Image.open(filename) | |
img_width = img.width | |
img_height = img.height | |
pixels = img.get_pixels |
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 json | |
import sys | |
import datetime | |
import math | |
import requests | |
import bs4 | |
""" | |
https://supernodes.nem.io/をスクレイピングしてSupernodeの一覧を格納した辞書オブジェクトとjsonオブジェクトを作ります。 | |
引数で取得件数を決められます。省略すると全部取ります。 |
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
echo off | |
pdftk %1 cat 1-endeast output %1.pdf |
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
/* Twitter */ | |
@namespace url(http://www.w3.org/1999/xhtml); | |
@-moz-document domain("twitter.com") { | |
.edge-design .avatar { | |
border-radius: 10% !important; | |
} | |
.DashboardProfileCard-avatarImage { |
We can make this file beautiful and searchable if this error is corrected: It looks like row 2 should actually have 1 column, instead of 2 in line 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
Hide Unwanted Results Data v1.0 | |
1,welq.jp | |
1,cafy.jp | |
1,mery.jp | |
1,iemo.jp | |
1,find-travel.jp | |
1,jooy.jp | |
1,cuta.jp | |
1,puul.jp | |
1,upin.jp |
7つある要素から重複あり(同じ要素が何度でも使える)で4つ選ぶ組み合わせを出力します。 組み合わせなので、例えば(2,3,4,4)と(4,3,4,2)は同じとみなして1つと数えます。 詳細は「重複組合せ」で検索してみてください。
Rubyで書こうかと思っていたらPythonだとそのまんまのメソッドを持つモジュールがあったので日和りました。
と思ったらRubyでもrepeated_combinationメソッドありました。検索力が低かっただけでした。Rubyのも足しました。
Pythonのが行数が多いのは作者のPython力が低いからです。
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
#!/usr/bin/env ruby | |
require 'RMagick' | |
include Magick | |
fext = File.extname(ARGV[0]) | |
fname = File.basename(ARGV[0],fext) | |
img = Magick::ImageList.new(ARGV[0]) | |
imgsize_x = img.columns |
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
#!/usr/bin/env ruby | |
require 'rexml/document' | |
def libdevicelist(partslibrary) | |
devicelist = [] | |
partslibrary.elements.each('eagle/drawing/library/devicesets/deviceset') do |element| | |
devicelist << element.attributes["name"] | |
end | |
return devicelist |
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 | |
1.upto(31){|num| | |
if num==1 | |
print("=") | |
else | |
print("+") | |
end | |
print("and(or($B$%d=\"月\",$B$%d=\"火\",$B$%d=\"水\",$B$%d=\"木\",$B$%d=\"金\"),C$%d<>\"\")"%[num+1,num+1,num+1,num+1,num+1,num+1]) | |
# ) |