-
Content Count
3416 -
Joined
-
Last visited
-
Days Won
113
Everything posted by Lars Fosdal
-
Pitfalls of Anonymous methods and capture
Lars Fosdal replied to Lars Fosdal's topic in RTL and Delphi Object Pascal
Which is why my post specifically pointed out that there is a link to the SCCE in the blog post? -
Pitfalls of Anonymous methods and capture
Lars Fosdal replied to Lars Fosdal's topic in RTL and Delphi Object Pascal
Yes, the examples leak. I didn't want to clutter it up with too much housekeeping code. Thank you, Uwe, for enlightening me on variable vs value capture. IMO, the compiler could need a hint or warning if a variable capture happens in a loop, because it is really easy to overlook. I use a number of variations on this to do dependency injection. It really helps with avoiding pulling too much project specific code into general code and keep the libraries isolated from each other. This code in particular is part of a web server that (now correctly) supports a configurable collection of JsonRPC protocol handlers. The web server knows nothing about Json, and the protocol handlers knows almost nothing about http. -
Anybody else see the same?
-
10.2 Tokyo unable to report issues from within the IDE
Lars Fosdal replied to Lars Fosdal's topic in General Help
What do we know about the state of 10.3 Rio in this context? -
Does anyone know if there are existing libs out there that can extract this across all FMX platforms? - Current user - Device name
-
Cross-platform discovery of device name and user name?
Lars Fosdal replied to Lars Fosdal's topic in Cross-platform
https://developer.android.com/training/id-auth/identify Would this be usable to get some sort of username / identity? Perhaps there is something similar on iOS as well? -
Request for advice: FireMonkey and Frames
Lars Fosdal replied to Lars Fosdal's topic in Cross-platform
So basically just like for VCL. Nice. -
Request for advice: FireMonkey and Frames
Lars Fosdal replied to Lars Fosdal's topic in Cross-platform
@Rollo62 Can you exemplify how you "load via runtime into TRectangles" ? In my current app, I want to instantiate the frame onto a TTabItem. -
Opinions solicited: Parallel processing to delete 40+Gig file structure?
Lars Fosdal replied to KeithLatham's topic in RTL and Delphi Object Pascal
SSD disks are usually connected via SATA (Serial ATA) or PCIe using the NVMe protocol. The first does not do parallel operations, while the second does. However, the speed benefit of the latter is when writing large amounts of data in parallel to individual areas. When deleting files, the OS is rewriting minor amounts of data in a shared area that needs to be integrity managed i.e. shared access locking, so I would suspect that there is no gain to parallelizing deletion of files. -
E2158 System unit out of date or corrupted: missing '@Clr' - how to cure?
Lars Fosdal replied to Lars Fosdal's topic in RTL and Delphi Object Pascal
Doh! Never mind! I had commented out one of two overloaded methods in the interface section. There was another "fatal" compilation error further up in the compiler output list. Basically, it was just a weird IDE/compiler artifact due to invalid code. -
I have a new stored proc that takes a varchar(max) argument for logging - and I occasionally run into this problem when the argument is very long. It then raises the following exception EFDException [FireDAC][Phys][ODBC]-345. Data too large for variable [#9]. Max len = [8000], actual len = [24448] Hint: set the TFDParam.Size to a greater value Note that I have a couple of varchar(5000) arguments in the same method that does not complain, so I assume that the default length for strings is 8000 chars. What is the best practice for dealing with this situation? My wrapper code for the stored proc does not really know anything about the potential sizes of these strings as it passes the values as variants. Is it acceptable to always measure the length of the string and dynamically increase TFDParam.size? I have a case already that deals with XML logging to an XML field. vtUnicodeString: begin p.DataType := ftString; s := String(ConstParams[ix].VUnicodeString); len := Length(s) * SizeOf(Char); if Len > p.Size // Autosize then begin p.DataType := ftWideMemo; p.Size := Len + 2; end; p.Value := s; end; But - what happens if the actual field is not type , but [varchar(max)] ? Can I do the above for long string fields? What is the recommended action for handling changes to TFDParam.size for long varchar arguments?
-
Amazing support at TMS
Lars Fosdal replied to PeterPanettone's topic in Tips / Blogs / Tutorials / Videos
I love how responsive TMS are as a company, but I wish they did more regression tests on the TAdvStringGrid. -
Delphi Developers Archive (Experimental)
Lars Fosdal posted a topic in Tips / Blogs / Tutorials / Videos
Delphi Developers Archive (Experimental) for the Google + Delphi Developers Community is online. https://delphi-developers-archive.blogspot.com The posts are searchable by tag list or free text search. FYI - This is work in progress, and I hope to improve the following issues: - Some posts have erroneous titles - Some posts are missing attribution of the original poster - Some 600 posts are missing due to an inexplicable quota error during import Comments on the archived posts are currently disabled until the import is finalized. Comments appreciated. -
Delphi Developers Archive (Experimental)
Lars Fosdal replied to Lars Fosdal's topic in Tips / Blogs / Tutorials / Videos
It looks like I have to delete and re-import, oh joy... -
Delphi Developers Archive (Experimental)
Lars Fosdal replied to Lars Fosdal's topic in Tips / Blogs / Tutorials / Videos
@Attila Kovacs That is one of the fixups that the Google+Exporter have implemented. At the moment I am trying to find out if I can update the posts, or if I have to delete them all and re-import them. Blogger is a difficult beast... -
Delphi Developers Archive (Experimental)
Lars Fosdal replied to Lars Fosdal's topic in Tips / Blogs / Tutorials / Videos
Odd story: Of the 12K posts, 3 did NOT have a category! Go figure! -
Delphi Developers Archive (Experimental)
Lars Fosdal replied to Lars Fosdal's topic in Tips / Blogs / Tutorials / Videos
@Attila Kovacs - If you find something truly horrendous, feel free to send me a link. I am not going over the 12K posts by hand, though. Edit: But not yet, do it after I've done the brush ups that Google+Exporter are implementing. I'll announce it when I think it is "done". Besides, Tags existing in the original G+ posts are perpetuated. Post category is also attributed as a tag. Also, the blog search is full Google search, so you can write things like someword AND (thisword OR thatword) Note the capitalization of logical keywords. Hence the titles are the least of worries. -
Delphi Developers Archive (Experimental)
Lars Fosdal replied to Lars Fosdal's topic in Tips / Blogs / Tutorials / Videos
Not possible. Blogger insists on a title, and Google+Exporter makes what it can out of the first text(s) it finds in the post. -
Changes in Parallel Library
Lars Fosdal replied to hsvandrew's topic in RTL and Delphi Object Pascal
Alternatives to sleep,could be to have a class that creates large arrays of random values, and do Bubble sort on them, optionally logging the progress to disk 😛 -
How to type json properties that are arrays with mixed element types?
Lars Fosdal posted a topic in Network, Cloud and Web
Consider the following Json data: The array elements are lists of integers, strings and objects. { "message": [ [ 0, "a text" ], [ 1 ], [ 1, { "switch": true } ], [ 2, "text one", "text line two" ] ] } Assume the JsonData const below is filled with the Json above. Using the Json tools from unit REST.Json, I would typically do like this. const JsonData = // see Json data above var Message: TJsonMessage; begin Message := TJson.JsonToObject<TJsonMessage>(JsonData); But - how should TMessageArray be declared to accept the above structure? Is it actually possible? TJsonMessage = class private Fmessage: TMessageArray; public property message: TMessageArray read FMessage write FMessage; end; -
How to type json properties that are arrays with mixed element types?
Lars Fosdal replied to Lars Fosdal's topic in Network, Cloud and Web
Correct link: REST.Json.Interceptors types/methods are undocumented https://quality.embarcadero.com/browse/RSP-23026 Unabashedly mentions @Marco Cantu -
Is there already a statistic about the new registrations?
Lars Fosdal replied to sh17's topic in Community Management
G+ is slightly different. As Owner or Moderator you can only remove posts or comments, not edit them. A post that is removed from a community, remains on the profile of the original poster. I am already missing G+ a lot. -
Changes in Parallel Library
Lars Fosdal replied to hsvandrew's topic in RTL and Delphi Object Pascal
Please amend the title. The title should IMO reflect the contents of the post, which "-------" does not. -
Is there already a statistic about the new registrations?
Lars Fosdal replied to sh17's topic in Community Management
Sounds like the std terms for any social media platform, i.e. meaning that the content will be massaged electronically to fit onto different devices and delivery methods. -
Is there already a statistic about the new registrations?
Lars Fosdal replied to sh17's topic in Community Management
Although there are no usage statistics for the G+ Delphi Developers, there is no doubt that the near 10k user count it has, in no way represent the actual number of active users, nor does it indicate the number of lurkers.