Pat1063代码
题目描述:
Given two sets of integers, the similarity of the sets is defined to be Nc/Nt*100%, where Nc is the number of distinct common numbers shared by the two sets,
and Nt is the to...
分类:
其他好文 时间:
2014-04-29 13:44:20
阅读次数:
325
Mrs Little likes digits most of all. Every year she tries to make the best number of the year. She tries to become more and more intelligent and every year studies a new digit. And the number she make...
分类:
其他好文 时间:
2014-04-29 13:13:21
阅读次数:
309
paip.输入法编程--英文ati化By音标原理与中文atiEn处理流程 python 代码为例
#---目标
1. en vs enPHati
2.en vs enPhAtiSmp
3.cn vs enPHati
4. cn vs enPhAtiSmp
#两个方法,一个获得enPhAtied代码,一个获得哪的smp版本..
def convert2atiEnPnNo...
分类:
编程语言 时间:
2014-04-28 10:47:43
阅读次数:
360
paip.性能跟踪profile原理与架构与本质-- python扫带java php
##背景
弄个个输入法音标转换atiEnPH工具,老是python性能不的上K,7k记录浏览过k要30分钟了.
##目标
分析一个程序的性能,最终都归结为回答4个基本的问题:
程序运行速度有多快?
运行速度瓶颈在哪儿?
程序使用了多少内存?
内存泄露...
分类:
编程语言 时间:
2014-04-28 10:46:41
阅读次数:
334
paip.元数据驱动的转换-读取文件行到个list理念 uapi java php python总结
#两个思路
1.思路如下:使用file_get_contents()获取txt文件的内容,然后通过explode()把获得的字符串转化为数组。获得数组长度可以使用count()函数
2.使用按照行读取api
在正则表达式中,有一个\n是newline的意思,又有一个\r是carri...
分类:
编程语言 时间:
2014-04-28 10:46:40
阅读次数:
304
6.2 Python作用域和命名空间
在介绍类之前,首先我想告诉你一些关于python作用域的规则。类的定义非常巧妙地运用了命名空间,你需要知道范围和命名空间的工作原理以能全面了解接下来发生的。 顺便说一下,关于这节讲到的知识对于任何优秀的python程序员非常有用。
让我们开始以一些定义开始。
命名空间(namespace)是一个从名称到对象的映射。大多命名空间目前用Python字典实现的...
分类:
编程语言 时间:
2014-04-28 10:31:42
阅读次数:
309
paip.utf-8,unicode编码的本质输出unicode文件原理 python
#别的语言,java php都是unicode,走十python不一样.
#enddef
#todo write to unicode encode
fileHandle = open ( r"c:\fmtSmpEnRst.txt", 'w',encoding="UTF-16"...
分类:
编程语言 时间:
2014-04-28 10:28:42
阅读次数:
374
直接上存储过程、函数
--执行不带参数但带返回值的存储过程
CREATE OR REPLACE PROCEDURE proc_getUserCount(v_totalCount OUT NUMBER) AS
BEGIN
SELECT COUNT(*) INTO v_totalCount FROM vote_user;
END;
--测试不带参数但带返回值的存储过程
DECLARE
v_t...
分类:
其他好文 时间:
2014-04-28 10:25:43
阅读次数:
461
paip.python3 的类使用跟python2 的不同之处
#------python3的写法而且使用..
#class syllable(BaseClassA, BaseClassB):
class syllable():
i = 123 # 类成员
##todox selft.xxx is err,tips selef is not def
c...
分类:
编程语言 时间:
2014-04-28 10:24:40
阅读次数:
284
paip.日志中文编码原理问题本质解决python
默认的python日志编码仅仅gbk...保存utf8字符错误..输出到个eric5的控制台十默认好像十unicode的,要是有没显示出来的字符,大概十字体问题..调整eric5的字体走ok兰.
#调用封装
from log import *
iniLog (r"c:\enPn2atiEnPh.log")
logx...
分类:
编程语言 时间:
2014-04-28 10:17:40
阅读次数:
395