Jump to content

Lars Fosdal

Administrators
  • Content Count

    3416
  • Joined

  • Last visited

  • Days Won

    113

Everything posted by Lars Fosdal

  1. Lars Fosdal

    XML to SVG

    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.
  2. Lars Fosdal

    Where did I come from

    Good point.
  3. Lars Fosdal

    Where did I come from

    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
  4. Lars Fosdal

    Profiler for Delphi

    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?
  5. value of myQuery is undefined at call to createMyQuery. Check your hints and warnings.
  6. Lars Fosdal

    looking for a lo-fi Delphi Style

    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.
  7. Chrome: Version 81.0.4044.122 (Official Build) (64-bit) partly managed by our IT org.
  8. 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.
  9. Lars Fosdal

    looking for a lo-fi Delphi Style

    Wow, you've been lucky. Perhaps it is primarily a plague for corporate developers.
  10. Lars Fosdal

    looking for a lo-fi Delphi Style

    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.
  11. Lars Fosdal

    Date in Android call log

    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
  12. Lars Fosdal

    Date in Android call log

    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?
  13. 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.
  14. Lars Fosdal

    UI resource manager design

    http://docwiki.embarcadero.com/RADStudio/Rio/en/TeeChart
  15. Lars Fosdal

    Receiving incoming calls

    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.
  16. Lars Fosdal

    UI resource manager design

    https://docs.microsoft.com/en-us/windows/win32/perfctrs/using-the-pdh-functions-to-consume-counter-data
  17. Lars Fosdal

    Difference between Pred and -1

    Wow! That fact had eluded me!
  18. Lars Fosdal

    Threading question

    The book gives a reasonably good understanding of threading issues. That understanding would suggest alternate solutions that avoids the pitfalls of messaging.
  19. Lars Fosdal

    Threading question

    A good place to start for writing solid thread code: https://leanpub.com/omnithreadlibrary
  20. Lars Fosdal

    issues with non-Win platforms

    Ref installation: You can safely install without elevating to localadmin.
  21. Lars Fosdal

    issues with non-Win platforms

    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.
  22. Lars Fosdal

    JSON woes

    Using the std TJson class in REST.Json. Probably not considered gold std.
  23. Lars Fosdal

    Do you name your Threads for debugging?

    Yes. I use the thread class name and an instance id.
  24. Lars Fosdal

    Android FMX Game App not working reliably

    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.
  25. Lars Fosdal

    OS Updates

    That is never wrong. Please ignore me 🖖
×