Redian新闻
>
火柴棒确实可以免费看espn
avatar
火柴棒确实可以免费看espn# PDA - 掌中宝
w*s
1
1,what is abi and api, give some example
2, what happens when exception is thrown?
3, what if exception is not caught anywhere?
4, what must be initialized in the initialization list?
5, what is reference vs. pointer?
6, how do you debug a box which has no debugger installed? i.e. you suspect
a process is hanging, but no debugger, how to tell what goes wrong?
avatar
a*c
2
马总的2个加时代破的1个都可以,直接点了就看,没有让输什么。
avatar
l*t
3
1. Know API, never heard ABI
2. All stacks pop
3. Hand all the way to the top, i.e. main(), and then halted by operating
system
4. Question not clear. Nothing, or constant class members.
5. reference is alias, bound forever, can not change.
pointer is more universal, unless you define something like
int * const *
Also there's some difference when you use reference/pointer as parameters
passed into a function.
6. C: printf printf printf printf printf
C++: cout cout cerr cerr
BTW: what do you mean by "a box" here? Linux box? XBOX? SandBox? BlackBox?
avatar
r*i
4
难道有高科技detect楼主家的Comcast?

【在 a********c 的大作中提到】
: 马总的2个加时代破的1个都可以,直接点了就看,没有让输什么。
avatar
s*r
5
6应该是trigger core dump 所有的thread,用kill send个signal给process,signal
几得查一下

【在 l********t 的大作中提到】
: 1. Know API, never heard ABI
: 2. All stacks pop
: 3. Hand all the way to the top, i.e. main(), and then halted by operating
: system
: 4. Question not clear. Nothing, or constant class members.
: 5. reference is alias, bound forever, can not change.
: pointer is more universal, unless you define something like
: int * const *
: Also there's some difference when you use reference/pointer as parameters
: passed into a function.

avatar
a*c
6
我家是cablevision。。。

【在 r**i 的大作中提到】
: 难道有高科技detect楼主家的Comcast?
avatar
w*s
7
According to your answers, you won't pass.
abt 6), it's a linux box, app is already running, no print or log.

【在 l********t 的大作中提到】
: 1. Know API, never heard ABI
: 2. All stacks pop
: 3. Hand all the way to the top, i.e. main(), and then halted by operating
: system
: 4. Question not clear. Nothing, or constant class members.
: 5. reference is alias, bound forever, can not change.
: pointer is more universal, unless you define something like
: int * const *
: Also there's some difference when you use reference/pointer as parameters
: passed into a function.

avatar
i*s
8
俺twc 要code

【在 a********c 的大作中提到】
: 马总的2个加时代破的1个都可以,直接点了就看,没有让输什么。
avatar
w*s
9
you can't download files from the box, no gdb there, and the process is
critical, you can't just kill it.

signal

【在 s*****r 的大作中提到】
: 6应该是trigger core dump 所有的thread,用kill send个signal给process,signal
: 几得查一下

avatar
s*d
10
我的att uverse要输code。第二个就不用了,但我觉得是因为我的帐号已经连上了?
avatar
l*t
11
Good to know. Will study more.
abt 6) How is this question related to C++? How about coding a debugger in C
++?

【在 w********s 的大作中提到】
: According to your answers, you won't pass.
: abt 6), it's a linux box, app is already running, no print or log.

avatar
a*c
12
我的note3上面的espn就要输,输了也看不了,只定了internet没有cable。。。看来火
柴棍的app特殊

【在 s**********d 的大作中提到】
: 我的att uverse要输code。第二个就不用了,但我觉得是因为我的帐号已经连上了?
avatar
w*s
13
it may be not that related to c++

C

【在 l********t 的大作中提到】
: Good to know. Will study more.
: abt 6) How is this question related to C++? How about coding a debugger in C
: ++?

avatar
d*o
14
如果是火柴棍的福利,很好;如果是bug,不要声张,否则很快就会消失
avatar
s*r
15
不清楚kill干什么的还提问,这是公司问你的问题吧

【在 w********s 的大作中提到】
: you can't download files from the box, no gdb there, and the process is
: critical, you can't just kill it.
:
: signal

avatar
u*d
16
肯定是巴哥了,我的不能看。

【在 d*******o 的大作中提到】
: 如果是火柴棍的福利,很好;如果是bug,不要声张,否则很快就会消失
avatar
a*c
18

觉得是马鬃跟isp有协议,问了邻居也能看。

【在 u****d 的大作中提到】
: 肯定是巴哥了,我的不能看。
avatar
f*d
19
你每次都发的什么破题阿, btw, c++11 const data member 可以直接inclass
initialize了, 所以问题4已经不成立了

suspect

【在 w********s 的大作中提到】
: 1,what is abi and api, give some example
: 2, what happens when exception is thrown?
: 3, what if exception is not caught anywhere?
: 4, what must be initialized in the initialization list?
: 5, what is reference vs. pointer?
: 6, how do you debug a box which has no debugger installed? i.e. you suspect
: a process is hanging, but no debugger, how to tell what goes wrong?

avatar
s*d
20
我的输了code才看到的。
朋友只有TWC Internet,输了code也看不了。

【在 a********c 的大作中提到】
:
: 觉得是马鬃跟isp有协议,问了邻居也能看。

avatar
w*s
21
有些process就是不能随便kill啊,比如一个正在交易的程序,你不知道它到底是hang
了,还是正常。production box没有debugger。

【在 s*****r 的大作中提到】
: 不清楚kill干什么的还提问,这是公司问你的问题吧
avatar
a*c
22

看来cablevision牛x!

【在 s**********d 的大作中提到】
: 我的输了code才看到的。
: 朋友只有TWC Internet,输了code也看不了。

avatar
w*s
23
谁说过只有const是答案?

【在 f**d 的大作中提到】
: 你每次都发的什么破题阿, btw, c++11 const data member 可以直接inclass
: initialize了, 所以问题4已经不成立了
:
: suspect

avatar
u*d
24
我也看到code了,会不会输了code,费用就跑到ISP账单去了?

【在 s**********d 的大作中提到】
: 我的输了code才看到的。
: 朋友只有TWC Internet,输了code也看不了。

avatar
q*x
25

no context, no idea.
sth like stack unwinding.
forget.
parent class?
this is basic
suspect
for loop dump pstack

【在 w********s 的大作中提到】
: 1,what is abi and api, give some example
: 2, what happens when exception is thrown?
: 3, what if exception is not caught anywhere?
: 4, what must be initialized in the initialization list?
: 5, what is reference vs. pointer?
: 6, how do you debug a box which has no debugger installed? i.e. you suspect
: a process is hanging, but no debugger, how to tell what goes wrong?

avatar
s*d
26
不可能不告诉你价钱同不同意就charge你吧。
朋友的看不了输code也还是看不了。

【在 u****d 的大作中提到】
: 我也看到code了,会不会输了code,费用就跑到ISP账单去了?
avatar
s*r
27
知道是不是行了容易,难的是知道为什么行了

hang

【在 w********s 的大作中提到】
: 有些process就是不能随便kill啊,比如一个正在交易的程序,你不知道它到底是hang
: 了,还是正常。production box没有debugger。

avatar
a*n
28
twc 点开就能看espn,不会是现在垃圾比赛能看,nba就不能了吧?
avatar
y*o
29
reference variable

【在 f**d 的大作中提到】
: 你每次都发的什么破题阿, btw, c++11 const data member 可以直接inclass
: initialize了, 所以问题4已经不成立了
:
: suspect

avatar
a*w
30
还真是的啊
avatar
g*u
31
哪家公司?
我觉得是难啊。。
avatar
r*n
32
+1

【在 a********c 的大作中提到】
: 马总的2个加时代破的1个都可以,直接点了就看,没有让输什么。
avatar
S*I
33
Based on answers above, no wonder it is hard to find a good C++ programmer
nowadays. :)

suspect

【在 w********s 的大作中提到】
: 1,what is abi and api, give some example
: 2, what happens when exception is thrown?
: 3, what if exception is not caught anywhere?
: 4, what must be initialized in the initialization list?
: 5, what is reference vs. pointer?
: 6, how do you debug a box which has no debugger installed? i.e. you suspect
: a process is hanging, but no debugger, how to tell what goes wrong?

avatar
R*M
34
加时带破的是什么?

【在 r****n 的大作中提到】
: +1
avatar
u*d
36
staples

【在 R*M 的大作中提到】
: 加时带破的是什么?
avatar
z*g
37
1,what is abi and api, give some example
API=application programing interface. ABI=?
2, what happens when exception is thrown?
In current function, if there is a try-catch, will go to catch part; If
there is try-finally, will go to finally; Otherwise, will go out of the
function and return to previous call.
3, what if exception is not caught anywhere?
The process will end with a certain error and signal.
4, what must be initialized in the initialization list?
For my style, every field must be initialized. For stl, it's not a must
requirement.If it's a c-style list, it depends on the structure.As I always
init everything, there is no problem.
5, what is reference vs. pointer?
Almost the same. Both represents the address of variable. Pointer can be
casted to any other types of pointers.
6, how do you debug a box which has no debugger installed? i.e. you suspect
a process is hanging, but no debugger, how to tell what goes wrong?
The key point is collecting the threads's stack info. Remote debugging and
core dump analysis are both okay. The exact steps might be as below:
First, we should talk to the box using tools such like ssh, telnet, serial
port usb and etc.
Second, after the connection is established, we should indentify whether it'
s a dead lock or endless loop by checking the CPU usage. And then, we should
identify whether the hang is in user-space or kernel-space. If it's in
kernel space, the process can not be killed, so we can try to kill the
process. But before kill it, we must ensure the killing would not impact the
business and most importantly, we must get the core file(on linux, we can
use gcore; on windows, we can use tool like windbg...). After user-mode core
file are collected, we can try to kill the process. If it's cannot be
killed, the problem must be in kernel. At this stage, we need remote
debugging or collect the kernel core dump: on linux, we can use 'echo *'(I
forget the exact command) to mannual trigger; on windows, we can use a
customized kernel module to trigger it.
Third, if we have a core file(no matter where it is), list all the threads'
stack.
1) for endless loop, check the running time and start time and stack infor.
2) for dead lock, check every thread where it is stuck.
avatar
r*n
38
是地

【在 R*M 的大作中提到】
: 加时带破的是什么?
avatar
w*s
39
most of your answers are bad.
for example, C++ does not have finally.
you still don't know what exception is not caught.
and there's no remote debugging as it's a production box, everything is
restricted, you cannot download dump file even you collect.

【在 z****g 的大作中提到】
: 1,what is abi and api, give some example
: API=application programing interface. ABI=?
: 2, what happens when exception is thrown?
: In current function, if there is a try-catch, will go to catch part; If
: there is try-finally, will go to finally; Otherwise, will go out of the
: function and return to previous call.
: 3, what if exception is not caught anywhere?
: The process will end with a certain error and signal.
: 4, what must be initialized in the initialization list?
: For my style, every field must be initialized. For stl, it's not a must

avatar
H*s
40
定了qualified 的cable service没?

【在 a*******w 的大作中提到】
: 还真是的啊
avatar
z*g
41
Actually, if you have developped windows driver, there is indeed try-finally
. C++ can be used to develop windows filesystem driver and there is try-
finally and I used it.It depends on the system and compiler.
For exception, I cannot describe it as same as book. However,I think if
there is a problem or a snippet of code. I'm sure I can describe it clearly.
For the box, my company is focus on appliance. I have to say it's a bad box
if the box has no way to remote debugging. Debugable is a base requirement
for any software.I will netver let that happen in my project. I have
debugged over 4000 dead locks both in user-space and kernel-space, so what I
said is the best practice.If you have better methods, I'm glad to learn it.

【在 w********s 的大作中提到】
: most of your answers are bad.
: for example, C++ does not have finally.
: you still don't know what exception is not caught.
: and there's no remote debugging as it's a production box, everything is
: restricted, you cannot download dump file even you collect.

avatar
H*s
42
定了qualified 的cable service没?

【在 r****n 的大作中提到】
: +1
avatar
b*z
43
Your answer for exception is wrong, stack unwonding is the answer

finally
clearly.
★ 发自iPhone App: ChineseWeb 8.6

【在 z****g 的大作中提到】
: Actually, if you have developped windows driver, there is indeed try-finally
: . C++ can be used to develop windows filesystem driver and there is try-
: finally and I used it.It depends on the system and compiler.
: For exception, I cannot describe it as same as book. However,I think if
: there is a problem or a snippet of code. I'm sure I can describe it clearly.
: For the box, my company is focus on appliance. I have to say it's a bad box
: if the box has no way to remote debugging. Debugable is a base requirement
: for any software.I will netver let that happen in my project. I have
: debugged over 4000 dead locks both in user-space and kernel-space, so what I
: said is the best practice.If you have better methods, I'm glad to learn it.

avatar
r*n
44
我的是frontier fios,只有internet,没有电视。

【在 H**********s 的大作中提到】
: 定了qualified 的cable service没?
avatar
s*x
45
赶紧公布正确答案吧,尤其是最后一道题。
avatar
u*d
46
改没改棒子的DNS?

【在 r****n 的大作中提到】
: 我的是frontier fios,只有internet,没有电视。
avatar
J*s
47
ABI是 application binary interface, 涉及到编译器对语言的实现, 典型的如vtable
的实现, 函数参数的传递.....等等二进制兼容的问题.

【在 l********t 的大作中提到】
: 1. Know API, never heard ABI
: 2. All stacks pop
: 3. Hand all the way to the top, i.e. main(), and then halted by operating
: system
: 4. Question not clear. Nothing, or constant class members.
: 5. reference is alias, bound forever, can not change.
: pointer is more universal, unless you define something like
: int * const *
: Also there's some difference when you use reference/pointer as parameters
: passed into a function.

avatar
a*w
48
No
and only Internet Service

【在 u****d 的大作中提到】
: 改没改棒子的DNS?
avatar
z*g
49
Are you expecting constructor of super class with argument for Q4?
avatar
r*n
50
没有,需要改dns的任务我都交给海美的了,棒子没改,害怕great firewall捣乱。

【在 u****d 的大作中提到】
: 改没改棒子的DNS?
avatar
z*g
51
I think the most significant difference between the usage of pointer and
reference is support on arithmetic operation.
avatar
y*n
52

我在NYC,可以观看没有问题。

【在 i******s 的大作中提到】
: 俺twc 要code
avatar
f*4
53
6: > pstack `ps --no-headers -o pid -C yourbin` >> log

suspect

【在 w********s 的大作中提到】
: 1,what is abi and api, give some example
: 2, what happens when exception is thrown?
: 3, what if exception is not caught anywhere?
: 4, what must be initialized in the initialization list?
: 5, what is reference vs. pointer?
: 6, how do you debug a box which has no debugger installed? i.e. you suspect
: a process is hanging, but no debugger, how to tell what goes wrong?

avatar
a*s
54
装个xmbv然后addon espn 就行了
avatar
b*f
55
Mark
avatar
a*c
56

那效果差watchespn十万八千里,毕竟人家是官版的,全程高清,一点就有。

【在 a*****s 的大作中提到】
: 装个xmbv然后addon espn 就行了
avatar
s*x
57

reference has to refer something, there is no null reference, while a
pointer can be null.
Reference is implemented with pointers.

【在 z******g 的大作中提到】
: I think the most significant difference between the usage of pointer and
: reference is support on arithmetic operation.

avatar
t*t
58

abi=application binary interface, 最主要的是决定函数怎么调用, 还有name
mangling, exception的处理
api还用说么.
stack unwind until caught, or until another exception (terminate())
unexpected()
EDIT:搞混了, 是terminate(). unexpected发生在扔出说明里没有的异常时.
const, reference, parent class w/o default ctor
reference can not be reseated, can not have nullptr value
suspect
这个太泛泛了, 必须得有点背景才行吧. 比如说看/proc/pid里的东西, 但是看什么就
很难说了.

【在 w********s 的大作中提到】
: 1,what is abi and api, give some example
: 2, what happens when exception is thrown?
: 3, what if exception is not caught anywhere?
: 4, what must be initialized in the initialization list?
: 5, what is reference vs. pointer?
: 6, how do you debug a box which has no debugger installed? i.e. you suspect
: a process is hanging, but no debugger, how to tell what goes wrong?

avatar
t*t
59
finally是VC自己加的, 不能算C++.

finally
clearly.
box
I
it.

【在 z****g 的大作中提到】
: Actually, if you have developped windows driver, there is indeed try-finally
: . C++ can be used to develop windows filesystem driver and there is try-
: finally and I used it.It depends on the system and compiler.
: For exception, I cannot describe it as same as book. However,I think if
: there is a problem or a snippet of code. I'm sure I can describe it clearly.
: For the box, my company is focus on appliance. I have to say it's a bad box
: if the box has no way to remote debugging. Debugable is a base requirement
: for any software.I will netver let that happen in my project. I have
: debugged over 4000 dead locks both in user-space and kernel-space, so what I
: said is the best practice.If you have better methods, I'm glad to learn it.

avatar
t*t
60
afaik if you use signal to force core dump, it will also stop the process.
so his concern is legitmate.

【在 s*****r 的大作中提到】
: 不清楚kill干什么的还提问,这是公司问你的问题吧
avatar
w*s
61
yes, but there are more items.

【在 z******g 的大作中提到】
: Are you expecting constructor of super class with argument for Q4?
avatar
w*s
62
of coz you can debug in your qa env, but what if it's in production env? how
do you resove issues there?

finally
clearly.
box
I
it.

【在 z****g 的大作中提到】
: Actually, if you have developped windows driver, there is indeed try-finally
: . C++ can be used to develop windows filesystem driver and there is try-
: finally and I used it.It depends on the system and compiler.
: For exception, I cannot describe it as same as book. However,I think if
: there is a problem or a snippet of code. I'm sure I can describe it clearly.
: For the box, my company is focus on appliance. I have to say it's a bad box
: if the box has no way to remote debugging. Debugable is a base requirement
: for any software.I will netver let that happen in my project. I have
: debugged over 4000 dead locks both in user-space and kernel-space, so what I
: said is the best practice.If you have better methods, I'm glad to learn it.

avatar
w*s
63
4, you missed 'For initialization of member objects which do not have
default constructor'

【在 t****t 的大作中提到】
: afaik if you use signal to force core dump, it will also stop the process.
: so his concern is legitmate.

avatar
t*t
64
哦, 对. 不过说实话我觉得考背书意思不大.

【在 w********s 的大作中提到】
: 4, you missed 'For initialization of member objects which do not have
: default constructor'

avatar
m*o
65
1) arm-none-eabi-gcc ? compiler related.
6) JTAG? hardware debugger. actually JTAG with GDB
avatar
m*x
66
mark
avatar
c*r
67
mark
avatar
k*g
68
I think I didn't do well on 1-5. When I'm in front of a C++ code base I can
remember much stuff. When I'm browsing MITBBS I can't recall much off hand.
6. Packet sniffer?
If the host doesn't communicate with outside, it is effectively a
Schrodinger's box. Just power-cycle it.
If it communicates with outside, then try to analyze how it communicates
with outside, and then deduce if the behavior is normal or bad. If it is bad
, and there's nothing you can do to fix it, then collect enough packets and
power-cycle it.
avatar
w*d
69
1,what is abi and api, give some example
api: usually means interfaces of a library or class.
abi: this is means the binary conversion rules for different compilers or
platforms, such as arguments order in stack for a function call.
2, what happens when exception is thrown?
in C++, the following operations are carried out:
1)unwind the current stack, call any dtor for local vars if necessary, until
there is a catch block that can handle the exception obj;
2)if there is no such catch block in the end(unwind to the bottom of the
stack), abort() the process.
3, what if exception is not caught anywhere?
abort() the process.
4, what must be initialized in the initialization list?
any non-static member var or base class, that have no default ctor, that is
can be called without arguments.
const member var is just one case of those.
5, what is reference vs. pointer?
pointer means an address, with a rep. of type. pointers can be null, or
uninitialized with any value.
ref is an alias for a var, so it must be initialized, and there is no null
ref.
but under the surface, ref is implemented via pointer, so they are identical
to the compiler.
6, how do you debug a box which has no debugger installed? i.e. you suspect
a process is hanging, but no debugger, how to tell what goes wrong?
it depends on many things, such as OS, process behavior, or other processes.
in linux, i usually use 'top' first to see the TIME+ of the target process,
and check any strange if the process should be busy/idle. if the process
has network traffic or io operations, 'sar'/'vmstat'/'iostat' can be used to
check any thing strange. and if there is a counter for requests handled by
the process, that's a straight way to tell whether the process is hanging.
相关阅读
logo
联系我们隐私协议©2024 redian.news
Redian新闻
Redian.news刊载任何文章,不代表同意其说法或描述,仅为提供更多信息,也不构成任何建议。文章信息的合法性及真实性由其作者负责,与Redian.news及其运营公司无关。欢迎投稿,如发现稿件侵权,或作者不愿在本网发表文章,请版权拥有者通知本网处理。