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 the target, whe...
分类:
其他好文 时间:
2014-06-09 23:14:45
阅读次数:
264
适配器模式:将一个类的接口转换成客户希望的另外一个接口。Adapter模式使得原本由于接口不兼容而不能一起工作的那些类可以在一起工作。
组成:
目标接口(Target):客户所期待的接口。目标可以是具体的或抽象的类,也可以是接口。
需要适配的类(Adaptee):需要适配的类或适配者类。
适配器(Adapter):通过包装一个需要适配的对象,把原接口转换成目标接口。
适配器模式分为...
分类:
其他好文 时间:
2014-06-08 18:04:13
阅读次数:
263
在测试sqoop语句的时候,一定要限制记录数量,否则就像我刚才,等了1个多小时,才看到测试结果。????sqoop-import --options-file media_options.txt --table my_table --where "ID = 2" --target-dir /user/jenkins/bigdata/import/20140607 -m 1 --fields-ter...
分类:
其他好文 时间:
2014-06-08 04:57:18
阅读次数:
350
题目 :Input: numbers={2, 7, 11, 15}, target=9
Output: index1=1, index2=2
解题思路:
给出一个数组合一个数,如果两个数的和等于所给的数,求出该两个数所在数组中的位置。
这个题也挺常见的,就是两个指针,从前后两个方向扫描。但是本题有以下几个需要的点:
1. 所给数组不是有序的;
2. 返回的下标是从1开始的,并且是原来无序数组中的下标;
3. 输入数组中可能含有重复的元素。
好了,把以上三点想到的话,做这个题应该不会有啥问题。
具体方法:把原...
分类:
其他好文 时间:
2014-06-08 02:14:06
阅读次数:
250
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 the target, whe...
分类:
其他好文 时间:
2014-06-08 02:12:04
阅读次数:
216
先上图,说明一下我主要想实现什么功能。一、演示图 演示首页:
演示内容页(包括按钮切换页+模板内容页): 演示首页到演示内容页的一个演变过程: 二、代码 演示首页代码: ...
分类:
其他好文 时间:
2014-06-08 02:09:32
阅读次数:
263
Suppose a sorted array is rotated at some pivot
unknown to you beforehand.(i.e.,0 1 2 4 5 6 7might become4 5 6 7 0 1 2).You are
given a target value t...
分类:
其他好文 时间:
2014-06-08 02:05:43
阅读次数:
311
JDK1.7能用,cmd下输入java,javac,java
-version,javaw配置和环境都没问题的话,有可能是工作空间的问题,就是一般在D盘下的workspace..那个文件夹,删除了,再打开eclipse。换了工作空间之后,有的项目重新导入有时会出现“Jar
mismatch! Fix...
分类:
移动开发 时间:
2014-06-08 00:40:17
阅读次数:
352
由于JIT的优化在调试Release版本程序集往往没有足够的跟踪信息,比如查看clrstack发现PARAMETERS:=
状态。在程序运行目录下创建一个[程序集名称].ini文件,比如:MyLibrary.dll => MyLibrary.ini。[.NET
Framework Debugging...
分类:
Web程序 时间:
2014-06-07 22:04:32
阅读次数:
232
1. 将开源项目的.xcodeproj拖入项目frameworks2. Build Phases下
Links Binary With Libraries 引入.a文件。Target Dependencies里引入开源项目文件3. Build
Setting下的 Search Paths 里 Hea...
分类:
移动开发 时间:
2014-06-07 20:06:34
阅读次数:
287