由买买提看人间百态

topics

全部话题 - 话题: object
首页 上页 1 2 3 4 5 6 7 8 9 10 (共10页)
r****x
发帖数: 1250
1
来自主题: HiFi版 - okeoke.net 2.2 支持歌词搜索
运行程序时总是有这个出错信息:
OS version: 5.1.2600.196608
okeoke version: 2.3.2.0
Program Folder: G:\OkeOke.Net\
Object reference not set to an instance of an object.
at OkeOke.Net.Controls.PlayListPanel.<_player_OnPlayerStopped>b__1() in D
:\Dev\OkeOke\OkeOke.Net\Controls\PlayListPanel.xaml.cs:line 566
at OkeOke.Net.Execute.<>c__DisplayClass2.b__0(
Action action) in D:\Dev\OkeOke\OkeOke.Net\Utilities\Execute.cs:line 26
at OkeOke.Net.Execute.OnUIThreadAsync(Action action) in... 阅读全帖
i*******n
发帖数: 114
2
nvidia interview experience
location:
NVIDIA
San Thomas Expressway, Santa Clara
duration
2 hours, 1PM to 3PM
2 interviewers, each for 1 hour
------------------------------------------
cdj
xor eax, edx
sub eax, edx
问我这段代码干嘛。就是算负数的补码(Two's Complement),正数没变化
logic puzzle,
4 fuses, each fuse burns out in 40 minutes, create a fuse that can burn
in
20 minutes. slightly flawed problem. Because when you burn the fuse from
two
ends, it is not exactly 20 minutes. (Two combustion points are
certainly
faste... 阅读全帖
c**********e
发帖数: 2007
3
来自主题: JobHunting版 - C++ Q 103-105
C++ Q 103: stream manipulators
Multiple choices
Which options are true of stream manipulators?
a. To use manipulators, you need only to include iostream.h as a header in
your C++ program
b. To use manipulators, you need only to include iomanip.h in your program
c. Stream manipulators are special functions which can be included in an I/O
expression
d. endl is a stream manipulator
Answer: b, c, d
C++ Q 104: object reference
Multiple choices
Which of the following statements are correct?
a. When pa... 阅读全帖
az
发帖数: 16686
4
来自主题: NextGeneration版 - First Aid for a Choking Child
http://www.whattoexpect.com/toddler/childhood-injuries/first-ai
First Aid for a Choking Child
The best way to help a choking child is to be prepared—and that means
enrolling in a CPR class (or a refresher course) so you'll know what to do
in case of an accident. But there are other steps you can learn so that you
know what to do—and how to act immediately if see your child choking.
How choking happens: It goes without saying that it’s a scary thing to see
a choking child. Usually, it happens whe... 阅读全帖
r***u
发帖数: 1272
5
1. 两幅图片同时动作
PowerPoint的动画效果比较多,但图片只能一幅一幅地动作。如果你有两幅图片要一左
一右或一上一下地向中间同时动作,可就麻烦了。其实办法还是有的,先安置好两幅图
片的位置,选中它们,将之组合起来,成为"一张图片"。接下来将之动画效果设置为"
左右向中间收缩",现在请看一看,是不是两幅图片同时动作了?
2. 滚动文本框的制作
右击工具栏打开"控件工具箱",再点击文本框,而后从"属性"里面把滚动条打开,在TEXT
里面输入文本框的内容.(完成)还可以通过"其他控件"中的SHOCKWAVE FLASH OBJECT 实
现PPT中加入FLASH。
3. 轻松隐藏部分幻灯片
对于制作好的powerpoint幻灯片,如果你希望其中的部分幻灯片在放映时不显示出来,
我们可以将它隐藏。方法是:在普通视图下,在左侧的窗口中,按 Ctrl,分别点击要
隐藏的幻灯片,点击鼠标右键弹出菜单选“隐藏幻灯片”。如果想取消隐藏,只要选中
相应的幻灯片,再进行一次上面的操作即可。
4.在PPT演示文稿内复制幻灯片
要复制演示文稿中的幻灯片,请先在普通视图的“大纲”或“幻灯片”选项中,选择... 阅读全帖
d**********o
发帖数: 1321
6
来自主题: WebRadio版 - 潜水员冒泡兼征版友意见
第一个项目report
这时偶刚到CSAC工作不久,与小A同学还不熟,我用的还是latex。随着贴的作业越来越
多,应该是用有共同爱好的小伙伴更亲密些。这次贴latex,下次才再org-mode。
\documentclass[b5paper,11pt, abstraction, titlepage]{scrartcl}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{CJKutf8}
\usepackage{multirow}
\usepackage{multicol}
\usepackage{listings}
\usepackage{geometry}
\geometry{b5paper}
\usepackage{graphicx,floatrow}
\usepackage{graphicx,subfigure}
\newsavebox{\abstractbox}
\renewenvironment{abstract}
{\begin{lrbox}{0}\begin{minipage}{\t... 阅读全帖
d**********o
发帖数: 1321
7
来自主题: WebRadio版 - 潜水员冒泡兼征版友意见
第一个项目report
这时偶刚到CSAC工作不久,与小A同学还不熟,我用的还是latex。随着贴的作业越来越
多,应该是用有共同爱好的小伙伴更亲密些。这次贴latex,下次才再org-mode。
\documentclass[b5paper,11pt, abstraction, titlepage]{scrartcl}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{CJKutf8}
\usepackage{multirow}
\usepackage{multicol}
\usepackage{listings}
\usepackage{geometry}
\geometry{b5paper}
\usepackage{graphicx,floatrow}
\usepackage{graphicx,subfigure}
\newsavebox{\abstractbox}
\renewenvironment{abstract}
{\begin{lrbox}{0}\begin{minipage}{\t... 阅读全帖
f*******n
发帖数: 12623
8
来自主题: Java版 - 如何造Array of Generic Type
You can't. T doesn't exist at runtime. It's an illusion. Just remove T and
ask yourself how to do it. If you cannot do it without T, then you cannot do
it with T either:
public class SpecialArray {
Object[] createSpecialArray()
{
return (Object[])Array.newInstance(???, 10);
// How to get T?
// You do not pass anything into this method
}
}
Your problem is that arrays in Java know their component type at runtime. If
you do new String[5], the object knows it's an... 阅读全帖
c**********e
发帖数: 2007
9
来自主题: Programming版 - C++ Q 103-105 (转载)
【 以下文字转载自 JobHunting 讨论区 】
发信人: careerchange (Stupid), 信区: JobHunting
标 题: C++ Q 103-105
发信站: BBS 未名空间站 (Fri Oct 28 23:15:10 2011, 美东)
C++ Q 103: stream manipulators
Multiple choices
Which options are true of stream manipulators?
a. To use manipulators, you need only to include iostream.h as a header in
your C++ program
b. To use manipulators, you need only to include iomanip.h in your program
c. Stream manipulators are special functions which can be included in an I/O
expression
d. endl is a s... 阅读全帖
f*******n
发帖数: 12623
10
来自主题: Programming版 - a python question
In Python, every value is a pointer to an object. Assigning one variable to
another copies the pointer so you have two pointers that point to the same
object. Since they point to the same object, the id() will be the same.
a = object()
b = a
# id(a) and id(b) are the same
c = object()
b = c
# id(b) and id(c) are the same,
# different from id(a) which is the same as before
Just like in C++ for example:
object *a = new object; // pretend we have a class called "object"
object *b = a;
// a and b ar... 阅读全帖
z****e
发帖数: 54598
11
来自主题: Programming版 - oop还是跟fp是对立的
fp为了保证func的复用,尽量抹杀object的存在
因为class/object这种东西是特殊的数据结构
会导致func跟这种特殊的结构绑定
就很难复用,比如go(USACity la)和go(ChineseCity gz)
是不一样的,因为参数的结构不一样,这就限制了其复用
所以最后fp为了能够重用,写的func参数都是map, list,sring,int这些
而map&list注定对于一个object描述的力度是有限的
限制少木有错,但是就容易包含有各种错误等等
所以为了让func独立出去,稳定其1st class的地位
注定要削弱class/object的存在感
而oop则反过来,提倡并鼓励使用class/object
像java这种,则强迫func寄托在object下面
虽然你也可以定义全局的Util,但是毕竟static方法是很少滴
object才是1st class的地位,这样做的好处就是
不依赖func,而依赖每个object自身
每个class自己有啥问题,自己搞定,当然会有各种搞不定
搞不定没关系,异常catch住,然后收拾掉就好
不要影响其他object就行,... 阅读全帖
d******e
发帖数: 2265
12
来自主题: Programming版 - 感觉python的前途堪忧 (转载)
转帖:
克里斯可以说是天才少年和好学生的代名词,他在2000年本科毕业之后,继续攻读计算
机硕士和博士。但克里斯并不是宅男,学习之余他手捧「龙书」游历世界,成为德智体
美劳全面发展的好学生。之后就是一篇又一篇的发表论文,硕士毕业论文即提出了一套
完整的运行时编译思想,奠定了 LLVM 的发展基础,读博期间 LLVM 编译框架在他的领
导下得到了长足的发展,已经可以基于 GCC 前端编译器的语义分析结果进行编译优化
和代码生成,所以克里斯在2005年毕业的时候已经是业界知名的编译器专家了。
注:很多计算机专业的大学生经常问我在大学里学点什么好,看看克里斯就行了。以目
前的科技信息开放程度,如果你在自己感兴趣的领域里用心耕耘,再加上那么一点点天
分,毕业时成为某一个专有领域的专家应该不是问题。那时就不是你满世界去找工作了
,而是工作满世界来找你!
克里斯毕业的时候正是苹果为了编译器焦头烂额的时候,因为苹果之前的软件产品都依
赖于整条 GCC 编译链,而开源界的这帮大爷并不买苹果的帐,他们不愿意专门为了苹
果公司的要求优化和改进 GCC 代码,所以苹果一怒之下将编译器后端直接替换为 LLVM... 阅读全帖
v**********m
发帖数: 5516
13
来自主题: _pennystock版 - soros的精神导师:Karl Popper的生平
Sir Karl Raimund Popper, CH FRS[1] FBA (28 July 1902 – 17 September 1994)
was an Austro-British[2] philosopher and a professor at the London School of
Economics.[3] He is regarded as one of the greatest philosophers of science
of the 20th century;[4][5] he also wrote extensively on social and
political philosophy.
Popper is known for his attempt to repudiate the classical observationalist
/ inductivist form of scientific method in favour of empirical falsification
. He is also known for his oppo... 阅读全帖
h*****9
发帖数: 6643
14
没听说过是你自己无知。这只能说明你是个很容易被骗的无知之徒, 你又要凭你自己的无知骂人,你又无耻了。
揭露 BIG-BANG 是披着科学外衣的宗教,这在10年前就有很多文章了。
THE "BIG BANG" IS JUST RELIGION DISGUISED AS SCIENCE
by Michael Rivero
Once upon a time, a long time ago, there was this guy named Aristotle.
Pretty sharp fellow; he thought up a lot of good things. But, occasionally
he made a mistake.
One mistake he made was to toss an orange up in the air and watch it come
straight back down to his hand. Aristotle reasoned that if he was moving,
the orange would have flown... 阅读全帖
P********l
发帖数: 452
15
来自主题: JobHunting版 - Permutation一问
你的想法是对的。但是实现起来还是优点麻烦。
如果一个数组的长度是n,那末,一共有n!种排列. 每种都可以写成基数{n, n-1, ..
., 2, 1, 0}的格式。比如,第一个到第三个是{0,0...,1,0},{0,0...1,0,0},{0,0..
.2,1,0}.
这个序列的含义是左边有多少个数比当前的数大。
比如,给定一个排列 {3,2,1,4}, 那末对应的序列是{2,1,0,0}.
根据这种方法,对于一个随机数,可以在o(n)内产生对应的排列。
代码:
完整的代码在:
http://code.google.com/p/sureinterview/source/browse/src/lib/combination/PermutationImpl.java
看看有问题没?
@Override
public T[] get(Long index) {
// adjust to 1-based.
index++;
// parse the index to {n-1, n-2, ... 3, 2, 1, 0}-bas... 阅读全帖
b*******n
发帖数: 847
16
来自主题: JobHunting版 - 一个新鲜twitter面经
interview 迟到了20分钟,只问了一道oo题,open end discussion。其实应该挺简单
,但答得不咋地,发上来给大家讨论造福后人吧~
假设有如下class: Account,Campain, TargetingCritierion,Logger. 前三个
class包含account,campain,和target的相关信息,后面的logger class用来输出前
三个class的信息。以下是初始code,问在class设计上有什么可以改进的地方,怎么改
进,怎么进一步改进,等等
class Account
attr_accessor :id, twitter_handle
end
class Campaign
attr_accessor :id, :name, :budget, :account
end
class TargetingCriterion
attr_accessor :targeting_type, :targeting_value
end
class Logger
def log(object)
case object... 阅读全帖
y**********a
发帖数: 824
17
没有问题,以下是 hashcode 的 contract:
Whenever it is invoked on the same object more than once during
an execution of a Java application, the {@code hashCode} method
must consistently return the same integer, provided no information
used in {@code equals} comparisons on the object is modified.
This integer need not remain consistent from one execution of an
application to another execution of the same application.
If two objects are equal according to the {@code equals(Object)}
method, then calling the ... 阅读全帖
y**********a
发帖数: 824
18
没有问题,以下是 hashcode 的 contract:
Whenever it is invoked on the same object more than once during
an execution of a Java application, the {@code hashCode} method
must consistently return the same integer, provided no information
used in {@code equals} comparisons on the object is modified.
This integer need not remain consistent from one execution of an
application to another execution of the same application.
If two objects are equal according to the {@code equals(Object)}
method, then calling the ... 阅读全帖
y****s
发帖数: 46
19
来自主题: JobHunting版 - Job opportunities at PVH in NJ
PVH has the following job openings.
1. Business Systems Analyst-Commercial IT-Store Systems
2. Testing Manager
3. Senior Developer-Middleware
for more info, please check www.pvh.com site.
Business Systems Analyst-
Commercial IT-Store Systems
More information about this job:
Overview:
PVH Corp. is a global, action-oriented company characterized by achievement
and commitment. We
want people who are hungry for both professional and personal growth; who
will help us take our
brands, our businesses a... 阅读全帖
g*****y
发帖数: 349
20
第一次买Tiger Direct的东西做Total defense的rebate,现在想去把自动续订关掉,
可是网站(https://my.totaldefense.com/Login2.aspx)根本登陆不进去啊,无论用
哪个电脑,什么浏览器,总是出现这个信息:
Server Error in '/' Application.
Object reference not set to an instance of an object.
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information
about the error and where it originated in the code.
Exception Details: System.NullReferenceException: Object reference not set
to an i... 阅读全帖
y****s
发帖数: 46
21
来自主题: NewJersey版 - job opportunities at PVH
PVH has the following job openings.
1. Business Systems Analyst-Commercial IT-Store Systems
2. Testing Manager
3. Senior Developer-Middleware
for more info, please check www.pvh.com site.
Business Systems Analyst-
Commercial IT-Store Systems
More information about this job:
Overview:
PVH Corp. is a global, action-oriented company characterized by achievement
and commitment. We
want people who are hungry for both professional and personal growth; who
will help us take our
brands, our businesses a... 阅读全帖
q**w
发帖数: 782
22
http://www.technologyreview.com/view/509106/best-of-2012-chines
Best of 2012: Chinese Physicists Smash Distance Record For Teleportation
The ability to teleport photons through 100 kilometres of free space opens
the way for satellite-based quantum communications, say researchers
Teleportation is the extraordinary ability to transfer objects from one
location to another without travelling through the intervening space.
The idea is not that the physical object is teleported but the information
th... 阅读全帖
m********5
发帖数: 17667
23
This is dynamic language. `Person` is NOT a C++ or java like `class`. `
Person` is just a name in global scope referring to an instance of `type`.
In another word `Person` is nothing but a key in the global name dictionary.
During interpretor exiting, as @hatemaths pointing out, when __del__ get
called, there is no guarantee any referred global name still exists (
deleting order is unpredictable). In this case `Person` in the global scope
has already being destroyed. But in the local scope it st... 阅读全帖
N*******t
发帖数: 66
24
来自主题: Programming版 - 牛人们来看看这个Dao语言怎么样
1. Given a set of candidate garbage objects,
scan the referencing graph accessible from them,
and for each object, reduce (by one) the refcounts
of the objects that are referenced by this object.
2. Then scan the graph again, and for each object
that has NON-ZERO refcount, increase (by one)
the refcounts of the objects that are referenced
by this object.
3. Now any object on the graph with zero refcount
is a real garbage object.
Objects on a dead cycle will have their... 阅读全帖
o**2
发帖数: 168
25
来自主题: Programming版 - FMP mini profile
费了老大的劲才把FMP的介绍塞进了2000个字符里。大家帮忙挑挑毛病。
Fast Messenger Programming (FMP) is a new object-based model for general
concurrent programming with NO threads.
FMP elements:
• Active objects – a type of virtual objects that represent business
functions
• Messenger objects – act as virtual machines to host and realize
active objects
• Text-based names – for FMP entities
An active object is defined as an object with:
• A name
• A list of services – each has a name and can be vie... 阅读全帖
c*****n
发帖数: 75
26
〉〉“真是你妹啊”
这段话有什么问题吗?首先,你漏掉了这段话前的 "In Addition, protected has
another important property: A derived object...."
在结合书中这段话后面的的例子, 这段话的意思非常清楚了。并无冗余。
以下是摘要全段:
In addition, protected has another important property:
· A derived object may access the protected members of its base class only
through a derived object. The derived class has no special access to the
protected members of base type objects.
As an example, let's assume that Bulk_item defines a member function that
takes a reference to a Bulk_i... 阅读全帖
N******K
发帖数: 10202
27
根据 context object的想法 我轮了一个
方法1 测试:
for循环 100000000 (8个零) 次
{
new 一个 object
注册 object 到 context object
delete 这个 object
//自动从 context object 删除object记录
}
方法2 测试:
for循环 100000000 (8个零) 次
{
new 一个 object

delete 这个 object
}
方法3 测试:
for循环 100000000 (8个零) 次
{
生成一个 stack object
//{}结束 自动删除
}
release 模式 测试
时间
方法 1 : 48 秒
方法 2 : 6 秒
方法 3 : 1 秒
还可以 主要用来做计算 性能还可以

impossible
is
one
X***9
发帖数: 7385
28
来自主题: Automobile版 - 2016 HONDA PILOT 参数
Sleek and athletic exterior meets interior elegance for a commanding yet
sophisticated presence
Top-of-the-line Elite trim introduces a premium look, feel and
experience with highest level of standard features
Direct injected 3.5-liter i-VTEC® engine with more horsepower and
torque than outgoing model
Smartest Pilot ever with new Intelligent Traction Management system,
Honda Sensing™ technologies and i-VTM4 AWD system
The all-new, third generation 2016 Honda Pilot will... 阅读全帖
l*****g
发帖数: 685
29
来自主题: JobHunting版 - Amazon的LRU设计题
最近Amazon面试好像喜欢问LRU (least recently used cache)的设计
我用doubly-linked list 和 hashtable 实现了一个简单的LRU, 抛砖引玉,供大家做
参考。祝大家都顺利拿到offer.
using System;
using System.Collections.Generic;
namespace LRU
{
public class Cache
{
public class Container
{
public Object obj;
public Container next;
public Container prev;
public Container(object o)
{
this.obj = o;
}
}
private const int MaxSize ... 阅读全帖
f**********t
发帖数: 1001
30
来自主题: JobHunting版 - Amazon一道synchronization的面试题
刚看了一个例子。大概是说static synchronized method是对class object lock,
synchronized method是对当前object lock。如果都是static synchronized或者都是
synchronized,则可以实现synchronization,因为是对同一个object。
那么在这个例子里面,f1和f2的两个synchronized是对不同的object lock。要让它们
真正synchronized,函数得用static synchronization。
以上是我的观点,不知对不对?
Using synchronized keyword along with method is easy just apply synchronized
keyword in front of method. What we need to take care is that static
synchronized method locked on class object lock and non static synchroniz... 阅读全帖
m*****n
发帖数: 204
31
来自主题: JobHunting版 - 小弟求问LinkedIn那道Deep Iterator的题
攒了个段子请大牛点评一下:
// Not thread-safe
// Talk about validation requirement: none vs in next() vs in constructor
private static class DeepIterator implements Iterator {
private final Iterator myIterator;

private final Class eleType;

private final Iterator empty = new ArrayList().iterator();

private Iterator head = empty;

DeepIterator(List list, Class eleType) {
this.myIterator = list.iterator();
this.eleType = e... 阅读全帖
m*****n
发帖数: 204
32
来自主题: JobHunting版 - 小弟求问LinkedIn那道Deep Iterator的题
攒了个段子请大牛点评一下:
// Not thread-safe
// Talk about validation requirement: none vs in next() vs in constructor
private static class DeepIterator implements Iterator {
private final Iterator myIterator;

private final Class eleType;

private final Iterator empty = new ArrayList().iterator();

private Iterator head = empty;

DeepIterator(List list, Class eleType) {
this.myIterator = list.iterator();
this.eleType = e... 阅读全帖
w********a
发帖数: 621
33
来自主题: JobMarket版 - job opportunities in Billerica MA
My client in Billerica MA has following open positions.
The base salary for senior position is around 110K
The base salary for principal position is around 130K
Please send your resume to me if you are interested in one of the positions.
Thanks in advance.
====================================================================
Title: Enterprise Architect
Division: G&A
Department: Technology IT and Infrastructure
Location: USA - Massachusetts - Billerica
Description:
The Enterprise Architect will wo... 阅读全帖
w********a
发帖数: 621
34
My client in Billerica MA has following open positions.
The base salary for senior position is around 110K
The base salary for principal position is around 130K
Please send your resume to me if you are interested in one of the positions.
Thanks in advance.
====================================================================
Title: Enterprise Architect
Division: G&A
Department: Technology IT and Infrastructure
Location: USA - Massachusetts - Billerica
Description:
The Enterprise Architect will wo... 阅读全帖
t******r
发帖数: 28
35
来自主题: 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 ... 阅读全帖
a***y
发帖数: 19743
36
☆─────────────────────────────────────☆
JunPengJia (贾君鹏(Junpeng Jia)) 于 (Fri Oct 22 17:01:28 2010, 美东) 提到:
首先要批评dsb的逻辑混乱,说PC open没错,但那是IBM open,不是微软Open,而IBM
已死,说Open就牛逼是讲不通的。
好下面开始胡说八道。
很久很久以前,毛主席还在,林副统帅刚刚去世的时候,美帝国主义的Intel公司整出
了4004CPU,一帮哥们闲得没事干整出了不少蛋疼的“电脑”,一般就是几盏灯一闪一
闪,没有键盘也没有鼠标,也没有显示器,也没有……反正都没有。当时还有摩托罗拉
做CPU
后来杀出了乔布斯教主,教主本人并不是geek,也从来不是geek,但教主本人极具忽悠
天赋,骗超级geek 沃兹尼克Wozniak搞了Apple I,而教主牛逼之处在于从一个消费者
角度看待问题,坚决不同意用小灯(没人会用)或LED面板(买不起)做显示器,而是
可以直接用电视。于是成功卖出若干。在华国锋主席的时代,教主卖出了200台左右,
一台卖666.66刀... 阅读全帖
a****a
发帖数: 5763
37
因势而动
1981年, Jean-Marie Hullot拿到巴黎第十一大学的计算机科学博士资格后,开始了法
国国家信息与自动化研究所(INRIA)的研究生活。
Jean-Marie Hullot的名字似乎不为大众所熟知,但他设计的Interface Builder 却深
入人心,创造了一个个软件神话。
20世纪70年代初,正是面向对象程序设计开始走上历史舞台的时期。许多现代计算机技
术的诞生地Xerox PARC(施乐帕洛阿尔托研究中心)的Alan Kay、Dan Ingalls、Ted
Kaehler 、Adele Goldberg等人,从1969年开始研发一款面向对象的程序语言
Smalltalk,并于1980年正式公布。这是一个完整地实现面向对象范型的编程套件,包
含了一种面向对象的程序设计语言、一种程序设计库和一个应用开发环境(ADE)。
虽然当时的机器跑得巨慢无比,但Smalltalk先进的思想对其他众多的程序设计语言(
Objective-C、Actor、Java和 Ruby)的产生起到了极大的推动作用,对计算机工业界
的发展产生了非常深远的影响。我们将会在今后介绍Obj... 阅读全帖
t****t
发帖数: 6806
38
来自主题: Programming版 - double-checked locking
刚好最近写了一些多线程的东西, 自己也研究了一下, 多写几句.
yes, the problem is shared_ptr<> itself may not be lock-free (and atomic
automatically). so it's possible that when doing
p=shared_ptr(new Object); // why not write p.reset(new Object)?
p may be in an intermediate indetermined state. it's possible that p get
accessed during this state and you are in race condition.
However, since you used shared_ptr, you can use it's accompanying atomic
store for this purpose (not fully implemented in libstdc++ yet)
atomic... 阅读全帖
a***y
发帖数: 2803
39
来自主题: Programming版 - string operator +
string s = "hi" + "ji";
是不是left operand,right operand都是const char*,在5个函数里都没有这个
signature?
"At least one of the arguments used has to be a string object."
参考:
http://www.cplusplus.com/reference/string/operator+/
Parameters
lhs
A string object, a c-string or a character. Its content forms the
beginning of the returned object.
rhs
If lhs is a string object, this is another string object, a c-string or
a character.
If lhs is not a string object, this is a string object.
In either cas... 阅读全帖
o**2
发帖数: 168
40
来自主题: Programming版 - FMP vs ExecutorService/Future
在执行阶段,我们来比较task的重用性。一个task object(不是class)如果不需要输
入,还是有可能可以被重用的。但是重用同一个task object的话,那这个task object
的内部logic就被暴露在多线程的并发环境里了。
而active object有headcount的概念,一个headcount就是一个individual worker,于
是它的implementation object被保证了运行在单线程环境里。一个active object可以
是一个group of individual workers,每个worker有其自己的impl object,所以对
impl object来说,总是运行在单线程环境里。
Example 3 里的Calculator就是一个implementation object。
在执行阶段,FMP胜。
k**********g
发帖数: 989
41

));
Creates a new std::vector on heap. The constructor parameter (100)
sets the vector's initial size to 100, and each element (of type double) is
default initialized, making them all double(0.0).
The pointer is assigned to a boost shared_ptr, which owns it.
(Internally, there is another hidden object created, which contains a
reference count. shared_ptr then points to this hidden object.)
Prints the first element to standard output.
A new boost::shared_ptr is initialized by sharing the... 阅读全帖
t******r
发帖数: 28
42
来自主题: Computation版 - 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 ... 阅读全帖
D*V
发帖数: 3096
43
http://www.youtube.com/watch?v=ijdNHojNfFM
http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="425" height="350">http://www.youtube.com/v/ijdNHojNfFM">http://www.youtube.com/v/ijdNHojNfFM" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" wmode="t... 阅读全帖
b*******y
发帖数: 4304
44
摘自 WIKI:
Conspiracists devote much of their efforts to examining NASA photos.
They point to oddities in photographs and films purportedly taken on
the Moon. Photography experts (even those unrelated to NASA) answer
that the oddities are what one would expect from a real Moon landing,
and not what would happen with tweaked or studio imagery.
Conspiracists also argue that whistleblowers may have knowingly
tweaked photos in hope of uncovering NASA. Some of the main arguments
and counter-arguments ... 阅读全帖
f****l
发帖数: 8042
45
来自主题: Military版 - 湖南4岁男童活活噎死 视频慎入
first aid: under 1 year
conscious baby
1. Lay the infant facedown on your forearm, resting your arm on your thigh
to hold her steady. Support her chin firmly with one hand, and be sure her
head and neck are lower than her torso.
2. Using the heel of your free hand, deliver five quick blows right between
her shoulder blades.
3. If she doesn't cough up the object, turn her onto her back. Rest her on
your forearm, using your thigh to support her body and your hand to steady
her head and neck. Make ... 阅读全帖
m******p
发帖数: 5393
46
来自主题: Automobile版 - HONDA跟Subaru哪个主动安全牛逼?
各有利弊
其他车型的radar sensor是放前保险杠后边散热器附近的吧,貌似较容易damage,但是
radar探测距离应该远。
eyesight的肯定和他的俩摄像头的探测能力直接相关了,视力要是出问题了那啥也别说了
Eyesight的disclaimer
The twin video cameras’ field of view is 25 degrees horizontally from the
center of the windshield. Unlike human vision, EyeSight has no peripheral
vision
The twin video cameras’ field of vision extends up to 260 feet in front of
the vehicle, but objects very close to the vehicle may not be detected
EyeSight works to recognize obstacles within a 19 mph (or less) spee... 阅读全帖
r******r
发帖数: 700
47
来自主题: JobHunting版 - Apple Siri 组 Java 测试题
/**
* Using {@link AppleExercise.Problem1.SampleCache} as a starting point,
answer questions 1-3 by
* creating 3 new inner classes within {@link AppleExercise.Problem1}
below.
*/
public static class Problem1 {
public interface Cache {
public void put(Object key, Object value);
public Object get(Object key);
}
public static class SampleCache implements Cache {
private Map map;
public SampleCache() {
... 阅读全帖
b**********5
发帖数: 7881
48
来自主题: JobHunting版 - 求neflix mobile面经 大包子
第三面: 一开始写一个非常简单的题目, 比如有这么一个json schema:
{ “score” : 0.9,
"id" : "abc",
"categories" : ["japanese", "bento"]
}
然后现在给你一个collection of those objects, sorted by score, remove
duplicate ids, return a new list
我这题竟然写的有点磕磕碰碰, 一开始稀里糊涂去remove duplicate score。。 然后
在弄了个hashmap存id为key, 然后object为value, 准备再输出hashmap。。。 然后
买上被指出不对, 最后改为hashset, 然后写对。。。
然后他问,我现在要每个schema object, 要output它的category list中的一个
category。 但一个category只能有一个corresponding schema object。 现在要
output as many schema... 阅读全帖
w*******g
发帖数: 9932
49
来自主题: Parenting版 - 求推荐给10岁孩子看的java script书
When you start to learn a programming language, you want to start from a
pure language.
Before you read my incomprehensible post, you can think of Ruby as a piano
that is suitable for beginners since it got the purest sound. JavaScript is
more like an electric keyboard or guitar. Funky but hard to get the right
tune. Expert players can play fantastically but beginners will only produce
noise.
=========
Programming languages have many categories and the division is not always
clear.
However, you... 阅读全帖
首页 上页 1 2 3 4 5 6 7 8 9 10 (共10页)