Search:

Type: Posts; User: peterst

Page 1 of 13 1 2 3 4

Search: Search took 0.02 seconds; generated 23 minute(s) ago.

  1. Replies
    27
    Views
    591

    Re: Thunk for a CopyMemory replacement?

    REP MOVSB/W/D/Q is avoided in many system libraries since Pentium 1 or 2. Few reasons are - prefetch queue in CPUs, memory cache (different levels), multi-CPU/core/threads systems.

    Simple...
  2. Replies
    6
    Views
    429

    Re: [RESOLVED] Optical Character Recognition

    Now more real optimization that may avoid some future problems:

    Loading image from file (Bitmat.FromFile()) actually locks the file and may become an issue if you run multiple threads or processes...
  3. Replies
    6
    Views
    429

    Re: [RESOLVED] Optical Character Recognition

    You can "optimize" this part of your code:

    Dim angleText = "{0} degrees"
    If (angle = 0) Then
    angleText = String.Format(angleText, "0")
    ElseIf (angle = 1) Then
    angleText =...
  4. Replies
    6
    Views
    429

    Re: [RESOLVED] Optical Character Recognition

    The library you used (https://github.com/charlesw/tesseract/) supports from .NET Framework 4.0 to .NET 6 - info got from NuGet package page:...
  5. Re: Good Programming Practice: About "ByVal MyObject"

    Optimization should be done by library authors. Same with that Len(B) discussion - all this is important for library authors. Developers will use the library as abstraction layer that hides the...
  6. Replies
    47
    Views
    778

    Re: VBForums most active sections stats.

    :D

    public int Add(int a, int b) => a + b;

    public int Subtract(int a, int b) => a - b;

    public int Mul(int a, int b) => a * b;

    public int Div(int a, int b) => a / b;
  7. Re: Good Programming Practice: About "ByVal MyObject"

    Probably someone already made real world benchmarks on ByVal vs ByRef but I just finished testing of old tool that processes millions of records with mostly string data - all hold in memory for...
  8. Re: Good Programming Practice: About "ByVal MyObject"

    When working with other 10+ devs - some experienced but most not so much, rules are rules. Performance penalty cannot compare to wasted weeks and months debugging strange issues and referenced...
  9. Re: Good Programming Practice: About "ByVal MyObject"

    We had some rules when defining parameters to avoid strange "effects" when multiple developers work on same (VB6) code base:


    Always specify ByVal or ByRef and don't leave it to default as devs...
  10. Replies
    25
    Views
    808

    Re: Type Conversion Issue

    /off: VS 2019 supports .NET 6 from today.

    If you have to import from CSV, why to convert to another format like JSON instead of simply importing everything as you want? I've never used "library"...
  11. Replies
    25
    Views
    808

    Re: Type Conversion Issue

    I am for what Zvoni suggested: write own parser and just split the string. Then handle each field as you want, not what some library will return to you.
  12. Replies
    4
    Views
    496

    Re: Windows forms dependency injection

    For those interested of my lame implementation of Orders reader/writer class, here it is:

    public class OrdersReaderWriterInMemory : IOrdersReader, IOrdersWriter
    {
    private Dictionary<string,...
  13. Replies
    4
    Views
    496

    Re: Windows forms dependency injection

    I was thinking where to use the DI containers with automatic injection of constructor parameters in WinForm app and here is simple example app description:


    The app contains 3 forms - MainForm,...
  14. Replies
    4
    Views
    496

    Re: Windows forms dependency injection

    I have to add some important information about WinForms and user controls:

    Dependency injection is not fine for user controls as the forms designer/editor will not know how to initialize dependent...
  15. Replies
    4
    Views
    496

    Re: Windows forms dependency injection

    Actually in the current (at the time of writing) OP version on GitHub there is no injection in provided forms, just using ServiceCollection and accessing via call to global static method...
  16. VS 2015 Re: WebClient.DownloadFileTaskAsync ProgressChanged can't get the real totalbytes

    Check https://github.com/robinrodricks/FluentFTP - it is available as NuGet package and has much better support of different FTP features.
  17. Replies
    12
    Views
    519

    Re: .NET 5 vs Framework question

    Similar to .NET Framework, newer .NET Core/5/6 require runtime to be installed if you deploy your small not ready to run apps. From .NET Core 3+ there is option to create ready to run binaries with...
  18. Replies
    12
    Views
    519

    Re: .NET 5 vs Framework question

    If .NET 5 "flashes" with few lines of messages, it says there is no runtime (similar to .NET Framework). This is the result of my test on (very) old Win7 machine where .NET Core/5/6 runtime was never...
  19. Replies
    12
    Views
    519

    Re: .NET 5 vs Framework question

    I would start new console app that just writes something to screen and waits for user input, something like:

    Console.WriteLine(".....")
    ...
    ...
    ...

    Console.WriteLine("Press Enter to...
  20. Replies
    12
    Views
    519

    Re: .NET 5 vs Framework question

    The "lines" you see when you run .NET 5 app on the server are saying that you need to install the runtime. You could check that by running the app from command prompt as it will not close...
  21. Replies
    41
    Views
    1,574

    Re: Change all UDTs to classes

    VB.NET Structure/C# struct - value type
    VB.NET Class/C# class - reference type

    Both have advantages and disadvantages. But all is well described in official documentation. Or other places easy...
  22. Replies
    11
    Views
    548

    Re: newer VS versions and subscriptions

    It's the opposite :-) No need to login to download. First month of use no need to login. But after that at least once per month need to be online to keep "logged-in" (active) status of community...
  23. Replies
    6
    Views
    337

    Re: JSON nested array - retrieving values

    Actually it is list of strings so definition should be:

    Public Property service As IEnumerable(Of String)
  24. Thread: TwinBasic

    by peterst
    Replies
    1,059
    Views
    396,555

    Re: TwinBasic

    CI/CD in real use?
  25. Re: Open office document, but prevent "Save As"

    From another thread and code is in VB.NET:

    Set Cancel to false if you want to prevent saving. You have to add your logic as the example is from different thread and requirement.
  26. Re: Moving from .Net Remoting to Anonymous Pipes, equivalent of Activator.GetObject

    I forgot to mention another advantage of pub-sub pattern. You open ports only on server. Clients connect to server and don't need to open ports locally. Zero configuration required to "call" (send...
  27. Re: Moving from .Net Remoting to Anonymous Pipes, equivalent of Activator.GetObject

    I've created small library on top of NATS to do the type specific conversion. The same way ASPNET Core handles http requests with type specific parameters - invisible for the developer. gRPC also...
  28. Re: Moving from .Net Remoting to Anonymous Pipes, equivalent of Activator.GetObject

    I am using NATS as pub-sub server to create "control plane" for multiple apps on single computer or inside network(s). You can serialize your strictly defined classes and pass the message to...
  29. Replies
    35
    Views
    1,031

    Re: Got a new computer - password story

    TysonLPrice, we don't want your password, we want the tech specs of your new toy :D

    Can it run endless loop in less than 6 seconds? :D
  30. VS 2012 Re: How to read the file into the variable when the file is occupied?

    Use FileAccess.ReadWrite to read "shared" between processes file. It is a bit misleading as this is how you want to allow others to access the file - read is that other processes can only read. In...
  31. VS 2012 Re: vb. Net how to capture the save () event of word?

    Inside DocumentBeforeSave event management you have to simulate what Word do and you will have to do the save yourself so you can catch it. Something like this:

    Private _saveActive As Boolean =...
  32. Re: vb.net increment string alphanumeric/numeric

    It is crazy when you get something to maintain. If you will not take care in far future - just keep your code. Actually I will implement it similarly - scan for digits from last to first character,...
  33. VS 2012 Re: vb. Net how to capture the save () event of word?

    Private _word As Word.Application

    ...
    ' Get or create Word application object
    _word = ...
    AddHandler _word.DocumentBeforeSave, AddressOf DocumentBeforeSave
    ...

    Private Sub...
  34. Re: vb.net increment string alphanumeric/numeric

    mikeg71, ff you don't know all formats, then you will end up with routines that are partially working and will misbehave in the future. I wrote about edge cases and there you have to ask (people who...
  35. Re: vb.net increment string alphanumeric/numeric

    Niya, how you will tokenize this and where you will "increment" first and then the rest of series:
    119432765912843

    Let me tell you: without knowing the rules - no way. This looks like single...
  36. Re: vb.net increment string alphanumeric/numeric

    These "strings" are including several fields inside, one (or more) of which are series. And series may or may not have leading zeros. This requires to know the proper fields definition. For example...
  37. Re: [RESOLVED] Generics: a good design pattern or doing more harm than good?

    From Wikipedia article about Generic programming:


    It is good first to read some basic theory about topic before trying to "imitate" it. And as The trick already wrote:


    So the main question...
  38. Thread: i need these

    by peterst
    Replies
    25
    Views
    879

    VS 2010 Re: i need these

    vb 1998 > vs/vb 2010 > vs2022 :D :D :D
  39. Replies
    16
    Views
    605

    Re: Opinions Requested - Program Settings

    In another thread where we discussed saving and loading user settings. They are similar to application configuration but there are shown different approaches to serialize and deserialize data using...
  40. Replies
    16
    Views
    605

    Re: Opinions Requested - Program Settings

    Using all settings in strongly typed class properties has many advantages over reading from key-value store by name on every place:

    Strongly typed variables instead of strings. Integers,...
Results 1 to 40 of 493
Page 1 of 13 1 2 3 4



Click Here to Expand Forum to Full Width