GPIO with raspi第一回(?)
ロードアベレージの高さに応じてLEDを点灯させる
- ロードアベレージが低い[0,2)→緑
- ちょっとしんどい[2,5)→黄
- しんどい[5,∞)→赤
| #!/usr/bin/env python3 | |
| """nicovideo.py: parse json and show video info""" | |
| __author__ = "Yuto Tokunaga" | |
| import sys | |
| import os | |
| import glob | |
| import json |
| Driver Capability: | |
| Driver: "uvcvideo" | |
| Card: "UCAM-DLN130T series" | |
| Bus: "usb-0000:00:14.0-2" | |
| Capabilities: 84000001 |
| using System; | |
| using System.Linq; | |
| using System.Collections.Generic; | |
| public class Hello{ | |
| public static void Main(){ | |
| // Here your code ! | |
| var t = new {a = 0f, b = 0f}; | |
| Func<float, object> hoge = (float x) => new {a = x+1, b = x-1}; |
| package main | |
| import ( | |
| "encoding/csv" | |
| "fmt" | |
| "html/template" | |
| "os" | |
| "strconv" | |
| "strings" | |
| ) |
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <title>大阪府の人口密度</title> | |
| </head> | |
| <body> | |
| <canvas id="canvas" width="640" height="640"></canvas> | |
| <script type="text/javascript" src="http://underscorejs.org/underscore-min.js"></script> | |
| <script type="text/javascript"> |
| import Data.Char | |
| import Data.List | |
| import Text.Regex | |
| import Text.Regex.Base.RegexLike | |
| splitJmp :: String -> (String, String) | |
| splitJmp ss = | |
| let isLoop s = head s == '[' && last s == ']' && matchCount (mkRegex "\\[") s == matchCount (mkRegex "\\]") s in | |
| case elemIndex True $ map (\i -> isLoop $ take i ss) [1..length ss] of | |
| Just i -> (init . tail $ take i ss, drop i ss) |