View recv_weight.ino
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
#define RECV_PIN 5 | |
#define TIMEOUT_US 30000 | |
#define DETECT_INTERVAL_MS 10000 | |
int recv_data(uint32_t *data) { | |
int count = 0; | |
while (true) { | |
unsigned long pulse = pulseIn(RECV_PIN, HIGH, TIMEOUT_US); | |
if (pulse == 0){ | |
break; |
View test.java
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 java.util.ArrayList; | |
import java.util.Collections; | |
import java.util.Comparator; | |
import java.util.HashMap; | |
import java.util.List; | |
import java.util.Map; | |
import java.util.Map.Entry; | |
public class Main { |
View gist:8fa109b00189ff213231
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
brew cask install google-chrome | |
brew cask install iterm2 | |
brew cask install skype | |
brew cask install todoist | |
brew cask install sequel-pro | |
brew cask install sublime-text | |
brew cask install intellij-idea | |
brew cask install alfred | |
brew cask install 1password | |
brew cask install cinch |
View gist:8034b336c047c80e81c3
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
#include <Wire.h> | |
#define MPU6050_ACCEL_XOUT_H 0x3B // R | |
#define MPU6050_WHO_AM_I 0x75 // R | |
#define MPU6050_PWR_MGMT_1 0x6B // R/W | |
#define MPU6050_I2C_ADDRESS 0x68 | |
typedef union accel_t_gyro_union{ | |
struct{ | |
uint8_t x_accel_h; |
View gist:9187637
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
var str0 = '{"id":0,"name":"GMT","difference":0}'; | |
var str1 = '{"id":1,"name":"JST","difference":9}'; | |
var str2 = '{"id":2,"name":"PST","difference":-8}'; | |
timezones = new Array(JSON.parse(str1), JSON.parse(str2), JSON.parse(str0)); | |
localStorage.setItem("currentTimezone",JSON.stringify(timezones[0])); | |
localStorage.setItem("myTimezone",JSON.stringify(timezones)); |
View BoundingBox.java
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
public class BoundingBox { | |
public int smallestArea(int[] X, int[] Y) { | |
return getl(X)*getl(Y); | |
} | |
private int getl(int[] N) { | |
int max = -100; | |
int min = 100; |
View Fluentd & Treasure Data でこっそり始めるログ集計
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
「Fluentd & Treasure Data でこっそり始めるログ集計」 | |
CROOZ 株式会社 | |
池田 朋大( @mikeda ) | |
FluentdとTreasureDataプラットフォームを使って、1インフラエンジニアが勢いでログ集計システムを作ってみたお話です | |
--- | |
■発表の人 | |
インフラエンジニア | |
fluentd 歴3ヶ月 |
View cyclone版
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 cyclone.web | |
class MainHandler(cyclone.web.RequestHandler): | |
def get(self): | |
self.write("hello, world") | |
Application = lambda: cyclone.web.Application([(r"/", MainHandler)]) |
View gist:2816540
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" /> | |
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script> | |
<script> | |
//write here | |
$(function() { | |
$("input#search").click( function() { | |
var searchId = $("input#input_id").val(); |
View Diamond.java
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
public class Diamond { | |
public static void main (String[] args) { | |
for (int j = 0; j < 8; j++) { | |
for (int i = 7; i-j>0; i-- ) { | |
System.out.print(" "); | |
} | |
for (int i = 1; i<j*2; i++){ | |
System.out.print("*"); |
NewerOlder