Click here to Skip to main content
14,238,549 members

The Weird and The Wonderful

   

The Weird and The Wonderful forum is a place to post Coding Horrors, Worst Practices, and the occasional flash of brilliance.

We all come across code that simply boggles the mind. Lazy kludges, embarrassing mistakes, horrid workarounds and developers just not quite getting it. And then somedays we come across - or write - the truly sublime.

Post your Best, your worst, and your most interesting. But please - no programming questions . This forum is purely for amusement and discussions on code snippets. All actual programming questions will be removed.

 
GeneralRe: WizzardWrx .NET API Core Available on NuGet Pin
David A. Gray5-May-19 16:29
groupDavid A. Gray5-May-19 16:29 
GeneralRe: WizzardWrx .NET API Core Available on NuGet Pin
Marc Clifton3-May-19 9:01
protectorMarc Clifton3-May-19 9:01 
GeneralRe: WizzardWrx .NET API Core Available on NuGet Pin
RickZeeland3-May-19 21:07
mveRickZeeland3-May-19 21:07 
GeneralRe: WizzardWrx .NET API Core Available on NuGet Pin
0x01AA6-May-19 10:39
professional0x01AA6-May-19 10:39 
GeneralRe: WizzardWrx .NET API Core Available on NuGet Pin
David A. Gray6-May-19 11:10
groupDavid A. Gray6-May-19 11:10 
GeneralRe: WizzardWrx .NET API Core Available on NuGet Pin
Chris Copeland7-May-19 4:34
professionalChris Copeland7-May-19 4:34 
GeneralRe: WizzardWrx .NET API Core Available on NuGet Pin
David A. Gray7-May-19 4:54
groupDavid A. Gray7-May-19 4:54 
GeneralWizardWrx .NET API, version 7.15 Pin
David A. Gray28-Apr-19 15:57
groupDavid A. Gray28-Apr-19 15:57 
The https://github.com/txwizard/WizardWrx_NET_API is now at version 7.15, with one subtle bug smashed flat and a few interesting, but obscure changes. As always full documentation is at https://txwizard.github.io/WizardWrx_NET_API/.

What makes this especially interesting is the way the bug that motivated this update came to the surface; it appeared in the output dumped into the Visual Studio debugger window of an application that consumed it.

Numerous distractions interfered with finishing the repair. The event that pushed me to finish it was a very minor addition that I needed to make to WizardWrx.Common.dll, one of three libraries that underpin the whole API. The common library is composed almost entirely of constants, to which I needed to add a few new ones so that I can use them as building blocks from which to build other string constants. Though all of them were already defined as character constants, you cannot mix character and string constants in the definition of a new string constant.

The WizardWrx .NET API is a set of libraries that expose a rich set of general-purpose helper classes for use in projects that target the Microsoft .NET Framework. Among other things, they offer the following.

1) Syntactic sugar, such as the routines that identify the first, last, and next-to-last iteration of a FOR loop, convert subscripts to and from ordinals (zero-based versus one-based subscripts), compute a modulus (remainder), and perform decimal shifts

2) Prse dynamically generated format control strings (used with string.format and such),

3) Reduce computing message digests to a single method call

4) Transparently convert Registry values of all types into native types (strings, integers of various sizes, and byte arrays)

5) Parse command line arguments for any program (command line or graphical),

6) Add numerous extension methods to system.string and system.IO.FileOnfo

7) Simplify working with the match groups returned by the Regular Expression engine

8) Dynamically generate format strings to compactly represent data in tabular format

9) Implement the Singleton design pattern in a way that fully leverages certain guarantees about the behavior of static constructors

10) Format and log exception reports, optionally recording them in a Windows Event Log and efficiently reporting them on the two standard console output streams, taking into account when either or both has been redirected to a file

11) Accurately identify the type of processor on which the code is executing and the Windows subsystem (character mode, graphical, etc.) in which it is executing

12) Walk the dependency tree of any executing assembly

13) Sort collections of FileInfo objects, so that the files they represent can be processed in any order

14) Provide scores of handy symbolic constants to disambiguate and properly document your code

The3re is much more; these are the highlights, most of which I use daily.
David A. Gray
Delivering Solutions for the Ages, One Problem at a Time
Interpreting the Fundamental Principle of Tabular Reporting


modified 4-May-19 3:09am.

GeneralWell, at least they use SQL Server Pin
PIEBALDconsult20-Apr-19 5:03
protectorPIEBALDconsult20-Apr-19 5:03 
GeneralRe: Well, at least they use SQL Server Pin
kmoorevs20-Apr-19 12:33
memberkmoorevs20-Apr-19 12:33 
GeneralRe: Well, at least they use SQL Server Pin
Slacker00722-Apr-19 21:55
professionalSlacker00722-Apr-19 21:55 
GeneralRe: Well, at least they use SQL Server Pin
Brisingr Aerowing20-Apr-19 12:48
professionalBrisingr Aerowing20-Apr-19 12:48 
JokeRe: Well, at least they use SQL Server Pin
Anurag Gandhi11-May-19 6:52
professionalAnurag Gandhi11-May-19 6:52 
GeneralRe: Well, at least they use SQL Server Pin
Member 1433107613-May-19 4:31
memberMember 1433107613-May-19 4:31 
GeneralSo we have this service at work... Pin
MadMyche19-Apr-19 5:28
mveMadMyche19-Apr-19 5:28 
GeneralRe: So we have this service at work... Pin
Rick York2-May-19 4:44
mveRick York2-May-19 4:44 
GeneralStupid user tricks (double-click = double postback) Pin
kmoorevs18-Apr-19 12:07
memberkmoorevs18-Apr-19 12:07 
GeneralRe: Stupid user tricks (double-click = double postback) Pin
Super Lloyd18-Apr-19 12:30
memberSuper Lloyd18-Apr-19 12:30 
GeneralRe: Stupid user tricks (double-click = double postback) Pin
codewitch honey crisis18-Apr-19 12:55
membercodewitch honey crisis18-Apr-19 12:55 
GeneralRe: Stupid user tricks (double-click = double postback) Pin
grralph118-Apr-19 23:29
membergrralph118-Apr-19 23:29 
GeneralRe: Stupid user tricks (double-click = double postback) Pin
OriginalGriff19-Apr-19 0:37
protectorOriginalGriff19-Apr-19 0:37 
GeneralRe: Stupid user tricks (double-click = double postback) Pin
grralph119-Apr-19 1:11
membergrralph119-Apr-19 1:11 
GeneralRe: Stupid user tricks (double-click = double postback) Pin
Jacek Gajek22-Apr-19 21:41
memberJacek Gajek22-Apr-19 21:41 
GeneralRe: Stupid user tricks (double-click = double postback) Pin
MadMyche19-Apr-19 5:38
mveMadMyche19-Apr-19 5:38 
GeneralRe: Stupid user tricks (double-click = double postback) Pin
kmoorevs19-Apr-19 5:16
memberkmoorevs19-Apr-19 5:16 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.