Jump to content

Leaderboard


Popular Content

Showing content with the highest reputation on 09/14/24 in Posts

  1. softtouch

    Delphi 12.2 available for download

    So they assume that user using the Pro version do not create large projects? I think its more a money thing again.
  2. Can also use the command line utility certutil. Supports calculating MD2 MD4 MD5 SHA1 SHA256 SHA384 and SHA512 hashes. certutil -hashfile <file> <algorithm>
  3. Would BSON (Binary JSON) and not JSON be better in this situation?
  4. Remy Lebeau

    Converting images to JSON and Send to Server

    How so, exactly? It is just a string field, JSON doesn't care what its content is. When you get the string back, simply parse it to extract the base64 substring after the comma, and then decode that substring to get the raw bytes that you can then save to a file. IOW, just reverse the code that created the string. For example: procedure Base64ToImage(const Base64String, FilePath: string); var FileStream: TFileStream; Bytes: TBytes; begin Bytes := TNetEncoding.Base64.DecodeStringToBytes(Base64String); FileStream := TFileStream.Create(FilePath, fmCreate); try FileStream.WriteBuffer(Pointer(Bytes)^, Length(Bytes)); finally FileStream.Free; end; end; procedure LoadBase64JsonToImage; var JSONObject: TJSONObject; Base64String: string; JSONString: string; JSONFile: TStringList; begin JSONFile := TStringList.Create; try JSONFile.LoadFromFile('image_base64.json'); JSONString := JSONFile.Text; finally JSONFile.Free; end; JSONObject := TJSONObject.ParseJSONValue(JSONString) as TJSONObject; try JSONString := JSONObject.GetValue('image_data').Value; finally JSONObject.Free; end; Base64String := Copy(JSONString, Pos(',', JSONString)+1, MaxInt); Base64ToImage(Base64String, 'path/to/image.jpg'); end; You are not supposed to save the entire string to a file. Just as the string wasn't produced entirely from a file to begin with, but from a text and a file.
  5. Yep! I first made use of that almost 10 years ago in a class holding translation strings. Before that the strings were indexed by an Integer, but later we extended that to string indices. property Items[Index: Integer]: string read GetItems; default; property Items[const Index: string]: string read GetItems; default; The interesting part was that both are marked as default properties, which allowed us to simply write something like this: Label1.Caption := Translations[42]; Label2.Caption := Translations['Error']; The most benefit came from the fact that we could keep the Integer based translations and simply add the string based ones - all using the same Translations instance.
  6. Anders Melander

    Delphi takes 9 seconds to start/shutdown an empty application

    So get a new MB that support the CPU you'd like. In my current system I have upgraded the MB in my system 3 times, the CPU 6 times, the GPU 2 times and the PSU 2 times. Always with newer and faster models. The only thing I haven't replaced is the 20 year old case (Lian Li PC-2100B tower) but that too will go the next time. I don't really need 12 internal and 6 external storage bays anymore 🙂 and being full aluminum it's quite noisy with all the fans. Probably Windows Update. That's a repeat offender on my system.
  7. Anders Melander

    Delphi takes 9 seconds to start/shutdown an empty application

    The CPU alone would be enough to explain the difference. I'm guessing your old CPU was a AMD Ryzen 8700G which is 5-6 times faster than your new CPU. https://www.cpubenchmark.net/compare/2962vs5836/Intel-i5-7440HQ-vs-AMD-Ryzen-7-8700G In addition, the support circuits (all the stuff that's not the CPU), being laptop components, are most likely optimized for energy efficiency rather than performance. My own laptop, a Lenovo X1 Extreme, was at the time I bought it the fastest (and most expensive 😞 ) laptop Lenovo produced but the performance is still... meh.. not impressive. The RAM will also make a difference. Windows 10 will be able to handle 16Gb better than Windows 7 did but it's still on the lower side. I think the best thing you could do with this hardware is to add more memory. Depending on the current memory configuration you should be able to upgrade to 32Gb. If I was you I would spend my effort on fixing your old system. Replace the parts that are dead. If you limit yourself to parts (CPU/MB/RAM/GPU) that are a few years old you can build a really good system on the cheap. I reluctantly upgraded my main system from Windows 7 to 10 earlier this year. I had feared that it would kill the performance of my 10+ old system (Intel i5-2500K @ 3.30Ghz, 16Gb) but it actually performs pretty good. In many cases better than the old system did.
  8. zed

    SQLite with Delphi 7

    Extract sqlite3.dll into the folder where Delphi outputs your application .exe file, and use this wrapper: https://github.com/plashenkov/SQLite3-Delphi-FPC (there is a usage example: https://github.com/plashenkov/SQLite3-Delphi-FPC/blob/master/Examples/Delphi/Main.pas).
  9. corneliusdavid

    SQLite with Delphi 7

    It looks like ZeosLib is still active: https://sourceforge.net/projects/zeoslib/ I have no experience with it but recent updates says it supports Delphi 7 through 12.
  10. Vandrovnik

    Delphi 12.2 available for download

    I wonder: is anyone going to upgrade from PRO to ENTERPRISE / ARCHITECT to have 64bit version of compiler?
×