【 以下文字转载自 Military 讨论区 】
发信人: playadelrey (A smile is a curve gets things straight), 信区: Military
标 题: 给力OCA直接跟ABC和JK较劲,直接给template去抗议赞助商
发信站: BBS 未名空间站 (Sat Nov 23 22:20:58 2013, 美东)
这么明确,简单,动动手指的事情,大家一起来把它给办了!
请大家多多转贴,转载
信中说:
OCA chapter members, lay advocates, and interested individuals can file a
form 2000e complaint with the FCC
点击链接填表抗议: https://esupport.fcc.gov/ccmsforms/form2000!formSelection.action
Additionally, individuals can support OCA’s efforts to pull sponsorship
from Jimmy Kimme... 阅读全帖
【 以下文字转载自 Programming 讨论区,原文如下 】
发信人: stock (Microsoft is dead), 信区: Programming
标 题: Perl for programmers(10): A template for CGI file
发信站: The unknown SPACE (Fri May 26 11:12:07 2000) WWW-POST
#!/usr/bin/perl -w
############################################################
################
# Copyright (c) 1999-2000 Ywu.com Inc.
# This program contains proprietary and confidential
information. All
# rights reserved except as may be permitted by prior
written consent.
#
# R E V I S
I downloaded a joomla template and would like do some edition to custdomize
it. But I don't know how to preview the result? Can anyone help?
I can upload it to the remote hosting server to view it but that would be
inconvenient.
Thanks!
I will attend an IEEE conference to present a paper, my boss ask me to apply
for the NSF travel grant, I have not done this before.
Did anyone get this kind of grant before, what is the chances?
What is the standard for evaluating the applicant?
Is there any template for doing this?
thanks in advance for sharing?
Better wait for .Net 2.0 generics. Any hack you come up with will be useless
in a few months.
Generics is a CLR type, so it can be used across .Net languages. But it
doesn't have certain features that template has (yet), such as specialization.
The java web frameworks are more or less similar nowadays.
The biggest difference is the view templating technology IMHO.
People all agree MVC pattern should be used. However, in view,
you have presentation logic to wire view and model. How to separate
presentatino logic from view becomes a big design difference.
Generally, people agree view should be dumb so that you cannot
change model or have control logic in it. Sun recommends having
view helper. They used JSP for the implementation, present
when i used ACM SIG proceeding latex template, the references's first author
's last name is always in abbreviation. For example,
John Smith, David Wang, "paper name". will displayed as
J.S. and D Wang, "paper name".
Can anyone tell me how to make it like:
J. Smith and D. Wang, "paper name"?
Thanks!
It's good to have compiler check as much as possible and as early as
possible. At the same time, we want to have flexibility.
template will make perfect sense in Collection classes, for example,
Vector is way better than Vector
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~he said he's got a different
implementation of valarray, which is
template class valarray.
Why doesn't std::valarray allow size parameter?
there is no "static linkage". there's only 3 types of linkage: external,
internal and no linkage. external linkage object can be referred in other
translation units, internal linkage can be referred in the same translation
unit but in different scope, no linkage can't be referred outside the scope.
whatever static linkage is, both template and macro can be external or
internal linkage. mixing macro and linkage are vague and not strict anyway,
since macros are not seen by compilers at all.
1. You can dynamic-cast the in object to target types. If it fails, do
nothing. Otherwise, get the id from the casted type.
2. If there is no target type known-in-advance, for example you don't want
to list all possible target types or it is created by third party, you can
use template constrain in definition. Some thing like this:
bool Comparer (T t1, T t2) where T : IIDBase
{
return t1.Equals(t2);
}
IIDBase is the interface:
Interface IIDBase
{
int GetID();
}
Then derive a
factory stresses on interface, you have the same interface and pluggable
implementations, thus caller can be unaware of implementation.
Example, DB driver, you want to use one new DB, you have to have a new
driver
that implements the interface.
template stress on using same operation on different data type.
You are implementing a generic operation, most useful for collection
opertations like insert/delete/sort in STL.
factory method pattern: it is a creational pattern. it is used to seperate
the class instantiation from the caller. so the caller can get the object
instance without know or refer to the concrete class.
template method pattern: it is a behavior pattern. it defines the skeleton
of business logic in the abstract class. the subclass implements the
business logic following the skeleton.
请问instantiation应该放在哪个文件中?
现在遇到的问题是
template class A
声明在 A.h
定义在 A.cpp
实例在 A.cpp
class B
声明在 B.h
定义在 B.cpp
B要用到A
class C
声明在 C.h
定义在 C.cpp
C要用到B
我想实例化 A< list >,这句应该放在哪里好
如果放在C.cpp中,gcc 好像ignore了。。。
solution 1, include your template definition in your header file.
solution 1 upgrade, pre compile that header
solution 2, explicit instantiation in a.cpp
in my project, I have following 3 files
//t.h
#include
template
myFunc (std::vector& var){
....
}
//a.cpp
#include "t.h"
void funcA(){
std::vector a;
std::vector b;
myFunc(a);
myFunc(b);
}
void funcB();
int main(){
funcA();
funcB();
}
//b.cpp
#include "t.h"
void funcB(){
std::vector a;
std::vector b;
myFunc(a);
myFunc(b);
}
if I build it, I'll get an error that myFunc(std::vector&) defined
twice.
if I manage them in di
比如这个例子:
template
class Test{
T a;
};
Test a;
Test b;
能把各种用过的模板都展开,然后生成C++源码:
class Test_int{
int a;
};
class Test_double{
double a;
}
Test_int a;
Test_double b;
thx