Jump to content

Fr0sT.Brutal

Members
  • Content Count

    2268
  • Joined

  • Last visited

  • Days Won

    46

Everything posted by Fr0sT.Brutal

  1. Fr0sT.Brutal

    Organizing enums

    In one case in multi-project complex I use constants for datatype. I'm 100% sure they won't change except adding new values so I carve them in stone. Not an option I like currently, now I think I'd better use mnemonic chars for this. There are several cases where I use mnemonic chars (abstract sample - 'M' for male sex, 'F' for female, whatever else for any possible later addition). For (de)serialization when dealing with files I use enum names and sometimes array of values if I don't want prefixed names to appear. Everything might change but enum names usually change less frequently.
  2. Fr0sT.Brutal

    Organizing enums

    Hmm, I think of enums like of an abstraction. I don't care what number has "enumFoo", I often won't notice if it had no number at all. All I want is that "enumFoo" is member of type "TEnumFoo" and (sometimes) that it goes after "enumLaz" and before "enumBar". If I need to let it go beyond my application, I'll use its string name "enumFoo" or special string from "FooNames: array[TEnumFoo] of string". Number values are applied only when I'm sure the definition of enum is consistent (f.ex., between two apps of the same complex).
  3. Fr0sT.Brutal

    Listview control with filtering like File Explorer

    Well, open source doesn't mean "crowd-developed". Look at Chromium or .Net Core - I doubt they accept every change. It's about making source available so that users could send suggestions that probably have a chance to be applied. Wait, oh shi- - more or less things with RTL/VCL already similar to this, and were since the very start.
  4. Fr0sT.Brutal

    What is the best way to split off a new project?

    That was a joke. The unit I mentioned is one from ICS library which was created by Francois himself. I don't practice making huge units neither. Probably the biggest is SimpleXML which I adopted and deeply modified and it has only 6500 lines.
  5. Fr0sT.Brutal

    Organizing enums

    If you use ordinal values of an enum you already are likely to get into trouble, not talking about data exchange with other systems.
  6. Fr0sT.Brutal

    Listview control with filtering like File Explorer

    Nothing prevents from inheriting from Richedit and extending its features. If that wasn't done already then seems no one needs it
  7. Fr0sT.Brutal

    What is the best way to split off a new project?

    OverbyteIcsWSocket: ~25500 lines 😄
  8. Fr0sT.Brutal

    Organizing enums

    +1. The most useful and powerful Delphi feature which I miss in other languages. These bunches of constants are just ugly and - what's more important - they do not allow type checking.
  9. Well, you only asked for Delphi , Node and VSCode living together. No Alexa stuff was mentioned. If it really requires the whole mess you described, then I'm afraid all you've got to do is suffer.
  10. Umm what?? Compilation involves installation of ~1Gb of build stuff and ~3Gb of sources. I only tried it after years of using Node just to get rid of full ICU built-in that increases binary size by 15 Mb. I even not use Node setup but just a zip that I extract over existing installation and that's all. One of things I like in Node is that it's very portable. You can just copy node.exe to a completely new OS and it will work.
  11. Fr0sT.Brutal

    how to classify and match error message patterns?

    Then just use regexp Error in (.+?), (.+?): Import error - CUSTOM CODE ERROR: (.+?) to extract message contents. But don't forget to check that substituted values doesn't contain separator values or you can get unexpected results
  12. You only need WindowsBuildTools for building Node itself, not running apps with it. So no problem, Node could live locally and almost portable and VSCode could be installed in really portable mode which is my favorite mode.
  13. Fr0sT.Brutal

    ICS crash

    From the code above I see you just trying to use async event-driven classes in sync mode. While this approach appears in several places in ICS itself, it's not a recommended way of using. You must understand the consequences. The simplest example is: if you launch this code from button click, MessagePump will retrieve and dispatch all Windows messages so the button will be unpushed and user will be able to push it again. P.S. In fact, I never used this function so I could be wrong here. I'm surprised to see it in ICS methods besides TCustomSyncWSocket.WaitUntilReady.
  14. Fr0sT.Brutal

    ICS crash

    Why do you need Socket.MessagePump at all?
  15. Just wondering: what's the sane usage scenario this Frankenstein's monster has?
  16. Fr0sT.Brutal

    how to classify and match error message patterns?

    With some efforts made to handle Firebird error messages I realized one thing - if you need to automatically handle errors (group, summarize etc) then better not try to extract necessary data from the constructed message, just return this data as-is in an array together with integer error code. HTH Side note: I got rid of ` Raise Exception.Create( Format( ...` in favor of ` Raise Exception.CreateFmt( `* because it's a bit shorter and - what's most important - doesn't add implicit finalization block to a subroutine which significantly slow down execution of subroutines without explicitly used variables of managed types (strings, dynarrays, interfaces). * moreover, I made trivial overloaded functions that create and return exception objects so I just type `raise Err('error: %s', [ErrMsg])`
  17. Fr0sT.Brutal

    How to detect when control is scrolled into view

    Probably virtual list/tree view would be really easier to use. https://github.com/Virtual-TreeView/Virtual-TreeView is very full-featured and maintained; there's also https://github.com/TurboPack/MustangpeakEasyListview
  18. Fr0sT.Brutal

    Simple inlined function question

    But it could contain only the code that would be compiled 1:1
  19. Wait, what? Delphi-powered HTTP server running on Android and executing PHP scripts?
  20. Fr0sT.Brutal

    DEC (Delphi Encryption Compendium) has a new home

    My own personal logic would be: author doesn't support minimal readme and description => he is very lazy => project will be very poorly maintained => I'll better look for another one.
  21. Fr0sT.Brutal

    How to detect when control is scrolled into view

    I use delayed loading called from PaintWindow, you can check it here https://github.com/Fr0sT-Brutal/Delphi_OSMMap/blob/master/Source/OSM.MapControl.pas
  22. Fr0sT.Brutal

    general question about embedding docs in an app

    Edit and save is not an issue as long as you don't need WYSIWYG editor. Nowadays if I'd got such task I'd probably use Markdown format and automatic conversion to HTML. Markdown is very friendly for edit and provides all basic features without excess complexity. Btw, all side files could be saved inside single HTML as base64-encoded nodes. They would be harder to view and modify though. Another option for HTML is to implement custom container (like zip) with all contents and substitute required resources via callbacks (like OnGetImage(URI: string) or something similar)
  23. Fr0sT.Brutal

    general question about embedding docs in an app

    For older Windows, it could be Webbrowser if it hadn't had giant heap of troubles. For transition stage, it couldn't be neither Webbrowser (too old and deprecated) nor Edge/whatever chromium clone - because of compatibility. For newer Windows, it probably would be that built-in chromium clone. But if you only want to display some simple HTML page, whole browser engine could be an overkill. This is where custom native implementations come in. At least with them you have full control over what's going on.
  24. Fr0sT.Brutal

    Automatically killing a service when stuck

    Of course no. I meant reconnecting a socket in some circumstances is like restarting a service.
  25. Fr0sT.Brutal

    general question about embedding docs in an app

    I too can't realize what's the principal advantage in running a web-server from an app and talking with it over direct display but I'd advice opensource and fully native THTMLViewer which I successfully use as help engine in one of my projects.
×