Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Other Discussions
  3. The Weird and The Wonderful
  4. Enum num num

Enum num num

Scheduled Pinned Locked Moved The Weird and The Wonderful
9 Posts 6 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    Duncan Edwards Jones
    wrote on last edited by
    #1

    One can only wonder what was going on here....

        'Generates search string using the hierarchy: 
        '1. SEDOL and ISIN and CUSIP  2. SEDOL and ISIN    3. SEDOL    4. ISIN   5. CUSIP
        Public Enum HierarchycalEquitySeachType As Integer
            SEDOL\_ISIN\_CUSIP\_\_\_SEDOL\_ISIN\_\_\_SEDOL\_\_\_ISIN\_\_\_CUSIP
        End Enum
    
    P B 2 Replies Last reply
    0
    • D Duncan Edwards Jones

      One can only wonder what was going on here....

          'Generates search string using the hierarchy: 
          '1. SEDOL and ISIN and CUSIP  2. SEDOL and ISIN    3. SEDOL    4. ISIN   5. CUSIP
          Public Enum HierarchycalEquitySeachType As Integer
              SEDOL\_ISIN\_CUSIP\_\_\_SEDOL\_ISIN\_\_\_SEDOL\_\_\_ISIN\_\_\_CUSIP
          End Enum
      
      P Offline
      P Offline
      PeejayAdams
      wrote on last edited by
      #2

      Don't you just love underscores? I once saw a sproc written by someone who had never heard of DATETIME as a datatype. There were about 3 million lines of "code" and, needless to say, it made vintage cat puke look pretty. The single most lamentable aspect of it, though, was that he padded his names with underscores to make everything the same length (especially ironic given that he didn't see any reason to format his code in any way whatsoever). It all went something like:

      select some bilge from badlynamedappointmenttable where is_monday______morning = 0 and is_monday____afternoon = 0 and is_tuesday_____morning = 0 and is_tuesday___afternoon = 0 and is_wednesday___morning = 0 ...

      Reams and reams and reams of it. How long did it take to type? How many hours did he sit there wondering why no-one had ever bothered to put some kind of date handling mechanism into an otherwise sophisticated RDBMS engine? How many times did he resist the temptation to rename his idiot columns because he couldn't figure out how many underscores to type? These, and many other questions, will probably remain unanswered for as long as the one of what on earth someone meant by ...

      'Generates search string using the hierarchy:
      '1. SEDOL and ISIN and CUSIP 2. SEDOL and ISIN 3. SEDOL 4. ISIN 5. CUSIP
      Public Enum HierarchycalEquitySeachType As Integer
      SEDOL_ISIN_CUSIP___SEDOL_ISIN___SEDOL___ISIN___CUSIP
      End Enum

      ?

      98.4% of statistics are made up on the spot.

      C 1 Reply Last reply
      0
      • P PeejayAdams

        Don't you just love underscores? I once saw a sproc written by someone who had never heard of DATETIME as a datatype. There were about 3 million lines of "code" and, needless to say, it made vintage cat puke look pretty. The single most lamentable aspect of it, though, was that he padded his names with underscores to make everything the same length (especially ironic given that he didn't see any reason to format his code in any way whatsoever). It all went something like:

        select some bilge from badlynamedappointmenttable where is_monday______morning = 0 and is_monday____afternoon = 0 and is_tuesday_____morning = 0 and is_tuesday___afternoon = 0 and is_wednesday___morning = 0 ...

        Reams and reams and reams of it. How long did it take to type? How many hours did he sit there wondering why no-one had ever bothered to put some kind of date handling mechanism into an otherwise sophisticated RDBMS engine? How many times did he resist the temptation to rename his idiot columns because he couldn't figure out how many underscores to type? These, and many other questions, will probably remain unanswered for as long as the one of what on earth someone meant by ...

        'Generates search string using the hierarchy:
        '1. SEDOL and ISIN and CUSIP 2. SEDOL and ISIN 3. SEDOL 4. ISIN 5. CUSIP
        Public Enum HierarchycalEquitySeachType As Integer
        SEDOL_ISIN_CUSIP___SEDOL_ISIN___SEDOL___ISIN___CUSIP
        End Enum

        ?

        98.4% of statistics are made up on the spot.

        C Offline
        C Offline
        charlieg
        wrote on last edited by
        #3

        I know enumerations, but I don't know why underscores would be special in them. :confused:

        Charlie Gilley <italic>Stuck in a dysfunctional matrix from which I must escape... "Where liberty dwells, there is my country." B. Franklin, 1783 “They who can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety.” BF, 1759

        D 1 Reply Last reply
        0
        • C charlieg

          I know enumerations, but I don't know why underscores would be special in them. :confused:

          Charlie Gilley <italic>Stuck in a dysfunctional matrix from which I must escape... "Where liberty dwells, there is my country." B. Franklin, 1783 “They who can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety.” BF, 1759

          D Offline
          D Offline
          Duncan Edwards Jones
          wrote on last edited by
          #4

          They aren't in any way - it seems you know enumerations better than the person who wrote that code.

          OriginalGriffO 1 Reply Last reply
          0
          • D Duncan Edwards Jones

            One can only wonder what was going on here....

                'Generates search string using the hierarchy: 
                '1. SEDOL and ISIN and CUSIP  2. SEDOL and ISIN    3. SEDOL    4. ISIN   5. CUSIP
                Public Enum HierarchycalEquitySeachType As Integer
                    SEDOL\_ISIN\_CUSIP\_\_\_SEDOL\_ISIN\_\_\_SEDOL\_\_\_ISIN\_\_\_CUSIP
                End Enum
            
            B Offline
            B Offline
            Brisingr Aerowing
            wrote on last edited by
            #5

            I think we wondered about it the last time you posted that as well...[^]

            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???

            D 1 Reply Last reply
            0
            • B Brisingr Aerowing

              I think we wondered about it the last time you posted that as well...[^]

              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???

              D Offline
              D Offline
              Duncan Edwards Jones
              wrote on last edited by
              #6

              Good lord - it's worse that I thought! (I should have fixed it back then....)

              1 Reply Last reply
              0
              • D Duncan Edwards Jones

                They aren't in any way - it seems you know enumerations better than the person who wrote that code.

                OriginalGriffO Offline
                OriginalGriffO Offline
                OriginalGriff
                wrote on last edited by
                #7

                They are if you get the enum element name using ToString, and then Split it:

                Dim h As HierarchycalEquitySeachType = HierarchycalEquitySeachType.SEDOL_ISIN_CUSIP___SEDOL_ISIN___SEDOL___ISIN___CUSIP
                Dim HierarchycalEquitySeachType____Value As String = h.ToString()
                Dim searchHierarchy As String() = HierarchycalEquitySeachType____Value.Split(New Char() {"_"C}, StringSplitOptions.RemoveEmptyEntries)

                yOu then have the hierarchy you need. Probably.

                Bad command or file name. Bad, bad command! Sit! Stay! Staaaay... AntiTwitter: @DalekDave is now a follower!

                "I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
                "Common sense is so rare these days, it should be classified as a super power" - Random T-shirt

                B 1 Reply Last reply
                0
                • OriginalGriffO OriginalGriff

                  They are if you get the enum element name using ToString, and then Split it:

                  Dim h As HierarchycalEquitySeachType = HierarchycalEquitySeachType.SEDOL_ISIN_CUSIP___SEDOL_ISIN___SEDOL___ISIN___CUSIP
                  Dim HierarchycalEquitySeachType____Value As String = h.ToString()
                  Dim searchHierarchy As String() = HierarchycalEquitySeachType____Value.Split(New Char() {"_"C}, StringSplitOptions.RemoveEmptyEntries)

                  yOu then have the hierarchy you need. Probably.

                  Bad command or file name. Bad, bad command! Sit! Stay! Staaaay... AntiTwitter: @DalekDave is now a follower!

                  B Offline
                  B Offline
                  Bernhard Hiller
                  wrote on last edited by
                  #8

                  Likely only partially correct. Looking at the comment above the enum definition and at its single member, I conclude that the first split to be done uses 3 underscores, afterwards each item gets split with a single underscore.

                  Oh sanctissimi Wilhelmus, Theodorus, et Fredericus!

                  OriginalGriffO 1 Reply Last reply
                  0
                  • B Bernhard Hiller

                    Likely only partially correct. Looking at the comment above the enum definition and at its single member, I conclude that the first split to be done uses 3 underscores, afterwards each item gets split with a single underscore.

                    Oh sanctissimi Wilhelmus, Theodorus, et Fredericus!

                    OriginalGriffO Offline
                    OriginalGriffO Offline
                    OriginalGriff
                    wrote on last edited by
                    #9

                    No, the extra underscores are there for emphasis!

                    Bad command or file name. Bad, bad command! Sit! Stay! Staaaay... AntiTwitter: @DalekDave is now a follower!

                    "I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
                    "Common sense is so rare these days, it should be classified as a super power" - Random T-shirt

                    1 Reply Last reply
                    0
                    Reply
                    • Reply as topic
                    Log in to reply
                    • Oldest to Newest
                    • Newest to Oldest
                    • Most Votes


                    • Login

                    • Don't have an account? Register

                    • Login or register to search.
                    • First post
                      Last post
                    0
                    • Categories
                    • Recent
                    • Tags
                    • Popular
                    • World
                    • Users
                    • Groups