f******n 发帖数: 90 | 1 最近研究了一下cast, 成果如下,大家看看如何:
const_cast:
It's only used to add or remove qualifiers: const or volatile. Note: static
_cast can add const and can never remove const.
reinterpret_cast:
It never does any check, neither compile time nor runtime. But it requires
the two types have the same storage size in memory.
static_cast VS dynamic_cast:
In the inheritance hierarchy (all public inheritance), upcast will always
work, even without any type of explicit cast. static_cast will work for
downcast too wi |
|
G****A 发帖数: 4160 | 2 问题1:
assume that WhiteOnBlackLabel inherits a paint method from JLabel and also
implements its own version of paint.
JLabel label = new WhiteOnBlackLabel("A label");
label.paint(g); //for some Graphics object g
Which of those two implementations of paint will be executed in
label.paint(g); of this example?
paint() defined in label or paint() defined in WhiteOnBlacklabel?
问题2:
All of our Fruits inherit an equals method from class Object. Suppose that
Fruit declares its own equals method:
Object> |
|
W*********g 发帖数: 409 | 3 不可行。首先vptr在哪不清楚,微软是放在前面,但是更直接的方法是在后面,如果是
这样,对于derived class来说vptr就在中间了,这还没有考虑multiple inherit(多
个vtbl) 和virtual inherit(virtual base class有自己的vtbl)。
其次vtbl里还有其他东西,比如typeid。有些实现会把this pointer adjustment
offsets放在vtbl里。 |
|
t****d 发帖数: 8 | 4 C++:
(Difference, advantage/disadvantage, and/or example for the following)
-Pass by value and pass by reference;
-struct in c and class in c++;
-struct and class in c++;
-Private and public inheritance
-Virtual inheritance
-Smart pointer(stack upwinding)
-Singleton design pattern(write a class)
-When a class has two vPtrTable?
-Member Methods which are automatically created by compiler for a class
-Deep copy and shallow copy
-How to design a class such that an object of that class can only be c |
|
i**p 发帖数: 902 | 5 One class A is privately inherited by B, and B is privately inherited by C.
a protected member in class A can be accessed by member of class B but not
by C.
Is there any good reason to design the C++ this way? Is there any porblem if
it were accessible by class C? |
|
p***o 发帖数: 1252 | 6 B inherits A privately. That means no other class should know B inherits A.
if |
|
s*******u 发帖数: 1855 | 7 【 以下文字转载自 JobHunting 讨论区 】
发信人: siriusliu (天狼), 信区: JobHunting
标 题: 问题:vptr/vtable for virtual function & vptr/vtable for virtual inheritance, are they the same?
发信站: BBS 未名空间站 (Wed Nov 5 00:58:56 2008)
we know that both virtual function and virtual inheritance have vptr
pointing to vtable. My question is: do they use one SAME table/ptr, or TWO separate table/ptr?
For ex: |
|
z***e 发帖数: 5393 | 8 被问到一个问题,关于C++的diamond problem,就是class A, 然后B和C都inherit A
,并override A里面的virtual method foo(),然后D inherit B和C
问在D里面怎么用A.foo()? 不准用A::foo()这种.
我败在这上面了...:( |
|
g*****g 发帖数: 34805 | 9 If you remove multiple inheritance from C++, you need interface.
You can achieve what interface brings you by using an abstract
base class in C++ as it stands now, but you can't prevent people
from using multiple inheritance in bad way.
That's my point, if C++ is designed from scratch, it can remove
these bad features while keeping its power. I know its history
and I understand why it's designed that way, it's just an academic
discussion.
where |
|
x******a 发帖数: 6336 | 10 derived class inherits every member of the base class but derived classs can
not access to the private member of the base class?
here what is the difference between "inherits" and "access"? |
|
N********n 发帖数: 8363 | 11
Growth curve, yeah, ri-i-ight. RHT is only INHERITing shares from
EXISTing fellow X-platforms such as Suns whereas MSFT starts from
0% server market penetration to CREATE own shares.
One inherits from others while the other creates own success. As
for growth curve I don't know how to calculate Windows Server's
growth curve b/c if you divide sth by 0% you get an overflow. hoho. |
|
g*****g 发帖数: 34805 | 12 OK, I mess up between the languages, you are right.
That being said, design patterns today favor composition over inheritance,
multiple inheritance is not necessary in OO language. |
|
L*****e 发帖数: 8347 | 13 如果是decorator pattern的话,BufferedReader不应该从Reader那里inherit Read()
并overrides Read()吧?InputStreamReader也从Reader()那里inherit Read()并
overrides Read().
这么看BufferedReader怎么也不是decorator pattern,难道说decorator pattern还有
变形体?
override |
|
Y**G 发帖数: 1089 | 14 Not really. This language uses class based inheritance, Javascript has no "
class" concept, everything is object and it adopts prototype based
inheritance.
, |
|
c*********e 发帖数: 16335 | 15 inheritance当然就意味着strong coupling.如果一对白人夫妻,生了个黑人孩子,那
还叫inheritance吗? |
|
c*********e 发帖数: 16335 | 16 请详细说明。inheritance里面,比如interface是一个车,然后有honda,toyota,bmw之
类的inheritance,可以用interface里面的方法。没啥错啊。也没啥大忌讳啊。 |
|
g*****g 发帖数: 34805 | 17 OOP里面inheritance只是一种选择,没有人逼你代码重用必需使用inheritance。 Java
里的接口就是让你可以选择composition。认为任何一个有用另一个没用都是极端。如
何能代码最少而且扩展容易就是最优的代码。 |
|
e*******o 发帖数: 4654 | 18 你说的是 vertical inheritance
还有 horizontal inheritance 这个在生物界也是存在的 有些语言中叫 trait 有些叫
role haskell 中是 class |
|
g*****g 发帖数: 34805 | 19 inheritance is not bad, abuse of inheritance is bad. |
|
z*y 发帖数: 1311 | 20 "next" is inherited, so no problem
but "next->prev" is not inherited |
|
l**********n 发帖数: 8443 | 21 在js里,定义inheritance, 很容易
util.inherits(clazz, super-clazz).
其实主要是这两个语言的callback最舒服。
在ruby里定义around:
@around = lambda { |*a, &b| @around.call(*a) { |*b| callback.call(*b, &b)}}.
js的callback就不用说了 |
|
j********8 发帖数: 21 | 22 讲的就是基因组印记?
要是这样岂不是将灌水发挥到了极至?
Paternally Induced Transgenerational
Environmental Reprogramming of
Metabolic Gene Expression inMammals
Epigenetic information can be inherited through the
mammalian germline and represents a plausible
transgenerational carrier of environmental information.
To test whether transgenerational inheritance
of environmental information occurs in mammals, we
carried out an expression profiling screen for genes
in mice that responded to paternal diet. Offspring
of males fed... 阅读全帖 |
|
r********s 发帖数: 149 | 23 Dear Colleagues:
It is with great sadness that we write to report the death of our colleague,
Simon W.-L. Chan, an HHMI-Gordon and Betty Moore Foundation Investigator.
Simon, 38, passed away on Wednesday, August 22, 2012 after a brief illness.
He is survived by his parents, Avril and Robert Chan, and sister, Caron
Chan.
In June 2011, Simon was among the first plant scientists selected for the
inaugural class of investigators funded jointly by HHMI and the Gordon and
Betty Moore Foundation to su... 阅读全帖 |
|
l**********1 发帖数: 5204 | 24 Re LZ
pls go to
one RNA-seq blog
one topic:
Long noncoding RNAs in pathogenesis
web link:
http://www.rna-seqblog.com/
LncRNAs (pronounced “link”) are long non-coding RNAs that are emerging as
important regulators of gene expression in biological processes and diseases
. In this issue of the Journal of Clinical Investigation, two papers connect
lncRNAs to inherited conditions in humans.
Sylvia B-hring and colleagues at the Experimental and Clinical Research
Center in Berlin found a chromosomal ... 阅读全帖 |
|
p*****c 发帖数: 20445 | 25 A-D E-K L-P R-Z
Peter Baumann, Ph.D.
HHMI Early Career Scientist
Stowers Institute for Medical Research
Peter Baumann’s research focuses on beginnings and endings: beginnings in
the form of reproduction in unisexual lizards and endings in the form of the
telomeres that protect chromosome tips.
Each time chromosomes are copied, telomeres—specialized stretches of DNA
that extend from the ends of each chromosome—become progressively shorter.
With each cell division, they ero... 阅读全帖 |
|
w***r 发帖数: 709 | 26 Did Mendel Fudge His Results?
Gregor Mendel was a 19th Century monk who discovered the laws of inheritance
(dominant and recessive genes etc.). More recent analysis of his results
suggest that they are "too good to be true". Mendelian inheritance involves
the random selection of possible traits from parents, with particular
probabilities of particular traits. It seems from Mendel's raw data that
chance played a smaller part in his experiments than it should. This does
not imply fraud on the part... 阅读全帖 |
|
W******r 发帖数: 789 | 27 先从官方网站上抄录几段。
What is known about the BRCA1 and BRCA2 genes?
Because family history is the strongest single predictor of a woman's chance
of developing breast cancer, researchers turned to cancer-prone families -
those with a high incidence of cancer in several generations - to find
specific inherited gene alterations that are passed on from one generation
to the next. After a long search, two genes were found that are altered in
many families with hereditary breast cancer. The first, BRCA1 (for ... 阅读全帖 |
|
a**********m 发帖数: 2098 | 28 你的积蓄是婚前还是婚后的?你能证明是婚前的话,那就算separate property,否则就
要和你老公分了。
个人认为如果不能证明是婚前你的个人财产(separate property),那即使你写上父母
的名字,如果你老公不同意赠予,那你也不能单方面的给你父母,所以还是得对半分。
可参见下面两个链接。
http://www.divorcenet.com/states/oklahoma/marital_and_separate_
klahoma
Marital Versus Separate Property in Oklahoma
In a divorce, it's vital to know whether your property is "marital" or "sepa
rate;" your separate property remains yours and cannot be divided by a judg
e, but Oklahoma courts can divide marital property between spouses.
Genera... 阅读全帖 |
|
x****n 发帖数: 893 | 29 Serum test theta has a reference interval from 0 to 5 mg/dL. Changing the
reference interval to 0 to 10 mg/dL would do which of the following?
A. Increase the specificity
B. Increase the sensitivity
C. Increase the number of false-negative results
D. Decrease the number of false-positive results
E. Not alter the sensitivity or specificity
正确是B。
我的理解是,如果reference interval被扩大了,说明会有更多的超出本来的正常范围
的数值被当做正常,比如8,原来是超出范围的,现在会被认为是在reference
interval之内。所以会有更多的假阴性。我选了C。
第二题:
An African-American couple with ... 阅读全帖 |
|
j********t 发帖数: 97 | 30 1. 多态指针要求public inheritance。因为protected inheritance class的instance
不包含based class的private member,derived class instance无法转成based class
instance。
2. 子类通常在构造函数的初始化列表中初始化父类。 |
|
s****p 发帖数: 19 | 31 1. B is not true. Surely you can cast a derived type pointer to a base type
one. this is just dynamic binding. The problem is that when doing
Base *pd = new Derived;
the pd pointer wants to bind to the base part of the Derived object, however
since the inheritance is protected, that part is inaccessible publicly, and
compiler reports an error.
If you change the inheritance label to public, it compiles with no error.
This also proves that casting derived pointer to base ptr is OK. |
|
r****r 发帖数: 9 | 32 Assume there are n genes on a chromosome (say chromosome 1), each person has a
pair of such chromosome. Each child will randomly inherit one chromosome of t
he pair. Given the person has m children, what's the probability of all 2n gen
es have been inherited?
Assume in miosis
(1) there are 0 recombination between the chromosome pair
(2) there are infinite large recombinations between the chromosome pair
under assumption (1), the probability is 1-(1/2)^(m-1)
under assumption (2), the probability |
|
w******y 发帖数: 4871 | 33 Febrile seizures
Author
Marvin A Fishman, MD
Section Editor
Douglas R Nordli, Jr, MD
Deputy Editor
Janet L Wilterdink, MD
Last literature review version 19.1: January 2011 | This topic last updated:
February 3, 2011 (More)
INTRODUCTION — Febrile seizures are a common cause of convulsions in young
children. They occur in 2 to 4 percent of children younger than five years
of age, but the incidence is as high as 15 percent in some populations. This
incidence has been attributed to closer living arr... 阅读全帖 |
|
z*******n 发帖数: 1034 | 34 http://www.informit.com/articles/printerfriendly/2211695
Introduction to "The Java Language Specification, Java SE 8 Edition"
By James Gosling, Gilad Bracha, Alex Buckley, Bill Joy, Guy L. Steele
Date: Jun 12, 2014
The Java® programming language is a general-purpose, concurrent, class-
based, object-oriented language. It is designed to be simple enough that
many programmers can achieve fluency in the language. The Java programming
language is related to C and C++ but is organized rather dif... 阅读全帖 |
|
M******a 发帖数: 6723 | 35 来自主题: Mod_CHN_Hist版 - 奉天兵工厂 https://wwiiafterwwii.wordpress.com/2017/04/03/mukden-arsenal-after-wwii/
Mukden Arsenal after WWII
April 3, 2017 jwh19752 Comments
(Zhang's Gate, the old entrance to Mukden Arsenal)
For people interested in Japanese firearms of WWII, the name Mukden Arsenal
is familiar. The history of the facility after Japan's defeat is less well
known. Under various names, it did survive for some time, producing an odd
mix of WWII weapons after the war's end.
(Mukden Arsenal proofmark during WWII)
Mukden an... 阅读全帖 |
|
C*********y 发帖数: 1424 | 36 The Seven Habits - An Overview
Our character is a collection of our habits, and habits have a powerful role
in our lives. Habits consist of knowledge, skill, and desire. Knowledge
allows us to know what to do, skill gives us the ability to know how to do
it, and desire is the motivation to do it.
The Seven Habits move us through the following stages:
1. Dependence: the paradigm under which we are born, relying upon others
to take care of us.
2. Independence: the paradigm under which we can... 阅读全帖 |
|
w*******y 发帖数: 60932 | 37 For those that know the GH2 this is a great deal. The 14-140mm lens is a
great lens as opposed to the 14-42 junk that is in most bundles. The camera
takes amazing video. In low light it is practically night vision
particularly when paired with the 20mm pancake. The cheapest I had seen it
before is $1000 at Samy's but that was only BM for those in Cali and you had
to pay tax.
Link:
http://store.uniquephoto.com/e/index.php/panasonic-lumix-dmc-gh
Me personally I would say if you pair this bundl... 阅读全帖 |
|
v**********m 发帖数: 5516 | 38 楼上文章的comments
Not yet but stay tuned. But a definite fact and you can review it in the FDA
's analysis in the briefing document is that there was no SS of astrocytomas
in male rats or female rats.
Dr. Alavi had concerns about how Arena calculated the exposure margin for
Lorcaserin, that is why it appeared in the CRL. When Arena met directly with
the FDA on December 15th and 16th at the FDA, both Arena and the FDA agreed
on the CSF methodology and the number of participants that would be
acceptab... 阅读全帖 |
|
x*****u 发帖数: 3419 | 39 【 以下文字转载自 Translation 讨论区 】
发信人: xiaozhu (此君), 信区: Translation
标 题: A Very Short History of Bad Writing z
发信站: BBS 未名空间站 (Sun Aug 14 15:01:00 2011, 美东)
A Very Short History of Bad Writing
===================================
Now, anyone familiar with the history of English prose might wonder
whether anything we do here will substantially improve its future. Since
the earliest times, many writers have graced us with much good writing.
But others have afflicted us with much that is b... 阅读全帖 |
|
z******0 发帖数: 1014 | 40 美国P民幸福开心顺从缴的税
Sales Tax
Hotel Tax
School Tax
Liquor Tax
Luxury Tax
Excise Taxes
Property Tax
Cigarette Tax
Medicare Tax
Inventory Tax
Car Rental Tax
Real Estate Tax
Well Permit Tax
Fuel Permit Tax
Inheritance Tax
Road Usage Tax
CDL license Tax
Dog License Tax
State Income Tax
Food License Tax
Vehicle Sales Tax
Gross Receipts Tax
Social Security Tax
Service Charge Tax
Fishing License Tax
Federal Income Tax
Building Permit Tax
IRS Interest Charges
Hunting License Tax
Marriage License Tax
Corporate |
|
N****n 发帖数: 6571 | 41 Congratulations to Mr. Liu! -----He is the one of the kind to inherit and
embody the spirit and soul of China, far more than the current government in
China. |
|
a******n 发帖数: 280 | 42 【 以下文字转载自 Military 讨论区 】
发信人: almarvin (marvin), 信区: Military
标 题: 龙延:挖出共产党的根(一)(转自独立评论)
发信站: BBS 未名空间站 (Mon Oct 18 23:02:26 2010, 美东)
(在1782年7月各国的共济会领导人在德国法兰克福的郊区召开的秘密大会之后,光照帮等级的基本
组织结构示意图。)
龙延:挖出共产党的根(一)
作者﹕龙延
美国现任国会图书馆馆长、著名的历史学家詹姆斯•毕灵顿(James H. Billington,
Librarian of Congress)通过系统的研究,在其关于世界革命的专著中指出,近代革命源自十
八世纪德国巴伐利亚的光照帮(Bavarian Order of the Illuminati)[1,2,3,4]。他还
指出,从法国大革命时秘密组织“平等会”的主要领导人之一邦纳罗蒂(Philippe Buonarroti)
到列宁之间有一条使徒传统线[5]。
光照帮是一个极其秘密的政治颠覆性组织。在十九和二十世纪光照帮通过秘密组织策划的颠覆性和革
命性运动... 阅读全帖 |
|
f*******e 发帖数: 785 | 43 PS.我经常当着美国人的面批评美国。
我也常对美国人说中华文化的好。
有很多次,我对美国人说过:In a way, I feel so lucky to be born as a Chinese
because I can speak, read & write the most ancient language & communicate
with people living several thousand years ago, WITHOUT any translation. I
was born into such a splendid culture, like inheriting a big treasure----
while you were small, you don't realize it.
有两次,我对美国朋友说:I feel so proud of China.
一次是汶川地震后中央政府的救援。
一次是国家颁发限塑令,购物塑料袋要给钱。
这种感情,朗朗不会有。这种话(尤其是英文,呵呵),朗朗可能也说不来。 |
|
|
DK 发帖数: 194 | 45 those colleges in the US which churn out tons of politicians kinda fit the
description too....ppl who does well in the current system, talking bout
things they prolly dont believe in and will inherit the power of the country
...... |
|
j***a 发帖数: 832 | 46 要 看 你 所 在 的 州 法 律。 大 多 数 的 地 方 比 如 TX, CA, INHERITANCE
PROPERTY is seperate property. 以 后 他 得 到 房 子 后 要 不 要 加 你 媳 妇
的 名 字 (那 大 多 数 情 况 就 是 共 同 财 产 了 吧 ) 就 是 他 自 己 的 事
情 了 。
那 个 富 人 给 孙 子 钱 是 为 了 免 税 把 , Generation skip. |
|
F*V 发帖数: 3978 | 47 http://www.nytimes.com/2011/12/20/world/asia/china-moves-to-ens
BEIJING — Following the death of Kim Jong-il, the North Korean leader,
China is moving quickly to deepen its influence over senior officials in
North Korea and particularly with those in the military to try to ensure
stability in the isolated nation, according to Chinese and foreign former
government officials and analysts.
China is North Korea’s foremost ally, and leaders here had been hoping Mr.
Kim would live for at least another... 阅读全帖 |
|
z***e 发帖数: 5393 | 48 “每一个网页,都需要一个由PHP嵌入的HTML来,通过访问数据库或者文件的方式,展
现所能访问的可能是不同的内容。"
----polymorphism/inheritance就是针对这种情况的。PHP你可以用一个base class来
定义基本操作,然后child来做不同的。如果页面在server端生成又比较复杂,那么职
业的作法是把模板存在server端,然后php只管读取数据后,再读入模板重新render(
其实就是替换字符串)后返回。
字体什么的都是靠css统一搞定。
上面好多人都说了,你们直接搞一个open source的cms+bbs(joomla/mambo什么的,
drupal应该也不错),搞起来再说,而不是在功能/需求都不清楚的情况下就纠缠用perl
还是php。 |
|
c*********2 发帖数: 3402 | 49 【看中国记者魏锦华编译】本文译自江学勤(Jiang Xueqin)1月12日发表在《外交学
者》上的文章。
上周,超级博主David Cohen讨论了胡锦涛的文章论述中国和西方开始了文化战。胡锦
涛在文中所用的语言和修辞“我们必须清楚地看到,国际敌对势力正在加紧西化和分裂
中国的战略图谋,思想和文化领域,是其长期渗透的重点”—这让西方观察家感到震惊
,并让人想起了红卫兵挥舞着红宝书的场景。
在胡锦涛任职期间,他表现出了最自律,最不露痕迹的技术官僚形象。所以他的此次言
论是非常少见的值得一评的事件。我想对他的文章及其对中国2012年产生的影响发表看
法。
首先,我同意David Cohen的说法,胡锦涛的文章是讲给体制内的党员听的。明年10月
交接权力之前,胡锦涛有两个直接的担忧:他要留下政治遗产,同时为共产党未来规划
战略。
第二,胡锦涛文章最有意思的地方,不是他讲了什么,而是他没讲什么:即,他选择了
强调一个没多少人会认为是问题的一个问题,而留下了他10年前从江泽民那里继承的至
今尚未解决的问题——不断加大的贫富差距,党内腐败,中国道德沦丧。
在整个任职期间,胡锦涛在他严厉而又空洞的... 阅读全帖 |
|
|