Jump to content

Lars Fosdal

Administrators
  • Content Count

    3416
  • Joined

  • Last visited

  • Days Won

    113

Everything posted by Lars Fosdal

  1. Lars Fosdal

    Minimum Viable Product (MVP)

    @lope Will there be an ERP, backoffice/accounting system behind the POS solution, or is it intended to be a single software solution? Will you need multiple stations? Multiple sign-ins? Scanners? Weights? Many of your suggested MVP items typically belong to an ERP or backoffice solution. There probably also are a number of existing POS solutions to be found - so unsure why anyone would start reinventing the wheel. I mean, the absolute MVP is a simple till and handwritten receipts with carbon copies...
  2. FYI - Removed the other post, which appeared to be in the wrong sub-forum.
  3. Lars Fosdal

    Watch me coding in Delphi on YouTube

    It may LOOK like a ternary, but looks deceive. It does NOT behave like a ternary op. Both expressions will be evaluated/executed - and not one or the other. The only place I use it, is when I want to emit const values, dependant on an expression.
  4. You are exposing the db endpoint on the network.
  5. Connecting directly to an SQL db from a mobile device is a bad idea. There should be a service in between that offers a REST API to serve the mobile app.
  6. Lars Fosdal

    UK Remote Delphi Developer

    I think you need more detail to attract candidates.
  7. Lars Fosdal

    Watch me coding in Delphi on YouTube

    This is me
  8. Xiaomi maintain their own Android fork. Can that be a factor?
  9. Lars Fosdal

    REST api: too much data

    Do you get a monolithic collection of json elements for the entire day, or do they arrive one by one? If monolithic, you could split it up and add each element to a queue. Is there a sequence of processing requirement? If not, you could have multiple parallell consumers of that queue.
  10. Lars Fosdal

    MSGraph and OAuth

    Found a description of "Invalid audience"-here https://stackoverflow.com/questions/75228773/access-token-validation-failure-invalid-audience-office-365-graph-api Spelunked and found this, but haven't tried it myself https://github.com/jfbilodeau/AzureRESTExample There also is this thread, but I am uncertain if it came to conclusion? OAuth2 isn't really a standard, but a guideline, and there can be fickle differences between implementations. I successfully do OAuth2 authentication to our ERP systems, using System.Net.HTTPClient THTTPClient, and simulating a form post. I couldn't get the REST OAuth component to work. In the source below, TRes is a TObject containing the properties of the expected response body from the authentication - which should contain your tokens. function TIONAPI.BuildStringStream(const NameValues: TNetHeaders): TStringStream; var Encoded, Sep : string; begin Sep := ''; Encoded := ''; for var item in NameValues do begin Encoded := Encoded + Sep + Item.Name + '=' + Encoder.EncodeForm(Item.Value); Sep := '&'; end; Result := TStringStream.Create(UTF8String(Encoded)); end; function TIONAPI.PostForm<TRes>(const aURL: string; const aFormFields: TNetHeaders; aExpectsResult: Boolean): TRes; var HTTPRequest: IHttpRequest; HttpResponse: IHttpResponse; ReqBody: TStringStream; ResStatus: Integer; ResContent: string; ReqHeaders: TNetHeaders; T: TStopWatch; begin Result := nil; ResStatus := 0; ReqBody := nil; FLastStatus := 0; FLastErrorMsg := ''; try try DebugOut(Format('HTTP %s %s', ['POST', aURL])); // DO NOT TRANSLATE try HTTPRequest := HTTP.GetRequest('POST', aURL); HTTPRequest.RemoveHeader('User-Agent'); HTTPRequest.SetCredential(IONCredentials.ResourceOwnerClientId, IONCredentials.ResourceOwnerClientSecret); ReqBody := BuildStringStream(aFormFields); HttpRequest.SourceStream := ReqBody; ReqHeaders := [ TNetHeader.Create('content-type', mime.ApplicationXwwwForm), // DO NOT TRANSLATE TNetHeader.Create('Expect', '100-continue') // DO NOT TRANSLATE // TNetHeader.Create('User-Agent', UserAgent); // DO NOT TRANSLATE ]; HTTP.PreemptiveAuthentication := True; T := TStopWatch.StartNew; HttpResponse := HTTP.Execute(HTTPRequest, nil, ReqHeaders); T.Stop; DebugOut('Status: ' + ResStatus.ToString + ' in ' + T.ElapsedMilliseconds.ToString+ ' ms'); if Assigned(HttpResponse) then begin ResStatus := HttpResponse.StatusCode; ResContent := HttpResponse.ContentAsString(TEncoding.UTF8); if (ResStatus = 200) then begin try T := TStopWatch.StartNew; Result := TJson.JsonToObject<TRes>(ResContent); except on E: Exception do begin DebugOutException(E, Format('TIONAPI.PostForm.%s<%s, %s> returned StatusCode: %d - but failed during conversion of "%s"', // DO NOT TRANSLATE [aURL, '', Result.ClassName, ResStatus, ResContent])); ResStatus := HTTPStatus.ExpectationFailed417; Result := nil; FLastErrorMsg := E.Message; end; end; end else begin Result := nil; end; end else begin ResStatus := HTTPStatus.NoResponse; ResContent := ''; Result := nil; end; except // Json Exception on E:Exception do begin DebugOutException(E); ResStatus := HTTPStatus.ExpectationFailed417; end; end; finally // DebugOut('Status: ' + ResStatus.ToString); ReqBody.Free; end; except // HTTP Exception on E: Exception do begin FLastStatus := ResStatus; FLastErrorMsg := E.Message; DebugOutException(E, Self.ClassName + '.PostForm'); // DO NOT TRANSLATE end; end; end;
  11. Lars Fosdal

    TControlList — need help!

    Or VS Code.
  12. Lars Fosdal

    Delphi app using Access database very slow on network drive.

    Single user or multi user? Named share? Long path/file names? Antivirus changes? DNS changes? Security changes? Do you which calls that are slow? Have you tried System Monitor to look for errors?
  13. Lars Fosdal

    What happened to OmniThreadLibrary.com

    Last release was 7 months ago. https://github.com/gabr42/OmniThreadLibrary
  14. Lars Fosdal

    Essential Delphi Addins survey

    Done.
  15. @corneliusdavid The fewest new ones, or the fewest old ones? 😉
  16. None of them. Old bugs fixed. New bugs are added. Old bugs resurface. Repeat.
  17. Lars Fosdal

    My YouTube Channel - The Silver Coder

    @silvercoder79 Hi Tim! I think it is great that you share your experiences with our favorite language! There seems to be a small influx of new faces at the moment, so the better an education they can have, the better it is for the community!
  18. Lars Fosdal

    Is there a way to check is the "user Idle" (no interaction)

    @Tommi Prami - So, do you want to have your app do something, when the PC signals that there has been no keyboard or mouse events for a while? Do you want to track that yourself, or are you looking for a system event? https://stackoverflow.com/questions/2212823/how-to-detect-inactive-user https://stackoverflow.com/questions/2177513/receive-screensaver-notification
  19. @Leszek Ref. your report - unless the context/conditions are identical, it is always wise to start a new topic instead of adding your question to an existing topic. I split off this question for you, as it seems to be a different problem.
  20. So, you copy text from outside the Delphi app, and when you paste it into your TMemo, it is LF and not CRLF? What is your TMemo.Lines.LineBreak set to? An alternative would be to intercept the paste and use https://docwiki.embarcadero.com/Libraries/Alexandria/en/System.SysUtils.AdjustLineBreaks
  21. I find some of the EMBT marketing practices to be idiotic and unnecessary. They keep spamming me these offers for "upgrades" and "new licenses" with varying levels of price slashing, all year around. Don't they consider that I have been a subscriber for more than a decade, and that the offers only are valid for new licenses? The new releases and offers tend to bundle some third party tool or package that is underfunctional and overpriced, and where the license terms are a tad unclear after the year has passed. After being bought by Idera, it is often some other Idera purchased product that I have little interest in. I find the bundling practices to be inconsistant, to put it mildly. Not only do they do this directly, but the local representative also spam the same offers, over and over. According to the local representative - it is EMBT that do the spam on their behalf. Where is the reward for staying a long time paying customer? It is not like the maintenance is cheap, and it is not like I spam EMBT with support issues. As for support, I don't think I've every raised a support question apart from the annoying license counter bump requests. Ok, I am paying for new versions, updates, hotfixes, etc. - but to be honest, for many major versions now, the first xx.0 releases have of sub-par quality. We've had to wait at least for update 1, and a hotfix or two - before it was fit for use. About license management... Remember the Delphi .NET craze? It led us to purchase RAD Studio licenses to get a the new and shiny .NET stuff. That shit didn't last long, mostly due to MS not fully opening the door on third party .NET tools - but - when they were discontinued, we were still on RAD Studio Enterprise, when we really only need Delphi Enterprise. We have never used the C++ part of RAD Studio., but there is no way to downgrade a license, and it is still cheaper to keep the RAD Studio Enterprise maintenance, than to repurchase Delphi Enterprise licenses. So we stay on maintenance and keep hoping for Old problems to be fixed New platforms to be supported HighDPI to be done right Code performance to be improved RTL performance to be improved IDE to become stable and performant Debuggers that actually work in all scenarios Less immature and unfinished new libs and components Less pointless marketing offers because, warts and all, the tool is what we have become dependant on. Still hoping that it will change for the better... http://www.toodarkpark.org/computers/humor/shoot-self-in-foot.html
  22. The maintenance part does get you the upgrades, updates, hotfixes, some GetIt stuff for a year, though. And, renewing the maintenance deal is less costly than repurchasing.
  23. Lars Fosdal

    How to debug a Not Responding program element

    @Willicious A common challenge when updating UI components that have events of their own, is that setting values in the component, will trigger said events, which again trigger your event handlers, which then exec code that changes other UI elements. Do you take steps to ensure that you don't get a flurry of events between different parts of the UI and biz logic when you change data in the components?
  24. Lars Fosdal

    Delphi on Surface Pro with Qualcomm CPU?

    I am sure I would prefer a clean installation.
×