The Wiert Corner – irregular stream of stuff

Jeroen W. Pluimers on .NET, C#, Delphi, databases, and personal interests

  • My badges

  • Twitter Updates

    • RT @samgerrits: Caroline en asielzoekers, een tweeluik. Links: dwepen met een speldje gekregen van een Iraanse asielzoeker, rechts: nou ja… 2 hours ago
    • RT @delphijunkie: Yeah, nah. I'm good thanks Twitter. https://t.co/eTMPUoeSEa 2 hours ago
    • RT @d_feldman: Microsoft: We have world class AI research Google: We have world class AI research Meta: We’re one or two steps behind in AI… 2 hours ago
    • RT @SchipholWatch: Op dit moment is kerosine zo’n tien keer goedkoper dan alternatieve synthetische brandstof. De overheid moet dit prijsve… 2 hours ago
    • RT @jasongorman: One aspect of LLMs many folks overlook is the energy cost of training one. GPT-3 used an ~936 MWh and training it took 102… 2 hours ago
  • My Flickr Stream

  • Pages

  • All categories

  • Enter your email address to subscribe to this blog and receive notifications of new posts by email.

    Join 4,178 other subscribers

Archive for August 30th, 2018

Delphi: delete temporary file after response dispatched – Stack Overflow

Posted by jpluimers on 2018/08/30

A while ago, Marjan Venema was in need for [Archive.isDelphi SOAP: delete temporary file after response dispatched – Stack Overflow.

The solution there is a truly temporary file: a file stream that when the handle closes will have Windows delete the file by setting the correct flags.

The construct is functionally identical to the JclFileUtils.TJclTempFileStream [Archive.is].

It passes these [Archive.isfile attribute constant flags to the [Archive.isCreateFileW Windows API function:

  • FILE_ATTRIBUTE_TEMPORARY
  • FILE_FLAG_DELETE_ON_CLOSE

I was glad she asked, though I wanted a temporary file to last after debugging, so I wrote code like this because internally the same FileGetTempName method is used by the JCL:

var
// ...
  TempPath: string;
  TempStream: TFileStream;
  TempStreamWriter: TStreamWriter;
begin
// ...
  TempPath := FileGetTempName('Prefix');
  TempStream := TFile.Open(TempPath, TFileMode.fmOpenOrCreate, TFileAccess.faReadWrite, TFileShare.fsRead);
  try
    TempStreamWriter := TStreamWriter.Create(TempStream);
    try
      TempStreamWriter.WriteLine('Debug starts:');
      MyStringList.SaveToStream(TempStream);
      TempStreamWriter.WriteLine();
// ...
      TempStreamWriter.WriteLine('Debug finishes.');
    finally
      TempStreamWriter.Free();
    end;
  finally
    TempStream.Free();
  end;

–jeroen

Posted in Conference Topics, Conferences, Delphi, Development, Event, Software Development | Leave a Comment »

TwistedDoodles • The truth about Eureka. (I say bollocks… A lot!)

Posted by jpluimers on 2018/08/30

The truth about Eureka.(I say bollocks… A lot!)

I bumped into this a while ago, but since I’ve been doing quite a bit of research lately, it’s worth repeating.

–jeroen

Source: TwistedDoodles • The truth about Eureka. (I say bollocks… A lot!)

Read the rest of this entry »

Posted in Development, Fun, LifeHacker, Power User, science, Software Development | Leave a Comment »

How to read data from old delphi application Paradox databases without BDE?

Posted by jpluimers on 2018/08/30

Interesting question that raise some good tips: [WayBack] How to read data from old delphi application Paradox databases without BDE? I search for freeware or open source solution. – Jacek Laskowski – Google+

–jeroen

Posted in Database Development, Delphi, Development, Paradox, Software Development | Leave a Comment »

Handling a new era in the Japanese calendar in .NET | .NET Blog

Posted by jpluimers on 2018/08/30

A first-hand look from the .NET engineering teams: [WayBack] Handling a new era in the Japanese calendar in .NET | .NET Blog

Very important if your software has to do anything with Japan, which – for global software and web applications – can be a lot.

Via: [WayBack] If you thought Y2K, leap years, easter and lent were complex, take a look at the Japanese era challenge… – Lars Fosdal – Google+

–jeroen

Posted in .NET, Development, Software Development | Leave a Comment »

 
%d bloggers like this: