七月, 2008

关于unicode,mbcs,utf8,charset,encoding等相关概念的说明 (转贴)

关于unicode,mbcs,utf8,charset,encoding等相关概念的说明

作者:小猪

发布Antlr For Delphi Target 3.1b2

这两天休息,抽出时间将Antlr For Delphi Target 从3.01同步更新到了3.1b2,已知大的问题是

感兴趣的可以下载例子程序(http://www.sharpplus.com/downloads/AntlrDelphiExamples.zip)

Google Trends

Google Trends最近开始支持查询指定一个网站访问者最经常访问的相关网站。

接口循环引用导致的内存泄漏

接口如果之间循环引用,引用计数总是无法归零,会产生内存泄漏,下面是一个简单的实例,基于GC的Java,不会产生类似的泄漏.
unit Unit2;

interface

uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;

type
TForm2 = class(TForm)
btn1: TButton;
procedure btn1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;

IChild=interface
['{ADA8F7F3-AA7D-4D57-8FA8-0FA501458981}']
procedure SetParent(AParent:IInterface);
procedure SetChild(AChild:IInterface);
end;

TChild=class(TInterfacedObject, IChild)