Archiv für den Monat Mai 2016

How to TStringList to JSON Array and vice versa

Nachfolgend zwei kleine Funktionen um eine TStringList bzw. TStrings in ein TJSONArray und umgekehrt zu wandeln.

uses
  Data.DBXJSON;

function StringsToJSONArray(const Data: TStrings): TJSONArray;
var
  I: Integer;
begin
  Result := TJSONArray.Create;
  for I := 0 to Data.Count - 1 do
    Result.Add(Data[I]);
end;

function JSONArrayToStrings(const Data: TJSONArray): TStringList;
var
  I: Integer;
begin
  Result := TStringList.Create;
  for I := 0 to Data.Size - 1 do
    Result.Add(Data.Get(I).Value);
end;

Weiterlesen

Long start/request times in Internet Explorer and bad code in ISAPIThreadPool.pas

I have created a web site which serves a lot of jpeg images (via <img /> – tags) from one of my web services. The web browser download most of this images simultaneously. In Internet Explorer I had the problem of long waiting times on start/request. See Screenshot. Weiterlesen

How to protect a Firebird table against direct writing?

In Firebird it is possible to insert/update data in a table even if the user did not have direct write access to this table. One way is to insert/update data via a stored procedure. In this case the user connected to the database has only execute permissions to the stored procedure. The stored procedure has the necessary insert/update permissions to the table. Weiterlesen