s*a
2 楼
有一个小项目,一两个月的时间 part time 即可。但是需要有足够经验可以
自己从零架构起来的。请大家推荐或者自荐。报酬可议。
自己从零架构起来的。请大家推荐或者自荐。报酬可议。
m*t
3 楼
say I have two functions:
void testFunc(int &i, int &j) {
//some complex operation to get both x and y
i = x;
j = y; //getting y is cheap if x is computed
}
void testFunc(int &i) {
// some complex operation to get x
i = x;
}
then i have some call testFunc(i), some call testFunc(i, j).
I am wondering if I should write testFunc(int &i) as this:
void testFunc(int &i) {
int junk;
testFunc(i, junk);
}
feel it is really ugly but i donot want duplicate the code to calculate x.
Any id
void testFunc(int &i, int &j) {
//some complex operation to get both x and y
i = x;
j = y; //getting y is cheap if x is computed
}
void testFunc(int &i) {
// some complex operation to get x
i = x;
}
then i have some call testFunc(i), some call testFunc(i, j).
I am wondering if I should write testFunc(int &i) as this:
void testFunc(int &i) {
int junk;
testFunc(i, junk);
}
feel it is really ugly but i donot want duplicate the code to calculate x.
Any id
e*a
5 楼
it depends on how i and j are related.
why not include testFunc(i) in testFun(i,j) or add an helper function for
both of them?
【在 m***t 的大作中提到】
: say I have two functions:
: void testFunc(int &i, int &j) {
: //some complex operation to get both x and y
: i = x;
: j = y; //getting y is cheap if x is computed
: }
: void testFunc(int &i) {
: // some complex operation to get x
: i = x;
: }
why not include testFunc(i) in testFun(i,j) or add an helper function for
both of them?
【在 m***t 的大作中提到】
: say I have two functions:
: void testFunc(int &i, int &j) {
: //some complex operation to get both x and y
: i = x;
: j = y; //getting y is cheap if x is computed
: }
: void testFunc(int &i) {
: // some complex operation to get x
: i = x;
: }
t*t
7 楼
why don't you do the other way, i.e. testfunc(i,j) call testfunc(i) then
calculate j.
【在 m***t 的大作中提到】
: say I have two functions:
: void testFunc(int &i, int &j) {
: //some complex operation to get both x and y
: i = x;
: j = y; //getting y is cheap if x is computed
: }
: void testFunc(int &i) {
: // some complex operation to get x
: i = x;
: }
calculate j.
【在 m***t 的大作中提到】
: say I have two functions:
: void testFunc(int &i, int &j) {
: //some complex operation to get both x and y
: i = x;
: j = y; //getting y is cheap if x is computed
: }
: void testFunc(int &i) {
: // some complex operation to get x
: i = x;
: }
m*t
9 楼
ok. testfunc actually parses a document. Parsing a document is expensive,
while checking for certain field is cheap. If parameter j is there, i need
check for j after I get the document object. If j is not there, i donot do
the checking on j field.
【在 t****t 的大作中提到】
: why don't you do the other way, i.e. testfunc(i,j) call testfunc(i) then
: calculate j.
while checking for certain field is cheap. If parameter j is there, i need
check for j after I get the document object. If j is not there, i donot do
the checking on j field.
【在 t****t 的大作中提到】
: why don't you do the other way, i.e. testfunc(i,j) call testfunc(i) then
: calculate j.
i*e
10 楼
花了300人民币不到
太便宜了!
太便宜了!
A*o
11 楼
how about this way:
void testFunc(int& i, int* j=NULL)
{
//Then test if j == NULL or not
}
by this way, you just have one interface to call
【在 m***t 的大作中提到】
: say I have two functions:
: void testFunc(int &i, int &j) {
: //some complex operation to get both x and y
: i = x;
: j = y; //getting y is cheap if x is computed
: }
: void testFunc(int &i) {
: // some complex operation to get x
: i = x;
: }
void testFunc(int& i, int* j=NULL)
{
//Then test if j == NULL or not
}
by this way, you just have one interface to call
【在 m***t 的大作中提到】
: say I have two functions:
: void testFunc(int &i, int &j) {
: //some complex operation to get both x and y
: i = x;
: j = y; //getting y is cheap if x is computed
: }
: void testFunc(int &i) {
: // some complex operation to get x
: i = x;
: }
n*r
17 楼
Kindle上装个“多看”,联小米帐号。多看可以试读,喜欢再买。
相关阅读
写code都推一起很牛逼吗mac 的 file sharing 问题天方夜谭 节选请教一个C++的设计问题打算写一个类似CNN的C++库,搞点deep learning新算法跟风说一下王垠js try catch finally question问个正经的工程技术问题 (转载)面对老印的无底线道德,老中束手无策啊求问C++问题王垠: 编程的宗派谁能给个这样的angular的样板?现在找工作好像要求很高数据库能 version control吗?如果一些platform 没有 api ,怎么做search?linux shell cmd xargs questionskype疯了现在哪个C++ IDE比较好?angular 2 quick start我要是说我发现了AI的秘密你们能相信我吗?