-
Content Count
3524 -
Joined
-
Last visited
-
Days Won
116
Everything posted by Lars Fosdal
-
@JonRobertson I have no performance comparisons between the ODBC driver and the OLEDB driver, so I'll have to take that at face value. Devart did a a more nuanced comparison between the two. The OLEDB driver was deprecated by MS at one point, then undeprecated in 2018. Not sure why EMBT chose not to create a wrapper for it, but resources may have been an issue? As for ODBC vs Native - In case there are multiple drivers installed, I wrote the following simple code to pick my preferred driver, but these days we stick with the ODBC driver(s) due to the Native Client being too old for some of our databases. class function TPSDFireDatabasePoolMSSQL.FindBestDriver(const Link: TFDPhysMSSQLDriverLink): String; const // Constants copied from implementation section of FireDAC.Phys.MSSQL C_SQL_SERVER = 'SQL Server'; // DO NOT TRANSLATE C_2019_ODBC = 'ODBC DRIVER 19 FOR SQL SERVER'; // DO NOT TRANSLATE C_2018_ODBC = 'ODBC DRIVER 18 FOR SQL SERVER'; // DO NOT TRANSLATE C_2017_ODBC = 'ODBC DRIVER 17 FOR SQL SERVER'; // DO NOT TRANSLATE C_2016_ODBC = 'ODBC DRIVER 13 FOR SQL SERVER'; // DO NOT TRANSLATE C_2012_ODBC = 'ODBC DRIVER 11 FOR SQL SERVER'; // DO NOT TRANSLATE {$IFDEF POSIX} C_FreeTDS = 'FreeTDS'; {$ENDIF} {$IFDEF MSWINDOWS} C_2012_NC = 'SQL SERVER NATIVE CLIENT 11.0'; // DO NOT TRANSLATE {$ENDIF} var DriverList : TStringList; WantedList : TArray<String>; Driver: string; begin Result := ''; // Blank = Default WantedList := {$IFDEF MSWINDOWS} {$IFDEF SQLNative} [C_2012_NC, C_2017_ODBC, C_2016_ODBC, C_2012_ODBC] {$ELSE} [C_2018_ODBC, C_2017_ODBC, C_2016_ODBC, C_2012_NC, C_2012_ODBC] {$ENDIF} {$ENDIF} {$IFDEF POSIX} [C_2018_ODBC, C_2017_ODBC, C_2016_ODBC, C_2012_ODBC, C_FreeTDS] {$ENDIF}; DriverList := TStringList.Create; try Link.GetDrivers(DriverList); DebugOut('Available SQL drivers'); // DO NOT TRANSLATE for Driver in DriverList do DebugOut(' "' + Driver + '"'); for var Wanted in WantedList do for Driver in DriverList do begin if CompareText(Wanted , Driver) = 0 then begin DebugOut('Selected driver: "' + Driver + '"'); // DO NOT TRANSLATE BestDriver := Driver; Exit(Driver); end; end; finally DriverList.Free; end; end;
-
@Stephanus Kusuma ADO has been succeeded by FireDAC. Although it has not been deprecated like BDE, ADO is quite old and you are more likely to get answers to questions about FireDAC . FireDAC also has a lot better performance, in my experience.
-
Installing Embarcadero Delphi in Ansible
Lars Fosdal replied to Willem Noorduin's topic in General Help
Unfortunately, it seems that the EULA was left there by intent. https://quality.embarcadero.com/browse/RSP-39577 IMO, it is odd that they couldn't add a command line argument like "-AcceptEULA to get rid of the required interaction. -
We use a font named Code128.ttf to generate bar codes on Windows. Can that font be loaded for on-screen rendering in an FMX app on Android and/or iOS? Does anyone have an example for loading a custom font and rendering text with it in FMX?
-
Is there a newer post than this one? I.e. one that suggests using the forums - I could not find one, so using the QP is recommended. https://blog.marcocantu.com/blog/2015-december-feature-requests-quality-portal.html If you decide to post a feature request, it needs to be clear on the technical benefits of using ARMv8, i.e. describe why ARMv7 doesn't cover the need.
-
@RDP1974 You should post this as a feature request on quality.embarcadero.com.
-
CreateSemaphore/FileLock etc
Lars Fosdal replied to hsvandrew's topic in Algorithms, Data Structures and Class Design
I'd use a log broker service, i.e. have log requests from the different apps go through the broker APIs. -
İs possible same pointer size for Win32/Win64?
Lars Fosdal replied to kosovali's topic in Algorithms, Data Structures and Class Design
Offsets may be helpful if the streamed order is not the same as the desired order, such as for a tree structure. Personally, I'd opt for identities and rebuild the structure after loading the stream. But, since OP doesn't share sufficient info about content and structure, this is all speculation. -
İs possible same pointer size for Win32/Win64?
Lars Fosdal replied to kosovali's topic in Algorithms, Data Structures and Class Design
I think you missed the point of my suggested changes. The point was only to be able to read the 32-bit stream. I think you will need to rewrite the code that loads the data from the old-32 bit structures. I don't see a clean easy way to avoid that, f.x. by using my example record struct to read the old stream, and then move it to a 64-bit version with actual pointers.. You say Element sequence is important - is the order of the loaded double linked list supposed to be different from the streamed order? I have a feeling that your records are more complex than your example, and I certainly don't understand the reason for the untyped pointer. Are the actual records fixed in size or do they vary in size? Are you writing new 32-bit and 64-bit apps, so this is not a transition thing - but a need for a future shared format? In that case, I would rethink the structure and replace the pointers with stream offsets. -
İs possible same pointer size for Win32/Win64?
Lars Fosdal replied to kosovali's topic in Algorithms, Data Structures and Class Design
Does the stream consist only of ptr_rec2 elements? Is it simply a double linked list? Is the element sequence in the stream of importance? Are the pointers relative positions in the stream or are they original memory positions in the old win32 app and discarded/replaced when loading in the receiving app? Do you need to keep it in the same linked list format in the new 64-bit app? Both ptr_rec1 and pointer are 8 bytes in 64-bit - so to read the stream in 64-bit, you would have to replace the pointer types with a 32-bit variable type Fake32bitPtr = UInt32; ptr_rec1=Fake32bitPtr; rec1=record i1:integer; p1:Fake32bitPtr; end; ActualPtr_rec2 = ^ptr_rec2; ptr_rec2=record rec:ptr_rec1; i:integer; p2:Fake32bitPtr; end; If the stream is not incredibly large, you could create a shadow structure that basically is an array of ActualPtr_rec2 and point to the ptr_rec2 elements without caring about the pointers? -
İs possible same pointer size for Win32/Win64?
Lars Fosdal replied to kosovali's topic in Algorithms, Data Structures and Class Design
Why would you stream the pointers? They only have any meaning inside each application as a reference to a memory position. -
Nope. I bought a license, though. Invaluable for sorting out the authentication protocol issues I had.
-
I use reg.ex search/replace and/or macros for that kind of stuff.
-
I didn't realize that VSCode had it. It defaulted to Alt+Click, while I expected Ctrl+Click.
-
Where to put an app in Windows startup and shutdown and sleep mode?
Lars Fosdal replied to JohnLM's topic in General Help
Another thought - would it not be just as convenient to search the Windows Eventlog for the various events for start/logon/logoff/sleep/reboot/shutdown? -
Where to put an app in Windows startup and shutdown and sleep mode?
Lars Fosdal replied to JohnLM's topic in General Help
I was also thinking about a service, but it might be more trouble (rights wise) to get one installed than a simple standalone app. Isn't there messages to respond to that can prevent/postpone the sleep? -
That is a very unusual function for a plain text editor. I don't think I've seen it before.
-
Charles Proxy is also good for sniffing out http/https issues.
-
TMS Advanced String Grid (https://www.tmssoftware.com/site/advgrid.asp) Not cheap, but part of a very powerful package of components (TMS VCL UI Pack). Data can be inserted in the grid, rendered from your memory structure, read from a db, json, excel, etc. We've been using it for many years now, and it is still being maintained and enhanced.
-
You have to expand that first line where the serial number is to see the download packages. There you'll find it next to the download link.
-
Right where you download your registered EL install kit, there is a link to the right of it where you can download the license file.
-
How can I force a record to be allocated on the heap ?
Lars Fosdal replied to dormky's topic in Algorithms, Data Structures and Class Design
You are right. I didn't consider the differences between GetMem and New. -
How can I force a record to be allocated on the heap ?
Lars Fosdal replied to dormky's topic in Algorithms, Data Structures and Class Design
@JiyaHana Please read the thread before replying. That solution was already proposed. -
Can you see the value if you create a new Watch for it? Is the "variable" you are trying to inspect, actually a function result like MyObject.MyFunction? If it is, you need to go to Tools | Options | Debugger and enable "Allow side effects and function calls in new watches"