版本:Ubuntu 14.04 LTS 默认语言:English(United States)
Debian 和 Ubuntu 下对中文支持比较好的字体有: fonts-droid、ttf-wqy-zenhei 和 ttf-wqy-microhei 等,除了文泉驿系列字体外,比较流行的免费中文字体还有文鼎提供的楷体和上海宋,包名分别是: fonts-arphic-ukai 和 fonts-arphic-uming。
| # In case you had some strange python installation | |
| # NOTE: .pydistutils.cfg seems to be not compatible with brew install python | |
| # areas I needed to clean before installation | |
| # clean up ~/Library/Python | |
| # clean up .local | |
| # preconditions: | |
| # xcode with command line tools installed | |
| xcode-select --install |
| public abstract class AbstractCameraFragment extends MDFragment implements UnexpectedTerminationHelper.OnCrashListener, SurfaceHolder.Callback, Camera.AutoFocusCallback { | |
| protected Camera camera; | |
| private boolean previewRunning, cameraReleased, focusAreaSupported, meteringAreaSupported; | |
| private UnexpectedTerminationHelper terminationHelper; | |
| private int focusAreaSize; | |
| private FocusSound focusSound; | |
| private Matrix matrix; | |
| protected ResultListener resultListener; |
| # 本文件存放在project目录下。 | |
| RELEASE_STORE_FILE={path to your keystore} | |
| RELEASE_STORE_PASSWORD=***** | |
| RELEASE_KEY_ALIAS=***** | |
| RELEASE_KEY_PASSWORD=***** |
| ###################################################################### | |
| # CURRENT AWARE LOCAL DATETIME | |
| ###################################################################### | |
| from datetime import datetime | |
| from tzlocal import get_localzone | |
| local_tz = get_localzone() | |
| local_dt = datetime.now(local_tz) |
| # -*- coding: utf-8 -*- | |
| import httplib | |
| import sys | |
| import mimetypes | |
| import os | |
| CHUNKSIZE = 65563 | |
| url="http://127.0.0.1:8090/" | |
| conn = httplib.HTTPConnection("127.0.0.1", 8090) |
| import socket | |
| import fcntl | |
| import struct | |
| def get_ip_address(ifname): | |
| s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) | |
| return socket.inet_ntoa(fcntl.ioctl( | |
| s.fileno(), | |
| 0x8915, # SIOCGIFADDR | |
| struct.pack('256s', ifname[:15]) | |
| )[20:24]) |
This gist is part of a blog post. Check it out at:
http://jasonrudolph.com/blog/2011/08/09/programming-achievements-how-to-level-up-as-a-developer
| #ifndef THE2SIN18_QUEUE_H | |
| #define THE2SIN18_QUEUE_H | |
| #ifndef CACHELINE_SIZE | |
| #define CACHELINE_SIZE 64 | |
| #endif | |
| #ifndef NON_ALIGNED | |
| #define ALIGNED __attribute__((aligned(CACHELINE_SIZE))) | |
| #endif |
| use strict; | |
| use warnings FATAL => 'all'; | |
| use Getopt::Long; | |
| my ( | |
| $command, $ssh_user, $orig_master_host, $orig_master_ip, | |
| $orig_master_port, $new_master_host, $new_master_ip, $new_master_port | |
| ); |