oracle 里面经常这样用select col1,col2..., row_number() over (partition by colx order by coly) from table_name;;这句话的意思是把表中的数值按照colx 分组,每一组内部按照coly排序,同时 row_nu...
分类:
数据库 时间:
2014-08-08 20:40:56
阅读次数:
307
看看以前的私密日志,原来自己之前被很多小而简单的问题困惑过!
看着那时候我们还是新手中的新手做的备忘笔记!
其实就是用了Oracle的统计函数而已!
以前的日记(看样子应该是以前公司的源码,呵呵……)如下:勿喷!
对多数据进行分组排序后取每组第一条记录:...
分类:
数据库 时间:
2014-08-08 16:05:06
阅读次数:
274
转自09年的blog,因为facebook在国内无法访问,故此摘录。The Photos application is one of Facebook’s most popular features. Up to date, users have uploaded over 15 billion p...
分类:
其他好文 时间:
2014-08-08 12:26:55
阅读次数:
374
Palindrome Partitioning IIGiven a strings, partitionssuch that every substring of the partition is a palindrome.Return the minimum cuts needed for a p...
分类:
其他好文 时间:
2014-08-07 21:54:30
阅读次数:
222
select sn, pname, srnum, rerepairtime, rn from ( select sn,pname, srnum, rerepairtime,row_number() over(partition by assetsid order by rer...
分类:
其他好文 时间:
2014-08-07 18:17:41
阅读次数:
216
采用算法导论上的实现方式,用java实现。快排算法核心的部分便是partition过程,这里的partition采取最后一个元素作为pivot,i和j两个指针都从头向后扫描,如下图所示,数组被分为4个部分。算法执行的过程:代码实现:import java.util.Arrays;public cla...
分类:
其他好文 时间:
2014-08-07 18:05:30
阅读次数:
196
Download AnacondaAnaconda is a completely free Python distribution (including for commercial use and redistribution). It includes over 195 of the most...
分类:
编程语言 时间:
2014-08-07 12:54:29
阅读次数:
241
In this article we will discuss how can we load jars residing over NFS in JBoss AS-7 classpath. In some development environment, when there are multip...
分类:
其他好文 时间:
2014-08-07 12:50:10
阅读次数:
323
Channel AllocationTime Limit:1000MSMemory Limit:10000KTotal Submissions:12143Accepted:6218DescriptionWhen a radio station is broadcasting over a very ...
分类:
其他好文 时间:
2014-08-07 12:02:00
阅读次数:
236
题目:输入n个整数,找出其中最小的k个数。
《剑指offer》给出了两种实现算法:
算法1:采用Partition加递归法,该算法可以说是快速排序和二分查找的有机结合。算法的时间复杂度为O(n),缺点在于在修改Partition的过程中会修改原数组的值。
算法2:采用top-k算法。如果要找最小的K个数,我们才用一个含有K个值的大顶堆;如果要找最大的K个数,我们采用小顶堆。该算法的时间复杂度为O(nlogK),是一种比较好的算法,启发于堆排序。...
分类:
其他好文 时间:
2014-08-06 23:04:12
阅读次数:
333