TClientDataSet支持超长字段名

找到 DataSnap.DBClient.pas文件, 拷贝到一个目录中, 例如 D:\DataSnap.DBClient.pas ,修改其中的 TCustomClientDataSet.AddFieldDesc 方法, 1 2 3 4 5 6 7 8 //fix cds 字段长度限制问题 LName := TMarshal.ReadStringAsAnsi(CP_UTF8, TPtrWrapper.Create(@FieldDesc.szName[0]));

先后抛硬币问题

问: A和B轮流抛硬币决定谁穿女装, 抛中正面的人穿女装, 先抛的人穿女装的概率多大? 解: 不妨设A先抛, 并且A穿女装的概率为x, 那么B穿女装的概率

FireDAC DataSnap Connection Pool

First use these units as follows. Of course, also need some other units 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 uses SysUtils, Classes, DB,Variants, Windows, Math, System.IniFiles, SynCommons, IPPeerClient, FireDAC.Comp.Client, FireDAC.Phys.DS, FireDAC.Comp.UI, FireDAC.Phys.Intf, FireDAC.Stan.Util, FireDAC.Stan.Def, FireDAC.Stan.Pool , FireDAC.Stan.Error, FireDAC.Stan.Intf, Datasnap.DSHTTPLayer; then we need a record to read configs, you can implement it as you like 1 2 3 4 5 6 7 8 9 10 TDSPoolConfig = record CleanupTimeout: string; ExpireTimeout: string; MaximumItems: string; Server: string; Port: string; DSUserName, DSPassword: string; IsHttpClient:Boolean; procedure ReadConfig; end; ok, now come the pool

How to Use mORMot to Build Rest Services and Consume Them

如何使用mORMot构建Rest服务并使用 服务端 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 var FModel: TSQLModel; FDB: TSQLRestServer; FServer: TSQLHttpServer; //Create Server FModel := TSQLModel.Create([], 'api'); FDB := TSQLRestServerFullMemory.Create(FModel, 'test.json', false, false); //reg services FDB.ServiceRegister(TTestService, [TypeInfo(ITestService)], sicShared); //setting and start it FServer := TSQLHttpServer.Create(httpPort,

Use webhook to deploy Hugo

First, make sure your hugo blog files are hosted on Github or any other git hosting server where you can access to through network. Github is suggested. in your server 1 2 3 4 5 6 apt-get install hugo wget https://github.com/adnanh/webhook/releases/download/2.6.8/webhook-linux-amd64.tar.gz tar -zxvf webhook-linux-amd64.tar.gz mv webhook-linux-amd64 webhook && cd webhook chmod +x webhook vim hooks.json 1 2 3 4 5 6 7 [ { "id": "redeploy-webhook", "execute-command": "/pathto/hookscripts.

Build Restapi With Gin and Mgo

首先安装govendor 1 go get -u github.com/kardianos/govendor 并添加 $GOPATH/bin/ 到环境变量中 这样可以执行 govendor 命令来确认已经完成安装 新建目录 例如 $GOPATH/src/gin-mgo-api 并创建一个 main.go, 然后 govendor init 初始化之 使用 govendor 来

Replace Battery of Nexus6p

Nexus 6P跟了我有快两年的时间了, 最近开始变得越来越不给力了, 经常20%左右就直接关机, 一个早上还没过完就只剩下60%的电了, 于是基本上最近一段

TWinHTTP

1 2 3 4 5 6 7 8 9 uses SynCrtSock; {$R *.dfm} procedure TForm1.btn1Click(Sender: TObject); begin mmo1.Lines.Add( TWinHTTP.Get('https://www.baidu.com')); end; 静态调用

SynLog日志组件捕获成吨可调试异常

工程设置(Release or Debug) Delphi Compiler -> Linking -> Map file -> Detailed Delphi Compiler -> Compiling -> Debug information -> Debug information 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37

以JSON作为配置文件

代码如下 其实我一直有个疑问, 为什么github上很多的配置库基本上都是只读的,并没有提供写配置的方法,因为如果可以实时地修改某个配置项的话就