Jump to content

Lars Fosdal

Administrators
  • Content Count

    3323
  • Joined

  • Last visited

  • Days Won

    110

Everything posted by Lars Fosdal

  1. Lars Fosdal

    Maximum static memory

    In that case, use index arrays and reorder the indexes instead of shuffling values.
  2. Lars Fosdal

    Maximum static memory

    Are you using arrays of records? How large records? Are you shuffling whole records when sorting? If so, why not have an array of pointers to records, and shuffle the pointers instead of the actual data?
  3. Then twiddle thumbs until Delphi 12...
  4. Is there a tidy way to avoid this conundrum?
  5. Lars Fosdal

    TPopupMenu with group headers

    Perhaps post a suggestion on https://quality.embarcadero.com ?
  6. Lars Fosdal

    TPopupMenu with group headers

    Good point.
  7. BTW: What is the setting of this one? https://docwiki.embarcadero.com/RADStudio/Sydney/en/Server_Class_LifeCycle
  8. I'd try to find the classes that handles DB connectivity and see where in the codepath you are when the connection is dropped. Somewhere in that callstack there must be a logical explanation. Otherwise, add a watchdog connection that keeps things alive? Brute force, I know... but...
  9. Surely there must be some sort of mechanism that governs the lifetime of a DS session?
  10. Lars Fosdal

    TPopupMenu with group headers

    Nice idea, @chkaufmann and nglthach. I had to change it around a little to get it to work, as I instantiate the menu items at runtime. Since I don't assign an OnClick handler, I don't need to disable the entry. I mucked around with colors for a while. Currently using Bold White on DarkGrey which works "ok" for both light and dark themes. type TMenuItemGroup = class(TMenuItem) protected procedure DoAdvancedDrawItem(Sender: TObject; ACanvas: TCanvas; ARect: TRect; State: TOwnerDrawState); public constructor Create(AOwner: TComponent); override; end; constructor TMenuItemGroup.Create(AOwner: TComponent); begin Inherited; OnAdvancedDrawItem := DoAdvancedDrawItem; end; procedure TMenuItemGroup.DoAdvancedDrawItem(Sender: TObject; ACanvas: TCanvas; ARect: TRect; State: TOwnerDrawState); begin ACanvas.Brush.Color := TColors.Darkgrey; // TColors.SysHighlight; // TColors.Darkblue; ACanvas.FillRect(ARect); ACanvas.Font.Color := TColors.White; // TColors.SysHighlightText; // TColors.White; ACanvas.Font.Style := [fsBold]; ACanvas.TextRect(ARect, ARect.Left + 3, ARect.Top + 3, StripHotkey(Caption)); end;
  11. It may be because the datasnap server tears down the connection when nobody is using it. It may be configurable. What is the setting of Server.KeepAlive ?
  12. https://firebase.google.com/docs/reference/rest/database
  13. I wish the "class abstract" declaration would have prevented .Create instantiation.
  14. https://cloud.google.com/datastore/pricing
  15. Lars Fosdal

    Console Manager for the Delphi IDE

    I prefer my PS shells to be native. There is so much functionality that can be lost otherwise.
  16. Is this a known issue? If you assign an anonymous function to a property, there is no warning if the result of the function is not defined. Normally, a function where Result is not set will yield a warning. program anon_method_func_result; {$APPTYPE CONSOLE} {$R *.res} uses System.SysUtils; type TConvertFunc<T> = reference to function(const invalue: string; out outvalue: T): Boolean; TValue<T> = class private FConverter: TConvertFunc<T>; public property Converter: TConvertFunc<T> read FConverter write FConverter; constructor Create; end; constructor TValue<T>.Create; begin FConverter := function(const inValue: string; out outvalue: T): Boolean begin outvalue := Default(T); // Would have expected a warning here // since Result is never set end; end; begin try try var V := TValue<Integer>.Create; V.Free; except on E: Exception do Writeln(E.ClassName, ': ', E.Message); end; finally {$ifdef Debug} Write('Press Enter: '); Readln; {$endif} end; end.
  17. It exists to balance out my inherent sense of imminent doom.
  18. Lars Fosdal

    Open PDF File

    If a user has modified the behaviour or installed an app that causes the "open" verb to behave differently than the default behaviour - that is a user problem, IMO. If you want to open a .pdf file, "open" is the way to go.
  19. Lars Fosdal

    FinTech anyone?

    I prefer regulation over learning that my debt has increased 500% the last week.
  20. Lars Fosdal

    Get Parent process Current directory

    If the parent process runs at a higher security level than your own, you will have a hard time gleaning info from the process without elevating your own process. Since CreateProcess explicitly can specify a different working directory than the current (i.e. the parent) - there is no bullet-proof way of knowing the actual working directory of the parent process.
  21. Lars Fosdal

    FinTech anyone?

    It is hard to have stability without regulation. Ref. crypto volatility.
  22. Lars Fosdal

    Encryption - are multiple keys possible ?

    Looks like you are describing a mix of public key encryption (PKE) and access control. PKE only has one encryption key and a one decryption key. Would it not be easier if Harry simply has both keys - one for the driving license and one for the passport? That would mean - one document, one encryption key, and one decryption key, with a list of people that has access to the decryption key for each document. Or - you could turn that around - one encryption key, one decryption key for each document owner and a list of people who has access to which documents (the documents share the same decryption key).
  23. Lars Fosdal

    FinTech anyone?

    One great benefit of switching to a regulated digital currency is that it will make corruption more difficult.
  24. Lars Fosdal

    FinTech anyone?

    I haven't seen any of that. There are rules here which govern how the APIs can used. I am not 100% certain, but it seems the APIs can only be accessed in the user's context, so the "other" bank doesn't actually "see" the numbers.
×