- 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
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; |
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
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/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
#!/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 | |
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
iveney@iveney-mbp:~$ # find the IP of dapenti.com | |
iveney@iveney-mbp:~$ dig dapenti.com | |
; <<>> DiG 9.7.3-P3 <<>> dapenti.com | |
;; global options: +cmd | |
;; Got answer: | |
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 30857 | |
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0 | |
;; QUESTION SECTION: |
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
""" | |
Fit a curve using polynomial order of n, | |
where n is the number of data points | |
""" | |
from scipy import * | |
from scipy.optimize import curve_fit | |
import matplotlib.pyplot as plt | |
#xs = array([1.0, 2.0, 3.0, 4.0, 5.0, 6.0]) |
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
<?php | |
$ip = $argv[1]; | |
$tags = get_meta_tags("http://www.geobytes.com/IpLocator.htm?GetLocation&template=php3.txt&IpAddress=$argv[1]"); | |
print "{$tags['city']}, {$tags['region']}, {$tags['country']}"; | |
?> |
OlderNewer