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
  • Embarrassing newbie mistake

    css
    5
    0 Votes
    5 Posts
    43 Views
    R
    No, is not fundamental. It is highly recommended but not fundamental. Prior to this error Intel had not required it to be done by different people and I am certain they were not alone in that. "They have a consciousness, they have a life, they have a soul! Damn you! Let the rabbits wear glasses! Save our brothers! Can I get an amen?"
  • Windows Explorer - Useful feature

    11
    0 Votes
    11 Posts
    73 Views
    Richard DeemingR
    It appears in the Windows Explorer folder context menu - even the horrible new Windows 11 one - so it's not too hard to find. :) "These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer
  • CCC 2022-09-26

    1
    0 Votes
    1 Posts
    6 Views
    No one has replied
  • Navel gazing on coding style?

    css json tutorial question discussion
    1
    0 Votes
    1 Posts
    11 Views
    No one has replied
  • Another ancient oddity in .net

    csharp question
    18
    0 Votes
    18 Posts
    131 Views
    F
    You really need some mental gymnastic to read my message and think that I'm trying to diminish you. I am not the one inserting some nationality (Mexican in your case) followed by a derogatory term (hobo) to say something is bad. I was not offended, I just said that the message could have been answered without inserting any nationality. I don't get offended by random people on Internet, I would be a very bitter person if I did. But I also tend to think that bigots are usually not the smartest people in the planet. That being said, I'm not interested in wasting more time responding to someone that is showing your kind of behaviour, I have better things to do with my life. Hasta la vista Thornik.
  • Does anyone recognized this "decryption" algorithm?

    algorithms question
    19
    0 Votes
    19 Posts
    98 Views
    P
    A hash may be invertible if it contains at least as many bits as the input (though it is not is major usage where this is geenrally the reverse). But the arguments are the same: you just want a perfectly flattened distribution of bits in the result, and for using it as an encryption, you must ensure that there will NEVER be any collision (so the distribution is almost perfectly flattened with collision lists for each hash value being either 1 or 0, a property that a good hash algorithm should have as well when their input has the same (or smaller) bitsize as their output. But actually a good hash will want to have this flattened distribution even if you truncate the hash value to less bits (the same will be true if you use it as an invertible encryption that must be secure, i.e. where you cannot guess the decryption key if you konw some pairs of clear-text input and resulting "hash" value, which should still be invertible but only when you know the decryption key or when you can generate it easily because you know the encryption key). Many encryption algorothms also depend a the existence of a "securely strong" hash key (at least to generate the encryption/decryption keys), and the inversible operation of encrypting/decrypting may as well be used as a hashing function (once you give it one of the keys). Note that encrypting very short messages even with a very strong encryption algorithm with long keys causes a major problem because the result is no longer a flat distribution; that's why strong encryptions require padding those messages with enough bits so that they become longer than the minimum length required for the keys. Such padding are not random, but they cannot be static (e.g. all zeroes), but should be generated by a strong hash: very short messages will then become undistibuishable from long messages that have the desired flattened distribution of bits in their encrypted patterns.
  • Thanks for the trip down memory lane

    performance announcement
    11
    0 Votes
    11 Posts
    81 Views
    E
    I saw a copy of the source for the UT one… Loading raw dilithium crystals started at a 5-10% chance of explosion and doubled each time you did it!
  • You expect me to use this with what, now?

    adobe hardware iot business performance
    12
    0 Votes
    12 Posts
    101 Views
    honey the codewitchH
    Powering an RPi off and on like that creates an issue, in that it runs an actual OS. Turning back on isn't instant. Sure it might be able to be done, but whatever can be saved in power on an RPi it still pales in comparison to the savings of using an ESP32 instead. To err is human. Fortune favors the monsters.
  • Odd Behavior With gethostbyname

    regex question learning
    4
    0 Votes
    4 Posts
    22 Views
    E
    On Win NT 4.0, the NIC could support a huge number of IPs. At least 16. The GUI could not handle that many so we would directly edit the registry to add additional IPs. We may have had to reboot after, but it always worked and sounds easier than your procedure.
  • I'm not sure how I feel about Forth implemented on a Cortex M-0

    7
    0 Votes
    7 Posts
    54 Views
    E
    If you are telling them to “go away”, then you probably do not want THEM to multiply. Multiply as in procreate.
  • Taking responsibility

    collaboration question discussion learning
    18
    0 Votes
    18 Posts
    138 Views
    E
    It will eventually be forgotten, but that is the way of software. No one will know it is there in the repo. This seems like more of a labeling situation than a branch. With this team, if they had created a branch, then no one would have the guts to merge it back to the mainline.
  • Tell me what's wrong with the following

    20
    0 Votes
    20 Posts
    147 Views
    E
    Message would cause a name clash in the 2 struts. So MessageOld, MessageNew
  • GetAssemblyVersion, VB style

    announcement
    8
    0 Votes
    8 Posts
    71 Views
    E
    There is some code that builds a dynamic Class name to load a different class as needed. The are multiple other places where this code was copied, but there is only a single, fixed class that is needed. Replace 10-20 lines of unnecessary code with “new Fixed()”
  • TECO Macros - show me the codez

    html com data-structures help question
    4
    0 Votes
    4 Posts
    31 Views
    P
    Correct. Though EDT became an option of TPU eventually -- EDIT/EDT . I never got the hang of EVE and I could never figure out how to exit it whenever I started it accidently. I still have a file of EDT macros I use when I use my OpenVMS systems (which is rare). I also knew developers who used VI rather than TPU-based editors. An amber-screen dumb terminus doesn't know the difference. Again, I don't adopt new things without some good reason to do so. I certainly prefer a screen editor to a line editor. Always consider what happens if you have to work with an older system without the new tool(s). Such as, does the version of OpenVMS/VAX I have on my MicroVAX even support TPU? (I think it does.) One reason I bought the MicroVAX is because VAX BASIC has Immediate Mode :D . About twenty years ago I was asked to write a program with only the tools installed on a fresh install of Windows XP (?) -- e.g. notepad and CSC. Developers who have no clue how to write code without an IDE may find themselves unable to make any progress. Edit: When I first learned BASIC on the PDP-11 (in 1983), the teacher taught us to use EDT in line mode (was there no screen mode yet?), but the cool kids used TECO.
  • C# 6, you dirty dog!

    csharp visual-studio help announcement xml
    7
    0 Votes
    7 Posts
    55 Views
    P
    Yes, which is what I do... as far as you know ;) . (I actually wrote my own simple IDE.) I don't like that notepad can't be flexible on TABs. I do use it for XML though.
  • Two of my most frequent issues with .net inconsistencies

    csharp
    13
    0 Votes
    13 Posts
    95 Views
    E
    They probably copied it from Java and had to swap the order to avoid copyright infringement. Before the judge: See Java has its parameters in the same order for both. DotNet 1.0 is different.
  • Grow tent shop

    sales
    1
    0 Votes
    1 Posts
    10 Views
    No one has replied
  • Weird: Very confusing Base64 problem (includes quiz)

    help question csharp database com
    7
    0 Votes
    7 Posts
    42 Views
    R
    Ah, learned something new, should have known that being Dutch: Quote: In matters of commerce the fault of the Dutch Is offering too little and asking too much :-\
  • "This is a rare event"

    database csharp asp-net sql-server dotnet
    14
    0 Votes
    14 Posts
    63 Views
    R
    Which means "Stop doing this to us in here!" :mad: Just for more gig-gles, sent it over and over and see is the "rare event" message changes.
  • Today is one of those days...

    csharp asp-net dotnet com security
    1
    0 Votes
    1 Posts
    5 Views
    No one has replied