转自:http://www.cnblogs.com/itech/archive/2012/01/06/2314454.html 1 编码 >>所有的 Python 脚本文件都应在文件头标上如下标识或其兼容格式的标识: # -*- coding:utf-8 -*- >>设置编辑器,默认新建或保存为ut...
分类:
编程语言 时间:
2014-06-18 10:54:57
阅读次数:
292
1 public class MergeWorkAssignment implements Comparable2 实现方法3 public int compareTo(MergeWorkAssignment o) {4 return this.getVocabularyName().compa.....
分类:
编程语言 时间:
2014-06-18 10:45:39
阅读次数:
253
package foo;import java.util.Arrays;public class Main { public static void selectionSort(int[] a, int len) { int in, out, min; fo...
分类:
其他好文 时间:
2014-06-18 10:31:17
阅读次数:
220
SQLmysql我们的MySQL使用latin1的默认字符集,也就是说,对汉字字段直接使用GBK内码的编码进行存储,当需要对一些有汉字的字段进行拼音排序时(特别涉及到类似于名字这样的字段时),默认无法通过order by关键字正确排序。经过网上查找,网上的办法大多是针对使用utf8字符集的数据库,主...
分类:
数据库 时间:
2014-06-18 10:01:58
阅读次数:
221
原地址:http://www.newsmth.net/nForum/#!article/Python/95860最近用到enumerate()函数,于是查了相关的资料。 其中的一篇是这样的:一般情况下,如果要对一个列表或者数组既要遍历索引又要遍历元素时,可以用enumerate比如:for inde...
分类:
编程语言 时间:
2014-06-18 09:59:20
阅读次数:
217
// Playground - noun: a place where people can playimport Cocoavar nums = Int[]()for _ in 1...50{ nums.append(random())}nums////冒泡排序/*var count = 0...
分类:
移动开发 时间:
2014-06-18 09:57:23
阅读次数:
303
最近做题目饱受打击,愈发觉得打好基础的重要性,于是乎,决心把基本的排序算法还有数组操作一一实现,目的在于一方面能够得到对JAVA基础的巩固,另一面在实现的过程中发现不足。 今天所实现的堆排序(最大堆)算法,最小堆大同小异。然后基于最大堆实现最大优先队列,最大优先队列可应用于作业调度,比如可将作...
分类:
编程语言 时间:
2014-06-18 09:52:16
阅读次数:
327
//1.先定义数组var cr_json = new Array();var s_arr_cr = '{ id: ' + hid_JobTicketID + ',fee:' + hid_CrossRegionFee + '}';var arr_cr = eval('(' + s_arr_cr + '...
分类:
Web程序 时间:
2014-06-18 09:48:20
阅读次数:
224
python中,import module会去sys.path搜索,sys.path是个列表,并且我们可以动态修改。要import某个目录的module,我们sys.path.insert(0,somedir)来加入搜索路径,就可以import了。既然这样,要import上一级目录的module,可...
分类:
其他好文 时间:
2014-06-18 09:37:57
阅读次数:
164
python模块——hashlibhashlib模块是对许多hash函数的一个公共接口new(name,string=‘‘)执行给定的hash函数来返回一个新的hash对象,使用给定的字符串数据初始化hash对象。如:>>>importhashlib
>>>hashlib.new(‘md5‘,string=‘abc‘).hexdigest()#hexdigest()..
分类:
编程语言 时间:
2014-06-17 18:11:38
阅读次数:
215