Skip to content

Instantly share code, notes, and snippets.

View wwj718's full-sized avatar

wwj718

View GitHub Profile
@wwj718
wwj718 / FrozenJSON.py
Created August 6, 2019 04:20 — forked from bonfy/FrozenJSON.py
FrozenJSON in Fluent Python
"""
explore2.py: Script to explore the OSCON schedule feed
>>> from osconfeed import load
>>> raw_feed = load()
>>> feed = FrozenJSON(raw_feed)
>>> len(feed.Schedule.speakers)
357
>>> sorted(feed.Schedule.keys())
['conferences', 'events', 'speakers', 'venues']
@wwj718
wwj718 / BluetoothLowEnergy.py
Created September 29, 2018 06:38 — forked from StefanD986/BluetoothLowEnergy.py
QBluetooth Discovery Methods in pyqt
import PyQt5
from PyQt5 import QtCore
from PyQt5 import QtBluetooth
class DeviceFinder(QtCore.QObject):
def __init__(self):
super().__init__()
self.m_devices = []
备份镜像
查看sd卡的路径
df -h
备份镜像到磁盘
sudo dd if=/dev/树莓派设备地址 | gzip>/home/你的用户名/文件名.gz
例子
sudo dd if=/dev/disk2 | gzip > /Users/hidaris/rpi_opencv3_41_hass.gz
@wwj718
wwj718 / zeromq_demo_publisher.py
Last active March 16, 2018 04:46 — forked from ramn/zeromq_demo_publisher.py
Python ZeroMQ pub/sub example
'''
测试环境:
python3.6
pyzmq==17.0.0
'''
import time
import zmq
context = zmq.Context()
socket = context.socket(zmq.PUB)
socket.bind('tcp://127.0.0.1:2000')
@wwj718
wwj718 / understanding-word-vectors.ipynb
Created March 3, 2018 01:55 — forked from aparrish/understanding-word-vectors.ipynb
Understanding word vectors: A tutorial for "Reading and Writing Electronic Text," a class I teach at ITP. (Python 2.7) Code examples released under CC0 https://creativecommons.org/choose/zero/, other text released under CC BY 4.0 https://creativecommons.org/licenses/by/4.0/
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@wwj718
wwj718 / opencv_video_to_pygame.py
Created January 24, 2018 13:50 — forked from radames/opencv_video_to_pygame.py
OpenCV VideoCapture running on PyGame
import pygame
from pygame.locals import *
import cv2
import numpy as np
import sys
camera = cv2.VideoCapture(0)
pygame.init()
pygame.display.set_caption("OpenCV camera stream on Pygame")
screen = pygame.display.set_mode([1280,720])
@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()
@wwj718
wwj718 / 词性标记.md
Created August 5, 2016 09:50 — forked from luw2007/词性标记.md
词性标记: 包含 ICTPOS3.0词性标记集、ICTCLAS 汉语词性标注集、jieba 字典中出现的词性、simhash 中可以忽略的部分词性

词的分类

  • 实词:名词、动词、形容词、状态词、区别词、数词、量词、代词
  • 虚词:副词、介词、连词、助词、拟声词、叹词。

ICTPOS3.0词性标记集

n 名词

nr 人名

@wwj718
wwj718 / cx_oracle.md
Created July 11, 2016 09:02 — forked from kimus/cx_oracle.md
Installing python cx_oracle on Ubuntu

First of all, it just seems like doing anything with Oracle is obnoxiously painful for no good reason. It's the nature of the beast I suppose. cx_oracle is a python module that allows you to connect to an Oracle Database and issue queries, inserts, updates..usual jazz.

Linux

Step 1:

sudo apt-get install build-essential unzip python-dev libaio-dev

Step 2. Click here to download the appropriate zip files required for this. You'll need:

@wwj718
wwj718 / gist:b3a72e03a63b000c4b0c
Created November 5, 2015 05:53 — forked from jubos/gist:2409369
s3cmd config for Fake S3
[default]
access_key = asf
bucket_location = US
cloudfront_host = cloudfront.amazonaws.com
cloudfront_resource = /2010-07-15/distribution
default_mime_type = binary/octet-stream
delete_removed = False
dry_run = False
encoding = UTF-8
encrypt = False