This is useful blog entry on automating the vside to build from the commandline.
I have added this to an existing want script (want is the ant/nant port for delphi).
This makes our build process far less painful.
Random outpourings of a software developer
This is useful blog entry on automating the vside to build from the commandline.
I have added this to an existing want script (want is the ant/nant port for delphi).
This makes our build process far less painful.
I am studying C# 2.0 to get myself upto speed with .NET 2.0
I am reading “A Programmers Introduction to C# 2.0 – Apress”
There is a great new class in .NET 2:
System.Security.SecureString
This provides a mutable string that is encrypted in memory.
This is ideal for passwords &c that need to be hidden for prying debuggers.
As a Delphi Developer learning C# there are a few very odd things to deal with:
Recent events have shrunk my development team down to just me.
I have been wondering how pair programming would work in situations like this (as a special case of odd sized teams)?
Delphi has a number of very useful stream classes.
They all derive from TStream.
The basic version is TFileStream – this writes to a filesystem.
There is also THandleStream – this writes to a windows handle – useful if you need to keep a file locked then write to it.
TStringStream is useful when dealing with delphi strings – especially when writing to another stream.
TBlobStream is used for accessing blob data from a database.
TResourceStream is used to read from embedded resources.
TMemoryStream that acts upon blocks of memory.
There are also the adapter streams that takes another stream as a parameter.
There is the TIStream that acts as a bridge between TStreams and the IStreams interface.
These include ZipStreams, EncryptionStreams, SocketStreams &c
These all take the approach that everything looks like a file this massively simplifys code.
This is another useful blog.
It covers asp.net and sql server
I know that storing images in a database is oftern a bad idea.
However there can come requirements that force things on you.
For the database end I have used an IMAGE datatype in SQL Server.
The delphi approach is as follows:
You need to use GraphicEx to allow display in the normal controls.
All this requires is adding the GraphicEx unit to the end of your uses clause.
procedure LoadJPEGImageFromStream(const aImage: TImage;
const stream: TStream);
var
aJPEG : TJpegImage;
begin
aJPEG := TJPEGImage.Create;
try
aJPEG.LoadFromStream(stream);
aImage.Picture.Assign(aJPEG);
finally
aJPEG.Free;
end;
end;
procedure LoadFromDB(Image : TImage; aField : TBlobField)
var
aBLOBStream : TStream;
begin
ado.Open;
ado.First;
aBLOBStream := adoFAX.CreateBlobStream(aField,bmRead);
try
LoadJPEGImageFromStream(Image, aBLOBStream );
finally
aBLOBStream.free;
end;
end;
procedure SaveToDB(const filename : string)
var
FS : TFileStream;
begin
FS := TFileStream.Create(filename, fmOpenRead);
try
ado.open;
ado.Insert;
adoIMAGE.LoadFromStream(FS);
ado.Post;
finally
FS.Free;
end;
end;
Just to check that this is not a Delphi-only format I wrote the following test from C#:
sqlDataAdapter1.Fill(dataSet11, “DB”);
// How to get an image from a database in .NET
pictureBox1.Image = new Bitmap( new MemoryStream( dataSet11.DB[0].IMAGE ) );
pictureBox1.Height = pictureBox1.Image.Height;
pictureBox1.Width = pictureBox1.Image.Width;
This loads the image previously stored by a Delphi app.
This ensures that the image format used is language neutral.
There are a number of reasons why a feature is added to a software product:
– Customer requested feature
– Company considers this will benefit the customer
– To obtain a sale that would not otherwise be made
– Match a competitor
– To qualify for an award
This is link to a microsoft knowledge basis article covers auidting under active directory.
This may help identify least priv problems.