ChinaUnix.net
相关文章推荐:

list control排序

这里主要是用sort方法对list中的数据进行排序。如果list中元素是tuple这样的类型,则按照tuple里面元素的位置的先后来排序。 代码如下: #coding:utf-8 l = [ (3,'a','john'), (2,'c','allen'), (3,'a','mike'), (6,'b','eddie'), (2,'b','susan') ] print l l.sort() print l 运行结果如下: C:\>python test.py [(3, 'a', 'john'), (2, 'c', 'allen'), (3, 'a', 'mike'), (6, 'b', 'eddie'), (2, 'b', 'susan')] [(2, 'b...

by pgt112you - Python文档中心 - 2009-10-25 18:04:06 阅读(2207) 回复(0)

相关讨论

1: list中包含的对象(TaskVO),实现接口Comparator import java.io.Serializable; import java.util.Comparator; import com.comtop.product.scheme.planitem.PlanItemConstants; import com.comtop.product.scheme.planitem.util.PlanItemUtil; public class TaskVO implements Serializable,Comparator { /** 地点名称 */ private String placeName; /** 工作内容 */ private String workContent; /** 电...

by kingkongII - Java文档中心 - 2009-03-18 18:14:51 阅读(964) 回复(0)

/一个POJO例子 class User { String name; String age; public User(String name,String age){ this.name=name; this.age=age; } public String getAge() { return age; } public void setAge(String age) { this.age = age; } public String getName() { return name; } public void setName(String name) { this.name = name; } } //具体的比较类,实现Comparator接口 import java.util.Comparato...

by 心如止水_00 - Java文档中心 - 2012-10-24 13:54:48 阅读(1534) 回复(0)

我有如下list: a = [[0, 'aaa'], [7, 'bbb'], [ 5, 'ccc']] 我如何多里面的数值进行排序? 也就是按0, 7, 5排序。 谢谢

by cs221313 - Python - 2009-06-04 15:27:49 阅读(2922) 回复(3)

//java list 排序 //关键词: java list 排序 //主要用到: Collections.sort方法: package com.tom.compare; import java.util.Arraylist; import java.util.Collections; import java.util.Comparator; import java.util.list; public class CompareClient { /** * @param args */ public static void main(String[] args) { // TODO Auto-generated method stub Li...

by qbq - Java文档中心 - 2008-07-30 09:55:13 阅读(968) 回复(0)

/** ############################################################################# # DESCRIBE 关于给Vector,Arraylist和Linkedlist特定list集合排序的方法 # AUTHOR 悠~游 # DATE 2006-7-12 # COMPANY FLX # PORJECT JAVA ############################################################################# */ import java.io.PrintStream; import java.text.CollationKey; import java.text.Collator; import java.util.Arr...

by ozy518 - Java文档中心 - 2007-06-15 17:40:25 阅读(821) 回复(0)

HashTable(MAP) 和Arraylistlist)是类,它们分別是继承了集合中Collection接口的MAP接口和list接口(原创). 首先来用一下关于HashMap的demo如下 public class C { public void test(){ Hashtable table=new Hashtable(); table.put("one",new Integer(1)); table.put("two",new Integer(2)); Integer a=(Integer) table.get("one"); Integer b=(Integer) table.get("two"); int count=table.size(); System....

by jeantian - Java文档中心 - 2006-11-15 17:29:24 阅读(752) 回复(0)

不用看我的了,看它 http://bbs.chinaunix.net/viewthread.php?tid=926041&extra=page%3D1 [ 本帖最后由 alvis 于 2007-4-19 16:17 编辑 ]

by alvis - 服务器应用 - 2007-04-17 09:43:59 阅读(2906) 回复(2)

ACL(Access control list) 访问控制列表 是一种功能比传统UGO更为强大的权限控制机制。可以针对任意指定的用户/组分配RWX权限。 现在主流的商业Unix系统都支持ACL,FreeBSD也提供了对ACL的支持,Linux 2.6内核配合EXT2/EXT3, JFS, XFS, ReiserFS等文件系统都是可以支持ACL的。 1)在mount中添加acl option使分区支持acl操作,如: mount -o rw,acl /dev/sda1 /home 一般写进/etc/fstab LABEL=/home /home ext3 default...

by unix.root - Linux文档专区 - 2006-11-23 00:03:47 阅读(624) 回复(0)

Access control list(ACL) 符号:+ getfacl filenames setfacl –m(modify) acl_entries setfacl –s(replace) acl_entries setfacl –d(delete) acl_entries acl_entries: u[ser]::perm – Sets the permissions for the file owner. g[roup]::perm– Sets the permissions for the owner’s group. o[ther]:perm – Sets the permissions for users other than the owner or members of the owner’s group. ...

by hrcxf - Solaris - 2003-03-31 22:40:40 阅读(930) 回复(2)

Access control list(ACL) 符号:+ getfacl filenames setfacl –m(modify) acl_entries setfacl –s(replace) acl_entries setfacl –d(delete) acl_entries acl_entries: u[ser]::perm – Sets the permissions for the file owner. g[roup]::perm– Sets the permissions for the owner’s group. o[ther]:perm – Sets the permissions for users other than the owner or members of the owner’s group. ...

by hrcxf - Solaris - 2003-03-29 18:02:16 阅读(2719) 回复(1)