由买买提看人间百态

topics

全部话题 - 话题: contained
首页 上页 1 2 3 4 5 6 7 8 9 10 下页 末页 (共10页)
z*******3
发帖数: 13709
1
framework跟container最大的区别就是
container通过脚本可以自己启动,运行成一个服务
而framework只能通过其它程序来启动,不能自行启动
也就是自己无法单独跑成一个服务
framework跟library的区别在于
framework有一个主类,负担起管理beans的任务
尤其是beans的生命周期的管理,这个功能container也有
所以才有了spring vs ejb之争,说的就是spring framework和ejb container之间
你要选择一个来管理你的beans的生命周期,也就是普通的java对象,从new到gc
然后library不负责管理beans的生命周期,只负责提供方法
所以从完整性上说
container > framework > lib
举个例子,我们不说spring
拿web server来说
tomcat是一个web server,你可以直接把tomcat给启动,不需要加任何代码,就可以跑了
然后你可以在tomcat上添加servlet之类的beans,让tomcat帮忙管理这样
如果你对tomcat的servlet... 阅读全帖
r******r
发帖数: 700
2
来自主题: Java版 - 学以致用,但多此一举?
原来的 code:
for(FileDefinition file : FileDefinitions){
if( filePath.contains("Generic")){
HashSet entries = file.loadGenericLexicon();
}else if( filePath.contains("NNP")){
HashSet entries = file.loadNNPLexicon();
}else if( filePath.contains("TPO")){
HashSet entries = file.loadTPOLexicon();
}
}
class FileDefinition{
...
public HashSet loadGenericLexicon(){
HashSet features = new HashSet();
// reach each line ... 阅读全帖
t*********e
发帖数: 630
3
来自主题: Java版 - 这个有 bug 吗
boolean contains(String str, String substr) {

int strSize = str.length();
int subSize = substr.length();

if(str==null || substr==null){
return false;
}

if(subSize > strSize ){
return false;
}

int i =0;
while(i int j = 0;
int l = i;
while(j if(Character.toLowerCase(str.charAt(i)) == Charact... 阅读全帖
Y*S
发帖数: 74
4
来自主题: Programming版 - 面试题求解 (转载)
【 以下文字转载自 JobHunting 讨论区 】
发信人: YES (NO,NO,NO), 信区: JobHunting
标 题: 面试题求解
发信站: BBS 未名空间站 (Sat Nov 26 01:00:25 2016, 美东)
毕业很多年了。 现在有个面试题要求完成,读完后完全没有头绪,帮忙看看该怎么做
?万分感谢。
Ms.Kox enjoys her job, but she does not like to waste extra time traveling
to and from her office. After working for many years, she knows the shortest
-distance route to her office on a regular day.
Recently, the city began regular maintenance of various roads. Every day a
road gets blocked and no one can use it that day, but all ... 阅读全帖
p****y
发帖数: 23737
5
Recently, there has been a renewed interest in vegetarian diets. Today there
are countless books, cookbooks, and magazine articles promoting vegetarian
diets and providing guidance for those who wish to follow a meatless diet. A
Short Historical Perspective on Vegetarian Diets
In the past, many viewed vegetarianism as strange and faddish but
appropriately planned vegetarian diets are now recognized by many, including
the American Dietetic Association, as being nutritionally adequate, and
providi... 阅读全帖
j*****9
发帖数: 716
6
http://scienceblogs.com/webeasties/2010/12/guest_post_arsenate-based_dna.php
In the wake of the NASA excitement over the new arsenic study, and my
promise to give a detailed review of the paper itself, I have recruited a
colleague with strong opinons about the work, a solid chemistry and
microbiology background, and "Dr." in front of his name to share his
analysis. I will be posting have posted my personal and less-technical take
on the whole thing soon, so stay tuned as well.
Dr. Alex Bradley u... 阅读全帖
D**o
发帖数: 2653
7
来自主题: Mathematics版 - 关于煙花不堪剪
注意作者 \author{YHBKJ}
Atiyah-Bott Localization 1
2012-09-05 09:24:19
\documentclass[a4paper,12pt]{article}
\usepackage{amsfonts}
\usepackage{amsmath,amsthm,amssymb}
\usepackage{CJK,graphicx}
\usepackage{amscd}
\usepackage{amssymb}
\newtheorem{theorem}{Theorem}[section]
\newtheorem{corollary}{Corollary}[section]
\newtheorem{definition}{Definition}[section]
\newtheorem{lemma}{Lemma}[section]
\begin{document}
\title{\textbf{\Huge{Atiyah-Bott Localization 1}}}\author{YHBKJ}\date{}\
maketitle
\begin{ab... 阅读全帖
s**********8
发帖数: 25265
8
来自主题: MedicalDevice版 - FDA Modernization Act of 1997
Overview of FDA Modernization Act of 1997, Medical Device Provisions
CDRH FDA Modernization Act of 1997 Page1
Foreword
Preface
Introduction
Investigational Device Exemptions
Premarket Approval
Premarket Notification [510(k)]
Device Classification
Device Labeling
Device Tracking
Postmarketing Surveillance
Global Harmonization
Medical Device Reporting and Recall Reports
Establishment Registration
Device Standards
Other Sections Related to Medical Devices
Foreword
The Center for Devices and Radiolo... 阅读全帖
p****y
发帖数: 23737
9
来自主题: _Vegetarianism版 - Health Benefits of Vegetarian Diets
http://www.vegetarian-nutrition.info/updates/vegetarian_diets_health_benefits.php
Recently, there has been a renewed interest in vegetarian diets. Today there
are countless books, cookbooks, and magazine articles promoting vegetarian
diets and providing guidance for those who wish to follow a meatless diet. A
Short Historical Perspective on Vegetarian Diets
In the past, many viewed vegetarianism as strange and faddish but
appropriately planned vegetarian diets are now recognized by many, includi... 阅读全帖
w*******y
发帖数: 60932
10
Zico Pure Premium Coconut Water, Natural, 14-Ounce Bottles (Pack of 12) $2.
44, Pomberry Flavor $2.39, Lima Citron Flavor $2.39 + $4.99 shipping from
Swansen Health via Amazon
Sellers Return Policy if it's a Price Mistake
Our Return Policy
Swansonvitamins.com guarantees that you must be 100% satisfied with your
purchase, or we will refund the total cost of the product! Please use the
postage paid mailing label found on the back of the invoice.
If you are not satisfied with your purchase for any ... 阅读全帖
w*******y
发帖数: 60932
11
Oreilly Auto is offering Buy Two and get One FREE after MIR. Terms copied
from the Adv are as below.
1. Purchase TWO 1-gallon containers of Valvolines MaxLife High Mileage or
SynPower Motor Oil and receive a rebate for the purchase price of one gallon.
Maximum rebate allowed is $22.99 per gallon of MaxLife High Mileage, or
$30.99 per gallon of SynPower. Limit two free gallons per household or
address,
but four gallon containers must be purchased and rebate will be for the
purchase price of two g... 阅读全帖
w*******y
发帖数: 60932
12
First of all: E-cigarettes are for adults only.
Joye 510 Dual e-cigarette starter kit for $35 shipped LINK:
http://www.nicotinehighway.com/products/Joye-510-Dual-Starter-K
plus get an additional battery for $9
The lowest price I have seen for this kit is $40 shipped and additional
batteries are rarely priced below $10 shipped.
Kit includes:
(2) Joye Manual batteries with blue LED
(2) Joye Atomizers
(1) Power Cord
(1) Normal Charger
(1) Manual
(5) Cartridges
This is a top rated e-cig, it is what ... 阅读全帖
w*******y
发帖数: 60932
13
Link:
http://www.walmart.com/ip/Rubbermaid-24-Piece-Food-Storage-Set-
#rr" rel="nofollow" target="_blank" onclick="_gaq.push(['_trackEvent', '
thread', 'click', '3106420 - wallmart-rubbermaid-24-peice-10-3.95-shipping-
or-free-ship-to-store']);">Link [Link:
http://www.walmart.com/ip/Rubbermaid-24-Piece-Food-Storage-Set-
#rr" rel="nofollow" target="_blank" onclick="_gaq.push(['_trackEvent', '
thread', 'click', '3106420 - wallmart-rubbermaid-24-peice-10-3.95-shipping-
or-free-ship-to-store']);">wa... 阅读全帖
w*******y
发帖数: 60932
14
Kmart has
Rubbermaid Easy Find Lids 40-Piece Storage Set:
http://www.kmart.com/shc/s/p_10151_10104_011W822130110001P
for $14.99
Use Code OFFERS10 for 10% off
Final Price $13.49
Select pick up in store to save on shipping
Walmart $18.54:
http://www.walmart.com/ip/Rubbermaid-40-Piece-Easy-Find-Lid-Foo
Amazon $21.37:
http://www.amazon.com/Rubbermaid-Easy-Find-Storage-40-Piece/dp/
Rubbermaid Easy Find Lid Food Storage Set:
40-piece food storage set
Five 0.5-cup containers with lids
Five 1.25-cup c... 阅读全帖
f**********g
发帖数: 2252
15
来自主题: _pennystock版 - MNI 动了 LEE 已经飞了
Lee Enterprises posts 38% growth in digital ad revenue
4 hours 14 minutes ago - HUG
Thomson Reuters ONEDAVENPORT, Iowa (January18,2011) -- Lee Enterprises,
Incorporated (NYSE: LEE) reported today that for its first fiscal quarter
ended December26,2010, digital advertising sales increased 37.8 percent
compared with a year ago, while the decline in total revenue moderated to 1.
0 percent, as forecast. Cash costs decreased 2.0 percent, more than forecast
, and operating cash flow(1) increased 1.8 p... 阅读全帖
z**n
发帖数: 22303
16
来自主题: Military版 - 关于转基因和中医
蒙山督2000年患基因小麦就可以投放市场了,可惜阻力太大不得不放弃,因为这个是羊
大人的主食,他们可不愿意做小白鼠。以前的转基因玉米,绝大部分作了饲料和生物燃
料,还有出口给别国享用。
美国有多少转基因食品我不清楚,FDA最近是什么动向,看看这个文章吧,今后几年是什
么动向,大家拭目以待.
三月初开始,美国发生了一个颇有影响的大规模食品召回事件。尽管政府主管部门不问
不说本质问题,但社会多数人都知道,那个规模召回跟美国政府如何管理转基因作物的
动向有关。理解其中原委,需要对美国政府运作细节有所了解,否则就可能摸不着头脑
、或望文生义地发生误解误导。
一、美国政府运作的一个细节:不问也不告。
美国联邦政府有个“Don't Ask, Don't Tell”(简称“DADT”)政策,意思是“不问
也不告”。其背景是:1992年总统竞选,政府如何对待同性恋、特别是如何对待军人同
性恋,成了可能导致社会严重分裂和政策辩论的关键问题之一。为解决问题,克林顿当
选总统后即制定了一个法规政策,概括为“不问也不告”,即联邦政府对公民(包括军
人)的同性恋自由选择采取“不问也不告”的默认立场和模糊政策。
... 阅读全帖
i***a
发帖数: 195
17
【 以下文字转载自 Military2 讨论区 】
发信人: idoba (turen), 信区: Military2
标 题: 造谣的,无知起哄的,哄抢盐糖醋的,担心出门被雨淋得辐射的
发信站: BBS 未名空间站 (Sat Mar 19 13:26:02 2011, 美东)
核电业: 和平利用核能还是将来一个热点,如何处理核废料,核事故提供了教训,将来会更安全的。
给造谣的: 别再散播恐慌了,事态完全控制住了,和我几天前预测一致
无知起哄的:多学点知识,无知不是错,因为无知而乱说话就是你的错了
哄抢盐糖醋的:别给奸商再送钱了
担心出门被雨淋的:别担心了,该干么干嘛去,和平常一样
http://ansnuclearcafe.org/
No New Developments since 9:00pm, 19th March
Unit Status
1 • Reactor cold shutdown, stable water level, offsite power is
available.
• No cooling wat... 阅读全帖
i***a
发帖数: 195
18
【 以下文字转载自 Military2 讨论区 】
发信人: idoba (turen), 信区: Military2
标 题: Re: 造谣的或者辟谣的都看过来,日本核事故更新
发信站: BBS 未名空间站 (Sat Mar 19 13:17:33 2011, 美东)
电力接通了。
造谣的可以闭嘴了。
这个事情就这样消停了吧。
核电该用的还是会用。该建还会建。
加州的朋友别担心了,该干么干么去,和平常一样
国内坉盐坉酱油坉白糖的歇歇吧,别给奸商送钱了。
http://ansnuclearcafe.org/
No New Developments since 9:00pm, 19th March
Unit Status
1 • Reactor cold shutdown, stable water level, offsite power is
available.
• No cooling water is leaked to the reactor containment vessel.
• Main... 阅读全帖
s********n
发帖数: 26222
19
方舟子在此文中说“虫子不吃的, 人能吃吗”是中国人的质疑, 而美国人是不会问这
样的问题的, 这显然是骗人的。见下文和其中引用的文献, 其中不少是美国人的科研

"Comments on the human health impact of Bacillus thuringiensis toxin gene
product in genetically modified crops"
EPA Review Docket Number OPP-00678B
Professor Joe Cummins
Professor Emeritus of Genetics
University of Western Ontario
I have studied the Environment Protection Agency (EPA) document "Bt Plant-
Pesticides Biopesticides Registration Action Document B. HUMAN HEALTH
ASSESSMENT" and comment in the following ... 阅读全帖
z*******9
发帖数: 167
20
经济学人杂志前几天为这位天才写了一篇很感人的报道。
http://www.economist.com/news/obituary/21569674-aaron-swartz-co
下面是我自己摘录的一些highlight, 核心理念:分享。
* That was morally wrong, he thought; the knowledge contained in it (often
obtained with public funding, after all) had to be made available, free, to
everyone.
* At 12 or 13—a plump, bookish boy with a computer-company executive for a
father and a very early Mac in the den—he set up theinfo.org, a sort of
Wikipedia before the fact, which was going to contain all the world’s
k... 阅读全帖
z**n
发帖数: 22303
21
转基因:美国政府大规模召回的背后
1 名作者发布了 1 个帖子
立里
7月3日
http://zhiyanle.blog.hexun.com/48361983_d.html
转基因:美国政府大规模召回的背后。
直言 了,2010-04-13。
三月初开始,美国发生了一个颇有影响的大规模食品召回事件。尽管政府主管部门不问
不说本质问题,但社会多数人都知道,那个规模召回跟美国政府 如何管理转基因作物
的动向有关。理解其中原委,需要对美国政府运作细节有所了解,否则就可能摸不着头
脑、或望文生义地发生误解误导。
一、美国政府运作的一个细节:不问也不告。
美 国联邦政府有个“Don't Ask, Don't Tell”(简称“DADT”)政策,意思是“不问
也不告”。其背景是:1992年总统竞选,政府如何对待同性恋、特别是如何对待军人同
性恋,成了可能导 致社会严重分裂和政策辩论的关键问题之一。为解决问题,克林顿
当选总统后即制定了一个法规政策,概括为“不问也不告”,即联邦政府对公民(包
括军人)的同 性恋自由选择采取“不问也不告”的默认立场和模糊政策。
克林顿时期,如何管理转基... 阅读全帖

发帖数: 1
22
来自主题: Military版 - 12 月26日 可能的真相
12月26日 事实的真相
以前我们分析过,Augusta, GA 只是这个人体基地的一个点,而且我们也追踪到还有一
个点在加州。那么经过更多的分析,显示事实的真相可能是如此。这些地下通道是很久
以前就存在的,是为了战争或避难用的,后来在南北战争中,又充当奴隶逃跑到北方的
通道。那么在后来的后来,就被一些别有用心的人充当了非法活动的场地。而到了80年
代后,日本人就加入进来,把其改造成了一个军事,人体实验基地,成了报复美国的一
种手段。当然,我也强调历史和解,仇恨和解,但要在正确的认知,悔改下的和解。如
果一边在屠杀受害者,一边高谈和解,并千方百计掩盖事情真相的曝光,这不是悔改的
表现,最多是转移了屠杀的目标,我们不能原谅罪恶势力彼此勾结下的和解。根据分析
,这个基地的入口就在Deerfield, ILLinois. 世界每一个人都是这个基地的受害者,
都是这些大药厂的受害者,受害者以亿为单位来计算。你们很可能都在不知不觉中受到
了他们的伤害,请把信息传达到世界每一个角落,让我们一起携手和世界上最邪恶的势
力做顽强的斗争,他们现在还在屠杀无辜的受害者,每天在我家里杀人。请你们和我站
在... 阅读全帖

发帖数: 1
23
来自主题: Military版 - 数据说话:长江水深
Yangtze River
RIVER, CHINA
WRITTEN BY: Aleksandr Pavlovich Muranov Charles E. Greer
See Article History
Alternative Titles: Ch’ang Chiang, Chang Jiang, Da Jiang
Yangtze River, Chinese (Pinyin) Chang Jiang or (Wade-Giles romanization) Ch
’ang Chiang, longest river in both China and Asia and third longest river
in the world, with a length of 3,915 miles (6,300 kilometres). Its basin,
extending for some 2,000 miles (3,200 km) from west to east and for more
than 600 miles (1,000 km) from north to so... 阅读全帖

发帖数: 1
24
来自主题: Military版 - 不列颠百科全书:长江水深数据
Yangtze River
RIVER, CHINA
WRITTEN BY: Aleksandr Pavlovich Muranov Charles E. Greer
See Article History
Alternative Titles: Ch’ang Chiang, Chang Jiang, Da Jiang
Yangtze River, Chinese (Pinyin) Chang Jiang or (Wade-Giles romanization) Ch
’ang Chiang, longest river in both China and Asia and third longest river
in the world, with a length of 3,915 miles (6,300 kilometres). Its basin,
extending for some 2,000 miles (3,200 km) from west to east and for more
than 600 miles (1,000 km) from north to so... 阅读全帖
i*****y
发帖数: 3449
25
寰楋紝杩欓攨鍙堢敤缁欏彴婀句汉浜br />
During the first eight months of this year, 41,790 people left Nghe An
looking for work, many of them overseas.
The province was ravaged by one of Vietnam鈥檚 worst environmental disasters
in 2016 when a steel mill owned by Taiwan鈥檚 Formosa Plastics contaminated
coastal waters, devastating local fishing and tourism industries and
sparking widespread protests
woman feared to be among 39 migrants found dead in a lorry in Essex have
said she was fooled into paying people smuggle... 阅读全帖
W*****B
发帖数: 4796
26
告诉你们了,肯定会爆发了,我能做的也就这么多了。
反正也已经警告过你们了,你也不能说我瞒报什么的
剩下的自求多福吧。
尼玛,民主国家就是这点好啊。全都撇清甩锅了。
Public health officials warn of ‘inevitable’ spread of coronavirus in U.S.
Trump administration health officials urged the public Tuesday to prepare
for the “inevitable” spread of the coronavirus within the United States,
escalating warnings about a growing threat from the virus to Americans’
everyday lives.
The urgent new tone from leaders of the Centers for Disease Control and
Prevention and the National Institut... 阅读全帖
y******a
发帖数: 56
27
是啊,电视上看明显是核岛containment(立方体形状)被炸飞了。不可能是发电机冷
却用氢气造成的。否则应该是常规岛机房(旁边稍矮的长方体建筑)被炸飞。日本开始
还死不承认。堆芯肯定是已经熔了。奇怪的是反应出的氢气怎么跑到containment里面
,而不是大气中。除非设计就是这样,主蒸气紧急排放点是在containment内,然后再
启动containment喷林系统冷去降低containment内空气压力。若喷林系统不工作,那就
只有阿弥陀佛了。
i***a
发帖数: 195
28
电力接通了。
造谣的可以闭嘴了。
这个事情就这样消停了吧。
核电该用的还是会用。该建还会建。
加州的朋友别担心了,该干么干么去,和平常一样
国内坉盐坉酱油坉白糖的歇歇吧,别给奸商送钱了。
http://ansnuclearcafe.org/
No New Developments since 9:00pm, 19th March
Unit Status
1 • Reactor cold shutdown, stable water level, offsite power is
available.
• No cooling water is leaked to the reactor containment vessel.
• Maintain average water temperature at 100°C in the pressure
restraint.
2 • Reactor cold shutdown, stable water level, offsite... 阅读全帖
i***a
发帖数: 195
29
核电业: 和平利用核能还是将来一个热点,如何处理核废料,核事故提供了教训,将来会更安全的。
给造谣的: 别再散播恐慌了,事态完全控制住了,和我几天前预测一致
无知起哄的:多学点知识,无知不是错,因为无知而乱说话就是你的错了
哄抢盐糖醋的:别给奸商再送钱了
担心出门被雨淋的:别担心了,该干么干嘛去,和平常一样. 平时没事的时候平均一个人每年接受的各种核辐射就是3.6毫希伏。而且一个人每年接受10毫希伏以下还不一定对身体有啥害处,反而有好处(HORMESIS, 激活了细胞修复功能)。所以有些人看到加州的辐射读数上升了5%就惊恐不安,真是没知识,穷担心啊。
http://ansnuclearcafe.org/
No New Developments since 9:00pm, 19th March
Unit Status
1 • Reactor cold shutdown, stable water level, offsite power is
available.
• No cooling water is leaked to t... 阅读全帖
P*********0
发帖数: 4321
30
http://healthcarereform.procon.org/view.resource.php?resourceID
History of the Individual Health Insurance Mandate, 1989-2010
Republican Origins of Democratic Health Care Provision
Heritage Foundation's 1989 report is considered to be the conceptual origin
of the health insurance mandate.
The concept of the individual health insurance mandate is considered to have
originated in 1989 at the conservative Heritage Foundation. In 1993,
Republicans twice introduced health care bills that contained an... 阅读全帖
l****z
发帖数: 29846
31
来自主题: USANews版 - 美国西岸码头工人大罢工
US West Coast seaports mostly shut down amid labor dispute
LOS ANGELES (AP) — Companies that operate marine terminals in major West
Coast cities said they weren't calling workers to unload ships Thursday that
carry car parts, furniture, clothing, electronics — just about anything
made in Asia and destined for U.S. consumers. Containers of U.S. exports won
't get loaded either.
The partial lockout is the result of an increasingly damaging labor dispute
between dockworkers and their employers.
The... 阅读全帖
g********2
发帖数: 6571
32
WASHINGTON (AP) — Republicans stepped up their attacks on Monday on former
Secretary of State Hillary Clinton's use of a private email server and
pointed to newly released messages to allege that foreign donors to the
Democratic presidential nominee's family charity got preferential treatment
from her department.
Congressional Republicans issued subpoenas to three technology companies
that either made or serviced the private email server located in the
basement of Clinton's New York home. The su... 阅读全帖
g********2
发帖数: 6571
33
把全文转来了:
Why obstruction charge for Clinton could hinge on timing
EXCLUSIVE: New details about the emails on Hillary Clinton's personal server
that contained classified markings call into question her claim to the FBI
that she didn't know what the markings meant -- and even believed they
represented an alphabetical listing of paragraphs.
A government source told Fox News that virtually every paragraph in one mail
contained so-called portion markings used exclusively for classification
purposes. T... 阅读全帖
a*****1
发帖数: 3817
34
来自主题: USANews版 - trump懵逼了,trump轮集体被打脸
自己去看美国宪法
United States Constitution
From Wikipedia, the free encyclopedia
Jump to: navigation, search
United States Constitution
Constitution of the United States, page 1.jpg
Page one of the original copy of the Constitution
Created
September 17, 1787
Ratified
June 21, 1788
Date effective
March 4, 1789; 227 years ago
Location
National Archives,
Washington, D.C.
Author(s)
Philadelphia Convention
Signatories
39 of the 55 delegates
Purpose
To replace the Articles of Confederation (177... 阅读全帖
a*****1
发帖数: 3817
35
来自主题: USANews版 - trump懵逼了,trump轮集体被打脸
自己去看美国宪法
United States Constitution
From Wikipedia, the free encyclopedia
Jump to: navigation, search
United States Constitution
Constitution of the United States, page 1.jpg
Page one of the original copy of the Constitution
Created
September 17, 1787
Ratified
June 21, 1788
Date effective
March 4, 1789; 227 years ago
Location
National Archives,
Washington, D.C.
Author(s)
Philadelphia Convention
Signatories
39 of the 55 delegates
Purpose
To replace the Articles of Confederation (177... 阅读全帖
w******i
发帖数: 1476
36
来自主题: JobHunting版 - 一个很全SAS Interview Q. List [ZT]
SAS Interview Questions from http://www.sconsig.com/
Very Basic
What SAS statements would you code to read an external raw data file to a DATA
step?
How do you read in the variables that you need?
Are you familiar with special input delimiters? How are they used?
If reading a variable length file with fixed input, how would you prevent SAS
from reading the next record if the last variable didn't have a value?
What is the difference between an informat and a format? Name three informats
or format... 阅读全帖
q*******p
发帖数: 39
37
来自主题: JobHunting版 - C++ template Questions
有1道题请教大家
1. 实现 Reduce function using templates. The Reduce fn applies a function
of two arguments cumulatively to the items of an STL container, from
begin() to end(), so as to reduce the sequence to a single value. For
example, Reduce(, std::plus()) should
calculate ((((1+2)+3)+4)+5).
class NotEnoughElements {};
template
typename Container::value_type
Reduce(const Container& c, Function fn) throw (NotEnoughElements)
{
实... 阅读全帖
z****o
发帖数: 78
38
来自主题: JobHunting版 - 问一道google题
1. use an integer Mark[i] to represent the character set for word[i] in the
dict; use lower 26 bits, each represent whether a certain character appears
in the word.
(Mark[i] & Mark[j]) == 0 means word[i] and
word[j] are disjoint.
2. at the mean time of calculating the Mark[i], we update the maximum-length
word index in
Longest[(~Mark[i]) & 0x03ffffff];
this means eg.
if word[i] = "abcdefg........uvwabcdefg.....uvw", Longest[(~
Mark[... 阅读全帖
r*******n
发帖数: 3020
39
10
input: all_poly = set(p1, p2, p3, ..., pn)
p is a given poly.
output: minimum poly that contain p.
step1:
result = set()
for each in all_poly:
if each contain p:
then put it in result.
step2:
Since any p1, p2 in result, either p1 contain p2 or p2 contain p1
take any two polys, assume p1 and p2,
if p1 contain p2, then remove p1 out of result,
otherwise remove p2 out of result.
until there is only one poly in result,
return that.
two steps all can be done with divide ... 阅读全帖
i***0
发帖数: 8469
40
来自主题: JobHunting版 - 大家来讨论一下c++吧
大家来讨论一下c++吧
Please answer the following c++ questions. Do not simply answer yes/no.
Always explain your assumptions and reasoning.
1. memset is sometimes used to initialize data in a constructor like the
example below. What is the benefit of initializing this way? Does it work
in this example? Does it work in general ? Is it a good idea in general?
class A {
public:
A();
private:
int a;
float f;
char str[35];
long *lp;
};
A::A()
{
... 阅读全帖
d****o
发帖数: 1055
41
来自主题: JobHunting版 - Time complexity
下面找lowestCommonAncestor的代码如果tree balance的话time complexity是多少?
自己想的不保险,请教一下。
我觉得是O(nlogn)
bool contain(node* root, node* cur)
{
if(root)
{
if(root==cur) return true;
return contain(root->left,cur)||contain(root->right,cur);
}
return false;
}
node* lowest(node* root, node* n1, node* n2)
{
if(root==n1||root==n2) return root;
if(root==NULL) return NULL;
bool isLeft1 = false;
bool isLeft2 = false;
if(root->left)
{
isLeft1 = contain(root->left,n1); ... 阅读全帖
m***k
发帖数: 946
42
来自主题: JobHunting版 - leetcode一道题
leetcode里这道题有一个test case没有看明白,能请哪位给解释一下么?
input: [1,2,4,3] expect: 4
Container With Most Water
Given n non-negative integers a1, a2, ..., an, where each represents a point
at coordinate (i, ai). n vertical lines are drawn such that the two
endpoints of line i is at (i, ai) and (i, 0). Find two lines, which together
with x-axis forms a container, such that the container contains the most
water.
Note: You may not slant the container.
o******3
发帖数: 91
43
来自主题: JobHunting版 - 求问hackerrank的lego blocks题
听了二爷的话,开始做hackerrank
今天被lego blocks绊住了
测试数据集可以过 但是提交数据集就超时了 虽然我用的确实是DP
下面是题目和我的代码,还望指点
You have 4 types of lego blocks, of sizes 1 * 1 * 1, 1 * 1 * 2, 1 * 1 * 3
and 1 * 1 * 4. Assume you have infinite number of blocks of each type.
You want to make a wall of height N and width M out of these blocks. The
wall should not have any holes in it. The wall you build should be one solid
structure. A solid structure means that it should not be possible to
separate the wall along any vertical line withou... 阅读全帖
r*********n
发帖数: 4553
44
来自主题: JobHunting版 - 请教一下jump game
传说中的pruning? 在recursion的时候设置一个全局flag,如果达到条件,就直接返回
比如在binary tree里面寻找一个key,
class BT{
bool found;
void contain(Node* nd, int key){
if(found) return;
if(nd == nullptr) return;
if(nd->val == key){
found = true;
return;
}
contain(nd->left, key);
contain(nd->right, key);
}
public:
BT():found(false){}
bool contain(Node* root, int key){
contain(root, key);
return found;
}
};
如果没有found,那么每个node都要check一遍。如果key刚好在最左下角的node里面,
那么上面这个方法只需要check那个node的height那么多... 阅读全帖
f*****t
发帖数: 13
45
来自主题: JobHunting版 - leetcode一题
Container With Most Water
Given n non-negative integers a1, a2, ..., an, where each represents a point
at coordinate (i, ai). n vertical lines are drawn such that the two
endpoints of line i is at (i, ai) and (i, 0). Find two lines, which together
with x-axis forms a container, such that the container contains the most
water.
Note: You may not slant the container.
下面是run完我的function后的一个test case:
Showing the first failed test case.
input output expected
[1,2,4,3] 6 4
不太明白为什么expected应该是4?
p****n
发帖数: 69
46

因为是int,所以直接用greater就好了,不用自己在写一个comparator
priority_queue, std::greater> minheap
另外再另外定义下cmp。有次面试
priority_queue is a container adapter in STL,vector is used to specify
the underlining container, you can also choose deque
even though priority_queue uses vector by default, here you have to
specify it because you are going to assign a comparator and hence all the
template parameters preceding comp need to be explicitly specified.
有人知道为何c++不把这container写
i t... 阅读全帖
n*****a
发帖数: 107
47
来自主题: JobHunting版 - 几道店面题, 大家讨论一下
第三个是多进程的,为了防止一个网页出现错误,crash了其他的网页
MULTIPROCESS ARCHITECTURE—CHROME BROWSER
Many websites contain active content such as JavaScript, Flash, and HTML5 to
provide a rich and dynamic web-browsing experience. Unfortunately, these
web applications may also contain software bugs, which can result in
sluggish response times and can even cause the web browser to crash. This
isn’t a big problem in a web browser that displays content from only one
website. But most contemporary web browsers provide tabbed ... 阅读全帖
首页 上页 1 2 3 4 5 6 7 8 9 10 下页 末页 (共10页)