- you
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 | |
import sys | |
import os | |
import unicodedata | |
for name in sys.argv[1:]: | |
try: | |
new_name = unicodedata.normalize("NFC", name.decode('utf8')) | |
new_name = new_name.encode('latin-1').decode('gbk') |
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 | |
import string | |
import re | |
import sys | |
def get_gbk(value): | |
result = '' | |
for i in value: | |
result = result + chr(ord(i)) |
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 | |
# Author: Zigang Xiao <iveney # gmail.com> | |
# Date : 07/12/2011 | |
"""A python utility (wrapper for mutagen.m4a) to udpate tags for m4a file type. | |
Relies on m4a module in mutagen. | |
""" | |
from mutagen.m4a import M4A |
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
var ctx; | |
var width; | |
var height; | |
var length; | |
var pline; | |
var MAX_LEVEL = 8; | |
var level; | |
function init() { | |
canvas = document.getElementById('tutorial'); |
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/local/include/boost/graph/random.hpp: In function ‘void boost::detail::randomize_property(G&, RandomGenerator&, Property, boost::edge_property_tag) [with Property = boost::edge_bundle_t, G = boost::adjacency_list<boost::setS, boost::vecS, boost::undirectedS, boost::no_property, EdgeProperty, boost::no_property, boost::listS>, RandomGenerator = boost::random::linear_congruential<int, 48271, 0, 2147483647, 399268537>]’: | |
/usr/local/include/boost/graph/random.hpp:255: instantiated from ‘void boost::randomize_property(G&, RandomGenerator&) [with Property = boost::edge_bundle_t, G = Graph, RandomGenerator = boost::minstd_rand]’ | |
random_graph.cpp:34: instantiated from here | |
/usr/local/include/boost/graph/random.hpp:247: error: no match for ‘operator=’ in ‘pm. boost::adj_list_edge_property_map<Directed, Value, Ref, Vertex, Property, Tag>::operator[] [with Directed = boost::undirected_tag, Value = EdgeProperty, Ref = EdgeProperty&, Vertex = long unsigned int, Property = boost::property<boost::edge_bundle_t, Edg |
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
enum label{A,B,C,D,E,N}; // N is exactly the size | |
char * desc="ABCDE" | |
vector<int> v(N); | |
// do sth. | |
cout << desc[A] << "'s value is " << v[A] << endl; |
NewerOlder