Noutați

Combine Front End, Back End, And Business Logic In Modern Full-Stack Development With Delphi

Many application developers are building a web version of their services to get more users. For instance, you do not always have the same phone or same laptop to utilize the application, if the application has a web version everything is done.  In this webinar, you can see what is new with TMS Software and how you can use their full range of components to modernize your Windows 10 application and building web apps with Delphi.  New challenges today: Development for multiple platforms Desktop Client Applications need to interact with servers. Less RAD, more OOP Loosely-coupled Software Building Blocks Front-End – TMS VCL, FMX, FNC UI Pack & TMS Web Core Business Logic – TMS Aurelius, FlexCel, ANalytics, and more Back-End – TMS RemoteDB, Sparkle, XData If you are interested in building backend services with Delphi and TMS, you can utilize TMS XData to write custom services. TMS XData has several major features which you should know: Can be autogenerated from an existing database Open for any desktop, web, or mobile app Standardized REST protocol using JSON for data transport Fully documented REST API with SwaggerUI Be sure to watch the session Q&A learn more about the specific information. Head over and check out all of the different components available from TMS Software!

Read More

The Role of SAST in DevSecOps

Published November 25, 2020 WRITTEN BY MICHAEL SOLOMON Michael G. Solomon, PhD, CISSP, PMP, CISM, PenTest+, is a security, privacy, blockchain, and data science author, consultant, educator and speaker who specializes in leading organizations toward achieving and maintaining compliant and secure IT environments. Most people involved in the process of creating and deploying software applications today are familiar with DevSecOps, which integrates security and operations into the software development process. In figurative terms, we think of the software development lifecycle as a timeline, starting with the design on the left and the deployment (and post-deployment activities) on the right. Historically, security was overlooked until as late as possible in the process; it was something to consider once you had a viable product. But the truth is, ignoring security early on makes it harder and more costly to add on later. As DevSecOps continuously pushes security “to the left” in the software development process, autonomous assessment can provide assurance of security compliance from development’s earliest stages. One type of autonomous assessment, static application security testing (SAST), can help identify software flaws early on. Let’s explore how using SAST helps DevSecOps achieve its stated goals while minimizing friction. What SAST offers Experienced software developers can integrate correctness, robustness, efficiency, elegance and even security into the code they create. However, even the best developers don’t get it right every time. And less experienced developers tend to deviate from standards and best practices in order to get the job done. In today’s push to deliver products quickly and efficiently, it gets harder and harder to pay attention to all the details, including security. SAST can provide a valuable tool in the software developer’s toolbox for writing quality code. Far from some initial developers’ perception, SAST isn’t just one more hoop to jump through. Strategically laced SAST assessments can alert developers and management that potential flaws exist and should be addressed early in the process. Developers commonly find that SAST helps them to be more efficient. The last thing you want to find is a critical design flaw that stays hidden until the final testing before release. SAST can increase the likelihood you’ll find flaws long before they get “baked in.” One great way to leverage SAST’s value is to require assessment of all code before the initial check-in. You don’t (or shouldn’t) ever commit code that doesn’t compile, so why should you be able to commit code with security flaws? Find the flaws and fix them before committing work to the pipeline. Instead of increasing each developer’s workload, you’ll decrease (in many cases dramatically) the time required down the road in rework to fix flaws someone else finds. Plus, complete SAST codebase scans may take hours. Individual and small-batch scanning is much faster. Requiring developers to carry out SAST scans locally distributes the overall workload and reduces friction along the development pipeline. Although giving individual developers the ability to automatically flag potential issues is a huge benefit, management and auditors enjoy SAST’s help in doing their jobs as well. Developers can fix flagged issues before committing code, but some errors won’t be found until more comprehensive tests, including integration tests, get carried out. For example, pre-build SAST assessments may identify flaws that unit-based SAST assessments couldn’t see. Each time SAST identifies new flaws, management has […]

Read More

Get Free Responsive Cross-Platform Login Screen Templates For Android And iOS

This FireMonkey UI template designs for implementing a login screen in a multi-device application. And shows how to utilize FireMonkey designing guidelines. As you can see, this FireMonkey UI template is responsive and ready to utilize in any kind of project that requires a login screen like this! The templates should be cross-platform and work on Android, iOS, macOS, Windows, and Linux with a single UI and single codebase. From this demo project, you can learn: How to utilize ScrollBox Utilizing Layouts Making a blurred background image Changes to the layout should be made inside of the TFrame itself. Once changes are made to the TFrame you can delete it from the TForm and re-add it. Set its Align property to Client. Optionally, it’s ClipChildren property can be set to True if there are any overlapping background images. You can get this FireMonkey UI template from GetIt Package Manager Head over and get more information for the templates from GetIt and then download them in the Delphi IDE.

Read More

Easy Steps To Connect To A MS Access Database With FireDAC In This Windows Sample App

Do you want your Delphi and C++ Builder Applications to connect with Access Database ? Do you need to manage some of the Access Database services such as creating, compacting database? How to start ? Don’t worry, FireDAC components offers robust components to connect with Access Database. FireDAC.Access Sample app demonstrates how to use FireDAC to work with access Database. You can find Delphi code samples in GitHub Repositories. Search by name into the samples repositories according to your RAD Studio version. Components used in the Sample App: TFDQuery : To execute SQL queries, browse the result sets, and edit the result set records. TFDPhysMSAccessDriverLink: To link the Microsoft Access driver to an application and set it up. In general, it is enough to only include the FireDAC.Phys.MSAcc unit into your application uses clause. It is used to specify access ODBC driver name and access the ODBC driver connection parameter common for all connections. TFDConnection : To establish a connection to a DBMS and to manage associated datasets. TFDAccessService: Class Implementing Microsoft Access database for creating, dropping, compacting, and repairing services. And some of the UI components, like TDBGrid,TDBComboBox, TFDGUIxWaitCursor1,TFDGUIxLoginDialog1,TFDGUIxErrorDialog1 Implementation Details: The simplest way to configure connection to MS Access database at run time is to build a temporary connection definition: In the sample, the temporary definition is created when the  item is selected in the Connection combo box.  Open the following database: C:UsersPublicDocumentsEmbarcaderoStudio20.0SamplesdataFDDemo.mdb. In the demo database, the Categories and Products tables have one-to-many relation by CategoryID field. Mention the query to the qryCategories.SQL property and qryProducts.SQL property. Finally, qryProducts.MasterSource property is set to dsCategories, while the MasterFields property is set to CategoryID. This creates a master-details relationship between the datasets. Simple queries execution is demonstrated via the ExecSQL method of TFDConnection. The management of databases, such as: creating, dropping, compacting/repairing, and setting a password is done using TFDMSAccessService component. This demo demonstrates how to create and compact the user database.  Check out the full article in the DocWiki about the FireDAC.Access Sample. FireDAC.Access Sample App Check out the full source code for the FireDAC.Access projects for Delphi and C++Builder over on GitHub.

Read More

Black Friday 2020

And we are back with our best deals for Black Friday 2020!Buy one product and get a second same or lower priced product at 50% discount! (new licenses only) Enjoy this super deal this Friday, all day long! Purchase your first product and just contact our team at sales@tmssoftware.com for your coupon code for the second license. Don’t wait and take advantage now! Share your excitement:

Read More

Flexible Brotli Compression Library For Your Windows Delphi/C++ Builder VCL And FMX Apps

Most of Delphi and C++ Builder developers utilize preinstalled components and libraries to compress and decompress files. For instance, the System.Zlib which supports gzip and deflate, the System.Zip is also helpful to handle .zip archive files. Moreover, Indy’s TIdCompressorZLib which is based on Zlib.  But that is not it. There are more different libraries based on different compression algorithms and more modern techniques, for instance, the Brotli – Brotli is similar in speed with deflate but offers more impenetrable compression. Brotli is open-sourced under the MIT License by Google. Brotli compressed files have .br extension. To connect your Delphi or C++ Builder VCL and FMX application with the Brotli library we can rely on Brotli Compress library from WINSOFT which offers to use the Brotli library easily. Brotli itself is free to use and distribute, but the Brotli Compress by WINSOFT is a commercial library and if you would like to use that library you should get a license! Uses Brotli library Supports Windows 32 and Windows 64 Available for Delphi/C++ Builder 6 – 10.4 After downloading the Brotli from WINSOFT you should configure the library into your RAD Studio. You can follow the tutorial here that shows the steps to configure without errors. Since the Brotli itself is a whole compression library your application should have brotlilib.dll – Dynamic-link library. You will get those files within the Brotli Compressor by WINSOFT in a Library Folder. Brotli Compressor Library has two main classes: TBrotliEncoder  TBrotliDecoder As you can observe the TBrotliEncoder encodes and TBrotliDecoder decodes the files with the given parameters. Furthermore, the OnProgress event provides the decompression and compression progress info. Additionally, you can set encoding quality with the Quality property. Here is the Brotli library demonstration video that shows the demo application in action.  These are demo projects’ UI: DEMO UI This is how you can encode with Brotli: InputStream := TFileStream.Create(EditFileName.Text, 0); try OutputStream := TFileStream.Create(ChangeFileExt(EditFileName.Text, ‘.br’), fmCreate); try with TBrotliEncoder.Create do try if RadioButtonGeneric.IsChecked then Mode := emGeneric else if RadioButtonText.IsChecked then Mode := emText else Mode := emFont; Quality := Round(TrackBarQuality.Value); OnProgress := Self.OnProgress; Compress(InputStream, OutputStream); finally Free; end; finally OutputStream.Free; end; finally InputStream.Free; end; 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 InputStream := TFileStream.Create(EditFileName.Text, 0);     try       OutputStream := TFileStream.Create(ChangeFileExt(EditFileName.Text, ‘.br’), fmCreate);       try         with TBrotliEncoder.Create do         try           if RadioButtonGeneric.IsChecked then             Mode := emGeneric           else if RadioButtonText.IsChecked then             Mode := emText           else             Mode := emFont;           Quality := Round(TrackBarQuality.Value);           OnProgress := Self.OnProgress;           Compress(InputStream, OutputStream);         finally           Free;         end;       finally         OutputStream.Free;       end;     finally       InputStream.Free;     end; Here is how you can decode with the Brotli: InputStream := TFileStream.Create(EditFileName.Text, 0); try if CheckBoxCheckIntegrity.IsChecked then OutputStream := nil else OutputStream := TFileStream.Create(ChangeFileExt(EditFileName.Text, ‘.uncompressed’), fmCreate); try with TBrotliDecoder.Create do try OnProgress := Self.OnProgress; Decompress(InputStream, OutputStream); finally Free; end; finally OutputStream.Free; end; finally InputStream.Free; end; 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 InputStream := TFileStream.Create(EditFileName.Text, 0);     try       if CheckBoxCheckIntegrity.IsChecked then         OutputStream := nil       else         OutputStream := TFileStream.Create(ChangeFileExt(EditFileName.Text, ‘.uncompressed’), fmCreate);       try         with TBrotliDecoder.Create do         try           OnProgress := Self.OnProgress;           Decompress(InputStream, OutputStream);         finally           Free;         end;       finally         OutputStream.Free;       end;     finally       InputStream.Free;     end; As you can see this is uncomplicated and you just need to implement the file selection […]

Read More

Quickly Share Data Between Datasets Using CloneCursor In This Native Windows Sample For Delphi

The CloneCursor sample shows you how to clone a dataset. To this end, the sample uses the CloneCursor method of the TFDDataSet class. Moreover, the sample uses other methods to determine whether the current record is within a specified range. Location You can find the CloneCursor sample project at: Start | Programs | Embarcadero RAD Studio Sydney | Samples and then navigate to: Object PascalDatabaseFireDACSamplesComp LayerTFDMemTableCloneCursor Subversion Repository: You can find Delphi code samples in GitHub Repositories. Search by name into the samples repositories according to your RAD Studio version. How to Use the Sample Navigate to the location given above and open CDS_CachedUpdates.dproj. Press F9 or choose Run > Run. Click on the Use Connection Definition combo box and select an option. Click on the CloneCursor button to clone the dataset. Modify the Start range (OrderID) and End range (OrderID) labels. Click on the CheckRange button. Files File in Delphi Contains CDS_CachedUpdates.dprojCDS_CachedUpdates.dpr The project itself. fCachedUpdates.pasfCachedUpdates.fmx The main form. Implementation This sample uses three main components: When you run the application, click on the Use Connection Definition combo box and select an option in order to define a connection. When you select an item of the combo box, the Active property of the cdsOrders table is set to True in order to open the dataset and read data from the database. Then, the sample displays a table using a TDBGrid component. Once the TDBGrid is filled, you can interact with the sample. Each of the following buttons implements an OnClick event to do what is described below: When you click on the CloneCursor button, the sample clones the cdsOrders table using the CloneCursor method and sets the Active property of the cdsClone table to True in order to populate the table with the cloned data. When you click on the CheckRange button, the sample uses the Start range (OrderID) and End range (OrderID) labels as the starting and ending values of the SetRange method. Then the sample applies the range to the cdsClone table using the GotoCurrent method. When you click on the CancelRange button, the sample uses the CancelRange to remove the current range. Please refer to the next links for the source code of this Sample: https://github.com/Embarcadero/RADStudio10.4Demos/tree/master/Object%20Pascal/Database/FireDAC/Samples/Comp%20Layer/TFDMemTable/CloneCursor

Read More

Learn About Delphi Continuous Integration With SVN, Jenkins, And DUnitX

In this tutorial, you learn how to configure a Jenkins server to build and run a DUnitX test application using MSBuild, to be triggered by commit to a subversion repository, and to notify by email when the test fails. Brief Introduction to Version Control Version Control allows you to maintain multiple versions (revisions) of your source code on a remote server Version Control assists in the maintenance of source code with multiple authors What is Continuous Integration? Continuous Integration is a team problem. Continuous Integration is all about preventing the main branch from being broken so, your team is not stuck. That’s it. It is not about having all your tests green all the time and the main branch deployable to production at every commit. Continuous Integration is independent of any tool. You can verify manually that the merge of your branch and the main branch works locally. Be sure to watch the whole session to learn all the concepts related to Continuous Integration with Delphi

Read More

Quickly Work With A COMPort On Linux With Delphi Using A WINSOFT library

For you who works with COM Port Applications on linux, this is the most easy and fast way to connect, write and read info. Using  COMPORT for linux you can do it within literally few minutes, you just need to download the library and add it on your project, and this is it. First of all you need to prepare your linux machine to deploy your Console application from a Windows. On this example I’m using a Windows host running VM VirtualBox with Ubuntu. Installing Development Packages To install the development packages on Ubuntu: Right-click your desktop and select Open Terminal. To upgrade the packages you have already installed , type sudo apt update && sudo apt upgrade && sudo apt dist-upgrade in the terminal. Type your user password and press Enter Wait until prompted to agree to the package upgrade operation. Type Y and press Enter Wait until the package upgrade operation is complete. It may take a few minutes to complete. To add the development packages, type sudo apt install joe wget p7zip-full curl openssh-server build-essential zlib1g-dev libcurl4-gnutls-dev libncurses5 in the terminal. Type your user password and press Enter Wait until prompted to agree to the package installation operation. Type Y and press Enter Wait until the pacjage installation operation is complete. It may take a few minutes to complete. Preparing Your Linux Machine To create Linux applications, you need to add a virtual machine PAServer: Find the LinuxPAServer21.0.tar.gz file in the following location: C:Program Files (x86)EmbarcaderoStudio21.0PAServerLinuxPAServer21.0.tar.gz Unpack the LinuxPAServer21.0.tar.gz file. If needed Install the zlib library to your Ubuntu machine with the following command: sudo apt-get install zlib1g-dev Open the current dir on terminal and run it using ./paserver Now that the Linux Machine is ready lets download and use the COMPORT Library. Preparing Your Delphi application Creating a Connection Profile On the Tools > Options > Environment Options > Connection Profile Manager page, click the Add button. The Create a Connection Profile wizard opens On the Profile information page, enter the following: In the Profile name field, enter the needed name. In the Platform field, click the 64-bit Linux platform. Click Next. On the Remote machine information page, enter the following: In the Remote machine field, enter the IP address or Machine name. Click Test Connection to check if the values are valid. Adding the Installed SDK to RAD Studio On the Tools > Options > Environment Options > SDK Manager page, click the Add button. In the Add a New SDK dialog, enter the following: In the Select a platform field, click 64-bit Linux. In the Select a profile to connect, select a created profile from the drop-down list. In the Select an SDK version field, the name of the SDK that you just installed will automatically appear. If you have not installed SDK previously, you can do it on this step. If you have already installed SDK, move on to the next step. Download the package from WINSOFT, unzip it and open the demo application with Delphi, after that just add the library path on the project properties. The entire Tutorial for this process is here (available for Red Hat too).

Read More

Learn To Build A Python GUI For Solving Complex Tasks With Powerful OpenCV Library In A Delphi Windows App

Are you looking for a powerful machine learning library? Try OpenCV library for Python. You can run it with Python for Delphi (P4D). P4D is a free and simple with which you can run Python scripts as well as create new Python modules and types in Delphi. Use Delphi and C++Builder and Python4Delphi to run Python scripts in  Python GUI apps for Windows. First, run Demo1 project for executing Python script in Python for Delphi. Then load script in text field and press Execute button to see the result. Go to GitHub to download Demo1 source. procedure TForm1.Button1Click(Sender: TObject); begin PythonEngine1.ExecStrings( Memo1.Lines ); end; procedure TForm1.Button1Click(Sender: TObject); begin PythonEngine1.ExecStrings( Memo1.Lines ); end; OpenCV is an open-source library for computer vision and machine learning that supports various programming languages including Python. With this library, you can do a lot of difficult operations, such as image processing, video analysis, feature detection, machine learning, computational photography, object detection. K-Nearest Neighbour In this example, we will consider solving the problem of finding nearest neighbors using OpenCV library. First, let’s randomly create 20 red points (family 0) and 20 green points (family 1). Then add 5 blue points. Using function train(), we will train the neural network. Function findNearest() returns k nearest neighbours (in our example k=3) for each blue point. It also calculates the distance to each found neighbor and determines the family of points from which more neighbors are found. import cv2 import numpy as np import matplotlib.pyplot as plt # Feature set containing (x,y) values of 20 training data trainData = np.random.randint(0,100,(20,2)).astype(np.float32) # Labels each one either Red or Green with numbers 0 and 1 responses = np.random.randint(0,2,(20,1)).astype(np.float32) # Take Red points and plot them red = trainData[responses.ravel()==0] plt.scatter(red[:,0],red[:,1],50,’r’,’s’) # Take Green points and plot them green = trainData[responses.ravel()==1] plt.scatter(green[:,0],green[:,1],50,’g’,’^’) # 5 new points newpoints = np.random.randint(0,100,(5,2)).astype(np.float32) plt.scatter(newpoints[:,0],newpoints[:,1],50,’b’,’o’) knn = cv2.ml.KNearest_create() knn.train(trainData,cv2.ml.ROW_SAMPLE,responses) ret, results,neighbours,dist = knn.findNearest(newpoints, 3) print(“result: “, results,”n”) print(“neighbours: “, neighbours,”n”) plt.show() 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 import cv2 import numpy as np import matplotlib.pyplot as plt   # Feature set containing (x,y) values of 20 training data trainData = np.random.randint(0,100,(20,2)).astype(np.float32)   # Labels each one either Red or Green with numbers 0 and 1 responses = np.random.randint(0,2,(20,1)).astype(np.float32)   # Take Red points and plot them red = trainData[responses.ravel()==0] plt.scatter(red[:,0],red[:,1],50,‘r’,‘s’)   # Take Green points and plot them green = trainData[responses.ravel()==1] plt.scatter(green[:,0],green[:,1],50,‘g’,‘^’)   # 5 new points newpoints = np.random.randint(0,100,(5,2)).astype(np.float32) plt.scatter(newpoints[:,0],newpoints[:,1],50,‘b’,‘o’) knn = cv2.ml.KNearest_create() knn.train(trainData,cv2.ml.ROW_SAMPLE,responses) ret, results,neighbours,dist = knn.findNearest(newpoints, 3)   print(“result: “, results,“n”) print(“neighbours: “, neighbours,“n”)   plt.show() Perspective Transformation of an Image To perform perspective transformation with an image use warpPerspective() function. The parameters of this function are the original image, the transformation matrix, and the size of the output image. Use getPerspectiveTransform() function to get the transformation matrix. You need to pass four points of the input image and the corresponding four points of the output image to this function. It is important, that three of the four points should not be on the same straight line. import cv2 import numpy as np import matplotlib.pyplot as plt image_path = “E:faces.JPEG” img = cv2.imread(image_path) pts1 = np.float32([[900,100],[1200,100],[900,400],[1200,400]]) pts2 = np.float32([[0,0],[400,0],[0,400],[400,400]]) M = cv2.getPerspectiveTransform(pts1,pts2) dst = […]

Read More