Archive for the ‘Development’ Category
Posted by jpluimers on 2013/12/19
Even when not using Visual Live Binding, Delphi generates empty .VLB files in both Delphi XE3 (virtually always) and Delphi XE4 (most of the time).
Visual Live Binding is one way of binding data to UI in FireMonkey and can also be used in VCL, but does not have to (Alister Christie made a nice video ▶ Delphi Training Tutorial #77 – Visual Live Bindings – YouTube about it).
Empty VLB files, and a batch file to delete them
The “empty” VLB files are almost empty, as they are exactly 3 bytes long and contain the byte sequence EF BB BF which is the Unicode BOM (byte order mark) for the UTF-8 encoding. Read the rest of this entry »
Posted in Delphi, Delphi XE3, Delphi XE4, Delphi XE5, Development, Encoding, QC, Software Development, Unicode, UTF-8, UTF8 | Tagged: Delphi, VLB | Leave a Comment »
Posted by jpluimers on 2013/12/19
Another episode in the Missed Schedule series that was originally scheduled for 20131201:
Until I read the comments at Monitoring the Monitor, I only knew the early days of Matt Pietrek‘s work at NuMega and as co-author of one of the first Undocumented Windows books (another one appeared about the same time).
Now I know Matt was one of the people interviewing Allen Bauer for his first position at Borland.
A bit more search revealed Matt worked at Borland from 1988 until 1992, roughly the era from Turbo Pascal 5 until Borland Pascal 7 (when Borland already had started researching Delphi), but more importantly with Turbo Debugger versions 1-3 that were indispensable when programming using Turbo C / Turbo C++ and Borland C++.
When Borland was working in Delphi 95, and Microsoft on Windows 95, he moved to Nu-Mega (later Acquired by Compuware) doing lots of work in debuggers.
Some interesting links from or involving Matt:
–jeroen
Posted in Borland Pascal, Debugging, Delphi, Delphi 1, Development, Pascal, Software Development, Turbo Pascal | 2 Comments »
Posted by jpluimers on 2013/12/19
Almost a year ago, a thread on “premature Delphi optimization” came by on G+ about this code:
procedure ExchangeInteger(var AValue1, AValue2: Integer);
begin
AValue1 := AValue1 xor AValue2;
AValue2 := AValue1 xor AValue2;
AValue1 := AValue1 xor AValue2;
end;
I don’t think that was premature optimization, just some code from an old fart that had already been programming in the era where processors had reasons to use it:
Back then, the only efficient way to exchange two variables of the same data type was using the XOR swap algorithm.
Nowadays you have more options, and this is where the fun in that thread began, which I will show in a minute.
First a bit of history
The XOR swap algorithm was widely known in the 80s of last century and before, especially because the 6502 processor (oh the days of LISA Assembler) was vastly popular, as was the Z80. Together, they powered the majority of the home computers in the 70s and 80s.
Read the rest of this entry »
Posted in Borland Pascal, Delphi, Delphi 1, Delphi 2005, Delphi 2006, Delphi 2007, Delphi 2009, Delphi 2010, Delphi 3, Delphi 4, Delphi 5, Delphi 6, Delphi 7, Delphi 8, Delphi x64, Delphi XE, Delphi XE2, Delphi XE3, Development, History, Pascal, Software Development, Turbo Pascal, UCSD Pascal | 7 Comments »
Posted by jpluimers on 2013/12/18
Thanks StackOverflow user splattne (Stefan Platnner) for explaining the differences between the various parameters you can pass to Server.MapPath, and giving some very clear examples.
You can also use it with HostingEnvironment.MapPath, which has the added benefit that it doesn’t require HttpContext (for more detail on it, see Working With HttpContext.Current).
–jeroen
via:
Posted in .NET, .NET 1.x, .NET 2.0, .NET 3.0, .NET 3.5, .NET 4.0, .NET 4.5, ASP.NET, Development, Software Development | Leave a Comment »
Posted by jpluimers on 2013/12/17
The Mono.Options single .cs source file seems very well suited for arguments parsing of (especially) console application:
https://github.com/mono/mono/blob/master/mcs/class/Mono.Options/Mono.Options/Options.cs
so it is on my research list, like some other .NET/C# based command line parsing libraries (:
–jeroen
Posted in .NET, .NET 2.0, .NET 3.0, .NET 3.5, .NET 4.0, .NET 4.5, C#, C# 2.0, C# 3.0, C# 4.0, C# 5.0, Development, Software Development | Leave a Comment »
Posted by jpluimers on 2013/12/13
About a year and a half ago, I wrote about a Batch file to “Keep Alive” a CMAK generated VPN connection in Windows 7.
It uses ping to wait a certain amount of time, but it has the drawbacks of
- requiring TCP/IP to be installed (which some headless systems don’t).
- using N+1 as the number of seconds
Since then, I learned that since Windows Vista and up has timeout command that just waits:
timeout /t 600 /nobreak
Two parameters are used:
- /nobreak
does not stop waiting when you press a key
- /t #
waits # seconds
(the example is 10 minutes, I use it to regularly run FlushFileCache.exe or FlushMem.exe to empty the Windows file chache and release memory – often more than a gigabyte – back to Windows)
There is also sleep.exe, but that requires the Windows Resource Kit or Windows Server 2000/2003.
–jeroen
via:
Posted in Batch-Files, Development, Power User, Scripting, Software Development, Windows | Tagged: batch file | Leave a Comment »
Posted by jpluimers on 2013/12/12
StackOverflow user David Heffernan – Stack Overflow has an interesting take on Delphi postbuild events:
At the moment my actiona read:
if exist PostBuild.bat call PostBuild.bat $(Platform) $(Config) $(OutputDir)
And then the PostBuild.bat script calls a Python script so that I can write my scripts in a real language.
I actually impose the build actions in a shared option set that I reference from all of my projects. That way I enforce consistency and predictability.
I know others use tools like FinalBuilder but building is so important that I feel it’s worth my effort in rolling my own tooling.
– David Heffernan Feb 14 at 20:24
–jeroen
via: Delphi XE3: Problems with complex pre-build events – Stack Overflow.
Posted in Delphi, Delphi 2007, Delphi 2009, Delphi 2010, Delphi XE, Delphi XE2, Delphi XE3, Development, Software Development | Leave a Comment »
Posted by jpluimers on 2013/12/11
One of the easy things in *nix is to set the value of an environment with the output of a command.
Something like this is possible in Windows too, but you have to instruct Windows to keep an empty set of delimiters to capture the full first line.
There is also a small but important difference between Windows and *nix upon command failure: *nix will always return an empty value, but in Windows you must make sure to empty the value first.
Thanks Jesse Dearing for this summary: Read the rest of this entry »
Posted in Batch-Files, Development, Power User, Scripting, Software Development, Windows | Leave a Comment »
Posted by jpluimers on 2013/12/10
Some things you have done for ages, are already phrased so nicely, the only thing you can do is quote.
Thanks Dave Coulter:
You can attach the Visual Studio debugger to a process by:
Debug > Attach to Process > Attach Read the rest of this entry »
Posted in .NET, .NET 1.x, .NET 2.0, .NET 3.0, .NET 3.5, .NET 4.0, .NET 4.5, C#, C# 1.0, C# 2.0, C# 3.0, C# 4.0, C# 5.0, Development, Software Development, Visual Studio 11, Visual Studio 2002, Visual Studio 2003, Visual Studio 2005, Visual Studio 2008, Visual Studio 2010, Visual Studio and tools | Leave a Comment »