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 <ESP8266WiFi.h> | |
#include <DHT.h> | |
#include <PubSubClient.h> | |
#include <aJSON.h> | |
#define DHTPIN 4 | |
#define DHTTYPE DHT11 | |
const char* ssid = "WIFI_SSID"; | |
const char* password = "WIFI_PASS"; |
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
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
import paho.mqtt.client as mqtt_client | |
topic = "MESHBLU_ACTION_UUID" | |
def on_connect(client, userdata, flags, rc): | |
print("connected with result code" + str(rc)) | |
client.subscribe(topic) |
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
(create-fontset-from-ascii-font | |
"Source Code Pro-14:weight=normal:slant=normal" | |
nil "codekakugo") | |
(set-fontset-font "fontset-codekakugo" | |
'unicode | |
(font-spec :family "Hiragino Kaku Gothic Pro" :size 16) | |
nil | |
'append) | |
(add-to-list 'default-frame-alist '(font . "fontset-codekakugo")))) |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<math xmlns="http://www.w3.org/1998/Math/MathML"> | |
<semantics> | |
<mtable> | |
<mtr> | |
<mtd> | |
<mrow> | |
<mrow> | |
<msup> |
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
#!/usr/bin/python | |
sample = [10, 11, 12, 1, 2, 3, 4, 2, 3] | |
temp = [0] + sample[0:-1] | |
points = map(lambda (x, y): x - 1, | |
filter(lambda (i, v): v < 0, | |
enumerate(map(lambda (a, b): a - b, zip(sample, temp))))) | |
if points[-1] != len(sample) - 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
/** | |
Copyright: (c) SAEKI Yoshiyasu | |
License : MIT-style license | |
<http://www.opensource.org/licenses/mit-license.php> | |
last updated: 2012/09/08 | |
**/ | |
#include<cstdio> | |
#include<pHash.h> |
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
/** | |
Copyright: (c) SAEKI Yoshiyasu | |
License : MIT-style license | |
<http://www.opensource.org/licenses/mit-license.php> | |
last updated: 2012/09/08 | |
**/ | |
#include<stdio.h> | |
#include<stdlib.h> | |
#include<puzzle.h> |
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 SocketServer | |
>>> ss = SocketServer.TCPServer(('localhost', 8080), None) | |
Traceback (most recent call last): | |
File "<stdin>", line 1, in <module> | |
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/SocketServer.py", line 408, in __init__ | |
self.server_bind() | |
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/SocketServer.py", line 419, in server_bind | |
self.socket.bind(self.server_address) | |
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/socket.py", line 224, in meth | |
return getattr(self._sock,name)(*args) |
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 socket | |
>>> sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) | |
>>> sock.bind(('localhost', 0)) | |
>>> sock.getsockname() | |
(u'127.0.0.1', 0) | |
>>> sock.listen(1) | |
>>> sock.getsockname() | |
(u'127.0.0.1', 49201) | |
>>> unused_port = _[1] | |
>>> sock.close() |
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
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
# Copyright : (c) SAEKI Yoshiyasu | |
# License : MIT-style license | |
# <http://www.opensource.org/licenses/mit-license.php> | |
# last updated: 2012/05/26 | |
import binascii | |
import subprocess |