Jump to content

All Activity

This stream auto-updates     

  1. Past hour
  2. DelphiUdIT

    Import .NET Assembly

    I update this topic 'cause new versions are released of Halcon (and quote Matthias that were interested about that). I post a Delphi wrapper around this, not a really Delphi wrapper, only a porting from C headers that I have done with CHET. Take care that some adjustments should be done from your previous sources because in Halcon are changed some records (Tuples), and for other reasons too. Read carefully the "Release Notes for HALCON 24.11.1.0 Progress-Steady" (https://www.mvtec.com/products/halcon/work-with-halcon/documentation/release-notes-2411-1) for full details. I tried the new wrapper only partially. Bye HalconC_2411.pas
  3. Remy Lebeau

    Clipboard history

    https://devblogs.microsoft.com/oldnewthing/20230302-00/?p=107889 https://devblogs.microsoft.com/oldnewthing/20230303-00/?p=107894 But, the way Microsoft describes this API, they make it sound like it is "the clipboard" history.
  4. Today
  5. Brandon Staggs

    Clipboard history

    A clipboard history is a convenient way to see lots of passwords in plaintext. Who wouldn't love that.
  6. Here an example: program Crcr32Demo; {$APPTYPE CONSOLE} {$R *.res} uses System.SysUtils, System.ZLib; var Buf1 : AnsiString; Buf2 : String; Crc : UInt32; begin Buf1 := 'Hello World!'; Crc := System.ZLib.Crc32(0, PByte(Buf1), Length(Buf1) * Sizeof(Buf1[1])); WriteLn('AnsiString ID=', IntToHex(Crc, 8)); Buf2 := 'Hello World!'; Crc := System.ZLib.Crc32(0, PByte(Buf2), Length(Buf2) * Sizeof(Buf2[1])); WriteLn('UnicodeString ID=', IntToHex(Crc, 8)); ReadLn; end. The output is: AnsiString ID=1C291CA3 UnicodeString ID=E2106423 AnsiString and Unicode string doesn't produce the same result because character code are different (8 bit and 16 bit per character). and CRC32 work at the byte level.
  7. westereng

    Delphi for Mobile Applications

    True, the initial cost of Delphi is quite substantial, but the yearly renewals is something to live with, I know several tools that is more expensive and less capable...
  8. DelphiUdIT

    Notice on C++ Webinar today

    The indication on the "GOTO" page is not precise, it was always like this.
  9. Fraser

    Notice on C++ Webinar today

    I think it is saying 5 hours and some minutes. Does anyone else have trouble with GetIt servers today?
  10. Lars Fosdal

    SSL of this site

    This has been resolved.
  11. tgbs

    SSL of this site

    Validity Not After Thu, 21 Nov 2024 10:24:06 GMT Please renew certificate
  12. sjordi

    Delphi for Mobile Applications

    Absolutely, that, to me, is one of the main point to go with Delphi or C++Builder. You have 1 codebase. Sure, you'll have conditional compile/code for specific platform, but still only 1 project. No need for 5 different sources/teams to maintain in parallel (it never works) for Windows, macOS, iOS, Android and Linux.
  13. Thanks, fix will be added for the next release shortly. Angus
  14. @FPiette I did consider your suggestion, but I could not understand it. I tried a second time after your last post and I still could not understand it, how to use it, etc. I think that "buf" is throwing me off. I'm not that good at pointers. I thought buf was an array and was to hold some bytes, so I tryined to move the string into it and, well, I just don't have the skills for this. I'm an amature programmer, and this is my hobby, and I'm not some wiz-kid know-it-all. So, I'm giving it up your suggestion per your link. its 5:32am and I work the night shift (truck unloading work) and I'm exhausted. However, I found another resource for crc32 and tried that, and it seems to be working. But again, I'm exhausted. I'll play around with it much later. I need sleep.
  15. Rollo62

    Notice on C++ Webinar today

    Hi there, I'm quite confused on the starting time of the C++ Webinar today. It shows 10:00 CST in the EMail note, which should be 17:00 in Germany. ... But it also tells me when joining Goto: 5 hours to go .... This would be 16:00 in Germany. I actually believe the Goto schedules, which should be correct, but something seems weird here. 🤔
  16. Patrick PREMARTIN

    Delphi for Mobile Applications

    Don't forget the cost of maintaining two or more projects in more than one language, with more than one IDE / OS. Depending on the subject, the cost of Delphi licenses is not so high.
  17. westereng

    Delphi for Mobile Applications

    Great point, I did not really think about that. That also means increased costs, since I need to keep my Delphi current at all times 😓 Using the .Net universe will be the more cost friendly option to consider. But the point about keeping on top of new os versions apply there too... Hmm, not as straight forward choice as I thought 🤔
  18. Dalija Prasnikar

    Delphi for Mobile Applications

    When it comes to mobile development you cannot count on that kind of stability. Not because of Delphi, but because of platforms. android and iOS get new OS version every year, often with drastic changes in some workflows and features. They also expect that you frequently update your application and make it compatible with new OS versions (old applications still run, but if you don't make an update in two years period applications will not be available to users with new OS versions - this is just example, there are variants of what exactly happens in each particular case). Those OS changes also require changes in Delphi toolset and sometimes additions in code. How drastic depends on the each particular change. This is valid for all mobile development toolsets, and is nothing Delphi specific. But, this also means that you will have to keep current with new Delphi releases and you cannot stick using some old Delphi version for too long after new one gets out.
  19. I found a memory leak in unit OverbyteIcsHttpAppServer.pas in the function THttpAppSrv.PutDispatchVirtualDocument() Below the fix (search for "fix") and also in attachment the fixed OverbyteIcsHttpAppServer.pas file. Note: a similar memory leak or a temp file that never will be deleted will probably also occur for large content. See the begin - end above the else with the fix. function THttpAppSrv.PutDispatchVirtualDocument(ClientCnx : THttpAppSrvConnection; var Flags : THttpGetFlag; ExecFlag : Boolean = False): Boolean; { V9.1 added Exec } var I, J : Integer; PathBuf : String; Status : Boolean; Proc : TMethod; OK : Boolean; Disp : THttpDispatchElement; SObj : TUrlHandler; begin for I := 0 to FPutHandler.Count - 1 do begin Disp := FPutHandler.Disp[I]; PathBuf := Disp.Path; J := Length(PathBuf); if PathBuf[J] = '*' then begin SetLength(PathBuf, J - 1); Status := AnsiStartsText(PathBuf, ClientCnx.Path); end else Status := (CompareText(PathBuf, ClientCnx.Path) = 0); { if HostTag specified, match it } {$IFDEF USE_SSL} if Status and (ClientCnx.HostTag <> '') and (Disp.HostTag <> '') then begin if (Disp.HostTag <> ClientCnx.HostTag) then Status := False; end; {$ENDIF} if Status then begin Result := TRUE; if ExecFlag then begin { V9.1 support upload using PUT } Disp := FPutHandler.Disp[I]; Flags := Disp.FLags; OK := TRUE; if Disp.Proc <> nil then begin Proc.Code := Disp.Proc; Proc.Data := ClientCnx; ClientCnx.BeforePutHandler(TMyHttpHandler(Proc), OK); if OK and (Proc.Code <> nil) then TMyHttpHandler(Proc)(FLags); end else if Disp.SObjClass <> nil then begin SObj := Disp.SobjClass.Create(Self); try SObj.FClient := ClientCnx; SObj.FFlags := Disp.FLags; SObj.FMsg_WM_FINISH := FMsg_WM_FINISH; SObj.FWndHandle := FHandle; SObj.FMethod := httpMethodPut; ClientCnx.OnDestroying := SObj.ClientDestroying; ClientCnx.BeforeObjPutHandler(SObj, OK); if OK then begin SObj.Execute; Flags := SObj.FFlags; end else begin Flags := SObj.FFlags; FreeAndNil(SObj); end; except on E:Exception do begin FreeAndNil(SObj); if Assigned (FOnVirtualExceptionEvent) then FOnVirtualExceptionEvent (Self, E, httpMethodPut, ClientCnx.Path); end; end; end; end else begin { V9.1 support upload using PUT } { V9.1 abort request now if content too large } if (FMaxUploadMB > 0) and ((ClientCnx.RequestContentLength div IcsMBYTE) > FMaxUploadMB) then begin Flags := hg403; Exit; end; { V9.1 create stream, FileStream for very large content, otherwise MemoryStream } ClientCnx.MaxPostMB := FMaxStreamMB; if (FMaxStreamMB > 0) and ((ClientCnx.RequestContentLength div IcsMBYTE) > FMaxStreamMB) then begin if FUploadDir = '' then FUploadDir := IcsGetTempPath; FUploadDir := IncludeTrailingPathDelimiter(FUploadDir); ClientCnx.PostTempName := FUploadDir + 'ics-httpserv' + IntToStr(Random(999999999)) + '.tmp'; ClientCnx.PostedDataStream := TIcsBufferedFileStream.Create(ClientCnx.PostTempName, fmCreate OR fmShareDenyNone, MAX_BUFSIZE); end else begin //// 19/11/2024 Yves Vermeersch // Fix memory leak if Assigned(ClientCnx.PostedDataStream) then ClientCnx.PostedDataStream.Free; //// End fix ClientCnx.PostedDataStream := TMemoryStream.Create; TMemoryStream(ClientCnx.PostedDataStream).SetSize(ClientCnx.RequestContentLength); end; { V9.1 content PostData pointer will be set if accessed, ditto TBytes and String version } ClientCnx.PostedDataLen := 0; ClientCnx.FPostedDataPtr := Nil; { V9.1 } SetLength(ClientCnx.FPostedDataTB, 0); { V9.1 } ClientCnx.FPostedDataStr := ''; { V9.1 } ClientCnx.FLineMode := FALSE; Flags := hgAcceptData; end; Exit; end; end; Result := FALSE; end; OverbyteIcsHttpAppServer.pas
  20. Anders Melander

    Clipboard history

    Again: Not a part of the clipboard system; A layer on top of it. It is not a single global history that is managed somewhere. It is just individual services that maintain their own history. So not "the clipboard" history but "a clipboard" history.
  21. Why don't you use what I proposed? You will always get an 8 characters key and make use only Delphi RTL functions. Please comment on this. I proposed you use CRC32 which is a kind of hash. https://docwiki.embarcadero.com/Libraries/Sydney/en/System.ZLib.crc32 IntToHex: https://docwiki.embarcadero.com/Libraries/Sydney/en/System.SysUtils.IntToHex
  22. Rollo62

    Clipboard history

    It works on my Win 10 and Win 11 systems, although I confess that I never used this before. AFAIK there are methods to access the ClipboardHistory under Windows, which are implemented in WinRT only. Never used that either, mainly because the WinRT requirement.
  23. Henry Olive

    Wrap texts in DBGrid

    D-10,4 Good Day MyField = Varchar(1500) MyDBGrid.Width = 400 Is it possible to wrap texts inside each row if my field's data longer than dbgrid field width ? Something like below ID History 1 aaaaaa bbbbb cccccc 2 xxxxxx Thank You
  24. "as short as possible" is not a usable specification. The shortest possible key is zero characters long. The longer the key, the fewer key collisions. You need to specify the exact length you want your key to be. Also, are you really sure that you want to hex encode the key? With hex encoding you are wasting half the bits by using 8 bits (i.e. an ansichar) to represent a 4 bit value (i.e. a hex digit). A more efficient encoding would be something like Base32 (5 bits per byte) or Base64 (6 bits per byte). I believe Delphi has implementations of both. Search the source (or wait for someone here to write what they are, as I'm sure they will do).
  25. Anders Melander

    migrating projects to RAD Studio 12

    I think I can see the problem: You are referencing the Form1 global variable before it has been assigned a value; Your code is in the constructor (or more precisely: an event handler called from the constructor) and the Form1 value isn't assigned until the constructor returns. Do like this instead: void __fastcall TForm1::FormCreate(TObject *Sender) { ... for(j = 0; j < c; j++) { pLayer[j] = new TBitmapLayer(this->ImageBackground->Layers); pLayer[j]->Bitmap->DrawMode = dmBlend; pLayer[j]->Scaled=true; } ... } or simply: void __fastcall TForm1::FormCreate(TObject *Sender) { ... for(j = 0; j < c; j++) { pLayer[j] = new TBitmapLayer(ImageBackground->Layers); pLayer[j]->Bitmap->DrawMode = dmBlend; pLayer[j]->Scaled=true; } ... } Of course it would be best if you could avoid all those global variables (not Form1 but all the others). I don't know if they were just there for debugging this problem.
  26. Remy Lebeau

    Unable to save from TImage to file

    SizeOf(StringStream) This is wrong. This is the size of a pointer. How many bytes are you expecting the client to send? What does the client code look like? Ideally, the client should send the JSON's size before sending the JSON's data, and then the server should read the size before the data. IOHandler.Write(TStream) and IOHandler.ReadStream() can handle that for you, but not the way you are currently using IOHandler.ReadStream(). The client can call IOHandler.Write(TStream) with AWriteByteCount=True, and the server can call IOHandler.ReadStream() with AByteCount=-1 and AReadUntilDisconnect=False. That being said, since JSON is textual data, I would suggest using IOHandler.ReadString() instead of IOHandler.ReadStream(). Also, the preferred encoding for JSON is UTF-8 not ASCII. IdDecoderMIME1.DecodeStream(JSON.GetValue('image_encoded').Value, MemoryStream); ... Image1.Bitmap.LoadFromStream(MemoryStream); You are not rewinding the TMemoryStream back to position 0 before loading it. So the TImage ends up blank before you save it to file.
  27. KimHJ

    Android aidl error when using it.

    Yes, it compiles and it prints. First It didn't print, but then I added the command Nextline(1) first and PrintText after then it printed. Now I just need to create the rest of the app. I'm working on two different apps at the same time as you can see on my posts, not getting enough sleep lately. Again, thanks for all your help.
  1. Load more activity
×