Jump to content

All Activity

This stream auto-updates     

  1. Past hour
  2. Georgge Bakh

    This implementation is Thread-safe?

    If I got it right, you protecting with a critical section (the same one I hope) read access to fields as well as field modifications with change event call. This may be or may be not enough depending on what your program do and what invariants you must ensure. Additionally, with some logic in change event handler there is a risk of deadlock.
  3. Today
  4. Bill Meyer

    Download issues

    I see. I guess I was moving too quickly and didn't read your notes.
  5. Dear David, Pls... What am I telling 🙂 and what am I writing. Please do not write without testing the samples. This is not a help. We extend the subject in vain. Would you please make an example code?
  6. I have a base data class that is used for multithreaded data classess in my project. I made an implementation to reduce thousands of lines of code, which theoretically should work, but even with some successful tests, I am afraid to release a version to the end user without being sure. function TipCustomData.GetSafeValue(var AField: string): string; begin Lock; // Enter critical section try Result := AField; finally Unlock; // Leave critical section end; end; procedure TipCustomData.SetSafeValue(var AField: string; const AValue: string); begin BeginUpdate; // Enter critical section try if AField <> AValue then begin AField := AValue; Change; end; finally EndUpdate; // Leave critical section triggering change event end; end; In the code above, the most intuitive in these cases would be to use the field pointer, but as "var" parameters internally it is already passed as a pointer (regardless of type), so both implementations should work in the same theoretical way (correct me if i'm wrong). Of course, I only access the parameters within the critical section. The implementation of my multithreaded data class, descendant of this, would be for example like this: type TipUser = class(TipCustomData) private FName: string; function GetName: string; procedure SetName(const AValue: string); public property Name: string read GetName write SetName; end; function TipUser.GetName: string; begin Result := GetSafeValue(FName); end; function TipUser.SetName(const AValue: string); begin Result := SetSafeValue(FName, AValue); end; So the question is, is this cleaner implementation that could exist of a multithreaded data class, is it really thread-safe? Sorry for my bad english. 😉
  7. Streams don't know about encoding. You might better do with a TStreamReader. In its FillBuffer method there is some code taking care of your concern (look for ExtraByteCount).
  8. David Heffernan

    Andorid Char xor is this a delphi bug or is it my fault?

    If you are working with AES encryption then the entire topic is moot because you should not be using text at all. Your entire code should operate on bytes.
  9. David Heffernan

    Reading large UTF8 encoded file in chunks

    https://stackoverflow.com/questions/56724326/find-longest-utf-8-sequence-without-breaking-multi-byte-sequences Self synchronisation is the keyword. Once you understand that then the code will emerge.
  10. Hi, I'm using Delphi Rio to read some rather large log files ( some might have 5Gb). The encoding might be Ansi or UTF8. The log files are created from different systems and each encodes differently. I would like to use TFileStream ( or TBufferedFileStream) to read the file in chunks of 32k, but how can I be sure that an UTF8 character split between chunks will be decoded correctly?
  11. No, this is not a tstringlist issue. this is officially chartable difference. You will see the difference when each char 0..to bla bla binds to numeric or character. char (8) > 10 char (9) > t tab linux android This is a serious mistake. It affects thousands of delphi android users. Think a little. Your application on Android sends data to an application on windows. I'm not asking questions easily. I solve all my work myself. However, this made me drink "alcohol jack daniels oopss I put a reset on my brain." for exactly 1 week 🙂 Delphi needs to urgently a patch. You will either tell the project settings that you want to use the charset table, or it should offer two different char set options for windows and android.
  12. I think, it's a bug in the TStrings visualizer, not in the code itself. Your program should work correctly both in Windows and Android. Nevertheless, I suggest use TBytes for byte manipulation instead of UTF8String. See "Delphi in a Unicode World" by Nick Hodges, Chapter "USING STRINGS AS DATA BUFFERS".
  13. Probably the person I gave the job will not be able to do it but he insisted he said. 🙂 We will see it all together. Dear friends, I hope you have a good understanding of what I want. Look, this is such a big problem. Think a little, you will understand. Thanks for your nice words Dany, I try to give as much detail as I can. It seems that I will not be able to solve the problem here. I gave this problem as a "freelancer" as a job. 250$ 🙂 https://www.freelancer.com/projects/delphi/Android-Project-for-Delphi/payments/
  14. Dany Marmur

    Why can't I install this monospaced font in Delphi ?

    Lars still prefers Source Code Pro.
  15. @Turan Can i do not use Delphi like you do, so i know nil about your specific problem. But i must give you points for you calmness and courage in you replies, especially considering the language barrier. That is the plus i gave on the OP. Other posters get annoyed, frustrated and angry. Keep it up!
  16. Hi Kas, It is no different from the jeans sample I made. your sample test. I added 2 pictures windows and android. This problem is actually a charset table problem. Possibly differences in windows charset and linux android char sets. For this problem, Delphi had to come up with a solution. Example: At the start of the project, I started to think that there should be a setting like setwindows charset table. So what is the source of the problem why I need this 🙂 I use AES 256 bit and the same data should be the same in andorid and linux. https://github.com/Turan-Can/Delphi-Encryption-Compendium
  17. dummzeuch

    [Bug] Line breaks - Local procedures

    Please file a bug report on SourceForge
  18. dummzeuch

    Download issues

    These are the links about the virus scanner false positives. The download links are below that and these work fine (at least for me here on the hotel WiFi).
  19. dummzeuch

    Code formatter in CnPack

    I didn't follow this thread so I had to scroll way back to see what it is about. There are various options to insert/remove line feeds in if then else statements. Have you tried them? If they don't satisfy your needs or think there is a bug, please file a feature request or bug report on sourceforge, detailing exactly what you want. Of course you are also free to implement any necessary changes yourself an provide a patch.
  20. Attila Kovacs

    Andorid Char xor is this a delphi bug or is it my fault?

    It shows the values as octal up to 31 except TAB. Nice.
  21. David Heffernan

    Andorid Char xor is this a delphi bug or is it my fault?

    Everything is fine here. No bug in Delphi. However, your code that performs xor on character ordinal values and pushes the output back into strings is defective.
  22. The /t is Horizontal tab, it is #9 like Carriage Return (CR) is #13 and Line Feed (LN) is #10, but why the debugger shows only the /t while shows #010 instead #008 while #010 should be /n ? That might be a bug in the parser inside the visualizer only.
  23. @Turan Can Try this var Ch: Char; I: Integer; T: TStringList; TT:array [0..299] of Char; TTIntValues:array[0..299] of Integer ; begin T := TStringList.Create; for I := 0 to 300 - 1 do begin Ch := Char(I); T.Append(Ch); TT[I]:=Char(I); TTIntValues[I]:=Ord(TT[I]); if TTIntValues[I]<>I then raise Exception.Create('Error, char value is wrong'); end; end; The content of TTIntValues is valid and right as it should, with no exception been raised, what you see in #010 or /t are just how the visualizer/debugger interprets and shows those special character, here i can't say for sure if it is right or wrong, but the value in those chars are 100% right.
  24. Dear friends; First of all, thank you for your answers. There are two results in the picture. Is this true ? Do I need to use something different for the character table? I wrote a very simple code at the bottom. This will explain everything David and Atilla, this code will work Please run windows first and then android. Look into the list. I made it in the picture below. procedure TForm1.Button9Click(Sender: TObject); var Ch: Char; I: Integer; T: TStringList; begin T := TStringList.Create; for I := 0 to 300 - 1 do begin Ch := Char(I); T.Append(Ch); end; end;
  25. Yesterday
  26. ŁukaszDe

    Code formatter in CnPack

    I added a task, but unfortunately no response. I try GExperts but works same. @dummzeuch is is possible?
  27. ŁukaszDe

    [Bug] Line breaks - Local procedures

    When selected option is on than two spaces before local procedure/function are missing. Tested on GExperts 1.3.15 build 84 version.
  1. Load more activity
×