Noutați

Developer Stories: Mehrdad Esmaeili Discusses About ParsLogo

Mehrdad Esmaeili started programming with Turbo Pascal 7. He has an application (ParsLogo) as showcase entry for Delphi 26th Showcase Challenge and we had a conversation with him to know all about his Delphi experiences. Go on over to ParsLogo to download the application. When did you start using RAD Studio/Delphi and have long have you been using it? Since First Release of Delphi i have found it my great tool for my lifetime, before i was using Turbo Pascal 7 as my desired programming language but since i found Delphi till Today at least 12 hours per day we were together… in result many applications have been produced. What was it like building software before you had RAD Studio/Delphi? I was using Basic in commodore 64, then in high school i found TURBO PASCAL and i knew since that time that it is great and i did not change  my idea still in the university….and i am the only author of DELPHI educational Persia since Delphi 6 … to Delphi 2005 How did RAD Studio/Delphi help you create your showcase application? Since 2005 It was all native pure delphi code, since i found how powerful applications can be made with mixing well known third party components since Delphi 7, So combine well  debugged components from TMS SOFTWARE and replace dwScript with TMS Scripter and adding Charts changed my app from classic to very Modern Idea so that i have introduced it in GITEX FAIR 2006 in DUBAI in multilanguage…. it has been awarded the best educational software in the First multimedia Fair in the country. What made RAD Studio/Delphi stand out from other options? Clean Code used since Pascal that is very closed to human language , Perfect IDE that is getting much more better in Delphi 10.4.1 that now i am using and it is amazing… What made you happiest about working with RAD Studio/Delphi? FireDAC or UniDac components that connects you to any DataSource via any device, because i believe that every application finally need to save/load data so it would be lead to DATABASE concept and today DADABASE must be remote for many reasons (like small storage on mobile devices) What have you been able to achieve through using RAD Studio/Delphi to create your showcase application? TMS Scripter from TMS Software (thanks from Mr.Bruno Fierens and specially Dear Mr.Wagner Landgraf) that have changed my opinion to programming concept completely: you can see my comments in that page: https://www.tmssoftware.com/site/scriptstudiopro.asp : I fell in love with this great product, it changed my opinion and my vision in programming. I am using it at least 12 hours per day and everyday I understand what a clean code you have used to make it …thanks a lot. Mehrdad Esmaili, via email What are some future plans for your showcase application? Visual ParsLogo that i  am working on it everyday and released …. Mixing BASIC/PASCAL in IDE like Delphi with more components palette features: http://smilyfiles.ir/MFTVisualParsLogo.exe Thank you, Mehrdad Esmaili! You can check out his application’s showcase entry below. Showcase https://blogs.embarcadero.com/impressive-logo-programming-software-pars-logo-is-powered-by-delphi/    

Read More

Football Playview Is An Outstanding Mobile Delphi App

With Football Playview coaches and players can view animated plays, drills and practice plans on their phone or tablet. Football plays, drills and practice plans can be created with the companion desktop Football Playbook program from Jes-soft, which is free to try and available at http://www.jes-soft.com/football/index.html. The playbook program is compatible with Windows all recent versions of Windows, Create your plays and practice plans on your desktop. Save them to your cloud drive (gdrive, DropBox for example). Open the plays and practice plans on your mobile device from your cloud drive. Website Football Playview Google Play Football Playview Screenshot Gallery Reduce development time and get to market faster with RAD Studio, Delphi, or C++Builder. Design. Code. Compile. Deploy.Start Free Trial   Upgrade Today    Free Delphi Community Edition   Free C++Builder Community Edition

Read More

Easily Deploy Powerful AI Vision Tools On Windows And Mobile

Google Cloud’s AI Vision API offers powerful pre-trained machine learning models that you can easily use on your desktop and mobile applications through REST or RPC API methods calls. Lets say you want your application to detect objects, locations, activities, animal species, products, or maybe you want not only to detect faces but also their emotions. Or you may have the need to read printed or handwritten text, this and much more is possible to be done for free (up to first 1000 units/month per feature) or at very affordable prices and scalable to the use you make with no upfront commitments. “Detect Labels” – an ordinary name for some extraordinary AI The option to “Detect Labels” is part of the AI Vision API that we can use to detect and extract information about entities in an image across a broad group of categories. With that information we can identify general objects, locations, activities, animal species, products, and more. We can use RAD Studio Delphi to easily setup a REST client library to take advantage of Google Cloud’s Vision API to empower our desktop and mobile applications. If the request is successful, the server returns a 200 OK HTTP status code and the response in JSON format. Our RAD Studio and Delphi applications will be able to call the API and perform the detection on a local image file by sending the contents of the image file as a base64 encoded string in the body of the request. Alternatively, it can use an image file located in Google Cloud Storage, or on the Web, without the need to send the contents of the image file in the body of your request. How do I set up the Google’s Cloud Vision Label Detection AI API? Make sure you refer to Google Cloud Vision API documentation; specifically the “Detect Label” section (https://cloud.google.com/vision/docs/labels), but, in general this is what you need to do on the Google server side: Visit https://cloud.google.com/vision and login with your Gmail account. Create or select a Google Cloud Platform (GCP) project. Enable the Vision API for that project. Enable the Billing for that project. Create a API Key credential. AI vision in action! Lets take, for example, the image below, as a brief practice. Make sure you take a long look at the image and try to think about 5 to 10 things you notice in it. Focus on what calls your attention the most. To make it more fun write them down or say them out loud and then see if Google can guess correctly. How do I call the Google Vision AI API Label Detection endpoint? All we need to do is to call the API URL via a HTTP POST method passing the request JSON body with type LABEL_DETECTION and source as the link to the image we want to analyze. We can do that using REST Client libraries available in several programming languages. A quick start guide is available on Google’s documentation found here: (https://cloud.google.com/vision/docs/quickstart-client-libraries). Actually, at the bottom page of the the Google Cloud Vision documentation Guide (https://cloud.google.com/vision/docs/labels) there is an option: “Try This API” allowing you to post the JSON request body as shown below and get a JSON response. POST https://vision.googleapis.com/v1/images:annotate POST https://vision.googleapis.com/v1/images:annotate { “requests”: [ { “features”: [ { “maxResults”: 5, […]

Read More

Connecting Databases with FireDAC through SSH

A customer recently asked me if FireDAC can be used to connect to a database through an SSH tunnel. The short answer is yes, of course. But let’s understand better what is an SSH tunnel, and how this goal can be easily achieved when using Delphi and FireDAC. SSH Tunnels Secure Shell (ssh) is a standard tool included on most “network” operating systems i.e. Linux, UNIX, MacOS, and now also on Windows (natively speaking). If you had used PuTTY sometime in your life to connect to a remote command line interface, in general a Linux system, SSH was the protocol used for that. So the key thing here to use FireDAC via an SSH secure interface is to understand that FireDAC (or any other database access framework) has nothing to do with it. What you need is to establish a permanent SSH tunnel and then setup your database connection properly. We’ll see two ways to establish an SSH tunnel: one using an external tool (PuTTY) and the second one directly coded in your application. SSH Servers The aim of this article isn’t to teach how to create an SSH Server, but I had to create one to test my solution, so here is what I’m using. Basically I have a Linux VM running a PostgreSQL database (this is the database the customer would like to connect, but the solution is database agnostic), and over it I’ve installed and started an SSH Server following this tutorial: https://docs.oracle.com/cd/E37670_01/E41138/html/ch25s03.html This is for Oracle Linux (this is what I’m running due another proof of concept I had to do past week) but you’ll find similar tutorials for your preferred Linux flavor. Testing the Connection Before trying the connection from FireDAC, it’s a good idea to prove the connection using just command line tools that are integral part of the operation systems, so you have an idea if things are working or not. So, having both the SSH Server and the database instance (PostgreSQL in my case) open and running on Linux, we can try a first connection from Windows using any SSH client terminal. Windows 10 has a native client since the 1809 “October Update”, but I’ll stick with PuTTY as this is a dominant utility for system admins. These are my Putty configurations. In the Session page you need to specify the server IP and the SSH port (22 is the default): And in the SSH/Tunnels configuration page you specify how the tunnel will be created: What this configuration is saying? Basically to create an SSH tunnel you have to specify the Source port (any available/not used port number you have in your system) and the Destination IP/Port (in this case the Linux server IP address and the Port where the PostgreSQL instance is listening – the 5432 is the default PostgreSQL port). Of course, the Source IP address will be always “localhost”, meaning your database connection will point to localhost/63333 and the tunnel will do the magic, sending the commands to the server and receiving back the results. Finally, opening the PuTTY connection and providing a valid Linux user and password (it’s recommended to create an specific user only for the SSH usage), you are going to see something similar to this below. Ugly, I know. You can test some Linux commands […]

Read More

Introduction to using Firestore and new Firestore features in TMS WEB Core v1.7

This article is the first in a 4 part series that will explore the new features available in the TWebFirestoreClientDataSet component in TMS Web Core v1.7. A quick summary of the basic features in the previous version of Firestore ClientDataSet component   Here’s a quick introduction for those developers who have not had a chance to use the component so far.   TWebFirestoreClientDataSet was introduced in TMS Web Core v1.3 to enable the developers to use Google Firestore as a cloud-hosted, NoSQL database for their web apps. By using this component, you can use a Google Firestore collection as a dataset and get a full CRUD functionality to update it. As you make changes to the dataset, the component updates the Firestore collection behind the scenes. What is more, since the component is a ClientDataSet, you can bind the component to various DB-aware TMS WEB Core UI controls via a TWebDataSource.   Here are the steps to use a Firestore collection as a dataset: In order to connect to a Firestore collection, all you have to do is drop a TWebFirestoreClientDataSet component on a form and set a few Firebase properties and CollectionName in it. Then define the dataset fields either in design view or in code and make the component Active. Additionally, you can bind the component to various DB-aware TMS WEB Core UI controls via a TWebDataSource. What you get is a basic App with a CRUD functionality out-of-the-box. A Firestore collection is created automatically as soon as you insert the first record. Any dataset updates you make in code or via the DB-aware controls are automatically sent to Firestore collection by the component. Further, the basic authentication of a Google Sign-In is also available in the component so that you can force the user to Sign-In with Google before the data in the Firestore collection can be accessed. This requires a simple Authentication rule to be set up in the Firestore dashboard. Then all you need to do in the component is switch ON its property SignInIsRequired. It takes care of presenting a Google Sign-In popup as soon as you make the dataset active. Complete details for the above steps are given in the TMSWeb Core Firestore documentation. You will also find a TodoList Demo in the folder “DemoDBBackendFirestore” that demonstrates the above features. Please follow the instructions in the TMS Web Core Firestore documentation to set up and run this Demo.   Here is a screenshot of the demo: What you will see in action is a web app that displays the Task records from a Firestore collection called “Tasks” and provides the features to edit the data by means of various DB-aware controls bound to the data source. It also prompts for a Google Sign-In if the user is not signed in. Although the basic demo does a good job of showing the CRUD features, it has some problems in the way its start up logic is coded and there is a reason for it as explained below. The demo expects the end user to enter the API Key and other Firebase parameters The values for these parameters are used to set Firebase properties in the Firestore ClientDataSet after the Open button is clicked The values are remembered in the local storage to be used […]

Read More

Multi-tenant TMS WEB Core client applications with Firestore

This is the 2nd article in a series of 4 about Firestore features in TMS WEB Core v1.7. Firestore is a cloud based solution from Google allowing to create modern web client backend databases in the Google cloud. So, there is zero config or server setup, all is managed by Google. This article series explores how components in TMS WEB Core facilitate the use of a Google Cloud Firestore backend in your web client applications. Previous Firestore ClientDataSet component Before TMS WEB Core v1.7, the built-in dataset component only supported a shared usage of a Firestore collection as a dataset. This means a collection is shared between different users who can sign-in and can access all the records in the collection through the dataset and are able to modify them.  This kind of shared usage is still supported and may be desirable for certain collections depending on the requirements of the web app.  But consider the case where you want to develop a web client application where each signed-in user can only see and change his own data. Such a feature is called Multi-tenancy.  If you were to develop this kind of Multi-tenant App directly in JavaScript that uses the Firestore API, you will need to devise your own scheme to keep each user’s data separate. A common approach is based on an internal-user-id of the signed-in user that is available from the API. But how your design uses that user-id is entirely up to you. There are many alternate designs possible to support this kind of Multi-tenancy. One design may use the relational approach of keeping a user-id field with each row or data object (called document in Firestore). Another design may create a nested collection whose name is based on the internal-user-id.  The new version of TWebFirestoreClientDataSet makes it simple for you by taking care of this internally as described next. New Multi-tenancy feature in TWebFirestoreClientDataSet  The new Firestore  specific TWebFirestoreClientDataSet component makes it easy for you to keep the data separate for each signed-in user. You tell it to do so by using the following property: property UserIdFilter The new version of the component has an internal implementation of the relational approach described above whereby it can automatically attach the internal-user-id of the signed-in user as an additional field to keep the data separate for the user.  To get this feature, all you need to do is set the property UserIdFilter as active.   fireStoreClientDataSet.UserIdFilter := ufActive; Once you do that, the component adds a new field named ‘uid’ to each new object (called document in Firestore) to identify the documents belonging to the signed-in user. Similarly when getting the initial list of objects on opening, it filters the collection on the ‘uid’ field. However, this automatic adding of ‘uid’ field happens only when creating new objects or documents. Hence, you may use this feature on a new collection only unless an existing collection already has the data separated by the same scheme–a field containing the internal-user-id. This is described next. property UserIdFieldName Suppose you want to connect to a pre-existing collection made by another app with the same scheme where the difference is that the user id field is not named ‘uid’ but is ‘userid’. To connect to such a collection with the feature to view […]

Read More

TMS WEB Core v1.7 Ancona is released

The main new features are: Miletus framework : desktop application development with web technology Introduction of async methods in many areas USB device access Firestore filtering, multi-tenant, async functionality added Local file access TWebStringGrid, TWebDBGrid enhancements Popup menu component Enhanced TWebForm TMS WEB Core for Visual Studio Code v1.3 The new version v1.3 of TMS WEB Core for Visual Studio Code is also around the corner. The major new feature of v1.3 will be extensibility via 3rd party components with a package system and with this, the whole portfolio of TMS FNC components will also become usable at design-time in Visual Studio Code. The TMS WEB Core framework will be at the same level as TMS WEB Core v1.7 for Delphi & Lazarus. The only feature that will not yet be included in TMS WEB Core for Visual Studio Code v1.3 is Miletus support. That is reserved for v1.4 and with this, it is expected to already bring Miletus for Windows, macOS, and Linux. More content Feedback We are curious to hear what you like the most about TMS WEB Core v1.7 Ancona or what you wish to see in future versions of TMS WEB Core! We look forward to discussing all these great milestones with you!

Read More

Create a Currency Converter Application Quickly with Sencha Ext JS and Exchange Rates API

With the world turning into a global village for free trade, it has become vital for individuals to have avenues for converting currencies. Currencies like the United States Dollar, the Euro, and the British Pound are widely used around the world for international transactions. So, individuals and businesses keep a close eye on the exchange rates. As a developer, you can help people access exchange rates by creating a currency converter application with Sencha Ext JS and Exchange Rates API. In this post, you will find all the details. What is Exchange Rates API? Exchange Rates API is a JSON-based REST API that provides current and historical exchange rates. It supports 170 global currencies and over 14,000 exchange rate conversion pairs. It is one of the fastest and most scalable exchange rate APIs that you can find online. Why should you use Exchange Rates API? Delivers unmatched performance Offers quick data refresh rate (60 seconds) User-friendly interface Easy to integrate with web applications Offers dedicated support team for helping you implementing the API How to Create a Currency Converter Application Quickly with Sencha Ext JS and Exchange Rates API Sencha Ext JS is a powerful framework for building cross-platform web applications. By integrating Exchanges Rates API, you can develop a currency converter application easily. Take a look at the app: To build the currency converter web application shown above, you have to follow these steps: 1. First, you have to create the model for exchange rates. Go to the App folder. Then head to the model directory, create the new RateModel.js file and add these codes: Ext.define(‘HeaderLeftRight.model.RateModel’, {                 extend: ‘Ext.data.Model’,                               requires: [                     ‘Ext.data.field.String’,                     ‘Ext.data.field.Number’                 ],                               fields: [                     {                         type: ‘string’,                         name: ‘symbol’                     },                     {                         type: ‘float’,                         name: ‘rate’                     }                 ]             }); Here, you are adding two fields, called ‘symbol’ and ‘rate.’ Also, you are defining their types. 2. You have to create models for the currency symbols. Create a new file, called SymbolModel.js, inside the model folder. Then add these codes: Ext.define(‘HeaderLeftRight.model.SymbolModel’, {                 extend: ‘Ext.data.Model’,                               requires: [                     ‘Ext.data.field.String’                 ],                               fields: [                     {                         type: ‘string’,                         name: ‘symbol’                     },                     {                         type: ‘string’,                         name: ‘value’                     }                 ]             }); Here, you are defining two fields: symbol and value. 3. Next, you have to add the Views. Go to the view folder, create the MyPanelViewModel.js file and add these codes: Ext.define(‘HeaderLeftRight.view.MyPanelViewModel’, {                 extend: ‘Ext.app.ViewModel’,                 alias: ‘viewmodel.mypanel’                           }); 4. Create the MyPanelViewController.js file and insert these codes: Ext.define(‘HeaderLeftRight.view.MyPanelViewController’, {                 extend: ‘Ext.app.ViewController’,                 alias: ‘controller.mypanel’,                               setRatesComapareValue: function(baseSymbol, rate, exchangeSymbol) {                     this.resultLbl.setText(`1 ${baseSymbol} = ${rate} ${exchangeSymbol}`);                 },                               toggleSymbolGrid: function() {                     if(this.isSymbolGridShowed) {                          this.symbolGrid.hide();                          this.isSymbolGridShowed = false;                     } else {                          this.symbolGrid.show();                          this.isSymbolGridShowed = true;                     }                 },                           […]

Read More

Developer Stories: Ziad Allaghi Shares On System Of Student Registration

Since 1998, Ziad Allaghi has been developing programs with Delphi. Ziad’s (System of Student Registration) application is a showcase entry for the Delphi 26th Showcase Challenge and we talked to him about his knowledge creating programs with Delphi. You can find more information about the application over at System of Student Registration. When did you start using RAD Studio/Delphi and have long have you been using it? I started programming in the Delphi language in 1998 the third edition and then version 6, and I have become better in my programs and increase my productivity because Delphi provides an environment for generating ideas easily. What was it like building software before you had RAD Studio/Delphi? The Delphi editor provides an excellent programming environment because it depends on the Pascal language, which is a clear language with a clear code that allows you to develop more than one program at the same time with minimal code description instructions, which allows you to easily understand It with less time and effort … The latest version is very amazing at all levels Delphi 10 4. 2 How did RAD Studio/Delphi help you create your showcase application? Rapid development in this language with the availability of many resources that help in the implementation of applications on adequate operating systems and increases the demand of users and your customers for your programs Thank you Embarcadero What made RAD Studio/Delphi stand out from other options? It provides easy-to-use and effective components such as dealing with various databases and communications .. Pascal language with the Delphi editor 10.4.2 gives the programmer the complete departure in writing his programs with creativity What made you happiest about working with RAD Studio/Delphi? It gives you the possibility that you can produce a program entirely without resorting to assistant programs, such as designing branding screens, databases, and visual components What have you been able to achieve through using RAD Studio/Delphi to create your showcase application? Sharing experiences is very important and taking notes in developing a program while developing programming style and ease of implementation with the new version of Delphi 10.4.2. What are some future plans for your showcase application? Program development, especially with the new components only available in Delphi version 10.4 ControlList and compiler speed Thank you, Ziad! Click through the link below for the showcase entry of System of Student Registration. Showcase Thanks for the interview Ziad!

Read More

Quickly Convert Speech To Text With Powerful Google Artificial Intelligence APIs

What can the Google Audio Transcription API do for our applications? Google’s Audio Transcription API allows your program to use all the power of Google’s huge computing resources to accurately transcribe speech found in audio files into text. As Google’s documentation says: Transcribe your content in real time or from stored files Deliver a better user experience in products through voice commands Gain insights from customer interactions to improve your service How can we use the Audio Transcription API with Delphi? Google cloud services have been positioned as a must have computing service solution today. They allow us to easily use their perfectly-designed AI solutions to use in our applications. Not only that, prices are also reasonable and you can start with zero payment by just adding your credit card. But how about getting those amazing functions to our Delphi application? Some people would think that Delphi is not the ideal language to work with those popular cloud computing APIs. It’s not true. With the help of the huge community for Delphi, it’s simpler than you think. Google Speech to Text and Text to speech are two of those cloud computing functions that could vital for some business applications. With the help of few repositories by grijjy in GitHub, we can easily get those functionalities to our Delphi application. Actually the repository is dated from 2017 but surprisingly it works perfectly with the newer versions of Delphi without many changes to the code. How to setup Google cloud services to work with Delphi? To use Google cloud services in our Delphi project, we need credentials to allow our project to use our google cloud API account. To do that, please visit this link and create an account. https://cloud.google.com Then create a new project. Then go to API and services dashboard and create new credentials. Make sure it’s service account. Then go to the new service account and create new key in Keys tab. Please make sure the key type is P12. Now you need to convert this P12 key to PEM to use with our Delphi components. To do that, please run this command in a folder with OpenSSL binaries. Make sure to edit file names: openssl pkcs12 -in path.p12 -out newfile.key.pem -nocerts -nodes em>openssl pkcs12 –in path.p12 –out newfile.key.pem –nocerts –nodes/em> Keep that generated pem file to use with our Speech to Text Delphi project. What are the prerequisites for creating a Delphi Audio Transcription project? Download the GrijjyFoundation repository. https://github.com/grijjy/GrijjyFoundation Download the “Nghttp2.pas” from this link and copy it to the GrijjyFoundation folder. https://github.com/grijjy/DelphiRemotePushSender/blob/master/Nghttp2.pas Download the “Google.API.pas” form this link and include it in your project folder. https://github.com/grijjy/DelphiGoogleAPI/blob/master/Google.API.pas How to setup new Delphi project to demonstrate Audio Transcription? Create a new Delphi project and add components like this. Alternatively, you can download the demo project form this link. Demo Project GrijjyFoundation has many units to support many Google Cloud services. But in this project we only need few of them. Please include only these units to your Delphi project. How to code the Delphi Audio Transcription project? Now let’s move to the coding part. We use an instance of “TgoGoogle” class to post data and get the response form the Speech to Text API. We need to set some parameters of “TgoGoogle”. TgoGoogle.OAuthScope – OAuth Scope of the […]

Read More