由买买提看人间百态

topics

全部话题 - 话题: foo
1 2 3 4 5 6 7 8 9 10 下页 末页 (共10页)
m*********s
发帖数: 354
1
来自主题: Football版 - MFL Trade Poll - foo/monster
Two polls are open:
1. Trade Proposal:
foo: Jay Cutler QB
monster: Mohamed Massaquoi WR, Mike Wallace WR
2. How much should foo/monster be charged for the trade, in case the trade
is approved?
1) US$4.00 for foo, US$2.00 for monster
2) US$2.00 for foo, US$1.00 for monster
3) Waiver cap $400 for foo, $200 for monster
4) Waiver cap $200 for foo, $100 for monster
5) No Charge
Vote Deadline: Noon this Saturday, 9/4. 1:00pm Central time.
S*******s
发帖数: 13043
2
来自主题: Programming版 - shocking! The origin of foo() (转载)
Foo is a metasyntactic variable used heavily in computer science to
represent concepts abstractly and can be used to represent any part of a
complicated system or idea including the data, variables, functions, and
commands just to name a few. Foo is commonly used with the metasyntactic
variables bar and foobar. The word foo itself has no meaning and is merely a
commonly used logical representation that is used much like the letters 'x'
and 'y' in algebra.
Foo has entered the English language as
b***i
发帖数: 3043
3
来自主题: Programming版 - const int foo()啥意思?
不用const也行吧?
比如
int foo()
{
return 5;
}
也不能foo()=6啊
我说过我理解const Obj& foo(),不理解const int foo()
m*********s
发帖数: 354
4
来自主题: Football版 - MFL Trade Poll - foo/monster
Yes, I don't like the idea to change rules now.
How should we charge the 3 players trade like this?
$2.00 for foo, $2.00 for monster and 400 coins for foo and 200 coins for
monster?
Help me clear the mind please.
m*********s
发帖数: 354
5
来自主题: Football版 - MFL Trade Poll - foo/monster
OK, Here is mine interpretion about the charges of rules:
1. Foo is charged for US$4.00 since 2 new players received from trade.
2. Foo is charged for 400 coins since 2 new players received from trade.
3. Monster is charged for US$2.00 since 1 new player received from trade.
4. Monster is charged for 200 coins since 1 new player received from trade.
Please ignore the poll about charges. I will remove that poll.
For the poll about trade:
1. If there are 6 "no" votes, or 51% of voters cast "no" vo
m***0
发帖数: 6
6
来自主题: Programming版 - shocking! The origin of foo() (转载)
【 以下文字转载自 SanFrancisco 讨论区 】
发信人: mark0 (吾道一以灌之), 信区: SanFrancisco
标 题: shocking! The origin of foo()
发信站: BBS 未名空间站 (Tue Jun 5 19:47:45 2007)
rfc3092: Etymology of "Foo"
When used in connection with `bar' it is generally traced to the WW II era
Army slang acronym FUBAR (`Fucked Up Beyond All Repair'), later modified to
foobar.
c********1
发帖数: 421
7
one-liner本身是值得提倡的
但真正简洁的one liner应该写成javascript语法,
foo = bar || {}
而不是python语法
foo = bar if bar else {}
m******r
发帖数: 1033
8
X = data.table(x=c("c","b"), v=8:7, foo=c(4,2))
DT = data.table(x=rep(c("b","a","c"),each=3), y=c(1,3,6), v=1:9)
dt.tbl> DT[X, on=.(y>=foo)]
答案是:
x y v i.x i.v
1: b 4 3 c 8
2: a 4 6 c 8
3: c 4 9 c 8
4: b 2 2 b 7
5: a 2 5 b 7
6: c 2 8 b 7
7: b 2 3 b 7
8: a 2 6 b 7
9: c 2 9 b 7
b***i
发帖数: 3043
9
来自主题: Programming版 - const int foo()啥意思?
C++里面,如果有一个函数
const int foo()
{
return 5;
}
或者是一个对象
const Object bar()
{
...
}
这里const干啥用的?
我同事说只能赋值给常值变量,比如const int i = foo();但是我试了,好像可以随便。
我觉得他和 const Obj& obj = bar_();混了,如果是返回一个引用。这个时候我们不
希望变量随便改写引用的内容。
w*******y
发帖数: 60932
10
This info kind of got buried in the Chinese Democracy thread, and I think it
's important enough to have its own thread. A poster in that thread talked
about a number of CDs and DVD/CD sets he'd marked down at work. I used that
as a starting point to make a list of quite a few that are up now for $0.99
IN STORE AND ONLINE.
These are all $0.99, marked down from $9.99-$11.98:
Bad Co Hits (0.99):
Link:
http://www.bestbuy.com/site/Hits (Bb) - CD/9107236.p?id=1927802&skuId=9107236
Weezer Six Hits (... 阅读全帖
s**********t
发帖数: 1846
11
来自主题: ChinaNews版 - Foo 拼 就是中国版的 Misha Defonseca
http://en.wikipedia.org/wiki/Misha_Defonseca
看她们的语言都类似:
Defonseca/de Wael said that the story of "Misha" "is not actual reality, but
was my reality, my way of surviving" and that there were moments when she "
found it difficult to differentiate between what was real and what was part
of my imagination."
Foo 拼:
“Somehow in my mind I always thought I saw it, but now I'm not sure my
memory served me right. I probably saw it in a movie or something, and I
acknowledge that's a problem."”
x****n
发帖数: 950
12
来自主题: Military版 - Foo 拼 就是中国版的 Misha Defonseca
http://en.wikipedia.org/wiki/Misha_Defonseca
看她们的语言都类似:
Defonseca/de Wael said that the story of "Misha" "is not actual reality, but
was my reality, my way of surviving" and that there were moments when she "
found it difficult to differentiate between what was real and what was part
of my imagination."
Foo 拼:
“Somehow in my mind I always thought I saw it, but now I'm not sure my
memory served me right. I probably saw it in a movie or something, and I
acknowledge that's a problem."”
t**r
发帖数: 3428
13
问个题目,函数foo() 返回1或者0。 如果10s内被调用10此以上 返回1,否则0
不考虑多线程 怎么写这个好?
p**m
发帖数: 11571
14
来自主题: Football版 - [MFL]饭大喜的foo请注意
这礼拜你跟我对阵,刚发现你的TE是bye week,你没调整阵容。
foo这个id好久没上线了,现在是啥id?
b*****u
发帖数: 1978
15
来自主题: Football版 - [MFL]饭大喜的foo请注意
赞 palm 厚道。
foo 应该还在管理MFL的,你看他第3周阵容跟这周对比,
James Jones BYE 所以板凳了,
但 Finley BYE 就没改,
一时糊涂看走眼了?
不过现在想换也还不及了,rtsports 跟 Yahoo 规矩不同。
b*****u
发帖数: 1978
16
来自主题: Football版 - [MFL]饭大喜的foo请注意
我是第一年玩MFL,规矩也不太清楚,
好象过了星期六上午,就不能Add Free Agent ?
foo 队里没有第二个TE,所以想换也来不及了。
r********d
发帖数: 7742
17
到底是foo?
x******i
发帖数: 14369
18
刚刚结束的格莱美,Foo Fighters获奖致词,Dave Grohl 抨击了那些靠着绯闻,奇葩
事迹等炒作,而不是通过音乐本身出名的歌手们,呼吁音乐界拾回自己的灵魂。
Dave Grohl是涅磐的一分子,科特库本也算泉下有知,得以欣慰了哈
h*d
发帖数: 19309
19
我不喜欢foo fighter那个主唱的嗓音,太不给力了。
g******t
发帖数: 18158
20
【 以下文字转载自 Soccer 讨论区 】
发信人: saadi (saadi), 信区: Soccer
标 题: Re: 没看球, foo给个武僧的搞笑视频的链接啊?
发信站: BBS 未名空间站 (Mon Apr 9 00:09:37 2012, 美东)
S*******s
发帖数: 13043
a***e
发帖数: 30
22
static void foo( boolean * validPtr )
谢谢。
t**r
发帖数: 3428
23
foo = bar if bar else {} 這種語法真的惡心到家
V*********r
发帖数: 666
24
foo = if bar then bar else {} 如何?
D*******a
发帖数: 3688
25
are you sure {} in "foo = bar || {}" will DEFINITELY NOT be evaluated?
v*******e
发帖数: 11604
26

python的好,因为还可以 foo = f(bar) if test(bar) else g(bar)
a9
发帖数: 21638
27
来自主题: Programming版 - const int foo()啥意思?
int a = foo();
a = 6; //这里会出异常? 我瞎猜的
b*****e
发帖数: 474
28
来自主题: Programming版 - const int foo()啥意思?
foo 是一个返回 const int 的函数。
这 const 是多余的。因为return 的东西是 r-value, 本来就不能改。
如果是 const char * 或者 const char &, 这里的const 是修饰char, 而不是
整个return type, 所以不是多余的。
也可以写成 char const * 或者 char const &.
w*******y
发帖数: 60932
29
Just saw this on www.mp3pla.net:
http://www.mp3pla.net
Amazon has Foo Fighters Greatest Hits:
http://www.amazon.com/Greatest-Hits-Amazon-Exclusive-Version/dp
MP3 Album for $3.99
Track List
1. All My Life
2. Best Of You
3. Everlong
4. The Pretender
5. My Hero
6. Learn To Fly
7. Times Like These
8. Monkey Wrench
9. Big Me
10. Breakout
11. Long Road To Ruin
12. This Is A Call
13. Skin And Bones
14. Wheels
15. Word Forward
16. Everlong (Acoustic Version)
17. Have A Cigar (Amazon Exclusive)
w*******y
发帖数: 60932
30
Amazon:
http://www.amazon.com/gp/product/B004UOECW4/ref=dm_mu_dp_trk10
has a Free track off the new Foo Fighters album "Wasting Light" titled "I
Should Have Known" available to download
w*******y
发帖数: 60932
31
Free song "I Should Have Known" from the Foo Fighters new album "Wasting
Light".
Click here:
http://www.amazon.com/gp/product/B004VN5POI
.

发帖数: 1
32
来自主题: Military版 - 汽车旅馆老板偷窥客人做爱30年
汽车旅馆老板偷窥客人做爱30年 看遍世相丑恶(图)
https://mmbiz.qpic.cn/mmbiz_jpg/
RiacFDBX14xCHekHDSSxMSTyqpGj8qEVJBv5ux7lx7MiaRMy7D6iaxtkamWcsGe3q9uOT4PNAeib
djPFAjyCQ3gEeQ/640?wx_fmt=jpeg
Photo From The New Yorker
人们正似乎极为迫切地渴望自己的私生活被暴露在众目睽睽之下——Facebook、
Instagram、朋友圈甚至到“直播软件”。人们在社交网络上直播自己的喜怒哀乐、鸡
毛蒜皮、柴米油盐,直播自己过马路、做爱.......
从Kim Kardashian到Paris Hilton,生活在红毯之上镁光灯之下的人们,一面极力
掩盖自己的真实生活,一面又窃喜于风流韵事出现在花边小报的头条上。而屏幕后的我
们,消费着、享用着这些信息,也“模仿”着他们。上世纪60年代,没有智能手机、没
有社交网络。
这篇文章将带你走近一个那个年代一个偷窥狂的生活,看他如何用一支笔和一个记
事本写下三十年看见的一切——那个“曝光”,“隐私... 阅读全帖
v******y
发帖数: 84
33
来自主题: Programming版 - 前几天有人问rvalue reference的
这是我的理解,不对的请指出,谢谢
The usage of rvalue reference &&
Define a class
class MyClass{
public:
MyClass(){/*require for const MyClass cMyClass init. Without this default
constructor, const MyClass will have to be declared and defined as such:
const MyClass cMyClass=MyClass(). MyClass() here will call synthesized
constructor automatically generated by compiler. This synthesized
constructor can not directly initiate const. So following is illegal without
default constructor: const MyClass cMyClass;*/}
};... 阅读全帖
d**********o
发帖数: 1321
34
来自主题: WebRadio版 - 潜水员冒泡兼征版友意见
hw3 & hw3b 最终结果
贴一个自己 hw3b 的 match 结果让小伙伴们感受一下我们作业需要的结果是什么样子
的。
如果是同专业的小伙伴,最后拷贝到编辑器中仔细看一下,这个网页因为宽度有限,让
并排两列的比较呈现出来的很变形。
=================================================
Output of Building User Code
Explode the tar
c-.l
c-.y
makefile
scanType.h
symtab.h
symtab.c
20131116163236-(me~~)-CS445-F13-A3B.tar: POSIX tar archive (GNU)
Tests: directory
c-.l: lex description text
c-.y: lex description text
... 阅读全帖
d**********o
发帖数: 1321
35
来自主题: WebRadio版 - 潜水员冒泡兼征版友意见
hw3b deadline前版本
这里我也先公开承认一下自己早前犯过的错误,在这个楼的第 14 页、第 265 楼,我
有贴出自己的hw3b,但现在我必须向亲爱的读者一一您公开道歉。因为当时因为着急,
我没能找到hw3b deadline前的版本,就把这次作业后来的最终版本(也就是那个楼贴
出来的,只剩下ReturnK、CompoundK两条小尾巴的版本,那个版本被我改动了时间戳我
现在已经把它改回来了。相比于急于求成绩,我更希望自己作一个诚实的人,希望大家
能原谅)给贴出来了。因为我们作业deadline之后也还都是可以接着交的,所以任何作
业,老师都是可以根据后来的版本,追终到这个学生的最后进展的,这个最新进展老师
到底给不给分、就要看老师如何下决定了。
deadline前的版本,被我附在下面了。
当然,把自己的这个版本更新后,我愿为这个楼(这一次出来写的所有)属于自己的每
个贴子负责,所有写出来的,都是真实发生过的事。
=================================================
Output of Building User Code
Ex... 阅读全帖
d**********o
发帖数: 1321
36
来自主题: WebRadio版 - 潜水员冒泡兼征版友意见
hw3 & hw3b 最终结果
贴一个自己 hw3b 的 match 结果让小伙伴们感受一下我们作业需要的结果是什么样子
的。
如果是同专业的小伙伴,最后拷贝到编辑器中仔细看一下,这个网页因为宽度有限,让
并排两列的比较呈现出来的很变形。
=================================================
Output of Building User Code
Explode the tar
c-.l
c-.y
makefile
scanType.h
symtab.h
symtab.c
20131123233236-(me~~)-CS445-F13-A3B.tar: POSIX tar archive (GNU)
Tests: directory
c-.l: lex description text
c-.y: lex description text
... 阅读全帖
d**********o
发帖数: 1321
37
来自主题: WebRadio版 - 潜水员冒泡兼征版友意见
hw3b deadline前版本
这里我也先公开承认一下自己早前犯过的错误,在这个楼的第 14 页、第 265 楼,我
有贴出自己的hw3b,但现在我必须向亲爱的读者一一您公开道歉。因为当时因为着急,
我没能找到hw3b deadline前的版本,就把这次作业后来的最终版本(也就是那个楼贴
出来的,只剩下ReturnK、CompoundK两条小尾巴的版本,那个版本被我改动了时间戳我
现在已经把它改回来了。相比于急于求成绩,我更希望自己作一个诚实的人,希望大家
能原谅)给贴出来了。因为我们作业deadline之后也还都是可以接着交的,所以任何作
业,老师都是可以根据后来的版本,追终到这个学生的最后进展的,这个最新进展老师
到底给不给分、就要看老师如何下决定了。
deadline前的版本,被我附在下面了。
当然,把自己的这个版本更新后,我愿为这个楼(这一次出来写的所有)属于自己的每
个贴子负责,所有写出来的,都是真实发生过的事。
=================================================
Output of Building User Code
Ex... 阅读全帖
c********2
发帖数: 56
38
来自主题: JobHunting版 - 贴个FLEXTRADE的在线C++测试的题
面的是Associate C++ Developer,下面是面试题,光顾着记题了,最后只有56%的通过
率,要到
80%才能ONSITE,算是帮大家做点贡献吧,他家在招人,赶快去投简历
1) #include
using namespace std;
struct A{
A(int value) : m_value(value){}
int m_value;
};
struct B:A {
B(int value):A(value){}
};
int main(){
try {
try{
throw B(5);
}
catch(A a){
a.m_value *=2;
throw;
}
catch(B b){
b.m_value -=2;
throw b;
}
}
catch(A a){
... 阅读全帖
x******a
发帖数: 6336
39
来自主题: 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.... 阅读全帖
h****b
发帖数: 157
40
来自主题: Programming版 - 看道c++题: brianbench
class Foo {
public:
virtual ~Foo() {}
};
class Bar : public Foo {
};
class Bar2 : public Foo {
};
class FooBar : public Bar {
};
class FooBar2 : public Bar2 {
};
以下哪个对?
1. Foo &foo = static_cast(FooBar2 f);
2. Foo &foo = dynamic_cast(*(new FooBar2)); 编译不过。
2肯定对,为啥1不对?我试了,如果1写成,
FooBar2 1;
Foo &foo = static_cast(f);
编译没问题。
指教,谢谢
d****p
发帖数: 685
41
来自主题: Programming版 - Interview question: is the following code OK?
#include
#include
class Foo;
typedef boost::shared_ptr Foo_ptr;
class Foo
{
static std::map fooMap;
int id;
public:
static Foo_ptr GetFoo(int id)
{
Foo_ptr foo(new Foo(id));
fooMap[id] = foo;
return foo;
}
Foo(int id) : id(id) {}
~Foo() { fooMap.erase(id); }
}
std::map Foo::fooMap;
int main()
{
Foo_ptr foo = Foo::GetFoo(3);
k****e
发帖数: 126
42
来自主题: Programming版 - 问个超简单的C问题
If a[][] is declared as static storage duration then it will certainly go to
.data segment. If not, the compiler will probably use immediate value
instead.
If you compare the following, (gcc version 4.5.3 -O0)
(1) array a[] has "auto" storage duration.
#include
#include
int foo()
{
int a[] = {3, 4, 5};
return a[2];
}
int main(void)
{
int temp;
temp = foo();
printf("%d", temp);
return 0;
}
Sections:
Idx Name Size VMA LMA File ... 阅读全帖
y****n
发帖数: 15
43
来自主题: Programming版 - 请教一个关于std::function的问题
请大牛们帮忙看看这段代码,在编译的时候会有如下error message 请问如何能编译通
过啊?跪谢!
当然这只是个虚构的例子,主要是想在template存在的情况下,传递一个member
function的指针给另一个member function.
test1.cpp: In member function 'void Foo::testInt()':
test1.cpp:30:61: error: no matching function for call to 'Foo::processVector
(std::vector&, std::_Bind_helper std::_Placeholder<1>&>::type)'
processVector(arr, std::bind(&Foo::print, this, _1));
^
test1.c... 阅读全帖
i**********e
发帖数: 1145
44
来自主题: JobHunting版 - a very general c++ question
class Foo {
// bla bla bla
};
class A{
public:
Foo foo1() {
return x;
}
const Foo &foo2() {
return x;
}
private:
Foo x;
};
通常没必要的话直接返回 Foo object 就可以了。
返回 const Foo & 主要是在以下的情况:
Foo x = A().foo2();
避免不必要的两次 copy(例如:A().foo1())。但是现在的编译器都很聪明,A().foo1
() 这种情况也只 copy 一次。
还有一种情况返回 const Foo & 的目的就是避免以下奇怪的情况:
(A().foo2() = x) = y;
如果 foo2() 的返回值定义为 Foo & 就反而会编译通过。
想想看 assignment operator 的返回值你就知道我在说什么意思了。在 primitive
type 里:
int x, y, z;
(x = y) = z;
虽然以上的含义很多人都搞不懂,但是语法是对的。
简单来说,在你自己定义的 user type,如... 阅读全帖
v******y
发帖数: 84
45
来自主题: Programming版 - 这二个在C++中有区别不?
要用
Foo myFoo=*(new Foo());
正确的话,copy construct要重新定义
Foo(const Foo & rhs){
//memberwise copy of Foo's member from rhs to this
delete &rhs;//prevent memory leak
}
那以后就不能用, Foo myFoo=Foo();
这个delete stack上的Foo()是undefined.
虽然很多程序运行没有问题,但是还是不安全
有啥办法不?
还有如果
Foo *a=new Foo();
Foo b(*a);
a就给释放了。程序完全乱了
c++无法知道object是分配到heap还是stack的。
A*******e
发帖数: 2419
46
来自主题: Programming版 - 请教C++11的rvalue ref
这里说的很清楚。
http://jxq.me/2012/06/06/%E8%AF%91%E8%AF%A6%E8%A7%A3c%E5%8F%B3%
如果你实现了void foo(X&);,但是没有实现void foo(X&&);,那么和以前一样foo的参
数只能是左值。如果实现了void foo(X const &);,但是没有实现void foo(X&&);,仍
和以前一样,foo的参数既可以是左值也可以是右值。唯一能够区分左值和右值的办法
就是实现void foo(X&&);。最后,如果只实现了实现void foo(X&&);,但却没有实现
void foo(X&);和void foo(X const &);,那么foo的参数将只能是右值。
如果同时定义,是不是就有二义性了?
A*******e
发帖数: 2419
47
来自主题: Programming版 - 请教C++ call-by-ref & call-by-val的问题
lambda里会出现这种情况:
using Callback = std::function;
vector foo_list;
Callback foo_callback = [&foo_list](Foo foo) {
foo_list.emplace_back(std::move(foo));
}
这是因为下面的函数被认为是同一个函数?
void f(const Foo& foo);
void f(Foo foo);
总觉得上面的用法怪怪的。是不是直接声明为下面这个较好?由caller决定传foo时要
不要move。
using Callback = std::function;
m**********w
发帖数: 4161
48
来自主题: Apple版 - Object C问题请教
下面的类定义哪个对?全对?
关于v4和v5,有说法xcode 4.4.1以上,synchroize也可省略。是这样吗?
类成员变量命名需要和getter/setter名字区别吗?好的实践是什么?
v1:
// foo.h
@interface Apple
@property NSString *ipad;
@end
// foo.m
@implement Apple
@synthesize ipad = _ipad;
v2:
// foo.h
@interface Apple {
NSString *ipad;
}
@property NSString ipad;
@end
// foo.m
@implement Apple
@synthesize ipad;
v3:
// foo.h
@interface Apple {
NSString *_ipad;
}
@property NSString ipad;
@end
// foo.m
@implement Apple
@synthesize ipad = _ipad;
v4
// foo.h
@interface Apple... 阅读全帖
b*******s
发帖数: 5216
49
"数组简单,内存消耗小,class肯定代码多"
sure ?
how about this class
class foo
{
foo() = delete;
foo(const foo&) = delete;
foo& operator=(const foo&) = delete;
foo(const foo&&) = delete;
foo& operator=(const foo&&) = delete;
};
1 2 3 4 5 6 7 8 9 10 下页 末页 (共10页)