Redian新闻
>
万佛有人用touchpad上的那个flickr app么?
avatar
万佛有人用touchpad上的那个flickr app么?# PhotoGear - 摄影器材
x*i
1
只有一点编程经验,书大概看了30%了,请问可以开始刷题了吗?边刷题边看知识点,
这样的学习方法效率高吗?
另外,summer的internship一般什么时候开始找啊?
菜鸟先谢过各位大牛了.
avatar
h*l
2
为什么点了授权什么反应也没有,没有帮助视频里显示的那样出来授权窗口。
avatar
t*b
3
可以了
不高 最好直接刷 遇到不懂的语言特性现场查一下就行了
什么时候都不算早
avatar
g*u
4
刷着刷着就会了
avatar
z*n
5
说实在的,这书一般,不值得花精力看,真不如C++ primer
avatar
y*u
6
zengqinghan兄说的对,看C++ Primer,有些不理解的地方可以参考the c++
programming language

【在 z*********n 的大作中提到】
: 说实在的,这书一般,不值得花精力看,真不如C++ primer
avatar
r*s
7
我觉得bs那个英语还不如我。。。


: zengqinghan兄说的对,看C Primer,有些不理解的地方可以参考the c

: programming language



【在 y**********u 的大作中提到】
: zengqinghan兄说的对,看C++ Primer,有些不理解的地方可以参考the c++
: programming language

avatar
y*u
8
dynamic binding那一部分讲的比c++ primer透彻,我个人是这样认为的
BS去morganstanley发财了,人赢啊
https://www.morganstanley.com/profiles/bjarne-stroustrup-managing-director-
technology

【在 r*****s 的大作中提到】
: 我觉得bs那个英语还不如我。。。
:
:
: zengqinghan兄说的对,看C Primer,有些不理解的地方可以参考the c
:
: programming language
:

avatar
z*n
10

街霸哥赶快开发一个刷题friendly的语言,造福芸芸众生。
比如程序入口统统叫 solution,不叫main。
比如做int到roman number的库函数叫string LC12(int);

【在 y**********u 的大作中提到】
: dynamic binding那一部分讲的比c++ primer透彻,我个人是这样认为的
: BS去morganstanley发财了,人赢啊
: https://www.morganstanley.com/profiles/bjarne-stroustrup-managing-director-
: technology

avatar
y*u
11
我每次跳槽也是family reason,吼吼吼

【在 g*******u 的大作中提到】
: 人家半截入土了 还在乎这个? 据说是为了离孩子近点
avatar
y*u
12
返回值是string array,里面有bug free的source code and 各种followup的解法,然
后写个embedded vm去run,太猥琐了

【在 z*********n 的大作中提到】
:
: 街霸哥赶快开发一个刷题friendly的语言,造福芸芸众生。
: 比如程序入口统统叫 solution,不叫main。
: 比如做int到roman number的库函数叫string LC12(int);

avatar
x*i
13
都不懂大牛说的什么啊
avatar
y*u
14
> : 比如做int到roman number的库函数叫string LC12(int);
之前做的几道roman number,大家放松一下:
http://poj.org/problem?id=3562
http://poj.org/problem?id=3353
http://poj.org/problem?id=1213
http://poj.org/problem?id=3448
http://poj.org/problem?id=1588
加油

【在 z*********n 的大作中提到】
:
: 街霸哥赶快开发一个刷题friendly的语言,造福芸芸众生。
: 比如程序入口统统叫 solution,不叫main。
: 比如做int到roman number的库函数叫string LC12(int);

avatar
u*s
15
c++ prime那么厚一本书看完黄花菜都凉了。而且intern的面试也很少考语言特性了
avatar
z*n
16

也放松一下,贴个以前写的编译时间计算int to Roman number的C++ metaprogramming
, 学生时在实验室天天就玩这种东西了:
class R2I {
const static int DIG;
public:
constexpr static char IN[] = "MCDXLVI"; ///This is the INPUT number;
const static int OUT;
};
template struct ID {};
template <> struct ID { static const int I = 0; static const int V = 1
; };
template <> struct ID { static const int I = 1; static const int V = 5
; };
template <> struct ID { static const int I = 2; static const int V =
10; };
template <> struct ID { static const int I = 3; static const int V =
50; };
template <> struct ID { static const int I = 4; static const int V =
100; };
template <> struct ID { static const int I = 5; static const int V =
500; };
template <> struct ID { static const int I = 6; static const int V =
1000; };
template
struct DiffHelper { static const int D = -9; }; //-9 means it hits the end
of R2I::IN. It's a valid state.
template
struct DiffHelper {
static const int VAL0 = ID::I;
static const int VAL1 = ID::I;
//The only possible Diff between Pos0 and Pos1 can be -2(IX), -1(IV), 0(
II), 1(VI), 2+ (MI), -3 - is not possible
//To reduce the states, I combined 1 and 2+, becasue 1 is only used to
transfer to state 6, so I did a calc at state 5 for it.
static const int D = (VAL0 - VAL1 <= -3) ? -3 : ((VAL0 - VAL1 >= 1) ? 1
};
//Diff Caculate the Difference of the indices.
template struct Diff { static const int D = DiffHelper< sizeof(R2I::IN) - 1), (I1 < sizeof(R2I::IN) - 1), I0, I1>::D; };
///////////// General ones
template struct State { const static int DIG = -4000;
};//Not accepted; The largest in Roman is 3999.
template struct State { const static int DIG =
ID::V; }; //End of R2I::IN, return what it is.

////////// State 9: IX XC CM
template struct State<9, 1, P> { const static int DIG = IDIN[P]>::V * 4 / 5 + State::I - ID::I) % 2,
Diff

::D, P + 1>::DIG; };
template struct State<9, -9, P> { const static int DIG = IDIN[P]>::V * 4 / 5; };
//////////// State 6: VI LX DC This state can be merged with II
template struct State<6, 1, P> { const static int DIG = IDIN[P]>::V + State::I - ID::I) % 2, Diff

1, P + 2>::D, P + 1>::DIG; };
template struct State<6, 0, P> { const static int DIG = IDIN[P]>::V + State<2, Diff

::D, P + 1>::DIG; };
//////////// State 4: IV XL CD, Note it is different from 9 as it ends with
V. So the odd/even is opposite for Diff
template struct State<4, 1, P> { const static int DIG = IDIN[P]>::V * 3 / 5 + State::I - ID::I + 1) %
2, Diff

::D, P + 1>::DIG; };
template struct State<4, -9, P> { const static int DIG = IDIN[P]>::V * 3 / 5; };
//////// State 3: III XXX CCC MMM
template struct State<3, 1, P> { const static int DIG = IDIN[P]>::V + State::I - ID::I) % 2, Diff

1, P + 2>::D, P + 1>::DIG; };
/////// State 2: II XX CC MM
template struct State<2, 1, P> { const static int DIG = IDIN[P]>::V + State::I - ID::I) % 2, Diff

1, P + 2>::D, P + 1>::DIG; };
template struct State<2, 0, P> { const static int DIG = IDIN[P]>::V + State<3, Diff

::D, P + 1>::DIG; };
////////////// State 5: V L D
template struct State<1, 1, P> {
const static int DIG = ID::V +
State::I - ID::I == 1) * 6 + (ID};
///////////////State 1: I X C M ; Look into Diff

to calculate
what Difference the next stage is facing.
template struct State<0, 1, P> { const static int DIG = IDIN[P]>::V + State::I - ID::I) % 2, Diff

1, P + 2>::D, P + 1>::DIG; };
template struct State<0, 0, P> { const static int DIG = IDIN[P]>::V + State<2, Diff

::D, P + 1>::DIG; };
template struct State<0, -1, P> { const static int DIG = IDIN[P]>::V + State<4, Diff

::D, P + 1>::DIG; }; //Use Diff


on purpose for situation XL;
template struct State<0, -2, P> { const static int DIG = IDIN[P]>::V + State<9, Diff

::D, P + 1>::DIG; };
///////////////////////
const int R2I::DIG = State::I % 2, Diff<0, 1>::D, 0>::DIG;
const int R2I::OUT = DIG > 0 ? DIG : 0;
using namespace std;
int main()
{
char carr[R2I::OUT];
cout << sizeof(carr) << endl; ///Compile time constant.
cout << R2I::OUT << endl; ///The OUTPUT of the INPUT R2I::IN
}

【在 y**********u 的大作中提到】
: > : 比如做int到roman number的库函数叫string LC12(int);
: 之前做的几道roman number,大家放松一下:
: http://poj.org/problem?id=3562
: http://poj.org/problem?id=3353
: http://poj.org/problem?id=1213
: http://poj.org/problem?id=3448
: http://poj.org/problem?id=1588
: 加油

avatar
y*u
17
这个赞,敢问zengqinghan兄,这种template metaprogramming工作中用的多吗?

metaprogramming
1

【在 z*********n 的大作中提到】
:
: 也放松一下,贴个以前写的编译时间计算int to Roman number的C++ metaprogramming
: , 学生时在实验室天天就玩这种东西了:
: class R2I {
: const static int DIG;
: public:
: constexpr static char IN[] = "MCDXLVI"; ///This is the INPUT number;
: const static int OUT;
: };
: template struct ID {};

avatar
x*r
18
把plus 去掉。这本书没什么看头。
相关阅读
logo
联系我们隐私协议©2024 redian.news
Redian新闻
Redian.news刊载任何文章,不代表同意其说法或描述,仅为提供更多信息,也不构成任何建议。文章信息的合法性及真实性由其作者负责,与Redian.news及其运营公司无关。欢迎投稿,如发现稿件侵权,或作者不愿在本网发表文章,请版权拥有者通知本网处理。