码迷,mamicode.com
首页 >  
搜索关键字:list add    ( 89211个结果
List<Map<String, String>> 转 Map<String, List<String>>
将List转成Map结构,以下为没有水平的写法! 好久之前写的土方法转换,不知道有没有优秀的解法,还希望大家提供! Map map1 = new HashMap(); map1.put("a", "1"); map1.put("b", "3"); map1.put("c", "5"); Map map2 = new HashMap();...
分类:其他好文   时间:2014-05-07 08:35:55    阅读次数:292
笨方法学python(6)加分题--列表与字典的区别
这篇对应的是习题39 字典, 可爱的字典 #encoding:utf-8 #列表与字典的区别 #列表 thing = ['name',1,'age','AD','sex'] print thing[1] #print thing['name'] #会报错,列表只能通过整数去访问:TypeError: list indices must be integers, not str stuff...
分类:编程语言   时间:2014-05-07 06:00:20    阅读次数:365
【Leetcode】Two Sum
[Question] Given an array of integers, find two numbers such that they add up to a specific target number. The function twoSum should return indices of the two numbers such that they add up to t...
分类:其他好文   时间:2014-05-07 05:37:44    阅读次数:278
emacs中eshell的快捷键配制
eshell是emacs shell的简称,是emacs自带的shell.开始设置的时候还在想是否要找到它的key map (eshell-mode-map?). 原来它是采用hook设置,如下所示 (add-hook 'eshell-mode-hook (lambda () (local-set-key (kbd "C-j") 'switch-to...
分类:其他好文   时间:2014-05-07 05:25:39    阅读次数:253
Python中的循环技术
简单谈谈 Python 中容器的遍历和一下小技巧。 1、遍历单个容器      下面代码遍历一个 List 结构,同样适用于 Tuple、Set 结构类型 >>> x = [1, 2, 3, 'p' , 'y'] >>> for v in x: ...     print(x) ... 1 2 3 p y      遍历字典 Dict 结构也是...
分类:编程语言   时间:2014-05-07 04:12:39    阅读次数:395
java中一个memcached案例
下面先来一个网络上的案例,这个案例比较简单,直接在类中进行一些参数的配置,具体代码如下: package com.wzpmt;     import java.util.ArrayList;  import java.util.Date;  import java.util.List;     import com.danga.MemCached.MemCachedClient;  impo...
分类:编程语言   时间:2014-05-07 03:57:53    阅读次数:510
用Java求字符串数组的的交集和并集
package com.array; import java.util.ArrayList; import java.util.HashMap; import java.util.HashSet; import java.util.Iterator; import java.util.List; import java.util.Map; import java.util.Set; import...
分类:编程语言   时间:2014-05-07 03:45:11    阅读次数:365
leetcode -day8 Copy List with Random Pointer & Single Number I II
五一中间断了几天,开始继续。。。 1、 ?? Copy List with Random Pointer A linked list is given such that each node contains an additional random pointer which could point to any node in the list or null. Return a...
分类:其他好文   时间:2014-05-06 18:54:59    阅读次数:386
选择子数据,默认存储父数据 的校验方法
如下图:选择了子数据,默认选中父级数据,数据库中会存储两条数据为使脚本通用性更好,不写死两级,可将数据放到List里处理,代码如下: String companyName = null; companyName = "测试公司1.1"; stepInfo("校验数据"); DBU...
分类:其他好文   时间:2014-05-06 18:14:09    阅读次数:282
ubuntu 下安装nodejs以及pm2
ubuntu12.04服务器可以使用apt-get方式安装NodeJS,但是,安装完后的版本为v0.6.12的版本,如果我们想要使用新一点的版本需要做如下配置:apt-getinstallpython-software-properties apt-add-repositoryppa:chris-lea/node.js apt-getupdate apt-getinstallnodejs安装完成后可以..
分类:Web程序   时间:2014-05-06 16:45:52    阅读次数:378
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!