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
# pip install psutil | |
# sbattery(percent=100, secsleft=<BatteryTime.POWER_TIME_UNLIMITED: -2>, power_plugged=True) | |
# sbattery(percent=100, secsleft=4294967295, power_plugged=False) | |
import psutil | |
battery = psutil.sensors_battery() | |
print(battery.power_plugged) |
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
import piexif | |
import re | |
import datetime | |
class GpsIdf(object): | |
def __init__(self, gpsIdf): | |
self.gpsIdf = gpsIdf |
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
import math | |
import matplotlib.pyplot as plt | |
import numpy as np | |
import cv2 | |
import math | |
img = cv2.imread("test.bmp", 0) | |
rhoMax = int(math.hypot(img.shape[0], img.shape[1])) |
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
<?php | |
class PageUtil { | |
private $values = array(); | |
public function put($name, $value) { | |
$this->values[$name] = $value; | |
} | |
public function val(...$names) { |
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
<!doctype html> | |
<html> | |
<!-- | |
* KanTanMarkdown | |
* Copyright (c) 2016 tatesuke | |
* Released under the MIT license | |
* https://github.com/tatesuke/KanTanMarkdown/blob/master/LICENSE | |
--><head> | |
<meta charset="utf-8"> | |
<style>#previewer:after,nav:after{content:".";display:block;font-size:0;clear:both;visibility:hidden}body{margin:0;padding:0;position:relative}body.onDragover{border:5px dashed #99cde1}nav{margint:0}nav #leftNav{float:left}nav #rightNav{float:right}nav:after{height:0}#attach{width:100%;border-top:1px solid gray;border-bottom:1px solid gray;display:none}#attach #attachForm{box-sizing:border-box;width:100%;height:100%;display:none}#attach #attachForm input[type=file]{width:100%}#attach #filer{box-sizing:border-box;width:100%;height:150px;overflow:auto;display:none}#attach #filer input{width:300px}#attach #pasteArea{box-sizing:border-box;width:100%;border:1px solid gray;text-align:center}#attach #attachToggleButton,#attach #previewToggleButton{width:50%}#wrapper{overflow:auto}#wrapper #editorTabWrapper{bo |
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
def ARG_SDF = new java.text.SimpleDateFormat("yyyy-MMdd-HHmm-ss", java.util.Locale.US); | |
def LOG_SDF = new java.text.SimpleDateFormat("dd/MMM/yyyy:HH:mm:ss Z", java.util.Locale.US); | |
def logFile = new File(args[0]); | |
def startTime = ARG_SDF.parse(args[1]); | |
def endTime = ARG_SDF.parse(args[2]); | |
def scanner = new java.util.Scanner(logFile); | |
while (scanner.hasNextLine()) { | |
def line = scanner.nextLine(); |
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
package hoge; | |
import java.awt.image.BufferedImage; | |
import java.io.File; | |
import java.io.IOException; | |
import javax.imageio.ImageIO; | |
import org.bytedeco.javacv.FFmpegFrameGrabber; | |
import org.bytedeco.javacv.FrameGrabber.Exception; |
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
def words = [] | |
def input = new File("org.txt") | |
input.eachLine { | |
it.split(" ").each {it2 -> | |
it2 = it2.toLowerCase() | |
.replaceFirst(/^\(/, "") | |
.replaceFirst(/\)$/, "") | |
.replaceFirst(/^\"/, "") | |
.replaceFirst(/\"$/, "") |
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
the 285850 | |
of 82114 | |
is 79278 | |
a 78948 | |
to 74413 | |
this 61625 | |
if 52123 | |
in 36277 | |
and 35898 | |
be 35465 |
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
<!doctype html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<style> | |
body { | |
padding:10px; | |
} | |
#attach { | |
width:100%; |