This file contains hidden or 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 SampleFragment extends Fragment { | |
/** Fragmentで保持しておくデータ */ | |
private int mData; | |
/** | |
* Fragmentインスタンスを生成した返却. | |
* | |
* コンストラクタに引数を渡すのはダメ。 | |
* Fragmentがメモリ不足で破棄され、そこから復帰する時に空のコンストラクタ呼ばれる。 |
This file contains hidden or 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
`EmbulkのBigquerryのプラグインを利用していて以下のエラーが出た。 | |
`Caused by: java.io.IOException: DerInputStream.getLength(): lengthTag=111, too big. | |
`間違えて秘密鍵を適当なエディタで開いてしまい、のエンコード形式が変わっていたのが原因。 |
This file contains hidden or 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/perl | |
for(@ARGV) { | |
open(IN, $_) || die "$!"; | |
for(<IN>) { | |
# 通常のjsonだと m/"(\w*?)":["|\d]/g | |
for my $match ( m/"(\$?\w*?)":["|\d|true|false]/g ) { | |
$is_match = 0; | |
for my $_ (@list) { | |
if($_ eq $match) { |
This file contains hidden or 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/perl | |
for(@ARGV) { | |
open(IN, $_) || die "$!"; | |
for(<IN>) { | |
# 通常のjsonだと m/"(\w*?)":["|\d]/g | |
for my $match ( m/"(\$?\w*?)":["|\d|true|false]/g ) { | |
$is_match = 0; | |
for my $_ (@list) { | |
if($_ eq $match) { |
This file contains hidden or 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 main | |
import ( | |
"fmt" | |
"github.com/franela/goreq" | |
) | |
func main() { | |
res, _ := goreq.Request{ Uri: "https://www.googleapis.com/customsearch/v1" }.Do() | |
body, _ := res.Body.ToString() |
This file contains hidden or 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 main | |
import ( | |
"fmt" | |
"github.com/franela/goreq" | |
) | |
type Parameter struct { | |
Key string | |
Q string |
This file contains hidden or 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
2016/10/11 06:17:13 GET /customsearch/v1/?cx=【検索エンジンID】&key=【APIキー】&num=3&q=google&searchType=image HTTP/1.1 | |
Host: www.googleapis.com | |
{ | |
"kind": "customsearch#search", | |
"url": { | |
"type": "application/json", | |
"template": "https://www.googleapis.com/customsearch/v1?q={searchTerms}&num={count?}&start={startIndex?}&lr={language?}&safe={safe?}&cx={cx?}&cref={cref?}&sort={sort?}&filter={filter?}&gl={gl?}&cr={cr?}&googlehost={googleHost?}&c2coff={disableCnTwTranslation?}&hq={hq?}&hl={hl?}&siteSearch={siteSearch?}&siteSearchFilter={siteSearchFilter?}&exactTerms={exactTerms?}&excludeTerms={excludeTerms?}&linkSite={linkSite?}&orTerms={orTerms?}&relatedSite={relatedSite?}&dateRestrict={dateRestrict?}&lowRange={lowRange?}&highRange={highRange?}&searchType={searchType}&fileType={fileType?}&rights={rights?}&imgSize={imgSize?}&imgType={imgType?}&imgColorType={imgColorType?}&imgDominantColor={imgDominantColor?}&alt=json" | |
}, |
This file contains hidden or 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 <ESP8266WebServer.h> | |
#define WIFI_SSID "接続したいSSID" | |
#define WIFI_PWD "接続したいSSIDのパスワード" | |
// HTML | |
#define HTML_HEADER "<!doctype html>"\ | |
"<html><head><meta charset=\"UTF-8\"/>"\ | |
"<meta name=\"viewport\" content=\"width=device-width\"/>"\ |
This file contains hidden or 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
String findPublicIP() { | |
WiFiClient client; | |
if (client.connect("api.ipify.org", 80)) { | |
//Serial.println("connected"); | |
client.println("GET /?format=txt HTTP/1.0"); | |
client.println("Host: api.ipify.org"); | |
client.println(); | |
} else { | |
Serial.println("connection failed"); | |
} |
This file contains hidden or 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
// https://github.com/urish/arduino-slack-bot | |
#include <Arduino.h> | |
#include <Hash.h> | |
#include <ESP8266WiFiMulti.h> | |
#include <ESP8266HTTPClient.h> | |
#include <WebSocketsClient.h> | |
#include <ArduinoJson.h> | |
#define WIFI_SSID "接続したいSSID" |
OlderNewer