原题链接在这里:https://leetcode.com/problems/kth-largest-element-in-an-array/采用quickSelect 算法,找第k大等于找第num.length + 1 - k小,这里k是从0开始所以就是 找num.length-k小。findK就是...
分类:
其他 时间:
2015-10-29 06:07:02
收藏:
0 评论:
0 赞:
0 阅读:
222
问题描述:题目要求我们实现一个简单的加减计算器,计算一个表达式的值,表达式除了数字之外还可能会含有括号,加减符号以及空格。思路:其实看到这个题自然就会想到利用后缀式求表达式值的算法作业题,况且这个题还没有乘法除法运算,我就沿用了做算法作业题的思路来求解:1.由原表达式求出后缀式2.根据后缀式求值当然...
分类:
其他 时间:
2015-10-29 06:06:52
收藏:
0 评论:
0 赞:
0 阅读:
167
自己的一个需求需要对a.b.com 下的 /c 这个目录下,cookie d=e 才能访问,如果不是,就重定向到f.html 下面看代码。代码如下复制代码server{ server_name a.b.com;...location /c/{if ($http_cookie !~* "d=e(;.*...
分类:
其他 时间:
2015-10-29 06:06:42
收藏:
0 评论:
0 赞:
0 阅读:
118
package cn.edu.xidian.sselab;/*** title:Excel Sheet Column Number* content:* Related to question Excel Sheet Column Title* Given a column title as app...
分类:
其他 时间:
2015-10-29 06:06:02
收藏:
0 评论:
0 赞:
0 阅读:
183
一款nginx中给目录增加密码保护实现程序,可以有效的保护一些目录不被访问,有需要的朋友可参考一下。了防止一些可能出现存在漏洞的后台脚本暴露,使用验证的方式保护这些文件所在的目录使用apache的htpasswd工具生成密码yingouqlj@yingouqlj-laptop:~$ htpasswd...
分类:
其他 时间:
2015-10-29 06:05:42
收藏:
0 评论:
0 赞:
0 阅读:
284
Centos查看端口占用情况和开启端口命令
分类:
其他 时间:
2015-10-29 06:05:32
收藏:
0 评论:
0 赞:
0 阅读:
191
不管LoadLibraryA,LoadLibraryW,LoadLibraryExA,LoadLibraryExW,所以只要hook LoadLibraryExW就可以监视所有的dll加载。值得注意的是,win7 以上系统,LoadLibraryExW函数在KernelBase.dll中,kerne...
分类:
其他 时间:
2015-10-29 06:05:12
收藏:
0 评论:
0 赞:
0 阅读:
277
今天下午收到一条报警邮件ZABBIX-监控系统: ------------------------------------报警内容: Free disk space is less than 20% on volume /U01--------------------------...
分类:
其他 时间:
2015-10-29 02:14:13
收藏:
0 评论:
0 赞:
0 阅读:
1093
web.config
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<defaultDocument>
<files>
...
分类:
其他 时间:
2015-10-29 02:12:15
收藏:
0 评论:
0 赞:
0 阅读:
328
Given an array of integers, find out whether there are two distinct indices?i?and?j?in the array such that the difference between?nums[i]?and?nums[j]?is at most?t?and the difference between?i?and?j?i
分类:
其他 时间:
2015-10-29 02:10:27
收藏:
0 评论:
0 赞:
0 阅读:
280
Same?function:
?
Normal:
for(String tmp:userThird.keySet()){
? ? ? ? ? ? ? ? ? ? thirdInfo.add(userThird.get(tmp).getType());
}
Better:
for (Map.Entry<String, UserLogin> e : userThird.ent ...
分类:
其他 时间:
2015-10-29 02:08:22
收藏:
0 评论:
0 赞:
0 阅读:
342
开抢时间:10月24日0时~11月10日23:59
红包面额:1元、2元、5元、10元、20元、
分类:
其他 时间:
2015-10-29 02:07:07
收藏:
0 评论:
0 赞:
0 阅读:
326
过去 Twitter 针对第三方开发者们所作出的错误策略,可谓是犹如滔滔江水,连绵不绝。下面我们就给大家一一数来。
Twitter 的联合创始人兼新任首席? ...
分类:
其他 时间:
2015-10-29 02:05:27
收藏:
0 评论:
0 赞:
0 阅读:
425
分类:
其他 时间:
2015-10-29 02:01:17
收藏:
0 评论:
0 赞:
0 阅读:
260
1,版本是个很重要的问题 nutch上面有介绍和nutch配合使用的各框架的版本 2,下载hbase,放在opt/下 3,tar -zxvf hbase-* 4,更改conf 下的 hbase-site.xml文件 添加属性: <configuration> <property> <name>h...
分类:
其他 时间:
2015-10-29 01:00:33
收藏:
0 评论:
0 赞:
0 阅读:
369
最简单的是静态代理方法,即代理模式,这里就不多啰嗦了。。 重点说一下JDK的动态代理和Cglib的动态代理吧 先说JDK的,需要被代理的类需要有接口,否则无法实现 package?proxy.dynamic;
public?interface?IBo...
分类:
其他 时间:
2015-10-29 01:00:23
收藏:
0 评论:
0 赞:
0 阅读:
318
只要在初始化的的时候加上这一句就可以默认当天了:$("#id").datebox("setValue",$(‘#id‘).datebox(‘options‘).currentText);
分类:
其他 时间:
2015-10-29 00:58:43
收藏:
0 评论:
0 赞:
0 阅读:
256
linux文档查看命令有多重,不同的命令功能各异,有的功能比较全面,掌握其中用法尤其重要。1.cat命令#cat1.txtcat命令的优势是在文档比较短的情况下可以对文档进行正序快速查看,然而,一旦文档太长,查看就会比较吃力,没有各异的颜色区分,且没有查找等相关的功能。所以,在..
分类:
其他 时间:
2015-10-29 00:58:23
收藏:
0 评论:
0 赞:
0 阅读:
362
#include<stdio.h>#include<math.h>intfun(intn){inti=0;intk=sqrt(n);for(i=2;i<=k;i++){if(n%i==0){printf("NO!\n");break;}if((i==k)&&(n%i!=0))printf("YES!\n");}}intmain(){intm;printf("请输入一个数:");scanf_s("%d",&m);fun(m);system("p..
分类:
其他 时间:
2015-10-29 00:58:02
收藏:
0 评论:
0 赞:
0 阅读:
235
问题是把清单文件里面的<dataandroid:scheme="tencent*******"/>设置为tencent+appid,记得前面一定要加“tencent”,另外,appid得是在腾讯开放后台申请的代码里面如下:(BundlesavedInstanceState){
.onCreate(savedInstanceState)setContentView(R.layout.)initUi()in..
分类:
其他 时间:
2015-10-29 00:57:52
收藏:
0 评论:
0 赞:
0 阅读:
1076