Skip to content

Instantly share code, notes, and snippets.

View KentaroAOKI's full-sized avatar

kekekekenta KentaroAOKI

View GitHub Profile
// 初学者のためのゲームプログラミング
// #01 とりあえず動かしてみよう
// ゲームのルール
// - 主人公(MAN("a"))を動かしてブロック(BLOCK(","))をゴール(GOAL("O"))に移動
// - ステージ全てのブロック(BLOCK)をゴール(GOAL)に移動させたら終了
#include <iostream>
// ステージのMAPデータ
const char gStageData[] = "\
0 kit fox, Vulpes macrotis
1 English setter
2 Australian terrier
3 grey whale, gray whale, devilfish, Eschrichtius gibbosus, Eschrichtius robustus
4 lesser panda, red panda, panda, bear cat, cat bear, Ailurus fulgens
5 Egyptian cat
6 ibex, Capra ibex
7 Persian cat
8 cougar, puma, catamount, mountain lion, painter, panther, Felis concolor
9 gazelle
#coding: utf-8
import json
import time
import os
import requests
import datetime
import hashlib
import hmac
import base64
Reagion Latitude Longitude
Asia 23.02 72.36
Asia 19.53 75.19
Asia 12.58 77.35
Asia 23.14 77.24
Asia 18.54 72.49
Asia 22.32 88.2
Asia 28.37 77.12
Asia 27.29 94.55
Asia 26.11 91.45
@KentaroAOKI
KentaroAOKI / raspisensor.sql
Created October 4, 2015 03:07
stream analytics query for raspi
SELECT
System.Timestamp as Time,
DeviceId,
CAST(AVG(frompis.Temp) AS float) AS Temp,
CAST(AVG(frompis.Pressure) AS float) AS Pressure,
CAST(AVG(frompis.Hum) AS float) AS Hum,
CAST(AVG(frompis.HiLux) AS float) AS HiLux,
CAST(AVG(frompis.LowLux) AS float) AS LowLux
INTO
powerbi
@KentaroAOKI
KentaroAOKI / senddatatosoracom.py
Created October 4, 2015 01:09
Send the sensor data of Raspberry PI to the Azure Event Hub using SORACOM.
#coding: utf-8
from azure.servicebus import ServiceBusService
import urllib3
import datetime
#azure service bus
key_name = 'SendRule' # SharedAccessKeyName from Azure portal
key_value = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' # SharedAccessKey from Azure portal
service_namespace = 'sora-ns'
sbs = ServiceBusService(service_namespace,
@KentaroAOKI
KentaroAOKI / getimsifrombeam.sh
Created October 4, 2015 00:56
Get the imsi number from beam.
#!/bin/sh
wget http://beam.soracom.io:8888/ –O soraenv
. soraenv
echo $SORACOM_IMSI
@KentaroAOKI
KentaroAOKI / senddatatosoracom.py
Created October 4, 2015 00:09
Send the sensor data of Raspberry PI to the Azure Event Hub using SORACOM.
#coding: utf-8
from azure.servicebus import ServiceBusService
import urllib3
import datetime
#azure service bus
key_name = 'SendRule' # SharedAccessKeyName from Azure portal
key_value = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' # SharedAccessKey from Azure portal
service_namespace = 'xxxxx-ns'
sbs = ServiceBusService(service_namespace,
@KentaroAOKI
KentaroAOKI / index.php
Created October 3, 2015 12:58
Get the IMSI of SORACOM Air using SORACOM Beam.
<?php
$headers = getallheaders();
echo "SORACOM_IMSI=" . $headers["X-Soracom-Imsi"] . "\n";
?>
Private Sub ExtractResponseBody(Response As String)
'This procedure parses the response and writes down the result
On Error GoTo ErrorsHandler
Dim Results As Variant
Dim InnerResults As Variant
Response = Replace(Response, "[[", Chr(9))
Response = Replace(Response, Chr(34), "")
Response = Replace(Response, "{", "")
Response = Replace(Response, "}", "")