-
Content Count
3416 -
Joined
-
Last visited
-
Days Won
113
Everything posted by Lars Fosdal
-
I agree with the sentiment of never buying components without source code. That said - $299 for 8 licenses with source code is not over the top for what appears to be a capable piece of code. Still, it would have been nice to see a $149..1xx single user license including source. Please keep the commentary polite and constructive.
-
I usually have a construct which I check in the event UI handlers. If I am writing changes to the UI, the event handler contains a busy check. type TGuard = record private FBusy: Integer; public procedure Enter; // Increments FBusy procedure Leave; // Decrements FBusy function Busy: Boolean; //True if FBusy > 0 function Idle: Boolean; // not Busy end; // In the form/frame type TMyForm = class(TForm) protected Update: TGuard; //... procedure TMyForm.UpdateUI; begin Update.Enter; try CheckBox1.Checked := TrueOrFalse; finally Update.Leave; end; end; procedure TMyForm.OnCheckBox1Clicked(sender: TObject); begin if Update.Busy then Exit; // do the event handling
-
Anders, what about https://github.com/andremussche/map2dbg? Can that produce the necessary debug files for VTune to play ball on Delphi line by line?
-
Why this code fail?
Lars Fosdal replied to Magno's topic in Algorithms, Data Structures and Class Design
value of myQuery is undefined at call to createMyQuery. Check your hints and warnings. -
It has become better over the years, but it is only as good as the processes of each company. Before, it could happen if you were a lowly developer, that there was a manager above you that set target dates not on your effort estimates, but on targets presented as wishes from the sales people and the upper management team.
-
Google Chrome is blocking the download of my application — HELP!!!
Lars Fosdal replied to Steve Maughan's topic in General Help
Chrome: Version 81.0.4044.122 (Official Build) (64-bit) partly managed by our IT org. -
Google Chrome is blocking the download of my application — HELP!!!
Lars Fosdal replied to Steve Maughan's topic in General Help
I successfully downloaded it just now, and I did not get a warning. I have to say that I became very skeptical when I saw Softpedia mentioned, as they have a long history with bundling files with other installers like "helpers" for browsers. I did not run the installer. -
Wow, you've been lucky. Perhaps it is primarily a plague for corporate developers.
-
In theory, it is possible to take a .dfm and convert it to an SVG illustration. Not sure there is a huge commercial market, but it surely is something that many would appreciate having to avoid those pointy haired bosses thinking that your two-hour-tossed-together-good-looking Delphi prototype is a complete application that just needs a little testing.
-
Aha - I assumed the UnixToDateTime did milliseconds - but it also requires seconds. If you change your code to CallTimeDouble := UnixToDateTime(Round(StrToInt64(DATEx)/1000), false); you should get local time, which for you is UTC + 3 ? So '1587377791601' is 2020.04.20 13:16:32,000
-
program Test; uses SysUtils, DateUtils; const USec: Int64 = 1587377791601; var dt: TDateTime; begin dt := UnixToDateTime(Usec); Writeln(FormatDateTime('yyyy.mm.dd hh:nn:ss,zzz', dt)); end. spits out 52272.01.01 03:26:41,000 Are you sure that you wrote an actual example value?
-
Extract selected UI and code elements to insert them into another project
Lars Fosdal replied to PeterPanettone's topic in Delphi IDE and APIs
To write an expert that helps separate the UI from the logic would be far from trivial. I strive to write code that is testable, something that Steve McConnell's "Code Complete" drilled into me. My logic routines and biz objects are created without a UI, and the UI itself is connected afterwards. I make an effort to isolate the displayed data from the data that is actually used. I.e. a grid only reflects the underlying data, and all work is done on the underlying data and not the data in the grid itself. A checkbox state reflects the underlying state, and a change to the checkbox affects the underlying data - which then again applies any recalculations to states, and suggest a refresh of the display. The benefits: It is easy to write unit tests and integration tests for the biz logic. It is easy to reuse the code, or change the UI. It also simplfies changing the biz.logic as it is inside the "black box" object, and not heavily tied to the UI. If the tests says the object works, and the app doesn't work - the error is in the coupling between the non-visual object(s) and the UI. The drawback: There is a certain degree of data duplication - but the cost of that is quite limited. You can use proxy classes and/or Attributes/RTTI to associate elements between the non-visual and UI elements. Divide and conquer is good - but hard unless applied from the start on. -
http://docwiki.embarcadero.com/RADStudio/Rio/en/TeeChart
-
Have you setup the required permissions in the Android manifest? From https://developer.android.com/reference/android/telephony/PhoneStateListener#onCallStateChanged String: call phone number. If application does not have READ_CALL_LOG permission or carrier privileges (see TelephonyManager#hasCarrierPrivileges), an empty string will be passed as an argument.
-
https://docs.microsoft.com/en-us/windows/win32/perfctrs/using-the-pdh-functions-to-consume-counter-data
-
Difference between Pred and -1
Lars Fosdal replied to John Kouraklis's topic in RTL and Delphi Object Pascal
Wow! That fact had eluded me! -
The book gives a reasonably good understanding of threading issues. That understanding would suggest alternate solutions that avoids the pitfalls of messaging.
-
A good place to start for writing solid thread code: https://leanpub.com/omnithreadlibrary
-
Ref installation: You can safely install without elevating to localadmin.
-
If you had TMS libs from before, like the TMS Component Pack, those are purely VCL for Windows. There are currently two alternatives for cross platform: 1. FireMonkey + TMS FMX Components https://www.tmssoftware.com/site/products.asp?t=fm (All Firemonkey supported platforms) 2. CrossVCL https://www.crossvcl.com/ - not compatible with TMS for VCL, afaik. (MacOS and Linux) Disclaimer: I've not used any of these, only the TMS Component Pack for VCL.
-
Using the std TJson class in REST.Json. Probably not considered gold std.
-
Do you name your Threads for debugging?
Lars Fosdal replied to Darian Miller's topic in Tips / Blogs / Tutorials / Videos
Yes. I use the thread class name and an instance id. -
Android FMX Game App not working reliably
Lars Fosdal replied to Len Yates's topic in Cross-platform
Also, monitor your memory consumption in the Windows App. If it is not stable but keeps growing - there is a chance that you have a leak.- 5 replies
-
- delphi 10.3.3
- multi-platform
-
(and 1 more)
Tagged with:
-
That is never wrong. Please ignore me 🖖