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
{ "accessKeyId": "<id>", "secretAccessKey": "<key>", "region": "ap-northeast-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
--- State1: Start --- | |
#du -h ~/date | |
12K /home/varlal/data/shards/40000000-5fffffff | |
8.0K /home/varlal/data/shards/00000000-1fffffff | |
8.0K /home/varlal/data/shards/80000000-9fffffff | |
8.0K /home/varlal/data/shards/60000000-7fffffff | |
8.0K /home/varlal/data/shards/c0000000-dfffffff | |
8.0K /home/varlal/data/shards/20000000-3fffffff | |
8.0K /home/varlal/data/shards/a0000000-bfffffff | |
8.0K /home/varlal/data/shards/e0000000-ffffffff |
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
// Goのプログラムはpackageで構成 | |
// importでパッケージを読み込み | |
package main | |
// 規約:パッケージ名はインポートパスの最後の要素と同じ名前 | |
// 例えば、math/randをインポートすると、package randを読み込む | |
import "math/rand" | |
// 1行づつimport |
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 <Adafruit_PWMServoDriver.h> | |
#include <Wire.h> | |
Adafruit_PWMServoDriver pwm = Adafruit_PWMServoDriver(); | |
#define SERVOMIN 150 | |
#define SERVOMAX 600 | |
#define CENTER 375 | |
#define MODE_DEBUG 1 | |
#define MODE_MOTION 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
#include <Servo.h> | |
Servo myservo; | |
const int analogInPin = A0; // Analog input pin that the potentiometer is attached to | |
const int servoPin = 9; // Analog output pin that the LED is attached to | |
int sensorValue = 0; | |
int sensorBuff[10] = {0,0,0,0,0,0,0,0,0,0}; | |
int aveValue = 0; |
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
#! /bin/sh | |
# ubuntu16.04 | |
# | |
# homeの表記を英語にする | |
LANG=C xdg-user-dirs-gtk-update | |
sudo apt-get update | |
sudo apt-get upgrade |
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
$ curl -L -O https://github.com/yahoo/pulsar/releases/download/v1.15.2/pulsar-1.15.2-bin.tar.gz | |
$ tar xvfz pulsar-1.15.2-bin.tar.gz | |
$ ./pulsar-1.15.2/bin/pulsar standalone |
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
0) | |
“596” | |
Returns: “569” | |
You can swap num[1] and num[2] to get the minimum integer. | |
1) | |
“93561” | |
Returns: “13569” | |
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
import java.util.Collections; | |
import java.util.TreeSet; | |
public class SwappingDigits { | |
public String minNumber(String num) { | |
TreeSet<String> results = new TreeSet<String>(); | |
results.add(num); | |
int n = num.length(); | |
for (int i = 0; i < n; i++) { |
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
#!/bin/sh | |
echo "Create .htaccess and .htpasswd for basic auth" | |
BASE_PATH=`pwd` | |
cat <<EOF > .htaccess | |
AuthUserfile $BASE_PATH/.htpasswd | |
AuthGroupfile /dev/null | |
AuthName "Please enter your ID and password" | |
AuthType Basic |