Noutați

Learn How To Easily Work With BLOB Streams Internally And Externally In This Delphi Windows App

The BlobStreams sample shows you how to use the BLOB streaming techniques of FireDAC. To this end, this sample implements both the external streaming and the internal streaming. Location You can find the BlobStreams sample project at: Start | Programs | Embarcadero RAD Studio Sydney | Samples and then navigate to: Object PascalDatabaseFireDACSamplesComp LayerTFDQueryBlobStreams 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 BlobStreams.dproj. Press F9 or choose Run > Run. Files File in Delphi Contains BlobStreams.dprojBlobStreams.dpr The project itself. fBlobStr.pasfBlobStr.fmx The main form. Implementation Before running the sample, the main components are configured at design time using the Object Inspector as follows: Two TFDQuery objects named qSelect and qInsert. These components are used to implement the datasets capable of executing SQL queries. The following setup is needed: Configure the Connection property of both objects to specify the FireDAC connection object that is used to connect to a DBMS. In both cases it is set to FDConnection1. Set the SQL property for both objects. It specifies the SQL statement to execute for the query. The SQL property of qSelect is set to select * from {id FDQA_Blob}. The SQL property of qSelect is set to insert into {id FDQA_Blob} (blobdata) values (:blobdata). Configure the qInsert.Param[0]: The Name property is se to BLOBDATA The DataType property is set to one of the BLOB data types. In this sample ftBlob. The ParamType property is set to ptInput. It means that the stream will be read and written to a database BLOB value. The StreamMode property is set to smOpenRead. This is the default value. It means that the stream is used to read the database BLOB value. A TDataSource object named DataSource1. This component provides an interface between a dataset component and data-aware controls on a form. In this sample, it is used to provide communication between the dataset and a TDBMemo object named DBMemo1. DBMemo1 is used to display the blobdata field of the dataset. To this end, the following setup is needed: The DataSet property of DataSource is set to qSelect. The DataSource property of DBMemo1 to DataSource1. The DataField property of DBMemo1 to blobdata. Once the main components are configured at design time you can run the application and interact with the sample in run time. To this end, the sample offers three buttons: Prepare data. This button creates an OnClick event that uses the TFileStream.Create method to instantiate the file stream in order to write a string into the file. Insert (external stream). This button creates an OnClick event that implements an external streaming. An external stream is provided by the application to FireDAC (external to FireDAC). Then, FireDAC reads this stream. See the code below: Insert (internal stream). This button creates an OnClick event that implements an internal streaming. An internal stream is provided by FireDAC to the application (internal to FireDAC). Then, the application reads this stream. To this end, the sample does the following: Use the StarTransaction method to start a mandatory transaction. Set the parameter DataType to ftStream. Set the parameter StreamMode to smOpenWrite in order to write the database BLOB value. Use the ExecSQL method to execute the SQL command. This will return the internal stream reference. Write the internal stream reference. Call the CloseStreams method to flush database API buffers and close internal streams. Use the Commint method to finish the transaction. For more information about this sample, please refer to the link below:http://docwiki.embarcadero.com/CodeExamples/Sydney/en/FireDAC.TFDQuery.BlobStreams_Sample Check out the full source code for the BLOB streams sample app in Windows for Delphi on GitHub.

Read More

Powerful CD/DVD/Blu-ray Burner Component Suite For Delphi Firemonkey By Winsoft

Introduction Delphi Builder components for preparing and burning images to CD, DVD, and Blu-ray optical storage media. Uses standard Windows Image Mastering API 2. 2. Components in the Demo and what they do The Demo contains some labels with text, as well as TEdits for the directory paths and file names. The ‘Create Image’ button calls the button onClick event, which executes the Write process. In the next code you can see the execution in details. procedure TFormMain.ButtonCreateImageClick(Sender: TObject); begin Cancel := False; ProgressBar.Value := 0; UpdateControls(True); try FDiscImage.VolumeName := EditVolumeName.Text; FDiscImage.SourceTree := EditSourceTree.Text; FDiscImage.Write(EditImageName.Text); finally LabelStatus.Text := ”; UpdateControls(False); end; end; procedure TFormMain.ButtonCreateImageClick(Sender: TObject); begin   Cancel := False;   ProgressBar.Value := 0;   UpdateControls(True);   try     FDiscImage.VolumeName := EditVolumeName.Text;     FDiscImage.SourceTree := EditSourceTree.Text;     FDiscImage.Write(EditImageName.Text);   finally     LabelStatus.Text := ”;     UpdateControls(False);   end; end; The Main component that does the Image Writing is the TFDiscImage component by Winsoft. Depending on the TRadioGroup choice, the user chooses between two file systems – ISO 9660 and UDF. When one of the files systems is marked, an onChange event is fired with code: procedure TFormMain.RadioButtonChange(Sender: TObject); begin if RadioButtonIso9660.IsChecked then FDiscImage.FileSystems := [fsISO9660] else FDiscImage.FileSystems := [fsUDF]; end; procedure TFormMain.RadioButtonChange(Sender: TObject); begin   if RadioButtonIso9660.IsChecked then     FDiscImage.FileSystems := [fsISO9660]   else     FDiscImage.FileSystems := [fsUDF]; end; To get better vision on what these components do, check the video below: If you want to download this Component suite, click on the next link: https://winsoft.sk/fburncs.htm

Read More

Quickly Consume The Firebase REST API With The Open Source Firebase4Delphi Library

procedure TFirebaseDatabase.SetBaseURI(const ABaseURI: string); begin   FBaseURI := ABaseURI; end; procedure TFirebaseDatabase.SetToken(const AToken: string); begin   FToken := AToken; end;   function TFirebaseDatabase.Get(const AParams: array of string;   AQueryParams: TDictionary<string, string> = nil): IFirebaseResponse; var   ARequest: IFirebaseRequest; begin   ARequest := TFirebaseRequest.Create(BaseURI, Token);   Result := ARequest.SendData(AParams, TFirebaseCommand.fcGet, nil,     AQueryParams); end;   function TFirebaseDatabase.Post(const AParams: array of string;   AData: TJSONValue = nil; AQueryParams: TDictionary<string, string> = nil;   ADataOwner: boolean = true): IFirebaseResponse; var   ARequest: IFirebaseRequest; begin   ARequest := TFirebaseRequest.Create(BaseURI, Token);   Result := ARequest.SendData(AParams, TFirebaseCommand.fcPost, AData,     AQueryParams, ADataOwner); end; function TFirebaseDatabase.Put(const AParams: array of string;   AData: TJSONValue = nil; AQueryParams: TDictionary<string, string> = nil;   ADataOwner: boolean = true): IFirebaseResponse; var   ARequest: IFirebaseRequest; begin   ARequest := TFirebaseRequest.Create(BaseURI, Token);   Result := ARequest.SendData(AParams, TFirebaseCommand.fcPut, AData,     AQueryParams, ADataOwner); end; function TFirebaseDatabase.Patch(const AParams: array of string;   AData: TJSONValue = nil; AQueryParams: TDictionary<string, string> = nil;   ADataOwner: boolean = true): IFirebaseResponse; var   ARequest: IFirebaseRequest; begin   ARequest := TFirebaseRequest.Create(BaseURI, Token);   Result := ARequest.SendData(AParams, TFirebaseCommand.fcPatch, AData,     AQueryParams, ADataOwner); end; function TFirebaseDatabase.Delete(const AParams: array of string;   AQueryParams: TDictionary<string, string> = nil): IFirebaseResponse; var   ARequest: IFirebaseRequest; begin   ARequest := TFirebaseRequest.Create(BaseURI, Token);   Result := ARequest.SendData(AParams, TFirebaseCommand.fcRemove, nil,     AQueryParams); end;

Read More

Free Cross-Platform Order Entry Point Of Sale App Template For Delphi

This industry-ready Order Entry Application template for busy small business owners. This project is to build a general template for the regular structure of the order entry application.       Specifics • Specifically we are working on something similar to general existing order entry applications. • The goal is to have a reusable template that a user can download and add their content to and create a professional-looking application. • The template will be delivered in a sample application that shows the power and flexibility of the template. And that is documented enough so that a user will understand how to customize it for their use. On the following slides, you will find screenshots and annotations Order Entry – tabs, rooms, and menu management Time Clock – employee clock in/out Manager – main manager settings Exit – exit from the application In a room view, it is possible to assign a table to a user and to start a new tab It is possible to move tables on the screen according to their real location It is possible to see the number of seats for each table On this screen, the user can pay for the order in different ways and leave tips You can download the Order Entry App from GetIt Package Manager Also, be sure to check out other amazing sample application here!

Read More

Submit Your Own Amazing Projects To The Embarcadero Showcase

The Embarcadero Showcase features a number of different amazing software solutions created by our customers. We are adding new showcases all the time. The purpose of the showcase is to highlight the successes our customers are enjoying by using our tools and solutions such as RAD Studio, Delphi, C++Builder, InterBase, and RAD Server. You can submit your own showcase and we might feature it if all of the necessary media is available. Submitting a new showcase is easy. Simply visit the Showcase Submission Form and enter the required information and media. A short app description describing how and why the software solution uses Delphi is optimal. In order to be evaluated for a Showcase the submission needs to include access to 1080p resolution screenshots or a public download (like a free trial) so that high resolution screenshots can be created. Additionally, they need to be taken with the latest version of Windows. For mobile apps please provide the App Store URLs in the description and any extra screenshots you may have. You can also submit a YouTube URL featuring your software solution and it may be included in the Showcase. Here are a few existing Showcases you can check out below. Award Winning Native Windows SFTP Client Built With C++Builder And Downloaded 143+ Million Times WinSCP is a popular award winning native SFTP client, FTP client, and file manager for Microsoft Windows. It has been download over 143 million times and is available in many languages. WinSCP is built with a number of programming languages but C++Builder is the main tool powering it’s graphical user interface. It is a great example of leveraging C++Builder’s fast UI development… Rise of Legions Multiplayer RPG Windows Game Built In Delphi Broken Games is a small, ambitious independent game development company based in Berlin, Germany. Their flagship game, Rise of Legions, is a multiplayer RPG available for the Windows platform. Co-founders Tobias and Martin focus on bringing people together through game… Comprehensive Music Theory and Ear Training App Built In Delphi With almost 3,000 lessons created by music teachers for beginners to professional musicians playing any instrument, EarMaster is a comprehensive, consumer-grade app with extraordinary functionality that uses a variety of different technologies. Despite the app’s technologically advanced backend, the EarMaster team worked hard make it as simple and intuitive as possible to use. EarMaster features… Ready to submit your own Showcase? Head over to the Showcase Submission Form and let us know about your amazing project!

Read More

Rethinking Application Security in a Post-Pandemic World

Published December 11, 2020 WRITTEN BY THE KIUWAN TEAMExperienced developers, cyber-security experts, ALM consultants, DevOps gurus and some other dangerous species. Without a doubt, the COVID-19 pandemic has had a massive impact on the financial services landscape. Not only did businesses have to tweak their entire operations under safety regulations, but they also had to contend with a growing list of cybersecurity threat-actors, given the rapid adoption and usage of online apps.  According to data from App Annie, there was a 20% increase in time spent on mobile apps in the first quarter of 2020. At the same time, consumers embraced online banking, social media, and online shopping like never before. All of these created more cybersecurity risks. To avoid exploitation and compromise of sensitive data, information, technology, and security leaders need to view app security through a new pair of lenses. This should include a defense plan that considers the remote workforce, significantly reduced IT budgets, and limited access to AppSec talent.  Read on as we explore a dynamic plan to boost your cyber protection in a post-pandemic world.  1. Data breaches Mobile banking malware risk has worsened, especially now that bad actors leverage uncertainty and fear surrounding the pandemic. Recent research from Malwarebytes shows that mobile banking malware has spiked in recent months, infiltrating weakened home networks and mobile devices to access highly-sensitive corporate applications. These malware solutions are only focused on one job: stealing client information. What CIOs and CISOs can do: The best place to start is identifying and remediating the security vulnerabilities in your application before it’s too late.  Plan to conduct application security vulnerability scanning with a tool like Kiuwan. Remember, a data breach could set back the company some millions of dollars, which is why you should never leave your mobile app security to chance. 2. Identity theft Credential stealing has spread around the US almost as effectively as the COVID-19 pandemic. Since the bulk of the workforce has switched to working remotely, black-hat cyber criminals’ attacks have grown exponentially.  Credential theft is the leading cause of fraud in financial services, and with credential-stealing malware such as EventBolt19 and Cerberus being increasingly widespread in 2020, the risk has never been greater. What CIOs and CISOs can do: The post-pandemic world presents a new opportunity for CIOs to protect employees from the claws of identity theft. The best defense should focus on building authentication solutions that focus on ‘who you are’ rather than ‘something you have’ (passwords).  That said, consider installing next-level biometric solutions such as thumbprint/fingerprint, iris, voice, retina, and facial recognition technologies. With biometrics, cybercriminals’ attempt at impersonating anyone of your team members just got a lot more difficult than trying to break into passwords or PINs. 3. Ransomware attacks  Even after the pandemic, ransomware will remain one of the most significant cyber threats facing financial institutions. Statistics show that financial services will still be the second most targeted sector for ransomware attacks, only trailing healthcare. Successful ransomware attacks reveal not only endpoint vulnerabilities but also act as a starting point for myriad other problems. For example, a breach could lead to huge monetary loss. But most importantly, businesses that don’t proactively protect against attacks will likely suffer from damaged loyalty and reputational risk. Yet this is only the tip of the iceberg. Other repercussions of ransomware attacks are weakened employee morale and the need to dig deeper into […]

Read More

Ultra-Fast Way To Wrap Delphi Objects To Python Objects With Python4Delphi Sample App

import spam   class MyPoint(spam.Point):   def Foo(Self, v):     Self.OffsetBy(v, v)   p = spam.Point(2, 5) print (p, type(p)) p.OffsetBy( 3, 3 ) print (p.x, p.y) print (“Name =”, p.Name) p.Name = ‘Hello world!’ print (“Name =”, p.Name)   p = spam.Point(2, 5) print (p, type(p)) p.OffsetBy( 3, 3 ) print (p.x, p.y)   # create a subtype instance p = MyPoint(2, 5) print (p, type(p)) p.OffsetBy( 3, 3 ) print (p.x, p.y) p.Foo( 4 ) print (p.x, p.y) print (dir(spam)) print (spam.Point) print (“p = “, p, ”  –> “,) if type(p) is spam.Point:   print (“p is a Point”) else:   print (“p is not a point”) p = 2 print (“p = “, p, ”  –> “,) if type(p) is spam.Point:   print (“p is a Point”) else:   print (“p is not a point”)   # You can raise errors from a Python script too ! print (“——————————————————————“) print (“Errors in a Python script”) try:   raise spam.EBadPoint(“this is a test !”) except:   pass   try:   err = spam.EBadPoint()   err.a = 1   err.b = 2   err.c = 3   raise err except spam.PointError as what: # this shows that you can intercept a parent class   print (“Caught an error derived from PointError”)   print (“Error class = “, what.__class__, ”     a =”, what.a, ”   b =”, what.b, ”   c =”, what.c)   if p == spam.Point(2, 5):   print (“Equal”) else:   print (“Not equal”)

Read More

Learn How To Use C++ Raw String Literals For Windows Apps In C++ Builder

There are escape characters in C++ like “n” or “t”. When we try to print the escape characters, it will not display on the output. To show the escape characters on the output screen we use a raw string literal by using R”(String with escape characters)”. After using R in the front of the string the escape character will be displayed on the output. From C++ 11, basically a raw string literal is a string in which the escape characters (like n t or ” ) of C++ are not processed. A raw string literal starts with R”( and ends in )”, let’s see an in an example the difference between a normal string and a raw string in C++: #include #include using namespace std; int main() { string normal_str=”First line.nSecond line.nEnd of message.n”; string raw_str=R”(First line.nSecond line.nEnd of message.n)”; cout #include #include    using namespace std; int main() {     string normal_str=“First line.nSecond line.nEnd of message.n”;     string raw_str=R“(First line.nSecond line.nEnd of message.n)”;     cout<<normal_str<<endl;     cout<<raw_str<<endl;     return(0); } The variable normal_str will be processed at compilation time so you will see three lines of text and an empty line. In the case of the variable raw_str which is a raw string literal, the compiler will not process the escape characters, so you will see a single line of text with a content identical with what you have in the C++ source code. A first application of the concept of a raw string is in simplifying the syntax of the regular expressions. Take as an example the regular expression used in the regex tutorial for checking if the user input is an integer number. Without raw strings this is how the code should look: regex integer(“(+|-)?[[:digit:]]+”); regex integer(“(+|-)?[[:digit:]]+”); Using a raw string we can simplify the above piece of code, we can get rid of the escaping characters: regex integer(R”((+|-)?[[:digit:]]+)”); regex integer(R“((+|-)?[[:digit:]]+)”); Head over and get more information about C++ raw string literals in the Embarcadero DocWiki.

Read More

Easily Build Master-Detail Relationships Between Datasets In Delphi Windows Apps

The sample demonstrates how to use the TFDQuery component in order to set up master-detail relationships between datasets. It uses the master-detail relationship to automatically filter a detail dataset based on a current master dataset record. In this sample, the master dataset has “Order” records, and the detail dataset shows only lines for the current order. Moreover, you can modify in run time the Cache property of TFDFetchOptions to control the data allocation in cache memory. Location You can find the MasterDetail sample project at: Start | Programs | Embarcadero RAD Studio Sydney | Samples and then navigate to: Object PascalDatabaseFireDACSamplesComp LayerTFDQueryMasterDetail 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 Qry_MasterDetail.dproj. Press F9 or choose Run > Run. Files File in Delphi Contains Qry_MasterDetail.dprojQry_MasterDetail.dpr The project itself. fQueryMasterDetail.pasfQueryMasterDetail.fmx The main form. Implementation To set up a master-detail relationship, this sample uses the Object Inspector to configure the following components at design time as follows: Two TFDQuery objects named qryOrders and qryOrderDetails. These components are used to implement a dataset capable of executing SQL queries. The following setup is needed: Configure the Connection property of both components to specify the FireDAC connection object that is used to connect to a DBMS. In order to set up a master-detail relationship, the SQL properties of both components have to be set up using the Object Inspector at design time as follows: The SQL property of qryOrders is set to select * from {id Orders} in order to select “Order” records. The SQL property of qryOrderDetails is set to select * from {id Order Details} where OrderID = :OrderID in order to select “Order Details” records. Finally, both objects are linked in a master-detail relationship, where qryOrders is the master dataset and qryOrderDetails is the detail dataset. To this end, you have to set up the following properties of qryOrderDetails: MasterFields is set to ORDERID. IndexFieldNames is set to ORDERID. MasterSource is set to dsOrders. Two TDataSource objects named dsOrders and dsOrdDetails. These components provide an interface between a dataset component and data-aware controls on a form. In this sample, it is used to provide communication between the datasets and the grids where the datasets are displayed. To this end, the following properties are set up at design time using the Object Inspector: The DataSet property of dsOrders is set to qryOrders and the DataSource property of DBGrid2 is set to dsOrder. The DataSet property of dsOrderDetails is set to qryOrderDetails and the DataSource property of DBGrid1 is set to dsOrderDetails. The Cache details check box includes fiDetails into the FetchOptions.Cache property of qryOrderDetails if the check box is checked. It means that if it is checked, the associated detail record will not be discarded from the memory after changing a master dataset record. The Refresh master button uses the Refresh method to re-fetch the master data from the database. The Refresh details button uses the Refresh method to re-fetch the detail data from the database. Please refer to the link below for more information about the sample: http://docwiki.embarcadero.com/CodeExamples/Sydney/en/FireDAC.TFDQuery.MasterDetail_Sample Head over and check out the full source code for the master detail Windows sample app on GitHub.

Read More

Impressive Native Windows PHP Code Editor And IDE Is Built In Delphi

Rapid PHP is a lightweight native code editor and IDE for PHP on Windows and it is built in Delphi. According to their site, “Rapid PHP editor is a faster and more powerful PHP code editor for Windows combining features of a fully-packed PHP IDE with the speed of the Notepad. Rapid PHP is the most complete all-in-one software for coding PHP, HTML, CSS, JavaScript and other web development languages with tools for debugging, validating, reusing, navigating and formatting your code.” It offers 6 different localization languages for the interface and a truly massive amount of features. In addition to PHP it has extensive Javascript and CSS capabilities to create a rounded development platform for building web apps in PHP. Notable productivity features include things like “Edit/save directly on FTP/SFTP/FTPS server or quickly publish all changed files”, “SVN and Git integration”, and “PHP debugger (xDebug)”. Website https://www.rapidphpeditor.com/ 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 Webinar: Massively Boost C++Builder Compile Speed Up To 50x with TwineCompile

Read More