汇编是直接跟硬件打交道的, 于是在学习汇编的同时,不经意间就了解到计算机的工作原理。
这是饭前开胃菜,作者从什么是电流开始,讲加法器、数字逻辑、触发器、CPU 原理、外设等,是计算机(硬件)组成原理的科普向轻松读物
I use PlantUML a lot. It's what I use for drawing all sorts of diagrams and it's handy because of its easy markup (once you get used to it) while making things easy to maintain as projects grow (thanks to version control)
This gist explains how I do my PlantUML workspace in a project.
globals
directory for all diagrams to follow (like the "stylesheet" below) to keep things consistent.stylesheet.iuml
file that keeps the use of colors consistent through use of basic FOREGROUND, BACKGROUND and ACCENT colors.style-presets.iuml
file defines these colors so you can make "presets" or "themes" out of them.stylesheet.iuml
, you'll need the Roboto Condensed and Inconsolata fonts for these to work properly.example-sequence.puml
for example: https://imgur.com/Klk3w2F# coding: utf-8 | |
from math import sqrt | |
import jieba.analyse | |
def cut_word(content): | |
''' | |
(u'\u65b9\u5e84', 2.4582479479) | |
(u'\u82b3\u57ce\u56ed', 1.19547675029) | |
(u'\u53ef\u6708\u4ed8', 1.19547675029) |
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
import sys, re | |
import requests | |
import Queue | |
import threading | |
class Proxy(): | |
def __init__(self, proxy_url, target_url, ver_keyword, timeout): |
/** | |
* 百度坐标(BD09)、国测局坐标(火星坐标,GCJ02)、和WGS84坐标系之间的转换的工具 | |
* | |
* 参考 https://github.com/wandergis/coordtransform 实现的Java版本 | |
* @author geosmart | |
*/ | |
public class CoordinateTransformUtil { | |
static double x_pi = 3.14159265358979324 * 3000.0 / 180.0; | |
// π | |
static double pi = 3.1415926535897932384626; |
This is a quick-and-dirty guide to setting up a Raspberry Pi as a "router on a stick" to PrivateInternetAccess VPN.
Install Raspbian Jessie (2016-05-27-raspbian-jessie.img
) to your Pi's sdcard.
Use the Raspberry Pi Configuration tool or sudo raspi-config
to:
# -*- coding: utf-8 -*- | |
import logging | |
logger = logging.getLogger(__name__) | |
import time | |
import six | |
from twisted.internet import defer, threads | |
from scrapy.pipelines.files import FSFilesStore, S3FilesStore |
#include <sys/socket.h> | |
#include <sys/ioctl.h> | |
#include <sys/kern_event.h> | |
#include <stdio.h> | |
#include <stdint.h> | |
#include <stdbool.h> | |
#include <stdlib.h> | |
#include <assert.h> | |
#include <string.h> | |
#include <net/ethernet.h> |
/// Observes a run loop to detect any stalling or blocking that occurs. | |
/// | |
/// This class is thread-safe. | |
@interface GHRunLoopWatchdog : NSObject | |
/// Initializes the receiver to watch the specified run loop, using a default | |
/// stalling threshold. | |
- (id)initWithRunLoop:(CFRunLoopRef)runLoop; | |
/// Initializes the receiver to detect when the specified run loop blocks for |