From the blog

Google Maps heat maps

We recently received a question whether TMS FNC Maps supports heat maps. Heat maps are supported in Google Maps and we immediately went exploring the capabilities upon this request. More info and a sample about heat maps can be found here: https://developers.google.com/maps/documentation/javascript/examples/layer-heatmap. TMS FNC Maps comes with a lot of great functionality as well as a (lesser visible) customization events and methods to add your own extensions. To add support for heat maps, we had to override 2 virtuals and we can do this by inheriting from the TTMSFNCGoogleMaps class. Customizing the API URL TTMSFNCMaps (and TTMSFNCGoogleMaps), expose a lot of virtuals to extend and customize existing or new functionality. To support heat maps, we needed to add an extra parameter to the URL that is required to load the Google Maps JavaScript API. This can be done by overriding the GetHeadLinks procedure. procedure GetHeadLinks(AList: TTMSFNCMapsLinksList; ACheckReady: Boolean = True); override; Additionally, we need to change the link to include an additional parameter: “libraries=visualization” to enable the library required to load the heat map layer. procedure TTMSFNCGoogleMapsEx.GetHeadLinks(AList: TTMSFNCMapsLinksList;   ACheckReady: Boolean); begin   AList.Add(TTMSFNCMapsLink.CreateScript(‘https://maps.googleapis.com/maps/api/js?key=’ + MapsProperties.GetAPIKey + ‘&language=’ +     MapsProperties.GetLocale + ‘&libraries=visualization’, ‘text/javascript’, ‘utf-8’, ”, True, True)); end; Adding additional JavaScript functionality After extending the API URL to load the required libraries we need to add custom JavaScript to visualize the heat map. According to the sample (following the link at the top), we need to add code to visualize heat maps in San Francisco. To add custom JavaScript functionality, override the DoCustomizeMap virtual. procedure DoCustomizeMap(var ACustomizeMap: string); override; The code specified in the sample translated to Delphi code is shown below. procedure TTMSFNCGoogleMapsEx.DoCustomizeMap(var ACustomizeMap: string); var   h: string; begin   h := ‘var heatMapData = [‘ + LB +   ‘{location: new ‘ + MAPSERVICEVAR + ‘.LatLng(37.782, -122.447), weight: 0.5},’ + LB +   ‘new ‘ + MAPSERVICEVAR + ‘.LatLng(37.782, -122.445),’ + LB +   ‘{location: new ‘ + MAPSERVICEVAR + ‘.LatLng(37.782, -122.443), weight: 2},’ + LB +   ‘{location: new ‘ + MAPSERVICEVAR + ‘.LatLng(37.782, -122.441), weight: 3},’ + LB +   ‘{location: new ‘ + MAPSERVICEVAR + ‘.LatLng(37.782, -122.439), weight: 2},’ + LB +   ‘new ‘ + MAPSERVICEVAR + ‘.LatLng(37.782, -122.437),’ + LB +   ‘{location: new ‘ + MAPSERVICEVAR + ‘.LatLng(37.782, -122.435), weight: 0.5},’ + LB +   ‘{location: new ‘ + MAPSERVICEVAR + ‘.LatLng(37.785, -122.447), weight: 3},’ + LB +   ‘{location: new ‘ + MAPSERVICEVAR + ‘.LatLng(37.785, -122.445), weight: 2},’ + LB +   ‘new ‘ + MAPSERVICEVAR + ‘.LatLng(37.785, -122.443),’ + LB +   ‘{location: new ‘ + MAPSERVICEVAR + ‘.LatLng(37.785, -122.441), weight: 0.5},’ + LB +   ‘new ‘ + MAPSERVICEVAR + ‘.LatLng(37.785, -122.439),’ + LB +   ‘{location: new ‘ + MAPSERVICEVAR + ‘.LatLng(37.785, -122.437), weight: 2},’ + LB +   ‘{location: new ‘ + MAPSERVICEVAR + ‘.LatLng(37.785, -122.435), weight: 3}’ + LB +   ‘];’ + LB +   ‘var heatmap = new ‘ + MAPSERVICEVAR + ‘.visualization.HeatmapLayer({‘ + LB +   ‘  data: heatMapData’ + LB +   ‘});’ + LB +   ‘heatmap.setMap(‘ + MAPVAR + ‘);’;   ACustomizeMap := h;   inherited; end; Bundling this all together produces the following result. The complete code snippet (written in FMX, but can be used in any framework) unit UGoogleMapsHeatMap; interface uses System.SysUtils, System.Types, System.UITypes, System.Classes, System.Variants, FMX.Types, FMX.Controls, […]

Read More

RAD Server CRUD Procedures – Part 2

In this Part 2 post, we will discuss modifying the default generated CRUD (CREATE, READ, UPDATE, DELETE) procedure implementations from the RAD Server Package Wizard, to show one possible way to implement Get, GetItem, Post, PutItem and DeleteItem REST Endpoints. In the Part 1 post, we discussed the default generated CRUD procedure implementations from the RAD Server Package Wizard. In the Part 3 post, we will discuss implementing a FireMonkey (FMX) REST client to call and interact with the RAD Server CRUD procedures. The Embarcadero RAD Server (also known as EMS – Enterprise Mobility Server) uses the industry standards of REST, and to transfer data to and from the RAD Server REST Service, JSON – JavaScript Object Notation, is typically used as the transfer encoding. Due to the Embarcadero RAD Server supporting industry standard REST and JSON, we will use Delphi’s, C++ Builder and/or RAD Studio’s REST Client Library components  (TRESTClient, TRESTRequest, and TRESTResponse ) on the client, and  System.JSON classes (TJSONArray and TJSONObject) and FireDAC on the RAD Server to implement our CRUD procedures. Also note, newer versions of RAD Server have introduced new frameworks and components that allows for greater control of the data retrieved by desktop, multi-device, web and other service-based applications that connect to your RAD Server application. For example the EMSDataSetResource Component is discussed here and other RAD Server Improvements introduced in RAD Studio 10.3.2, like the RAD Server Database Mapping Wizard, and Swagger API Documentation Improvements, are discussed here. OK, now let’s dig into the details! First, for our application we want to access and perform CRUD procedures on our Employee Table from our InterBase Employee Database. For the Employee Table, I’m using the sample InterBase Employee database, located at: localhost:C:UsersPublicDocumentsEmbarcaderoStudio21.0Samplesdataemployee.gdb Recall from the part 1 post, using the RAD Server Package Wizard, , we created a package with resource. This created for us a Data Module. A Data Module is like a special form that contains nonvisual components. We can now add FireDAC data access controls onto our Data Module to access our Employee table. On our uResourceModule unit we can add our FireDAC controls to connect to the InterBase Employee database and Query the Employee Table: The easiest way to do this is to use the IDE’s Data Explorer Tab and create a new FireDAC connection to the InterBase Employee database: Then, select the Employee Table from the Tables node. And then drag and drop the Employee Table onto the Data Module form: This will add two FireDAC components on your data module. EmployeeConnection is the FireDAC connection (FDConnection) to your InterBase Employee database, and the EmployeeTable is your FireDAC Query component (FDQuery) to perform the SQL SELECT * FROM EMPLOYEE, to return all rows from the Employee table. To test the FDQuery EmployeeTable, double-click the FDQuery EmployeeTable component. This will open the FireDAC Query Editor, and show us the SQL Command for this FDQuery EmployeeTable, like this. The SQL is SELECT * FROM EMPLOYEE Click the Execute button, to verify you get all the rows return from the Employee table: Get (READ) Procedure Recall from the part 1 post, we saw the RAD Server Package Wizard, generate a default GET (READ) procedure implementation like this: Here is how we modified the default GET procedure to use FireDAC and System.JSON Classes (TJSONArray […]

Read More

The Future Of Desktop Apps Is Native Code

Desktop apps are powerful execution tools that can natively run on your local machine to provide holistic application navigation and utilization experiences. With the advancement of modern web technologies, the desktop application development paradigm also experienced a major drift in terms of implementation. Technologies such as JavaScript and Python have inspired the hybrid implementation of desktop apps. Hybrid app implementations have enhanced the ability of web developers to deliver desktop apps but the decreased performance and increased memory consumption are a significant downside. Since desktop apps run the application code locally on your machine, we cannot compromise on the performance and memory usage by getting rid of the native code. The future of desktop apps still lies in the native code. In this blog post, we’ll look at why native code is the future of desktop apps by comparing the performance and memory usage of Delphi with other desktop application development frameworks such as WPF .NET and Electron. Can Electron deliver an optimized solution? Visual Studio Code is an Electron app and generally performs pretty well. A developer might think that all Electron apps can achieve the same performance as Visual Studio Code but generally that is probably not the case. Microsoft has a huge task force of developers working on the project and has put a lot of effort, time, and money to optimize the VS Code application. In most cases, other companies do not have the enormous budget as giants like Microsoft and hence cannot match the optimization efforts to deliver a high-performant application using Electron. Running a a few unoptimized applications might still be fine, but we know for a fact that our systems indeed have the capacity to run more. When you choose to operate with more than a few, say five to ten, unoptimized applications then they adversely effect the system and application runtime performance. In such scenarios, RAD Studio that consists of Delphi and C++ Builder becomes an ideal choice of adoption for desktop application development. Now let’s look at the performance test results from the Embarcadero Whitepaper. According to Discovering the Best Developer Framework through Benchmarking by Embarcadero Technologies, the end-product performance, which depends on startup times and runtime memory, is one of the four aspects of effectiveness for the success of applications. The consumers judge applications based on the runtime performance and businesses choose the frameworks that have a higher performance. The specialists at Embarcadero Technologies used the development and analysis of a benchmark Windows calculator app and evaluated its performance against the Delphi, WPF, and Electron frameworks and libraries. How does Delphi Contribute to Application Performance and Startup Time? When it comes to performance and startup time of applications, according to Embarcadero’s commissioned whitepaper, frameworks that produce applications with shorter startup times facilitate good user experiences and minimize the system resources well before the application is ready to be used. Startup time is especially important when loading an executable or application over a network because network speeds can be slower than loading applications via the local hard drive. According to the experimentation done in the whitepaper, the benchmark calculator app built with Delphi gave a startup time of 0.239 seconds on average from the local files, whereas from the network files, the average time was recorded to be 0.439 seconds. The slowest startup […]

Read More

Automatically Label Objects In An Image With DenseCap API And Javascript

As businesses and individuals move increasingly online, they accumulate large volumes of data in the form of digital images. If you have found yourself in this position, then you are definitely aware that to efficiently organize, analyze, and edit your images takes plenty of time. It takes so much time, in fact, that often the only good solution is for you to develop your own high-quality software to ease the ever-increasing load. Thankfully, there are tools available to you that speed things up, and they do it using AI and machine learning. They perceive and recognize objects within your images and automatically label them appropriately. In addition to being very useful for organizing your directories full of digital images, they also help you search for and discover the important information contained within your images. DeepAI.org has created a number of these machine learning and computer vision technology tools. DenseCap API in particular scans and adds captions to your images by identifying objects they contain. Most importantly, DenseCap API is fast. It takes seconds to scan and caption even your largest images. If building your own AI and machine learning apps interests you, then read on to find out how you can quickly build a Sencha Ext JS app that automatically labels objects in an image. Let’s get started building an app that looks like this: What is the DenseCap API by DeepAI? So what does the DenseCap API do? Simply put, the DenseCap API takes your image input and returns a JSON object that contains information about each item or object it detects within the image. For object it identifies it returns the following three attributes: Object label Confidence value of the object Coordinates/bounding box of the object within the image. The great thing about DeepAI is that the API key is provided for free. You can use this key to try out their interface and once you run out of a fixed number of queries, you can get your own key. To see it in action for yourself, first, open the command line in Sencha Cmd and type the following: curl -F ‘image=https://images.pexels.com/photos/4198322/pexels-photo-4198322.jpeg?auto=compress&cs=tinysrgb&dpr=2&h=750&w=1260’ -H ‘api-key:42638949-3cf9-486b-a063-eaf5f4df0634’ https://api.deepai.org/api/densecap Pasted below is a part of the JSON text that the API returns. The API actually identifies more objects for this image, but we are only showing two of them below to help you gain an understanding of how the API works:  {   “id”: “26f9959b-2001-4f98-a648-99c6f8856190”,     “output”: {         “captions”: [             {                 “caption”: “a white plate with a white frosting”,                 “bounding_box”: [                     420,                     189,                     578,                     589                 ],                 “confidence”: 0.9974018335342407             },             {                 “caption”: “a small orange bowl”,                 “bounding_box”: [         […]

Read More

Developer Stories: Serkan Şahinoğlu Shares More About His ForPrompt Studio Software

Serkan Şahinoğlu started programming since 1995. He submitted his ForPrompt Studio showcase entry at the Delphi 26th Showcase Challenge and we interviewed him to get more insight on his experiences with Delphi. Head over to the ForPrompt Studio website for the product and how to use it. When did you start using RAD Studio Delphi and how long have you been using it? Since 1995, I have been developing software in Delphi and various languages for 26 years. It has been part of many of my projects since Delphi 1. Thanks to its practicality, it helps me to finish the product in a short time. What was it like building software before you had RAD Studio Delphi? With Delphi  a simple database application could be developed in minutes without writing any code, even twenty years ago, using embedded components for database. How did RAD Studio Delphi help you create your showcase application? As I mentioned earlier RAD Studio is extremely rapid application-oriented, this is my very first mobile application developed while learning Firemonkey for the first time, this really proves RAD studio has really good features to get the work done fast. When my projects need rich interface and practicality, I mostly turn to Delphi. Several times I prepared DLL libraries and external modules with C++ and C# for custom applications and used Delphi again for the interface. What made RAD Studio Delphi stand out from other options? I usually prefer Delphi when developing software with extensive interfaces. With hundreds of visual components and features ready, I can focus on my actual work without dealing with unnecessary details. After doing projects in Visual Basic, Visual C++, C#, and other programming languages, I came to the conclusion that Delphi is a practical software development tool that can producing rapidly. Now it has reached an advanced level that can compile the same project for Windows, Linux, MacOS, iOS, Android operating systems. What made you happiest about working with RAD Studio Delphi? One of Delphi’s my favorite features is that all libraries have clear and readable source codes. By examining them, we can program them more efficiently and easily to understand what is going on behind our code up to the operating system level because it is written very practically and understandably. They also help you learn how to coding. Since the software we produce with Delphi is standalone exe file, the fact that it can be easily transported and operated without the need for additional installations speeds up our business. I can also share my practical small software with my friends as a single small exe file. The VCL library, which cleverly encapsulates the massive Windows API, its practicality in database applications, and the fact that there is no longer the need to encode heavy DirectX/OpenGL thanks to FireMonkey are all my favorite aspects of Delphi. It’s nice that the DXScene/VGScene library, which I bought a lifetime license a few years ago, soon came across as FireMonkey and evolved to its current level. What have you been able to achieve through using RAD Studio Delphi to create your showcase application? The teleprompter render engine I created in Firemonkey sends floating reading text to the laptop monitor or to screens in the TV studio via I/O cards such as Decklink and AJA. In […]

Read More

Another webinar with another first …

If any of these technologies are of interest to you, we have a new webinar coming up with another first!Reserve your first class seat now while it can here.  We will show you for the first time in public, the latest state of project Miletus in TMS WEB Core.  To give you a hint, we only show today this screenshot: First time you hear about the word Miletus? Read up here and then reserve your seat!  With your registration, you’ll see & discover it first-hand in our online webinar running in our own fully web-based TMS Web Academy platform developed here using TMS WEB Core for Visual Studio. We look forward to meet you in the webinar and discuss via the platform the many new capabilities that open up for Delphi developers.  See you!

Read More

Discover our wide range of TMS FNC Components

FNC stands for Framework Neutral Components. This means that the components can be used cross-framework and cross-platform. With our TMS FNC Component studio bundle you will get access to all our current FNC components! That is not all! You will save over 45% now and even more with new free FNC component releases! All products come with perpetual licenses and 1 year of FREE updates & support. Subscriptions can be extended for another year at 70% discount! Products included in the bundle: Get full access to FNC components: Components for Delphi & C++Builder that can be used in all project types. Only one learning curve: VCL, FMX, LCL and WEB. Target Windows, macOS, iOS, Android, Linux and WEB. Growing range of components, new products on the way. Yearly renewal only 145 EUR* instead of regular 495 EUR. All products accessible via TMS Subscription Manager tool. Full online support through TMS Support Center. *The price is valid for this moment & depends on the price of the pack at the moment of renewal. Learn More: Want to learn more about FNC and how you can benefit from it? Join us on our upcoming webinar: “What is FNC : Introduction to the growing family of FNC technology based components“, on June 22, 2021. Act now: Find out more about our products included in TMS FNC Component Studio and get your license today! NOTE: Contact sales for special upgrading pricing for existing customers of other products.

Read More

TMS WEB Core & FNC trial support

A small update with a big impact We have recently changed the way the trial version is being built and now works together with other TMS WEB Core enabled products. Evaluating a product before considering a purchase is important and therefore we have bundled all of our resources and investigated a solution for the ongoing issues trying out the combination of trial FNC & trial TMS WEB Core. Today we can announce there are no issues compiling FNC trial & TMS WEB core trial together. Enjoy and test the trial version of the following products in combination with TMS WEB Core trial today! In case you didn’t notice This week is also FNC week. Please read the following blog post to know more about FNC & FNC Studio and the benefits it has to offer: https://tmssoftware.com/site/blog.asp?post=806

Read More

Facebook Scraping Incident Leaks Info for a Half-Billion Users

Published June 10, 2021 WRITTEN BY ED TITTEL. Ed Tittel is a long-time IT industry writer and consultant who specializes in matters of networking, security, and Web technologies. For a copy of his resume, a list of publications, his personal blog, and more, please visit www.edtittel.com or follow @EdTittel In early April, numerous sources disclosed discovery of a pool of Facebook records including information on more than 530 million of its users. The leaked information included users’ names, dates of birth, and phone numbers as posted to a website for hackers. Business Insider’s (BI) April 3 story represented some of the first reporting on this breach, and focused on a database that security researcher Alon Gal of cybercrime intelligence firm Hudson Rock discovered in January 2021. BI reports further that it “reviewed a sample of the leaked data and verified several records by matching known Facebook users’ phone numbers with IDs listed in the data set.” Facebook’s Response and Explanation The BI story states that a “Facebook spokesperson told Insider that the data has been scraped because of a vulnerability that the company patched in 2019.” Scraping attacks involve downloading account pages from a Website and parsing their contents to discover personal information amongst the data the underlying Web markup contains. The vulnerability involved was based on the ability to import contact lists from users’ cellphones (with their permission) to extend friend lists and associated data. But while the vulnerability is no longer open to current exploit, even PII (personally identifiable information) data from 2019 can serve as entry points for various types of attack, including impersonation, identity theft, targeted phishing, and potential fraud. According to numerous sources who’ve analyzed the database in question, users from 106 countries are included in its contents. Of the over 500 million users represented therein, over US-based users number 32 million, with 11 million more from the UK, and an additional 6 million from India. For most users, their data includes Facebook IDs, phone numbers, full names, locations, dates of birth, and self-descriptions (bios). For some users, email addresses are also disclosed. How the Breach Was Identified Mr. Gal found the leaked data in January when a hacking forum users advertised a bot that could provide phone numbers for hundreds of millions of Facebook users at a price. At around that same time, Joseph Cox at Motherboard reported the existence of this automated Telegram bot, with a proof of function demo, with charges ranges from US$20 to get information for a single user account, and up to US$5K for 10,000 users. Motherboard reports it tested the bot and confirmed that it provides a valid phone number for a Facebook user known to them who elected to keep that number private. The exploit was documented in 2019 for Instagram users (Instagram is a subsidiary of Facebook) and included this statement “It would … enable automated scripts and bots to build user databases that could be searched, linking high-profile or highly-vulnerable users with their contact details.” This is apparently just what the database that Gal discovered contains. Since his initial findings in January, that database has been posted to a hacking forum at no charge. Thus, it’s available to anyone able to access the site. And indeed it could provide ample data to drive attacks even […]

Read More

Quickly Deploy Powerful Cross-Platform Machine Learning OCR Technology

Are you familiar with the concept of OCR? Wouldn’t it be nice to be able to easily convert images of typed, handwritten or printed text into machine-encoded text? Take a look at the two images below, with just a few lines of code we will make our Windows, Mac, Android or iOS application able to “read” those texts! Whether from a scanned document, a photo of a document or the text on signs and billboards in a landscape photo this process of extracting text from images is called Optical Character Recognition or Optical Character Reader (OCR). We can easily use Google OCR machine-learning AI in our Delphi applications The option for “Text Detection” is part of the Vision API that we can use to detect and extract information about multitple Texts in an image. For each text detected Google returns both a list of words identifed with text, bounding boxes, and textAnnotations , as well as the structural hierarchy for the OCR detected text. Google Cloud’s 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. How do I get my RAD Studio Delphi applications to detect text in images with an API? We can use RAD Studio and Delphi to easily setup its REST client library to take advantage of Google Cloud’s Vision API to empower our desktop and mobile applications and 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 either 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 or rather 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 Cloud Vision Logo Detection API? Make sure you refer to Google Cloud Vision API documentation in the Text Detect section (https://cloud.google.com/vision/docs/ocr) and also Document Text Detection optimized for dense text/handwriting (https://cloud.google.com/vision/docs/pdf), but in general lines this is what you need to do on Google’s 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 How do I call Google Vision API Text Detection endpoint? Now all we need to do is to call the API URL via a HTTP POST method passing the request JSON body with type TEXT_DETECTION and source as the link to the image we want to analyze. One can do that using REST Client libraries available on […]

Read More