Jump to content

Leaderboard


Popular Content

Showing content with the highest reputation on 02/27/21 in all areas

  1. Rollo62

    Delphi 10.4.2 first impressions

    I would propose, when 1st testing, better don't install unnecessary components. Normally I do some very pure test runs first, before I add more stuff. With that approach its easier to find the library or expert that causes issues.
  2. KodeZwerg

    Totally new to this area

    Hashes and Checksums are calculated over that file, it aint 'branded/marked'. The only way is to modify image to get a modified result from one of those methods (sha1/md5/crc) You can not define such.
  3. Daniel

    Delphi 10.4.2 first impressions

    @PingPIng Strange visual effect. Do you have any 3rd-party components installed? I could not (yet) see this here.
  4. David Heffernan

    Totally new to this area

    Use websearch. That's all we would do.
  5. KodeZwerg

    Totally new to this area

    Thanks @David Heffernan for pointing that out. Heres a quick and dirty fix. It is limited by memory and fail if dont fit in RAM. Uses System.SysUtils, System.IOUtils, System.Hash; function HashFileSHA1(const FileName: string): string; var HashSHA1: THashSHA1; Memory: TBytes; begin Result := ''; if FileExists(FileName) then begin Memory := TFile.ReadAllBytes(FileName); HashSHA1 := THashSHA1.Create; HashSHA1.Update(Memory); Result := HashSHA1.HashAsString; end; end;
  6. KodeZwerg

    Totally new to this area

    Here small code for Delphi to get hashes. function GetFileHashMD5(FileName: WideString): String; var HashMD5: THashMD5; Stream: TStream; Readed: Integer; Buffer: PByte; BufLen: Integer; begin HashMD5 := THashMD5.Create; BufLen := 16 * 1024; Buffer := AllocMem(BufLen); try Stream := TFileStream.Create(FileName, fmOpenRead or fmShareDenyWrite); try while Stream.Position < Stream.Size do begin Readed := Stream.Read(Buffer^, BufLen); if Readed > 0 then begin HashMD5.update(Buffer^, Readed); end; end; finally Stream.Free; end; finally FreeMem(Buffer) end; Result := HashMD5.HashAsString; end; function GetFileHashSHA1(FileName: WideString): String; var HashSHA: THashSHA1; Stream: TStream; Readed: Integer; Buffer: PByte; BufLen: Integer; begin HashSHA := THashSHA1.Create; BufLen := 16 * 1024; Buffer := AllocMem(BufLen); try Stream := TFileStream.Create(FileName, fmOpenRead or fmShareDenyWrite); try while Stream.Position < Stream.Size do begin Readed := Stream.Read(Buffer^, BufLen); if Readed > 0 then begin HashSHA.update(Buffer^, Readed); end; end; finally Stream.Free; end; finally FreeMem(Buffer) end; Result := HashSHA.HashAsString; end; Uses Sytem.Hash <<- insert that into your uses clause Maybe that code help you. Taken from Embarcadero Examples. Ps. FMX might be wrong for this topic 🙂
  7. David Heffernan

    Totally new to this area

    Yes, but it easier just to use a command line tool to do this. You don't need any components. Delphi comes with a library of hash functions. That doesn't make much sense. A hash function is a function that maps an arbitrary length array of bytes to a fixed length array of bytes. Your image file is the input to the hash function. Multiple different inputs can yield the same has for fairly obvious reasons. Reading about hash functions would be useful for you.
  8. Mike James

    Problems with FMX.CameraComponent Sample

    I can confirm that the update fixes the Green-flashing on my FMX.CameraComponent app. Thanks to one and all... -<mike>-
  9. Rollo62

    TNothingable<T>

    Don't worry, emptiness is full of everything, thats what physicist's know today
  10. Attila Kovacs

    TNothingable<T>

    @Rollo62 Sometimes I have no Idea what am I talking about. Saint Augustine, on being asked what is time: "I know what it is, but when you ask me I don’t."
  11. Uwe Raabe

    How to get json array from string?

    Declare a class like this and create an instance with TJson.JsonToObject from REST.Json.pas: type TMyJson = class FResult: Integer; FIdList: TArray<Integer>; end; const cJson = '{"RESULT":200, "IDLIST":[1,2,3,4,5]}'; var myJson: TMyJson; begin myJson := TJson.JsonToObject<TMyJson>(cJson); try for var I := 0 to Length(myJson.FIdList) - 1 do { do something with myJson.FIdList[I] } finally myJson.Free; end; end;
  12. https://www.finalbuilder.com/resources/blogs/dpm-package-manager-progress-update
  13. Vandrovnik

    Delphi 10.4.2 first impressions

    You can use: TDummyDict = class(TDictionary<String, TDummy>); Then Ctrl+click works as expected. Content of tList<> - I have tried and it seems it works, or is it something else?
  14. Arnaud Bouchez

    Edge Webview update (?)

    Personal note: each time I see GetIt involved, I remember that mORMot was never accepted as part of it because it was "breaking their license policy". In short, you could use any Delphi version (even the free edition) and create Client-Server apps with it. I guess this is the same reason the great ZEOS library or even UniDAC are not part of it, if I checked correctly their registration. That's why I prefer more open package solutions like Delphinus and I hope in the future the very promising https://github.com/DelphiPackageManager/DPM Old but still relevant discussion at https://synopse.info/forum/viewtopic.php?pid=17453#p17453
  15. Uwe Raabe

    optset files

    I often have different optset files containing unit search path entries. Usually I separate them by library name. F.i. there is one optset for TMS Scripter or GLScene, where several folders have to be added to the search path. As my folder layout for projects is consistent, the search path for each library is the same for each project. Thus I only have to add that optset to each project (only the first one, the others with drag'n'drop) to add the necessary folders to the project search path. As a gimmick I can see immediately which libraries a project depends on. This is als pretty convenient when the projects inside a project group share a couple of local folders in their search path. Using an optset for that makes changing the search path for all projects at once just a breeze. Unfortunately FinalBuilder is not able to resolve those optset references. Therefore I have written a small program doing that, which is called immediately before the compile action. Regarding RSP-14723: Indeed, optset references are not removed from the dproj. As that is not very common in my workflow I usually fix this by editing the dproj manually.
  16. balabuev

    Delphi 10.4.2 first impressions

    1) I see Code Insight no more completes identifier when I type "." (dot) or any other symbol like semicolon or open round bracket in the following editor state: This seems to me as a big regression. 2) Overall, this new nonblocking code insight idea is really a pain in pactise, because I have to wait each time until drop-down window is appeared (which happens with a delay) before continue typing. In the above situation in XE2, for example, I can very quickly press Ctrl+Space and then ".", and be sure that "Canvas." will be typed. But, with async drop-down window the result depends of typing speed.
×