由买买提看人间百态

topics

全部话题 - 话题: overload
首页 上页 1 2 3 4 5 6 7 8 9 10 下页 末页 (共10页)
a***a
发帖数: 40617
1
来自主题: E-Sports版 - nydus worm(虫洞)
是有视野就可以还是必须先用overload拉稀有菌毯才可以?
我记得是后者
刚才ladder打了一盘,后来看rep,居然是一个overload飞过一个地方(都快
出视野了,突然就冒出来一个虫洞。。。也没菌毯。我都惊了。。。
什么时候改的这个设定?
还是bug?
如果是bug,我准备像暴雪哭诉
d**********t
发帖数: 20415
2
来自主题: E-Sports版 - P民赛季-战术篇
本来想圣诞写的,实在是懒,拖到现在...
还是那句话,本人菜鸟,理解不足之处,欢迎高玩来拍~
P的战术整体给我感觉是猜对了,很凶猛,猜错了,很悲剧,因为兵种特点都太鲜明,
针对上了可以暴力的一波A死人,但是为啥说猜呢,因为P的侦查能力么,大家都懂的..
.T有雷达,Z有狗占塔,P只好等OB出来,前期的侦查基本是很难的。我用P打天梯基本用
大招,因为玩运营一路跌到黄金,果断不能忍,上套餐,基本白金之前胜率能到80%+,
即使到了白金之后,也能保持70%以上,钻石之后套餐威力就一般了,不过PvZ的那招还
是很好用(下面具体讲)
先说说PvT吧,这个不好打,因为T能13甩的原因,对P的哨兵力场要求相当高,像我这
种框一下A的选手来说比较痛苦,那就索性单矿一波吧...PvT的单矿一波,我主要是5BG
,3BGVS,3BGVR巨像,4BGVR运输机,速闪烁追猎,其他像速DT和3BGVR带不朽也不错,
但是我用的比较少,DT主要是怕女妖真善美之类的,这年头在雷达面前,DT要破口也不
容易,基本只能用来拖延对手2矿打运营,3BGVR带不朽主要是我不朽操作太烂,经常卡
来卡去。选择什么一波战术,基本取... 阅读全帖
b*s
发帖数: 82482
3
来自主题: LeisureTime版 - 问个xxoo的问题
这个叫做操作符重载,operator overloading。xoxo和sm都被overloaded了。

如果楼里的二叔们都这么理解,我只好面壁去了。
q*c
发帖数: 9453
4
来自主题: SciFiction版 - 正在系统复习SG1和SGA
有 ancient 的武器, 我一个人就能消灭全宇宙的生物。
看看三个 zpm 就能让整个 Atlantis 称无数时间, 一个
zpm 就能让 Atlantis 在 wraith 全力攻击下防护罩撑 N 天,
相应的只要把zpm 防护罩做到飞船上, ancient 的卫星一发
激光一秒就能消灭一艘 hive, ancient 的发电机 overload 就能整个
太阳系的消灭。
只要驾驶一艘 ancient 的飞船, 连隐形都不要, 直接就杀进
wraith 的老巢, 见了 hive 就一个激光, 一小时就能消灭
成千上万的 hive, 能有几个 wraith. 太多了 wraith ,
就直接一个 zpm overload 仍过去, 只要一艘船, 真是纵横宇宙无敌手。
这都不是原则迂腐的问题了, 再迂腐的人类军队, 也能消灭兔子群。
这个片子实在是毫无逻辑。
q*c
发帖数: 9453
5
来自主题: SciFiction版 - 正在系统复习SG1和SGA
so what. 只要装几百个那种激光在飞船上, (看电视那玩意不大),
拿 zpm 撑着轮流充电, 杀 hive 还不是和拍苍蝇一样。
waith 的 hive 在 atlantis 出现后聚集了几十个过来进攻,
显然也不是动辄就是几摩尔的数量, ancient 只要一艘船
就和拍蚊子一样的把他们消灭光。
我说的就是那种失败的发动机, 正因为 overload 一定发生,
就拿他当武器, overload 然后扔出去, 然后 jump,
wraith 的老巢无论什么防护, 什么星球, 就完蛋。
ancient 完全就是个逻辑不通的玩意, 编剧没上过理科啊...
a***y
发帖数: 19743
6
来自主题: Apple版 - 微软要打算leapfrog Apple了
没有被convinced
如果想要tile,而且是HTML5和Javascript的,苹果的Dashboard就是
苹果只需要更新一下Dashboard,提出新的建widget的指南,就可以比Windows 8的这些
玩意儿有用。
因为我觉得tile的信息量太大,实际上并不好。
Widget的问题,其他OS都习惯放到桌面上,其实完全是信息overload,如果大家喜欢这
个,那么每个人的Vista, Win 7桌面上都应该有很多微软Gadgets。可惜事实上并非如
此。
Dashboard那样,需要的时候我才去看天气,facebook更新,flickr photostream,
twitter updates,等等才是王道。
这么多信息闪来闪去,个人认为工作效率会很低。审美疲劳很快,信息overload立即,
不久就会学会ignore这些不断闪烁的更新内容。
大家想想自己是否已经对growl的提示麻木
是否对iOS跳出来的很多notification麻木,就可以预知tile的下场
而且这个设计理念和Windows抛弃taskbar变Dock也是矛盾的。
taskbar可以显示比dock... 阅读全帖
a***y
发帖数: 19743
7
来自主题: Apple版 - Metro UI
今天终于找到了能够总结我对Metro UI的观点的评论:
1. “regarding Windows Phone ’07, Apple offers “a better-designed UI that
doesn’t continuously destroy users’ visual memory.”
2. The sameness made it impossible to find anything. Why anyone would revert
to vague and homogeneous tiles from highly identifiable icons is beyond my
comprehension. Perhaps someone thinks it’s more artsy.”
3. “People sense something is wrong. The miserable sales of the Phone 7
products reflect the user sensitivity,” Dvorak writes. “So what do... 阅读全帖
h**o
发帖数: 347
8
re啊~re
自己写overloaded operator 当然是一个办法
可是vector的运算这么多,一个个都overload。。。太多了。。。
X****r
发帖数: 3557
9
来自主题: Programming版 - 请问一个implicit conversion的问题(C++)
In case of a function template, template argument deduction is performed
before the compiler tries to resolve the overloading [13.3.1 paragraph 7].
In other words, the compiler sees "a*b", then it looks for all overloaded "
operator*". You have "template operator *(const A&, const A&)
;" defined up there, so it tries to deduct the typename T. Note that the
compiler doesn't look into anything else in this step, including your user-
defined conversion function. Obviously it cannot f
N**s
发帖数: 837
10
来自主题: Programming版 - 一个inheritance 的问题
if 'new' is overloaded, maybe
if '=' is overloaded, maybe
s***e
发帖数: 793
11
来自主题: Programming版 - one question about struct
sure, struct has every thing. virtural function , function overloading ,
operator overloading .
another issue is that the struct inheritance is public inheritance by
default.
j****g
发帖数: 597
12
来自主题: Programming版 - 谁给详细说一下这句
The original text is:
std::transform (source.begin(), source.end(), dest.begin(), addValue);
Note that there is a problem with this example: addValue is a
function template, and function templates are considered to name a set of
overloaded functions (even if the set has only one member). However,
according to the current standard, sets of overloaded functions cannot be
used for template parameter deduction. Thus, you have to cast to the exact
type of the function template argument:
P********e
发帖数: 2610
13
来自主题: Programming版 - 问一个private destructor的问题
你前面temp能是create on heap
private destructor 能保证instance ONLY on HEAP
如果要STACK的话,overload operator new/delete as private, 其实严谨一点
malloc, alloc, realloc都要overload
你的方法是在heap上
i***h
发帖数: 12655
14
来自主题: Programming版 - ambiguous operators in c++
[] by default is pointer reference
I think this way is more elegant than overloading [].
[] overloading can be used for more complicated index operation.
k**f
发帖数: 372
15
来自主题: Programming版 - C++命名空间和算子重载

Only user defined class can have overloaded operator. The compiler will try
to resolve the operator based on the type of the operand. If you have two
classes of the same name but in different namespace, then you need to
specify which class the object is when it is declared. I don't see how you
can overload an operator with the same signature unless you do it on purpose.
Also related is the special "Koenig lookup".
http://en.wikipedia.org/wiki/Argument_dependent_name_lookup
If you have a specifi
c********e
发帖数: 383
16
来自主题: Programming版 - 请教怎么看unix server busy or not?
a "man top" will nicely explain everything.
there are two things you can see on this screen.
1) load average, note you have only 1 CPU and your load average is 17, your
system is critically overloaded.
2) CPU states: 1.9% idle...overloaded again.
z***e
发帖数: 5393
17
来自主题: Programming版 - C++ linking 弱问 (one file)
可以分开啊,比如:
#include
#include
using namespace std;
template
void write(T);
template
void test(T parameter)
{
write(parameter);
}
int main()
{
test(1);
test("adbsdfs");

return 1;
}
template
void write(T a)
{
std::cout< }
关键是compiler在instantialize你的template的时候,会好像#define一样展开,你的
code里面的两个Read(一个declare,一个definition),展开后是不同的两个东西,所
以当然会说第一个Read找不到definition了。
template本身就是overload啊,还要怎么overload?
t****t
发帖数: 6806
18
来自主题: Programming版 - C++ linking 弱问 (one file)
分开没有问题, 但是引用之前先声明是最最基本的规则, 一定不能忘了
函数没有specialization, 所以每个需要specialize的case都需要先声明, 跟class不
一样, 声明最general那个就算声明了(其实class的specialization也是需要先声明
再使用的, 但是由于dependent name的存在, 这个时间可以推后)
template function的overload和普通函数的overload没有什么区别
partial ordering of function template看这里
http://cs.calvin.edu/books/c++/C++Standard-Nov97/template.html#temp.func.order
(要学会效使用google)
t****t
发帖数: 6806
19
来自主题: Programming版 - 问个c++的template的问题
overload不对.
less期望的operator<的原型就应该是
bool operator<(const T&, const T&)
或者
bool operator<(T, T)
要overload的话原型必须不同, 但是原型不同就没法调用了
d****b
发帖数: 25
20
来自主题: Programming版 - friend function 不能virtual 怎么搞呢?
c++中 overload << operator 是用 friend function, 但是如果在derived class 中
也overload <<, 因为是friend, 不能virtual, 怎么搞呢, 是不是只能是自己定义一个
virtual void show() 的函数? 谢谢大家
X****r
发帖数: 3557
21
来自主题: Programming版 - friend function 不能virtual 怎么搞呢?
直接overload operator <<就行了,和virtual没关系。
你大概是没分清楚overload和override的区别。
z****e
发帖数: 2024
22
来自主题: Programming版 - 这段code有啥问题?
牛人decamp 说错了,new operator是没有overload的概念的。
只能overload "operator new".
j***i
发帖数: 1278
23
来自主题: Programming版 - python 可以给class动态添加method吗?
恩,我是了下,对的
我还有另外一个问题
如果我想家的是已有的method的一个overload 如何?
class c 有一个method func(int)
我想加一个 func(int,int)的overload 该如何?
X****r
发帖数: 3557
24
来自主题: Programming版 - 问个函数指针指向操作符的问题
Err.. they are totally different things. Operators are special
non-alphabetic symbols with their predefined syntax and semantics,
and take one or more operand to form expressions. Functions are
units of code that has its own declaration, body, scope, etc.,
and can be called using the function call operator ().
The only connection between them is that for overloadable operators,
you can define functions with the name "operator @" where @ is the
operator symbol for your own class or enum to overlo... 阅读全帖
g*********s
发帖数: 1782
25
来自主题: Programming版 - stl Compare为何需要重载()?
sure. overloading << is more natural.
on the other hand, after overloading int(), how does << locate it
properly?
it seems << is very smart. the c++ compiler is defined in such way?
b******n
发帖数: 592
26

core.
cores(
吧。
load
除非node都有load,才会有多个thread在同一个node,个人感觉只有node overload之
后才应该会有跳的调整。这个应该跟architecture很有关系,如果一个process的
thread被分配到不同的socket,内存不是uma的话不是很惨。而且系统应该考虑到
thread跳动的cost。系统cpu的load均衡不均衡不是很重要,除非都utilized了,然后
有一些overload,另外一些空闲。
如果要自己控制的话,应该要考虑系统的内存,cpu,如果不能掌握具体的环境参数,
还是让系统去控制分配。
f*******r
发帖数: 901
27
不是cs专业的,有一个关于operator overloading 的问题。
书上写的operator overloading都是针对class的。请问针对class member variable的
operator (比如=) 能否重载呢?
sc
发帖数: 122
28
来自主题: Programming版 - a simple design question
Sorry for the naive question, but I couldn't figure out a better solution.
In C++, I have A1, A2 derived from A,
B1, B2 derived from B.
A is abstract, has pure virtual fooA(), which gets overloaded later. A1, A2
have their fooA1(), fooA2() respectively.
B "has-a" A. B::fooB() will be calling A::fooA(). At the same time, B1 and
B2 will need to call A1::fooA1() and A2::fooA2() as well.
Option 1:
If I make A as a data member of base B, and use polymorphism to instantiate
A with A1 or A2 (in B1 or B... 阅读全帖
r*********r
发帖数: 3195
29
来自主题: Programming版 - ocaml的一个奇怪的设计
做 type inference 的人肯定不待见任何的 overloading.
不过语言要实用, 没有 overloading 很不方便.
ocaml 原来的设计组已经解散了吧. 反正没看到有什么新东西.
r*******y
发帖数: 1081
30
来自主题: Programming版 - string operator +
string library defines these overloaded operator +
string operator+ (const string& lhs, const string& rhs);
string operator+ (const char* lhs, const string& rhs);
string operator+ (char lhs, const string& rhs);
string operator+ (const string& lhs, const char* rhs);
string operator+ (const string& lhs, char rhs);
We know
string s = "hi" + "ji";
is not OK
If compiling this using g++ , I get the error :
invalid operands of types ‘const char [3]’ and ‘const char [3]’ to
binary ‘operator+’
I am a lit... 阅读全帖
t****t
发帖数: 6806
31
来自主题: Programming版 - string operator +
overloaded operator must have at least one user-defined operand. you can't
overload operator for 2 built-in operands.
t****t
发帖数: 6806
32
来自主题: Programming版 - please help debug this code
interesting enough, it seems that ostream_iterator will not consider
overloaded operator<< in global namespace. i tried on gcc 4.4.4 and 4.6.0,
they both failed. however if I overload the operator<< in namespace std, it
can pass. And if you do not invoke the operator<< in ostream_iterator, it is
ok as well, no matter which namespace you use.
I am not sure whether this is a more strict constraint that existed long ago
but not enforced, or this is a bug. and interesting enough, both gcc and VC
has... 阅读全帖
t****t
发帖数: 6806
33
来自主题: Programming版 - please help debug this code
OK, solved. let me explain this, this is complex.
you called copy(....begin(), ....end(), ostream_iterator<...>(...)), so
ostream_iterator will do the << for you. naturally, ostream_iterator is
within namespace std, so operator<< is called in namespace std.
Now for overload resolution. there are a lot of operator<< within namespace
std; so these are considered. your parameters to operator<< are std::basic_
ostream<...> and std::pair<...>, they are both in namespace std. Therefore
no other namesp... 阅读全帖
t****t
发帖数: 6806
34
来自主题: Programming版 - c++ pointers are iterators, why?
short answer: iterators are generalized pointers. so pointers, by definition
, are iterators.
long answer: there is no iterator "type" or pointer "type". iterator and
pointer are CONCEPTs, which are classes of types (that satisfy some
condition). pointer satisfy all the requirement of iterator so pointer is
iterator.
for implementation, anything suuport "iterator" (or some subclasses of
iterators) must be implemented with template (template is a set of
overloaded functions, so you are right, it ... 阅读全帖
p*********t
发帖数: 2690
35
来自主题: Programming版 - 形参可以直接使用私有数据成员?
operator new, operator delete overloaded as private时, new的重载函数里面还是
要用malloc.
哪位高手写一下overload new的code ?
c**********e
发帖数: 2007
36
来自主题: Programming版 - Polymorphism是怎么定义的?
从某些材料上, polymorphism 就是virtual function 引起的多太性。但是wiki上,
polymorphism 也包括operator overloading 和function overloading。
大侠们怎么看这个问题?要是面试时被问到,该怎么回答?
s******n
发帖数: 3946
37
【 以下文字转载自 JobHunting 讨论区 】
发信人: swanswan (swan), 信区: JobHunting
标 题: 有个SB interviewer和我说++i比i++好
发信站: BBS 未名空间站 (Thu Mar 22 16:09:09 2012, 美东)
他的意思是假设是operator重载
++i先做++再放在stack上,i++则先复制一份copy到stack上再做++,多了一份复制(假
设编译无优化)
大家看有道理吗?
I did a real test on arm compiler turn off optimization:
the O0 code is exactly the same, except that post operator++()(int dummy)
has an extra dummy parameter which is required by c++ to identify the
difference of prefix and postfix.
2nd, even I change the Test& ope... 阅读全帖
G****A
发帖数: 4160
38
问题在:
http://stackoverflow.com/questions/1734893/overloading-a-method
subclass-in-c
下面的解释中提到"Name lookup happens before overload resolution"。
谢谢
n******t
发帖数: 4406
39
别扯了。。
说道添乱的事情C++可牛B太多了。
什么function overloading, operator overloading,
还有reference,哪个不是添乱的?
c*********e
发帖数: 16335
40
来自主题: Programming版 - 问题的根源找到了
其实operator overloading本身就是可有可无的,就是一个函数而已。java没有
operator overload,还不是比c++红火得多?
p*****2
发帖数: 21240
41
来自主题: Programming版 - 问题的根源找到了

这个跟有没有operator overloading没啥关系呀?Java火是因为其他的吧?你不能因为
Java火就认为C++一无是处吧?这个真不代表Java任何方面都比C++强。
感觉没有operator overloading算Java一大缺陷。这不scala给fix了吗。
d**********x
发帖数: 4083
42
来自主题: Programming版 - 问题的根源找到了
C++里面的operator overload不是可有可无的
没有这个机制,C++的template就无法同时工作在built-in类型上和UDT上。
当然operator overload造成的问题很多,这都是trade off。
k**********g
发帖数: 989
43
来自主题: Programming版 - 怎么看process 用多少内存? (转载)

个G
valgrind
http://stackoverflow.com/questions/131303/linux-how-to-measure-
overloading operator new might also work, but might be unreliable (because
some libraries might also overload operator new.)
t*******c
发帖数: 288
44
来自主题: Programming版 - 问个copy constructor的问题
http://stackoverflow.com/questions/1051379/is-there-a-differenc
Delving into Initializations Direct and Copy initialization
While they look identical and are supposed to do the same, these two forms
are remarkably different in certain cases. The two forms of initialization
are direct and copy initialization:
T t(x);
T t = x;
There is behavior we can attribute to each of them:
Direct initialization behaves like a function call to an overloaded function
ones), and the argument is x. Overload resol... 阅读全帖
x******a
发帖数: 6336
45
来自主题: Programming版 - 请教struct inside class的问题(C++)
code和编译的错误在下面。
尝试了另外两种方式编译都没有问题:
1. 把struct Obj和double plus(..)定义在class外面
2. 在total()的定义里面,用for loop而不用std::accumulate.
请教怎么回事?谢谢!
#include
#include
#include
class Foo{
struct Obj{
double a;
explicit Obj(const double& a_): a(a_){}
};
double plus(double result, const Obj& obj){
return result+ obj.a;
}
std::vector v;
public:
void append(const double& a){ v.push_back(Obj(a));}
double total() const{
return std::accumulate(v.begin(), v.... 阅读全帖
B********e
发帖数: 1062
46
来自主题: Programming版 - C++糟粕和需要避免的。
For C++ if you don't know the feature well, just don't use it. There is
nothing wrong with it
Do not overload operators
Do not overload functions
Do not use templates
You are still able to finish your project nice and clean without these. That
's the beauty of c++.
w****i
发帖数: 964
47
来自主题: Programming版 - C++糟粕和需要避免的。
template is one of the most powerful parts of C++
operator overloading is kinda syntax sugar
function overloading const are hell
m*********a
发帖数: 3299
48
来自主题: Programming版 - 今天给c++震惊了
看到一个区别是
The Dot (.) operator can't be overloaded, arrow (->) operator can be
overloaded.
i***R
发帖数: 663
49
来自主题: Biology版 - feng zhang又一篇cell.
Yes new iGluR is selective Silencer because it is selective for K. They
took so much trouble to get the selectivity right, and it is a great
improvement.
If ChR2 is selective for Na but not for Ca or Mg it will be much better.
Ca do so much more than depolarization. If we want to ultimately
introduce the channel into the brain to stimulate some neuronal cell, it
is better it won't cause Ca overload.
TRPV1 like ChR2 is non-selective cation channel that causing pain
sensation, but long term activa... 阅读全帖
n****e
发帖数: 327
50
来自主题: Biology版 - DePinho的文章也有copy and paste
This is outrageous!
On the original scan, from left to right, Lanes 7 and 9 were overloaded,
resulting in higher level signals for all three proteins. The Vinculin
signal was very strong and reached saturation, so that the difference in
loading wasn’t obvious. Yet, lanes 7 and 9 were overloaded as indicated by
the non-specific bands between 76kDa and 120 kDa.
However, in the published figure, the P-p53 and p21 blots were flipped
horizontally, but the Vinculin blot wasn’t flipped. In this way the... 阅读全帖
首页 上页 1 2 3 4 5 6 7 8 9 10 下页 末页 (共10页)