Delphi

This API Adds Machine Learning Computer Vision To Your App

Microsoft’s Azure has a broad collection of services you can access with an easy-to-use API. Azure is Microsoft’s cloud hosting and computing platform with a catalog of more than 200 different products. It also includes products which allow you to implement Machine Learning services. Those services all have an API which can you can access using client access libraries or a REST client. Delphi takes this ease of use one step further by providing a TAzureConnectionInfo to implement some of those services quickly and with a minimal amount of code. Also, we can access the services using Delphi’s built-in REST client. Is Azure Read Client Free? No, the Azure Read Client is not free, but the good news is when you first register you will get some free 12 months services and an free-tier allowance for services so you can try things out as you develop, test and launch your app. Some Azure services have very generous ‘always free’ levels. The service we going to use in our OCR application is  “Cognitive Search” which is one of those which is always free. It has a permanent limit of 10,000 documents, but that’s more than enough for our testing purposes. How do we get API credentials for the “Computer Vision” service resources? For our OCR application, we going to use the “Cognitive Services->Computer Vision” resource. First you must have an “Azure subscription”. Go to the link below and create an “Azure subscription” if you don’t have one. It’s free to start! https://azure.microsoft.com/en-us/free/cognitive-services/ Once you have the subscription, you can create the required service links. Go to this link to create a “Computer Vision” resource. https://portal.azure.com/#create/Microsoft.CognitiveServicesComputerVision Make sure you select the correct region because you can’t go back and change it later. Now go to the resource you created and choose “Keys and Endpoint” from the left-hand menu. Now, copy one of the keys and and the location. We need those in our application. How to connect to the Cognitive Services REST API? We need TRESTClient, TRESTRequest and a TRESTResponse components to connect to the cognitive services REST Api. Lets drag and drop TRESTClient in to the forum and do some basic property changes. Make sure the “Accept” property has “application/json” type. Set the content type to “application/json“. Then drop a TRESTRequest component into the forum and set client property to the client we created earlier. Set the method to “rmPOST“. Place a TRESTResponse component and set the response property in the request component to this response object. Add some edit boxes, buttons and a memo box to complete our interface. How do we use the API to post the image for processing? We cannot post the image to cognitive services and get the result in one call. The image processing takes time, although usually this is less than five seconds. So, first we need to submit our image to the cognitive service and get the “Operation-Location” and check the status until it’s “succeeded”. If the server is still processing the image, status will be “running” instead. For each and every call to cognitive service API, we need to provide our subscription key through the HTTP Header. It’s the key we copied earlier from the resource we created. To do that, add a new parameter to TRESTRequest component, set the ‘kind’ to […]

Read More

Developer Stories: Michał Bąkowski Exclusively Elaborates On TonCut

Michał Bąkowski first worked with Delphi many years ago. He participated in the Delphi 26th Showcase Challenge with his cutting optimization (TonCut) showcase entry. Learn more about his software over at the TonCut website. When did you start using RAD Studio/Delphi and have long have you been using it? I’ve started with Delphi 1 ages ago. Before I was working with Borland Pascal for Windows and when Delphi came out, it was like a revolution. What was it like building software before you had RAD Studio/Delphi? It was much more time consuming, difficult and harder to control. With Delphi, creating UI is very fast and simple. How did RAD Studio/Delphi help you create your showcase application? Most of all it allows creating own components and easily using it. Besides that, when I started working on TonCut, there was no other option actually.  All other tools were far behind Delphi. What made RAD Studio/Delphi stand out from other options? It allows fast creation and modification of UI. This is the main advantage of Delphi. What made you happiest about working with RAD Studio/Delphi? Hard to tell. I think, again option to create own components. What have you been able to achieve through using RAD Studio/Delphi to create your showcase application? Well, I created the app that my customers like. This is all I need. What are some future plans for your showcase application? We will be working on adding more AI to the app. Also we plan to add new optimization algorithms (1D with slants, 2D nesting of any shapes and maybe even 3D). Some functional changes are also on their way.   Thank you so much Michał! Head on over to the TonCut showcase to read more about Michał’s work

Read More

Machine Learning: 5 Ways To Use ML in your Windows Apps

How do I start using Machine Learning in Windows? Machine learning isn’t only for the cloud, or run locally in a web browser or command prompt, Microsoft is bringing it to PCs in the latest Windows 10 release. For example, Microsoft provides Python’s WinRT to create Windows Machine Learning applications, and ONNX (Open Neural Network Exchange) format, an open standard for sharing trained deep learning models between platforms and services. The latest release of Windows 10 provides plenty of new APIs for your applications. This includes the support for running trained Machine Learning models as part of Windows applications, taking advantage of local GPUs to accelerate Machine Learning applications. On the other hand, Embarcadero created Python4Delphi (P4D) to empower Python users with Delphi’s award-winning VCL functionalities for Windows which enables us to build native Windows apps 5x faster. This integration enables us to create a modern GUI with Windows 10 looks and responsive controls for our Python Machine Learning applications. Python4Delphi makes it very easy to use Python as a scripting language for Delphi applications. It also comes with an extensive range of demos and tutorials. With Python4Delphi, you can integrate any Python features, functionalities, and libraries with Delphi to create a nice GUI for your Machine Learning applications in Windows. In this tutorial, we will discuss the following: How to use these 5 Python libraries with different Machine Learning capabilities to perform Machine Learning in Windows Apps: Matplotlib, NLTK, Pillow, OpenCV, and Keras. All of them would be integrated with Python4Delphi to create Windows Apps with Machine Learning capabilities. Prerequisites: Before we begin to work, download and install the latest Python for your platform. Follow the Python4Delphi installation instructions mentioned here. Alternatively, you can check out the easy instructions found in Getting Started With Python4Delphi video by Jim McKeeth. Time to get started! First, open and run our Python GUI using project Demo1 from Python4Delphi with RAD Studio. Then insert the script into the lower Memo, click the Execute button, and get the result in the upper Memo. You can find the Demo1 source on GitHub. The behind the scene details of how Delphi manages to run your Python code in this amazing Python GUI can be found at this link. Open Demo01.dproj. 1. How do I enable Matplotlib inside Python4Delphi in Windows? Matplotlib is one of the most popular and oldest plotting libraries in Python which is used in Machine Learning. In Machine Learning, Matplotlib helps to gain insights from a huge amount of data through different data visualization techniques. With the high demand for Data Science and Analytics skill sets, drawing graphics programmatically is a very popular task these days. You can easily solve these tasks by combining the Matplotlib library with Python4Delphi (P4D). Matplotlib can be used in Python scripts, the Python and IPython shell, web application servers, and various graphical user interface toolkits (in this post, Python GUI by Delphi’s VCL using P4D)! After installing Python4Delphi properly, you can get Matplotlib using pip or easy install to your command prompt: and don’t forget to put the path where your Matplotlib installed, to the System Environment Variables, here are the example: C:/Users/YOUR_USERNAME/AppData/Local/Programs/Python/Python38/Lib/site-packages C:/Users/YOUR_USERNAME/AppData/Local/Programs/Python/Python38/Scripts C:/Users/YOUR_USERNAME/AppData/Local/Programs/Python/Python38 C:/Users/YOUR_USERNAME/AppData/Local/Programs/Python/Python38/Lib/site–packages C:/Users/YOUR_USERNAME/AppData/Local/Programs/Python/Python38/Scripts C:/Users/YOUR_USERNAME/AppData/Local/Programs/Python/Python38 The following is a code example of Matplotlib to create Stacked Horizontal Bar Chart to Visualize Discrete Distribution (run […]

Read More

Get A Workflow Supercharge For Your Sales

Take your order and billing workflow to the next level with this brilliant Android app. Smart Trader is of course written in Delphi using the cross-platform power of the Firemonkey FMX framework. Produced by Soluciones Informáticas Globales S.A. based in Buenos Aires Smarter Trader is now available in its third version for Android. As stated by the SIG S.A. “SMART TRADER is an app for mobile devices with android platform, designed to optimize the task of order taking and billing in the moment, with the specific objective of increasing the productivity of your sales force. It has an online and offline mode of operation, allowing to take orders, invoice them and make snakes autonomously. How can Smart Trader help with your workflow? Search for items by code, name, item, vendor, or scan the barcode. View the requested item data: price, units per package and display, stock availability, photo. Suggest offers, out of Stock items, highlight new products. Adds up the value the order as items are added to the bill of sale. View the final total including any discounts. Issue an electronic invoice. Of course, record the visit, the names of the sales person and the order placed. The customer’s geographic location can also be captured using the Android device’s in-build GPS If the sale falls through for any reason, the sales person can record details of why it didn’t go ahead. Starting your day the Smart Trader way At the beginning of their working day sellers can review the list of clients by account code, name or address and obtain the following information from them: What is the customer’s geographical location? Do they have any previous sales or specific requests? Are there any invoices or payments pending collection? When was the last visit made and who made it? Are there any special discounts or promotional items available which can be offered? What discount policy you have with this customer? Other workflow friendly features Smart Trader contains advanced search features which allow you to search for items rapidly assess orders, customer or order profitability, mark accounts for collection, issue along with a host of other features packed into the one application. Google Play SMART TRADER 3 Screenshot Gallery Library

Read More

Add STOMP to your apps for lightweight real-time streaming

STOMP is a publish/subscribe messaging protocol which allows for very lightweight communications between almost any mixture of programming languages, operating system platforms and “message brokers”.  This article goes into detail about what STOMP is, why you would want to use it, some quick-start hints to get you up and running and a fully working example of using STOMP in your Delphi programs – all for free. What is STOMP? STOMP is the Simple (or Streaming) Text Orientated Messaging Protocol. STOMP describes an agreed message protocol format so that STOMP clients can communicate and work with any STOMP message broker (the STOMP name for the server). What is the difference between STOMP and websockets? It’s a good question!  We looked at Websockets in a previous article.  Websockets are sometimes the underlying transport technology used to implement STOMP.  In a sense, websockets are how the messages get passed around and STOMP is the agreed format of what is passed.  STOMP doesn’t need to use websockets to work. Is STOMP hard to use? Like any technical subject there are a few concepts to understand but once you get comfortable with the terminology STOMP is extremely easy to use.  If you write your own server applications, or ‘brokers’, any STOMP client can interact with them no matter what computer language or technology is used.  The official STOMP website even states “you can use Telnet to login to any STOMP broker and interact with it”. Behind the scenes STOMP uses headers and frames to control the back and forth of the communications.  It’s modeled on HTTP but it’s more lightweight and doesn’t really have anything to do with it. The broker controls things such as an optional heartbeat system Clients ‘SUBSCRIBE’ to a ‘topic’.  The clients can then post messages to that topic.  Messages sent to that channel get passed on to all clients subscribed to the same topic.  Clients can be subscribed to more than one topic. Clients can also be brokers but that complicates our examples, so we’ll stick here with the idea of the client and the broker being separate entities. STOMP subscriptions and possible uses For example, I could write a client to subscribe to a topic called “/myapplication/errors”.  Then, whenever my application encounters an error, it could send a message to the “/myapplication/errors” topic.  All other clients also subscribed to that topic would receive that message and could then act on it, reply or ignore it. Imagine that one of the clients was a status page showing a count of errors.  It could show a real-time visualization of the severity, number and frequency of the errors.  That status page could be a web page, a Delphi VCL application running on Windows, macOS app or a Firemonkey mobile app running on an iPhone. The content is up to your imagination Whilst STOMP defines how the messages get passed around the actual text content of the message is totally under your control in your code.  The messages work best when they are plain text – because that’s the format underpinning the STOMP protocol – but they could just as easily be some JSON or similar text-based encoding. First steps on how to use STOMP in your applications RabbitMQ makes testing your Delphi STOMP programs more straight-forward. First, it’s easiest if we install […]

Read More

Powerful FileOptimizer Windows Tool Is Built With Delphi

FileOptimizer is an advanced file optimizer featuring a lossless (no quality loss) file size reduction that supports an absolutely staggering array of file formats. I counted at least thirty formats but the application supports many more than that and also includes a plug-in mechanism which can enhance the app’s capabilities even more. What does FileOptimizer do? FileOptimizer compresses already compressed files further without changing the file format and retaining complete compatibility with their originals. It keeps the behavior of the file untouched, but with its size reduced thanks to a collection of recompression and optimization techniques. FileOptimizer runs natively under the Windows operating system and can also run under Linux and macOS using WINE. Website FileOptimizer 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

This Ultimate Mathematical Visualization Software Comes With Full Delphi Source Code

Algosim is a mathematical visualization application and scripting language that lets you perform computations on numbers, vectors, matrices, images, sounds, and more. More than 800 functions and 70 operators More than 320 mathematical functions, ranging from linear algebra from number theory A syntax that very closely mimics the notation in ordinary mathematics Functions are first-class objects A comprehensive set of list-manipulation functions A comprehensive set of 2D visualization functions with SVG export Visualize data as images, sounds, and MIDI music A comprehensive manual in almost 1000 pages More than 40,000 automatic tests (close to 500,000 after parameterization) are used to assert the correctness of the software Free to download and use Algoism is developed by Andreas Rejbrand. Complete with Delphi source code The program is great on its own, but what’s ever better for us Delphi fans is that the full source code is available here: https://algosim.org/SynViewSource/ which means you can take a look for yourself and see how it does its work – excellent as a learning resource. What operating systems are supported? Algoism runs on all recent versions of Microsoft Windows and it only requires 100mb of space to do it! Website Algosim Screenshot Gallery

Read More

Magnificent Fitting Program Software Is Made In Delphi

Embarcadero’s users understand the scalability and stability of C++ and Delphi programming, and depend on the decades of innovation those languages bring to development. Ninety of the Fortune 100 and an active community of more than three million users worldwide have relied on Embarcadero’s award-winning products over the past 30 years. Icons by Icons8.com. © 2020 EMBARCADERO INC. ALL RIGHTS RESERVED

Read More

Developer Stories: Giuseppe Massimo Pinto Talks About His Application Metrodrummer 2

Giuseppe Massimo Pinto has been programming for about four years now. His application (Metrodrummer 2) was one of the Delphi 26th Showcase Challenge entries and we asked for his insights on programming with Delphi. Download Metrodrummer 2  to experience the application. When did you start using RAD Studio/Delphi and how long have you been using it? I”m starting using delphi from about 4 years. Starting with community edition then my boss buy a license con me. I use rad studio for many purpose, but mainly i use it for mobile app development. What was it like building software before you had RAD Studio/Delphi? The only thing I had never created was an app for iPad or Mac.  I used, and still use, other tools, mainly C++ or VB6 for development on Windows and Java with Android Studio for Android development. How did RAD Studio/Delphi help you create your showcase application? It helped me a lot for the very intuitive graphic management. The main advantage is having a single project to compile Windows, MAC, iOS and Android applications. What made RAD Studio/Delphi stand out from other options? It compiles for many platforms. What made you happiest about working with RAD Studio/Delphi? The ease of compiling for Android and iOS. What have you been able to achieve through using RAD Studio/Delphi to create your showcase application? Obviously the development of many apps and a .dll which in turn uses an oxc made in C. It was very useful to me as a sound engine in our very famous top program for PC and macOS “Winlive Pro Synth”. The latter however is not  done in Delphi. What are some future plans for your showcase application? Now in my company I am working on updates of our software. Certainly some other software always in the music field in which we work Thank you, Giuseppe! Go over to the link below and view the application’s showcase entry for more information. Showcase

Read More

Terrific Fun With The Good Cat Bad Cat Mobile Game!

All the cool cats are coming to a party in this hilarious mobile game. Watch out though, some are coming to have fun, but just like a real party, some will try to ruin it! Your task is to let the GOOD cats IN and keep the BAD cats OUT. No party poopers allowed!. The game play involves you tapping on the cat entrance door to close it quickly when a bad cat appears. If you accidentally let three felonious felines through the cat flaps the party is over and nobody likes that! Good luck! Written in Delphi using Firemonkey FMX – the best and only monkey allowed at the party – this kitty-friendly mobile game is harmless fun. In fact, you could say Good Cat, Bad Cat is purrfect.. [Enough with the puns now, I know, I know] Developer Davor and Robi have done such an excellent job. You can find Good Cat, Bad Cat on the Apple App Store and on Google Play using the links below. Google Play Good Cat Bad Cat Apple App Store Good Cat Bad Cat Screenshot Gallery Delphi makes developing a mobile game very easy Just add your imagination with a sense of fun and your mobile app could be one of the cool cats too.

Read More