Visit site Yanniel's notes
August 2011
0
votes
Anonymous Methods in Delphi
Yanniel's notes
– Under the scope of Delphi, an anonymous method is either a procedure or function that’s unattached to an identifier. In other words, anonymous methods don’t have names, which is why they are called “anonymous”.Basically, you can assign a block of code (in the form of a procedure or function) ...
0
votes
My contributions to the Delphi community at RosettaCode
Yanniel's notes
– RosettaCode is a wiki site that gathers a collection of programming tasks being resolved in as many programming languages as possible.You can post solutions to a particular task using a particular language (Delphi, Java, C++, C#, Ruby, the list goes and goes). All solutions to the same task ...
0
votes
Hide the utter "Create" constructor of TObject in Delphi
Yanniel's notes
– In Delphi, constructors can be inherited; this doesn’t happen in Java, C# and C++ for example. Furthermore, constructors in Delphi can have multiple and different names; usually they are called Create, but this is just a convention, since you can define a constructor with whatever name you choose.In ...
0
votes
Implementing the Singleton Design Pattern in Delphi without Global Variables
Yanniel's notes
– The purpose of this post is NOT to cover the insights and applicability of the Singleton pattern, instead I just pretend to give you a Delphi code snipped that implements it. This implementation is focused in avoiding variables that are global to the unit (or Unit Global Variables).Fist of ...
July 2011
0
votes
Using Macros in Delphi
Yanniel's notes
– Computer programmers often need to transform a piece of code in a repetitive way. For example, consider transforming the following fields declaration into a fields initialization [1], as shown below: You can do that by hand of course, but you can also use macros to streamline your work, specially if ...
0
votes
Null character in Delphi (Caret notation: ^@)
Yanniel's notes
– I was assigned with a new programming task and I found the following constant declaration in the base code (Delphi 2007):const s1 : PChar = ^@;I was not sure about the meaning of such statement: the first ideas in my mind pointed me to think about some kind of pointer related syntax. I was ...
0
votes
Delphi Developers in Toronto
Yanniel's notes
– There are very little opportunities for Delphi developers in Toronto (Canada). The job market for software developers in this area is monopolized by .NET (C#, VB) and Java technologies in at least an 80 percent. C, C++, PHP, Ruby and even Objective C are more popular than Delphi these days.I love ...
0
votes
String compression/decompression routines using Delphi
Yanniel's notes
– I wrote the following two functions (in bold) with the purpose of compressing/decompressing string values within a Delphi application: .........................implementationuses ZLib;function ZCompressString(aText: string; aCompressionLevel: TZCompressionLevel): string;var ...
0
votes
Fetching a web page with Delphi
Yanniel's notes
– This function fetches the HTML content of a given web page. It takes the page's URL as parameter and returns the corresponding HTML text. The name CURL comes from the PHP Client URL Library that can be used (among other things) for the same purpose..................implementationuses ...
0
votes
Calculating the factorial of a number in Delphi: Recursive and iterative methods
Yanniel's notes
– The factorial function can be defined in both recursive and iterative ways. Take a look at the following definitions borrowed from Wikipedia.Recursive definition: Iterative definition:For both the above definitions we have that: The purpose here is not the mathematical stuff, but two provide the ...
0
votes
New certifications available for Delphi Developers
Yanniel's notes
– Last June 12th, 2011, I received an Embarcadero Community Newsletter pointing out that “certification exams are now available for Delphi developers. Embarcadero's Delphi Certification Program offers two levels: Delphi Certified Developer and Delphi Certified Master Developer. “I just passed ...
0
votes
Template Method Design Pattern in Delphi. A working example
Yanniel's notes
– The Template Method Pattern is very easy to understand and implement. Here’s the definition borrowed from Design Patterns: Elements of Reusable Object-Oriented Software book:“Define the skeleton of an algorithm in an operation, deferring some steps to subclasses. Template Method lets subclasses ...
0
votes
Parameterized Factory Method in Delphi
Yanniel's notes
– Factory Method is a creational design pattern, whose intent (according to Design Patterns: Elements of Reusable Object-Oriented Software book) is to:“Define an interface for creating an object, but let subclasses decide which class to instantiate. Factory Method lets a class defer instantiation to ...




