Slide 1

Slide 1 text

AQSF SGTTe Q?t jbnp CS Q? J AQSF SGTT 8PSE$BNQ)BOFEB ஑ాඦ߹ࢠ

Slide 2

Slide 2 text

P GSPG QH ?J PIT iw

Slide 3

Slide 3 text

gueo 1WGS J PI QP PG QSM

Slide 4

Slide 4 text

J N RT VG 鲱鳖鳓鱬র౓ɾ৭Թ౓鱑ม鱍鲎鲑鲐

Slide 5

Slide 5 text

S Q 7QEM 鲱鳖鳓鱬։ৣɾ鳅鲻鳀ܦ༝鱬߹伴ަ׵

Slide 6

Slide 6 text

_ QRVNCS TOCNN EQORV GST Q/ AG IJ S EG 3BTQCFSSZ1J Y"3.()[ H = 3BTQCFSSZ1J ;FSP8 "3.()[ H = "SEVJOP "3..)[ H = NJDSPCJU "3..)[ H = &418300. "3..)[ H =

Slide 7

Slide 7 text

No content

Slide 8

Slide 8 text

8J'J ()[ (CQT #-& ()[ .CQT (-5& .ʙ()[ ໿.CQT -18" ʙ.)[ LCQT ;JH#FF ()[ ೔ຊ ,CQT A SGNGTT GEJPQNQI

Slide 9

Slide 9 text

3&45 Ұํ޲ ର 8FC4PDLFUT ૒ํ޲ ର .255 ૒ํ޲ ରଟ SQ QEQN

Slide 10

Slide 10 text

1 ? -

Slide 11

Slide 11 text

A i t : : P G A FC C IUUQEFNPXQBQJPSHXQKTPOXQWQPTUT {"id":1,
 "date":"2017-05-23T06:25:50",
 "date_gmt":"2017-05-23T06:25:50",
 "guid":{"rendered":"http:\/\/demo.wp-api.org\/?p=1"},
 "modified":"2017-05-23T06:25:50",
 "modified_gmt":"2017-05-23T06:25:50",
 "slug":"hello-world",
 "status":"publish",
 "type":"post",
 "link":"https:\/\/demo.wp-api.org\/2017\/05\/23\/hello-world\/",
 "title":{"rendered":"Hello world!"},
 "content":{"rendered":"

Welcome to...

Slide 12

Slide 12 text

x w i 1PFRQ P T IUUQEFNPXQBQJPSHXQKTPOXQWQPTUT IUUQEFNPXQBQJPSHXQKTPOXQWNFEJB IUUQEFNPXQBQJPSHXQKTPOXQWUZQFT IUUQEFNPXQBQJPSHXQKTPOXQWDPNNFOUT IUUQEFNPXQBQJPSHXQKTPOXQWUBYPOPNJFT IUUQEFNPXQBQJPSHXQKTPOXQWVTFST ৄࡉ鱴IUUQKBXQBQJPSHࢀর

Slide 13

Slide 13 text

y /VT QO G CWC NCDNG XQKTPOXQW40.&5)*/( XQKTPO"/:5)*/(W8)"5

Slide 14

Slide 14 text

x w G GPFRQ P add_action( 'rest_api_init', function () { register_rest_route( 'anything/v1', '/get', array( 'methods' => 'GET', 'callback' => 'get_anything_awesome', ) ); } ); function get_anything_awesome() { $data = array('result' => 'great data'); return new WP_REST_Response( $data, 200 ); }

Slide 15

Slide 15 text

- GTRQPTG http://example.net/wp-json/ anything/v1/get {"result":"great data"}

Slide 16

Slide 16 text

710 710 -F CPGN

Slide 17

Slide 17 text

No content

Slide 18

Slide 18 text

CSF CSG 3(#-&%.BUSJY1BOFMYʙY 3BTQCFSSZ1J #PS;FSP "EBGSVJU3(#.BUSJY)"5 64# " %$鲩鱅鳎鳣 ిݯ୺ࢠ୆

Slide 19

Slide 19 text

CTRDGSS 鳧鳫鳔鱅鳁鲫鳫鳌鳝鱅鲷 -JOVY 
 8JOEPXT*P5 FUD ʙ
 ʙԁ লిྗ UP8 ӳࠃ੡

Slide 20

Slide 20 text

CTRDGSS 鳧鳫鳔鱅鳁鲫鳫鳌鳝鱅鲷 -JOVY 
 8JOEPXT*P5 FUD ʙ
 ʙԁ লిྗ UP8 ӳࠃ੡ 1JO)FBEFS )%.* Y64# -"/

Slide 21

Slide 21 text

710 C S CPGN )6#鲫鳅鲧鲷 4JHOBM /FYU

Slide 22

Slide 22 text

. C S .QPPG 鲚鳁鲢鳫鳔鱅鳁 )6#鲫鳅鲧鲷 35$鳈鲻鲧鲚鲻鳏ରԠ ถࠃ"EBGSVJU੡ 1BOFM

Slide 23

Slide 23 text

t dg GS ECN EQPPGE NCPFTECRG RCPGN

Slide 24

Slide 24 text

QH CSG 3BTQCJBO-JUF
 IUUQTXXXSBTQCFSSZQJPSHEPXOMPBET 31J3(#-&%.BUSJY-JCSBSZ
 IUUQTHJUIVCDPNI[FMMFSSQJSHCMFENBUSJY

Slide 25

Slide 25 text

CTRD CP 7 G XXXSBTQCFSSZQJPSHEPXOMPBET

Slide 26

Slide 26 text

: G PIT 4%鲣鱅鳁鱰04ॻ鱒ࠐ鲄 ઃఆ 鳡鲜鳎鳡鳢鱳鲜鳫鲱鳀鱅鳣

Slide 27

Slide 27 text

.VSP : 鲼鱅鳣鱬4%鲣鱅鳁鱰ॻ鱒ࠐ鲄 &UDIFSJP"QQMF1J#BLFS鱯鱮

Slide 28

Slide 28 text

1 EJGS IUUQFUDIFSJP

Slide 29

Slide 29 text

-RRNG .CMGS IUUQTXXXUXFBLJOHBMMDPNTPGUXBSF NBDPTYTPGUXBSFNBDPTYBQQMFQJCBLFS

Slide 30

Slide 30 text

/QPH I SBTQJDPOpH鱬ઃఆ 鳥鲩鱅鳣KB@+1 65' 鲥鱅鳔鱅鳁೔ຊޠ鲥鱅ӳޠ 64 ࣌ؒଳ"TJB5PLZP

Slide 31

Slide 31 text

PT CNN CEMCIGT BQU鱬鲜鳫鲱鳀鱅鳣 $ sudo apt install git \ libgraphicsmagick++-dev \ libwebp-dev

Slide 32

Slide 32 text

. 710 C S HJUIVCDPNI[FMMFSSQJSHCMFENBUSJY

Slide 33

Slide 33 text

OCMG $ git clone https://github.com/ hzeller/rpi-rgb-led-matrix $ cd rpi-rgb-led-matrix $ make -C examples-api-use $ cd utils $ make led-image-viewer

Slide 34

Slide 34 text

0GOQ $ cd example-api-use $ sudo ./demo \
 --led-gpio-mapping=adafruit-hat \ --led-no-hardware-pulse \ --led-chain=4 -L \
 -D 0

Slide 35

Slide 35 text

sk 0 TRNC ACRVV

Slide 36

Slide 36 text

sk t /QNNGE ACRVV OCIGT

Slide 37

Slide 37 text

h lr -SSCPIG Q NCPFTECRG

Slide 38

Slide 38 text

ESQNN 0GOQ $ sudo ./demo \
 --led-gpio-mapping=adafruit-hat \ --led-no-hardware-pulse \ --led-chain=4 -L \
 -D 1 ../../images/wapuu.ppm

Slide 39

Slide 39 text

- -FF -

Slide 40

Slide 40 text

A - e OCIG /JCPIG -

Slide 41

Slide 41 text

/VT QO 1PF Q P ը૾ઃఆ 4FU*NBHF /wp-json/wapuu/v1/set/NNN ը૾൪߸ಡ鲄ग़鱜 (FU*NBHF /wp-json/wapuu/v1/get

Slide 42

Slide 42 text

x w -FF GPF RQ P add_action( 'rest_api_init', function () { register_rest_route( 'wapuu/v1', '/set/(?P\d+)', array( 'methods' => 'POST', 'callback' => 'set_wapuu_image', 'args' => array( 'id' => array( 'validate_callback' => function($param, $request, $key) { return is_numeric( $param ); } ), ), ) ); register_rest_route( 'wapuu/v1', '/get', array( 'methods' => 'GET', 'callback' => 'get_wapuu_image', ) ); } );

Slide 43

Slide 43 text

t CWG& G OCIG PVODGS function set_wapuu_image( $data ) { $id = $data['id']; update_post_meta( 60, 'wapuu-image', $id ); $data = array( 'id' => $id ); return new WP_REST_Response( $data, 200 ); } function get_wapuu_image() { $id = get_post_meta( 60, 'wapuu-image'); $data = array( 'id' => $id ); return new WP_REST_Response( $data, 200 ); }

Slide 44

Slide 44 text

- GTRQPTG http://example.net/wp-json/ wapuu/v1/get {"id":"001"}

Slide 45

Slide 45 text

JQP EQFG QP CT

Slide 46

Slide 46 text

- p G OCIG PVODGS api="http://example.net/wp-json/wapuu/v1/get" def img_number(): try: html = urllib.urlopen( api ).read() except: return None data = json.loads(html) return data['id']

Slide 47

Slide 47 text

e t c G S WG OCIG D PVODGS image_dir = "~/wapuu/" viewer = "~/rpi-rgb-led-matrix/utils/led-image-viewer" opt = " --led-daemon --led-gpio-mapping=adafruit-hat" +\ " --led-no-hardware-pulse --led-chain=4 -L" prev = None while True: time.sleep(2) number = img_number() if number is None: continue files = glob.glob(image_dir+number+"-*.png") if len(files) < 1: continue if files[0] == prev: continue if prev is not None: kill_img() commands.getstatusoutput("sudo "+viewer+opt+files[0]) prev = files[0]

Slide 48

Slide 48 text

j t c ?VSP QHH OCIG JGP EJCPIG pattern = r"^ *(\d+) .*/led-image-viewer" def kill_img (): id = [] ps_list = commands.getoutput('ps awx') for process in ps_list.split("\n"): match = re.match(pattern, process) if not match: continue id.append(match.group(1)) commands.getoutput("sudo kill "+" ".join(id))

Slide 49

Slide 49 text

GNGE CIG
[caption id="attachment_40" align="alignleft" width="150"] 001 Original (WordCamp 2011 Fukuoka)

 Submit [/caption]

Slide 50

Slide 50 text

z ?GORGSC VSG& VO F 7QIIGS

Slide 51

Slide 51 text

GPTG -? "EEPO#PBSE GPS"TUSP1J 3(#-&%.BUSJYY 4FOTPST
 5FNQ)VNJ1SFTT(ZSP.BH

Slide 52

Slide 52 text

GPTG -? "EEPO#PBSE GPS"TUSP1J 3(#-&%.BUSJYY 4FOTPST
 5FNQ)VNJ1SFTT(ZSP.BH 1JO)FBEFS 4FOTPST +PZTUJDL

Slide 53

Slide 53 text

1PW SQ R -? "EEPO#PBSE &OWJSPONFOU4FOTPST 5FNQFSBUVSF1SFTTVSF -JHIU$PMPVS.PUJPO g .BEFCZ1JNPSPOJ 6,

Slide 54

Slide 54 text

1PW SQ R -? "EEPO#PBSE &OWJSPONFOU4FOTPST 5FNQFSBUVSF1SFTTVSF -JHIU$PMPVS.PUJPO g .BEFCZ1JNPSPOJ 6, 1JO)FBEFS 4FOTPST

Slide 55

Slide 55 text

GCTVSG GORGSC VSG&JVO F from sense_hat import SenseHat sense = SenseHat() temp = sense.get_temperature() print("Temperature: %s C" % temp) humi = sense.get_humidity() print("Humidity: %s %%rH" % humi)

Slide 56

Slide 56 text

h /QPWGS P Q F TEQOHQS PFG 0.81Td +0.01H(0.99Td -14.3) +46.3 Td: Temp (℃) H: Humidity ฏԺ ೤ؾ͋Γ

Slide 57

Slide 57 text

AQSF SGTTe 7QI J AQSF SGTT

Slide 58

Slide 58 text

e CMG ISCRJ D

Slide 59

Slide 59 text

AQSF SGTT CT 0C C QSG

Slide 60

Slide 60 text

/VT QO QT ? RG J RT &&EQFG QSFRSGTT QSI&RQT B RG add_action( 'init', 'create_fever_log_type' ); function create_fever_log_type() { register_post_type( 'fever_log', array( 'labels' => array( 'name' => __( 'Fever' ), 'singular_name' => __( 'Fever' ) ), 'public' => true, 'has_archive' => true, ) ); }

Slide 61

Slide 61 text

HGSWGSBNQI RG 鲷鲜鳀鳣
 QPTU@UJUMF ˡ ෆշࢦ਺ EJTDPNGPSUJOEFY ຊจ QPTU@DPOUFOU ˡ Թ౓࣪౓ UFNQ IVNJEJUZ ߋ৽೔࣌ QPTU@EBUF ˡ ଌఆ೔࣌ EBUFUJNF

Slide 62

Slide 62 text

/SGC G -

Slide 63

Slide 63 text

/VT QO 1PF Q P Թ౓ɾ࣪౓鲗ه࿥
 4VCNJUBUFNQIVNJEJUZ /wp-json/fever/v1/log ෆշࢦ਺鱳ཤྺ鲗औಘ
 (FUIJTUPSZPGEJTDPNGPSUJOEFYFT /wp-json/fever/v1/history

Slide 64

Slide 64 text

x w -FF GPF RQ P add_action('rest_api_init', function () { register_rest_route('fever/v1', '/log/', array( 'methods' => 'POST', 'callback' => 'log_fever_value', ) ); register_rest_route('fever/v1' '/history/', array( 'methods' => 'GET', 'callback' => 'get_fever_history', ) ); } );

Slide 65

Slide 65 text

t "( 7QI GOR JVO F function log_fever_value() { $obj = json_decode($_POST); $t = $obj['temp']; $h = $obj['humi']; $data = array(); if (! is_numeric($t) || ! is_numeric($h) ) { return new WP_REST_Response($data, 400); } $json=json_encode(array('temp'=>$t,'humi'=>$h)); $discomf = $t*0.81+$h*($t*0.99-14.3)*0.01+46.3;

Slide 66

Slide 66 text

t ") 7QI GOR JVO F $post = array( 'post_type' => 'fever_log', 'post_name' => 'fever_log', 'post_content' => $json, 'post_title' => $discomf, ); $post_ID = wp_insert_post($post); if (! $post_ID ) { return new WP_REST_Response($data, 500); } $data['post_ID'] = $post_ID; return new WP_REST_Response($data, 200); }

Slide 67

Slide 67 text

HGWGS NQI RQT

Slide 68

Slide 68 text

t m a"( GCF F TEQOHQS PFG GT function get_fever_history() { $num = 360; $args = array ( 'post_type' => 'fever_log', 'numberposts' => $num, 'offset' => 0, 'orderby' => 'date', 'order' => 'ASC', ); $posts = get_posts($args);

Slide 69

Slide 69 text

t m a") GCF F TEQOHQS PFG GT $data = array(); foreach ( $posts as $p ) { setup_postdata( $p ); $data[] = array( 'date' => get_the_date('Y/m/d H:i:s'), 'discomfort' => floatval(get_the_title()), ); } return new WP_REST_Response($data,200); }

Slide 70

Slide 70 text

& R LTQP&HGWGS&W(&J T QS [ {"datetime":"2018\/06\/01 22:25:11", "discomfort":83.0214384153}, {"datetime":"2018\/06\/01 22:25:35", "discomfort":83.3682958288}, {"datetime":"2018\/06\/02 09:12:00", "discomfort":82.3637111865} ]

Slide 71

Slide 71 text

7QII PI QP CT

Slide 72

Slide 72 text

t GPF GOR&JVO F #!/usr/bin/python api="http://example.net/wp-json/fever/v1/log" import requests from sense_hat import SenseHat sense = SenseHat() temp = sense.get_temperature() humi = sense.get_humidity() env = '{"temp":%f, "humi":%f}' % (temp, humi) response = requests.post(api, env, headers={'Content-Type': 'application/json'} )

Slide 73

Slide 73 text

h GPF RGS QF ECNN $ crontab -e */5 * * * * /home/pi/log-env.py {"temp":30.190403, "humi":41.724270}

Slide 74

Slide 74 text

CMG SCRJ

Slide 75

Slide 75 text

SCRJ 7 DT IUUQEZHSBQITDPN IUUQNPSSJTKTHJUIVCJPNPSSJTKT

Slide 76

Slide 76 text

C E ? 7
g = new Dygraph( document.getElementById("graphdiv"), // CSV data. );

Slide 77

Slide 77 text

HVPE QPT RJR add_action('wp_enqueue_scripts','dygraph_styles'); function dygraph_styles() { wp_enqueue_style( 'child-style', get_stylesheet_directory_uri().'/dygraph.css'); wp_enqueue_script( 'dygraph', get_stylesheet_directory_uri().'/dygraph.js'); }

Slide 78

Slide 78 text

RQT BEQP GP
g = new Dygraph( // containing div document.getElementById("graphdiv"), // CSV or path to a CSV file. "Time,Fever\n" + "2018-06-02 10:15:07,77.258414\n" + "2018-06-02 10:16:08,77.554262\n" + "2018-06-02 10:17:10,77.680172\n" + "2018-06-02 10:18:02,77.825666\n" + "2018-06-02 10:20:04,78.359325\n" + "2018-06-02 10:25:03,79.242797\n" );

Slide 79

Slide 79 text

No content

Slide 80

Slide 80 text

?:0: 鲿鱅鲷౤ߘ࣌鱰0"VUIೝূ
 "EE0"VUIBVUIFOUJDBUJPOXIFOQPTUJOH 鲨鳡鳍鱳։࢝ɾऴྃ࣌ࠁ鲗ࢦఆՄೳ
 $BOTQFDJGZTUBSUFOEUJNF Թ౓ɾ࣪౓鱥鱖鱳鲨鳡鳍ඳը
 %SBXHSBQIPGUFNQFSBUVSFPSIVNJEJUZPOMZ

Slide 81

Slide 81 text

2N IJ SCFCS

Slide 82

Slide 82 text

No content

Slide 83

Slide 83 text

JQ FQGT QSM IUUQTIBCSDPNFOQPTU

Slide 84

Slide 84 text

CSF CSG 3BTQCFSSZ1J 35-4%3鳁鳫鲨鳣
 64#஍鲿鲰鲹鳝鱅鳂鱅 鲚鳫鲾鳂

Slide 85

Slide 85 text

v IUUQTIBCSDPNFOQPTU

Slide 86

Slide 86 text

QH CSG HJUDMPOFIUUQTHJUIVCDPNBOUJSF[ EVNQHJU DEEVNQ NBLF EVNQJOUFSBDUJWFŠOFU

Slide 87

Slide 87 text

IUUQTIBCSDPNFOQPTU

Slide 88

Slide 88 text

fjA e 鲣鲱鲷鳘౤ߘ鲷鲜鳏鱬อଘ ஍ਤ্鱬දࣔ

Slide 89

Slide 89 text

w IUUQTIBCSDPNFOQPTU

Slide 90

Slide 90 text

஑ాඦ߹ࢠ http://www.yuriko.net/ @lilyfanjp J RT && TN FGTJCSG PG & N N HCP& QSFRSGTT Q J RT &&I JVD EQO&N N HCPLR& QSFHGT) ( TCORNG