Visit site Yanniel's notes
February 2012
1
vote
Deep copying (cloning) objects in Delphi
Yanniel's notes
– [More Delphi articles by Yanniel at http://www.yanniel.info/p/delphi-programming.html] When I first took a look at the prototype design pattern in GoF(years ago), I realized that there was a big obstacle (challenge) to implement it in Delphi: How to write a routine to really clone (not just ...
0
votes
Deep copy clone object in Delphi
Yanniel's notes
– When I first took a look at the prototype design pattern in GoF(years ago), I realized that there was a big obstacle (challenge) to implement it in Delphi: How to write a routine to really clone (not just recreate) an object? In other words, how to perform a deep-copy of a living object in ...
January 2012
8
votes
String comparison in Delphi
Yanniel's notes
– Have you ever wondered how utilities like Beyond Compare or DIFF are comparing files? They do this (I guess) by solving the longest common subsequence (LCS) problem.After reading the Wikipedia article liked above, I obtained an overall view of the problem and I looked at the possible resolutions. ...
0
votes
Testing the World Away: Recovery mission
Yanniel's notes
– I was recently reviewing the DUnit website and I noticed there is a broken link to an article titled “Testing The World Away”. It was written by Will Watts for QBS Software. November, 2000. I said “OK, maybe the articled was relocated somewhere else in the QBS Software website”; so I tried a custom ...
2
votes
Delphi Implementation for the OpenSubtitles API
Yanniel's notes
– OpenSubtitles.org allows searching and hosting subtitles in several formats (SRT, SUB, etc.) and pretty much every language. It currently has a vast database of subtitles (expanding every day). OpenSubtitles.org also exposes a XML-RPC based API that can be used in order to build third party ...
December 2011
1
vote
Request the Google PageRank the Delphi way
Yanniel's notes
– In this post I am implementing the Delphi way to request the Google Toolbar’s PageRank (PR). As an example, if I want to look up the PR of my blog (http://www.yanniel.info/), I will have to query the following URL: http://toolbarqueries.google.com/tbr?client=navclient- ...
4
votes
Pascal Server Pages – Pascal Script
Yanniel's notes
– Without getting too technical, I would define a Pascal Server Page (PSP) as a dynamic web page containing embedded Pascal Script (PS) code. When a web request is made, the PS code needs to be executed (interpreted) in the server side and outputted into the proper format (HTML, XML, JSON, text, ...
1
vote
Salary Guide for Delphi developers: Let’s make it
Yanniel's notes
– If you work as an IT professional in North America, you should probably find very useful the 2012 Technology Salary Guide published by Robert Half Technology.This guide exposes the compensation trends (salary trends) for pretty much every position in Information Technology. It covers the United ...
November 2011
2
votes
Generating Fibonacci numbers in Delphi: Recursive and iterative algorithms
Yanniel's notes
– In this post, I want to implement a function that returns the Nth Fibonacci number. Initially, I will provide a recursive implementation that derives directly from the Fibonacci sequence definition. Afterwards, I will recode the same function using an iterative approach.Why do I want to do (share) ...
5
votes
Internationalizing your Delphi application: An ABC example
Yanniel's notes
– If you want to make your Delphi application general enough to address multiple locales, then you need to internationalize it. There are three common aspects that I want to emphasize (no necessarily in that order): Resourcing Unit conversionsDynamic messagesWe’ll cover the three of them with a very ...
1
vote
Multiton Design Pattern in Delphi
Yanniel's notes
– The multiton is somewhat an extension of the singleton pattern. It is referred as registry of singletons by the GOF. I don’t know for sure who appointed the name multiton: it’s an analogy derived from the term singleton. So, singleton = single + ton; while multiton = multi + ton.The singleton ...
3
votes
Dependency Injection in Delphi: a simple example
Yanniel's notes
– I want to give a fairly simple Delphi example that will expose the dependency injection pattern. No framework, no third-party library will be needed here: just plain Delphi code.I won’t dig into the different forms of dependency injection. I will explain the idea of the pattern as simple as ...
September 2011
6
votes
Decorator Design Pattern in Delphi. Multiple Decorations
Yanniel's notes
– In my previous post I introduced the decorator design pattern to you. I used a fairly simple example (a silly example if you wish) in order to give you a flavour of the pattern. I wrote Delphi code for that matter and I focused in having ONE, and only ONE, decorator class.This was the situation in ...
August 2011
4
votes
Decorator Design Pattern in Delphi. Single decoration
Yanniel's notes
– Decorator (also referred as Wrapper) is classified by GoF as a structural pattern. Its purpose is to:“Attach additional responsibilities to an object dynamically. Decorators provide a flexible alternative to subclassing for extending functionality.” Both inheritance and the decorator ...
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) ...




