- 博客(13)
- 资源 (4)
- 收藏
- 关注
原创 c++ int、char、double转string
#include #include #include using namespace std;int main() {stringstream ss;string str;int fuck = 123;ss ss >> str;cout return 0;}简单明了粗暴,转double等也是类似
2013-12-14 16:46:23 662
原创 python读取utf-8文件
在mac下python读取utf-8编码的txt文件,如果文件里有中文,直接输出的话会显示成乱码,也无法直接转成utf-8,所以必须想将其转成gbk,然后在转成utf-8# -*- coding: utf-8 -*-import osfilename = open(".txt")while True:s = filename.readline()if s
2013-12-13 20:18:25 3987
原创 pycurl字符编码方面的一些问题
python真的是一门很神奇的语言假设str1是utf-8的编码,str2是unicode的编码str = str1 + str2后,打印str的type,显示的是str但是在c.setopt(pycurl.URL,str)时则会报错,原因是str2并不是str,必须要进行转码.....
2013-12-12 22:09:57 1166
原创 pycurl post json data to php
利用pycurl把write到的data post给web,在网上找了很多,没有一个合适的,于是了解原理后自己手写了一个import osimport jsonimport pycurlimport StringIOss=StringIO.StringIO()s=StringIO.StringIO()url = "xxxxxxxxx" #需要抓取
2013-12-12 19:19:28 1862
转载 PycURL 网络编程
简单的PycURL例子import pycurlimport StringIO url = "http://www.google.com/"crl = pycurl.Curl()crl.setopt(pycurl.VERBOSE,1)crl.setopt(pycurl.FOLLOWLOCATION, 1)crl.setopt(pycurl.MAXREDIRS, 5)crl.
2013-12-11 20:42:00 793
原创 wxPython控件学习续
wxTextEntryDialog(wxWindow* parent, const wxString& message, const wxString& caption = "Please enter text", constwxString& defaultValue = "", long style = wxOK | wxCANCEL | wxCENTRE, const wxPoint
2013-12-10 21:25:12 728
原创 wxPython控件学习
wx.BoxSizer:1.构造函数 boxSizer = wx.BoxSizer(integer orient) orient可以是wx.VERTICAL or wx.HORIZONTAL2.向sizer里面增加一个控件。box.Add(wx.Window window, integer proportion=0, integer flag = 0, integer border = 0)
2013-12-09 23:13:04 2576
原创 安装第三方库出现 Python version 2.7 required, which was not found in the registry
import sys from _winreg import * # tweak as necessaryversion = sys.version[:3]installpath = sys.prefix regpath = "SOFTWARE\\Python\\Pythoncore\\%s\\" % (version)installkey = "Inst
2013-12-05 23:41:29 723
原创 wxpython编写的简单划线工具
import wxclass SketchWindow(wx.Window): def __init__(self, parent, ID): wx.Window.__init__(self, parent, ID) self.SetBackgroundColour("White") self.color = "Black
2013-12-05 23:35:29 1592
原创 sublime python的一些使用命令
package control : shift + command + psublime codeintel : jump to definition = control + click / control + command + alt + upgo back = control + command + alt + leftmanual code intelligence = c
2013-12-03 20:57:13 625
原创 windows下配置curl
1、去CURL的官网下载最新的CURL包2、用vs打开:curl-xxxxxx\vs\vc8\vc8curl.dsw3、分别在debug和release下进行编译,注意debug和release模式下生成的lib是有区别的4、添加curl文件:拷贝curl-xxxxxx\include\curl到你的工程目录下5、拷贝libcurl.lib到工程目录下,libcurl.lib是re
2013-12-03 20:53:29 864
转载 UTF8和GB2312编码转换
#include #include //UTF-8到GB2312的转换char* UTF8ToGB(const char* utf8){int len = MultiByteToWideChar(CP_UTF8, 0, utf8, -1, NULL, 0);wchar_t* wstr = new wchar_t[len+1];mem
2013-12-03 20:37:54 761
转载 前K条最短路径算法
[注:为了简便我这里只列出算法的步骤和伪代码,详细的数学证明请参见相关论文。C++代码的算法实现可以在我的sourceforge目录https://sourceforge.net/projects/ksp 下载使用。特别要指出的是葡萄牙教授Martins对此算法有深入研究,发表了为数众多的相关论文,我这里采用的也是基于他早期提出的deletion algorithm。Martins的Fortr
2013-12-01 12:22:20 6980
CTU Open Contest 2009
2010-10-29
2008 ACM ICPC South Central USA Regional Programming Contest
2010-10-29
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人