bits and pieces from everyday coding
Pascal HTML Batchfile
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
DUnit
src
thirdpartylibs/sdedit
.gitignore
README.md
thundax.projectGroup.groupproj
thundax.projectGroup.groupproj.local

README.md

bits and pieces from everyday coding

Thundax repository contains Delphi examples on:

  • Mock Objects
  • Custom Attributes
  • Fluent interfaces
  • Regular Expressions
  • UML Diagrams
  • Logging
  • Design Patterns
  • Code Coverage
  • Class Operator
  • Class Helper
  • Multi-threading
  • Anonymous methods
  • Unit testing
  • Profiling
  • Debugging
  • Plotting
  • Refactoring

Feel free to use them to improve your applications.

Mimicking LINQ:

function TQueryImplementation.GetIntegerListQueryValues: TList<Integer>;
var
  IqueryList : IQueryList<Integer, Boolean>;
  item : integer;
begin
  Result := TList<Integer>.Create;
  IqueryList := TQueryList<Integer, Boolean>
    .New()
    .FillList(function ( list : TList<Integer> ) : Boolean
              var k : integer;
              begin
                for k := 0 to 100 do
                  list.Add(Random(100));
                result := true;
              end);

  //Display filtered values
  for item in IqueryList
    .Select(function ( list : TList<Integer> ) : TList<Integer>
              var
                k : integer;
                selectList : TList<Integer>;
              begin
                selectList := TList<Integer>.Create;
                for k := 0 to list.Count-1 do
                begin
                  if Abs(list.items[k]) > 0 then
                    selectList.Add(list.items[k]);
                end;
                list.Free;
                result := selectList;
              end)
    .Where(function ( i : integer) : Boolean
          begin
            result := (i > 50);
          end)
    .Where(function ( i : integer) : Boolean
          begin
            result := (i < 75);
          end)
    .OrderBy(TComparer<integer>.Construct(
         function (const L, R: integer): integer
         begin
           result := L - R; //Ascending
         end
     )).Distinct.List do
          result.add(item);
end;

Example DUnit:

Example using Fluent Interfaces:

Example using Quick Sequence Diagram Editor (sdedit):

Sponsors

No sponsors yet! Will you be the first?

PayPayl donate button