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. The Lounge
  3. This may be the saddest code ever

This may be the saddest code ever

Scheduled Pinned Locked Moved The Lounge
17 Posts 11 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.
  • G Offline
    G Offline
    Gordon Kushner
    wrote on last edited by
    #1

    if (sex == NOT_PROVIDED)
    {
    borrowerInfoRequest.HmdaInformation.Sex = 0;
    }
    else
    {
    borrowerInfoRequest.HmdaInformation.Sex = sex;
    }

    B N L D 4 Replies Last reply
    0
    • G Gordon Kushner

      if (sex == NOT_PROVIDED)
      {
      borrowerInfoRequest.HmdaInformation.Sex = 0;
      }
      else
      {
      borrowerInfoRequest.HmdaInformation.Sex = sex;
      }

      B Offline
      B Offline
      Brady Kelly
      wrote on last edited by
      #2

      :laugh: I've just added a Select as the first value in my Gender enum to force the user to select either Male or Female, but before I renamed it to Select it was Unknown. I later thought users would find that too great a source of office or site mirth.

      OriginalGriffO B 2 Replies Last reply
      0
      • B Brady Kelly

        :laugh: I've just added a Select as the first value in my Gender enum to force the user to select either Male or Female, but before I renamed it to Select it was Unknown. I later thought users would find that too great a source of office or site mirth.

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

        What have you got against the hermaphrodites? Hmm?

        Ideological Purity is no substitute for being able to stick your thumb down a pipe to stop the water

        "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 J 2 Replies Last reply
        0
        • OriginalGriffO OriginalGriff

          What have you got against the hermaphrodites? Hmm?

          Ideological Purity is no substitute for being able to stick your thumb down a pipe to stop the water

          B Offline
          B Offline
          Brady Kelly
          wrote on last edited by
          #4

          Nothing, the gubment does though. The official stance is, pick a gender and stick with it. :laugh:

          OriginalGriffO 1 Reply Last reply
          0
          • G Gordon Kushner

            if (sex == NOT_PROVIDED)
            {
            borrowerInfoRequest.HmdaInformation.Sex = 0;
            }
            else
            {
            borrowerInfoRequest.HmdaInformation.Sex = sex;
            }

            N Offline
            N Offline
            Nish Nishant
            wrote on last edited by
            #5

            Not good design to have NOT_PROVIDED not equal to 0.

            Regards, Nish


            My technology blog: voidnish.wordpress.com Part 2 in my WinRT/C++ series : Visual C++ and WinRT/Metro - Databinding Basics

            B 1 Reply Last reply
            0
            • B Brady Kelly

              Nothing, the gubment does though. The official stance is, pick a gender and stick with it. :laugh:

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

              Do they have any major objections if I pick a gender and try to stick with the other one? I'm just old fashioned that way...

              Ideological Purity is no substitute for being able to stick your thumb down a pipe to stop the water

              "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

                Do they have any major objections if I pick a gender and try to stick with the other one? I'm just old fashioned that way...

                Ideological Purity is no substitute for being able to stick your thumb down a pipe to stop the water

                B Offline
                B Offline
                Brady Kelly
                wrote on last edited by
                #7

                As long as they don't have to work, you're probably A-OK

                1 Reply Last reply
                0
                • OriginalGriffO OriginalGriff

                  What have you got against the hermaphrodites? Hmm?

                  Ideological Purity is no substitute for being able to stick your thumb down a pipe to stop the water

                  J Offline
                  J Offline
                  Jorgen Andersson
                  wrote on last edited by
                  #8

                  Tell that to the ISO people.

                  The four codes specified in ISO/IEC 5218 are:
                  0 = not known,
                  1 = male,
                  2 = female,
                  9 = not applicable.

                  I guess they would be a 9.

                  Light moves faster than sound. That is why some people appear bright, until you hear them speak. List of common misconceptions

                  P OriginalGriffO 2 Replies Last reply
                  0
                  • G Gordon Kushner

                    if (sex == NOT_PROVIDED)
                    {
                    borrowerInfoRequest.HmdaInformation.Sex = 0;
                    }
                    else
                    {
                    borrowerInfoRequest.HmdaInformation.Sex = sex;
                    }

                    L Offline
                    L Offline
                    LloydA111
                    wrote on last edited by
                    #9

                    The SparkFun electronics site allows "Yes" as a gender option.


                    See if you can crack this: b749f6c269a746243debc6488046e33f
                    So far, no one seems to have cracked this!

                    The unofficial awesome history of Code Project's Bob! "People demand freedom of speech to make up for the freedom of thought which they avoid."

                    1 Reply Last reply
                    0
                    • J Jorgen Andersson

                      Tell that to the ISO people.

                      The four codes specified in ISO/IEC 5218 are:
                      0 = not known,
                      1 = male,
                      2 = female,
                      9 = not applicable.

                      I guess they would be a 9.

                      Light moves faster than sound. That is why some people appear bright, until you hear them speak. List of common misconceptions

                      P Offline
                      P Offline
                      PIEBALDconsult
                      wrote on last edited by
                      #10

                      8 = none o' yer durn bidness!

                      1 Reply Last reply
                      0
                      • B Brady Kelly

                        :laugh: I've just added a Select as the first value in my Gender enum to force the user to select either Male or Female, but before I renamed it to Select it was Unknown. I later thought users would find that too great a source of office or site mirth.

                        B Offline
                        B Offline
                        BillWoodruff
                        wrote on last edited by
                        #11

                        Here, in Amazing Thailand, your Gender Enum would really need to be extended, unless there's some "localization" functionality for Enum's I'm unaware of. Here, you'll find ads, at times on the front-page of one of the two major English-language newspapers, advertising sex change (male to female) for around US $1600. In fact, I can see in trying to "model" gender-identity in Thailand the necessity for a special ... new ... Type, a nested Enum ("EnumEx" ?), for reasons I won't go into here in depth. The fact that .NET demands an Enum contains only named constants providing the rationale for this ... uhhh ... thought. best, Bill

                        "Last year I went fishing with Salvador Dali. He was using a dotted line. He caught every other fish." Steven Wright

                        B 1 Reply Last reply
                        0
                        • J Jorgen Andersson

                          Tell that to the ISO people.

                          The four codes specified in ISO/IEC 5218 are:
                          0 = not known,
                          1 = male,
                          2 = female,
                          9 = not applicable.

                          I guess they would be a 9.

                          Light moves faster than sound. That is why some people appear bright, until you hear them speak. List of common misconceptions

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

                          I notice they leave a lot of space for new genders, just in case we (as a species) decide to create some new ones... :laugh:

                          Ideological Purity is no substitute for being able to stick your thumb down a pipe to stop the water

                          "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
                          • N Nish Nishant

                            Not good design to have NOT_PROVIDED not equal to 0.

                            Regards, Nish


                            My technology blog: voidnish.wordpress.com Part 2 in my WinRT/C++ series : Visual C++ and WinRT/Metro - Databinding Basics

                            B Offline
                            B Offline
                            BobJanova
                            wrote on last edited by
                            #13

                            Why not? I usually use -1, but having it at the beginning means that the literal value doesn't change when you add new entries to the enum (not that that is particularly likely for this case but still).

                            N 1 Reply Last reply
                            0
                            • B BobJanova

                              Why not? I usually use -1, but having it at the beginning means that the literal value doesn't change when you add new entries to the enum (not that that is particularly likely for this case but still).

                              N Offline
                              N Offline
                              Nish Nishant
                              wrote on last edited by
                              #14

                              BobJanova wrote:

                              Why not? I usually use -1, but having it at the beginning means that the literal value doesn't change when you add new entries to the enum (not that that is particularly likely for this case but still).

                              I reckon that's C++ code and NOT_PROVIDED is more likely a macro than an enum (although it could be an enum too). I meant the design where his user code and data model code use 2 different values to represent the same thing. NOT_PROVIDED may be coming from a 3rd party data layer, but that's just a probability.

                              Regards, Nish


                              My technology blog: voidnish.wordpress.com Part 2 in my WinRT/C++ series : Visual C++ and WinRT/Metro - Databinding Basics

                              1 Reply Last reply
                              0
                              • G Gordon Kushner

                                if (sex == NOT_PROVIDED)
                                {
                                borrowerInfoRequest.HmdaInformation.Sex = 0;
                                }
                                else
                                {
                                borrowerInfoRequest.HmdaInformation.Sex = sex;
                                }

                                D Offline
                                D Offline
                                DerekT P
                                wrote on last edited by
                                #15

                                I was once working on a database designed by someone else. Gender was stored in the customer records as a CHAR(1). That field was a foreign key into a "tblGender" table, which had the following rows defined:

                                GenderKey GenderValue
                                M M
                                F F

                                And yes, they had manually written CRUD routines to maintain that table, and included JOINS to it in views that extracted data from the customer table etc.. etc.. :sigh: :doh: Derek TP

                                H 1 Reply Last reply
                                0
                                • B BillWoodruff

                                  Here, in Amazing Thailand, your Gender Enum would really need to be extended, unless there's some "localization" functionality for Enum's I'm unaware of. Here, you'll find ads, at times on the front-page of one of the two major English-language newspapers, advertising sex change (male to female) for around US $1600. In fact, I can see in trying to "model" gender-identity in Thailand the necessity for a special ... new ... Type, a nested Enum ("EnumEx" ?), for reasons I won't go into here in depth. The fact that .NET demands an Enum contains only named constants providing the rationale for this ... uhhh ... thought. best, Bill

                                  "Last year I went fishing with Salvador Dali. He was using a dotted line. He caught every other fish." Steven Wright

                                  B Offline
                                  B Offline
                                  Brady Kelly
                                  wrote on last edited by
                                  #16

                                  How does a sex change, i.e. a change from one of two genders to the other of two genders, necessitate anything more than those two genders?

                                  1 Reply Last reply
                                  0
                                  • D DerekT P

                                    I was once working on a database designed by someone else. Gender was stored in the customer records as a CHAR(1). That field was a foreign key into a "tblGender" table, which had the following rows defined:

                                    GenderKey GenderValue
                                    M M
                                    F F

                                    And yes, they had manually written CRUD routines to maintain that table, and included JOINS to it in views that extracted data from the customer table etc.. etc.. :sigh: :doh: Derek TP

                                    H Offline
                                    H Offline
                                    H Brydon
                                    wrote on last edited by
                                    #17

                                    DerekTP123 wrote:

                                    I was once working on a database designed by someone else. Gender was stored in the customer records as a CHAR(1). That field was a foreign key into a "tblGender" table, which had the following rows defined:

                                    GenderKey GenderValue
                                    M M
                                    F F

                                    The school where my kids go has us fill out the usual forms at the beginning of the year. In the identification section for the parents, instead of using the usual M=male or F=female, they have the coding as M=mother or F=father. The database has lotsa mistakes...

                                    -- Harvey

                                    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