Jump to content

Edwin Yip

Members
  • Content Count

    430
  • Joined

  • Last visited

  • Days Won

    3

Everything posted by Edwin Yip

  1. Edwin Yip

    String optimization

    Well done sir! BTW, what tool(s) do you use to measure the performance? Thanks.
  2. Edwin Yip

    Skia4Delphi v3.0.0

    Your hard work greatly improved the richness of drawing/painting/image-processing/animation abilities of Delphi! Thanks!
  3. Edwin Yip

    simple SFTP-like server for Windows?

    My experience has shown that FreeSSHd is better than FileZilla.
  4. Hi David, for simple use cases, the generic collections are simpler. However, please consider situations where you need to add a bunch of methods such as CopyFromLeft, CopyFromRight, Each, GetPropertyValuesByNameAsCSV, and so on, to the enhanced list class. In this case I have two options, and I'll outline the pros and cons: Inherit from the generic TObjectList<> Pros: Can eliminate some of the typecasting, but not all, without techniques such as Curiously Recurring Generic Pattern the OP is presenting. Cons: From time to time, the compiler emits strange internal error and I'll have to restart the IDE. bloated EXE sizes. Inherit from the non-generic TObjectList Pros: No strange compiler errors. No strange bloated EXE sizes. Cons: In order to eliminate all typecasting for the list users, you'll have to make a derived class for each object. That being said, I might be wrong, but my gut feeling is using the non-generic TList/TObjectList is more comfortable, especially without the need to constantly restart the IDE. By IList, sorry for not being clearer, it's from Spring4D which is excellent, so it just occurred to me. I should have said TList<>.
  5. This is a good technique, but speaking of generic collections, honestly, after using it in several projects, now except for dictionaries, I've gone back to using the non-generic collections from `System.Contnrs`. In order to make it comfortable using the object lists, all I have to do is to override the `Items` property for a specific class, like this: TAddressList = class(TEyObjectList) // TEyObjectList is an enhanced descendent of TObjectList protected function GetItem(Index: Integer): TAddress; procedure SetItem(Index: Integer; aObj: TAddress); public property Items[Index: Integer]: TAddress read GetItem write SetItem; default; end; Making such derived class is a 10-seconds operation with the help of MMX's class templates and Find-and-Replace. Maybe it's just me, but I really don't find too much cases where a `IList` can serve both the objects and string items (for example) well. Maybe for library writers it's good to have a collection to rule them all, but for users of libraries, specificity is a good thing. Another burden is the lame support of generics of the Delphi compiler...
  6. FYI, XE4 can compile the tests, after removing the inline var statements.
  7. Edwin Yip

    Frequent and/or annoying typos you make while coding

    This is where GExperts Code Proofreader come to rescue. I couldn't code without it. When I encounter situations like what @dummzeuch described, I don't disable it, doing that is like a Chinese old saying: ;) You can get around it, can't you? For instance, use another var name instead.
  8. Edwin Yip

    For gui information

    HTML Component Library + StyleControls from almdev can do that.
  9. Hi Ian, By "for Unicode" it means it can be compiled and run correctly under Delphi 2009 plus, of course it also works for ANSI. The repository already contains a libhunspell.dll in the demo subfolder. Hope it helps.
  10. Edwin Yip

    Spell Checker implementation?

    So after: I failed to upgrade LS Speller to support Unicode Delphi, found that the TMS one from 2017 is not fast enough for me, none of the above mentioned Hunspell wrapper has a dialog which directly operates on TRichEdit/TMemo In the end I found on Torry.net another hunspell wrapper originally written by Stefan Ascher, and have upgraded to support Unicode Delphi. Check my new post if you are interested:
  11. Edwin Yip

    Spell Checker implementation?

    Very helpful and quite complete list and details about spell check libraries by Darian, thanks for sharing! I use the LS Spell Checker mentioned above in a project written in D7 (and contributed fixes back to Luzius the author in the past). Now I need a unicode version (for D2009 and above). I tried to modify it and it seems to be tricky since it mostly deals with character strings. So I wonder, if anyone has a unicode version of it and can you share it with the rest of us? And happy new year to every one in the forum!
  12. The official QOI repo as 3.8K stars, no bad.
  13. The Image32-based controls demo is cool! And this seems to be a new feature added most recently.
  14. @Ann Lynnworth, I'm not encourage nor pushing you to work on CJK words support in your FTS library, because I honestly think SQLite FTS is excellent already, even without Chinese word support built in, it allows me to supply call back procedures to overcome that, if I want to, thanks to the excellent works by authors of both SQLite and mORMot. But since you are interested, here are some points that might be of helpful: No, spaces used in Chinese writings are not for delimiting words, it's impossible to just use spaces and punctuation to segment Chinese words. Translation shown by services like Google Translate is a result of hard works by CS researchers all around the world in the past 4 or 5 decades. Yes, decades. It's not always feasible for a desktop app to use Google API, even if it provides the word segmentation service (which I don't think so as far as I know). Further more, in case of China, we have the GFW, which makes it impossible to use Google API. The 'cola' translation is not a mistake, but rather a local 'alias' (maybe only limited to that place) to cocaine :D
  15. Hah, yes, languages in the world are extremely diverse. Algorithms exist, and open source projects too, some in c and some in golang on github. AFAIK, there is only one in Pascal: https://github.com/PassByYou888/zChinese, but I don't know how good it's and the size of the files.
  16. Well, I must say, from your description I already know it most likely doesn't support it, because you didn't know CJK words have no word delimiters ;)
  17. Sure, because Chinese, Japanese and Korean have no such a thing as word delimiter :D Word segmentation, is a fundamental and professional term in your area, I guess.
  18. @Ann Lynnworth, Does it support CJK words? SQLITE FTS does not, and that's my only complain about it.
  19. Yes. No. Re. FTS5 sample compile-able with Delphi, I know at least mORMot (which I use) and DISQLite have that. Hope it helps.
  20. Thanks for the answers Ann. I use mORMot for db connection. Just one note - if you take full-text search seriously (I know you do), you cannot ignore SQLite's FTS3/4/5 (with code sponsor from the Google search team) because it's the currently the number one embedded/desktop FTS engine in the world. The features you described seems to be all supported by SQLite FTS as far as I know.
  21. Edwin Yip

    My new project : WebView4Delphi

    Great! Another amazing project by you! What's the planned supported Delphi versions ;)
  22. A few questions if you don't mind. How does it compare with SQLite's FTS? ( would appreciate a genuine comparison table). Does the db backend support SQLite? Has built-in support (asking this because I don't use FireDAC, ADO nor IBExpress )? No support for earlier versions of Delphi prior to XE8?
  23. Edwin Yip

    WebView2 synchronious calls

    Sorry, but I'm able to help as I don't use it, but may I start a small not-so-off-topic discussion? When I first read from your post that winsoft has a WebView2 wrapper which supports old version of Delphi, I was exciting, thought that old Delphi can finally have the "TEdgeBrowser" component introduced in newer Delphi. Than I realized that in order to use it, the client PC would have to download a 123 MB WebView2 runtime! Oh, in that case, I think I'll keep using our good old Cef4Delphi... I'm puzzled, it seems that TEdgeBrowser also request that 120+ MB WebView2 run-time. I mean, why bother? Why not just use cef4delphi which provides you much more power and flexibility? This is a genuine question.
  24. Hi all, I've just encountered an issue that's quite strange and it took me hours to figure out but still couldn't confirm where dose it come from. The situation I found is like this: Let's say we have a VCL program with DPI-aware enabled (with xml manifest correctly set, all forms have `Scaled` set to true and working), and the form inheritance is like this: TFormC inherits from TFormB which in turn inherits from TFormA, which have some buttons on some panels. I found that, when running on a computer with different system DPI, TFormA will be auto scaled for 1 time and it's correct. But TFormB will be wrongly scaled and shifted twice, while TFormC will be scaled and shifted for 3 times. All other forms, even with form inheritance, but since there is no controls on the parent forms, the auto-scaling works. I'm not sure if it's related to my Delphi version and I use XE4, I wonder anyone can confirm if the issue comes from form inheritance?
  25. @Stano, great, thanks for the helpful info, I'll try that and come back here with meaningful info!
×