public class ThreadSafeHashMap extends HashMap {
private final ReentrantReadWriteLock readWriteLock = new
ReentrantReadWriteLock();
private final Lock read = readWriteLock.readLock();
private final Lock write = readWriteLock.writeLock();
public ThreadSafeHashMap(){
super();
}
@Override
public V put(K key, V value) {
write.lock();
try {
super.put(key,value);
} finally {
write.unlock();
}
... 阅读全帖
看到有的网友对这个概念比较糊涂 我把我写的代码放上来大家看看 都挺简单的
如何开拓一个新thread 和它的driver程序
package jc;
import java.util.*;
public class NewThreadOne extends Thread {
LinkedList myLinkedList = new LinkedList();
// Optional: a constructor which contains this.start()
// if there is no constructor or there is no this.start(), then have to
manually threadName.start()
//Must override run(): inside run() can put a flag which can stop the
thread
@Override
public void run(){
myLinkedList.add... 阅读全帖
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.SortedSet;
import java.util.TreeSet;
public class EPI_15_1 {
static class Rect {
public int lft;
public int rgt;
public int height;
public Rect(int l, int r, int h) {
lft = l;
rgt = r;
height = h;
}
}
import java.util.concurrent.ArrayBlockingQueue;
import java.util.concurrent.atomic.AtomicInteger;
public class H2O {
//using blocking queue, so it's easy to just have 2 h and 1 o at most,
//other threads will be blocked.
ArrayBlockingQueue
Q:Give a array of integers, remove all the duplicate.
我首先说sort array,然后比较当前和next,如果一样,就in place override当前,
最后array 就shrink到没有duplicate的了。面试官说sort too expensive.
接着,我说用map,如果insert过了,就 remove,他说hash expensive。
接着,我说用set,当insert int 到set 里有conflict stl会catch到,然后in place
override duplicate,面试官说set 还是用的hash,expensive,有可能collision,
hash不一定O(1)time complexity.
好像面试官一定要求不能extra time cost, space没有明确限制。
请问板上大神怎么破?
接下来,他又说,假如给你的array里面都是string呢?又怎么解?
Aube by Honeywell TI033/U 7-Day Programmable Timer Switch, White http://www.amazon.com/Aube-Honeywell-TI033-Programmable-Switch/dp/B000F3ZR8C/ref=cm_cr_pr_product_top
I was looking for a timer to control my outdoor lighting. I was first drawn
to this product because of the name Honeywell, which is well known quality
proven name in the PLC (Programmable Logic Controller) business. So if
Honeywell could make such a great PLC, then their timers should be par
excellence. It turned out that some rese... 阅读全帖
写是那样写的,有人汇报说过不去,要override
-----------
The $15 coupon didn't apply automatically for me; it only subtracted $0.01
or $0. The cashier manually entered $15 off and got manager override
加钱没用。 non.negotiable restriction for 90 days buying. 不想等就把钱转出去换
别的的吧
You will be restricted from making day trades for 90 days in the instances
listed below. However, if you feel you must execute a sell order, you can
override these restrictions by calling our trade desk and speaking with a
broker. Please exercise discretion when overriding these restrictions
because doing so will result in a non-negotiable 90 day restriction from
buying stock.
How a Bill Becomes Law?
There are potentially 10 steps a bill can go through before becoming a law.
Below is a description of each step in the process, using the Genetic
Information Non-Discrimination Act of 2003 (S. 1053), as an example.
Step 1: A Bill Is Born
Anyone may draft a bill; however, only members of Congress can introduce
legislation, and, by doing so, become the sponsor(s). The president, a
member of the cabinet or the head of a federal agency can also propose
legislation, although a... 阅读全帖
H.R.3012
Latest Title: Fairness for High-Skilled Immigrants Act
Sponsor: Rep Chaffetz, Jason [UT-3] (introduced 9/22/2011)
Related Bills: S.1857
Latest Major Action: 11/18/2011 Placed on the Union Calendar, Calendar No.
193.
House Reports: 112-292
--------------------------------------------
Cosponsors (11)
Rep Flake, Jeff [AZ-6] - 11/18/2011
Rep Goodlatte, Bob [VA-6] - 11/4/2011
Rep Griffin, Tim [AR-2] - 10/11/2011
Rep Gutierrez, Luis V. [IL-4] - 11/4/2011
Rep Holt, Rush D. [NJ-12] - 10/31... 阅读全帖
☆─────────────────────────────────────☆
Helsinki (跑步然后桑拿) 于 h 提到:
How a Bill Becomes Law?
There are potentially 10 steps a bill can go through before becoming a law.
Below is a description of each step in the process, using the Genetic
Information Non-Discrimination Act of 2003 (S. 1053), as an example.
Step 1: A Bill Is Born
Anyone may draft a bill; however, only members of Congress can introduce
legislation, and, by doing so, become the sponsor(s). The president, a
member of the cabinet o... 阅读全帖
更新一下,我的最后入境日期在H-1B批准之后,我问公司的律师说我入境时的F-1 I-94
会不会override那个在H-1B Approval Notice上的I-94,给我的答复是:
No, it does not override the I-94 on the H-1B since the H-1B I-94 only
begins on 10/01/2015.
不过还是谢谢楼上各位提供的信息
Why Chinese Mothers Are Superior
Can a regimen of no playdates, no TV, no computer games and hours of music
practice create happy kids? And what happens when they fight back? http://online.wsj.com/article/SB1000142405274870411150457605971
By AMY CHUA
Amy Chua with her daughters, Louisa and Sophia, at their home in New Haven,
Conn.
A lot of people wonder how Chinese parents raise such stereotypically
successful kids. They wonder what these parents do to produce so many math
whizzes and music prod... 阅读全帖
Wa, 當她的小孩很辛苦阿 Their preferences are often overrided; their fun is
based on hard work rather than play. 這是什麼樣的童年阿 呵呵
"What Chinese parents understand is that nothing is fun until you're good at
it. To get good at anything you have to work, and children on their own
never want to work, which is why it is crucial to override their preferences
."
Why Chinese Mothers Are Superior
Can a regimen of no playdates, no TV, no computer games and hours of music
practice create happy kids? And what happens when they fight back? http://online.wsj.com/article/SB1000142405274870411150457605971
By AMY CHUA
Amy Chua with her daughters, Louisa and Sophia, at their home in New Haven,
Conn.
A lot of people wonder how Chinese parents raise such stereotypically
successful kids. They wonder what these parents do to produce so many math
whizzes and music prod... 阅读全帖
【 以下文字转载自 GayStudy 俱乐部 】
发信人: msgc (为了下一代免遭变态残害), 信区: GayStudy
标 题: 阿肯色痢疤肉法官帮助变态人渣践踏人权被弹劾
发信站: BBS 未名空间站 (Sun May 18 13:40:39 2014, 美东)
这个畜生刚刚宣布支持变态人渣强行改变属于正常人千百年的婚姻定义,就为此遭到被
弹劾!
让那些为了讨好变态人渣而贪赃枉法的人渣也想一想天理报应.
Impeach Chris Piazza? Look who's talking
Posted by Max Brantley on Sun, May 11, 2014 at 7:27 AM
Some elements of the Arkansas legislature Crackpot Caucus emerged Saturday
to talk of impeaching Pulaski Circuit Judge Chris Piazza for his ruling
striking down the state ban on same-sex marriage... 阅读全帖
【 以下文字转载自 GayStudy 俱乐部 】
发信人: msgc (为了下一代免遭变态残害), 信区: GayStudy
标 题: 阿肯色痢疤肉法官帮助变态人渣践踏人权被弹劾
发信站: BBS 未名空间站 (Sun May 18 13:40:39 2014, 美东)
这个畜生刚刚宣布支持变态人渣强行改变属于正常人千百年的婚姻定义,就为此遭到被
弹劾!
让那些为了讨好变态人渣而贪赃枉法的人渣也想一想天理报应.
Impeach Chris Piazza? Look who's talking
Posted by Max Brantley on Sun, May 11, 2014 at 7:27 AM
Some elements of the Arkansas legislature Crackpot Caucus emerged Saturday
to talk of impeaching Pulaski Circuit Judge Chris Piazza for his ruling
striking down the state ban on same-sex marriage... 阅读全帖
【 以下文字转载自 GayStudy 俱乐部 】
发信人: msgc (为了下一代免遭变态残害), 信区: GayStudy
标 题: 阿肯色痢疤肉法官帮助变态人渣践踏人权被弹劾
发信站: BBS 未名空间站 (Sun May 18 13:40:39 2014, 美东)
这个畜生刚刚宣布支持变态人渣强行改变属于正常人千百年的婚姻定义,就为此遭到被
弹劾!
让那些为了讨好变态人渣而贪赃枉法的人渣也想一想天理报应.
Impeach Chris Piazza? Look who's talking
Posted by Max Brantley on Sun, May 11, 2014 at 7:27 AM
Some elements of the Arkansas legislature Crackpot Caucus emerged Saturday
to talk of impeaching Pulaski Circuit Judge Chris Piazza for his ruling
striking down the state ban on same-sex marriage... 阅读全帖
copied from the big book.
Question:I find that running (or more accurately, jogging) at my MAF (
maximum aerobic function) is not fun for me. I feel under-challenged and
uninspired to work out at such a low level of intensity. I miss the fun and
freedom I feel running at higher heart rates and dislike hearing my heart-
rate monitor alarm beep as soon as I start moving at a pace that feels good
to me. But biking at my aerobic heart rate is much more fun for me since I
can sustain a more stimulati... 阅读全帖
现在好像在讨论奖学金4年,不是1年1 renew.. 很多反对 http://espn.go.com/college-sports/story/_/id/7447649/ncaa-mark-
s-stipend-stay-override-effort
The four-year scholarship, approved in October, also is under attack. Eighty
-two schools signed an override petition, enough to make the board take a se
cond look at the rule. Previously, schools renewed athletic scholarships ann
ually.
"The working group is going to recommend that the rule not be modified and t
hat they stay the course as it is written," Emmert said. "... 阅读全帖