CodeSOD: Maximum Character Width

0

Advertisement: Click here to learn how to Generate Art From Text

One of the "features" of the Oracle database is that, in addition to the "wonderful" PL/SQL language for building stored procedures, you can also write stored procedures in Java.

Now, the skills of "being a good database programmer" and "being a good Java programmer" are not necessarily overlapping, especially when you're deep in the world of Oracle's approach to programming. This is where this submission comes from. TomasComes from

    You can also contact us by email. The following are examples of static Final Shorts m_maxCharWidth[][] = {
        {
            1, 1
        }, {
            2, 1
        }, {
            3, 1
        }, {
            4, 1
        }, {
            5, 1
        }, {
            6, 1
        }, {
            7, 1
        }, {
            8, 1
        }, {
            9, 1

       //... a little later

            9998, 3
        }, {
            9999, 3
        }
    };

The first thing you should note is that the 2D array uses the first dimension of its 2D array to store data. index+1. It’s possible that someone liked Matlab a lot and wanted 1-based indexes. It's hard to say You can also find out more about the following: sure.

It's also hard to say what this is actually for. My first thought, was that the numbers were being mapped to their digits for display. Given the name, it seems likely- but that would mean they're using 3 characters to display 4 digit numbers, which would be wrong. Maybe it's mapping Unicode code points to the number of bytes they require to be represented? That doesn't jive either. Or perhaps it's (short)log(n)– a truncated, but You can also find out more about us here.All the numbers with single digits would be incorrect. Our submitter snipped the 2 digit range, so I'm not sure what was inside of there, and that might answer the question.

But then again Why am I even asking this question?? This code just shouldn't exist.


.comment { border: none; }

[Advertisement]
Otter– Provisioning your servers automatically, without the need to ever log into a command line. Start today!


‘ Credit:
Original content by thedailywtf.com: “CodeSOD Max Character Width”

Read the complete article at https://thedailywtf.com/articles/max-character-width

Leave a Reply

Your email address will not be published. Required fields are marked *