GitHub supports several lightweight markup languages for documentation; the most popular ones (generally, not just at GitHub) are Markdown and reStructuredText. Markdown is sometimes considered easier to use, and is often preferred when the purpose is simply to generate HTML. On the other hand, reStructuredText is more extensible and powerful, with native support (not just embedded HTML) for tables, as well as things like automatic generation of tables of contents.
binlog_list = list() | |
for i in xrange(20): | |
# 使用zfill补全0 | |
binlog = 'mysql-bin.' + str(i).zfill(6) | |
binlog_list.append(binlog) |
def tail( f, lines=20 ): | |
total_lines_wanted = lines | |
BLOCK_SIZE = 1024 | |
f.seek(0, 2) | |
block_end_byte = f.tell() | |
lines_to_go = total_lines_wanted | |
block_number = -1 | |
blocks = [] # blocks of size BLOCK_SIZE, in reverse order starting | |
# from the end of the file |
string='My string'; | |
if [[ $string == *My* ]] | |
then | |
echo "It's there!"; | |
fi |
#!/usr/bin/env python2 | |
# Quick and dirty demonstration of CVE-2014-0160 by Jared Stafford (jspenguin@jspenguin.org) | |
# The author disclaims copyright to this source code. | |
import sys | |
import struct | |
import socket | |
import time | |
import select |
##Introduction SMP is an acronym for “Symmetric Multi-Processor”. It describes a design in which two or more identical CPU cores share access to main memory. Until a few years ago, all Android devices were UP (Uni-Processor).
Most — if not all — Android devices do have multiple CPUs, but generally one of them is used to run applications while others manage various bits of device hardware (for example, the radio). The CPUs may have different architectures, and the programs running on them can’t use main memory to communicate with each other.
Most Android devices sold today are built around SMP designs, making things a bit more complicated for software developers. The sorts of race conditions you might encounter in a multi-threaded program are much worse on SMP when two or more of your threads are running simultaneously on different cores. What’s more, SMP on ARM is more challenging to work with than SMP on x86. Code that has been thoroughly tested on x86 may break badly on ARM.
The rest of this document wil
reference:https://help.ubuntu.com/community/EncryptedFilesystemsOnRemovableStorage
sudo cryptsetup --verify-passphrase luksFormat /dev/sdb1 -c aes -s 256 -h sha256
sudo cryptsetup luksOpen /dev/sdb1 mountable_partition
sudo mkfs -t ext4 /dev/mapper/mountable_partition
sudo mount /dev/mapper/mountable_partition /mnt/point
所有的程序、代码都要考虑国际化问题!否则就会遇到乱码的情况。mysql默认的编码都是latin1
,因此如果在配置mysql、建库等操作使用默认的话,乱码问题必然会遇到。
编码设置的几个地方:
my.cnf
- mysql client连接
- sqlalchemy连接数据库
- create database/table时指定编码
mysql可用的collation
: show collation
credit:http://stackoverflow.com/a/62680
class Foo(object):
#...