Skip to content

Instantly share code, notes, and snippets.

Avatar

wwj718

View GitHub Profile
@wwj718
wwj718 / FrozenJSON.py
Created Aug 6, 2019 — forked from bonfy/FrozenJSON.py
FrozenJSON in Fluent Python
View FrozenJSON.py
"""
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 Sep 29, 2018 — forked from StefanD986/BluetoothLowEnergy.py
QBluetooth Discovery Methods in pyqt
View BluetoothLowEnergy.py
import PyQt5
from PyQt5 import QtCore
from PyQt5 import QtBluetooth
class DeviceFinder(QtCore.QObject):
def __init__(self):
super().__init__()
self.m_devices = []
View gist:5323267a3f4347683024d5348d8b4f82
备份镜像
查看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 Mar 16, 2018 — forked from ramn/zeromq_demo_publisher.py
Python ZeroMQ pub/sub example
View zeromq_demo_publisher.py
'''
测试环境:
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 Mar 3, 2018 — 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/
View understanding-word-vectors.ipynb
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 Jan 24, 2018 — forked from radames/opencv_video_to_pygame.py
OpenCV VideoCapture running on PyGame
View opencv_video_to_pygame.py
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 Mar 24, 2017 — forked from marvin/client.py
simple python client/server socket binary stream
View client.py
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 Aug 5, 2016 — forked from luw2007/词性标记.md
词性标记: 包含 ICTPOS3.0词性标记集、ICTCLAS 汉语词性标注集、jieba 字典中出现的词性、simhash 中可以忽略的部分词性
View 词性标记.md

词的分类

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

ICTPOS3.0词性标记集

n 名词
	nr 人名
@wwj718
wwj718 / cx_oracle.md
Created Jul 11, 2016 — forked from kimus/cx_oracle.md
Installing python cx_oracle on Ubuntu
View cx_oracle.md

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 Nov 5, 2015 — forked from jubos/gist:2409369
s3cmd config for Fake S3
View gist:b3a72e03a63b000c4b0c
[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
You can’t perform that action at this time.