Skip to content

Instantly share code, notes, and snippets.

View wwj718's full-sized avatar

wwj718

View GitHub Profile
#!/usr/bin/env python
# encoding: utf-8
# 或者用这个 http://debugo.com/apscheduler/
import threading
import time
import schedule
class Task(threading.Thread):
# 作为整个类 类本身是线程
# 时间
@wwj718
wwj718 / client.py
Created March 24, 2017 11:37 — forked from marvin/client.py
simple python client/server socket binary stream
import socket
HOST = 'localhost'
PORT = 9876
ADDR = (HOST,PORT)
BUFSIZE = 4096
videofile = "videos/royalty-free_footage_wien_18_640x360.mp4"
bytes = open(videofile).read()
/*
http "http://pwnote.paperweekly.site/api/search?_separate_replies=true&limit=200&offset=0&order=asc&sort=created&uri=https://arxiv.org/pdf/1703.00573.pdf" "Authorization:Bearer 6879-XqkNxdWgJ_HQ1AN9OjiA_c7WWmgUvfnhtWIROKFYCZk"
HTTP/1.1 200 OK
Access-Control-Allow-Origin: *
Connection: keep-alive
Content-Length: 2854
Content-Type: application/json; charset=UTF-8
Date: Wed, 29 Mar 2017 13:49:34 GMT
ETag: "UMUfVM/pkH5Ct3NYwKwXIA"
Referrer-Policy: origin-when-cross-origin
@wwj718
wwj718 / websocketd_test.html
Last active March 30, 2017 03:34
信息管道,把任何本地程序映射为websocket
<!DOCTYPE html>
<head></head>
<body>
<pre id="log"></pre>
<script>
// helper function: log message to screen
function log(msg) {
document.getElementById('log').textContent += msg + '\n';
}
// setup websocket with callbacks
#!/usr/bin/env python
# encoding: utf-8
import os
import datetime
import shutil
from shutil import copytree, ignore_patterns
from shutil import copyfile
import time
#!/usr/bin/env python
# encoding: utf-8
#!/usr/bin/env python3
import subprocess
import time
import shutil
#--
#!/usr/bin/env python
# encoding: utf-8
from ws4py.client.threadedclient import WebSocketClient
class DummyClient(WebSocketClient):
def opened(self):
#这里发射
self.send("wwj")
#!/usr/bin/env python
# encoding: utf-8
import os
import datetime
import shutil
from shutil import copytree, ignore_patterns
from shutil import copyfile
import time
import subprocess
import hashlib
#!/usr/bin/env python3
# NOTE: this example requires PyAudio because it uses the Microphone class
import speech_recognition as sr
# obtain audio from the microphone
r = sr.Recognizer()
with sr.Microphone() as source:
print("Say something!")
//chrome中
//朗读
var utterThis = new window.SpeechSynthesisUtterance('你好,世界!');
window.speechSynthesis.speak(utterThis);
//识别
var newRecognition = new webkitSpeechRecognition();
//newRecognition.continuous = false;
newRecognition.onresult = function(event) {