Jump to content

Bob Baudewyns

Members
  • Content Count

    24
  • Joined

  • Last visited

Posts posted by Bob Baudewyns


  1. Well, this is not the feedback I was expecting from my post here more than one year ago.

    I guess this approach is not working that well.

     

    Two heads are better than one. I see my request as a potential collaboration with a developer.
    Even for additional developments.

    Just keeping an open mind for other suggestions.

    I assume that additional works shall be included in the final price anyway.
     

    Again, I am not asking for free stuff. We are in the "Job opportunities/Coder for hire" section.
    I'm not a native English speaking person. Sorry if my wording was poor and unclear. 
    I sincerely hope that this unproductive discussion is now closed.


     

    • Like 1

  2. Hi Patrick,

    Quote

    Did you checked TFrameStand project

    Yes but I would prefer a standalone implementation not relying on another library

     

    Quote

    Is there anything else you would like for free? How 'bout we all pitch in and pay this month's mortgage for you?

    Not sure I understand your point here.
    I'm asking for a proposal meaning that I'm, of course, ready to pay for that.
    Sorry if this was unclear in my message.
    I just need an invoice.
    Are you interested ?

    • Like 1

  3. Yep, this is doing the job. Thanks

      for ColorIndex:= 0 to 4 do
        begin
          GradientPoint:= FGradient.Points.Add;
          TGradientPoint(GradientPoint).Color:=  TGradientColors[ColorIndex];
          TGradientPoint(GradientPoint).Offset:= TGradientOffsets[ColorIndex];
      end;

     


  4. I'm looking to define a gradient for TRectangle stroke.

    I can do that using the editor:

    1354599739_GradientEditor.png.deeb031d5ebdd22c37cf8a98427c8b33.png

    Which gives me the following definition:

        Stroke.Kind = Gradient
        Stroke.Gradient.Points = <
          item
            Color = claRed
            Offset = 0.000000000000000000
          end
          item
            Color = claBlue
            Offset = 0.250000000000000000
          end
          item
            Color = claYellow
            Offset = 0.500000000000000000
          end
          item
            Color = claFuchsia
            Offset = 0.750000000000000000
          end
          item
            Color = claLime
            Offset = 1.000000000000000000
          end>
        Stroke.Gradient.StartPosition.Y = 0.500000000000000000
        Stroke.Gradient.StopPosition.X = 1.000000000000000000
        Stroke.Gradient.StopPosition.Y = 0.500000000000000000
        Stroke.Thickness = 5.000000000000000000

    I'm trying to reproduce that Gradient definition by code like this:

    const
      TGradientColors:  Array[0..4] of TAlphaColor = (claRed, claBlue, claYellow, claFuchsia, claLime);
      TGradientOffsets: Array[0..4] of Single      = (0.0, 0.25, 0.50, 0.75, 1.0);
    
    FGradient:= TGradient.Create;
      for ColorIndex:= 0 to 4 do
        begin
          FGradient.Points.Add;
          FGradient.Points[ColorIndex].Color:=  TGradientColors[ColorIndex];
          FGradient.Points[ColorIndex].Offset:= TGradientOffsets[ColorIndex];
      end;
      CalcPosition(FAngle, FGradient);

    But what I get is not at all what I'm expecting:

        PanelsAppearence.Gradient.Points = <
          item
            Color = claRed
            Offset = 0.000000000000000000
          end
          item
            Color = claNull
            Offset = 0.000000000000000000
          end
          item
            Color = claNull
            Offset = 0.000000000000000000
          end
          item
            Color = claNull
            Offset = 0.000000000000000000
          end
          item
            Color = claLime
            Offset = 0.750000000000000000
          end
          item
            Color = claWhite
            Offset = 1.000000000000000000
          end
          item
            Color = claFuchsia
            Offset = 1.000000000000000000
          end>

    I've searched everywhere for the proper way to define a gradient by code
    Could you help me?


  5. Hi,

    I'm looking to outsource the development of a standalone generic custom dialog box framework that can be used from a simple MessageBox (error, warning...) with icon to flexible container to display almost anything

    Can also act as message toaster

     

    Based on the following specifications:

    • FMX Framework. Compliant with FMX styling
    • Independent unit as non-visual component
    • - Non-modal mode like a simple pop-up message
      - Modal mode, interrupting execution proving same user feedback as standard dialogs when clicking outside
      - Toaster mode with duration
    • Fully localizable
    • Size: Fixed, Autosize, Sizeable (Win, OSX) 
    • Screen Position: Top, Center, Bottom
    • Options to modify
      - Dialog Background (Color, Fill, Gradient, Image) with opacity
      - Margins
      - Dialog Borders (Color, stroke), Corners (Radius), Shadow (Color, opacity)
      - Shade or Blur the background application behind it
    • Screen Position: Top, Center, Bottom
    • Appearance and disappearance with animations.
      i.e. :
      - Fade in / out 
      - Fly: scrolling from a side (top, bottom, left, right)
      - Grow / Shrink
      - Split / Wipe, etc...
    • Generic methods to open, update (i.e. progress dialog) and close the dialog
      Modal result

     

    1. No dependency with another third-party library
    2. Full code source delivered. We are owning that code (negotiable).
    3. Shipped as a Delphi packages (10.4, 11).
    4. A demo application must also be provided to validate the deliverables
    5. Need an invoice

     

    Please send me your best proposition possibly with additional features in private message

    Don't hesitate if you have any question to discuss or any comment to improve this project


  6. There is absolutely no server action here. Sorry for the confusion.

     

    Let's say it's a remote file instead of a file stored on each local computer

    The file is just sitting there to be shared between computers and potentially modified by one of these computers

    Imagine this is a configuration JSON file driving the behavior of each computer. But can be changed and affecting all computers that are reading it at startup 

     

    My question is focusing if I can change that file by code without downloading and uploading it.

    If I can get the content of the file with THTTPClient.Get, why I couldn't change that content with POST or PUT ?

     


  7. Hi,

    To drive my application, I am downloading at startup a JSON structure from a file located on a server.

    I need to share that file between me and a remote person.

     

    I am doing that successfully with the following code:

    function GetJSONFromServer(const Filename: string): TJSONObject;
    var
      FullURLPath: string;
      Buffer: TStringStream;
      Client: THTTPClient;
      Response: IHTTPResponse;
    begin
      Result:= nil;
      Buffer := TStringStream.Create;
      try
        Client := THTTPClient.Create;
        try
          FullURLPath:= Concat(URL, '/', Filename);
          Response:= Client.Options(FullURLPath, nil, 0);
          if Response.GetStatusCode = 200 then
            begin
              Client.Get(FullURLPath, Buffer);
              if (Buffer.Size > 0) then
                Result:= TJSONObject.ParseJSONValue(Buffer.DataString) as TJSONObject
              else
                Log('ERROR: JSON File is empty !', ErrorColor);
            end
          else
            Log('ERROR: File does not exist on server !', ErrorColor);
        finally
          Client.Free();
        end;
      finally
        Buffer.Free();
      end;
    end;

    I'm simply trying to do the opposite: Updating the same JSON file at shutdown.

    The following code doesn't generate any error but the file is not updated.

    function PostJSONToServer(const Filename: string; const JSONObject: TJSONObject): Boolean;
    var
      FullURLPath: string;
      Buffer: TStringStream;
      Client: THTTPClient;
      Response: IHTTPResponse;
    begin
      Result:= false;
      Buffer := TStringStream.Create;
      try
        Client := THTTPClient.Create;
        try
          FullURLPath:= Concat(URL, '/', Filename);
          Response:= Client.Options(FullURLPath, nil, 0);
          if Response.GetStatusCode = 200 then
            begin
              Buffer.Seek(0, soFromBeginning);
              Buffer.WriteString(JSONObject.ToString);
              Client.Post(FullURLPath, Buffer);
              if Response.GetStatusCode = 200 then
                begin
                  Log('Transaction with server successfull !', OkColor);
                  Result:= true;
                end
              else
                Log('ERROR: Transaction with server failed !', ErrorColor);
            end
          else
            Log('ERROR: File does not exist on server !', ErrorColor);
        finally
          Client.Free();
        end;
      finally
        Buffer.Free();
      end;
    end;

    The buffer contents before posting is correct.

    • Is my code completely wrong ?
    • Should I use another query instead of Post ? 
    • Is it a matter of security preventing me to modify the file ?
    • Is there a workaround to allow such transaction ?

    Thanks


  8. I need to update a large number of strings because the syntax is not compliant with the expected format. I would like to automate that process.

    Such strings can have a mix of alphanumeric, numeric and special characters. A small example would be appropriate here

    Let's say 3 different strings:

    NameA 01 01 [A-01]
    NameB 01 02 [B-02]
    NameC 01 03 [C-03]

    Should become:

    My Name A [1963-A-01]
    My Name B [1963-B-02]
    My Name C [1963-C-03]

    As you can see:

     - 'My ' is inserted at the beginning
     - A space is inserted between 'Name' and 'A'
     - The two groups of numbers before '[' are removed
     - '1963-' is inserted after '['

    Rules:

    • String Length can be different
    • Some characters need to be added/inserted
    • Some others need to be removed
    • Others need to be replaced
    • Inserting space/special characters

     

    The same rules must be applied to all strings based on a specific "syntax" defining what should be added/removed/replaced and at which location in the string.

     

    Do you known the most efficient way to achieve such smart replacement with Delphi ?

    Is Regular Expression can be applied here and how ?

     

    I'm looking to provide an Edit field that would allow the user to enter the syntax(rules) and see the result applied dynamically like done by Regular Expression web sites

     

     

     


  9. Thank you again Rollo62,

     

    In the meantime, I did something very close in the IDE with:

    - 1 TGridPanelLayout

    - 4 Outer Black TRectangle with opacity 0.5

    - 8 Inner Yellow TRectangle with appropriate rounded corners

     

    With a TImage as background for rendering the camera, it looks Ok to me

     

     

    All Steps.png

    • Like 1

  10. Hi,

    Thanks for your feedback.

     

    My app is intended for Android and iOS.

    I already know all these solutions and examples. 

    By the way, I am using ZXing with the standard FMX Camera because this is the same code for all platforms.

    With my friend Erik from Winsoft, I need 3 libraries as mentioned by you.

    But I am indeed using Winsoft's Barcode for FireMonkey to generate the QR codes 

     

    My problem is not generating or scanning QR codes. This is working just fine.

    It is just a matter of look & feel for the scanning screen as explained above.

     

     


  11. Hi,

     

    I'm developing an application that needs to scan QR Code.

    For the GUI design, I'd like to provide the usual scan focus screen with a transparent square inside a rectangle (the screen) like the attached mock-up.

    I already tried different approaches but not very successful.

     

    Any idea how could I design this with FMX ?

     

    Thanks   

    ScreenFocus.png


  12. This is the request captured with Fiddler

    DELETE https://ws.synchroteam.com/api/v3/job/delete?myId=467927 HTTP/1.1
    Connection: Keep-Alive
    Content-Type: application/json
    Accept: text/json
    Accept-Charset: UTF-8
    Authorization: Basic XXXXXXXXXX
    Cookie: incap_ses_466_1982613=JG+hNrWzP3ntmaXA4pB3BhU0SmAAAAAArMFLFUXF8+BXuhjHFDJEIA==; visid_incap_1982613=eLvuGVc7ToSqZT5dVRPkcRU0SmAAAAAAQUIPAAAAAADEtuE8tUgs/WIAYTcpXzLh; ASP.NET_SessionId=tpffwpqwj0pphbx5s3llzp3f
    User-Agent: Embarcadero RESTClient/1.0
    Content-Length: 348
    Host: ws.synchroteam.com

    And response

    HTTP/1.1 404 Not Found
    Cache-Control: private, s-maxage=0
    Content-Type: application/json; charset=utf-8
    Server: Microsoft-IIS/10.0
    X-RateLimit-Limit: 1000
    X-RateLimit-Remaining: 999
    X-RateLimit-Reset: 1615476362
    X-Quota-Limit: 15000
    X-Quota-Remaining: 14679
    Date: Thu, 11 Mar 2021 15:25:02 GMT
    Content-Length: 66
    X-CDN: Imperva
    X-Iinfo: 10-12437416-12437480 SNNN RT(1615476301530 1054) q(0 0 0 -1) r(1 1) U6
    {"error":"Not Found","message":"The requested Job does not exist"}

     


  13. Looking for some help from Delphi community as I'm blocked with my project.

    I am working with SynchroTeam API using their REST API. SynchroTeam API

    I can successfully GET and POST data without any problem.
    But I can't find out the right way to delete a job.. Delete a job

    After downloading all jobs Object, I'm trying to delete some of them. So, I know ID, MyID and NUM properties of each Job.
    However, when I'm using the following code:
     

    RESTClient:= TRESTClient.Create('https://ws.synchroteam.com/api/v3');
    with RESTClient do
    begin
      Accept:= 'application/json';
      AcceptCharset:= 'UTF-8';
      Authenticator:= HTTPBasicAuthenticator;
      SecureProtocols := [THTTPSecureProtocol.TLS12];
    end;
    
    RESTRequest.Method:= TRESTRequestMethod.rmDELETE;
    RESTRequest.Resource:= 'job/delete';
    RESTRequest.AddParameter('Content-Type', 'application/json', TRESTRequestParameterKind.pkHTTPHEADER, [poDoNotEncode]);
    RESTRequest.AddParameter('Accept', 'text/json', TRESTRequestParameterKind.pkHTTPHEADER, [poDoNotEncode]);
    RESTRequest.AddParameter('myId', '467925', TRESTRequestParameterKind.pkQUERY, [poDoNotEncode]);
    
    RESTRequest.Execute;

    I get the error 404: Job does not exists. I'm 100% sur about myId. I also tried with ID property: same result.
    I also tried with all relevant TRESTRequestParameterKind for myId parameter. I always get 404
     

    What would be the correct way to delete a record using Delphi REST.Client.TRESTRequest ?
    Thank you for your help

×