topics

全部话题 - 话题: method
首页 4 5 6 7 8 末页 (共10页)
t***a
发帖数: 416
1
别的method有改elementCount啊
t***a
发帖数: 416
2
刚才那个synchronized加在method前面,基本相当于
synchronized(this){

}
你下面这个是构造函数。。。。。你觉得能俩线程create出同一个instance么?
m*****n
发帖数: 204
3
Your question is a very good one. It touches on both points of multithreaded
programming:
Synchronization and memory coherency (memory barrier). Had vector been
implemented in java 1.5 or later, it wouldn't make much sense to synchronize
on these two methods. It's enough to declare the relevant vars as volatile.
But pre-1.5 volatile semantics was different, and synchronized was the only
way to add memory barrier.
c*********e
发帖数: 16335
4
elementcount可能在别的method里被改变。
c*m
发帖数: 836
5
I see what you are trying to achieve.Yeah the provided synchronization is on
the method level. If a node is added or removed while the collection is
being iterated over, it's going to throw an cocurrentmodificationexception.
Nonetheless I do think this is the only case you need to synchronize on the
whole collection, and should be avoided in general. If you do need to
iterate, try copyonwritearray which you can iterate without blocking
everyone else.

s
x****o
发帖数: 29677
6
来自主题: Java版 - Java synchronized method一问

那个method都不是static的,何况要不是一个instance还锁啥
r******r
发帖数: 700
7
来自主题: Java版 - Java synchronized method一问
concurrent access 只是相对意义上的并行,因为多线程对同一个对象的操作,总是
要通过加锁实现,比如 synchronized, 或 lock()。
所以 synchrnozied method 也是为了实现 concurrent 的目标,这样理解对么?
a*******e
发帖数: 3021
8
来自主题: Linux版 - input method in fedora 11?
I remember somebody said ibus is not good, what else we can install?
What was the input method in fedora 9? I like that one. sth-pinyin.
u****a
发帖数: 1098
9
来自主题: Linux版 - Unix Chinese input method
Is there other Chinese input method software for Unix except SCIM...
s*****l
发帖数: 2041
10
Thanks all for the comments.
I installed fcitx, but it seems it only works under default language set to
be Chinese. Is there any way to use Chinese input method with English as the
default language? Or am I missing some settings?
Thanks again.
u**r
发帖数: 663
11
ubuntu 9.10
ati mobility radeon 3450hd
driver from amd.com
run compiz-check结果:
Distribution: Ubuntu 9.10
Desktop environment: GNOME
Graphics chip: ATI Technologies Inc Mobility Radeon HD 3400 Series
Driver in use: fglrx
Rendering method: None
Xorg.0.log内容如下:
X.Org X Server 1.6.4
Release Date: 2009-9-27
X Protocol Version 11, Revision 0
Build Operating System: Linux 2.6.24-23-server i686 Ubuntu
Current Operating System: Linux ubuntu 2.6.31-19-generic #56-Ubuntu SMP
w*s
发帖数: 7227
12
Can't call method "header" on an undefined value at /.../login.pl line 19.
# process the form
if($usr eq "demo" and $pwd eq "demo")
{
$session = new CGI::Session();
print $session->header(-location=>'index1.pl');
}
This is the sample i copied from web, what does this error mean pl ?
file is at
http://www.perlguru.com/gforum.cgi?do=post_attachment;postatt_i
w********g
发帖数: 121
13
【 以下文字转载自 CS 讨论区 】
【 原文由 whatswrong 所发表 】
check file existance using java:
File.exists()
what is the default search method? I bet not sequential
G****A
发帖数: 4160
14
来自主题: Programming版 - c++ 是否也有class method??
即在不不实例化任何对象的情况下,仍然能够用class method 实现一些功能(输出字符
串)?
比如,在Ruby下,可以这样做:
>>class Person
>> def self.info
>> puts "Hi, Ni hao"
>> end
>>end
>>Person.info
输出:
>>Hi, Ni hao
不知道用c++可以不??谢谢回答
s***e
发帖数: 793
15
来自主题: Programming版 - c++ 是否也有class method??
static method.
class person{
public:
static void info() const{ std::cout<<" hello"< };
person::info();
z***e
发帖数: 5393
16
来自主题: Programming版 - c++ 是否也有class method??
sure.
don't have to be static. Once the method doesn't use "this", even it's null,
you can still use it.
e.g.
class A
{
public:
void output(){cout<<"I did her!!!"< };
...
A* a=null;
a->output();
..
it should work.
X****r
发帖数: 3557
17
来自主题: Programming版 - python 可以给class动态添加method吗?
Python不支持method overload。你需要自己判断类型来dispatch。
G****A
发帖数: 4160
18
来自主题: Programming版 - [c++] ?? about friend method
报错:In method B, "list" is not declared in this scope.
蔡鸟,求指教。
r****t
发帖数: 10904
19
item 18 (p80):
class Month {
public:
static Month Jan() { return Month(1); }
...
private:
explicit Month(int m);
};
这里的 static method 为什么不是
static Month Jan() { static Month m = Month(1); return m; }

按照 item 4 解释需要一个 local static,但是这里返回的不是 local static, 所以
每次 Month::Jan() 调用的时候都需要 create Month(1) 对象,而按 item 4 方法的
话,应该是 local static 这样只在第一次调用 Month::Jan() 的时候才创建对象。
这个的理解对不?
BTW,侯捷的 effective c++ 译的很烂,应该是机器翻译的再手修改了一下就拿出来卖
了。以前看到有人还推荐他译的哪一本来着。。
z*****n
发帖数: 447
20
比如:
#include
class f{
public:
virtual void p(){printf("father\n");}
};
class c : public f{
public:
void p(){
printf("child\n");
}
};
--------------------------------------
Derived Class 调用Base Class可以这样:
f *a = new c;
a->f::p(); // 这里Print的是"father"
---------------------------------------
如果
f *b = new f;
b怎样才可以调用到 c的method p()
多谢!
z*****n
发帖数: 447
21
比如:
#include
class f{
public:
virtual void p(){printf("father\n");}
};
class c : public f{
public:
void p(){
printf("child\n");
}
};
--------------------------------------
Derived Class 调用Base Class可以这样:
f *a = new c;
a->f::p(); // 这里Print的是"father"
---------------------------------------
如果
f *b = new f;
b怎样才可以调用到 c的method p()
多谢!
f*z
发帖数: 421
22
大牛,同学们,请教,static member method 可不可用default argument?比如,
enum Index
{
INDEX_A = 0,
INDEX_B
};
class foo
{
public:
static void method1( int a, int b = Index::INDEX_A);
};
编译可以过,但有什么要注意的地方?
多谢!
i**p
发帖数: 902
23
来自主题: Programming版 - C++ mutex vs Java synchronized method
Java synchronized method 在同一thread里是可以多次进入的. 锁是在thread上的.
C++ mutex 在释放之前被同一thread再次调用会造成死锁, 它是锁在mutex这个变量上
的.
请评论.
e***m
发帖数: 92
24
来自主题: Programming版 - C++ mutex vs Java synchronized method
Java synchronized method 的锁是在object上的
e*****w
发帖数: 144
25
来自主题: Programming版 - golang的method是后来加的?
不需要wrap. 比如string slice可以定义methods:
type Slice []string
func (s Slice) Filter(p func(string) bool) {
}
p*****2
发帖数: 21240
26
来自主题: Programming版 - golang的method是后来加的?

Float
就是有些code要这样写
func(param1, param2)
有些是这样写
object.method(param2)
风格不统一。
i**p
发帖数: 902
27
来自主题: Programming版 - C++ JNI code to invoke native method
是不是在问如何用 JNI code创建一个JAVA object,然后通过这个object调用native
method。
l**********n
发帖数: 8443
28
来自主题: Programming版 - Getter and setter methods are evil
http://www.javaworld.com/article/2073723/core-java/why-getter-a
They provide external access to implementation details. They violate the
encapsulation principle.
These procedural programmers read somewhere that fields should be private,
however, so they make the fields private and supply public accessor methods.
d******e
发帖数: 2265
29
来自主题: Programming版 - Getter and setter methods are evil
不是evil是stupid.
这是当年m$当道,软件升级会遇到的困难。
现在早就不需要了。特别是函数 1st citizen 加上immuatable class后,更佳不需要
考虑getter/setter

methods.
d******e
发帖数: 2265
30
来自主题: Programming版 - Getter and setter methods are evil
这片文章也是捣浆糊。傻逼java 程序猿每天研究怎么对象化,可惜这个对象化就众说
纷纭,一人一个想法。
违法这个原则那个原则。
殊不知,这些原则本身都是某些人对雨某些特定问题的特定解决方案。

methods.
O*****c
发帖数: 171
31
【 以下文字转载自 EmergingNetworking 讨论区 】
发信人: Oldmanc (oldmanc), 信区: EmergingNetworking
标 题: any method to access a server remotely?
发信站: BBS 未名空间站 (Tue Mar 20 11:00:28 2007)
3.0 beta radmin was once running on it but now it expired before I can
install any other remote access software. The windows 2003 intrinsic remote
desktop access service is not started either.
thanks a lot!
f*c
发帖数: 7
32
I carelessly delete one file, but didn't do anything else,
is there any method to regain that file in Unix?
Thanks a lot!
e***e
发帖数: 38
33
that method could be in another class/file.
What is the command? something like M+???
Thanks
f****r
发帖数: 709
34
来自主题: XML版 - NodeFromID Method???
Anybody can tell me how to define an xml schema to call the
nodeFromID method in xml dom object?
I appreciate if anybody can provide me some source code.
thanks
d******s
发帖数: 228
35
既然是大量生产服装,是不是用process cost method?
n*******8
发帖数: 893
36
来自主题: Accounting版 - FAR-Lecture 3-pooling interests method
will the "pooling of interests method" in homework reading of lecture 3 be
tested in the exam?
Thanks so much!!!
r*****e
发帖数: 4598
37
In this part, it said the markdown go aboe the totoal availabe for sale line
, does that means markdown participates in the cost-to-retail ratio? But it
said mardown does not participate in cost -to - retail ratio calculation
under conventional retail inventory method. I am kindda confused here. Also,
how did the question adjusted to lower of cost or market? I could not tell.
Thanks in advance for your help.
r*****e
发帖数: 4598
38
In the textbook, it said LIFO cost retail inventory method does not use
beginning inventory to reach the cost-to-retail ratio. Then, out of a sudden
, it start to use only beginning inventory to calculate the ratio. Why? Also
, could anybody explain what is that cost complement? Didn't find any
definition in the book.
Thank you for your help.
h*******0
发帖数: 92
39
因为第一年的时候, MEGA CORP已经先RECORD 了 DIVIDEND INCOME, 所以ADJUST的时候
,要把以前RECORD 的DIVIDEND INCOME 减去,不然DIVIDEND INCOME就会被RECORD了两次
了.
第二年,因为已经有SIGNIFICANT INFLUENCE了. 所以就直接按照PERCENTAGE RECORD
INVESTMENT INCOME.而且在EQUITY METHOD下, PENNY CORP 的NET INCOME TIMES THE
PERCENTAGE 应该就直接是INVESTMENT INCOME了
b********n
发帖数: 1651
40
为什么equity method要amortize FV of net asset 多于 book value of net asset的
部分?如果不理解直接记忆好难记。
B*********r
发帖数: 13
41
Let me give you a try. I apologize as I don't have Chinese input on this
computer.
For example, a $60M new building is coming into the play. On the book is $
30M only anyhow. 30 year depreciation life. We only the building will be
zero value after 30 years. Every year, how much appreciation should we take
to take down the building to zero?
On the book, we only have taken $1M/ year.
In reality, we need take $2M/year.
As the equity method, the $1M=$2M-$1M should be added to the expense.
FV is not ... 阅读全帖
b********n
发帖数: 1651
42
谢谢mm的讲解。不知为什么cost method不考虑building 的depreciation呢?
I**R
发帖数: 1309
43
pls define triangle method first
X******n
发帖数: 914
44
请帮忙下载这本书,包子感谢!!
RNA-Protein Interaction ProtocolsSeries: Methods in Molecular Biology, Vol.
488
Lin, Ren-Jang (Ed.)
2nd ed., 2008, XVI, 416 p. 81 illus., Hardcover
ISBN: 978-1-58829-419-7
http://www.springerprotocols.com/BookToc/doi/10.1007/978-1-60327-475-3
请发到x******[email protected]
f********r
发帖数: 190
45
有没有打算参加九月在woods hole 举行New Optical Methods in Cell Physiology会
的朋友吗?有一个问题想请教一下,就是$675.00的报名费是否包含食宿。 多谢。
w******e
发帖数: 1187
46
来自主题: Biology版 - paper help! methods in molecular biology
Methods Mol Biol. 1999;118:143-60.
Detection of nucleic acid interactions using surface plasmon resonance.
Crouch RJ, Wakasa M, Haruki M.
email: q****[email protected]
thank you!!
w******e
发帖数: 1187
47
来自主题: Biology版 - paper help! methods in molecular biology
我看一个methods上,在incubation结束后狂dilute一下,模拟ligand无法rebind的
状态,那么complex的数量根据时间成指数衰减,把几个time point上的
value plot一下可以搞出个koff来。
ITC倒没听过,不过0.1~0.2mg...我的蛋白都是买的,50ug300大刀,肯定没得玩~
l*****l
发帖数: 1451
48
来自主题: Biology版 - 求paper Methods Molecular Biology 2009
Methods in Molecular Biology, 2009, Volume 545, 21-37, DOI: 10.1007/978-1-
60327-993-2_2
Functional Dissection of Mitotic Regulators Through Gene Targeting in Human
Somatic Cells
x**w
发帖数: 112
49
Methods in Molecular Biology
2009, Volume 461, IV, 493-512,
DOI: 10.1007/978-1-60327-483-8_34
please send to n*****[email protected]
tons of thanks.
z*h
发帖数: 773
50
来自主题: Biology版 - The Scientific Method
The key reason of actual method is to prevent others from stealing your
hypothesis. In engineering fields, such doing may not be necessary. For SBIR
projects, you may start from zero experimental data, if you are not afraid
of possible stealing.
首页 4 5 6 7 8 末页 (共10页)