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 hosebird_kafka; | |
import com.twitter.hbc.ClientBuilder; | |
import com.twitter.hbc.core.Constants; | |
import com.twitter.hbc.core.endpoint.StatusesSampleEndpoint; | |
import com.twitter.hbc.core.processor.StringDelimitedProcessor; | |
import com.twitter.hbc.httpclient.BasicClient; | |
import com.twitter.hbc.httpclient.auth.Authentication; | |
import com.twitter.hbc.httpclient.auth.OAuth1; | |
import kafka.javaapi.producer.Producer; |
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
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | |
<modelVersion>4.0.0</modelVersion> | |
<groupId>hosebird_kafka</groupId> | |
<artifactId>hosebird_kafka</artifactId> | |
<version>1.0-SNAPSHOT</version> | |
<packaging>jar</packaging> | |
<name>hosebird_kafka</name> |
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
int focusPin = 2; | |
int shutterPin = 3; | |
void setup() { | |
pinMode(focusPin, OUTPUT); | |
pinMode(shutterPin, OUTPUT); | |
pinMode(13, OUTPUT); | |
} |
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 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
>>> 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) |