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 socket | |
import time | |
from imutils.video import VideoStream | |
import imagezmq | |
sender = imagezmq.ImageSender(connect_to='tcp://wwj-macbook.local:5555') | |
rpi_name = socket.gethostname() # send RPi hostname with each image | |
picam = VideoStream(usePiCamera=True).start() | |
time.sleep(2.0) # allow camera sensor to warm up |
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
"block" | |
a := [ :x :y | [ :z| x+y+z] ]. | |
b := a value:1 value:2. | |
b value: 3 |
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
目标: 构建中文dsl | |
Date today | |
"hello" size | |
'hello' executeMethod: ('hello' class lookupSelector: #size) | |
[:x | Date executeMethod: (Date class lookupSelector:x) ] value: #today |
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
''' | |
IoT: Internet of Things | |
server : iot.codelab.club | |
# tool: | |
pip3 install hbmqtt # 0.9.5 | |
hbmqtt_pub --url mqtt://guest:test@iot.codelab.club -t "/scratch3_sub" -m "hello from hbmqtt_pub" | |
hbmqtt_sub --url mqtt://guest:test@iot.codelab.club -t "/scratch3_pub" | |
''' | |
import logging |
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 itchat, time | |
from itchat.content import TEXT | |
@itchat.msg_register([TEXT]) | |
def text_reply(msg): | |
# 不会接受群消息 | |
# msg.user.send('%s: %s' % (msg.type, msg.text)) | |
# author = itchat.search_friends(nickName='Finn')[0] | |
# author.send('hi ,我正通过codelab的Scratch界面与你聊天!') | |
content = msg.text |
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
<html> | |
<head> | |
<title>video player</title> | |
</head> | |
<body onload="onload();"> | |
<video | |
id="idle_video" | |
onended="onVideoEnded();" | |
controls="controls" | |
></video> |
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
# python3 | |
''' | |
usage | |
1. download sb3 and unzip | |
* box2d_2_codelab_start.sb3 | |
* rename box2d_2_codelab_start.sb3 -> box2d_2_codelab_start.zip | |
* unzip it: -> box2d_2_codelab_start | |
2. Modify content | |
3. zip box2d_2_codelab_start |
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
# python3 | |
''' | |
Usage: | |
openssl req -new -x509 -keyout server.pem -out server.pem -days 365 -nodes | |
python3 simple_https_server.py | |
''' | |
import http.server, ssl | |
server_address = ('localhost', 8601) | |
httpd = http.server.HTTPServer(server_address, http.server.SimpleHTTPRequestHandler) |
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
anim_launch_cubediscovery | |
anim_slowpoke_loop_04 | |
anim_dancebeat_quit_01 | |
anim_observing_sides_area_01 | |
anim_message_deleted_short_01 | |
anim_fastbump_loop_01 | |
anim_hiking_driving_start_04 | |
anim_cubedocking_drive_loop_01 | |
anim_hiking_driving_start_03 | |
anim_launch_wakeup_startdriving_01 |
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
''' | |
Vector: | |
https://developer.anki.com/vector/docs/getstarted.html | |
https://github.com/anki/vector-python-sdk/blob/master/examples/tutorials/02_drive_square.py | |
todo: | |
内置 anki_vector, 是否可行? | |
''' | |
import time | |
import threading | |
from scratch3_adapter import settings |