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 io | |
import socket | |
import struct | |
#u should do this: | |
# pip install --upgrade pip | |
# pip install image | |
from PIL import Image | |
# NOTICE: | |
# The server script should be run first (don't run in pi)· | |
# to ensure there’s a listening socket ready to accept a connection from the client script |
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 io | |
import socket | |
import struct | |
import time | |
import picamera | |
from PIL import Image | |
import cv2 | |
import numpy as np | |
def photographToFile(): |
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
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
# look this: http://picamera.readthedocs.io/en/release-1.2/recipes1.html | |
import io | |
import os | |
import sys | |
import random | |
import time | |
import struct |
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 subprocess | |
# Start a socket listening for connections on 0.0.0.0:8000 (0.0.0.0 means | |
# all interfaces) | |
server_socket = socket.socket() | |
server_socket.bind(('0.0.0.0', 8000)) | |
server_socket.listen(0) | |
# Accept a single connection and make a file-like object out of it |
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
// Name: spinlockvsmutex1.cpp | |
//http://www.parallellabs.com/2010/01/31/pthreads-programming-spin-lock-vs-mutex-performance-analysis/ | |
// Source: http://www.alexonlinux.com/pthread-mutex-vs-pthread-spinlock | |
// Compiler(spin lock version): g++ -o spin_version -DUSE_SPINLOCK spinlockvsmutex1.cpp -lpthread | |
// Compiler(mutex version): g++ -o mutex_version spinlockvsmutex1.cpp -lpthread | |
#include <stdio.h> | |
#include <unistd.h> | |
#include <sys/syscall.h> | |
#include <errno.h> | |
#include <sys/time.h> |
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
//Name: spinvsmutex2.c | |
//http://www.parallellabs.com/2010/01/31/pthreads-programming-spin-lock-vs-mutex-performance-analysis/ | |
//Source: http://www.solarisinternals.com/wiki/index.php/DTrace_Topics_Locks | |
//Compile(spin lock version): gcc -o spin -DUSE_SPINLOCK spinvsmutex2.c -lpthread | |
//Compile(mutex version): gcc -o mutex spinvsmutex2.c -lpthread | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <pthread.h> | |
#include <sys/syscall.h> |
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
#!/bin/bash | |
mkdir -p ~/.vim/{ftdetect,indent,syntax} | |
for d in ftdetect indent syntax ; do | |
curl -o ~/.vim/$d/scala.vim https://raw.githubusercontent.com/gchen/scala.vim/master/scala.vim | |
done |
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
package main | |
import ( | |
"context" | |
"errors" | |
"fmt" | |
"log" | |
"sync" | |
"time" |
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
show engines; | |
show databases; | |
drop database pay; | |
create database pay ; | |
use pay; | |
drop table `pay`.`user_asset`; | |
CREATE TABLE `user_asset` | |
( | |
`userId` bigint unsigned NOT NULL DEFAULT '0', | |
`assetCn` bigint unsigned NOT NULL DEFAULT '0', |
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
// ¥¥¥ show me the money ¥¥¥ | |
// author: weedge | |
// desc: redis change asset tx demo | |
package main | |
import ( | |
"context" | |
"encoding/json" | |
"errors" | |
"fmt" |
OlderNewer