Quantcast
Channel: TMS Software
Viewing all 1008 articles
Browse latest View live

Array and Matrix operations with Analytics 2.2

$
0
0

New version 2.2 of TMS Analytics and Physics pack includes total support of operations with N-element arrays and MxN matrices. The operations realized in the Linear Algebra extension package. Array and matrix operations allow advanced calculations with small, compact formulae.

Let us consider the examples of using the array/matrix operations for solving some common math/statistics problems. First of all we need to add special variables to the translator instance:

var
  av: TArray<TFloat>;
  mv: TArray<TArray<TFloat>>;
begin
  translator:= TTranslator.Create;

  translator.Add('µ', 0.0);

  av:=TArray<TFloat>.Create(0.2, -0.1, -0.25, 0.4);
  translator.Add('A', av);

  av:=TArray<TFloat>.Create(-0.2, 0.2, -0.1, 0.25, 0.35, 0.15, -0.04, 0.01, -0.12, 0.1);
  translator.Add('B', av);

  SetLength(mv, 4, 3);
  mv[0,0]:= 0.5; mv[0,1]:=-0.4; mv[0,2]:= 0.33;
  mv[1,0]:=-0.3; mv[1,1]:= 0.1; mv[1,2]:= 0.28;
  mv[2,0]:=-0.4; mv[2,1]:=-0.2; mv[2,2]:=-0.75;
  mv[3,0]:=0.44; mv[3,1]:=0.25; mv[3,2]:= 1.00;
  translator.Add('M', mv);
end;
The code above adds to the translator instance the ‘µ’ variable with value 0.0, the array variable ‘A’ with 4 components, the array variable ‘B’ with 10 components and the 4x3 matrix ‘M’.

The first problem to solve is calculation of statistics square deviation from the mean value for the ‘B’ array. Math formula for the deviation of discrete random variable is (https://en.wikipedia.org/wiki/Standard_deviation):

where µ is the mean value

N is the number of elements.

This formula can be evaluated with using array operations by the following code:
var
  m, d: TValue;
begin
  m:= translator.Calculate('∑B/#B');
  translator.Variables['µ'].Value:= m;
  d:= translator.Calculate('∑((B-µ)^2)/#B');
  // print the ‘d’ value
end;
First we calculate the mean value. The number operator ‘#’ in the formula returns the array element count. Then we assign the calculated value to the ‘µ’ variable and, finally, calculate the deviation value. Notice that there are the parentheses for the square operation in the formula, because the summation operation has higher priority. Here is the output for the evaluation:

µ = ∑B/#B = 0.06
D = ∑((B-µ)^2)/#B = 0.02876


Next problem is solving an over-determined linear equation system with the least squares approach (https://en.wikipedia.org/wiki/Linear_least_squares_(mathematics)). Let the system is set up by the ‘M’ matrix and the ‘A’ vector. Then the solution ‘X’ is defined by the formula:

where MT – is the transposed matrix, 1 means the inversed matrix.

This formula can be evaluated with the Analytics library as the following ‘M'*A/(M'*M)’. Here the apostrophe ‘'’ operator is for transposition operation and the division is equivalent to the multiplication by the inversed matrix. Evaluating the formula we get the following output:

X = M'*A/(M'*M) = TArray<TFloat>[3]=
(0.459953357586789 0.163947437790482 0.113927221302585 )

Here the ‘X’ array is the solution vector that minimizes the square error for the over-determined system.

As can be seen from the examples above, the realized array/matrix operations allow easily solve complicated problems with small, compact formulae. The complicated code for the array/matrix operations implemented inside the Analytics library and totally integrated with analytical evaluations. For an example, linear algebra operations allow solving so called ‘matrix’ ordinary differential equations (https://en.wikipedia.org/wiki/Matrix_differential_equation).

The TMS Analytics and Physics pack version 2.2 can be downloaded here. Total source code of the example application can be downloaded here .


TMS Data Modeler 3 is out!

$
0
0

We are happy to announce that TMS Data Modeler 3 has been released today. TMS Data Modeler is our tool to design databases models, ER diagrams, import existing database schema and, among others, generate source code with TMS Aurelius mapped classes based on the database schema. Below is a list of the new features in this release.

Updated User Interface

To start with, we have improved user interface, by using a more modern look-and-feel. A new cleaner color theme is used, logo, file menu, splash screen have been updated.



Customization Script for TMS Aurelius Export

When generating TMS Aurelius classes from database, you can now fully customize the output source code. Users don’t need to manually tweak the source code anymore, or wait for us to explicitly implement an option that changes how source code is created.

You can simply write a script that is based on event handlers. You can for write the following script to add the [Version] attribute to any field named “FVersion” in all of your classes:

procedure OnColumnGenerated(Args: TColumnGeneratedArgs);
begin
  if Args.Field.Name = 'FVersion' then
    Args.Field.AddAttribute('Version');
end; 

In case you script gets complex, you can also use a full-feature debugger to check what’s wrong with your code.



For the scripting system and debugger, TMS Data Modeler internally uses our scripting frameworks TMS Scripter.

You can refer to documentation for more info on how you can use customization scripts in TMS Data Modeler.

Export TMS Aurelius classes to multiple units

In previous versions all TMS Aurelius classes would be exported to a single unit. Now you can choose the name of unit where a specific class will be exported to. TMS Data Modeler will even warn you if there are cyclical references between classes declared in different units.

Source code preview

You can now preview the output source code in the TMS Aurelius Export Dialog itself, without needing to generate the source code files to view them. Just click the Preview tab and you will see the final source code generated.



Separate classes into models

You can also define to which models each class belongs to. One or more TMS Aurelius Model attributes will be added to each class. If you already have multiple ER diagrams in your Data Modeler project, then you can optionally ask for each diagram to be considered a different model and have your classes be marked automatically with one Model attribute for each diagram it belongs to.

It’s also worth saying that we have updated a lot of internal processes, frameworks and tools. It took a lot of effort. While it’s not directly perceived by the end-user, it doesn’t reflect directly on user experience, we’re sure that it will make release of newer versions easier and faster.

I hope you are excited with these new features as much as we are, and enjoy the new TMS Data Modeler!



TMS Component Pack v8.8 is here

$
0
0

What initially started in 1999 as a small bundle of about 15 VCL user interface controls for Delphi, has grown in about 18 years to a set of over 400 powerful and feature-rich components for development of VCL Windows applications with Delphi and C++Builder.
Thousands and thousands of hours work went into this VCL component set that found its way to thousands of Delphi & C++Builder developers world-wide and this way, also to thousands of Windows applications used in so many places day-in, day-out to help and improve the life and work of so many people. As a small example, we learned that our VCL Planner is being used to track maintenance schedules of the French trains all over France, all in real-time.
And yet, every day our team continues to improve, extend the TMS Component Pack, assist the users in getting the most out of it and listen carefully to your needs and wishes. Also with the newest v8.8 release, we focused on user needs and added no less than 11 new features in existing components and 3 new components that were requested. We have our feature request logging & voting system for this where customers can add new feature requests and up-vote feature requests from other users so we can set the right priorities in our development.
As a result of this, these 3 new controls were added to TMS Component Pack v8.8:

New : TAdvHighLightLabel v1.0.0.0 : Label that allows to highlight specific words in the label text in different colors.

highlight label

New : TAdvTouchSpinEdit v1.0.0.0 : Spin edit control with spin buttons left and right from the edit control to allow easy up/down button access from touch screens.

spinedit

New : TAdvDBListBox v1.0.0.0 : Listbox control with embedded filter + insert data capability that can be bound to a dataset field.

listbox

In addition, 11 new features were added to existing components:


Whether you are using the newest Delphi 10.2.1, C++Builder 10.2.1 or still using an older version of Delphi, our TMS Component Pack installer detects the versions of Delphi or C++Builder installed on your system and will install for any version (from Delphi 7 onwards) it finds.
If you haven't used the TMS Component Pack yet, check out all the feature-rich components you have been missing all this time. If you have used an older verison of the TMS Component Pack, check out all latest additions & improvements and if you have just downloaded & installed the latest version 8.8, check out the new components and features that were added.

Now that TMS Component Pack v8.8 is released, we are already laying out plans for the next version and eagerly awaiting your favorite feature requests or feedback that you can send by email, in our forum or add to our feature request system.

TMS Analytics for nonlinear multiparametric approximation of surface data

$
0
0

The new version 2.2 of TMS Analytics and Physics pack contains the nonlinear least squares approximation tools. The nonlinear approximation tasks are widely used in statistics to fit experimental data with some random distribution function.


Let us consider the example of surface data fitting with the 2D Gaussian function. The Gaussian distribution of 2 variables x and y (https://en.wikipedia.org/wiki/Gaussian_function) has the following math expression:

Except the amplitude A, the distribution nonlinearly depends on four parameters: center coordinates x0, y0 and deviations sx, sy. The task of fitting data with the Gaussian function is to find optimal values of the four parameters, those minimize the error of the distribution and the experimental data zi(xi,yi), i=1..N.

The approximation task can be solved by the numerical tool with the following code:

var
  variables, coefficients: TArray;
  f: string;
  basis: TNonlinearBasis;
  cValues: TArray;
  appr: TNonlinearApproximator;
  opt: TSolverOptions;
  eValues: TArray;
  eValue: TFloat;
begin
  variables:= TArray.Create('x', 'y'); // 1
  coefficients:= TArray.Create('x0', 'Sx', 'y0', 'Sy'); // 2 
  f:= 'e^-((x-x0)^2/(2*Sx^2)+(y-y0)^2/(2*Sy^2))'; // 3
  basis:= TNonlinearScalarBasis.Create(variables, coefficients, nil, f); // 4 

  appr:= TGaussNewtonLeastSquares.Create; // 5
  appr.C0:= TArray.Create(0.1, 0.1, 0.1, 0.1); // 6
  opt:= TSolverOptions.Create(true);
  opt.MaxIterationCount:= 100;
  opt.Precision:= 0.2;
  appr.Options:= opt; // 7

  cValues:= appr.Approximate(basis, xyData, zData); // 8

  // use basis with optimal coefficients
end;

Line 1: Create array of variable names.
Line 2: Create array of four distribution coefficient names.
Line 3: Set up the approximation function expression.
Line 4: Create the nonlinear basis instance with specified data.
Line 5: Create the appropriate nonlinear approximator instance.
Line 6: Set up initial guess of coefficient values for nonlinear solution.
Line 7: Set up appropriate nonlinear solution options.
Line 8: Solve the problem (finding optimal values).

When optimal values of the Gauss distribution parameters found, they can be used with the basis instance to calculate the distribution function in any specified point (x,y) or for other analysis methods, like derivative calculations and so on.

On the pictures below there are results of the approximation made with some generated noisy data. The result presented as 1D section of the 2D function for two different x values: x=0.0 and x=0.6.





In this sample, we used the TMS FNC Chart to display the values and the approximated function. The advantage of using the TMS FNC Chart is that it can be used both for VCL and FMX applications and we can use the same code to create a VCL Windows application or a FireMonkey cross platform application.
The source code of the example application can be downloaded here.

The TMS Analytics and Physics pack version 2.2 includes also many other useful numerical tools: linear least squares approximation, 1D and 2D integration, ordinary differential equation solution, function analysis. Due to the addition of array and matrix support in version 2.2, many numerical calculations can be implemented in vector form with small and compact formulae. The version can be downloaded from the product page.

Document and test your REST API using OpenAPI/Swagger support in TMS XData

$
0
0

TMS XData 2.7 has been just release with lots of new features. The most interesting one, in my opinion, is OpenAPI/Swagger support.

TMS XData server can now optionally provide a JSON file containing the OpenAPI Specification (OAS, formerly Swagger) for your whole server API. This opens up a lot of possibilities, usage of several tools of the OpenAPI ecosystem is now possible. Main one would be the Swagger UI, a web front-end to describe and test your API.

Enabling support for OpenAPI

To enable OpenAPI support in your server, just use the unit XData.OpenAPI.Service and call the method RegisterOpenAPIService anywhere in your application:

uses {...}, XData.OpenAPI.Service;
 
{...}
  RegisterOpenAPIService;
It's as simple as that. XData will scan your whole API and build the specification file describing that API automatically. The specification will be very detailed as XData has all the metadata for your API: the method parameters, the mappings for entity classes, the data types, etc.

Retrieving the OpenAPI Specification (OAS) file

The OAS file is available through a GET request to the URL "/openapi/swagger.json" relative to your server root URL. For example, if your server root is http://myserver/tms/xdata/, then you will be able to access the file from this URL:

GET http://myserver/tms/xdata/openapi/swagger.json

Using Swagger UI

One of the main use cases is to be able to use the Swagger UI. It's a web-based front-end to dynamically document and test your API. From their website: "Swagger UI allows anyone - be it your development team or your end consumers - to visualize and interact with the API's resources without having any of the implementation logic in place. It's automatically generated from your Swagger specification, with the visual documentation making it easy for back end implementation and client side consumption.".

You can visit their site for more information, but here are quick steps to see it in action from your own server:

1. Create your XData Server and enable OpenAPI support as described above.

2. Enable CORS in your TXDataServerModule:
    Module.AccessControlAllowOrigin := '*';
3. Open the existing live demo of the Swagger UI at https://petstore.swagger.io.

4. In the edit box that appears at the top of the page, just type the URL that returns the OpenAPI Specification. For example, "http://myserver/tms/xdata/openapi/swagger.json", and click "Explore". That would be enough to list your API.

If you want an even faster way to see it in action with XData:

1. Run the demo named SQLiteConsoleServer. It's located in folder demossimple_sqlite. That demo is available when you install TMS XData trial or licensed version.

2. Open web site https://petstore.swagger.io.

3. In the edit box, enter the OAS file address: "http://localhost:2001/tms/music/openapi/swagger.json":



4. Click Explore to browse the API and test.



And that's it!

This new XData release doesn't stop there, there are lots of new features including several new types supported in method parameters, entity properties, PODO properties, and more!


Improvements for symbolic expressions simplification in TMS Analytics & Physics developing library

$
0
0

One of the unique features of the Analytics library is symbolic derivatives calculation. The derivative can be calculated just with several lines of Delphi code, for an example:

var
  f, df: string;
  t: TTranslator;
begin
  t:= TTranslator.Create;
  f:= 'x^2*e^(x/3)';
  df:= t.Derivative(f, 'x');
  //...
end;


The Analytics library guarantees that the result derivative expression is syntactically and mathematically correct and satisfies the derivative rules. From the first version, the derivative algorithm automatically simplifies the result derivative expression. Nevertheless, the library is not a Computer Algebra system, so it cannot simplify all the result expressions to the optimal representation.

New version 2.3 introduces new simplification algorithms for providing more readable and short symbolic derivatives. New simplification algorithms include: constants reducing in sum and product expressions; reducing nested sum or product expressions to one; reducing negation pairs in product expressions and others.

There are some examples of functions and their derivative expressions, evaluated with the old version of the library and with the 2.3 version:

f(x)       : x^2*e^(x/3)
df/dx (old): (2*x)*e^(x/3)+(e^(x/3)*(1/3))*x^2
df/dx (2.3): 2*x*e^(x/3)+e^(x/3)/3*x^2

f(x)       : 2*x^3+A/4*x^2-x/3
df/dx (old): (3*x^2)*2+((2*x)*A)/4-1/3
df/dx (2.3): 6*x^2+1/2*x*A-1/3

f(x)       : (A/2)*arctan(x^2)
df/dx (old): ((1/(1+(x^2)^2))*(2*x))*(A/2)
df/dx (2.3): x*A/(1+x^4)

f(x)       : P{n-1 m+2}(x)
df/dx (old): ((((n-1)+1)-(m+2))*P{(n-1)+1 m+2}(x) -(((n-1)+1)*x)*P{n-1 m+2}(x))/(x^2-1)
df/dx (2.3): ((n-m-2)*P{n m+2}(x)-n*x*P{n-1 m+2}(x))/(x^2-1)


As can be seen from the examples, new version gives shorter and more readable symbolic expressions for different function cases. The simplified representation of the formulae also reduces the calculation time. The new library version is already available here

Join us in The Netherlands and Germany at several upcoming Delphi conferences

$
0
0

We look forward to connect with you at the upcoming conferences! TMS will be present at following Delphi events:

The LAB - European Delphi & C++Builder Conference 2017
19 September 2017 - Eindoven, The Netherlands

TMS software will be present with a booth where you can meet us and find out about our latest product offerings.
Bruno Fierens will give a session about VCL & FMX Delphi applications based on Google Maps and TMS WebGMaps. He will demonstrate how locations on the map can be indicated in different ways, how addresses can be associated with locations, how locations can be coupled to pictures and how to load POI files and visualize the POIs on the map. Furthermore, route directions can be calculated, displayed and imported & exported for exchange with navigation systems or smartphone apps. Finally the GeoJSON file format is explained and it is shown how these can be used together with Google Maps.Dutch spoken


Foren-Tage 2017
23 September 2017 - Hamburg, Germany

TMS software will be present with a booth where you can meet us and find out about our latest product offerings.
Bruno Fierens will give a session about VCL & FMX Delphi applications based on Google Maps and TMS WebGMaps. He will demonstrate how locations on the map can be indicated in different ways, how addresses can be associated with locations, how locations can be coupled to pictures and how to load POI files and visualize the POIs on the map. Furthermore, route directions can be calculated, displayed and imported & exported for exchange with navigation systems or smartphone apps. Finally the GeoJSON file format is explained and it is shown how these can be used together with Google Maps.


EKON 21
24 October - Cologne, Germany

Bruno Fierens will give a presentation about creating cross-framework UI controls. The similarities and differences between the two key UI frameworks VCL and FMX that come with Delphi are explained. With this knowledge, it is possible to create an abstraction layer that allows to create UI controls that will work both in VCL applications and in FMX applications (and also in the LCL framework). The abstraction layer FNC (Framework Neutral Components) is introduced and explained and with the help of this FNC layer, it is demonstrated to create a UI control from scratch for VCL, FMX and LCL.


TMS hands-on training day
23 November 2017 - Meerbusch-Büderich, Germany

After an introduction on the latest news from Embarcadero, the first half of the day will be devoted to an in-depth look at TMS VCL components, in particular TAdvStringGrid and TAdvTreeView. In the second part of the day, focus will be on cross-platform development and cross platform UI controls. We'll round up the day with a look at Google Maps integration and a "What's cooking in the labs" session. Sessions will be in German.




Formatted emails (HTML email) from TAdvRichEditor

$
0
0

Our TAdvRichEditor UI control has everything on-board to generate HTML from its rich document content, including exporting images that are possibly used in the document. Although generating this HTML can be easily done via the TAdvRichEditorHTMLIO non-visual component connected to the TAdvRichEditor, we frequently receive support emails from users struggling to use the generated HTML to send it as email with the Indy components (TIdMessage, TidSMPT).

Therefore, we decided not only to create a sample code snippet to show how this can be done, but also to create a non-visual component (available in the latest TMS Component Pack release) to reduce the code to generate such email message to the minimum possible, that is, to one line of code:

    emailio.GenerateEmail(idmessage);

But, back to full code first that shows how to use the Indy components to generate HTML emails with embedded images as this can be generally applied for cases also where no TAdvRichEditor is used.

Drop a TIdMessage component on the form. We create a multipart message, with a part for the plain text version of the email, a part for the HTML email header and a part for the HTML itself. Then we add attachments to the message where ContentDisposition is set to 'inline' and the ContentID is set to the ID used in the HTML image reference cid attribute. So, if we have in the HTML code an image reference like:

then the ContentID for the attachment containing the image will be :
ContentID := 'imageref1';

Now, let's put this together using a TAdvRichEditor, TAdvRichEditorHTMLIO, idMessage on the form. We set AdvRichEditorHTMLIO.RichEditor to the TAdvRichEditor instance we want to export. It is very important to set AdvRichEditor.HTMLImages to igID as this instructs the TAdvRichEditor to export images references as CID URI attributes. The export to HTML and image files from TAdvRichEditor becomes:
var
  i: integer;
begin
  AdvRichEditor1.HTMLImages := igID;
  // we save the output to a temporary HTML file
  AdvRichEditorHTMLIO1.Save('.
icheditor.html');

  for i := 0 to AdvRichEditor1.HTMLImageList.Count - 1 do
    begin
      // we prepare the images as temporary images files for use as attachments for the message
      AdvRichEditor1.HTMLImageList.Items[i].SaveToFile('.img'+i.ToString+'.png');
    end;
end;

As you can see, the images to be used in the export are available via the collection AdvRichEditor.HTMLImageList. From there, we can save the images to file to be used as attachments for the Indy idMessage. The code to construct the idMessage from here becomes:
  idMessage1.IsEncoded := True ;
  idMessage1.ContentType := 'multipart/alternative';
  idMessage1.ClearBody;

  with TIdText.Create(idMessage1.MessageParts, nil) do
  begin
    // here we include the text as plain text
    Body.Text := AdvRichEditor1.PlainText;
    ContentType := 'text/plain';
  end;

  with TIdText.Create(idMessage1.MessageParts, nil) do
  begin
    ContentType := 'multipart/related; type="text/html"';
  end;

  with TIdText.Create(idMessage1.MessageParts, nil) do
  begin
    // we load the content from the temporary HTML file
    Body.LoadFromFile('.
icheditor.html');
    ContentType := 'text/html';
    ParentPart := 1;
  end;

  // here we loop over images to add all as attachments 
  for i := 0 to FRichEditor.HTMLImageList.Count - 1 do
  begin
    with TIdAttachmentFile.Create(idMessage1.MessageParts,  + '.img' + i.ToString + '.png') do
    begin
      ContentID := 'image'+ i.ToString;
      ContentType := 'image/png';
      ContentDisposition := 'inline';
      ParentPart := 1;
    end;
  end;

When the idMessage message has been created, it is straightforward to send it via the idSMTP component, i.e., this is minimally:
  IdMessage1.From.Address := 'info@tmssoftware.com';
  IdMessage1.Recipients.Add.Address := 'bruno@tmssoftware.com';
  IdMessage1.Sender.Address := 'info@tmssoftware.com';

  idsmtp1.Host := 'smtp.mailserver.com';
  IdSMTP1.Connect;
  idsmtp1.Send(idMessage1);
  idsmtp1.Disconnect();

With this code now explained, let's introduce the class TAdvRichEditorEmailIO included in unit AdvRichEditorEMailIO.pas in the latest version 8.7.3.0 of TMS Component Pack. With this class, we can reduce the code to send a HTML email from TAdvRichEditor to:
  AdvRichEditorEMailIO.GenerateEmail(idmessage);
  idMessage.Subject := 'A HTML email from TAdvRichEditor';

  idSMTP1.Host := 'smtp.mailserver.com';
  IdSMTP1.Connect;
  idSMTP1.Send(idMessage);
  idSMTP1.Disconnect();

The resulting Delphi application looks like this:

and when opening the email sent in MS Outlook, it looks like:

You can easily get started to build your own HTML formatted text email client. You can download the source code of the application here and you can compile and use this with the latest TMS Component Pack release. In the next updates of TMS FMX UI Pack that also includes the FireMonkey version of our rich editor component, we'll also include a FireMonkey version of the HTML email creator class and the same applies for the cross-framework version of the rich editor in the TMS FNC UI Pack.


Array and Matrix operations with Analytics 2.2

$
0
0

New version 2.2 of TMS Analytics and Physics pack includes total support of operations with N-element arrays and MxN matrices. The operations realized in the Linear Algebra extension package. Array and matrix operations allow advanced calculations with small, compact formulae.

Let us consider the examples of using the array/matrix operations for solving some common math/statistics problems. First of all we need to add special variables to the translator instance:

var
  av: TArray<TFloat>;
  mv: TArray<TArray<TFloat>>;
begin
  translator:= TTranslator.Create;

  translator.Add('µ', 0.0);

  av:=TArray<TFloat>.Create(0.2, -0.1, -0.25, 0.4);
  translator.Add('A', av);

  av:=TArray<TFloat>.Create(-0.2, 0.2, -0.1, 0.25, 0.35, 0.15, -0.04, 0.01, -0.12, 0.1);
  translator.Add('B', av);

  SetLength(mv, 4, 3);
  mv[0,0]:= 0.5; mv[0,1]:=-0.4; mv[0,2]:= 0.33;
  mv[1,0]:=-0.3; mv[1,1]:= 0.1; mv[1,2]:= 0.28;
  mv[2,0]:=-0.4; mv[2,1]:=-0.2; mv[2,2]:=-0.75;
  mv[3,0]:=0.44; mv[3,1]:=0.25; mv[3,2]:= 1.00;
  translator.Add('M', mv);
end;
The code above adds to the translator instance the ‘µ’ variable with value 0.0, the array variable ‘A’ with 4 components, the array variable ‘B’ with 10 components and the 4x3 matrix ‘M’.

The first problem to solve is calculation of statistics square deviation from the mean value for the ‘B’ array. Math formula for the deviation of discrete random variable is (https://en.wikipedia.org/wiki/Standard_deviation):

where µ is the mean value

N is the number of elements.

This formula can be evaluated with using array operations by the following code:
var
  m, d: TValue;
begin
  m:= translator.Calculate('∑B/#B');
  translator.Variables['µ'].Value:= m;
  d:= translator.Calculate('∑((B-µ)^2)/#B');
  // print the ‘d’ value
end;
First we calculate the mean value. The number operator ‘#’ in the formula returns the array element count. Then we assign the calculated value to the ‘µ’ variable and, finally, calculate the deviation value. Notice that there are the parentheses for the square operation in the formula, because the summation operation has higher priority. Here is the output for the evaluation:

µ = ∑B/#B = 0.06
D = ∑((B-µ)^2)/#B = 0.02876


Next problem is solving an over-determined linear equation system with the least squares approach (https://en.wikipedia.org/wiki/Linear_least_squares_(mathematics)). Let the system is set up by the ‘M’ matrix and the ‘A’ vector. Then the solution ‘X’ is defined by the formula:

where MT – is the transposed matrix, 1 means the inversed matrix.

This formula can be evaluated with the Analytics library as the following ‘M'*A/(M'*M)’. Here the apostrophe ‘'’ operator is for transposition operation and the division is equivalent to the multiplication by the inversed matrix. Evaluating the formula we get the following output:

X = M'*A/(M'*M) = TArray<TFloat>[3]=
(0.459953357586789 0.163947437790482 0.113927221302585 )

Here the ‘X’ array is the solution vector that minimizes the square error for the over-determined system.

As can be seen from the examples above, the realized array/matrix operations allow easily solve complicated problems with small, compact formulae. The complicated code for the array/matrix operations implemented inside the Analytics library and totally integrated with analytical evaluations. For an example, linear algebra operations allow solving so called ‘matrix’ ordinary differential equations (https://en.wikipedia.org/wiki/Matrix_differential_equation).

The TMS Analytics and Physics pack version 2.2 can be downloaded here. Total source code of the example application can be downloaded here .

TMS Data Modeler 3 is out!

$
0
0

We are happy to announce that TMS Data Modeler 3 has been released today. TMS Data Modeler is our tool to design databases models, ER diagrams, import existing database schema and, among others, generate source code with TMS Aurelius mapped classes based on the database schema. Below is a list of the new features in this release.

Updated User Interface

To start with, we have improved user interface, by using a more modern look-and-feel. A new cleaner color theme is used, logo, file menu, splash screen have been updated.



Customization Script for TMS Aurelius Export

When generating TMS Aurelius classes from database, you can now fully customize the output source code. Users don’t need to manually tweak the source code anymore, or wait for us to explicitly implement an option that changes how source code is created.

You can simply write a script that is based on event handlers. You can for write the following script to add the [Version] attribute to any field named “FVersion” in all of your classes:

procedure OnColumnGenerated(Args: TColumnGeneratedArgs);
begin
  if Args.Field.Name = 'FVersion' then
    Args.Field.AddAttribute('Version');
end; 

In case you script gets complex, you can also use a full-feature debugger to check what’s wrong with your code.



For the scripting system and debugger, TMS Data Modeler internally uses our scripting frameworks TMS Scripter.

You can refer to documentation for more info on how you can use customization scripts in TMS Data Modeler.

Export TMS Aurelius classes to multiple units

In previous versions all TMS Aurelius classes would be exported to a single unit. Now you can choose the name of unit where a specific class will be exported to. TMS Data Modeler will even warn you if there are cyclical references between classes declared in different units.

Source code preview

You can now preview the output source code in the TMS Aurelius Export Dialog itself, without needing to generate the source code files to view them. Just click the Preview tab and you will see the final source code generated.



Separate classes into models

You can also define to which models each class belongs to. One or more TMS Aurelius Model attributes will be added to each class. If you already have multiple ER diagrams in your Data Modeler project, then you can optionally ask for each diagram to be considered a different model and have your classes be marked automatically with one Model attribute for each diagram it belongs to.

It’s also worth saying that we have updated a lot of internal processes, frameworks and tools. It took a lot of effort. While it’s not directly perceived by the end-user, it doesn’t reflect directly on user experience, we’re sure that it will make release of newer versions easier and faster.

I hope you are excited with these new features as much as we are, and enjoy the new TMS Data Modeler!



TMS Component Pack v8.8 is here

$
0
0

What initially started in 1999 as a small bundle of about 15 VCL user interface controls for Delphi, has grown in about 18 years to a set of over 400 powerful and feature-rich components for development of VCL Windows applications with Delphi and C++Builder.
Thousands and thousands of hours work went into this VCL component set that found its way to thousands of Delphi & C++Builder developers world-wide and this way, also to thousands of Windows applications used in so many places day-in, day-out to help and improve the life and work of so many people. As a small example, we learned that our VCL Planner is being used to track maintenance schedules of the French trains all over France, all in real-time.
And yet, every day our team continues to improve, extend the TMS Component Pack, assist the users in getting the most out of it and listen carefully to your needs and wishes. Also with the newest v8.8 release, we focused on user needs and added no less than 11 new features in existing components and 3 new components that were requested. We have our feature request logging & voting system for this where customers can add new feature requests and up-vote feature requests from other users so we can set the right priorities in our development.
As a result of this, these 3 new controls were added to TMS Component Pack v8.8:

New : TAdvHighLightLabel v1.0.0.0 : Label that allows to highlight specific words in the label text in different colors.

highlight label

New : TAdvTouchSpinEdit v1.0.0.0 : Spin edit control with spin buttons left and right from the edit control to allow easy up/down button access from touch screens.

spinedit

New : TAdvDBListBox v1.0.0.0 : Listbox control with embedded filter + insert data capability that can be bound to a dataset field.

listbox

In addition, 11 new features were added to existing components:


Whether you are using the newest Delphi 10.2.1, C++Builder 10.2.1 or still using an older version of Delphi, our TMS Component Pack installer detects the versions of Delphi or C++Builder installed on your system and will install for any version (from Delphi 7 onwards) it finds.
If you haven't used the TMS Component Pack yet, check out all the feature-rich components you have been missing all this time. If you have used an older verison of the TMS Component Pack, check out all latest additions & improvements and if you have just downloaded & installed the latest version 8.8, check out the new components and features that were added.

Now that TMS Component Pack v8.8 is released, we are already laying out plans for the next version and eagerly awaiting your favorite feature requests or feedback that you can send by email, in our forum or add to our feature request system.

TMS Analytics for nonlinear multiparametric approximation of surface data

$
0
0

The new version 2.2 of TMS Analytics and Physics pack contains the nonlinear least squares approximation tools. The nonlinear approximation tasks are widely used in statistics to fit experimental data with some random distribution function.


Let us consider the example of surface data fitting with the 2D Gaussian function. The Gaussian distribution of 2 variables x and y (https://en.wikipedia.org/wiki/Gaussian_function) has the following math expression:

Except the amplitude A, the distribution nonlinearly depends on four parameters: center coordinates x0, y0 and deviations sx, sy. The task of fitting data with the Gaussian function is to find optimal values of the four parameters, those minimize the error of the distribution and the experimental data zi(xi,yi), i=1..N.

The approximation task can be solved by the numerical tool with the following code:

var
  variables, coefficients: TArray;
  f: string;
  basis: TNonlinearBasis;
  cValues: TArray;
  appr: TNonlinearApproximator;
  opt: TSolverOptions;
  eValues: TArray;
  eValue: TFloat;
begin
  variables:= TArray.Create('x', 'y'); // 1
  coefficients:= TArray.Create('x0', 'Sx', 'y0', 'Sy'); // 2 
  f:= 'e^-((x-x0)^2/(2*Sx^2)+(y-y0)^2/(2*Sy^2))'; // 3
  basis:= TNonlinearScalarBasis.Create(variables, coefficients, nil, f); // 4 

  appr:= TGaussNewtonLeastSquares.Create; // 5
  appr.C0:= TArray.Create(0.1, 0.1, 0.1, 0.1); // 6
  opt:= TSolverOptions.Create(true);
  opt.MaxIterationCount:= 100;
  opt.Precision:= 0.2;
  appr.Options:= opt; // 7

  cValues:= appr.Approximate(basis, xyData, zData); // 8

  // use basis with optimal coefficients
end;

Line 1: Create array of variable names.
Line 2: Create array of four distribution coefficient names.
Line 3: Set up the approximation function expression.
Line 4: Create the nonlinear basis instance with specified data.
Line 5: Create the appropriate nonlinear approximator instance.
Line 6: Set up initial guess of coefficient values for nonlinear solution.
Line 7: Set up appropriate nonlinear solution options.
Line 8: Solve the problem (finding optimal values).

When optimal values of the Gauss distribution parameters found, they can be used with the basis instance to calculate the distribution function in any specified point (x,y) or for other analysis methods, like derivative calculations and so on.

On the pictures below there are results of the approximation made with some generated noisy data. The result presented as 1D section of the 2D function for two different x values: x=0.0 and x=0.6.





In this sample, we used the TMS FNC Chart to display the values and the approximated function. The advantage of using the TMS FNC Chart is that it can be used both for VCL and FMX applications and we can use the same code to create a VCL Windows application or a FireMonkey cross platform application.
The source code of the example application can be downloaded here.

The TMS Analytics and Physics pack version 2.2 includes also many other useful numerical tools: linear least squares approximation, 1D and 2D integration, ordinary differential equation solution, function analysis. Due to the addition of array and matrix support in version 2.2, many numerical calculations can be implemented in vector form with small and compact formulae. The version can be downloaded from the product page.

Document and test your REST API using OpenAPI/Swagger support in TMS XData

$
0
0

TMS XData 2.7 has been just release with lots of new features. The most interesting one, in my opinion, is OpenAPI/Swagger support.

TMS XData server can now optionally provide a JSON file containing the OpenAPI Specification (OAS, formerly Swagger) for your whole server API. This opens up a lot of possibilities, usage of several tools of the OpenAPI ecosystem is now possible. Main one would be the Swagger UI, a web front-end to describe and test your API.

Enabling support for OpenAPI

To enable OpenAPI support in your server, just use the unit XData.OpenAPI.Service and call the method RegisterOpenAPIService anywhere in your application:

uses {...}, XData.OpenAPI.Service;
 
{...}
  RegisterOpenAPIService;
It's as simple as that. XData will scan your whole API and build the specification file describing that API automatically. The specification will be very detailed as XData has all the metadata for your API: the method parameters, the mappings for entity classes, the data types, etc.

Retrieving the OpenAPI Specification (OAS) file

The OAS file is available through a GET request to the URL "/openapi/swagger.json" relative to your server root URL. For example, if your server root is http://myserver/tms/xdata/, then you will be able to access the file from this URL:

GET http://myserver/tms/xdata/openapi/swagger.json

Using Swagger UI

One of the main use cases is to be able to use the Swagger UI. It's a web-based front-end to dynamically document and test your API. From their website: "Swagger UI allows anyone - be it your development team or your end consumers - to visualize and interact with the API's resources without having any of the implementation logic in place. It's automatically generated from your Swagger specification, with the visual documentation making it easy for back end implementation and client side consumption.".

You can visit their site for more information, but here are quick steps to see it in action from your own server:

1. Create your XData Server and enable OpenAPI support as described above.

2. Enable CORS in your TXDataServerModule:
    Module.AccessControlAllowOrigin := '*';
3. Open the existing live demo of the Swagger UI at https://petstore.swagger.io.

4. In the edit box that appears at the top of the page, just type the URL that returns the OpenAPI Specification. For example, "http://myserver/tms/xdata/openapi/swagger.json", and click "Explore". That would be enough to list your API.

If you want an even faster way to see it in action with XData:

1. Run the demo named SQLiteConsoleServer. It's located in folder demossimple_sqlite. That demo is available when you install TMS XData trial or licensed version.

2. Open web site https://petstore.swagger.io.

3. In the edit box, enter the OAS file address: "http://localhost:2001/tms/music/openapi/swagger.json":



4. Click Explore to browse the API and test.



And that's it!

This new XData release doesn't stop there, there are lots of new features including several new types supported in method parameters, entity properties, PODO properties, and more!


Improvements for symbolic expressions simplification in TMS Analytics & Physics developing library

$
0
0

One of the unique features of the Analytics library is symbolic derivatives calculation. The derivative can be calculated just with several lines of Delphi code, for an example:

var
  f, df: string;
  t: TTranslator;
begin
  t:= TTranslator.Create;
  f:= 'x^2*e^(x/3)';
  df:= t.Derivative(f, 'x');
  //...
end;


The Analytics library guarantees that the result derivative expression is syntactically and mathematically correct and satisfies the derivative rules. From the first version, the derivative algorithm automatically simplifies the result derivative expression. Nevertheless, the library is not a Computer Algebra system, so it cannot simplify all the result expressions to the optimal representation.

New version 2.3 introduces new simplification algorithms for providing more readable and short symbolic derivatives. New simplification algorithms include: constants reducing in sum and product expressions; reducing nested sum or product expressions to one; reducing negation pairs in product expressions and others.

There are some examples of functions and their derivative expressions, evaluated with the old version of the library and with the 2.3 version:

f(x)       : x^2*e^(x/3)
df/dx (old): (2*x)*e^(x/3)+(e^(x/3)*(1/3))*x^2
df/dx (2.3): 2*x*e^(x/3)+e^(x/3)/3*x^2

f(x)       : 2*x^3+A/4*x^2-x/3
df/dx (old): (3*x^2)*2+((2*x)*A)/4-1/3
df/dx (2.3): 6*x^2+1/2*x*A-1/3

f(x)       : (A/2)*arctan(x^2)
df/dx (old): ((1/(1+(x^2)^2))*(2*x))*(A/2)
df/dx (2.3): x*A/(1+x^4)

f(x)       : P{n-1 m+2}(x)
df/dx (old): ((((n-1)+1)-(m+2))*P{(n-1)+1 m+2}(x) -(((n-1)+1)*x)*P{n-1 m+2}(x))/(x^2-1)
df/dx (2.3): ((n-m-2)*P{n m+2}(x)-n*x*P{n-1 m+2}(x))/(x^2-1)


As can be seen from the examples, new version gives shorter and more readable symbolic expressions for different function cases. The simplified representation of the formulae also reduces the calculation time. The new library version is already available here

The Exit Procedure

$
0
0

Photo by Kev Seto on Unsplash

All Pascal programmers know the Exit() procedure since the early versions of the compilers. But do they know how to use it correctly?

The Exit() procedure is used when we want to exit of running scope. That scope could be a function, procedure, method, or even the program itself.

Let's say that a console program calls a procedure named Execute:

    procedure Execute;
    begin
      Writeln('1. Passing on this line...');
      Exit;
      Writeln('2. It will not pass here');
    end;

In the example above, only the information from the first Writeln will be shown on the console.

When exiting a scope, the program immediately returns to the previous scope (another function/procedure/method or the program itself). The only exception to this rule is when there are try-finally blocks. If Exit () is called within a try-finally block, the compiler will execute the code inside the finally-end before it exits the scope.

Here is another example:

    procedure Execute;
    begin
      try
        Writeln('1. Passing on this line...');
        Exit;
      finally
        Writeln('2. I am still here!');
      end;
      Writeln('3. It will not pass here');
    end;

Texts #1 and #2 will be shown on the console. Even though Exit() was called before the text #2 was printed, the code still runs because of try-finally.

Another example of using Exit() is when we do validations. If a validation or checking does not return true, we use Exit() to stop execution of the current scope.

Suppose that we want to add two integer numbers, but we only want integers bigger than zero:

    function Sum(A, B: Integer): string;
    begin
      Result := 'Invalid result';
      if (A < 0) or (B < 0) then
        Exit;
      Result := Format('The result is %d', [A + B]);
    end;

In the above example, the return of Sum function is initialized with an invalid value and then there is a validation to know if the values are less than 0. If the test fails, the program will return to the prior scope to calling Sum function with the invalid result. But if the test does not fail, the function result will be the sum of A and B.

There are those who are adept at structured programming and prefer do not "break" the program execution with an "early exit", which means they do not use Exit() because they believe the code would be simpler.

So, let's rewrite the previous example:

    function Sum(A, B: Integer): string;
    begin
      if (A > 0) and (B > 0) then
        Result := Format('The result is %d', [A + B]);
      else
        Result := 'Invalid result';
    end;

Looks simpler? Well, in this example I would say yes. But for examples with more conditionals, I'd say no (let's see this below).

What if we wanted to tell the user that their data is not correct?

    function Sum(A, B: Integer): string;
    begin
      Result := 'Invalid result';
      if (A > 0) then
      begin
        if (B > 0) then
          Result := Format('The result is %d', [A + B]);
        else
          Writeln('B should be greater than zero');
      end
      else
        Writeln('A should be greater than zero');
    end;

In this example, we do not use Exit() and I think the code is quite confusing. The tests are "separated" from the warning return to the user (Writeln).

Kent Beck, Martin Fowler stated categorically that "one exit point is really not a useful rule. Clarity is the key principle: If the method is clearer with one exit point, use one exit point, otherwise don't".

So, let's rewrite the previous example using Exit():

    function Sum(A, B: Integer): string;
    begin
      Result := 'Invalid result';
      if (A < 0) then
      begin
        Writeln('A should be greater than zero');
        Exit;
      end;
      if (B < 0) then
      begin
        Writeln('B should be greater than zero');
        Exit;
      end;
      Result := Format('The result is %d', [A + B]);
    end;

The code got a little bigger, it's true, but the tests and warnings for the user got simpler, in my opinion. You do not have to follow all nested if-else's. For each test that fails, the warning is just below and the scope will be aborted with the use of Exit. If all tests do not fail, the function will return the sum of A and B.

In Delphi, as of 2009 version, Exit() procedure has gained an improvement: Exit() can have a parameter specifying a result. The parameter must be of the same type as the result of the function.

The FPC also has the same definition, but I do not know who implemented this new feature first.

Again, let's rewrite the previous example:

    function Sum(A, B: Integer): string;
    begin
      if (A < 0) then
        Exit('A should be greater than zero');
      if (B < 0) then
        Exit('B should be greater than zero');
      Result := Format('The result is %d', [A + B]);
    end;

Simple and clean.

Exit() can be given any type of return, even instances of Interfaces. Using this parameter, it is as if we get the same behavior as the return reserved word in Java. However, Exit() together with Result, gives us even more possibilities to return from functions.

See you.




Announcing TMS RADical WEB

$
0
0

The world of web development has evolved at a fascinating pace over the past 15 years. I still remember having developed around 2001 a CGI-bin based WAP pages server application, a solution that is these days not only completely irrelevant (anyone still knows what WAP and CGI-bin is?) but technically fully outdated.



While the strength of Delphi (and thus the Pascal language) was originally in Windows desktop applications and from 2011 in cross platform native desktop and mobile applications, developing web applications was always a kind of side-affair for Delphi developers. Many Delphi developers as such also looked over the fence at other solutions to create web applications.

Over the past couple of years several welcome trends have developed: the HTML5 standard became widely accepted and available in modern browsers, the Javascript Ecma 5 standard made it a stronger language with object-oriented capabilities, CSS3 offers a styling & layout features so rich that most developers know not even half of its power.


Wouldn't it be a dream come true that Delphi/Pascal developers could also reach out to this platform? At TMS software we always felt this lacking over the past years.

A little less than a year ago, we were approached by the bright minds who were for a longer time already working on a Pascal to Javascript compiler and asked if we didn't think it would be interesting to bring the power of this new compiler in the hands of Delphi developers with a framework & IDE integration to take advantage of it. This was the kind of moment where my enthusiasm must have been at about the same level when I dropped the first components on the Delphi 1 form designer in 1995 or when I got my first FireMonkey application started on my iPhone 4 thanks to the cross-platform capabilities in Delphi XE2. Now, in 2018, we're pleased to announce a kind of similar wow experience will become available that allows you to build an application in a component based RAD way in the Delphi IDE, press F9 and see the app working in your browser.


TMS RADical WEB is the umbrella name under which several web enabled products will be created and offered by TMS software and it is built upon a couple of fundamental pillars:

  • Backed by a solid & proven Delphi/Pascal to Javascript compiler that was years in development
  • Modern SPA web application model. The application consists of HTML & Javascript files that can be easily deployed on any existing light or heavyweight webservers
  • Component based RAD development integrated in the Delphi IDE
  • Standard component framework for common UI controls and access to browser features
  • A truly revolutionary & innovative TMS FNC component framework that is now also web enabled, allowing to create UI controls that can be used on VCL, FMX, LCL and WEB!
  • Open to consume other existing Javascript frameworks & libraries, open to use HTML/CSS for design
  • Binding to server data via microservices with seamless interfacing to server data via TMS XData
  • Binding to cloud services


The first building block under the TMS RADical WEB umbrella is TMS WEB Core. TMS WEB Core offers the full RAD integration in the Delphi IDE of standard components, compiler & form designer. The next block is TMS FNC UI controls that are web-enabled. Third is TMS XData extended with a web XData client. As a first step to bring TMS RADical WEB to you, will be the delivery of a technical preview of TMS WEB Core, TMS FNC UI Controls for web and TMS XData with web client to our TMS ALL-ACCESS customers. Our TMS ALL-ACCESS customers sit as such in a first-class seat to experience this exciting new route to web development and influence the further fine-tuning with feedback, requests, comments. After this initial period, TMS WEB Core will then also become widely available to all customers.

Over the coming days, I'll give a deeper insight in each of these pillars of TMS RADical web. Watch this blog space! Every day we will have a new blog about our new web development products.
Coming blog articles are:
  • RAD web development from the Delphi IDE
  • Proud to announce a revolutionary & innovative UI control set that is TMS FNC
  • Connecting to data
  • Open to other Javascript frameworks
  • Using HTML & CSS for design & layout of your application pages
  • Using common web functionality & consuming cloud services
  • Debugging your code
  • History, team behind TMS RADical WEB and future


Get started today: Technical previews of TMS WEB Core, TMS FNC UI web-enabled controls, web-enabled TMS XData, the first parts under the TMS RADical WEB umbrella are exclusively available now for all active TMS-ALL-ACCESS customers.

TMS RADical WEB, RAD web development from the Delphi IDE

$
0
0

It cannot be denied that RAD component-based application development is the very foundation of Delphi software development. It is the foundation that got us all so excited since Delphi 1 in 1995. It got us not only excited but most of all very productive.

Encapsulation of UI controls and other functionality in components with easy access to properties, method and events is what lets developers focus on business logic and their problem domain rather than underlying technical tricks used to render the UI or access operating system functionality.
It is in this respect that our team went to great lengths to offer this RAD experience in the Delphi IDE that does not really have a web target.
With TMS WEB Core, all that is offered. Via File, New, Other, select a new TMS Web application and a new project is created with a first form ready to start building your application.



While the developer cannot really see this, technically, this is a VCL form but our IDE integration ensures that for this web form, only TMS web controls can be picked from the tool palette. This is the tool palette with the set of UI controls & components that is currently already available.



You can build your UI together this way like you did the past 23 years for VCL applications or the past 7 years for FMX applications. When you compile the application, a HTML file and Javascript file is produced. By default, the TMS WEB Core IDE integration launches a small TMS Web server for debugging purposes allowing the developer to see the application running in the browser. As such, the so familiar development cycle of designing forms, setting properties, adding event handlers, writing code and press F9 and see within a fraction of time the result running and working or have the capability to debug the application, is achieved.



Compared to VCL or FMX application form designing, there is an optional but very fundamental difference between VCL/FMX application forms and web forms. While it is perfectly possible to have the WYSIWYG model, i.e. what you see in the Delphi IDE form designer is what you get when running the web application, TMS WEB Core facilitates alternative ways. The web page design and layout can be fully created with HTML/CSS. It can be easily created by people with different talents than us software developers, i.e. graphic designers. TMS WEB Core allows for easily hooking up our forms with UI controls to pages designed with HTML & CSS. More about this technique will be covered in a separate blog.



My colleague dr. Holger Flick, Embarcadero MVP, brings it all together here:



Get started today: Technical previews of TMS WEB Core, TMS FNC UI web-enabled controls, web-enabled TMS XData, the first parts under the TMS RADical WEB umbrella are exclusively available now for all active TMS-ALL-ACCESS customers.

TMS RADical WEB, proud to announce a revolutionary & innovative UI control set that is TMS FNC for web

$
0
0

Over two years ago, we did deep research at TMS to create a UI control abstraction layer that would allow to create UI controls that can be used to create VCL Windows applications, FMX cross platform applications for Windows, iOS, Android, macOS and also LCL applications with the free Lazarus IDE for Windows, macOS and Linux. The result of our deep research was our FNC component framework.


Meanwhile, we are proud that we have already a wide range of sophisticated UI controls based on the FNC framework available like a grid, treeview, planner, chart, ribbon, tableview and many more plus also several new controls in development. We have noticed that for many developers there is still a bit of confusion about what FNC really means. Except there is a lot of technical magic behind FNC, for developers the result is really simple. You have one UI control set available that you can use simultaneously to create VCL, FMX or LCL applications. Yes, with one UI control set, you choose what framework you want to use, be it VCL, FMX or LCL. Irrespective of the framework you use, you can use the exact same controls, you can share or reuse application code dealing with these UI controls between the different frameworks and you have only one learning curve to get the most out of these powerful controls.




While VCL, FMX, LCL have been able from the first stage of FNC controls, from now on, the web is a major new target for using your FNC UI controls. That we even managed to web-enable our FNC abstraction layer is certainly a proof how solid that framework was designed from the beginning, but it remains nothing short of unbelievable, revolutionary and innovation that the exact same source code produces UI controls usable simply everywhere: native desktop, native mobile and web. And this on almost any modern electronic device on the planet: as installed native application or as web application you use via your browser on your Windows laptop, your iPad or iPhone mobile device, your Android smartphone, your macOS, your Linux machine and even on your Raspberry Pi SBC.

See it to believe it and be amazed!

This is our FNC Planner that worked before in Windows, iOS, Android, macOS and yes also on Linux and even Raspberry PI, now it makes the giant leap to the web and runs in every HTML5 supporting web browser on every device on the planet:


Now, back to web development with TMS WEB Core and TMS FNC UI Controls installed, you have an FNC tab of UI controls available on the tool palette.



As you expect it, you drop the TMS FNC UI control on the web form, you set its properties, add event handlers, add code and you see the FNC UI control in the web application after pressing F9 to run the application. The FNC UI Control appears WYSIWYG in the web form designer as it appears in the browser and in the browser, it also nicely takes advantage of zoom in/out or retina/high DPI handling. Go ahead and play with the FNC controls demos in your browser of choice:

Get started today: Technical previews of TMS WEB Core, TMS FNC UI web-enabled controls, web-enabled TMS XData, the first parts under the TMS RADical WEB umbrella are exclusively available now for all active TMS-ALL-ACCESS customers.

TMS RADical WEB, connecting to data

$
0
0

As Delphi developers we are used to frameworks and components to take the chore out of using databases. Ever since Delphi 1, database handling was abstracted by the TDataSet & TDataSource. Wouldn't it be nice (and mainly productive as this is what is important after all) if this exact abstraction model allowed us to create web applications consuming data? Exactly that goal is what we wanted to achieve with TMS WEB Core, only technically under the hood things are RADically different from the implementation of Delphi 1 like datasets and datasources. So, with TMS WEB Core, you have your DB-aware edit, label, combobox, datepicker etc... and these can be hooked up to a datasource and a datafield can be specified. The dataset though is in this case a wrapper component that will under the hood do its work getting data or updating data via the use of REST HTTP calls to microservices exposed on a data server. As our TMS XData product already provided exactly that: exposing your databases via REST HTTP calls, we extended it to have a web XData client component so you can from Delphi, create a web application against an XData client and hook up your DB-aware components to an XData dataset, pretty much the same way as you can for VCL or FMX native client applications.

For the sake of demo purposes, we have created a first sample app with a web client dataset. This web client dataset gets its data in JSON format from a server via a HTTP REST call. This allows to view and edit the data in the web client dataset but won't do updates server side so that it isn't possible to 'fiddle' with the data and break the sample this way.

Here you can see a form editing contact info with several DB-aware controls, including a DB-navigator.



When the dataset is connected to the server, the DB-aware controls display and can edit the data.



Connecting to an XData based server is one possible way to hook up to databases. You can implement your own interfaces to a database server via REST HTTP calls and over-time we plan to create and offer connectors to such server as Embarcadero RAD server, Google Cloud datastore and several others...

Get started today: Technical previews of TMS WEB Core, TMS FNC UI web-enabled controls, web-enabled TMS XData, the first parts under the TMS RADical WEB umbrella are exclusively available now for all active TMS-ALL-ACCESS customers.

TMS RADical WEB, open to other Javascript frameworks

$
0
0

By design, the Pascal to Javascript compiler that is integrated in the Delphi IDE via TMS WEB Core provides a thin, direct and thus high-performance layer to Javascript. This also means that it is fairly easy to interface directly to all kinds of functionality offered by Javascript libraries including Javascript UI controls libraries.

The proof of the pudding is in the eating and to begin with, TMS WEB Core will offer out of the box a complete set of Pascal components that wrap the jQuery jQWidgets UI control set.



This is a very complete & consistent jQuery UI control set including masked editors, ribbon, calendars & datepicker, powerful paging grid, ... and many more.

We are busy creating this set of easy to use wrappers in agreement and cooperation with the jQWidgets company. A first set is already available in the TMS WEB Core technology preview available today. This is the list of controls on the Delphi tool palette we have so far covered and the team is at this very moment busy tackling the jQWidgets grid:



Via Delphi components you can drop these jQuery controls on the form, set properties, implement event handlers etc...



To interact with these jQuery controls, you will as such fully use the Pascal language. For deployment, all you need to do is put the jQWidgets Javascript & CSS files into the subfolder jQWidgets of your web project. Over time & steered by your feedback and requests, we will consider adding many more thin Pascal wrapper classes for other interesting Javascript libraries, frameworks, UI controls.

Get started today: Technical previews of TMS WEB Core, TMS FNC UI web-enabled controls, web-enabled TMS XData, the first parts under the TMS RADical WEB umbrella are exclusively available now for all active TMS-ALL-ACCESS customers. The jQWidgets UI controls library files can be obtained from https://www.jqwidgets.com. jQWidgets offer a free for non-commercial use license as well as licenses for commercial use.

Viewing all 1008 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>