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 <string> | |
#include <list> | |
// 文字列strからstart_strとend_strで囲まれた部分を抽出する。 | |
string match_slice(string str, string start_str, string end_str) | |
{ | |
int start_pos = str.find(start_str); | |
int end_pos = str.rfind(end_str); | |
return str.substr(start_pos + 1, end_pos - start_pos - 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
#include "mbed.h" | |
#include "EthernetInterface.h" | |
#include "GraphicOLED.h" | |
#include <string> | |
const string SERVER_HOST = "your-app.herokuapp.com"; | |
const int SERVER_PORT = 80; | |
const int CATEGORY_NUM = 28; | |
const string NICO_CATEGORIES[CATEGORY_NUM] = { |
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
//入力のピン | |
const int inputPins[2] = { | |
0, 1}; | |
//出力のピン | |
const int redPins[2] = { | |
3, 6}; | |
const int greenPins[2] = { | |
5, 10}; | |
const int bluePins[2] = { |
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
//入力のピン | |
const int inputPins[2] = {0, 1}; | |
//出力のピン | |
const int redPins[2] = {3, 6}; | |
const int greenPins[2] = {5, 10}; | |
const int bluePins[2] = {11, 9}; | |
//入力ノイズ値 | |
#define NOISE_INPUT 20 |
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
//servo | |
#include <Servo.h> | |
#define SERVO_PIN 9 | |
//negi furi | |
#define DEFAULT_DEG 40 | |
#define NEGIFURI_DEG 70 | |
#define NEGIFURI_WAIT 200 | |
#define NEGIFURI_WAIT_DELAY 400 | |
//spectrum shield | |
#define NOISE_INPUT 160 |
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> | |
void setup() | |
{ | |
delay(1000); | |
Wire.begin(); | |
} | |
void loop() | |
{ |
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> | |
/** | |
* AquesTalk picoをしゃべらせるクラス(I2C接続) | |
* @param int address デバイスのアドレスを指定 | |
*/ | |
class AquesTalk { | |
private: | |
int address; | |
public: |
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
/** | |
* 赤外線でシリアル通信(送信)クラス | |
* 注:このクラスを使うとPORTBのピンは使えなくなる | |
* 受信するときは赤外線受光モジュールのVoutをシリアル送信ピンとして扱えばOK | |
*/ | |
class IrTransmitter{ | |
private: | |
//赤外線の1周期ごとの時間(us) | |
unsigned int irCycleTime; | |
//半周期 |
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 | |
define('ACCESS_URL', 'http://money.www.infoseek.co.jp/MnForex/fxrate/'); | |
define('END_TERM', '</tr>'); | |
define('HTML_DELIMITER', '</td>'); | |
define('API_KEY', 'hogehoge'); | |
if ($_GET['key'] !== API_KEY || empty($_GET['target']) || !is_string($_GET['target'])) { | |
die(); | |
} |
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 | |
try { | |
ob_start(); | |
//warningが出るコード | |
$file = file_get_contents('./not_found_file.txt'); | |
$warning = ob_get_contents(); | |
ob_end_clean(); | |
//Warningがあれば例外を投げる | |
if ($warning) { |
OlderNewer