tml 全称 Testing Markup Language,是用于存储单元测试中变量的文本文件。格式简单
目前仅支持以下几种字段数据类型
- int
- string
| package sqlsplit | |
| import ( | |
| "strings" | |
| "unicode/utf8" | |
| ) | |
| type SplitConfig struct { | |
| Dialect string | |
| StripSemicolon bool |
| #coding=utf-8 | |
| import struct, StringIO | |
| import urllib2 | |
| """Wrap a file handle to allow seeks back to the beginning | |
| Sometimes data coming from a socket or other input file handle isn't | |
| what it was supposed to be. For example, suppose you are reading from | |
| a buggy server which is supposed to return an XML stream but can also | |
| return an unformatted error message. (This often happens because the |
| #!/bin/bash | |
| function make_tmp_file() | |
| { | |
| local name=${1:-"rand"} | |
| local magic=`date +%s` | |
| echo "/tmp/__${magic}__${name}" | |
| } | |
| function make_rand_file() |
| #encoding=utf-8 | |
| #!/usr/bin/python | |
| import os, sys | |
| import operator | |
| import math | |
| img_path = sys.argv[1] | |
| img_dir = sys.argv[2] | |
| dest_imgs = [] |
| echo off | |
| :LOOP | |
| set index=%1 | |
| if %index%! == ! goto END | |
| rem | |
| echo %index% | |
| ren %index% *.jpg | |
| shift |
| #!/bin/bash | |
| user=root | |
| password=rootpassword | |
| database=testdb | |
| tables=$(echo "show tables" | mysql -u$user -p$password $database) | |
| for table in $tables; | |
| do |
| #!/bin/bash | |
| # run image-shadow myimage.png to add a shadow to the image | |
| # or run image-shadow myimage.png 6x6 to add a shadow and 6 pixel border | |
| image-shadow () { | |
| out=${1%.*}-shadow.${1#*.} | |
| in=$1 | |
| echo "Converted file : $out" | |
| if [ ! -z $2 ] ; then | |
| convert $in -frame $2 $out |
| #!/usr/bin/env python | |
| # -*- coding: utf-8 -*- | |
| """ | |
| Monkey Patch for tornado | |
| """ | |
| import cProfile as profile | |
| from tornado.options import options | |
| from tornado.web import HTTPError |