由买买提看人间百态

topics

全部话题 - 话题: static
首页 上页 1 2 3 4 5 6 7 8 9 10 下页 末页 (共10页)
l*********8
发帖数: 4642
1
pass by reference 好吧
static local variables 看起来不好理解
S*******w
发帖数: 24236
2
static?

pass by
a********m
发帖数: 15480
3
如果是static,下次重新调用同一个计算的时候怎么办?还要弄一个 bool first_time
的变量?
U*********y
发帖数: 54
4
同意这个, static local variable可能不好还原成初始状态.

time
a********m
发帖数: 15480
5
很简单的一个代码,计算一个二茶树的高度,不用参数用static试试看。
a**********0
发帖数: 422
6
上次一个帖子中学习到了professional的代码要使用单独的一个class来盛放这些
static field 但是不是很知道原因
d******b
发帖数: 73
7
因为本质上是全局的,在规模变大后,会造成混乱。放在单独的一个类里,可能是便于
管理。
我的观点是 static Field 必须 加 final
a**********0
发帖数: 422
8
大规模情况下造成混乱是说 lose track of how it is changed and what the
current value it is 对吧
教科书经常具的例子是比如生成一个 human class 于是定义一个 static field 是
population 每construct 一个人 就加一 这样可以自动统计人数 这样的例子不实用
吗》
c*****a
发帖数: 808
9
用static要注意thread safe
g*****g
发帖数: 34805
10
In practice, if you need some data to support singleton, you are better off
with a DI framework, Spring IoC, Guice etc. Beyond that scope, static field
is pretty much limited to constant.
g*****g
发帖数: 34805
11
DI is more flexible, e.g. you can extend and have hierarchy. You can have
precise control of life cycle.
After all, static -> single copy of data/method in the JVM. Singleton means
the same thing. And DI is recommended way to implement Singleton.
t**r
发帖数: 3428
12
c++最变态的是 头文件,模板,const, static 这几件事情。
可惜c++11, 14, 17没有在这几方面改进。
没有任何理由回到c++的世界。
底层编程c足以。linus 用c写linux也不需要cpp.
上层编程就是jvm的天下。
客户端就是js.
写测试用python.
写机器学习用scala。
c++只会慢慢衰退
a********m
发帖数: 15480
13
前两个不争论。const和static有啥问题。。。。
I*******g
发帖数: 7600
14
地址哪里?
薪水范围?
有没有股票?

static
/* */
w****l
发帖数: 269
15
These are all text books required by courses:
Linear Algebra and its applications (4th edition), price $70
Introductory Nuclear Reactor Statics, price $60
Introductory Nuclear Reactor Dynamics, price $60
condition: almost new
contact: 765-491-7284 or w*******[email protected]
a*****0
发帖数: 3319
16
60D录的像在电脑上看,出现很多big static noise画面。LCD上是看正常的。
请问这是为什么?多谢。
x****c
发帖数: 25662
17
什么是big static noise?
是不是播放器的原因。
a*****n
发帖数: 5158
18
right click on the image, then copy the image url (chrome)
then u will get a link,
then change "/sxxx/" in the link (change xxx to the size of the image)
such as "..../s1500/....

static
N******p
发帖数: 2777
19
【 以下文字转载自 WaterWorld 讨论区 】
发信人: incubus (succubus), 信区: WaterWorld
标 题: http://farm5.static.flickr.com/4140/4738607791_f2e29f22fa_o.gif
发信站: BBS 未名空间站 (Thu Jul 1 16:01:36 2010, 美东)
L****8
发帖数: 3938
20
来自主题: Joke版 - Google人工智能 攻破了围棋,然后呢? 雷锋网 study875 39分钟41秒前 Google日前宣布其程序AlphaGo击败了欧洲围棋职业选手,这意味着人工智能技术又或得了极大的突破。计算机目前已经在许多智力游戏比赛上战胜了人类顶级选手,包括国际象棋、五子棋、黑白棋、拼字游戏等等。而对于有着2500年历史的东方游戏围棋——比国际象棋要复杂得多——人类始终能够保持在和计算机对决中的胜利。不过,Google人工智能专家表示, 这个壁垒或许很快将要被打破。随着AlphaGo在没有任何让子的情况下以5:0完胜法国围棋职业二段棋手樊麾,AlphaGo将在三月份对战韩国九段棋手李世乭。 今天早上,《自然》杂志发表了一篇Google DeepMind团队——程序AlphaGo的创造者撰写的关于深度学习系统的论文。根据论文描述,在AlphaGo中,DeepMind研究员在程序中录入了大量职业棋手的棋谱——加起来多达3000万步——他们用增强学习的方法训练AI,让它自己下棋,研习棋谱。不过这只是第一步。理论上,这样的训练只能让这个人工智能系统无法突破人类的计算。为了获得更好的成绩,研究员随后让系统进行自我博弈,计算出比基础棋谱更多新的打点。也就是说,战胜人类就要靠这些新的东西。 “这其中最重要的是,AlphaGo不仅记录着大量的棋谱,还有一系列规则来指导‘思考’,”DeepMind CEO Demis Hassabis说道,“事实上,该程序能够通过机器学习的方式掌握比赛技巧。” DeepMind的技术核心结合了“强化学习”及其他人工智能手段,这种技术能够用于解决现实机器人执行物理任务和对环境作出回应的技术问题。就是说,要让机器人变得更“自然”。 视觉判断 2014年初, Coulom的围棋程序“疯石(Crazystone)”在一次比赛中战胜九段棋手依田纪基。但是当时是在人类棋手让出4子的情况下赢得比赛,而这次AlphaGo并没有被让子,可以说比赛很公平。 人工智能战胜人类围棋到底有多难?即使是最强大的计算机系统也无法在合理的时间内分析出下一步最优的走法。1997年IBM超级计算机“深蓝”则利用了蒙特卡洛搜索树的方式做到了这一点。“深蓝”能够预测出对手下一步会怎么走,而且计算力远高于人类。但是,围棋要复杂得多。国际象棋每一步平均只有35种可能性的走法,但是围棋呢——在19*19的棋盘内,共有361个点,就机器学习的角度而言,围棋的计算最大有3361种局面,大致的体量是10170,而已经观测到的宇宙中,原子的数量才1080。国际象棋最大只有2155种局面,称为香农数,大致是1047。 使用蒙特卡洛树搜索技术,Crazystone等系统能够进行更长远的计算。而结合其他技术的话,它们能够对可能性走法进行刷选,然后选择出最优的策略。在大多数情况下,它们能够战胜人类选手,但不是最厉害的那一个。顶级大师中,走法很多时候依靠直觉——做棋除了需要计算,还有棋感——棋手能够根据棋形分析攻防线路。“好的棋形看起来顺手多了,”Hassabis本身也是一名围棋手,“这其中不只有计算角力,还有审美。这也是围棋几千年来都让人着迷的原因。” 因此,从2014年至2015年间,包括Facebook、爱丁堡大学、DeepMind等人工智能研究团队都将围棋人工智能系统的突破方向瞄准为——使得程序能够模仿人类的直觉式思维。 自我强化 深度学习要依靠神经网络技术,它是可以模拟人脑中神经元网络的软硬件网络。神经网络不会依靠蛮力或预先输入的规则,而是会分析大量数据,“学习”特定的任务。给神经网络提供足够的喵星人照片,它就能学习识别喵星人;提供足够的语音,它也会学习理解人类的语言;提供足够的围棋走法,它也会学会围棋。 在DeepMind,爱丁堡和Facebook,研究人员希望神经网络能像人类选手一样,通过观看棋盘学习围棋。Facebook在最新的研究中表明,这种方法确实可行。结合深度学习与蒙特卡洛树搜索方法,Facebook打败了一些人类选手,虽然并非是Crazystone和其他顶尖选手。 但DeepMind走得更远。在经过3000万步人类走法的训练后,它的神经网络能以57%的准确度(此前记录是44%)预测人类的下一步。然后Hassabis和团队通过强化学习技术,让这一神经网络与它自己的另一个稍有区别的版本对战。两者互搏中,系统会评估哪一步效果最好,即占领更多棋盘区域。最终,神经网络在判断哪一步更好时会越来越优秀。 DeepMind的研究者David Silver表示,“在与其它神经网络和它自己对战数百万局后,AlphaGo学会了自己发现新策略,并逐渐提高了水平。” 正是这种方法帮AlphaGo超越了其它围棋AI系统,包括Crazystone。但事情还没完,研究人员随后将结果再反馈给第二个神经网络。了解前任的走法了,第二个神经网络会使用许多相同的技术来判断每一步的后果。这一过程与深蓝等旧系统在国际象棋上的做法类似,只是它会在下棋过程中学习,分析更多数据,而非暴力破解所有可能的步骤。这样,AlphaGo不仅能战胜AI,还能战胜顶尖人类选手了。 计算机网络 http://static.cnbetacdn.com/article/2016/0128/7bfcf7e43c9064b.jpg 李世乭 与其它神经网络一样,DeepMind的系统运行在配备了GPU的机器上。GPU最初用于渲染游戏图像,但后来有人发现,它们很适合深度学习。Hassabis表示,DeepMind系统在装备了一定数量GPU芯片的单一电脑上也可以用,但与樊麾对战中,他们用上了更大的计算机网络,其包括170个GPU和1200个标准CPU。大的计算机网络训练了同样的系统并进行了实际对战,还借鉴了训练的结果。 尽管Hassabiss会不断改善系统,但待AlphaGo与韩国选手李世乭对战时,他们会使用相同的配置。比赛中系统也需要网络连接,而且他们会“自己铺设光纤”。 挑战世界冠军比挑战樊麾难得多,但Coulom还是认为DeepMind会赢。他过去数十年一直在开发能打败最好选手的系统,现在他认为这一目标已经实现了,他买GPU会赢。 接下来…… AlphaGo的重要性不言而喻。同样的技术还能用于机器人和科学研究,以及类似于Siri的数字助理和金融系统。深度学习创业Skymind的创始人Chris Nicholson就认为,技术“能用于任何对抗性问题,任何类似于游戏且需要策略的事情,包括战争、商业和交易”。 对有些人来说,这是一件值得忧虑的事,特别是DeepMind的系统还能自己学会下围棋。它不仅能从人类提供的数学中学习,还能生成自己的数据,在与自己下棋中学习。特斯拉创始人埃隆·马斯克等大佬多次声明,这类AI系统会最终超越人类智能,脱离掌控。 幸而DeepMind的系统还在Hassabis等人的控制之下。虽然他们用系统破解了复杂的游戏,但这仍只是个游戏。AlphaGo离人类智能还很远,更不论超级智能了。下棋是一种高度结构化的情景,系统也没有人类级别的理解力。但它代表了一种方向,即如果AI能理解围棋,它也会理解更多事。如果宇宙就是一局超大型的围棋呢? via Wired
不就是把棋谱数据库增大了么 然后欺负人的记忆力
算个屁的人工智能

在合理的时间内分析出下一步最优的走法。1997年IBM超级计算机“深蓝”则利用了蒙
特卡洛搜索树的方式做到了这一点。“深蓝”能够预测出对手下一步会怎么走,而且计
算力远高于人类。但是,围棋要复杂得多。国际象棋每一步平均只有35种可能性的走法
,但是围棋呢——在19*19的棋盘内,共有361个点,就机器学习的角度而言,围棋的计
算最大有3361种局面,大致的体量是10170,而已经观测到的宇宙中,原子的数量才
1080。国际象棋最大只有2155种局面,称为香农数,大�: 率�1047。
使用蒙特卡洛树搜索技术,Crazystone等系统能够进行更长远的计算。而结合其他技术
的话,它们能够对可能性走法进行刷选,然后选择出最优的策略。在大多数情况下,它
们能够战胜人类选手,但不是最厉害的那一个。顶级大师中,走法很多时候依靠直觉—
—做棋除了需要计算,还有棋感——棋手能够根据棋形分析攻防线路。“好的棋形看起
来顺手多了,”Hassabis本身也是一名围棋手,“这其中不只有计算角力,还有审美。
这也... 阅读全帖
c*******9
发帖数: 6411
21
if only have one static IP, and I have multiple machine, and plan to use one
machine to host a website and other machines for personal uses. will that
going to work? can multiple machines share the same IP?
thanks
p******w
发帖数: 62
22
来自主题: BuildingWeb版 - 求助,有static ip,怎么把域名加上
本人新手,自己有一个static ip,是comcast的business class,server在路由器后面
,目前可以通过ip address access。
最近买了一个域名,没有买hosting,请问怎么绑定我的域名和ip address?我自己要
设一个dns server么?还是要用comcast的dns?
多谢了!
c*o
发帖数: 70
23
来自主题: DotNet版 - Drawbacks of using static
Then waht are the drawbacks of using static in this senario?

.
in-depth
postback,a
ur
field
to
in
from
e***i
发帖数: 43
24
来自主题: Hardware版 - 有谁懂static ram吗?
我正在做一个板子,需要做一个static ram,用来存取一个参数,加上一个芯片以后,
开机后,时有时无。断电4小时后,里面存的参数也是消失了。换了3家芯片都这样。
不知道那个大虾懂?
可以有报酬
e****c
发帖数: 10
25
来自主题: Internet版 - How to get static IP with Cable modem?
I am goint to set up a FTP server, so i want a static IP with Cable modem,
does anybody have experience on it ? thanks
G**T
发帖数: 388
26
来自主题: Internet版 - How to get static IP with Cable modem?

u can ask a static IP, but u need pay more
s******e
发帖数: 63
27
in one web application(resin server), I put string constants in one class
Constants, those string constants are like:
public final static String UPPER="...."
when other classes use this constants, just call Constants.UPPER etc.
but when I changed some string value, recompiled, even restarted resin server,
in the places where uses changed constants, it still uses old constants.
how could this happen? if changes was taken inside jsp, I could understant
there's some cache issue. do java classes als
s******e
发帖数: 63
28
normaly those web service urls don't change, so it does not make sense
to put them in database. if I do it this way, it will cost many testing
time also. I just need a quick, safe way to make the change.
thanks.
so even 'static' won't solve the problem? I could not test now, have to try
tomorrow?
R*******r
发帖数: 104
29
来自主题: Java版 - Static getFontMetrics()?
I don't understand why Graphics.getFontMetrics() is not a static method.
if I want to use this method in the start of application when getGraphics()
is not awailable, what do you do other than create a dummy image.
h*****0
发帖数: 4889
30
来自主题: Java版 - static object assignment/init ?
static initiator? 静态初始化器?
你不是已经写得很明白了吗?
c******n
发帖数: 4965
31
来自主题: Java版 - static object assignment/init ?
static initialization block
N*D
发帖数: 3641
32
来自主题: Java版 - static object assignment/init ?
java是要求在初始化前,包括static initializer或者constructor都可以
N*D
发帖数: 3641
33
来自主题: Java版 - static object assignment/init ?
我是说:
如果是class fields,it如果是static,必须在class load时initialize一次;如果是
instance,必须在instance initialze时复值一次;
local variable就是随便了,只能一次。
h*****0
发帖数: 4889
34
来自主题: Java版 - static object assignment/init ?
好吧。这个可以理解,因为static field如果class load之后的赋值编译时是不知道的
,同样一般的field在instance被创建之后的赋值也是编译时不知道的。无法保证是一
次。
b******y
发帖数: 9224
35
I did some research. It seems to me that static variables, if they are
primitives, are stored in permgen, also object references.
Objects could be allocated in any heap.
r*****l
发帖数: 2859
36
This is inline with what I thought. Thanks.
Now there is something more interesting. If I have a class Singleton, look
at the code below:
private static final Singleton instance_ = new Singleton();
Suppose reference to the Singleton class (value of "instance_") is stored in
permgen, then what about the Singleton object. It has the same life cycle
as instance_ so it makes sense to store it in permgen. However, I do believe
they will be stored in normal heap (finally tenured) cause otherwise the
p... 阅读全帖
r*****l
发帖数: 2859
37
Read the JVM Specs. All field metadata is stored in the permgen (method area
). Static variable each has a reference to a ConstanceValue data structure,
also in permgen. The value can be of type long, float, double, int (short,
char, etc.), and string. The Specs does not specify how a object reference
is stored (or at least I did not find it). Maybe it's like this: if the type
of the field is not primitive, then the value stored in the ConstantValue
data structure is interpreted as an object ref... 阅读全帖
r*****l
发帖数: 2859
38
This is too vague and most people know it.
My two specific questions are:
1, If static variable is stored in permgen
2, Proof whether the answer is yes or no.
b***i
发帖数: 3043
39
来自主题: Java版 - static final的问题
public class zzz {
private xxx ok=new xxx();
private class xxx {
private static final int[] aa={1,2,3};// this one
N***m
发帖数: 4460
40
来自主题: Java版 - static final的问题
我想是因为每个zzz object有自己不同的class xxx definition,
所以想按照你原来意思那么用的话,可以把xxx声明为static.
f*******n
发帖数: 12623
41
来自主题: Java版 - static final的问题
这个是inner class的问题。inner class的static只可以是constant。
不放在inner class就行了
f*******n
发帖数: 12623
42
来自主题: Java版 - static final的问题
http://docs.oracle.com/javase/specs/jls/se7/html/jls-8.html#jls
Inner classes may not declare static members, unless they are constant
variables (§4.12.4), or a compile-time error occurs.
http://docs.oracle.com/javase/specs/jls/se7/html/jls-4.html#jls
A variable of primitive type or type String, that is final and initialized
with a compile-time constant expression (§15.28), is called a constant
variable.
b***i
发帖数: 3043
43
来自主题: Java版 - static final的问题
就是想吧,每次initialize xxx的对象,不想生成那么多数组,因为就是常数,不会改
变。而且就在private class里面用,要把数组放进xxx里面非常合理。但是,xxx里面
确实要对外面的class对象进行操作,所以不能整个class都static.
挪数组到外面也可以。
有没有可能本来private class里面的final int[]就不会有多个copy?
s******e
发帖数: 493
44
Maybe I misunderstood you. But I do not think this is the case for the
facade. I do not think you are coding a facade even you call it so.
Maybe what you really need is the factory method or abstract factory.
Usually a static variable can be coupled with the abstract factory.
p*****2
发帖数: 21240
45
来自主题: Java版 - Static就是个混球
static是挺恶心的
Y**G
发帖数: 1089
46
来自主题: Java版 - Static就是个混球
很多时候static是需要的,比如singleton pattern
g*****g
发帖数: 34805
47
来自主题: Java版 - Static就是个混球
Everything is within an object is a good design. You avoid the namespace
conflict of C/C++ automatically.
And main is static because you call it without creating the wrapping object.
w*s
发帖数: 7227
48
Hi, someone mentioned this last time,
the latest ubuntu is using network-manager to set static/dhcp.
So i cannot use command line to change this anymore ?
BTW,
in /etc/network/interfaces,
i only see
auto lo
iface lo inet loopback
nothing configured for eth0.
But when i boot up, it's using dhcp ?
Where does it get the configuration now ?
R*********r
发帖数: 225
49
昨天通过network-manager改了static ip,然后查了下 /etc/network/interfaces
发现里面的内容没变,猜测可能得修改其他的文件。
b*****n
发帖数: 2324
50
dynamic link好查,ldd就可以了。
一直没搞明白static link的有什么办法可以查看,有时候这功能还挺有用。谢谢。
首页 上页 1 2 3 4 5 6 7 8 9 10 下页 末页 (共10页)