Brian Evans
Members-
Content Count
360 -
Joined
-
Last visited
-
Days Won
4
Everything posted by Brian Evans
-
Your problem. Exception objects are not thread safe so accessing them from two different threads when one is about to destroy it anyway is never going to end well. Also it is totally pointless - any threading so writes don't block should be done in the logging library itself not every place that logs something.
-
The error message shows a colon at the start of the path\file. ":C:\Prog2\employee.fdb" Your code shows signs of leftovers from trying different things. Make a NEW project and get a connection working with as little as possible. Once done clean up the old code to match.
-
The file has a definition of EMPLOYEE not C:\Prog2\employee.fdb. What is the definition/settings for Convert.FDConnection1?
-
64 bit shift operations?
Brian Evans replied to A.M. Hoornweg's topic in RTL and Delphi Object Pascal
Type the constant by replacing 1 with UInt64(1) in your bit() function. Works in 32 and 64 bit targets. Result := ((Uint64(1) shl idx) and value) <> 0; The reason is bit shifts are modulo the size of the type of the arguments. So no error and you get short shifted when one argument is 32 bits which is the default for integer constants. -
Basically it provides database neutral full text indexing to Delphi database applications and comes with components and examples to make it easier. I used Rubicon over a decade ago at work. Was fast and easy to use back then and I imagine it still is. They have a web site that allows searching of Delphi related newsgroups as a demonstration (Code News Fast: Search Delphi and CPPBuilder Newsgroups).
-
If you want a console application then create a console application. Not sure the reason behind this statement - what does it matter what else is using a DLL/library?
-
TDirectory.GetFiles is listing the contents of Packages such as PhotosLibrary
Brian Evans replied to Incus J's topic in RTL and Delphi Object Pascal
There is some code / interfaces in Macapi.foundation including one for NSFileManager, at least in Delphi 11.1. Used by TPath.InternalGetMACOSPath in System.IOUtils when {$IFDEF MACOS} which you can look at to get some ideas at least. -
DBGrid selected row does not highlight the selected row when ClientDataSet is Closed and Open again
Brian Evans replied to ChrisChuah's topic in Databases
There certainly was GetBookmark/GotoBookMark()/FreeBookMark() in Delphi 1. Attached is an image of the Delphi 1 help topic for GetBookmark, notice what the "Note:" at the bottom says: -
Did you notice the target shown as assets\internal in the help section linked? Try it with just what the help suggests to start with. Usually prefer .\ vs an empty directory string as well.
-
Do you need an ARM64 compiler for Windows?
Brian Evans replied to Lars Fosdal's topic in Cross-platform
Microsoft has in the past put large amounts of resources into the 'next big thing' followed by it being abandoned. Chasing them is a path to ruin for any smaller companies. Even good products get poor support when they decide to chase something else. Windows Phone 7, 8 and 10, and Windows RT all on ARM and all now deprecated dead ends for example. Or the whole UWP / UWA mess where it seems to be on the way out then comes back. Not a very stable base for third party support. Not sure it is worth chasing ARM64 yet. -
Interbase VAR Licence and Demos or Free Versions
Brian Evans replied to Juan C.Cilleruelo's topic in Databases
Gave up on this decades ago and used FlashFiler then NexusDB instead. Mainly for the ease of going from single user embedded to multi-user client/server without licensing issues. Note for single user applications higher editions of Delphi come with redistribution rights for IBLite and IBToGo. It's only multiuser that needs server licensing that can cause issues for some sales models like yours. -
I would not have PAServer accessible on a public IP. Since you are already connecting by SSH I would suggest a SSH tunnel which redirects a local port to a remote port over a SSH connection.
- 3 replies
-
- alexandria
- linux
-
(and 1 more)
Tagged with:
-
problem upgrading to Delphi 11.1 Patch 1
Brian Evans replied to Dave Novo's topic in Delphi IDE and APIs
The zip file came from another computer (the Internet) and is probably marked as such. Perhaps some copied files are getting the flag set in some circumstances? Try checking the unblock checkbox before extracting/copying. -
FireDac has Local SQL (FDLocalSQL) which can be used to run SQL against TDataSets. Uses SQLite underneath the hood with some extra bits. Using with some FDMemTable components would keep it all in memory. Local SQL (FireDAC) - RAD Studio (embarcadero.com)
-
There is no built-in query editor in Delphi for TDataSet descendants. Some third party components provide them and some include being able to run the query. One example is FireDac where it accessed by double left clicking or right clicking the component. The dbGo components provide no such editor.
-
Analyze strings for common parts
Brian Evans replied to Mike Torrettinni's topic in Algorithms, Data Structures and Class Design
A lot of SQL is executed with parameters which would be a much easier to use form of the data than logs containing SQL with values inline. It also reduces clutter as static values show up as such vs looking the same as a parameter that might change. Where are these logs coming from? Can they be updated to log SQL + parameter value list? -
suppress connection killed/ gone away dialog
Brian Evans replied to TreyUsesDelphi's topic in Databases
Likely the reconnect failed and latter on after the error dialog is closed the connection gets opened again and the application continues on. A FDConnection has some events to give you a chance to handle exceptions or log what is happening: OnError, OnLogin, OnLost, OnRecover and OnRestored. If you add some logging to OnLost with a timestamp you should be able to tell what is going on and when. -
More efficient string handling
Brian Evans replied to parallax's topic in Algorithms, Data Structures and Class Design
A quick look at the file (searched Bing for the 2022VAERSDATA.csv) and it looks like double quotes within a string field are escaped with a double quote. As well only string fields that contain commas or double quotes appear to be enclosed in double quotes. Will take a more detailed look when I get a chance. LOAD DATA local INFILE 'c:/programdata/mysql/mysql server 8.0/uploads/2022VAERSDATA.csv' INTO TABLE data CHARACTER SET latin1 FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"' ESCAPED BY '"' IGNORE 1 LINES -
More efficient string handling
Brian Evans replied to parallax's topic in Algorithms, Data Structures and Class Design
The MySQL LOAD DATA statement can certainly handle all of that not sure why you think otherwise? MySQL :: MySQL 5.7 Reference Manual :: 13.2.6 LOAD DATA Statement The [{FIELDS | COLUMNS} [TERMINATED BY 'string'] [[OPTIONALLY] ENCLOSED BY 'char'] [ESCAPED BY 'char'] can handle double quotes. The SET col_name={expr | DEFAULT} section can be used for date, Boolean or other field conversions as needed. -
A better way to share global data structures than as global variables?
Brian Evans replied to DavidJr.'s topic in Algorithms, Data Structures and Class Design
I tend to move it all into a DataModule (one per thread type/definition) so it ends up under an instance variable for that namespace wise.