Jump to content

omnibrain

Members
  • Content Count

    107
  • Joined

  • Last visited

Everything posted by omnibrain

  1. How should I have known? I figured it out in the end, so it wasn't too difficult after all... I understand. That totally makes sense.
  2. You might have misunderstood me. I did not use "SendHeader" by myself. I just initialised PersistentHeader:='Access-Control-Allow-Origin: *' before starting the server. Then I wondered why my browser hung accessing the served files and why Postman chocked on the headers. So I debugged into the "SendHeader" function and saw there, that it loses the second CRLF at the end of the header when adding the PersistentHeader. I guess that leads to a missing blank line between header and body, but I did not go that low level while debugging. My workaround is to add a CRLF to the end of the PersistentHeader when I set it in my Program. But I think (at least from an UX standpoint) that should not be necessary.
  3. I found something I overlooked earlier: The PersistentHeader property might be useful. But there might be a bug in THttpConnection.SendHeader. I looks like, that in adding the PersistentHeader the second #$d#$a at the end of the headers might gets omitted. That means, that the blank line between headers and body is missing.
  4. I don't use any of them. I use the "automatic serving of the contents of the DocDir" method. So I think I would have to use the events, I guess. But where can I add a custom header to the automatic response? Do I need to create my derived "myHttpConnection" class and override "ProcessGet"?
  5. omnibrain

    Looking for a localization tool

    Tsilang is horrible, horrible, horrible for source control. It stores the translation data in a blob within the DFM. I don't know the other tools, but I would take a sharp look at how they store their translation data.
  6. omnibrain

    11.2 Patch 1 is out

    And if I install 11.2 now, I have still to install the patch and do the fix, because there is no updated install file?
  7. My Understanding is, that App passwords also will stop working: Office 365 App passwords | Blog | Limilabs I tried to jump through a lot of hoops and use OAuth with Clever Internet Components, but it all lead to errors, but I might try again, because: I tried the TMS FNC Cloud Outlook Mail component, but you can only read and send mail. I also need to delete or at least move mail. Has someone found another component? I don't have the time to implement and maintain the Graph API by myself.
  8. omnibrain

    Are the jcl and jvcl libraries still alive?

    But when you are only a handful of trusted contributors you don't have to use the Github workflow but can have them merging (perhaps with rebase and smashing) locally and then have them push the changed branches to Github. And if you work this way with your trusted contributors you can still be open for external contributors with the Github Fork-Merge-Request-Workflow. That's really the best of both worlds. We have to face, that Delphi itself is obscure enough for younger developers. Clinging to outdated tools, hosting options and workflows nobody learns anymore isn't going to help.
  9. I'm looking for a small component/library to just draw some vectors, perhaps add some predefinded shapes and load some bitmaps, save everything and perhaps export to bmp/png, whatever. I want to be able to "paint" by hand and "paint programatically". I found littleearth/draw-objects: draw-objects (github.com) (Update to TDrawObject Components (angusj.com)) In a previous search I found something similar, but I can't seem to find it anymore. Perhaps someone has an idea? I don't think I need a fullblown CAD solution...
  10. If you would be so kind to point me into the direction where I can find GR32_Objects I could evaluate it. But it is not part of the Graphics32 repository. From my google search it looks like it was an add on by AngusJ, who concentrates on Image32 now. But I fail to find a source. But a couple of hundred lines are indeed too large an effort if it means reinventing the wheel. That's why I asked first for a finished solution. I can still invent the wheel if it's not invented yet, or I need square wheels for whatever reason. The TMS component linked by SwiftExpat is an option, but it looks like that the Delphi Area Simple Graph Component (despite being abandoned by its creator) is sufficient for my needs.
  11. Thanks. Of course I found Graphics32 and Image32, but they seem to be a bit much. And it looks like I need to implement the basic stuff I need (the drawing) by myself. At least I did not find the "old demo of the GR32_Objects unit" you mentioned.
  12. Thanks, I know Skia and toyed with the demo programs for a bit. Skia sure is capable, but using Skia would mean that I have to implement all the "diagram" stuff like click to place, connecting lines, etc.
  13. Thanks, I did not know that. That looks like it's a bit much... I also don't understand what "FNC" means. Are they "native" VCL or something different? It may or may not come with a whole host of baggage... In the meantime I found the other component again: DELPHI AREA » Simple Graph Component I really need only some basic stuff I can salvage into my own application. Edit: I tried both and neither has the option to insert (background) bitmaps in the demo. I guess that would be easy enough to implement, but if I remember correctly I had another one that offered this option out of the box. But I can't find it anymore... Edit2: Might have been Simple Graph after all. There in the Demo I can set a bitmap as background in one shape and use that as a background for everything else.
  14. omnibrain

    MQTT: advice wanted

    We too are using TMS MQTT to connect to a broker to send and receive. It works quite well, but we initially had some trouble with the correct signaling of lost connections. Hi Sergio, does your component support mTLS (mutual TLS)? I'm working on a scenario where we want to use Scaleways IoT Hub, which offer that the clients can authenticate with the broker via mTLS.
  15. I'm trying to use JSONPath via TJSONObject.FindValue in my program. I'm using Delphi 11. I broke it down to the easiest example and I still can't get it to work: { "name": "Chris", "value": 10000 } Path: $.name My Code after stripping away everything else: var myjson:=TJSONObject.ParseJSONValue('{"name": "Chris","value": 10000}'); var myval:=myjson.FindValue('$.name'); ergebnis.Text:=myval.Value; The JSON get's parsed, but the FindValue returns 'nul'. Am I doing something completely wrong?
  16. Thanks, it works now. 🙂 Perhaps it's me being daft, but I cloud not read either from System.JSON.TJSONObject.FindValue - RAD Studio API Documentation (embarcadero.com) or System.JSON.TJSONPathParser - RAD Studio API Documentation (embarcadero.com) that I don't need to address the document root. Or is there some documentation/example I missed?
  17. omnibrain

    Doscommand OnCharDecoding Output

    I'm currently experimenting with Turbopack DosCommand and try to capture the following output for the "ping" command. (ping is just an example I try with) Ping wird ausgeführt für 8.8.8.8 mit 32 Bytes Daten: But the DosCommand doesn't seem to decode the output right: Ping wird ausgef�hrt f�r 8.8.8.8 mit 32 Bytes Daten: I tried to implement the CharDecoding event to decode the output for Unicode function TForm4.DosCommand1CharDecoding(ASender: TObject; ABuf: TStream): string; var pBytes: TBytes; iLength: integer; begin ilength := ABuf.Size; if iLength > 0 then begin SetLength(pBytes, iLength); ABuf.Read(pBytes, iLength); Result := TEncoding.Unicode.GetString(pBytes); end else Result := ''; end; but I only get chineese characters as a result: ਍楐杮眠物⁤畡杳晥梁瑲映犁㠠㠮㠮㠮業⁴㈳䈠瑹獥䐠瑡湥ഺ湁睴牯⁴潶⸸⸸⸸㨸祂整㵳㈳娠楥㵴㐲獭吠䱔ㄽ㔱਍湁睴牯⁴潶⸸⸸⸸㨸祂整㵳㈳娠楥㵴㐲獭呔㵌ㄱവ湁睴牯⁴潶⸸⸸⸸㨸祂整㵳㈳娠楥㵴㈲獭吠䱔ㄽ㔱਍湁睴牯⁴潶⸸⸸⸸㨸祂整㵳㈳娠楥㵴㈲獭吠䱔ㄽ㔱਍਍楐杮匭慴楴瑳歩映犁㠠㠮㠮㠮ഺ †倠歡瑥㩥䜠獥湥敤⁴‽ⰴ䔠灭慦杮湥㴠㐠‬敖汲牯湥㴠〠਍††〨‥敖汲獵⥴ബ慃‮敚瑩湡慧敢湩䴠汩楬敳⹫ഺ †䴠湩浩浵㴠㈠洲ⱳ䴠硡浩浵㴠㈠洴ⱳ䴠瑩整睬牥⁴‽㌲獭਍
  18. omnibrain

    Doscommand OnCharDecoding Output

    Thanks, that worked. The joys of windows legacy and eternal backwards compatibility...
  19. omnibrain

    Doscommand OnCharDecoding Output

    (13, 10, 80, 105, 110, 103, 32, 119, 105, 114, 100, 32, 97, 117, 115, 103, 101, 102, 129, 104, 114, 116, 32, 102, 129, 114, 32, 56, 46, 56, 46, 56, 46, 56, 32) This is the value from "pbytes" from the watchlist. #$D#$A'Ping wird ausgef'#$0081'hrt f'#$0081'r 8.8.8.8 ' is the result after "TEncoding.ANSI.GetString"
  20. omnibrain

    Doscommand OnCharDecoding Output

    Same as without event handler, which is no surprise, as "TEncoding.ANSI" is the default in the DosCommand Unit. https://github.com/TurboPack/DOSCommand/blob/4ded41648e4e1aafa372c7a740fb2366aeb3e9e4/Source/DosCommand.pas#L1042
  21. omnibrain

    ICS V8.69 announced

    GetIt on my Delphi 11 still shows 8.68. Does the release via GetIt take more time, or did I miss some refresh somewhere?
  22. I'm currently designing a REST API for a larger existing Delphi application and I'm currently looking into various options. I don't need a lot of "magic", I actually prefer my code to be straight forward so THttpAppSrv looks great to me. I should be able to implement most of my endpoints in GET and POST-Handlers. But for some PUT and DELETE would make more sense. How would I best implement PUT and DELETE? Should I work around and just use GET and POST for everything? Can I somehow use a "generic" dispatch with THttpAppSrv, handle PUT and DELETE there and use the GET- and POST-mechanism as provided? Or would it be easy to add PUT- and DELETE-Handler "infrastructure" to THttpAppSrv? I tried looking into the code, but I'm not familiar with ICS so it's all greek to me...
  23. After I updated ICS (to 8.68) I added the handlers for PUT and DELETE, but it looks like I never tested them properly. My process produces only "501 Unimplemented". I wanted to try your example OverbyteIcsDDWebService.dproj because there you added the handlers, but I couldn't compile it. I had to add 'OverbyteICSURl' to the Uses of 'OverbyteIcsDDWebServiceSrv' and Answer String in line 2398 misses the code page argument. After fixing that I could compile and start (after editing the .ini) the process. But there it also throws an "501 Unimplemented" for the put handler when calling delete for "restapi.html. In the end I needed to add the options 'hoAllowPut' and 'hoAllowDelete'. After I added them on my project the calls work as well. So I can say it works now, but your example may need some minor tweaks.
  24. Did you have time to check if there is a bug for POST and why GET produces alternately a 401 and 500 on failed authentication?
  25. Checking Client.AuthUserName in .Execute would work for me (if it worked). It would also pave the way for future endpoints with different authorizations per user. I tried it and Client.AuthUserName is always filled, so there might really be a bug as you suspect. But I still wonder why I even get into .Execute after authenticated failed for the "post", while the "get" produces a "401" (and every other time a 500...) before calling the .Execute.
×