H********g 发帖数: 43926 | 1 【 以下文字转载自 Military 讨论区 】
发信人: Pizzle (), 信区: Military
标 题: 回顾我来美9年和所有白牛的互动
发信站: BBS 未名空间站 (Tue Mar 28 09:41:58 2017, 美东)
我定义的白牛是一看就是白人,而不是abc也不是墨西哥或者黑人混血。英语没有口音
。所以东欧甚至英法第一代移民也不算。
第一年,在课堂里,下课时候我和一老中讨论程序当中, 写 a=b, 然后a=3. b是不是
也等于3。后来一胖白牛走过,问:“You guys seem really intense, what are you
arguing about? I have to know". 让后我迫不及待的对对方复述了我的论点,就是b
等不等于3取决于这个语言里的整数是不是mutable。她好像没怎么听懂,松松肩膀走开
了。一胖子,没什么兴趣。
还是第一年,学校orientation,站在操场上做游戏,随机配对。正好和一白妞在我旁边
,就配上了。让后让互相问对方一些无聊问题。最后让双方就pc还是mac好进行争论,
越激烈越好。争论结束竟然让所有pa... 阅读全帖 |
|
H********g 发帖数: 43926 | 2 Alone I stand in the autumn cold
On the tip of Orange Island,
The Hsiang flowing northward;
I see a thousand hills crimsoned through
By their serried woods deep-dyed,
And a hundred barges vying
Over crystal blue waters.
Eagles cleave the air,
Fish glide in the limpid deep;
Under freezing skies a million creatures contend in freedom.
Brooding over this immensity,
I ask, on this boundless land
Who rules over man's destiny?
I was here with a throng of companions,
Vivid yet those crowded months and ... 阅读全帖 |
|
r*****m 发帖数: 287 | 3 【 以下文字转载自 Love 讨论区 】
发信人: wmbyhh (wmbyhh), 信区: Love
标 题: 人生6大哲理 (转载)
发信站: BBS 未名空间站 (Wed Jul 23 01:46:12 2008)
发信人: Dreamer (不要问我从哪里来), 信区: Dreamer
标 题: 人生6大哲理
发信站: BBS 未名空间站 (Wed Jul 23 01:45:57 2008)
1.记住该记住的,忘记该忘记的。改变能改变的,接受不能改变的。
Remember what should be remembered, and forget what should be forgotten.
Alter what is changeable, and
accept what is mutable.
2.能冲刷一切的除了眼泪,就是时间,以时间来推移感情,时间越长,冲突越淡,
仿佛不断稀释的茶。
Apart from tears, only time could wear everything away. While feeling is
being proces |
|
C****i 发帖数: 1776 | 4 CHAPTER II
Of God, and of the Holy Trinity
I. There is but one only,[25] living, and true God,[26] who is infinite in b
eing and perfection,[27] a most pure spirit,[28] invisible,[29] without body
, parts,[30] or passions;[31] immutable,[32] immense,[33] eternal,[34] incom
prehensible,[35] almighty,[36] most wise,[37] most holy,[38] most free,[39]
most absolute;[40] working all things according to the counsel of his own im
mutable and most righteous will,[41] for his own glory;[42] most loving,[... 阅读全帖 |
|
C****i 发帖数: 1776 | 5 CHAPTER 9
OF FREE WILL
1. God hath endued the will of man with that natural liberty, that it is nei
ther forced, nor, by any absolute necessity of nature, determined to good, o
r evil.
2. Man, in his state of innocency, had freedom, and power to will and to do
that which was good and well pleasing to God; but yet, mutably, so that he m
ight fall from it.
3. Man, by his fall into a state of sin, hath wholly lost all ability of wil
l to any spiritual good accompanying salvation: so as, a natural m... 阅读全帖 |
|
C****i 发帖数: 1776 | 6 CHAPTER IX
Of Free Will
I. God hath endued the will of man with that natural liberty, that it is nei
ther forced, nor, by any absolute necessity of nature, determined to good, o
r evil.[205]
II. Man, in his state of innocency, had freedom, and power to will and to do
that which was good and well pleasing to God;[206] but yet, mutably, so tha
t he might fall from it.[207]
III. Man, by his fall into a state of sin, hath wholly lost all ability of w
ill to any spiritual good accompanying salvation:... 阅读全帖 |
|
C*****e 发帖数: 367 | 7 【 以下文字转载自 Church 俱乐部 】
发信人: CCBible (神同在圣经), 信区: Church
标 题: Glossary to the Westminster Confession
发信站: BBS 未名空间站 (Tue Apr 24 21:16:33 2012, 美东)
Glossary to the Westminster Confession
Explanations of all archaic and uncommon words, usages, and expressions, in
the order in which they occur.
Title Confession. n. Public statement of religious beliefs.
1.1 Providence. n. Divine care. Manifest. v. Show. Are they. idiom. T
hey are. Unto. prep. With regard to. Sundry. adj. Separate. D... 阅读全帖 |
|
G*******s 发帖数: 4956 | 8 首先给大家看个故事,然后再探讨经文:
林慈信牧师的《基督教教义发展史》中提到这个:
http://blog.sina.com.cn/s/blog_622134fd01013i7l.html
基督论的发展史(1):基督论的争辩
HISTORY OF THE DOCTRINE OF CHRIST (1):
The Christological Controversies
(Louis Berkhof, A History of Christian Doctrines, pp. 101ff.)
基督论与三位一体之问题的关联
Connection of Christological and Trinitarian Problems
基督论的难题可以从一般神学(译注:神论)方面,与拯救论方面来加以
研究。早期教父对基督论拯救方面的关系,虽未曾加以轻忽,但他们在重要的讨论上却
没有重视。在三位一体争论的气氛中,他们从一般神学(译注:神论)方面来研究基督
,乃天经地义的事,而三位一体争论所导致的决定则是,基督为神的儿子,事与父同质
的,因此祂是神。从此而发生的问题,就是基督... 阅读全帖 |
|
G*******s 发帖数: 4956 | 9 再看看早期教父们的正确和错误的观点
林慈信:早期教会信仰真伪辨——上帝,圣父,圣子﹕我们的信仰
http://blog.sina.com.cn/s/blog_622134fd01013i7w.html
早期教会信仰真伪辨 THE FAITH OF THE EARLY CHURCH
上帝,圣父,圣子:我们的信仰
GOD, THE FATHER, AND THE SON: WHAT WE BELIEVE
1.上帝:一位格,三位格
GOD: ONE, PERSON, PERSONAL, THREE PERSONS
只有一位真神。宇宙并没有两位神(创造主 + 至高至善神:诺斯底主义)。
There is only one God. There aren’t two gods (creator-demiurge, plus the h
ighest God: Gnosticism).
上帝是位格。上帝不只是祂的属性的总和。
God is a person. God is not just a bunch of attributes.
上帝是有位格的。祂在永恒里计划要创造人,与人建立(约的)关... 阅读全帖 |
|
s*********9 发帖数: 9860 | 10 再抄些中英文的:)
记住该记住的,忘记该忘记的。改变能改变的,接受不能改变的
Remember what should be remembered, and forget what should be forgotten.
Alter what is changeable, and accept what is mutable.
能冲刷一切的除了眼泪,就是时间,以时间来推移感情,时间越长,冲突越淡,仿佛不
断稀释的茶
Apart from tears, only time could wear everything away. While feeling is
being processed by time, conflicts would be reconciled as time goes by, just
like a cup of tea that is being continuously diluted.
怨言是上天得至人类最大的供物,也是人类祷告中最真诚的部分
Complaints are the greatest offerings that God obtains ... 阅读全帖 |
|
g*****g 发帖数: 34805 | 11 Here are a few things that I know can be confusing from academic
point of view comparing Pascal and Java
1. Global variable
2. Mutable function parameter
3. Pointers
On top I hate how verbose Pascal is.
You don't have to teach Java and stress its OO part.
Its class structure only forces you to organize your files.
,差 |
|
L*******r 发帖数: 1011 | 12 hehe, just the immutable and mutable issue. Very common issue.
When I was teaching Java for cs undergraduate, they always asked those kind of
"string" questions. :)
Anyway, you have stringbuffer in Java.
I talked about stringbuilder, whcih is "stringbuffer" equivalent in C#, in my
recent post. :)
that
the |
|
L*******r 发帖数: 1011 | 13 Java has stringbuffer. C# has stringbuilder.
Stringbuilder is mutable. You can do "append, insert and remove" with
stringbuilder. Using stringbuilder will speed up your program. hehe.
But you don't need to use stringbuilder if your program is not
string-computing intensive.
以 |
|
i*******e 发帖数: 2 | 14
Not a mutable one.
Try this one:
public class Test
{
static public void main(String argv[])
{ int a=3;
int b=4;
Int aa= new Int(a);
Int bb= new Int(b);
swap(aa, bb);
System.out.println("aa="+aa.intValue());
System.out.println("bb="+bb.intValue());
}
static void swap(Int a1, Int b1)
{
int tmp = a1.intValue();
a1.setIntValue( b1.intValue() );
b1.setIntValue( tmp );
}
}
class Int
{
int value = 0;
public Int( in |
|
g*****g 发帖数: 34805 | 15 You are wrong, Double is designed to be an immutable class for
efficiency. If you want a mutable Double class, create a MutableDouble class
should be trivial.
Java is not powerful enough for writing an OS. But enough for
most application programming.
looks |
|
b******y 发帖数: 1684 | 16 if parameter1 and parameter2 are both List type,
it would be a headache...
my concern on convert1 like methods is that you don't know which
parameter is in&out (mutable), and which one is immutable.
while with convert3, you can follow a convention that every parameter
is immutable |
|
b*****t 发帖数: 1276 | 17 should be equal.
using debugger you will see both var have same id.
because in jvm, same string are reused, that's one of the reason string is
not mutable. |
|
o**1 发帖数: 6383 | 18 所有 Map 的Key都是Read Only.
这不是groovy的事,是JDK就这么design的。
如果key是 mutable object, reference不能变,但是可以指向别的object.
但是这是强烈不推荐的,会造成很隐藏的bug. |
|
w***o 发帖数: 6775 | 19 如果synchronize一个object的writing, 或者说setvalue. 那getvalue 或者reading,
是不是也要synchronize ? p.s. Object是mutable的 |
|
e*****t 发帖数: 1005 | 20 use return value. If you want to use an argument of the method, you have to
use a mutable object.
primitives are not objects and wrapper objects are immutable. |
|
x*****p 发帖数: 1707 | 21 You can use reflection in inc method and make Integer mutable. |
|
s******e 发帖数: 493 | 22 well I believe it was understated in this use case. What concern the author
most were performance and memory footprint. By take advantage of the built-
in life cycle mechanism of the executor framework, coders can very much
delegate the predicator instance management to the executor framework. This
will guarantee both the performance (no thread needs to wait for next
available predicator instance) and memory footprint concerns (shrink and
recreates if needed. or fixed...) this provides the exact... 阅读全帖 |
|
o**2 发帖数: 168 | 23 我听你的,把第三章的Sharing Objects从第33到54页又读了一遍。发现就是按这本书
里说的标准,你对我的程序的判定也是错的,没有根据的。因为它说的是“Mutable
objects must be safely published, and mush be either thread safe or guarded
by a lock.”。我写的程序(在41楼)完全符合它对安全的定义,就是instance变量都
guarded by a lock。
我在66和67楼的回复中说这是OOP encapsulation的要求,不但对constructor,对任何
一个能change internal state的method,都有这个要求。就是你要等change made,才
能去publish/notify外部的其他objects。
而且我说的OOP encapsulation这个知识,是Brian在第三章说的知识的来源。
example they use to show what a bad code will be. |
|
l******n 发帖数: 577 | 24 我也觉得是有问题,但是这和我从书上看来的矛盾:
Locking is not just about mutual exclusion; it is also about memory
visibility. To ensure that all threads see the most up to date values of
shared mutable variables, the reading and writing threads must synchronize
on a common lock.
这个意思我的理解就是synchronized可以保证visibility to all threads,但是这段
代码如果有问题,就跟这个意思矛盾。
synchronized可以确保两个thread不会call一个method,但是synchronized对于
visibility到底有没有作用?
use |
|
a*w 发帖数: 4495 | 25 Java String是immutable的,用==无妨
mutable的才需要用equals |
|
G*****h 发帖数: 33134 | 26 现在的语言都力求涵盖越来越多的概念
有的增加关键字,比如C#,java
有的多用标点,比如 perl
不过标点还是不太够用
到了 Rust,关键字和标点都用上了,看着头晕
实在是概念太多,过程性,功能性语言概念不同又略有交叉
不同语言还把同一种概念叫不同的名字
type class, class, trait, generics, template, bounds, method, function,
closure, lambda, impl, member function, inheritance, interface, override,
crates, module, package, namespace, lib...
加上内存管理访问控制,ownership
mutable, immutable, const, volatile, pointer, reference, box, owned box,
managed box, borrowed, copy, move, sendable, shareable
呕卖糕的。。。 |
|
m*********e 发帖数: 37 | 27 Attached is the implementation of the List class:
IntList.h
*****************************************************
#ifndef _INTLIST_H_
#define _INTLIST_H_
#define NULL 0
class IntItem
{
public:
IntItem()
{
//itm = -1;
nxt = NULL;
}
IntItem(int value, IntItem * n = NULL):itm(value), nxt(n){}
int itm;
IntItem *nxt;
};
class IntList
{
public:
IntItem *list;
mutable IntItem *curr;
IntList();
~IntList();
void add |
|
|
G*****m 发帖数: 5395 | 29 const
mutable
how do you write a member function that guarantees to leave "this" object
unchanged?
how do you overriding this feature? |
|
j****g 发帖数: 597 | 30 An interview question.
First he asked what is a const function. I said it's a function that doesn't
change a variable's value.
Then he asked what if you want to change that value in the const function? I
said use mutable. He told me there's other way.
Any idea what is the other way? ? |
|
|
c*****g 发帖数: 119 | 32 use list or other mutable objects. |
|
r****t 发帖数: 10904 | 33 所有的attribute也是mutable的。你说的这么几种正好就是所有的immutables |
|
r****t 发帖数: 10904 | 34 a = [1]
b = a
after this, when you change b[0] to any value, a[0] is also changed
accordingly:
b[0] = 5
assert a[0]==5
b[0] = 'dfadf'
assert a[0]=='dfadf'
这是因为list的元素是mutable的。python全是by reference. |
|
P********e 发帖数: 2610 | 35 来自主题: Programming版 - 问个问题 mutable的变量可以在const的function里面修改值
check out TIC |
|
j*****k 发帖数: 1198 | 36 来自主题: Programming版 - 问个问题 这个我知道呀。我的意思是说,在这种情况下,为什么不采用
常规变量和常规function, 非得要用const function和mutable
变量呢? |
|
j*****k 发帖数: 1198 | 37 来自主题: Programming版 - 问个问题 你的意思是说如果const A a的情况下?在一般情况下(不用const function和mutable)
也可以只修改想修改varaible呀 |
|
c*****t 发帖数: 1879 | 38
This is a stretch.
The advantage for Java is
1. immutable string objects
2. built-in Unicode
In contrast, in C++, you have several distinct types of string, some
are mutable, some are not. They are not inter-operable either.
Java does have break for breaking out of loops (two or more
levels). However, it is a bit unintuitive. Fortunately it is a rare
use. For example:
out:
for (;;)
for (;;)
break out;
Java has finally keyword, which is distinctive. (Pytho |
|
h****b 发帖数: 157 | 39 Is there anything wrong with this C++ class declaration?
class temp
{
int value1;
mutable int value2;
public :
void fun(int val)
const{
((temp*) this)->value1 = 10;
value2 = 10;
}
};
为什么我编译没问题? 再有((temp*) this)什么意思? const函数不是不能改变
member
variable?
多谢 |
|
h*****0 发帖数: 4889 | 40 其实这段例子代码是给出了两种改变const对象内容的方法。很明显第一种用了显式
cast的是不好的,有可能出bug的。不过第二种mutable应该是标准方法。
知道这是怎么回事当然不是坏事。不过简单的一句“代码没有问题”就满足了的,多半
是种下了危险的种子。 |
|
X****r 发帖数: 3557 | 41 第四题是B,这个明显是考mutable这个关键字的。
一般来说题目没提到多线程的话就不需要考虑多线程的情况。 |
|
X****r 发帖数: 3557 | 42 1.如果声明mCacheValue为mutable的话GetValue() const里也可以写
mCacheValue了,就避免重复计算。
2.对。 |
|
g*****g 发帖数: 34805 | 43 immutable string is not a problem, you just need a mutable string
builder when you need efficiency. Actually immutable string improves
memory efficiency, there's only one copy in the VM.
For java you can find StringBuilder/StringBuffer, I guess python
would have something similar. |
|
r****t 发帖数: 10904 | 44 Seriously, strings in python need to be immutable, otherwise they cannot
be used as keys of dicts. I did not know 3.0 has string mutable now.
For your need, StringIO/struct may work just fine. Its there for years. Or
maybe you need to switch to use list instead of string. |
|
h*******c 发帖数: 248 | 45 3.0有bytearray。这个显然是mutable的。我不反对string immutable,但2.x没有一个
类似buffer的结构,还是很不方便。我这几天一直在反思自己是不是被c之类的
variable概念毒害太深了。实际上我大概想要的是个bytearray,或者buffer,不是
string. |
|
p***o 发帖数: 1252 | 46 Sometimes people need it, though I don't know when, probably for template
meta programming when you need to remove cv-qualifiers.
The example you mentioned is bad anyway since you can use mutable. There's
a very similar example in The C++ PL and BS said so. |
|
X****r 发帖数: 3557 | 47 Just don't do it.
7.1.5.1
4. Except that any class member declared mutable can be modified,
any attempt to modify a const object during its lifetime results
in undefined behavior.
If you're still curious, under the hood compiler just assumed
the cost variable doesn't get changed at all and directly use
value 0 instead of reading from it. You can add keyword
'volatile' to force the read, e.g.
const volatile int x = 0;
const int *py = const_cast (&x);
(rest of code unch... 阅读全帖 |
|
e*****w 发帖数: 144 | 48 use mutable arguments such as pointers.
B object and an int
and |
|
c*****e 发帖数: 3226 | 49 learning curve is far less important than reliability. learning curve 只是
对新手小萝卜有意义,对一个成熟的团队毫无意义。而且一个人也不会永远处于新手的
状态。
Erlang guarantees that race conditions won't happen because this data is
immutable. In Scala, though, you can send between actors pointers to mutable
objects. This is the classic recipe for race conditions, and it leaves you
just where you started: having to ensure synchronized access to shared
memory.
erlang 的distributed program and hot code swap非常经典非常简单,特别适合现在的云技术。
erlang语言没有被很好... 阅读全帖 |
|
g*****g 发帖数: 34805 | 50 Of course learnging curve is critical. There's a reason Java gets popular
while Smalltalk remains a niche. Java's syntax looks like C/C++ and there
are bunch of C/C++ developers in 90s that can pick up Java quickly.
This immutable thing is wrong assessment on Scala. think about it
actor1 -> message(String, String....) -> actor2. How can this message
not immutable? Practically it's not an issue on Scala, you just need
to know what you are doing.
Erlang has been there for decades, it's not popular... 阅读全帖 |
|