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
  • How many values between 0 and 0?

    android csharp data-structures tutorial question
    19
    0 Votes
    19 Posts
    26 Views
    B
    I guess that when we get to know a new language we expect it to be consistent with the languages that we already know. At least this works for me that way. That is the reason one might not expect how range operator in Go works (note the index) or JS sorting numbers lexicographically. And this is also a reason why this topic started in the first place.
  • This Definitely Falls into the Wonderful Camp

    c++ csharp css visual-studio com
    4
    0 Votes
    4 Posts
    9 Views
    L
    David A. Gray wrote: What made it stand out was that this was happening in a debug build. Had it been a release build, I would have expected this level of optimization. However, this is the most recent of many such unanticipated, and welcome, optimizations, that I've seen in recent debug builds. Yeah, it's not a coincidence that the first compiler implementing the /Qspectre mitigations[^] is generating slighty different conditional moves. It's an active area of development. Best Wishes, -David Delaune
  • where can i post my course url here without being banned?

    question learning
    5
    0 Votes
    5 Posts
    13 Views
    G
    I didn't know that. Thanks. The article if he creates one won't get through then :-D No harm done I guess.
  • 0 Votes
    4 Posts
    7 Views
    raddevusR
    Brisingr Aerowing wrote: There’s a library you can install to enable System.Drawing on Linux. That's cool. Thanks for posting. I browsed it and I'll look at it a lot more closely. :thumbsup:
  • Dev time waster ala JSON dialect

    c++ javascript android ios database
    17
    0 Votes
    17 Posts
    20 Views
    B
    Sander Rossel wrote: different ways to look at a GUID :doh: Yes, there are "case-sensitive" Guids. I guess it was project ids in a Visual Studio solution file... Oh sanctissimi Wilhelmus, Theodorus, et Fredericus!
  • Weird Performance

    performance question css asp-net testing
    6
    0 Votes
    6 Posts
    9 Views
    N
    Rick York wrote: t is so entwined with the rest of my framework it would be difficult to extract and isolate. I have stuff like multiple trace contexts, editable colors on a per-thread basis, and other stuff What about a serie of articles? :rolleyes: ;P :laugh: 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.
  • Head, meet desk

    csharp question
    3
    0 Votes
    3 Posts
    5 Views
    Z
    A good reason not to use goto. ;) Social Media - A platform that makes it easier for the crazies to find each other. Everyone is born right handed. Only the strongest overcome it. Fight for left-handed rights and hand equality.
  • 0 Votes
    11 Posts
    26 Views
    CHill60C
    Yeah - I get that it makes sense. It also saves space in automation etc. TBH we used to do it back in the day (but that was sooo long ago I'd forgotten). My main gripe with this was that this is the only feed (of many) that was defined like this, and it's not the case for all the fields :confused: It looks like the whole shebang was designed by committee! To make things worse the BA involved shares specifications a page at a time, only the bits that she thinks are necessary to do a job (that she is not qualified to do nor has any experience of). This was not on the pages she chose to share with me :|
  • Meet Jagwyre, The World's Fastest Hacker

    1
    0 Votes
    1 Posts
    3 Views
    No one has replied
  • 0 Votes
    14 Posts
    44 Views
    P
    How about this gem then, hot from some inherited code: CREATE VIEW [dbo].[vwSomething] AS SELECT dbo.AA_SomeTable.some_table_id AS parent_id, ... CASE WHEN SUBSTRING(CONVERT(nvarchar(30), dbo.AA_SomeTable.date_created, 126), 9, 2) + '/' + SUBSTRING(CONVERT(nvarchar(30), dbo.AA_SomeTable.date_created, 126), 6, 2) + '/' + SUBSTRING(CONVERT(nvarchar(30), dbo.AA_SomeTable.date_created, 126), 0, 5) + ' ' + SUBSTRING(CONVERT(nvarchar(30), dbo.AA_SomeTable.date_created, 126), 12, 2) + ':' + SUBSTRING(CONVERT(nvarchar(30), dbo.AA_SomeTable.date_created, 126), 15, 2) IS NULL THEN 'None' ELSE SUBSTRING(CONVERT(nvarchar(30), dbo.AA_SomeTable.date_created, 126), 9, 2) + '/' + SUBSTRING(CONVERT(nvarchar(30), dbo.AA_SomeTable.date_created, 126), 6, 2) + '/' + SUBSTRING(CONVERT(nvarchar(30), dbo.AA_SomeTable.date_created, 126), 0, 5) + ' ' + SUBSTRING(CONVERT(nvarchar(30), dbo.AA_SomeTable.date_created, 126), 12, 2) + ':' + SUBSTRING(CONVERT(nvarchar(30), dbo.AA_SomeTable.date_created, 126), 15, 2) END AS date_details FROM dbo.AA_SomeTable INNER JOIN dbo.AA_Other ON dbo.AA_SomeTable.SomeTable_user_id_FK = dbo.AA_Other.user_id Ummmmmmm? (Table & Column names changed to protect the guilty)
  • You learn something new every day

    c++ debugging help
    18
    0 Votes
    18 Posts
    45 Views
    C
    Actually it's really that simple. Assembly may not be my weapon of choice for and against everything anymore, but I still use it a lot. Even a C compiler may sometimes not be practical on very small processors with limited resources. I have lived with several Zen masters - all of them were cats. His last invention was an evil Lasagna. It didn't kill anyone, and it actually tasted pretty good.
  • Kotlin: new(ish) syntax emerges

    asp-net android lounge
    16
    0 Votes
    16 Posts
    25 Views
    R
    That was my immediate thought too. Glad to see someone else cares about wasting cycles. "If you don't fail at least 90 percent of the time, you're not aiming high enough." Alan Kay.
  • Broken image links in the articles that come up for approval

    question
    3
    0 Votes
    3 Posts
    19 Views
    S
    Oops, sorry for posting in wrong form, I did not find another place where I could post this. Will delete this now that I got the answer...
  • Visual Studio namespace gotcha

    csharp visual-studio help question
    2
    0 Votes
    2 Posts
    7 Views
    N
    Because that would be an ambiguity in one of the few places where ambiguity would break the system. By and large, C# is really good about supporting abstractions. One of the main reasons for this is that the whole thing is underpinned with stringent structural rules in terms of where and how code is loaded. These rules, which include namespace definitions, make the entire idea of dynamic module loading work without a bunch of odd checks and locks. An ambiguous namespace definition would break this system. Do I want System.Timers or System.Threading.Timers? The APIs are different, so if I load one ambiguously, I'd need to do some type checks before using anything from it an likely set aside some buffers and concurrency control while making the determination and loading the code. Or I can just type: using System.Threading.Timers; Side note: ReSharper automatically detects namespace issues and can automatically correct them for you. "Never attribute to malice that which can be explained by stupidity." - Hanlon's Razor
  • Another Cause for LNK1181

    help c++ database com tools
    14
    0 Votes
    14 Posts
    28 Views
    M
    Thankyou for the valuable information.iam very interested with this one. looking forward for more like this. ac market acmarket apk ac market downloading ac market for android ac market ios ac market for pc
  • jhbnm

    1
    0 Votes
    1 Posts
    2 Views
    No one has replied
  • roleplay

    1
    0 Votes
    1 Posts
    3 Views
    No one has replied
  • Memory Leak

    csharp wpf wcf com hardware
    6
    0 Votes
    6 Posts
    11 Views
    M
    In C#, I almost ALWAYS use try-catch-finally. That's the "Padre Nostro" of alldays. :laugh:
  • Dragging Hairlines to Widen Fields

    visual-studio help
    21
    0 Votes
    21 Posts
    85 Views
    D
    In general terms, I know that. I've used Windows since almost day 1, and I don't recall ever seeing a drag work when the mouse pointer moves outside the boundaries of the windows that has the focus. That's good to know, so long is it doesn't make the thing 3 parsecs wide. ;) David A. Gray Delivering Solutions for the Ages, One Problem at a Time Interpreting the Fundamental Principle of Tabular Reporting
  • Wonderful, not weird

    linux workspace
    4
    0 Votes
    4 Posts
    5 Views
    S
    I did it with my kid's pc too. Whole new pc. Swapped old HDD out into new box. Win 8.1 Started up just fine!