由买买提看人间百态

topics

全部话题 - 话题: instances
首页 上页 1 2 3 4 5 6 7 8 9 10 下页 末页 (共10页)
e****i
发帖数: 2152
1
【 以下文字转载自 Military 讨论区 】
发信人: erkuai (三天不上bbs,赶得上刘少奇), 信区: Military
标 题: On the Jews and Their Lies, 1543
发信站: BBS 未名空间站 (Wed Jan 12 23:21:23 2011, 美东)
by Martin Luther (1483-1546)
Translated by Martin H. Bertram
copyright © 1971 Fortress Press & Augsburg Fortress - On the Jews and
Their Lies is from Luther’s Works Volume 47. Augsburg Fortress is the
publishing ministry of the Evangelical Lutheran Church in America.
Funded through sales revenue, Augsburg Fortress is called to provide
produ... 阅读全帖
e****i
发帖数: 2152
2
来自主题: Military版 - On the Jews and Their Lies, 1543
by Martin Luther (1483-1546)
Translated by Martin H. Bertram
copyright © 1971 Fortress Press & Augsburg Fortress - On the Jews and
Their Lies is from Luther’s Works Volume 47. Augsburg Fortress is the
publishing ministry of the Evangelical Lutheran Church in America.
Funded through sales revenue, Augsburg Fortress is called to provide
products and services that communicate the Gospel, enhance faith, and
enrich the life of the Christian community from a Lutheran perspective.
Part I
I had mad... 阅读全帖
n********y
发帖数: 66
3
找没有太多人用的 (看 spot instance 的 price history) 的 spot instance,
使用 auto scaling group 来 launch spot instances, 这样能降下来很多费用
举个例子来说,几个月前 m3.2xlarge 之类的正常的价格是好几毛一小时, 然后 spot
instance 是2,3分钱, 设一个 spot instance 上限为5分, 这样,在这个limit下的话,
Amazon EC2 会keep你的instance, 直到资源不够用,且别人出价更高...
通过一个合理的定价体系: 譬如, 1个on-demand(甚至是 reserved) + 若干个不同价位
设置(一组(可以是x个instances)5分/时; 一组(可以是y个instances)1毛/h 等等,都可
以配置的)来达到cost效率最高
你直接让他们 quote 的话,价格不会便宜到哪里去的..
r*****3
发帖数: 143
4
中文名: IBM DB2 9.7 高级管理指南
原名: IBM DB2 9.7 Advanced Administration Cookbook
作者: Neagu
Pelletier
Prusinski
Jayanty
图书分类: 软件
资源格式: PDF
版本: 文字版
出版社: Packt
书号: 978-1-84968-332-6
发行时间: 2011年
地区: 美国
语言: 英文
简介:
内容简介:
DB2 是 IBM公司研制的一种关系型数据库系统。主要应用于大型应用系统,具有较好的
可伸缩性,可支持从大型机到单用户环境,应用于OS/2、Windows等平台下。 DB2提供
了高层次的数据利用性、完整性、安全性、可恢复性,以及小规模到大规模应用程序的
执行能力,具有与平台无关的基本功能和SQL命令。DB2采用了数据分级技术,能够使大
型机数据很方便地下载到LAN数据库服务器,使得客户机/服务器用户和基于LAN的应用
程序可以访问大型机数据,并使数据库本地化及远程连接透明化。 它以拥有一个非常
完备的查询优化器而著称,其外部连接改善了查询性能,并支持多任务并行查询。 DB2
具... 阅读全帖
t****n
发帖数: 2601
5
俄国批评文章
The Nobel Peace Prize, and an Instrument of Western Power
11.10.2010
Pages: 123By Peter Baofu, Ph.D.
Contrary to the China-bashing coverage by mainstream Western media (which
also controls much of global media), the award of the 2010 Nobel Peace Prize
to Liu Xiaobo, an imprisoned Chinese (convicted of violating state laws),
does not promote world peace and prosperity in the long run, for seven major
reasons as explained below.
(1) The first reason is that, contrary to the China-bashing t... 阅读全帖
o**1
发帖数: 6383
6
☆─────────────────────────────────────☆
aben (hehe) 于 (Sat Oct 16 23:52:21 2010, 美东) 提到:
前两年诺贝尔和平奖,不论是戈尔,还是obama,国际上各大媒体
都有非常明显的争议性。
只有这次刘晓波,国际上各大媒体,不论左右,conservative还是liberal
一边倒的祝贺刘晓波骂TG,貌似从来没有那么一致过。
说老实话,我本来以为以TG这些年存的那么多外汇储备,收买一两
个所谓“国际友人”,一两个有点影响外国媒体骂骂诺贝尔委员会,
应该还是做得到的,但是到现在都一个多礼拜了,只有一个从来没有
听说过的什么“挪威教授”,还有个美国老年愤青在自己blog的博文
里面指责诺贝尔(人家即使指责诺贝,也没有说TG一个好字),TG喉舌
为了增强影响力,仍是造谣给人家戴了个“CNN VP”的头衔,贻笑大方
难怪啊,菌斑EUV等几个著名五毛这个礼拜都发疯了。
☆─────────────────────────────────────☆
mofia (Mofia) 于 (Sat Oct 16 ... 阅读全帖
w*********g
发帖数: 30882
7
纽约时报:美国人如何输掉了iPhone的工作
四月网 2012-02-06
《纽约时报》1月12日报道,原题:美国人如何输掉了iPhone的工作。以下是文章内容
摘编。
中国河南省2010年招聘会上,富士康科技有限公司的求职者蜂拥而至。
去年二月份,巴拉克•奥巴马在加利福尼亚参加矽谷名人们的晚宴,每个客人都
得到了一个向总统提问的机会。
但当斯蒂夫•乔布斯准备发问时,奥巴马总统打断了他,先提出了自己的一个问
题:怎样才能在美国生产iPhone?
不久之前,苹果还在吹嘘它的产品都是在美国生产的,今天事情已经完全不是这样了。
苹果公司去年卖出的7000万部iPhone、3000万部iPad和5900万部其他产品,几乎全是在
海外生产的。
奥巴马问,为什么不能把这些工作搬到家里来做?
乔布斯先生的回答含糊其辞,据参加宴会的人员回忆,他说:“这些工作回不来了。”
总统的发问触及了苹果公司的核心问题所在,这已经不仅仅是海外廉价劳动力的问题了
。苹果高层认为,海外工厂的规模、工人的灵活性、勤奋程度和操作技巧都已经超过了
美国工人。“美国制造”已经不是大部分苹果产品的明智选择... 阅读全帖
K**********n
发帖数: 1197
8

跟这帮自称理科的文科生物wsn实在纠缠不清楚。给丫们上点洋大人自己的说法吧,而
且都是学术圈的,已有reference一堆,其中一份是著名的兰德公司的报告。
另外,美国和澳洲已立法限制使用脑波扫描仪,拿脑波扫描仪扫本国公民已是联邦法的
重罪。不过这个比较难的是你无法证实谁接收了你的脑信号。所以立了法跟没立一个样。
Remote Mind Control Technology

Reprinted from SECRET AND SUPPRESSED: BANNED IDEAS AND HIDDEN
HISTORY, edited by Jim Keith, $12.95, available from
1-800-680-INET.
There had been an ongoing controversy over health effects of electromagnetic
fields (EMF) for years (e.g., extremely low frequency radiation and the
Navy's Project Sea... 阅读全帖
a*******a
发帖数: 1240
9
来自主题: Military版 - A critique, 从引力波说开去
Before embarking on a metaphysical critique of the famed "theory of general
relativity" (GR) amidst the fanfare of the recent observation by LIGO of
gravitational wave, an explorative discussion of mathematics is both helpful
and necessary.
In any theoretical investigations, mathematics plays a pivotal role. The
natural question arising herein is then, what is mathematics? And what kind
of roles can we possibly expect of mathematics in any theoretical enquiries
(i.e., by deductions) or in a prac... 阅读全帖
l****z
发帖数: 29846
10
来自主题: USANews版 - How U.S. Lost Out on iPhone Work
http://www.nytimes.com/2012/01/22/business/apple-america-and-a-
The New York Times
When Barack Obama joined Silicon Valley’s top luminaries for dinner in California last February, each guest was asked to come with a question for the president.
But as Steven P. Jobs of Apple spoke, President Obama interrupted with an inquiry of his own: what would it take to make iPhones in the United States?
Not long ago, Apple boasted that its products were made in America. Today, few are. Almost all of the 70 ... 阅读全帖
M****o
发帖数: 4860
11
就是,起码也得写下面这篇这么长。。。
Why I Am Not A Christian
What Is a Christian?
Nowadays it is not quite that. We have to be a little more vague in our
meaning of Christianity. I think, however, that there are two different
items which are quite essential to anybody calling himself a Christian. The
first is one of a dogmatic nature -- namely, that you must believe in God
and immortality. If you do not believe in those two things, I do not think
that you can properly call yourself a Christian. Then, further tha... 阅读全帖
D*****r
发帖数: 6791
12
来自主题: TrustInJesus版 - Mark Twain:Letters from the earth
Letters from the Earth
When the Creator had finished thinking, He said, "I have thought. Behold!"
He lifted His hand, and from it burst a fountain-spray of fire, a million
stupendous suns, which clove the blackness and soared, away and away and
away, diminishing in magnitude and intensity as they pierced the far
frontiers of Space, until at last they were but as diamond nailheads
sparkling under the domed vast roof of the universe.
At the end of an hour the Grand Council was dismissed.
They left... 阅读全帖
l****g
发帖数: 1922
13
来自主题: BuildingWeb版 - 贡献个e-comm的思路
先申明,
1.不是大牛,版里大牛不要笑,就是把我自己最近的功课做个总结,抛砖引玉吧。
2.没有代码,就是一个架站思路。
3.可能有很多不对的地方,欢迎拍砖斧正。
主要内容:
参考帖子 http://www.mitbbs.com/article_t/BuildingWeb/31168017.html
1. 架设/租用服务器
2. 软件/工具
3. 域名
4. e-commerce流程
开始:
1. 一般刚起步的时候,为了节省成本,很少有直接租用独立服务器(dedicated server),
这个价格大致是$100/month往上吧(不精确)。大多数人会选择 web hosting,
或者虚拟主机VPS,价格便宜,而且绝大多数情况下,也都够用了。web hosting
就是页面主机,相当于一台服务器,给你一个账号,你可以架设网站,优点是便宜,从
免费的,到数十美金/month不等;缺点是,一般限定数据库个数,数据库容量,磁盘容量,
子域名数等。缺点是,可能很多人公用一个服务器,网络会不太稳定(?),
而且功能很受限制,基本上只能架设个web server。vps就是一台linux虚拟机,... 阅读全帖
F******e
发帖数: 197
14
来自主题: Hardware版 - 【包子】求AMZ EC2的经验
和一般的vps没有区别。
这种large instance性能还是很好的。
然后elastic ip不是必须的。每个instance是有公共ip的,不过你每次启动新的
instance,都会有新的ip。所以elastic ip的作用是,你可以在amazon那儿reserve一
个固定的ip,每次启动新的instance后都绑定在这个ip上。
也没有别的什么要注意的。
ps,用完记得关,amazon按照instance存活的时间长度收费。
你这个instance估计一个小时两三刀呢,所以放个半个月或者两个月的,账单就让你吐
血了。
再ps,elastic ip在绑定在instance上的时候,是免费的,但如果没绑定仅仅reserver
,是要收费的。所以你要是reserver了elastic ip,记得最后用完的时候释放掉。要不
然放个几年,都有账单,当然这部分不贵了
g**e
发帖数: 6127
15
你说的是好虫的还是我的,我写的那个锁了instanceMap,没这个问题吧。但是我想了
一下,头两行可能就有问题
instance = instanceMap.get(i);
if (instance == null) {
有可能Thread A取i, Thread B取j,假设A先进去创建了instance,这时候B才检查
instance == null,会直接返回A创建的instance吧。
解决的办法是不是加一个判断?
if (instance == null || instance.getI() != i) {
...
}

map
me
K**********n
发帖数: 1197
16
来自主题: EE版 - 版上有人懂这个技术没?
学术界珍稀有限的原版外文资料,
Remote Mind Control Technology

Reprinted from SECRET AND SUPPRESSED: BANNED IDEAS AND HIDDEN
HISTORY, edited by Jim Keith, $12.95, available from
1-800-680-INET.
There had been an ongoing controversy over health effects of electromagnetic
fields (EMF) for years (e.g., extremely low frequency radiation and the
Navy's Project Seafarer; emissions of high power lines and video display
terminals; radar and other military and industrial sources of radio
frequencies and micr... 阅读全帖
a*******a
发帖数: 1240
17
Before embarking on a metaphysical critique of the famed "theory of general
relativity" (GR) amidst the fanfare of the recent observation by LIGO of
gravitational wave, an explorative discussion of mathematics is both helpful
and necessary.
In any theoretical investigations, mathematics plays a pivotal role. The
natural question arising herein is then, what is mathematics? And what kind
of roles can we possibly expect of mathematics in any theoretical enquiries
(i.e., by deductions) or in a prac... 阅读全帖
m**c
发帖数: 7299
18
(仇恨罪首先是犯罪,然后要确认犯罪原因是因为某些原因,如种族歧视引起的暴力行
为等。变态人渣多次威胁公正讨论变态淫乱行为对社会危害等正常言论是仇恨罪,其实
是缺乏法律常识的表现,也是其破坏言论自由的罪证。相反,ABC公开宣扬种族灭绝性
的屠杀,已经构成煽动犯罪的。ABC可以用是否实施了屠杀辩护,这也可以用犯罪动机
来反击,先例有学生跟老板闹矛盾说出炸掉实验室而被作为犯罪处理的,ABC的言论比
起来,跟加严重,已经有了实施犯罪的计划和细节。)
In both crime and law, hate crimes (also known as bias-motivated crimes, or
race hate) occur when a perpetrator targets a victim because of his or her
perceived membership in a certain social group. Examples of such groups
include but are not limited to: racial group, religion... 阅读全帖
D*********n
发帖数: 279
19
来自主题: Military版 - Native Americans in the United States
http://en.wikipedia.org/wiki/Native_Americans_in_the_United_Sta
Native Americans in the United States
From Wikipedia, the free encyclopedia
Jump to: navigation, search
"American Indian" redirects here. For other indigenous peoples, see
Indigenous peoples of the Americas and other geographic regions. For
Americans from South Asia, see Indian American.
This article may be too long to read and navigate comfortably. Please
consider splitting content into sub-articles and/or condensing it. (January
2... 阅读全帖
m**c
发帖数: 7299
20
【 以下文字转载自 Military 讨论区 】
发信人: msgc (为了下一代免遭变态残害), 信区: Military
标 题: Hate crime, Hate speech and Hate speech in media
发信站: BBS 未名空间站 (Sun Oct 27 01:49:49 2013, 美东)
(仇恨罪首先是犯罪,然后要确认犯罪原因是因为某些原因,如种族歧视引起的暴力行
为等。变态人渣多次威胁公正讨论变态淫乱行为对社会危害等正常言论是仇恨罪,其实
是缺乏法律常识的表现,也是其破坏言论自由的罪证。相反,ABC公开宣扬种族灭绝性
的屠杀,已经构成煽动犯罪的。ABC可以用是否实施了屠杀辩护,这也可以用犯罪动机
来反击,先例有学生跟老板闹矛盾说出炸掉实验室而被作为犯罪处理的,ABC的言论比
起来,跟加严重,已经有了实施犯罪的计划和细节。)
In both crime and law, hate crimes (also known as bias-motivated crimes, or
race hate) occur when a perpetrator t... 阅读全帖
g**e
发帖数: 6127
21
来自主题: JobHunting版 - gg面试题
跟我写的一样,不过这里instance要是volatile的。好虫在java版给了另外一个方法
instance = instanceMap.get(i);
if (instance == null) {
instance = new SpecialSingleton(i);
temp = instanceMap.putIfAbsent(i, instance);
if(temp != null) return temp;
}
return instance;
g**e
发帖数: 6127
22
来自主题: JobHunting版 - gg面试题
按顺序执行没有问题,因为最开始就做了instance=instanceMap.get(i)
我想了一下,多线程的时候头两行可能有问题
instance = instanceMap.get(i);
if (instance == null) {
有可能Thread A取i, Thread B取j,假设A先进去创建了instance,这时候B才检查
instance == null,会直接返回A创建的instance。
J***e
发帖数: 50
23
来自主题: JobHunting版 - 请问一道special singleton class的题
Write a special singleton class, the class has one integer field,
make sure only one instance of this class will be instantiated for
the same value of the integer field.
以下是我写的, 但是有个问题,这样instance不是static, getInstance()因为用到
instance也不能是static,可以吗?这样解对吗?另外,当singleton object destruct的时候,应该把 value从hashmap里删除。怎么实现这个呢?用finalize()?
import java.util.HashMap;
public class SingletonInteger {
private Integer value;
private SingletonInteger instance;
private static HashMap阅读全帖
m**c
发帖数: 7299
24
【 以下文字转载自 Military 讨论区 】
发信人: msgc (为了下一代免遭变态残害), 信区: Military
标 题: Hate crime, Hate speech and Hate speech in media
发信站: BBS 未名空间站 (Sun Oct 27 01:49:49 2013, 美东)
(仇恨罪首先是犯罪,然后要确认犯罪原因是因为某些原因,如种族歧视引起的暴力行
为等。变态人渣多次威胁公正讨论变态淫乱行为对社会危害等正常言论是仇恨罪,其实
是缺乏法律常识的表现,也是其破坏言论自由的罪证。相反,ABC公开宣扬种族灭绝性
的屠杀,已经构成煽动犯罪的。ABC可以用是否实施了屠杀辩护,这也可以用犯罪动机
来反击,先例有学生跟老板闹矛盾说出炸掉实验室而被作为犯罪处理的,ABC的言论比
起来,跟加严重,已经有了实施犯罪的计划和细节。)
In both crime and law, hate crimes (also known as bias-motivated crimes, or
race hate) occur when a perpetrator t... 阅读全帖
s******g
发帖数: 755
25
【 以下文字转载自 Apple 讨论区 】
发信人: faucetQ (fq), 信区: Apple
标 题: [Mac Dev]整了个ObjectiveC的笔记,看看气氛对得上不
发信站: BBS 未名空间站 (Mon Feb 2 21:38:18 2009), 转信
整了个类似ObjectiveC学习笔记的东西,发上来大伙看看有兴趣不。
修改了一点,增加了NSAutoreleasePool的内容。
增加了NSString内容。
===========俺系分隔线==================
本文假设读者有基本的C编程能力,如果有C++或者Java的背景会更容易理解但是不是必须。
ObjectiveC基本语法
消息
在objectiveC中,向一个对象发送一个消息的语法为
[ obj method:parameter];
类似的功能在C++中写作
obj->method(parameter);
在java中写作
obj.method(parameter);
在smalltalk中写作
obj method:parameter
显而易见objectiveC和smalltalk... 阅读全帖
S*********g
发帖数: 24893
26
Sodomy
From Wikipedia, the free encyclopedia
Sodomy (/ˈsɒdəmi/) is any non-penile/vaginal copulation-like
act, such as oral or anal sex, or sex between a person and an animal.[1] The
word is derived from the story of Sodom and Gomorrah in chapters 18 and 19
of the Book of Genesis in the Bible.[1] So-called "sodomy laws" in many
countries criminalized not only these behaviors, but other disfavored sexual
activities as well, but in the Western world, many of these laws have been
ove... 阅读全帖
m**c
发帖数: 7299
27
【 以下文字转载自 Military 讨论区 】
发信人: msgc (为了下一代免遭变态残害), 信区: Military
标 题: Hate crime, Hate speech and Hate speech in media
发信站: BBS 未名空间站 (Sun Oct 27 01:49:49 2013, 美东)
(仇恨罪首先是犯罪,然后要确认犯罪原因是因为某些原因,如种族歧视引起的暴力行
为等。变态人渣多次威胁公正讨论变态淫乱行为对社会危害等正常言论是仇恨罪,其实
是缺乏法律常识的表现,也是其破坏言论自由的罪证。相反,ABC公开宣扬种族灭绝性
的屠杀,已经构成煽动犯罪的。ABC可以用是否实施了屠杀辩护,这也可以用犯罪动机
来反击,先例有学生跟老板闹矛盾说出炸掉实验室而被作为犯罪处理的,ABC的言论比
起来,跟加严重,已经有了实施犯罪的计划和细节。)
In both crime and law, hate crimes (also known as bias-motivated crimes, or
race hate) occur when a perpetrator t... 阅读全帖
f*****Q
发帖数: 1912
28
整了个类似ObjectiveC学习笔记的东西,发上来大伙看看有兴趣不。
修改了一点,增加了NSAutoreleasePool的内容。
增加了NSString内容。
===========俺系分隔线==================
本文假设读者有基本的C编程能力,如果有C++或者Java的背景会更容易理解但是不是必须。
ObjectiveC基本语法
消息
在objectiveC中,向一个对象发送一个消息的语法为
[ obj method:parameter];
类似的功能在C++中写作
obj->method(parameter);
在java中写作
obj.method(parameter);
在smalltalk中写作
obj method:parameter
显而易见objectiveC和smalltalk的语法基本是相同的。
当有两个或者两个以上的参数时,通常试用以的语法
[ obj method:parameter1 WithSecondParameter:parameter2];
定义一个类的代码放在一个.h文件中,下面是一个例子。
//macdevexample1.h
... 阅读全帖
c********1
发帖数: 421
29
来自主题: BuildingWeb版 - 问一个关于AWS的设置问题
AWS的free tier应该只限了一个t2.micro instance
如果再加instance 就要付费
我现在用Ops Works在PHP App Server Layer加了一个instance
用于跑php code
现在想再在DB Layer中 复用 那个instance,这样以达到省钱的目的
但MySQL Layer 加instance时,Ops Works说我必须要新建一个instance
怎么样能用上免费的RDS又不另外花钱?
是不是其实直接在Linux 里面装一个MySQL就不用走Amazon的RDS口了?
RDS其实就是提供了一个备份功能?但备份功能在不跑PROD时其实没用
R******d
发帖数: 1436
30
看到一些文章使用遗传算法寻找feature集合,把这个集合用于machine learning
predictor,比如svm,神经网络等等。反复多次最终得到最优的集合,获得最大的
prediction accuracy.
遗传算法中包括crossover, duplication, mutation的步骤。我的不解是:如果在一个
instance的feature上发生mutation,或者在两个instance的feature 之间发生
crossover,很有可能会产生一些在原始dataset中根本就不存在的instance。那么,怎
么能够拿这些根本不存在的 instance去做training呢?起码,这些新的instance连应
该属于哪个lable都不知道吧。
或者我理解错了,遗传算法是通过优化instance而不是优化feature来得到最大
prediction accuracy?
第二个问题是,好像遗传算法分成了好多种,我看到了:
GA (genetic algorithm) GP(genetic programming) GE (grammatical evol
a******s
发帖数: 7
31
来自主题: Java版 - 问一个SCJP 题目
Test Question [1]
Given:
5. class NoGo implements Runnable {
6. private static int i;
7. public synchronized void run() {
8. if (i%10 != 0) { i++; }
9. for(int x=0; x<10; x++, i++)
10. { if (x == 4) Thread.yield(); }
11. }
12. public static void main(String [] args) {
13. NoGo n = new NoGo();
14. for(int x=0; x<101; x++) {
15. new Thread(n).start();
16. System.out.print(i + " ");
17. } } }
Which is true?
A. The output can never contain the value 1... 阅读全帖
p*****d
发帖数: 80
32
来自主题: Programming版 - c++ singleton questions
singleton
1. ctor: 必须private
否则会允许出现多个instance,这个和singleton的定义矛盾。而且必须定义无参数的ctor,否则编译器默认会定义一个。
2. get_instance method:必须static
否则无法在没有singleton instance的情况下调用产生第一个也是唯一一个instance。
3. copy ctor:必须private
否则下面的语句会出现两个instance
S *s = S::get_instance();
S s1(*s);
4. assignment optr:不必private
因为不会出现第二个instance,所以编译器默认生成的assignment operator只能自己assign自己,无效果。
5. dtor:看情况
dtor可能是有用的,如果允许用户自己释放singleton的话,因为singleton的定义
是无论何时在系统中最多有一个instance存在,可以是1个也可以是0个。但通常是定义一个release函数来free分配的内存而不是使用dtor。但即使dtor是public... 阅读全帖
p*****d
发帖数: 80
33
来自主题: Programming版 - c++ singleton questions
singleton
1. ctor: 必须private
否则会允许出现多个instance,这个和singleton的定义矛盾。而且必须定义无参数的ctor,否则编译器默认会定义一个。
2. get_instance method:必须static
否则无法在没有singleton instance的情况下调用产生第一个也是唯一一个instance。
3. copy ctor:必须private
否则下面的语句会出现两个instance
S *s = S::get_instance();
S s1(*s);
4. assignment optr:不必private
因为不会出现第二个instance,所以编译器默认生成的assignment operator只能自己assign自己,无效果。
5. dtor:看情况
dtor可能是有用的,如果允许用户自己释放singleton的话,因为singleton的定义
是无论何时在系统中最多有一个instance存在,可以是1个也可以是0个。但通常是定义一个release函数来free分配的内存而不是使用dtor。但即使dtor是public... 阅读全帖
z****e
发帖数: 54598
34
http://www.techempower.com/blog/2014/03/04/one-million-http-rps
关键字undertow
As we and our collaborators prepare Round 9 of our Framework Benchmarks
project, we had an epiphany:
With high-performance software, a single modern server processes over 1
million HTTP requests per second.
Five months ago, Google talked about load-balancing to achieve 1 million
requests per second. We understand their excitement is about the performance
of their load balancer1. Part of what we do is performance consulti... 阅读全帖
m**c
发帖数: 7299
35
【 以下文字转载自 Military 讨论区 】
发信人: msgc (为了下一代免遭变态残害), 信区: Military
标 题: Hate crime, Hate speech and Hate speech in media
发信站: BBS 未名空间站 (Sun Oct 27 01:49:49 2013, 美东)
(仇恨罪首先是犯罪,然后要确认犯罪原因是因为某些原因,如种族歧视引起的暴力行
为等。变态人渣多次威胁公正讨论变态淫乱行为对社会危害等正常言论是仇恨罪,其实
是缺乏法律常识的表现,也是其破坏言论自由的罪证。相反,ABC公开宣扬种族灭绝性
的屠杀,已经构成煽动犯罪的。ABC可以用是否实施了屠杀辩护,这也可以用犯罪动机
来反击,先例有学生跟老板闹矛盾说出炸掉实验室而被作为犯罪处理的,ABC的言论比
起来,跟加严重,已经有了实施犯罪的计划和细节。)
In both crime and law, hate crimes (also known as bias-motivated crimes, or
race hate) occur when a perpetrator t... 阅读全帖
l*********o
发帖数: 3091
36
来自主题: USANews版 - 托雷翁大屠杀
The rebel forces entered the city at six o'clock, accompanied by a mob of
over 4,000 men, women, and children from Gómez Palacio Municipality, Viesca
Municipality, San Pedro Municipality, Lerdo Municipality, and Matamoros
Municipality.[17][21] They were joined by citizens of Torreón and began the
sacking of the business district. The mob released prisoners from jail,
looted stores, and attacked people on the street. They soon moved to the
Chinese district. Men on horses drove Chinese from the ga... 阅读全帖
h******3
发帖数: 351
37
来自主题: JobHunting版 - gg面试题
public static SpecialSingleton getInstance(int i)
{
instance = instanceMap.get(i);
if (instance == null) {
//to avoid multithreading corruption
synchronized (SpecialSingleton.Class){
if (instance == null) {
instance = new SpecialSingleton(i);
instanceMap.put(i, instance);
n*******r
发帖数: 22
38
来自主题: JobHunting版 - C++ Singleton Template - 编译通不过
在Visual Studio上编译总是有错,哪位大侠能不能帮我看看是什么原因?
error LNK2019: unresolved external symbol "private: __thiscall
Singleton2::Singleton2(void)" (??0?$Singleton2@H@@AAE@XZ)
referenced in function "public: static class Singleton2 * __cdecl
Singleton2::GetInstance(void)" (?
GetInstance@$Singleton2@H@@SAPAV1@XZ)
// Singleton.h
template class Singleton2
{
private:
Singleton2(void);
~Singleton2(void);
Singleton2(const Singleton2&);
Singleton2& operator=(const Si... 阅读全帖
l*********y
发帖数: 142
39
看了wiki上的介绍,还算理解。
请问是下面这样吗?谢谢
class Singleton {
Singleton* GetInstance() {
if (! instance) {
pthread_mutex_lock();
if (! instance) {
instance = new Singleton();
}
pthread_mutex_unlock();
}
}
~Singleton() {
pthread_mutex_unlock();
}
private:
Singleton(){};
static Singleton* instance;
};
Singleton* Singleton::instance = NULL;
但是如果Singleton destructor被正常调用,pthread mutex这时是没有lock的
可以unlock吗... 阅读全帖
x*****p
发帖数: 1707
40
The singleton model with double check is as follows and is very popular in
the interview. However, there is a big bug in the following code.
public class MySingle {
private static MySingle instance;
private MySingle() {}
public static MySingle getInstance() {
if (instance==null) {
synchronized (MySingle.class) {
if (instance==null) {
instance = new MySingle();
}
}
}
return instance;
}
}
The code is lazy-loade... 阅读全帖
q**q
发帖数: 266
41
来自主题: JobHunting版 - how does AWS's auto scale work? (转载)
【 以下文字转载自 BuildingWeb 讨论区 】
发信人: qiiq (qiiq), 信区: BuildingWeb
标 题: how does AWS's auto scale work?
发信站: BBS 未名空间站 (Tue Apr 22 12:54:57 2014, 美东)
Suppose I launched an AWS instance, deployed my application (i.e., a Java
WAR). When a single instance is incapable of handling the heavy traffic, is
the AWS going to automatically duplicate the application to another instance
and redirect some traffic to the second instance? Here, I consider an "
instance" as a "server", but I'm not sure whether I'm c... 阅读全帖
s********e
发帖数: 340
42
Question:
A J2SE 5.0 class ThirdPartyObject, that is not thread-safe, is to be used
in some new java code. Which of the following design decision can be made to
ensure that no race condition will occour?
A. Store instance of ThirdPartyObject in a ThreadLocal
B. Provide a static getter for a ThirdPartyObject instance
C. Ensure that an instance of ThirdPartyObject is private and can only be
accessed using a public getter method
D Make any instance of ThirdParyObject a local(method) variable and e... 阅读全帖
t******r
发帖数: 28
43
来自主题: BrainTeaser版 - c++ 选择题求解
1. What is Visual C++?
a.It's a program used for starting other programs.
b.It's a program that you use to create other programs.
c.It's a program for browsing the Web.
d.It's a multimedia program that teaches you how to program.
2.What is the name of the process by which Visual C++ converts your C++
code to a program the computer can understand?
a.Compile.
b.Run.
c.Debug.
d.Build.
3.What do you call the container that stores all the files you write and
all the files Visual C++ writes to create ... 阅读全帖
s********b
发帖数: 3
44
来自主题: TrustInJesus版 - 再来提问一个信奉的问题

回应:
一、注意“长老”不是“老年人”可能是年轻人或中年人。请长老抹油祷告是很正常的
,任何相信圣经的教会都会有人相信并实践的。
二、我不清楚怎样解释‘“圣经”“新约”明确要求女人在教会要“闭口不言”’。
我不知道这个教导是不是绝对的,或“明确”。
例如,哥林多前书十一章,
4 凡男人祷告或是讲道(讲道或作说预言下同),若蒙着头,就羞辱自己的头。 5 凡
女人祷告或是讲道,若不蒙着头,就羞辱自己的头。因为这就如同剃了头发一样。 6
女人若不蒙着头,就该剪了头发。女人若以剪发剃发为羞愧,就该蒙着头。
这些经文意为,女人可以讲道(先知预言)只有蒙头(要不就剪头发)就可以了。与哥
林多前书十四章34-35节的教导有异。我没时间具体查原文希腊文怎么写的。
在网上找到一篇有关文章。(比较长)
http://www.ntrf.org/articles/article_detail.php?PRKey=16
Correctly Interpreting 1 Corinthians 14:33b-35 (Part 1&Part 2)
by Steve Atkerson
If you ever wis... 阅读全帖
L**********1
发帖数: 797
45
来自主题: BuildingWeb版 - 说说我用过的几家免费的主机
1. heroku.com
不错,一家成熟的PaaS(平台即服务),
我问过,一个帐号可以开750个instance,
可以用java,ruby,python,node.js,php...
一个instance 512M内存,他家为了防止滥用,每次都将免费的instance deactive。
加34刀,可以加到 1G内存,不会再催眠你的instance.
这家是建设在EC2上的,主要是卖PostgreSQL服务器。
你还可以购买几十种其它服务.
2. openshift.com
redhat的PaaS平台。
可以免费开3个,特色是JBoss。
这家性能不错。不催眠。
免费的内存512M,存储1G,可以安装mysql等等数据库。
mongodb就不是那么方便了,占空间太大。
如果你的项目发展顺利,可以scale up,
官方宣称可以支持到16G内存,百万/天的访问量。
和heroku一样,这家也是用的EC2。
3. aws.amazon.com
micro instance免费1年,但是不是真的全免费。
对IO,bandwith等等都有限制,超过还是要收费。
不过还是真的挺大方,
免费... 阅读全帖
l**b
发帖数: 64
46
【 以下文字转载自 Programming 讨论区 】
发信人: libb (你是猫鼬嘛), 信区: Programming
标 题: 小白弱问一个AWS EC2 outage的问题
发信站: BBS 未名空间站 (Wed Mar 12 20:30:46 2014, 美东)
本人歪打正着转行web developer,边工作边学的阶段。请教各位一个AWS EC2 outage
的问题,求大家指点,有说的外行的地方,请大家不要见笑。
现在网站用的是AWS EC2,大概日访问量200-400,去年是medium的instance,今年一月
份客户因为预算的原因,要求改到了small,一直到三月初都很正常。最近两周,网站
down了三次,第一次是server reboot但是MySQL没有autostart,改好了。第二down掉
之后,负责server的人给重新clone到了一个新的small instance。第三次down,给重
新换回了medium instance。
现在客户很不情愿换到medium的instance,因为觉得网站流量不大。请问大家,可能是
什么原因导致的这个问题... 阅读全帖
q**q
发帖数: 266
47
来自主题: BuildingWeb版 - how does AWS's auto scale work?
Suppose I launched an AWS instance, deployed my application (i.e., a Java
WAR). When a single instance is incapable of handling the heavy traffic, is
the AWS going to automatically duplicate the application to another instance
and redirect some traffic to the second instance? Here, I consider an "
instance" as a "server", but I'm not sure whether I'm correct.
Any advice is appreciated!
c*****t
发帖数: 1879
48
Actually, I am a big fan of static / singleton codes :)
Basically, I think of static functions as utility functions.
It is easy to wrap a static function inside a instance function. Never
forget that an instance function is only meaningful either when it
involves an instance variable or when one intends to override it. Yet,
since one usually prefer composition over inheritance, so creating an
instance function only when instance variables are involved. Besides
static function is much faster t
c*****t
发帖数: 1879
49
Actually, I am a big fan of static / singleton codes :)
Basically, I think of static functions as utility functions.
It is easy to wrap a static function inside a instance function. Never
forget that an instance function is only meaningful either when it
involves an instance variable or when one intends to override it. Yet,
since one usually prefer composition over inheritance, so creating an
instance function only when instance variables are involved. Besides
static function is much faster t
c*****t
发帖数: 1879
50
Actually, I am a big fan of static / singleton codes :)
Basically, I think of static functions as utility functions.
It is easy to wrap a static function inside a instance function. Never
forget that an instance function is only meaningful either when it
involves an instance variable or when one intends to override it. Yet,
since one usually prefer composition over inheritance, so creating an
instance function only when instance variables are involved. Besides
static function is much faster t
首页 上页 1 2 3 4 5 6 7 8 9 10 下页 末页 (共10页)