Noutați

FNC wishes the VCL Delphi community a merry Christmas!

Intro FNC was born in 2016 and with it, a lot of great opportunities and ideas. We started with TMS FNC Chart, followed by TMS FNC UI Pack only 4 months later! The typical components such as a grid, treeview, planner and many more are included as you would expect in a UI component set. In April 2020, with TMS FNC Maps, we introduced a brand new way to add and work with mapping/routing services in your application. Today we have a wide variety of visual and non-visual components and libraries to enhance your application. The latest addition to the FNC family, named TMS FNC WX Pack, provides access to a whole new world of JavaScript/HTML based libraries and components to Delphi. All of this would not be possible without a solid foundation, a component structure that is reliable as well as extensible. Solid Structure The architecture needed to be solid, robust as well as extensible. Our initial idea was to create a base component for each product separately, but not long after, we abandoned the idea and immediately thought out of the box and created TMS FNC Core. TMS FNC Core was the foundation we created starting with a custom control class and some utility functions. Over the years TMS FNC Core grew into a versatile base foundation for creating cross-platform and cross-framework custom controls. This includes VCL, FMX, LCL and WEB frameworks. Today we focus on a showcasing TMS FNC Core for VCL.  Working on FNC components and the TMS FNC Core foundation on a daily basis and looking back at beginning made us realize that TMS FNC Core is much more than just a foundation. It’s actually capable of doing powerful things with little to no code. The following example demonstrates what TMS FNC Core alone is capable of. No need to install additional components, just download, install TMS FNC Core, plugin the code and experience the true power of FNC. Merry Christmas Out of all the features TMS FNC Core has to offer, we picked a couple of important ones: PDF export, SVG and asynchronous file download support. The code snippet below shows how to download an SVG, export it to PDF. Not more than 25 lines of code went into this sample, with a very nice and warm result, especially during this time of the year! uses VCL.TMSFNCCloudBase, VCL.TMSFNCTypes, VCL.TMSFNCPDFLib, VCL.TMSFNCGraphicsTypes; procedure TChristmasForm.GenerateChristmasWishes; begin TTMSFNCCloudBase.DownloadFileFromURL(‘https://tmssoftware.com/site/img/merry%20christmas.svg’, procedure(const ARequestResult: TTMSFNCCloudBaseRequestResult) var b: TTMSFNCBitmap; p: TTMSFNCPDFLib; begin p := TTMSFNCPDFLib.Create; b := TTMSFNCBitmap.CreateFromStream(ARequestResult.ResultStream); try p.HeaderSize := 100; p.HeaderFont.Size := 24; p.HeaderFont.Style := [TFontStyle.fsBold]; p.HeaderFont.Name := ‘Lucida Handwriting’; p.HeaderFont.Color := MakeGraphicsColor(156, 41, 41); p.Header := ‘tmssoftware.com wishes you a’; p.Footer := ”; p.BeginDocument(‘Christmas.pdf’); p.NewPage; p.Graphics.DrawImage(b, p.MediaBox); p.EndDocument(True); finally b.Free; p.Free; end; end); end; Download TMS FNC Core today, explore the capabilities!. Found something yourself that’s worth sharing? Please let us know, we are excited to find out what you have created, in which way you are using FNC. TMS and FNC wishes you all the best and a merry Christmas!

Read More

What Is A Language Server Protocol (LSP) Anyway?

Have you ever wondered how web browsers can offer smart text options such as auto-fill and hover translate/definition? This is made possible through complex development tools, or IDE Software (Visual Studio, Vims, Eclipse, RAD Studio) tailoring features for each server (C/C++, Java, Python, etc.). This used to be a repetitive process, as each development tool would have to customize its programming language to be read by different servers, which have specific requirements.  When Microsoft introduced the language server protocol (LSP) in 2016, it facilitated an open-code, standardized way to communicate between all development tools and servers. Today, developer companies like Red Hat are continuously adding to the protocol, and programming languages are offering their own LSP capabilities. What is an LSP? A language server is a text-based, standardized language library that uses its own procedure (protocol) through an infrastructure called JSON-RPC (JavaScript Object Notation – Remote Call Procedure). In this instance, JSON (an open-code file format) uses a procedure or method instead of an API (application programming interface) endpoint.  With LSPs, developers can simply integrate these libraries to their editors and refer to existing language infrastructures instead of customizing their codes one server at a time.  For editor builders, they only need a single protocol to support different languages. For language developers, they only need to implement their code in one server to be compatible with numerous editors. Why do we need LSPs? There are two main ways that LSPs have made the coding process easier. Centralized communication. Before LSPs, developers had to duplicate their efforts across major servers, which was time-consuming. With LSP support becoming a service, developers can now focus on integrating LSP into their editors/ integrated development environment (IDE) and expanding their capabilities. Enabled developers to use different editors instead of sticking to just one. Developers can experiment with different plugins and work directly from different IDEs. A word of caution, though.  LSPs are still a work in progress, and not all programming languages are equal. Some languages don’t enjoy the same extensive server support as the more developed ones do. Some protocol extensions are also still server-specific. Still, this concern sits on the developers’ shoulders and not the LSPs. How can I use an LSP? A typical session goes like this. Suppose a user wants to add a ‘Go to Definition’ feature to a document.  When a user opens a document in their IDE, the tool sends a notification to the language server. The tool keeps the file version in memory at this point (instead of in the file directory), which allows all edits to be synced between the tool and the server. Next, the server acknowledges and analyzes any changes that the user implements on the document. If there are any errors, the server will notify the tool.  The user will then send a definition request with specific parameters. The server reflects this request immediately.  Finally, when the user closes the document, the tool informs the server that the document is no longer in memory and has returned to its file location. In general, the editor requests are simplified and the programming language is neutral, which eliminates complexities and confusion. To further standardize LSPs, there are two major software development kit (SDK) libraries that programmers can refer to. First is the development tool SDK, which […]

Read More

This Is The Blockchain And It May Rule The World

If you write apps, whether it be native Windows development, or perhaps targeting a broader market encompassing mobile devices, cryptocurrency is an area of incandescent growth and potential opportunity. Like the white-hot-topic of AI, cryptocurrency is a new frontier, and it seems everybody wants to stake their claim. Cryptocurrency has evolved into a global sensation in recent years, although much is yet to be learned about this evolving technology. Numerous concerns and worries are stirring around technology and its capacity to disrupt traditional financial systems. Cryptocurrency innovators wish to claim that these new forms of monetary exchange are all financial ‘trustless’ systems that are not directly tied to any government or nation-state. But some claim that cryptocurrency, non-fungible tokens – NFTs, the buzz word of the moment, and Blockchain, the technology underpinning these wispish intangibles, are an independent and reliable system. According to Joseph A. Grundfest, an American academic, regardless of whether you think that’s a good or bad thing, it is not entirely accurate. Cryptocurrencies are still reliant on the underlying infrastructure powering cryptocurrencies like Bitcoin, much of which is located in China. So, the Chinese government could theoretically push changes to cryptocurrencies at a fundamental level by setting its will on the data miners who keep them operating. What is the story of NFTs and art? Right now, NFTs are dominating the tech news. News media loves to gorge on stories of life-changing amounts of money being paid for an NFT associated with a piece of art, particularly focusing on facts like the buyer has, in effect, got nothing tangible to show for their hard-earned cash. Combine that with the use of AI to produce original and unique paintings and artworks and you have an almost impossible to resist temptation for a journalist looking to fill out a blank page with some exciting headlines: “anonymous author pays a million dollars for an NFT of an abstract painting by an AI artist”. As a tech person, this use of Blockchain, to secure the details of the sale, might look frivolous when compared to the many different companies solving complex problems with Blockchain and AI. While some others are generating similar non-human “art pieces” using AI or one of the many open-source projects that use layers of images which they combine to generate dozens of variations of images for you to sell online, in the NFT market. It’s less of Bob Ross and more Robot Ross. What is an NFT? NFT stands for “Non-Fungible Token”. This means that you can interchange one asset, here in our case images or animated NFT. This is a unique digital asset representing objects like digital artworks, tweets, pictures, videos, and music. The NFT acts a little like a digital checksum – except it’s a checksum of a moment in time combined with an object. So, the NFT refers to a very specific image or group of images in a way which is incontrovertibly that object or objects. A bit like having a postal code for a train which always meant that someone sending a letter to that postal code would always end up reaching the train no matter where it was or when you sent the letter. It’s a weird thing worthy of the best Wachowski sister movie plot. Hard to understand until someone explains […]

Read More

Advanced FNC Math Components

In version 3.2 of the TMS Analytics & Physics library, we’ve introduced new FNC Math components. The components allow easy development of math applications with all the advantages of the Delphi IDE. The base concepts of the math components have been described in the previous article. In this article, we’ll introduce several advanced components for designing more complicated math applications. With the base components TFNCFunction1D, TFNCDerivative1D, and TFNCIntegral1D we can evaluate functions, derivatives, and integrals of math expressions. Let’s consider the following component: TFNCFunctionDerivative1D – introduces a symbolic derivative of an FNC function; allows evaluating the derivative for the specified variable value. The component provides the following published properties: Variable (TVariableProperty) – a variable specifying the argument of the function. D (TVariableProperty) – a variable specifying the differential. Functional (TFNCBaseFunction1D) – a differentiable FNC function. Formula (TFormulaProperty) – read-only formula denoting the resulting math expression of the derivative. As one can see, this component is like the TFNCDerivative1D, but the Functional property now is of TFNCBaseFunction1D type. This means that we can assign any appropriate function to the property. The component will trace the functional’s change and re-evaluate the derivative automatically. Let’s start developing an advanced FNC math application. Put a TFNCProvider on the form and create three parameters ‘A’, ‘B’, and ‘L’. Add new TFNCFunction1D and TFNCFunctionDerivative1D components. Assign required properties to the function as described in this article. Add an FNC Chart and two plotters for both components (the function and the derivative). Then connect the derivative component with the function, assigning its Functional property. Finally, input a simple math expression, say ‘5*sin(x)’, into the Formula property of the function. Our math application at the design time is shown in the picture below: Then we can add a text box, allowing the user to input a math expression, and a button with the following simple event handler: procedure TForm1.Button1Click(Sender: TObject);var  f: string;begin  f:= Edit1.Text;   FNCFunction1D1.Formula.Formula:= f;end;   The developed application provides functionality for drawing a user-defined function and its derivative on one chart. An example of the running application is shown in the following picture:   Note that we created only one button with the event handler which assigns the formula to the function. When the formula is changed, the derivative is re-evaluated and the chart is updated automatically. Let’s move on and modify the application to evaluate also the second derivative of the function. It is possible due to the special structure of the FNC math components. As the TFNCFunctionDerivative1D class is a descendent of the TFNCBaseFunction1D, the derivative is considered to be an FNC function. Thus, we can just evaluate a derivative of any other derivative and get the second-order derivative of a function. Putting a new TFNCFunctionDerivative1D component (together with a plotter for the FNC chart) and assigning the functional property to the first derivative component, we get the fully functional application: Finally, let’s consider the TFNCFunctionIntegral1D component. It has the same properties as the TFNCFunctionDerivative1D class, but it evaluates the indefinite integral of a function. Now we can create a single application that provides the evaluation of a user-defined function, its derivatives of the first and the second order, and its integral.  The source code of the demo project for the article can be downloaded from here. To develop your own FNC math application […]

Read More

A Raspmerry Christmas with Miletus

Time flies and we are yet again at the end of the year. With the holidays coming up we thought it would be exciting to put our Miletus technology to the test and see what we can achieve in combination with a Raspberry Pi 4. Christmas is just around the corner so why not have a Christmas tree on a screen with some snowflakes and Jingle Bells playing in the background? Preparation With the plan set we need something to show the Christmas tree on. The screen of our choice is an Adafruit PiTFT Plus 320×240 2.8″ TFT. In theory any ILI9431 display should work with this project if it is correctly hooked up to the Raspberry Pi. We also need a Christmas tree. If we carefully examine the available specification, datasheet and a Python library provided by Adafruit, we can learn that the pixel format is set to 16 bit. This means each pixel’s color is stored in an RGB565 format. With our Christmas tree image converted and stored in a binary file we are ready to get started! With respect to software needed to create the project, all we need here is the latest TMS WEB Core v1.9.6.0 release. Let’s get coding First let’s make the SPI connection. Drop the TMiletusRaspberrySPI component onto the form and leave the default settings. In the form’s OnCreate event set the TMiletusRaspberrySPI.Frequency property (= SPI clock frequency) to 16 MHz. This determines how fast the data can be written, which is important if we want to show a 150 kB image at a reasonable speed. Then open the connection: procedure TForm1.MiletusFormCreate(Sender: TObject); begin   MiletusRaspberrySPI1.Frequency := 16000000;   MiletusRaspberrySPI1.Open; end; Next is screen initialization. We can do this as soon as the SPI connection is ready. By using the TMiletusRaspberrySPI.OnOpen event we can initialize the screen, load the image and after that draw the snowflakes. By using async methods and functions we can wait for each of step to finish before moving onto the next one. procedure TForm1.MiletusRaspberrySPI1Open(Sender: TObject); begin   Await(JSValue, InitScreen);   Await(JSValue, LoadChristmasTree);   StartSnowing; end; InitScreen is sending a number of command and data combinations through SPI to the screen so it can be set up with the correct settings. It is based on values from the datasheet and the example library. For further information on these values please study the linked sources. LoadChristmasTree is responsible for loading the Christmas tree onto the screen. While it is possible to embed the binary image as part of the executable, there are a few reasons against it: First of all, it doesn’t make sense to send the whole image to the web application and from there back to the native shell application. Sending 150 Kb of data between these 2 layers on a small device like a Raspberry Pi can be time consuming. Besides, by making it available as a file it gives the flexibility to change it to a different Christmas tree without modifying or recompiling the application! function TForm1.LoadChristmasTree: TJSPromise; begin   Await(Boolean, TMiletusRaspberryMemoryBuffer.LoadFromFile(‘./xmastree.bin’));   Await(JSValue, Block(0, 0, 239, 319, []));   Await(Integer, GPIOWrite(GPIO_DC_PIN, 1));   Await(Boolean, MiletusRaspberrySPI1.WriteMemBuffer);    Result := EmptyPromise; end; We added a new class called TMiletusRaspberryMemoryBuffer in TMS WEB Core v1.9.6.0. This makes it possible to load a file directly from the local file system (or […]

Read More

An Introduction To A High-Performance JS Grid

Nowadays, a large amount of data keep generating in businesses, and sometimes they need to display that information on websites for the consumers. The common way of displaying data on a website is using an HTML table. However, showing a large amount of data in an HTML table is cumbersome, especially if it slows down the entire page load. Therefore, if you want to show a large amount of data in a table on your web page, using a grid is the best way to do that.  A grid is similar to a table in HTML elements, but it allows you to easily fetch, scroll, sort, group, and filter a large number of data rows. When loading and processing large data sets, the performance is important because it should not hinder the user experience.  A high-performing js grid has a good initial page load time which is the amount of time the grid takes to load the initial data set. It is also efficient in dynamic filtering or the time it takes to filter one column. In addition, when considering a large amount of data in a grid, users often need to scroll through various sections of the grid to see the rest of the data. This scrolling speed is a good indicator of grid performance, and high-performing grids have a good scrolling speed that amounts to seconds.  Ext JS data grid is a high-performing grid that allows loading and manipulating a massive data set within milliseconds. In most benchmarking experiments, almost all the JS grid types from different vendors have shown good initial page load time and dynamic filtering speed. However, all those grids have shown a greater variation in scrolling speed, except when viewing the first few records of the grid. the Ext JS data grid has an outstanding scrolling speed which is 300x faster than other leading data grids, which can fetch and display massive sets of data in less than one second Ext JS grid consists of two parts which are Ext. data.Store and Ext.grid.The panel. The datastore represents the data and the set of columns in the grid to render.  The data stores give Ext Js grids the capability to load data inline and load them dynamically on-demand. It also allows loading nested data, sorting, and filtering. The following example shows a simple data store specified in JSON data structure which will be loaded to Ext Js Grid. Ext.create(‘Ext.data.Store’, { storeId: “myProductStore”, fields: [‘productid’, ‘title’], data: [{ ‘productid’: ‘1’, “title”: “LindtChocalate” }, { ‘productid’: ‘2’, “title”: “Milk” },] }); Ext.grid.The panel is the key component that allows displaying a massive amount of tabular data on the client side. For example, the below code generates a simple grid with two columns. The grid will load the data we specified in the above-specified data store. The grid generated will consist of the columns specified below and the header title ‘Products .’ Under the title will show the data directly below the header title.  var columns = [{ text: ‘productid’, dataIndex: ‘productid’, flex: 1 }, { text: ‘title’, dataIndex: ‘title’, flex: 1 }]; var grid = Ext.create(‘Ext.grid.Grid’, { title: ‘Products’, store: “myProductStore”, columns: columns, layout: ‘fit’, renderTo: document.body, width: ‘100%’, height: 300 }); Raw and Column operations, rendering, and scrolling Ext JS grid consists of a rich set […]

Read More

This Is The Blockchain: Expectations vs. Reality

We have discussed Blockchain technology in our “Everything You Need To Know About Blockchain” article. In that article we have learned about: Immutability Distribution How trust issues can be resolved with Blockchain Blockchain in the financial industry High integrity with Blockchain – and more You might find it useful to read that article first as a useful overview of what people mean by The Blockchain. We also talk about cryptocurrencies built with Object Pascal/Delphi programming language. What is the blockchain? Blockchain is simply a database containing a growing list of records named blocks, linked, and secured using cryptography. Each block holds a hash pointer that links to a previous block, timestamp, and transaction data. So, now we have a chain of blocks or just blockchain as many people call it. To point out that this chain of blocks or database is open, distributes system with every participating computer maintains a copy. What are the expectations of Blockchain? Market investigation indicates that blockchain technology will rule the future because of its many benefits like: Data transparency Immutability Decentralization Security A growing number of people think Blockchain is the future because it inspires a new generation of platforms that are easy to use, accessible, scalable, and interoperable. What is the reality of Blockchain? Despite the possibility that blockchain technology is not supported by many countries because of limits and control over blockchain projects. For instance, governments are fighting to not utilize Blockchain. Unless if blockchain technology matures through enough reforms to support the problems that we are having, it can be applied to every field of our society. Until now, blockchain technology has been a massive breakthrough in the financial industry: Cryptocurrency Decentralized Finance (DeFi) Art Collectibles – Non-fungible token (NFT) When companies started to accept cryptocurrencies, people started looking at the underlying technology that made cryptocurrencies possible. They are based on the basic concepts of cryptocurrencies applied to the deployment of general-purpose applications. These applications are called Smart Contracts, and this defines the business logic and after deployment to the network, it can be used to implement different use cases securely. Is it really worthwhile to integrate Blockchain technology? Technologies take time to be accepted by everyone. Blockchain technology can be a problem in some cases with specific people. But we can see that the financial industry is benefiting from this technology because it offers immutability, transparency, and reliability. For example, Blockchain has all the needed features in supply chains. Supply chain data is not always perceptible, available, or trusted. But blockchain technology helped them to create authenticity over these problems.  How to create decentralized applications with smart contracts in Delphi? You can utilize Delphereum which is an interface for the Ethereum blockchain that allows native development of decentralized applications using the Delphi programming language. In fact, the stability, security and blinding speed of Delphi native applications means it’s ideally suited to the task, Moreover, you can find samples of applications for starting your project with the Ethereum distributed computing platform. You can check out the post below to learn about using Ethereum with Delphi, smart contracts, and more helpful topics. Next-Generation Cryptocurrency – Pascal Pascal, also known as PascalCoin, is a fast, zero-fee, scalable, and decentralized multi-purpose blockchain designed for payments, data operations, and layer-2 applications. Enabled by the SafeBox technology to become the world’s first […]

Read More

TMS Analytics joins TMS Academic family

Perhaps this is our product that suits and targets students & teachers best and finally it is available now as a free edition for students & teachers. TMS Analytics helps students by providing a library to easily evaluate mathematical expressions, calculate symbolic derivatives & integration, solving non linear equations, approximation function calculation and more… This library is fully cross-platform, so it can be used in VCL Windows applications as well as FireMonkey applications for Windows, macOS, Linux, Android & iOS. We encourage and hope that students will discover & learn to appreciate Delphi even more when having TMS Analytics in their arsenal of tools.  While you are visiting our academic offerings, check also following products available free for students & teachers: TMS VCL UI Pack: extensive UI controls library for VCL Windows applications TMS WEB Core: Object Pascal RAD component based web client development  TMS FNC UI Pack: extensive UI controls library for both VCL Windows applications & FireMonkey cross-platform applications TMS Aurelius: ORM framework for Delphi with full support for data manipulation, complex and advanced queries, inheritance, polymorphism, and more TMS Flexcel for VCL/FMX: Powerful, extensive & flexible component suite for native Excel report & file generation & manipulation  Also in the coming year 2022, we want to extend our academic offerings! Let us know what products you look forward to the most to join the TMS Academic family. Our team is listening!

Read More

‘How it works’ video series

With this blog we want to announce our new series of ‘How To” videos, presented by our colleague Holger Flick. In these video series you will learn how you can achieve basic interesting functionality with little to no code! Most of the time developers are blocked in a major project, just because of a little piece of information that is missing! This can be a common problem that keeps happening. That is why FlixEngineering and tmssoftware.com will work together to provide you hands-on solutions by explaining this step by step. Unlike other videos these series will not solve complex problems, here we will focus on simple “how to” questions! Subscribe to our YouTube channel and stay tuned for our first “How it works” video:   Happy Holidays!

Read More

How To Automate Large Numbers Of Delphi Project Builds

What is build automation? Despite the ever-increasing rise of mobile devices, desktop applications are still the backbone of enterprise environments. Typically, these enterprise solutions are made up from multiple discrete modules which are harnessed together to create an application suite. But even applications which are themselves monolithic there may exist multiple versions at any one time either to target specific use cases and operating systems or to provide for trialing versions of new functionality. It’s often quite complicated to keep on top of situations like this. It can really become overwhelming once you start to factor in things like cross-platform multi-device targets and functionality which includes localization into different languages such as a user interface which supports English, French, German, Spanish and so on Automating the builds of applications can be a huge improvement for developers who need to make various build scenarios and make repeated actions automatic. Automation can also help prevent mistakes which can creep in during repetitive and tedious tasks as our minds start to wonder or we lose focus. When we think about building web or mobile applications, we can think about techniques such as continuous integration and development pipelines or CI/CD as it’s more commonly referred to. Despite the benefits, developers are still often slow to utilize CI/CD for building and automating the builds and tests on desktop applications. Here’s a few suggestions on things to consider incorporating into your development and release processes which might help. How can I automate Delphi project builds? There are dozens of different solutions available to automate the process of building Delphi projects, but in this spotlight, we’re going to talk about MiTeC Project Maker and with a bonus solution at the end. What is MiTeC Project Maker? MiTeC Project Maker is a tool for automated batch Delphi projects building. With the Project Maker, you can set compiler configurations, define actions processed before and after building, patch version information of built binary, sign that binary with a specified code-signing certificate, apply for 3rd-party software protection, and many more. How does Project Maker work? Project Maker offers a clear powerful interface for project building task definition. Each project can contain an unlimited number of tasks. A ‘task’ represents a Delphi project as defined in a dpr or dproj file. Moreover, Project Maker features Profiles, where you can specify common properties for a project. The project can have an infinite number of profiles. By utilizing profiles, you can simply switch between a variety of build configurations.  Compiler Directives & Options Build options Signing tool Form Cleaner Versioning and more How can we use GitHub Actions to supercharge our GitHub workflow? With GitHub Actions, you can automate, customize, and execute your software development workflows right in your repository.  GitHub Actions are event-driven, meaning that you can run a series of commands after the specified event occurred. For instance, you can set a trigger to pull request event, and when there is a new change GitHub Actions starts code testing. Without any CI/CD integration, you can have everything with GitHub Actions. It gives end-to-end CI and CD capabilities. Additionally, it is in your GitHub repository. How do I use GitHub Actions on Delphi projects? One of the Delphi MVPs, Darian Miller, has written a number of useful articles and tutorials on Delphi. On his RADAuthenticator blog series, he shared his experience on configuring GitHub Actions with […]

Read More