Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
Q

qmartens

@qmartens
About
Posts
7
Topics
0
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Some C# code that makes me sick...
    Q qmartens

    IMHO, the correct answer to "How should I handle exceptions?" is "Do Not." ("Unless you know how to recover from a specific exception." (e.g. `FileNotFoundException`s are easy to deal with. However, if you try to handle things like `DivideByZeroException`, `OutOfMemoryException`, or `StackOverflowException`, you're pretty much attached by an inclined plane wrapped helically around an axis.) Also (I might catch (pun intended) a lot of flak for this): - re-throwing exceptions should be avoided like the plague, as doing so can potentially cause a single exception to be logged multiple times. Unfortunately, of the `async`/`await` (i.e. things in the `System.Threading.Tasks` namespace) re-throw a lot, which leads to a lot of noise and distractions while debugging). - a `catch { ... }` block is the wrong place to log exceptions. A better alternative is use [Exception Filters] for logging. For example:

    try {
    Foo();
    }
    catch(SpecificException ex) when (ex.Log()) {
    }

    (Where `.Log` is an extension method that always returns `false`). An even better alternative is to avoid logging exceptions in `catch` blocks or exception filters altogether. I am glad that it was decided not to remove the `System.AppDomain` class in .NET Core and .NET 5+ for this very reason: you can use the [AppDomain.FirstChanceException] and [AppDomain.UnhandledException] events as the one (erm... OK, two) place(s) to log all exceptions. You can even get fancy and add something to the `Exception.Data` dictionary in those events to avoid logging the same exception multiple times. However, in order for this to be useful, exceptions should not be re-thrown in order to ensure the logging of complete stack traces.

    Eagles my fly, but weasels don't get sucked into jet engines.

    The Lounge csharp question com help

  • The Decline and Fall of Search Engines
    Q qmartens

    I don't disagree, but when I want to buy a "4S 850 mAh 95 C" LiPo battery for one of my racing/freestyle drones, it gets really annoying that the only batteries with the specs I actually specified are on, like, page 9, 15, and 22 of the search results. I miss Alta Vista.

    Eagles my fly, but weasels don't get sucked into jet engines.

    The Lounge com adobe algorithms tutorial question

  • The Decline and Fall of Search Engines
    Q qmartens

    I don't disagree, but when I want to buy a "4S 850 mAh 95 C" LiPo battery for one of my racing/freestyle drones, it gets really annoying that the only batteries with the specs I actually specified are on, like, page 9, 15, and 22 of the search results. I miss Alta Vista.

    Eagles my fly, but weasels don't get sucked into jet engines.

    The Lounge com adobe algorithms tutorial question

  • Programming Languages - Fun with Rexx?
    Q qmartens

    Around 1992 or so, back when my ANSI-escape-sequence-Fu was strong, I was co-owner of a BBS running on an Amiga 2000. When we added a 2nd phone line, I wrote a 3-way chat extension in (A)Rexx (SysOp and 2 users). I still feel that Rexx is the most comfortable (for lack of a better word) of scripting/interpreted languages. After the internet pretty much made BBSs a thing of the past, I wrote a USENET client in Arexx. Rexx is just fun. PowerShell scripting would be really awesome if they could be written in Rexx. 😃

    Eagles my fly, but weasels don't get sucked into jet engines.

    The Lounge visual-studio question discussion career

  • Who vs Whome
    Q qmartens

    AFAIK, the only way to correctly determine when to who vs. whom, is to use grammar rules that don't really exist in the English language (unless you're a linguist). Native German speakers get this right by intuition, because German does have those rules. It boils down to whether the pronoun refers to the accusative object ('who'), or the dative object ('whom'). Here's a really bad analogy for us geeky types: Using the C++ or C# member access operators, . is 'who', and -> is 'whom'. A better example would be the sentence "Who did what to whom?". Commence flame wars re: ...but isn't "Who" in that example actually the subject (in the grammatical sense)?

    Eagles my fly, but weasels don't get sucked into jet engines.

    The Lounge visual-studio question

  • Keeping Command Console Open After Running Process
    Q qmartens

    The entire command line after /k needs to be in quotes like so: Process.Start("cmd.exe", "/k \"\"C:\\Program Files\\Inno Setup 5\\iscc.exe\" \"%dir%\\MyInstallScript.iss\"\""); Note the extra quote characters at the start and the end of the argument after /k.

    Eagles my fly, but weasels don't get sucked into jet engines.

    .NET (Core and Framework) csharp tools question discussion workspace

  • How to detect when an application is about to exit
    Q qmartens

    Override OnClosed in MyWin instead of OnClosing. The RichTextBox.Text property will still be valid. MyWin.OnClosed does get called when the main form is closed, whereas MyWin.OnClosing does not.

    Eagles my fly, but weasels don't get sucked into jet engines.

    .NET (Core and Framework) agentic-ai help tutorial
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups