-
Content Count
3504 -
Joined
-
Last visited
-
Days Won
115
Everything posted by Lars Fosdal
-
BlockRead & BlockWrite - E2010 error
Lars Fosdal replied to Jud's topic in RTL and Delphi Object Pascal
I use BlockRead/BlockWrite for a text file device driver that really speeds up writing and reading a text file, since it allows me to configure much larger buffers. https://pastebin.com/u/LarsFosdal/1/ns7ET60N -
What about https://docwiki.embarcadero.com/Libraries/Sydney/en/FMX.Grid.TStringGrid.OnEditingDone ?
-
Argh, Mike - my bad. I was speaking from a VCL point of view - not noticing that you posted in the FMX section. Not the first time I've made that mistake.
-
delphi Thread ITask.ExecuteWork not wait until Task finish in mobile devices?
Lars Fosdal replied to bravesofts's topic in Cross-platform
Threads are about parallel/background work, but after invoking a task, you could in theory use ITask.Wait to stop the main thread while waiting for it to complete - but then you might as well execute the code from the main thread instead of creating other threads. Also, if the thread gets stuck, your main thread would be stuck. It is better to use parallel threads and in the main thread receive signal events for when the background thread succeeds/completes/fails. Threads are not hard when you understand them and the best practices around the use of them - but gaining that knowledge can be a challenge. Read the theory, study the examples, and try it out.- 24 replies
-
- android
- multithreading
-
(and 2 more)
Tagged with:
-
One option is the OnSetEditText event. https://docwiki.embarcadero.com/Libraries/Sydney/en/Vcl.Grids.TCustomDrawGrid.OnSetEditText
-
TFDMongoQuery data type mismatch. Current type [WideString], new type [ADT]
Lars Fosdal replied to plv's topic in Databases
The JSON looks non-standard. JsonLint.com doesn't like it either. It doesn't know how to deal with ObjectId(); Can it be that it is BSON? Ref. https://stackoverflow.com/questions/16586180/typeerror-objectid-is-not-json-serializable -
combining two characters to a string switches them
Lars Fosdal replied to dummzeuch's topic in RTL and Delphi Object Pascal
I do a lot of string manipulation, but I have not seen this effect yet. Weird. I would definitively have assumed that the concatenation would go left to right on evaluation of the functions. Would this change the outcome? s := ''; s := s + ReadChar + ReadChar; -
Intel's blurb: "Under the right circumstances, the technology lets CPU cores effectively do two things at once." - but it doesn't really outline the circumstances. https://en.wikipedia.org/wiki/Hyper-threading has some interesting observations, making me wonder if I actually would be better off by disabling Hyper-Threading...
-
BlockRead & BlockWrite - E2010 error
Lars Fosdal replied to Jud's topic in RTL and Delphi Object Pascal
Searching the 11.x source: So - there is some compiler magic involved somewhere with the BlockWrite proc. In System.pas, below line 3000, you find the comment: { Procedures and functions that need compiler magic } and a long list of funcs and procs. _BlockWrite is in that section. Map file says 0001:0000BE10 System.@BlockWrite Is it a pointer to the procedure which is set up somewhere by the compiler/RTL? -
32-bit and 64-bit Windows Apps Runs fine in Windows for ARM under Parallells on my MacBook Pro M1 (macOS Ventura 13.4.x)
-
That FFFFFFF9 address looks like a nil reference negative offset. Does TBSDictionary.SetElements check the validity of the references?
-
I would have said that this is a manual task, as components or libaries might not be easily identifiable. In theory, you could write something that scanned the source files and picked out copyright messages, but the list would probably be ripe with duplicates, and have many missing entries. On the other hand - if the scanning could be done out-of-project and connect units to a vendor once and for all and allow for manual tidying, then it would basically be about scanning the map file post build, and create and link a resource text (or JSON or XML) with the SBOM info. Sounds like a development opportunity for a creative person with time to spare.
-
W1057 during D7 -> D11 conversion
Lars Fosdal replied to Bart Verbakel's topic in Algorithms, Data Structures and Class Design
@Bart Verbakel Is it a file used only by your application(s) - i.e. are you in control of production and consumption of the file? In that case, you have the alternative to modernize the file structure to f.x. JSON to support unicode and additional/optional fields. If you stay on your Record format, you need to do explicit conversions between your shortstrings and other strings in the system. MessageDlg( String( F1Pool.Deelnemer[High(F1Pool.Deelnemer)].Teamnaam ) + ' succesfully added!', mtInformation, [mbOk], 0); // Should silence the W1057 -
W1057 during D7 -> D11 conversion
Lars Fosdal replied to Bart Verbakel's topic in Algorithms, Data Structures and Class Design
@Bart Verbakel Does the output file have a specific format, or is it just a text file with multiple lines? -
You could perhaps do a grdDetails.Canvas.FillRect(Rect) before calling TextRect?
-
How to modify the code for $R+
Lars Fosdal replied to dummzeuch's topic in Algorithms, Data Structures and Class Design
Voted for RSP-38847. -
Please support Stack Overflow moderators strike against AI content policy
Lars Fosdal replied to Dalija Prasnikar's topic in Tips / Blogs / Tutorials / Videos
I participated in an IT event this winter, where gender discrimination was one of many sub-topics, and there was many real-life examples by women who had experienced it. Gender discrimination still is a real issue - particularly for the young women starting their careers. -
Please support Stack Overflow moderators strike against AI content policy
Lars Fosdal replied to Dalija Prasnikar's topic in Tips / Blogs / Tutorials / Videos
Yet, women are fighter pilots, front line soldiers, astronauts, mountain climbers, race car drivers, plumbers, electricians, engineers, and what not. IMO, equality is about more than comparing physical traits. It is about mentality, attitude and equal opportunities. I think it is good for any industry to have a balanced work force, hence we need to find out why there are less female programmers, and not bury our heads in the sand, like SO did with their yearly polls. -
Please support Stack Overflow moderators strike against AI content policy
Lars Fosdal replied to Dalija Prasnikar's topic in Tips / Blogs / Tutorials / Videos
The health risks are the same for men and women in that environment. Even when pregnant. Apart from the ability to exert physical strength (not including my niece who is a strongwoman national champion), women are no less fit than men to work in difficult or demanding enviroments. I also have a machine-engineering niece, and another one that is currently doing her master on material techology. But, as always, we are drifting - no, racing - away from the core topic, and I am (as often) to blame. -
Please support Stack Overflow moderators strike against AI content policy
Lars Fosdal replied to Dalija Prasnikar's topic in Tips / Blogs / Tutorials / Videos
No idea. We don't really have that many mines these days. However, women can drive heavy machinery as good as or better than men. https://forskning.no/svalbard-partner-historie/kull-karer-og-kvinnfolk/1023284 informs -
Please support Stack Overflow moderators strike against AI content policy
Lars Fosdal replied to Dalija Prasnikar's topic in Tips / Blogs / Tutorials / Videos
AI is not easy, for sure. -
Please support Stack Overflow moderators strike against AI content policy
Lars Fosdal replied to Dalija Prasnikar's topic in Tips / Blogs / Tutorials / Videos
Someone needs to make a ChatGPT SO front-end that helps you ask questions that are acceptable to the moderators of SO 😛 As for ChatGPT generated answers... I don't mind those as long as they are verified to be correct before publishing. Unfortunately, that doesn't seem to be the case. -
Please support Stack Overflow moderators strike against AI content policy
Lars Fosdal replied to Dalija Prasnikar's topic in Tips / Blogs / Tutorials / Videos
Quite low. Not many female developers using our ancient tool, it seems. We need more women in IT to end the boy's club attitudes that exist in many places. -
Please support Stack Overflow moderators strike against AI content policy
Lars Fosdal replied to Dalija Prasnikar's topic in Tips / Blogs / Tutorials / Videos
Yet, the 2022 survey statistics shows that less than 1 in 10 of the responding users are female. -
Please support Stack Overflow moderators strike against AI content policy
Lars Fosdal replied to Dalija Prasnikar's topic in Tips / Blogs / Tutorials / Videos
https://www.wired.com/story/stack-overflow-gender-problem/ and there is this... Can the moderation be a factor when women, minorities and non-native english speakers are put off by SO?