//日期格式为数字 如 20080901
//By zsp007@gmail.com
///验证是否是有效日期
bool date_validate(T)(T date)
{
static T daysOfMonth[] = [0,31,28,31,30,31,30,31,31,30,31,30,31];
T monthDay = date % 10000;
if(monthDay > 1231)
return false;
if(monthDay == 229)
{
int year = date / 1 ...
简陋的封装了一些单表操作
源代码
template eval( A... )
{
const typeof(A[0]) eval = A[0];
}
char[] escape(char[] c){
return "\""~c~"\"";
}
char[] column_def(char[] temp){
return "typeof(this) " ~ temp ~ "(char[] v){ this.column[\"" ~ temp ~ "\"]=v;return this;}\n";
}
char[] table(char[] nam ...
学习的参照资料
http://www.d-programming-language-china.org/
对应版本
DMD 1.013(2007年4月12日)
0.
数组切片
char[][] args=[
"main.exe",
"zsp",
"earth"
];
args[1..$])
1.
可以给引入模块一个本地名称
import io = std.stdio;
io.writefln("hello!");
2.
从一个模块中只导入专门符号,并绑定到当前名字空间
import std.stdio : writefln, foo = writef;
std. ...
Apress.Learn.to.Tango.with.D.Jan.2008.pdf
Learn to Tango with D is a book about the D programming language and the Tango software library. It became available as an eBook 7th of January 2008, whereas the printed version should be available 3 weeks later.
Learn to Tango with D introduces you to D, ...
我用poseidon新建一个全新工程
编译参数加入-g(就是加入调试信息),
试一试如下代码,就会有如"Previous Definition Different"
代码:
import std.c.windows.windows, std.c.windows.winsock;
static this(){
WSADATA wd;
}
int main (){
htons(9001);
return 0;
}
很奇怪...
完整的错误信息如下
Command >>> ReBuilding Project: stalk......
D:\myWay\env\d\ ...







评论排行榜