s********u 发帖数: 1783 | 1 【 以下文字转载自 Notice 讨论区 】
发信人: deliver (自动发信系统), 信区:
标 题: smallwoniu 封 dup 在 Piebridge
发信站: BBS 未名空间站自动发信系统 (Wed Nov 12 18:11:03 2008)
【此篇文章是由自动发信系统所张贴】
由于 dup 在 Piebridge 版的 发表不恰当文章 行为,
被暂时取消在本版的发文权力 1 天。
版主:smallwoniu
Wed Nov 12 18:10:43 2008 |
|
|
|
f********r 发帖数: 16 | 4 【 以下文字转载自 Linux 讨论区 】
【 原文由 flyinghair 所发表 】
in some software, when accept a connection and be ready to
read from or write to this socket, it will make a copy of
the file descriptor of this socket by dup(). Then this
copy will be used instead of the real( original) file descriptor.
What is the intention of this?
Sounds useless. |
|
n******g 发帖数: 17225 | 5 May reaches deal with DUP to form government after shock election result
https://www.theguardian.com/politics/2017/jun/09/theresa-may-reaches-deal-
with-dup-to-form-government-after-shock-election-result-northern-ireland
Theresa May has struck a deal with the Democratic Unionists that will allow
her to form a government, sources have confirmed.
The prime minister is expected to see the Queen at about 12.30pm on Friday
to confirm that a deal is in place.
It follows extensive talks with the DUP la... 阅读全帖 |
|
t*****w 发帖数: 254 | 6 answer is the following;
your final result is the following:
student teacher senior
2732 3465 1
3347 3837 1
1179 1693 1
3875 1711 1
3875 2059 1
2032 1784 1
2848 3921 1
2148 1416 1
3038 1434 1
3530 2037 1
2585 3811 1
1481 3954 1
... 阅读全帖 |
|
l*******0 发帖数: 63 | 7 A solution that could deal with dups. O(N^3).
public ArrayList> fourSum(int[] num, int target) {
int len=num.length;
Arrays.sort(num);
ArrayList> results=new ArrayList
Integer>>();
for(int i=0;i
if(i-1>=0&&num[i]==num[i-1]) continue; //skip dup in outmost
loop
for(int j=i+1;j
if(j-1>=i+1&&num[j]==num[j-1]) continue; //skip dup in 2nd
outmost loop
... 阅读全帖 |
|
f**********t 发帖数: 1001 | 8 // Given a dictionary of words, how can we efficiently find a pair words s.t
. they don't have characters in common and sum of their length is maximum?
size_t MaxLengthSumOfDistinctPairs(vector vs) {
vector char2str[26];
for (size_t i = 0; i < vs.size(); ++i) {
for (char c : vs[i]) {
char2str[c - 'a'].push_back(i);
}
}
size_t res = 0;
for (size_t i = 0; i < vs.size(); ++i) {
unordered_set dups;
for (char c : vs[i]) {
for (size_t k : char... 阅读全帖 |
|
N*D 发帖数: 3641 | 9 use XOR
int dup = a[0];
for (int i=1; i<=N; i++) {
dup = dup ^ i ^ a[i];
}
return dup; |
|
L*******e 发帖数: 114 | 10 可不可以用vector + small map variables, like the following:
/* assume range 'from' ... 'to' */
void findDupTri(int a[], size_t size, int from, int to, int& dup, int& trip)
{
vector v( to-from+1, false);
map small;
for( int i = 0; i < size; i++ ){
if( v[a[i]-from] == true ) {
small[a[i]]++;
}
else{
v[a[i]-from] = true;
}
}
// scan the map to find dup and trip
if ( small.size() != 2 ) //error
... 阅读全帖 |
|
P***t 发帖数: 1006 | 11 正好写了个Program比较了一下,再加上你的HASHSET:
Sort used time (ms): 1182
HashMap Used time (ms): 2959
HashSet Used time (ms): 3583
import java.io.Console;
import java.util.Arrays;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Set;
public class LongestConsecSequence {
public int longestConsecutive(int[] a) {
return v1(a);
}
public int v1(int[] in) {
int[] a = new int[in.length];
System.arraycopy(in, 0, a, 0, in.length);
if (a.length == 0)
return 0;
Arrays... 阅读全帖 |
|
p*****2 发帖数: 21240 | 12 我觉得下边的代码更公平一些。
Sort used time (ms): 4657
HashMap Used time (ms): 1696
HashSet Used time (ms): 2433
public class test {
public int v1(Integer[] in) {
Integer[] a = new Integer[in.length];
System.arraycopy(in, 0, a, 0, in.length);
if (a.length == 0)
return 0;
Arrays.sort(a);
int ret = 1;
int start = 0;
int dup = 0;
for (int i = 1; i < a.length; i++) {
if (a[i] == a[i - 1] + 1) {
ret = Math.max(ret, i - start - dup + 1);
} else if (a[i] ... 阅读全帖 |
|
p*****2 发帖数: 21240 | 13
代码都给你。你跑一个看看。
import java.io.Console;
import java.util.Arrays;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Random;
import java.util.Set;
public class test {
public int v1(Integer[] in) {
Integer[] a = in;
//System.arraycopy(in, 0, a, 0, in.length);
if (a.length == 0)
return 0;
Arrays.sort(a);
int ret = 1;
int start = 0;
int dup = 0;
for (int i = 1; i < a.length; i++) {
if (a[i] == a[i - 1] + 1) {
ret = Math.max(ret... 阅读全帖 |
|
c******t 发帖数: 391 | 14 How about this one? Is this O(NlogN) solution?
#include
#include
using namespace std;
void finddup(int arr[], int length){
hash_map hm;
cout<
for(int i=0; i
hm[arr[i]]++;
}
hash_map::iterator it;
int dup=0;
for(int i=0; i
it=hm.find(arr[i]);
if(it->second>1){
dup=it->first;
cout<
}
}
cout<
}
void main(){... 阅读全帖 |
|
L*********r 发帖数: 9 | 15 For your reference.
public Character findFirstCharAppearingOnlyOnce(String s) {
Set dups = new HashSet();
Set uniques = new LinkedHashSet();
for ( Character c : s.toCharArray() ) {
if ( !dups.contains( c ) ) {
if ( uniques.contains( c ) ) {
uniques.remove( c );
dups.add( c );
} else
uniques.add( c );
}
... 阅读全帖 |
|
w**u 发帖数: 311 | 16 转自http://bbs.sutta.org/forum.php?mod=viewthread&tid=5712#lastpost
舍离的含义 (孙南达禅师开示)
巴利文 Nekkhamma 的意思是舍离或不执着。真正的含义是舍弃taṇhā(贪爱)。
当一个人的贪爱变得很强,他就会抓紧一个目标,执着不想放下。
在巴利文,贪爱是taṇhā,执着是upādāna。因此 Nekkhamma 舍离或放下跟贪
爱,执着是相反的。 Nekkhamma 舍离也是其中一项巴拉蜜 pāramī。
有四种 Nekkhamma
一 Kāmupādāna 欲乐取
二 Diṭṭhupādāna 见解取
三 Sīlabbatupādāna 戒禁取
四 Attavādupādāna 我见取
一 Kāmupādāna 欲乐取
欲乐取的意思是执着于感官的享受。这kāmupādāna是 kāma(感官享受的对象/感官
目标)和upādāna(取)。这些感官目标也被称为kāmaguṇa因为他们给予感官上
的欲 乐。因此kāmupādāna是强烈的贪取感官目标。
如... 阅读全帖 |
|
g***l 发帖数: 18555 | 17 还有,前面一个说的是ETL进去,去DUP,好像不是真正的DUP,不同环境ETL,首先要把
数据原封不动的LOAD进去,然后在一个系统做各种CHECK,DE-DUP,一步一步的走,异源
ETL要保证快,原封不动保证完整性,要不然人家问起来,我的数据怎么少了,你在哪
一步给扔的,你找不出来,人家就对你的DW持怀疑态度,分析出来的东西也没啥意义。 |
|
n****t 发帖数: 182 | 18 Why not use data step?
proc sql;
select col1, col2, count(*) as count, 'N' as dup from a group by col1,
col2 having count=1
union select distinct col1, col2, count(*) as count, '
N' as dup from a group by col1, col2 having count>1
union select col1, col2, count(*) as count, 'Y'
as dup from a group by col1, col2 having count>1; |
|
发帖数: 1 | 19 林忌
作为民主政制发源地的英国,其选举制度最刺激的元素,一就是单议席单票制,即胜者
全取的制度,既有利于大党,亦可以令少量选票差异造成结果差天共地,二就是政府有
权解散国会再选,虽然这方面自2011年后,因为新立法把国会定为任期5年,如要解散
国会大选,则必须得到国会三分之二同意,但今次却因为脱欧公投后,各党派都不敢对
大选说不,于是出现了这次峰回路转的选举。
当英国首相文翠珊于四月十八日宣布解散国会大选时,执政保守党在民意调查之中,领
先排第二大在野工党21%-24%的支持,这数据在其他国家的选举,几乎可断定绝无翻盘
机会,保守党应可赢出下议院650 席中的400席,达到文翠珊增强其领导地位,以至加
强与欧盟谈判角色的目标;然而在短短的一个多月的选举工程之中,文翠珊却“能人所
不能”,把领先优势由最高的24%,跌至几乎倒输,虽然保住第一大党的地位,苏格兰
得到斩获,却输掉更多议席,一来一回倒输13席,由原本的331席跌至318席,更严重的
是失去了国会半数,至今仍要寄望能凭北爱尔兰民主联合党(DUP)10席,去组织联合
政府,或得到其支持来组织少数政府;然而DUP即可以此制约保守党的... 阅读全帖 |
|
h*********y 发帖数: 49 | 20 First, get how many unique elements in the set (say M) and how many dup for
each.
Then, for selecting k element, in i-th (0<=i
of elements from M whose dup number >0.
If i==k, then count++.
But I am not sure if there is an analytical solution. |
|
S*******n 发帖数: 1867 | 21 C# code 如下下
调用如下:
static void Main(string[] args)
{
int[] A = { 1, 2, 3, 4, 5, 6, 7, 8,8 };
int dup = FindDuplicateByBS(A, 0, A.Count() - 1);
Console.WriteLine(dup);
Console.ReadKey();
}
public static int FindDuplicateByBS(int[] IntArray, int p, int q)
{
//Assume the array has non negative numbers.
if (p == q)
{
return -1;
}
if (p == q - 1)
{
if (IntArray[p] == IntArray[q])
{
return IntArray[p];
}
else
{
return -1;
}
} |
|
m**q 发帖数: 189 | 22 题目中说明了,index是 0~n-1,value是1~n-1,
所以a[0]的值一定在1~n-1,你说的情况不会出现。
不过这是这道题的一个很强的限制条件。如果value
的范围是0~n-1,那么检查cycle的方法不能用于
解这题,因为会有local cycle的情况,无法保证
找到cycle,就像你说的
index 0 1 2 3 4
value 4 2 2 3 0
dup是2,但是check cycle只能检查到0,4构成的环,
无法找到2这个dup。只是这道题目对取值的限制
保证了这种情况不会发生。 |
|
n*******w 发帖数: 687 | 23 sort的代价有点大,O(nlgn )。
比较常规考虑,hashmap其中小的那个string list并且remove dups。然后把大的merge
进来。
如果考虑到hashmap可能overflow,换ties。还不够的话,先用hash function把
string list split到小文件上,然后再用hashmap来remove dups。最后直接合并成大
文件。
进一步,如果容许小概率出错,可以上bloom filter。 |
|
l*****a 发帖数: 14598 | 24 obviously, it just doesn't support dup
once there is dup, u need a full scan |
|
s******n 发帖数: 20 | 25 XOR有下列性质:
XOR is associative, so (x ^ y) ^ z = x ^ (y ^ z)
XOR is commutative: x ^ y = y ^ x
XOR is its own inverse: x ^ y = 0 if x = y
XOR has zero as an identity: x ^ 0 = x
所以 ans = (0-n)^(0-n)^dup = dup |
|
s*******n 发帖数: 305 | 26
我理解的还不够透彻,我trace一下,i+1,好像不对。
{1,1,2,3,4} = 4;
个人觉得要理解上面所提到的, 不要去考虑下标了。
XOR有下列性质:
XOR is associative, so (x ^ y) ^ z = x ^ (y ^ z)
XOR is commutative: x ^ y = y ^ x
XOR is its own inverse: x ^ y = 0 if x = y
XOR has zero as an identity: x ^ 0 = x
所以 ans = (0-n)^(0-n)^dup = dup |
|
A*********c 发帖数: 430 | 27 dup很多为什么有问题呢?不管有没有dup每次不都是搜索空间减半吗? |
|
b********r 发帖数: 620 | 28 to deal with dup numbers, can we add a count to each number in the queue,
stack? every time when peek is called, check the value against the queue end
and/or stack top, then if dup just increase the number count by 1.
N2) |
|
b********r 发帖数: 620 | 29 to deal with dup numbers, can we add a count to each number in the queue,
stack? every time when peek is called, check the value against the queue end
and/or stack top, then if dup just increase the number count by 1.
N2) |
|
p*****e 发帖数: 537 | 30 我是用swap 来做permutation这个题的,但是如果input是有dup的,那么output也可能
会有dup。大家帮我看看问题出在哪儿?
vector> permutationHelper(vector& data, int start){
vector> rt;
if (start == data.size()-1) {
rt.push_back(data);
return rt;
}
for (int i=start; i
if (i != start && data[i] == data[start]) continue;
if (i > start && data[i] == data[i-1]) continue;
vector set = data;
swap(set, start, i);
vecto... 阅读全帖 |
|
a*********4 发帖数: 7 | 31 来自主题: JobHunting版 - 一道面试题 nodeset will remove dups, but that won't really impact the result. as long
as there's one copy of the presented nodes in the set, it will serve the
purpose of prevent dupe when comparing two sets. the result is stored in the
arraylist, which will maintain dup as is. |
|
a*********4 发帖数: 7 | 32 来自主题: JobHunting版 - 一道面试题 nodeset will remove dups, but that won't really impact the result. as long
as there's one copy of the presented nodes in the set, it will serve the
purpose of prevent dupe when comparing two sets. the result is stored in the
arraylist, which will maintain dup as is. |
|
l*****a 发帖数: 14598 | 33 sort by the length of those strings ,start from biggest
a[0] a[1] ... a[n-1]
check whether no dup between a[0]a[1] , if no dup, return
then check a[0]a[2].
then a[0]a[3] or a[1]a[2]...
put pair in a heap, eachtime popup the smallest, insert one/two new pairs...
worst case的复杂度比O(n2)大,但是考虑到能尽快得到结果,amortized复杂度是不是
还可以呢 |
|
x*z 发帖数: 381 | 34 【 以下文字转载自 JobHunting 讨论区 】
发信人: xxz (星星), 信区: JobHunting
标 题: 谁来帮我看看这是什么语言写的代码
发信站: BBS 未名空间站 (Mon Sep 7 22:02:21 2009, 美东)
program facesievers
!model of {$n=10} web spans
!web properties
constant ew=3.0e5 !Young's modulus, #/in
{dup 'constant lw1=\2\4.\0',$n}
!in-plane misalignment angle of rollers, radians
{dup 'constant th1i=\0.\0',$n} |
|
j*a 发帖数: 14423 | 35 来自主题: SanFrancisco版 - 说起猥琐 我感觉这么些年下来 银行开户有dup的越来越少
以前全是带dup的? |
|
l**********s 发帖数: 4363 | 36 昨晚折腾了一晚上,几乎把所有的soul都用光了,才给弄清楚。
首先,这个bug的原理是当你用龙头道具怒喷火龙弹的时候如果迅速把道具切换到下一
个可以无限duplicate你的下一个道具并且使用之,结束后该道具清零。所以这个bug不
仅仅可以用在soul的dup上,血瓶之类的也可以,当然这个没什么用,另外一个有用的
是dup人性,很轻松的就可以人性99了。
但是龙头喷射火龙弹是要消耗体力的,所以如果什么都不管直接用的话it works until
your stamina is drained,所以如果想要无限用他必须要装个恢复体力的道具。据说
是有两个道具可以的,但我现在确定的只有一个,就是一个叫covanthy ring的东西,
这个东西在the great hollow的树洞里可以拿到,拿的方法很triky,要从树干的路上
跳下去,还要保证跳的准,才不会掉下去。哥哥我昨天跳了无数次才干到。
所以,搞龙头的大概流程就是,先在blighttown底下进蜘蛛洞把蜘蛛干了,敲了第二个
铃铛。然后大家就是自由选择了。回到外边的沼泽,在另外一边有条路可以进大树,里
面有两面illusory w... 阅读全帖 |
|
t******g 发帖数: 17520 | 37 会不会像Borderlands那样复制?
dashbording?
不过这不是borderlands,
不过AH没有了, dup金子对系统没啥影响
但是武器dup的人估计要被办 |
|
b*e 发帖数: 3845 | 38 maybe this would be better
select count(*) as dup, columnA from myTable group by ColumnA
having dup>1 |
|
g***l 发帖数: 18555 | 39 1. extract a source relatively simple table(7-8 columns) to target.
这种工作量很难确定吧,如果SOURCE TABLE不干净,无KEY,DE-DUP KEY, DE-DUP
RECORDS,DATATYPE MISMATCH,这些都需要花时间去清理。垃圾进垃圾出的话,2分钟
就搞定了。 |
|
s**********o 发帖数: 14359 | 40 设计了新的DATABASE,整个都变了还MIRGRATE啥啊,
不是重新LOAD吗?所有的数据问题都会暴露,尤其是RECORD DUP,
KEY DUP,REFERENTIAL INTEGIRY,NOT NULL,UNIQUE,新的DATABASE未必
考虑的很周全,LOAD不进去,丢失数据都是有可能的,
一般是谁设计的谁LOAD,你少跟着掺和 |
|
a*******d 发帖数: 72 | 41 6-9 will generate dup ack of 5, upon receive 3 dup acks, 5 will be
retransmitted,
if 6-9 lost, 5 will be timeout, and 5 - 9 will be retransmitted.
TCP |
|
T*******n 发帖数: 493 | 42 EPS file, about 525 bytes, more spaces could be squeezed out.
Intersections of rings are painted over
instead of drawn with clipping paths.
%!PS-Adobe-3.0
%%BoundingBox: 0 0 160 80
/R { 0.816 0 0.141 } def
/G { 0 0.624 0.239 } def
/K { 0 0 0 } def
/Y { 0.957 0.765 0 } def
/C { 0 0.522 0.780 } def
/X {
9 7 roll exch dup 3 2 roll dup 3 1 roll
6 setlinewidth 18 9 7 roll arc 1 1 1 setrgbcolor stroke
4 setlinewidth 18 5 3 roll arc setrgbcolor stroke
} def
/O { -1 361 -1 361 X } def
/T { 237 268 |
|
q**c 发帖数: 3 | 43 a program about pipe, suppose a command:
ls -l | more
then use fork to create process for more, dup pipe[0] as
stdin, execv more
then use fork to create process for ls -l, dup pipe[1] as
stdout execv ls -l
wait at parent process
but even the process ls stopped, the process more is
still running, so when I type new command, it don't echo at
screen. Please help me to kill process more
thanks a lot!!! |
|
u*********1 发帖数: 2518 | 44 楼主,对于CNV,simply forget it
貌似只有DGV是比较靠谱的NIH-sponsor的数据库,但我从来不会用,也不知道怎么用。
你别说CNV-phenotype了,就连CNV本身就没啥靠谱的数据库。
或者说的更明白点,以目前的sequencing技术条件和后期数据处理,CNV
identification和validation几乎不可信。主要是sequencing reads太短,而CNV(包
括copy number variation,del,dup,inv,translocation等等)根本无法通过这么
短的reads被identify。。。其实别说CNV了,就连2bp的indel都很困难,因为比如
intron-exon boundary有时候会有一连串的TTTTTT,那么你要确定到底是多了两个T,
还是少了两个T,是很困难的。
1000 genome project目前有indel和large deletion的database。1000G最后present出
来的indel/deletion我是比较相信的,但问题是他们present出来的只是genome里... 阅读全帖 |
|
l****g 发帖数: 304 | 45 Thank you, Banzhu!
1. After i did a query, it gave me all the records, however, it only give
me some options to save the data including EXCEL, CSV, HTML, WORD, XML. How
can i use ODBC here? Or just someother where?
2. Great! I like SAS!
3. De-dup by member ID, dose that means I should creat a variable named
memeber ID, that i should use a some method to sign different name different
'memeber ID' value, then de-dup it ? |
|
w*******r 发帖数: 349 | 46 都给出non dup observation 的count
试验了一下,这个count (unique)好像更快,但是网上没有任何文章
不知道哪位了解这个 count (unique)
另外,最快得出non-dup index 的observation 是什么方法??
多谢 |
|
o***s 发帖数: 42149 | 47 13日,“刀锋战士”枪杀女友案再次开庭,进入量刑听证阶段。
南非著名残疾人运动员、被誉为“刀锋战士”的奥斯卡·皮斯托瑞斯(Oscar Pistorius)枪杀女友瑞瓦·斯滕坎普(Reeva Steenkamp)一案于本月13日再次开庭,法庭将对皮斯托瑞斯的量刑作出宣判。据加拿大《多伦多星报》14日报道,假释官、被告证人安妮特·沃吉尔(Annette Vergeer)在量刑听证会上表示,皮斯托瑞斯不应该被判入狱,因为他在狱中可能面临着被轮奸的风险,而且连轻松地洗个澡都做不到。
沃吉尔表示,由于皮斯托瑞斯比健全人更容易受到侵害,所以他不应该在监狱服刑。
沃吉尔说,“我最近处理了一起监狱内发生的强奸案,具体说是轮奸案。我们如何能够确定,皮斯托瑞斯不会面临这种风险呢?”早些时候,沃吉尔承认皮斯托瑞斯的辩护团队曾经付钱给她,以让她担任被告证人。
沃吉尔还说,“他可能面临这类情况,而且由于没有双腿,他远比正常人更容易受到侵害。另外,没有双腿该怎么洗澡呢?”
9月份,南非黑人女法官玛希帕(Thokozile Masipa)裁定,27岁的皮斯托瑞斯谋杀罪名不成立,过失杀人罪名成立。这一判决令很多南非人... 阅读全帖 |
|
L*****E 发帖数: 658 | 48 coldsteel - 马甲追踪
排名 疑似马甲 IP相似分 发贴版面相似分 总分
1 i50 0.570536288194 0.382192301133 1.00664544192
2 rainlion 0.518864200562 0.0267792860837 0.546653826293
3 two2 0.349900675443 0.240959022152 0.518524124652
4 leela 0.504779678545 0.0 0.504779678545
5 yobsdia 0.369480240936 0.171687815848 0.496350752067
6 wryoung 0.443086376552 0.0353817150131 0.474440688355
7 fatalme 0.362510415942 0.148875807221 0.47044847... 阅读全帖 |
|