Skip to content

The Weird and The Wonderful

It was the best of code, it was the worst of code. Coding Horrors, Worst Practices, and flashes of brilliance

This category can be followed from the open social web via the handle the-weird-and-the-wonderful@forum.codeproject.com

1.8k Topics 20.7k Posts
  • Hide and Seek Cache

    2
    3 Votes
    2 Posts
    178 Views
    code-witchC
    Caching is always great to deal with when it comes to debugging. Always so helpful it is, serving out valid, stale requests that don't reflect what is actually happening on the ground. [image: d8d05d53-236f-44d3-b8c2-6e9bc504f66a.png]
  • Generate SHA256 Hash of every file on my computer.

    database learning csharp css sqlite
    3
    0 Votes
    3 Posts
    92 Views
    Mircea NeacsuM
    raddevus wrote: 2. It's super slow to use EntityFramework to insert those dir names into the sqlite db. Super slow means it takes more than 10 minutes. Take a look at my article[^] about sqlite multi-threading. Might give you some ideas how to speed up things. Mircea (see my latest musings at neacsu.net)
  • 10 Pages of Pascal code vs 1 Shell script

    delphi visual-studio com linux algorithms
    3
    0 Votes
    3 Posts
    71 Views
    raddevusR
    Very good points! Everything is a trade-off. :thumbsup:
  • 0 Votes
    11 Posts
    207 Views
    Richard DeemingR
    raddevus wrote: If you don't have the deconstructor in your class and you try the destructuring you will get an error Unless you have a deconstructor extension method, which can be handy for third-party classes that don't provide them: // In your "SimpleShapes.dll" assembly: public class Rectangle(float width, float height) { public readonly float Width = width, Height = height; } // In my application code: public static class Shapes { public static void Deconstruct (this Rectangle rectangle, out float width, out float height) => (width, height) = (rectangle.Width, rectangle.Height); } "These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer
  • The best thing since sliced bread

    com hardware
    1
    0 Votes
    1 Posts
    26 Views
    No one has replied
  • Hollywood Apple

    csharp html ios
    7
    0 Votes
    7 Posts
    134 Views
    D
    Adding some cooling and keeping the phones charged with a battery pack is doable anyway. I like this kind of experimentations, they are really an artistic expression of the highest magnitude. GCS/GE d--(d) s-/+ a C+++ U+++ P-- L+@ E-- W+++ N+ o+ K- w+++ O? M-- V? PS+ PE Y+ PGP t+ 5? X R+++ tv-- b+(+++) DI+++ D++ G e++ h--- r+++ y+++*      Weapons extension: ma- k++ F+2 X The shortest horror story: On Error Resume Next
  • The Commodordion

    com
    6
    0 Votes
    6 Posts
    95 Views
    Richard Andrew x64R
    This should go in Insider News! The difficult we do right away... ...the impossible takes slightly longer.
  • dolly chaiwala: funny meme video hindi

    com question
    3
    0 Votes
    3 Posts
    72 Views
    L
    Nitin S wrote: there was indian section on cp It was closed down years ago, if I remember correctly. This remains an English language site.
  • Plutovg is a fascinating bit of software

    graphics design com hardware iot
    1
    0 Votes
    1 Posts
    26 Views
    No one has replied
  • pass the 500-220 exam

    com sysadmin security architecture
    1
    0 Votes
    1 Posts
    25 Views
    No one has replied
  • 0 Votes
    3 Posts
    65 Views
    Mike HankeyM
    no bueno A home without books is a body without soul. Marcus Tullius Cicero PartsBin an Electronics Part Organizer - Release Version 1.4.0 (Many new features) JaxCoder.com Latest Article: EventAggregator
  • 0 Votes
    2 Posts
    47 Views
    Richard DeemingR
    raddevus wrote: well they didn't entirely abuse me. You obviously weren't trying hard enough! :laugh: "These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer
  • How, VS Code? This is amazing.

    visual-studio design c++ com
    7
    0 Votes
    7 Posts
    118 Views
    L
    I've been tinkering with these free AI tools for a while now, specifically ChatGPT, Copilot and codepal. The only one I've tried for generating code was codepal. Not very impressed: it only generates code snippets ('functions'), and after very few such short snippets it reaches the limit for free usage. For not code related questions, I found ChatGPT far better than Copilot. It used to be really bad just a few months ago, but it significantly improved. It reaches the limit for free usage pretty fast though, requiring a few hours of timeout. Copilot is just pathetic, in my experience, at this time. Both Copilot and ChatGPT give quite often wrong answers - they don't 'realize their own mistakes', but rather admit them when pointed out, leading to 'I apologize for the confusion/misunderstanding/frustration...'. Almost never 'for the wrong answer'! They're trained well ;) What they're not trained to say is 'I don't know', which I'd prefer, instead the constantly wrong answers. I usually know the correct answer, or at least I know when the answer is wrong, but what happens if I don't? They're nice toys, but not really useful and trustworthy in my opinion. Maybe I'm not very good at asking questions (they can understand), but I do it in a very clean manner and provide enough context, so I doubt that. I would be myself impressed with any decent answers (nevermind code generation), because my expectations are pretty low, but so far I'm not. Your Mileage definitely Varies!
  • 0 Votes
    1 Posts
    19 Views
    No one has replied
  • What the hell GCC, again

    algorithms performance help question
    2
    0 Votes
    2 Posts
    45 Views
    B
    GCC's warnings are often way too strict (and in some cases, outright wrong). What do you get when you cross a joke with a rhetorical question? The metaphorical solid rear-end expulsions have impacted the metaphorical motorized bladed rotating air movement mechanism. Do questions with multiple question marks annoy you???
  • Total Recall? nope

    com hardware help question
    5
    0 Votes
    5 Posts
    103 Views
    N
    I have an AMD 5800x and an AMD 6900XT (almost three years old). A VM, 3 Instances of "Lord of the rings" online, several browser tabs and 2 instances of Sketch up 2017 open. Be Quiet case with 2x silent wings and a dark rock pro 4 for the CPU. The fans only activate second speed from time to time for 10 or 15 seconds. My first AMD components and, right now, I do not see me coming back to intel soon. M.D.V. ;) If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about? Help me to understand what I'm saying, and I'll explain it better to you Rating helpful answers is nice, but saying thanks can be even nicer.
  • CSS & Sophocles, more related than you know

    csharp css database wpf help
    14
    0 Votes
    14 Posts
    228 Views
    T
    Interesting, and good to know. I'm way behind on modern CSS. There are no solutions, only trade-offs.    - Thomas Sowell A day can really slip by when you're deliberately avoiding what you're supposed to do.    - Calvin (Bill Watterson, Calvin & Hobbes)
  • Supporting multiple cores from bare metal C

    design asp-net com graphics iot
    7
    0 Votes
    7 Posts
    135 Views
    honey the codewitchH
    I just thought it was interesting that it was effectively a second main(). I was expecting something more complicated for some reason. And yeah, synchronization is the real mess, especially when you need to build up the primitives from scratch. :) Check out my IoT graphics library here: https://honeythecodewitch.com/gfx And my IoT UI/User Experience library here: https://honeythecodewitch.com/uix
  • Linux C PreProcessor: Who Knew?

    linux c++ html tutorial
    8
    0 Votes
    8 Posts
    144 Views
    raddevusR
    Very cool. Thanks for sharing :thumbsup:
  • Dynamic SQL

    database help question
    11
    0 Votes
    11 Posts
    160 Views
    Sander RosselS
    Yeah, seen it too. In fact, it was the default for a project I worked on. The idea was that you could filter on something like ten to twenty fields and depending on which fields were set, the string concatenation added fields to the WHERE-clause. The alternative was something like WHERE (X = @X OR @X IS NULL) AND (Y = @Y OR @Y IS NULL) AND (Z = @Z OR @Z IS NULL) -- Etc. Nowadays I'd use LINQ to build such a query. Best, Sander Azure DevOps Succinctly (free eBook) Azure Serverless Succinctly (free eBook) Migrating Apps to the Cloud with Azure arrgh.js - Bringing LINQ to JavaScript