-
Content Count
267 -
Joined
-
Last visited
-
Days Won
2
Everything posted by Jacek Laskowski
-
Vote for SAST support for Delphi in GitLab
Jacek Laskowski replied to Darian Miller's topic in Tips / Blogs / Tutorials / Videos
exactly! -
Vote for SAST support for Delphi in GitLab
Jacek Laskowski replied to Darian Miller's topic in Tips / Blogs / Tutorials / Videos
What is SAST? -
Firebird 3.0.6 - embedded. Change the disk to caching the first time you start program
Jacek Laskowski replied to Stano's topic in Databases
Please ask here: https://groups.google.com/g/firebird-support -
How make event be called with an inherited class?
Jacek Laskowski replied to Magno's topic in Algorithms, Data Structures and Class Design
NetHTTPClient has one huge advantage... When working with SSL/TLS it uses the system api and you don't have to fight with openssl, certificates etc. -
How make event be called with an inherited class?
Jacek Laskowski replied to Magno's topic in Algorithms, Data Structures and Class Design
In your class constructor, you should assign these events, something like: constructor TmyNetHTTPClient.Create() begin inherited Create; OnReceiveData := ReceiveData; OnRequestComplewted := RequestCompleted; end; -
Problems changing database with pooled connection
Jacek Laskowski replied to Mark Williams's topic in Databases
Try to use OutputDebugString() function from WinAPI and this tool for viewing output: https://docs.microsoft.com/en-us/sysinternals/downloads/debugview -
Problems changing database with pooled connection
Jacek Laskowski replied to Mark Williams's topic in Databases
Try debugging the difference in the firedac code, just before the error, how the manager's state differs? -
What exactly are PoolCleanupTimeout and PoolExpireTimeout in FireDAC connection definition params? Documentation not explain these parameters. @Dmitry Arefiev ?
-
Problems changing database with pooled connection
Jacek Laskowski replied to Mark Williams's topic in Databases
@Dmitry Arefiev Dmitry, please explain what you mean? -
Local string variable value is not assigned for 2nd and following calls
Jacek Laskowski replied to ertank's topic in RTL and Delphi Object Pascal
I guess inside the uUtils.Http.PostIndy() method, the Request parameter is somehow casted and associated with a buffer/indicator, which is later cleaned up by another part of the code (maybe thread?) -
livebindings without livebindings designer , code only
Jacek Laskowski replied to FranzB's topic in Databases
I don't know the answer to the question, but it may be useful: https://github.com/malcolmgroves/FluentLiveBindings -
Records, Generics and RTTI meets FireDAC
Jacek Laskowski replied to Lars Fosdal's topic in Tips / Blogs / Tutorials / Videos
@Lars Fosdal Ok, ok, I just wanted to expand the topic: FireDAC, RTTI and generics 😉 -
Records, Generics and RTTI meets FireDAC
Jacek Laskowski replied to Lars Fosdal's topic in Tips / Blogs / Tutorials / Videos
Look at my idea, without records, but with interfaces, SQL is generated automatically, moreover UPDATE and INSERT works 😉 https://github.com/jaclas/transfORM -
I need to validate an XML file that has references to XSD files, I use TXMLDocument for that. But during this validation, which is done in a thread, the MSXML bni library displays me a window asking for permission, it looks like this: The message in english is: "This page is accessing information that is not under its control. This poses a security risk. Do you want to continue?" Is it possible to confirm this question from the code level or disable the message? And I know it is hidden in the internet options of the system, but I do not have access to clients' computers and I have to bypass it in the code.
-
XMLDocument and popup windows
Jacek Laskowski replied to Jacek Laskowski's topic in RTL and Delphi Object Pascal
The reason is in the internet settings: https://kb.froglogic.com/squish/web/troubleshoot/page-accessing-information-not-under-its-control/ When I change "Access data sources across domains" to Enable problem disappear. But how to change this or prevent from code level? -
XMLDocument and popup windows
Jacek Laskowski replied to Jacek Laskowski's topic in RTL and Delphi Object Pascal
Code: var lXML: IXMLDocument; begin lXML := TXMLDocument.Create(nil); lXML.ParseOptions := [poResolveExternals, poValidateOnParse]; lXML.LoadFromFile('test_.xml'); and test file for load: <?xml version="1.0" encoding="UTF-8"?> <tns:JPK xmlns:tns="http://jpk.mf.gov.pl/wzor/2017/11/13/1113/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:etd="http://crd.gov.pl/xml/schematy/dziedzinowe/mf/2016/01/25/eD/DefinicjeTypy/" xsi:schemaLocation="http://jpk.mf.gov.pl/wzor/2017/11/13/1113/ http://www.mf.gov.pl/documents/764034/6145258/Schemat_JPK_VAT%283%29_v1-1.xsd"> <tns:Naglowek> <tns:KodFormularza kodSystemowy="JPK_VAT (3)" wersjaSchemy="1-1">JPK_VAT</tns:KodFormularza> <tns:WariantFormularza>3</tns:WariantFormularza> <tns:CelZlozenia>0</tns:CelZlozenia> <tns:DataWytworzeniaJPK>2020-07-23T12:49:30.000Z</tns:DataWytworzeniaJPK> <tns:DataOd>2020-06-01</tns:DataOd> <tns:DataDo>2020-06-30</tns:DataDo> <tns:NazwaSystemu>test</tns:NazwaSystemu> </tns:Naglowek> </tns:JPK> -
Unable to rename pas file to versioned ~1~ file - strange issue
Jacek Laskowski posted a topic in Delphi IDE and APIs
I have been using VMware Workstation for years, the host system is Windows 10, the virtual machine works under Windows 7, where I have Delphi 10.3 installed. It always worked well. External project and library files are on a disk shared by VMware mechanism called "Shared folders", in the virtual machine they are available as a network disk, which I map to the letter D:\ A month ago I built a new computer on Ryzen, and installed Ubuntu as the host system. Under Ubuntu I installed VMware Workstation and moved a virtual machine containing Delphi from the old computer. I've converted the disk file system with projects and libraries from NTFS to Ext4 and it's also shared by "Shared folders". Everything was ok until it turned out that I couldn't make a change in Spring.inc file from Delphi level. But for example, by notepad the change was successful. I couldn't find an explanation, so I worked until now. Since yesterday I have the same problem with one of the files in my project. Trying to save (ctrl+s) changes in *.pas file ends with an error message: "Unable to rename ...\path\filename.pas to ...\path]\__history\filename.pas.~20~" and the file does not save, only a copy of it with the extension *.$$$ next to the source file is created, all this can be seen in the screenshot: It seems that the internal (Delphi) file versioning mechanism has some problem with this file. But I've been editing other files from the same project for a month now and I haven't had such problems (except for Spring.inc - outside the project). This is not a problem of permissions in the Ext4 file system, because I checked and the permissions are identical with all the project files. I also checked the file edition with notepad and rename with move with shell command "mv" - also without any problem. What can be the cause and what else can I check? -
Unable to rename pas file to versioned ~1~ file - strange issue
Jacek Laskowski replied to Jacek Laskowski's topic in Delphi IDE and APIs
I also use relative paths in the project, but in the end each path is absolute. And probably others, like me, have some common folder with external libraries (in my case d:\work\libraries) which as a whole could be excluded and the problem would disappear. Fortunately, git can be configured so that "on the fly" it changes the end of line characters to the ones we prefer and does not treat this as changed sources, so everything works fine. Thanks to this Spring4D has a CRLF at the ends of the line. -
Unable to rename pas file to versioned ~1~ file - strange issue
Jacek Laskowski replied to Jacek Laskowski's topic in Delphi IDE and APIs
Great @Uwe Raabe! In that case I will add one more thing I came across. Before I was touched by the problem "Unable rename ..." I was struggling with strange behavior of the environment while debugging the code. When I pressed the F7 key while standing cursor on the line with a Spring method call, IDE went to Spring4D sources and then the weird thing happened. The cursor was standing on the first line of the unit (not in the method) and the Spring file was marked by the IDE as modified (asterisk next to the name). I was looking for a long time for the reason before I came across that Project Magician has end of line correction option set and at the same time my git configuration under Linux didn't force the end as CRLF but Spring files had LF at the end of line! In such a situation Magician was changing line ends and debugger was stupid. And I was with him Maybe it is worth to add an exclusion path for this Magician function? -
Unable to rename pas file to versioned ~1~ file - strange issue
Jacek Laskowski replied to Jacek Laskowski's topic in Delphi IDE and APIs
@Uwe Raabe Perhaps it would be worth adding a function to the Project Magician that will scan the project files and their paths and check if the actual paths on the disk are the same case sensitive? I know it's not very useful for most programmers, but the workload is small, and such a feature can sometimes save a lot of time. Besides, for programmers who like to keep their projects in order (and that's what Magician is for) even if everything works, it may be important to have the correct paths. -
Unable to rename pas file to versioned ~1~ file - strange issue
Jacek Laskowski replied to Jacek Laskowski's topic in Delphi IDE and APIs
After a few hours of fighting I discovered the cause of the problems... Maybe somebody will meet with it one day and I'll give you a solution. As I wrote I migrated from Windows to Ubuntu and converted the disk from NTFS to Ext4. As you know Linux systems are case sensitive and so is Ext4. Although the files had the correct name, it turned out that in the dpr and dproj files the paths to some files sometimes had the name "\Services\" and sometimes "\services\" and that was the reason. After correcting the contents of dpr and dproj to the correct directory names, all errors disappeared. -
Unable to rename pas file to versioned ~1~ file - strange issue
Jacek Laskowski replied to Jacek Laskowski's topic in Delphi IDE and APIs
I've worked with Shared Folders for a decade and never had such a problem, no problem at all. Only now (after migrate do Ubuntu and Ext4) the problems have come to light, but the problem is clearly in Delphi and not in file locks, because as I wrote other tools they can modify and move these files without any problem. -
I create an array of arrays, then assign the data in whole rows (array). Example code: program Project1; {$APPTYPE CONSOLE} {$R *.res} uses System.SysUtils; var lValues: array of TArray<Variant>; procedure TestAddRowData(); var lRow : TArray<Variant>; begin SetLength(lRow, 3); SetLength(lValues, 3); lRow[0] := 'one'; lRow[1] := 1; lRow[2] := '1one'; lValues[0] := lRow; lRow[0] := 'two'; lRow[1] := 2; lRow[2] := '2two'; lValues[1] := lRow; lRow[0] := 'three'; lRow[1] := 3; lRow[2] := '3three'; lValues[2] := lRow; end; begin TestAddRowData(); Writeln(lValues[0, 0]); Writeln(lValues[0, 1]); Writeln(lValues[0, 2]); Writeln(lValues[1, 0]); Writeln(lValues[1, 1]); Writeln(lValues[1, 2]); Writeln(lValues[2, 0]); Writeln(lValues[2, 1]); Writeln(lValues[2, 2]); Readln; end. Results: three 3 3three three 3 3three three 3 3three I expected to get all the data according to their addition... Isn't there a Copy on Write rule for arrays?
-
@Uwe Raabe I got it! I managed to repeat the effect a few times, I recorded the screencast: https://www.youtube.com/watch?v=PmsQHrr3muU&feature=youtu.be
-
Extension's cool and needed. Thanks for that! After a minute of use, I see one flaw... if I have a lot of code cards open, the window with ListBox does not scroll and pressing the Tab key hides the cursor outside the window after a while.