Jump to content

Lars Fosdal

Administrators
  • Content Count

    3303
  • Joined

  • Last visited

  • Days Won

    110

Everything posted by Lars Fosdal

  1. Lars Fosdal

    JSON string value

    If you don't document it - how do you expect to maintain backward compatibility? My code relies on REST.Json - ObjectInstance := TJson.JsonToObject<T>(aJsonString) ; - aJsonString := TJson.ObjectToJsonString(ObjectInstance, [joIgnoreEmptyStrings, joIgnoreEmptyArrays, joDateIsUTC, joDateFormatISO8601]); - TJSONInterceptor / JsonReflectAttribute for instructing the converter to drop TDateTime properties that have 0 as value. What are the equivalents in System.Json ?
  2. Lars Fosdal

    JSON string value

    I wish the various Json classes were better documented. http://docwiki.embarcadero.com/Libraries/Rio/en/REST.JsonReflect is particularly poorly documented with regards to marshalling, interceptors and converters. I have long been wondering if the TJson.JsonToObject<T>(aJsonString) can be made to handle mixed type arrays {"list": [5, "text", {"prop": "value"}]} by injecting converters, but it seems impossible - but then again - the above mentioned tools are undocumented.
  3. Lars Fosdal

    Passing back a string from an external program

    What about a memory mapped file? An idealist kind of solution could perhaps be a message queue system like f.x. RabbitMQ (https://www.rabbitmq.com/)
  4. Lars Fosdal

    Android Log Capture

    Also, https://github.com/tananaev/rootless-logcat Same caveat.
  5. Lars Fosdal

    Android Log Capture

    https://bitbucket.org/mlopatkin/android-log-viewer/src/default/ Caveat: I have not tried it myself
  6. Lars Fosdal

    Good design for "file was just saved" message

    Another option would be to specify that file should be opened after creation already at the point where you decide to make the file in the first place.
  7. Lars Fosdal

    Good design for "file was just saved" message

    Yes, that could work well, IMO.
  8. Lars Fosdal

    Good design for "file was just saved" message

    I'd make a generic "application log" where I would log the different actions, and for each action type - offer the possible options when viewing the log. Whenever something is logged, I'd have a "New Item" counter (Think "number of unread") somewhere in the UI - f.x. on a button that opens the log. I also strongly dislike modal dialogs, but when I need that file, I do need a mechanism to find it.
  9. https://sdtimes.com/softwaredev/industry-watch-the-developer-transformation/
  10. As David says - if the setter and getter don't do anything but assignments, you can eliminate them. property X: Integer read pX write pX; property Y: Integer read pY write pY;
  11. The joys of inherited problems. I am looking for a pattern or advice on how to best allocate a set of records to a specific requestor when there are multiple parallel requests, and there are multiple parallel request viewers. In practice: Allocate a set of deliveries to a user, when there can be multiple users requesting deliveries in parallel, and multiple users viewing the deliveries in parallel. The current SQL can give deadlocks both on allocations and on viewing, so something is definitively not right, and I need to improve on it. There is SO, where it all is an exercise in asking the question right... Are there other good discussion sites?
  12. Lars Fosdal

    Best site/source for SQL Server questions?

    Work in progress. Looking at more retry resilience, rather than always once off. https://www.microsoftpressstore.com/store/exam-ref-70-762-developing-sql-databases-9781509304912
  13. Lars Fosdal

    10.3.1 has been released

    I use a cream colored background in the editor. I find that much calmer than looking at a black display.
  14. Lars Fosdal

    New to Json

    https://jsonlint.com is very handy.
  15. I like the MS VS way better than the EMBT BDS way.
  16. Lars Fosdal

    P.I. Engineering XKeys keyboards

    I have a couple of XK16, an XK-60, and the XK-3 pedal that I rarely use these days. I used them a lot back when I was a PC gamer. Amazing hardware. Quirky software.
  17. Does any of you have experience with OPC over DCOM, using Delphi? We are looking for a library that is tried and known to work well, as there are a number to choose from at https://www.opcconnect.com/delphi.php
  18. Lars Fosdal

    Preferred OPC DCOM library for Delphi?

    Thanks, Uwe. We did consider that our best option as well. Now we just need Tetrapak to set up their OPC server correctly 😛
  19. Lars Fosdal

    Initialize local variables at declaration

    They would be uninitialized per iteration. Ref. AllocMsg - what can I say other than old habits die hard 😛 TPQ and ArtSum are regular objects retrieved from global shared pools and life cycle management happens elsewhere.
  20. I am quite fond of class variables of the Class of TSomeClass type. I use these for polymorph creation of class instance variables, typically handlers of some sort, but C# does AFAIK not have a similar construct, i.e. type as a variable. What are the best practice alternatives to using class variables? Am I limited to case / if then else factories or is there something more elegant around?
  21. Lars Fosdal

    Getit problem

    I wonder if this was related to themes being disabled.
  22. Lars Fosdal

    Initialize local variables at declaration

    This works well in our 10.3 production code, so it is not entirely useless. The THardAllocList is a TList<T>, though - not a TArray<T>. Several typeless inline declarations with initialization, and a inline string var with initalization. procedure TPSDTask_ImportCustomerOrders.ProcessHardAllocations(const aDeliveryId: Integer; const HardAllocations: THardAllocList); begin for var Alloc in HardAllocations do begin var TPack := GlobalTPackList.FindByTPackNo(Alloc.TPackNo, True, True); if Assigned(TPack) then begin var TPQ := TPack.GetQuantityOfArticleOnTPack(Alloc.ArticleId); var ArtSum := GlobalArticleSummaryList.FindByArticleId(Alloc.ArticleId); if ArtSum.QuantitiesAreEqual(Alloc.Quantity, TPQ) then begin if TPack.AllocatedDeliveryId = 0 then begin // Allokér TPack til leveranse var AllocMsg: string := ''; if TPack.AllocateToDelivery(aDeliveryId, AllocMsg, True) = rOK
  23. Lars Fosdal

    Forked VSCode for Delphi

    I use extensive logging, so that does clarify most of my threading issues - but sometimes, you simply need to get into the structures to understand where shit happens. At that point, I'd like my debugger to be well behaved. Unfortunately, it is not.
  24. Lars Fosdal

    Constructors + Destructors in class helpers?

    Both class and record helpers could do with a real upgrade. The lack of inheritance and lack of support for Generics is crippling.
  25. Lars Fosdal

    Decorating read-only controls

    Only us old-timers.
×