1、List和Set 在实际开发中,需要将使用的对象存储于特定数据结构的容器中。JDK提供了这样的容器-集合(Collection)。 Collection是一个接口,定义了集合的相关的操纵方法,有两个子接口:List与Set List:可重复集 Set:不可重复集 元素是否重复,取决于元...
分类:
其他好文 时间:
2015-06-10 07:41:02
阅读次数:
147
semctl semget semop 函数系列构成的 信号量linux服务器编程信号量原语简介信号量是由 Dijkstra 提出的解决多进程沟通和并发编程问题的特殊变量,这种变量只能取自然数,而且只支持两种操作: wait & signal 。它主要处理多个进程访问资源的问题,通过生成并使用令牌来...
分类:
其他好文 时间:
2015-06-10 07:37:54
阅读次数:
168
具体可查看以下网址本文只做简单概述以及前端IOS的使用http://www.ruanyifeng.com/blog/2011/09/restful.htmlhttp://www.cnblogs.com/artech/p/restful-web-api-02.html一、RESTful 特点(1)资源...
分类:
其他好文 时间:
2015-06-10 07:38:51
阅读次数:
97
■延伸阅读 Further Reading ? 好了,现在你已具备了基础知识和一些先进的概念感。在这一点上,我建议你到涉水我的源代码。该软件包包含两个版本,一个是C ++的,一个是Blitz Basic的。两个版本都大量注释,应该...
分类:
其他好文 时间:
2015-06-10 06:38:04
阅读次数:
286
电子备忘录
1 系统的基本功能
利用电子备忘录记录未来某时间内的待办事宜。允许查询、添加。
2 要求
(1)备忘信息的保存方式自己设定,尽量保证操作灵活。一条备忘信息最多允许100个汉字。备忘信息的时间设置可以精确到具体的某个日期、或者某个日期中的某个时间段、或者某个日期中的某个具体时间。可以对事件的重复出现进行设置,如每月10号取工资,6月16号到28号每天上午9:10考试等。
(2)...
分类:
其他好文 时间:
2015-06-10 06:36:46
阅读次数:
118
使用Gifsicle可以批量将过个独立的gif文件合并或者生成gif格式的图像。从http://www.lcdf.org/gifsicle/可以下载适用于各种平台的Gifsicle的软件包。比如,在Ubuntu 64bit环境下,可以下载https://packages.debian.org/sid/amd64/gifsicle/download链接的deb包。然后使用dpkg -i xxxx.d...
分类:
其他好文 时间:
2015-06-10 06:35:45
阅读次数:
149
leetcode 223: Rectangle Area
java c++ python...
分类:
其他好文 时间:
2015-06-10 06:36:53
阅读次数:
113
首先我们有一个概念,那就是“同源准则",也就是same-origin policy,它要求一个网站(协议+主机+端口号)来确定的脚本、XMLHttpRequest和Websocket无权去访问另一个网站的内容。
如果设置不正确,它通常会报错如下:No 'Access-Control-Allow-Origin' header is present on the requested re...
分类:
其他好文 时间:
2015-06-10 06:36:14
阅读次数:
121
最近需要批量将PNM格式的文件转换成GIF文件。我尝试了如下的图像转换工具:
ImageBatch:完全免费,但仅仅支持PNG JPEG BMP GIF四种格式
OfficeConverter:在线转换软件,支持所有图像格式的相互转换,大量处理图像时需要支付一定费用,否则效率很低
Pixillion:支持所有格式,试用版仅仅最多支持5个文件为一组batch的处理,使用100次以后...
分类:
其他好文 时间:
2015-06-10 06:36:14
阅读次数:
126
简单题IGiven a binary tree and a sum, determine if the tree has a root-to-leaf path such that adding up all the values along the path equals the given su...
分类:
其他好文 时间:
2015-06-10 06:33:31
阅读次数:
101
题意:思路:#include#include#include#include#includeusing namespace std;int a[200];int dp1[1000+10];int dp2[1000+10];int main(){ int t,n; int i,j,k; ...
分类:
其他好文 时间:
2015-06-10 06:35:11
阅读次数:
125
Given an array where elements are sorted in ascending order, convert it to a height balanced BST.题解完全抄自ref的说明,感谢!“题解:先复习下什么是二叉搜索树(引自Wikipedia):二叉查找树(B...
分类:
其他好文 时间:
2015-06-10 06:33:38
阅读次数:
112
超简洁的代码本来考虑是不是真的要每个点求一个maxDepth,看来是的哟public class Solution { public boolean isBalanced(TreeNode root) { if (root==null) return true; i...
分类:
其他好文 时间:
2015-06-10 06:35:56
阅读次数:
88
就recursive做,简单题public class Solution { public int minDepth(TreeNode root) { if(root==null) return 0; if (root.left==null && root.righ...
分类:
其他好文 时间:
2015-06-10 06:35:28
阅读次数:
138
leetcode中有几道题使用同一个思路,大致是先维护一个窗口,每次只移动窗口左侧或者右侧的边界,然后针对这个窗口内的元素进行处理。这种方式使用两个指针,可以将问题的运行时间降到O(n)内。Longest Substring Without Repeating Characters:https://...
分类:
其他好文 时间:
2015-06-10 06:34:45
阅读次数:
412
题意:思路:#include#include#include#include#include#include#include#include#includeusing namespace std;struct Work{ __int64 c,d;};Work work[100000+10];i...
分类:
其他好文 时间:
2015-06-10 06:32:28
阅读次数:
119
Given a binary tree, find its maximum depth.The maximum depth is the number of nodes along the longest path from the root node down to the farthest le...
分类:
其他好文 时间:
2015-06-10 06:33:56
阅读次数:
99