• blunden (unregistered)

    Nice one.

  • NiceWTF (unregistered)

    OK, this actually makes some sense, at least from the address data vendor point of view.

    Where I live, houses on one side of a street are often numbered even, while those on the opposite side have only odd numbers.

    But some streets are so short (or whatever other reasons there might be) they don't bother doing this, so they are just numbered sequentially.

    Actually, the zipcodes (called 'postcode', where I live) are often different for the odd and even sides of the same street. Except, again, for very small streets.

    W.r.t. whether this makes sense, I was not referring to the source code you posted though ;)

  • JC (unregistered)

    Haven't they used the Mod function incorrectly as well?

    2 Mod CType(StreetNumberValue, Integer) = 0 will check to see if 2 divides by the street number when surely they want it the other way round.

  • (cs)

    I guess we have to go to both partitions to access the data then ?

  • NiceWTF (unregistered)

    To clarify, my post was to explain the seemingly weird data model used by the address data vendor. It may actually make some sense when they sort the table by zipcode (which is likely).

    Each zipcode is for 'odd, even, or both' sides of a street.

  • Tidus (unregistered) in reply to JC
    JC:
    Haven't they used the Mod function incorrectly as well?

    2 Mod CType(StreetNumberValue, Integer) = 0 will check to see if 2 divides by the street number when surely they want it the other way round.

    You're definitely right. Also, the semantics of the sy;bols used is wrong ... EVEN and ODD are good. But to be logical, BOTH should have been something more like NONE or UNUSED ...

  • (cs)

    It seems simple from the example code, if the "Number" isn't numeric, it's Both Odd and Even. If you live at "J" Generic Street, is your address Even or Odd? It would probably be better to use None, though.

  • sol (unregistered)
    Sub foo(ByVal db As IUnknown, ByVal streetNumber As Double)
        Dim inserted As Boolean = False
        If Math.IEEERemainder(streetNumber, 2) = 0 Then
            db.Insert("even")
            inserted = True
        Else
            db.Insert("odd")
            inserted = True
        End If
    
        If Not inserted = True Then 'code will never run
            db.Insert("both")
            inserted = True
        End If
    End Sub
    
  • (cs)

    Please provide a description of the physical location of the submitter.

  • Fred (unregistered)

    The US Postal Service is the primary source of this silliness. All of their street data products use the OEB coding to assign ZIP9's within a ZIP5.

  • RandyD (unregistered)

    Building 2 North University Drive Somewhere, AB

    = BOTH.

    sorta - i agree should be NONE or NON-NUMERIC or something other than BOTH.

    Looks like lots of unrunnable code also.

  • (cs)

    Hate to say it, but the end result of the code actually makes sense.

    1551 N. Anywhere St = odd 1552 N. Anywhere St = even Building A S. Nowhere Ave = both

    "Neither" would be a better word for it, but having it be 3-state is actually necessary.

    The purpose of such division is for postal presorting. If you want to run what's called a "walk sequence presort", which gets you the best possible postal rate, you need to have those three states.

    It is, as mentioned by a prior post, used to determine which side of the street the address is on. Odd being on one side and even on the other is very much a standard arrangement. Having the mail sorted that way helps the post office deliver it with greater efficiency. Thus, a huge postage discount if you sort it that way before you ever give it to them for delivery.

    On the other hand, the Mod operation is backwards. It's dividing 2 by the street number, not the other way around. That may be an error in the submission, since it would result in huge data errors which would be immediately noticeable in any actual production environment. (If, as I suggest, this code is being used for presorting, the very first mailing done with that would be rejected by the post office with instructions on how to fix it.)

    If the actual code doesn't have that error, then there's nothing at all wrong with that part of it. At least, not that I see.

  • (cs)

    so if it's not numeric, then it's both even and odd? So the string "test" is even and odd. I wonder what the mathematical proof of that looks like!

  • (cs) in reply to RandyD
    sorta - i agree should be NONE or NON-NUMERIC or something other than BOTH.

    Depends on the point of view. If you're asking, "Is this address odd, even, or xxx," xxx should probably be "neither." But if your question is, "What addresses does this postal code cover, odd ones, even ones, or xxx," xxx makes more sense as "both" that as "neither" (since it does cover odd and even addresses). Without knowing the context, we can't say that this doesn't make sense.

  • Duston (unregistered)

    And what about those silly vanity addresses? #1 My Company Thinks a Whole Lot of Itself Avenue, which of course could be on either side of a long street? I guess that would fall under the "FILE_NOT_FOUND" category.

  • nobody (unregistered)

    I once lived in a duplex. Each side had its own address: 8L and 8R I guess this ends up in "both" because it is non-numeric

  • different (unregistered) in reply to Duston

    I live on a block that has a few fractional addresses (really!).

    How would their algorithm handle: "38 1/2 xyz street" ?

  • Therac-25 (unregistered) in reply to different
    How would their algorithm handle: "38 1/2 xyz street" ?

    I would (optimistically) assume that the 1/2 is in a different field, and the algorithm in question is only operating on the 38 portion of it.

    The "Both" makes sense given the context, I don't see what's so weird about it -- there are "court" streets all over suburbia that are a circle and don't have 2 distinct sides for odd/even. If you're trying to figure out what side of the road the house is on, being told "odd" or "even" when there's only one side of the road is a bigger WTF.

    CAPTCHA: alarm, the system call which is involved in a bug (err, sorry, "outdated feature") I'm trying to fix this morning.

  • Mike Dimmick (unregistered) in reply to JC
    JC:
    Haven't they used the Mod function incorrectly as well?

    2 Mod CType(StreetNumberValue, Integer) = 0 will check to see if 2 divides by the street number when surely they want it the other way round.

    Which, in practice, means that number 1 and 2 are Even but all other numbers are Odd. 2 Mod 1 = 0, 2 Mod 2 = 0, 2 Mod 3 = 2, 2 Mod 4 = 2, 2 Mod 5 = 2, etc.

    Odd definition. :P

    CAPTCHA: dreadlocks. Like deadlocks, but worse.

  • Steve Boyko (unregistered)

    I'd like to see the buildings that are on both sides of the street. Does the street run right through the middle of the building? ;)

  • (cs) in reply to Steve Boyko
    Steve Boyko:
    I'd like to see the buildings that are on both sides of the street. Does the street run right through the middle of the building? ;)

    I will quote:

    "Our house, in the middle of the street."

  • (cs) in reply to Steve Boyko
    Steve Boyko:
    I'd like to see the buildings that are on both sides of the street. Does the street run right through the middle of the building? ;)

    I've seen buildings that are on both sides of the street, the center of the building is a bridge over the street. I'm not sure if is considered 2 buildings for addressing sake or not.

  • Roy (unregistered) in reply to Steve Boyko

    I'd like to see the buildings that are on both sides of the > street. Does the street run right through the middle of the > building? ;)

    The John Lewis department store in Kingston upon Thames in England straddles a major road.

  • BitTwiddler (unregistered) in reply to Steve Boyko
    Steve Boyko:
    I'd like to see the buildings that are on both sides of the street. Does the street run right through the middle of the building? ;)
    I've seen a driveway that goes right thru the middle of the house! Really - it's a two-story house with a large top floor and two smaller first-floors, one on either side of the driveway (I have no idea how the inside is layed out)
  • Cheetah (unregistered)

    This reminds me of a related real world WTF. A friend of mine has some warehouse space. The (major) road it is located on, like pretty much any road in the USA, has all the even numbers on one side and the odd numbers on the other side. Except this one warehouse building, which has an odd number on the even side of the street.

    Apparently this confuses the shit out of Fedex, UPS, and just about any other person trying to deliver anything.

  • Jim (unregistered) in reply to Steve Boyko
    Steve Boyko:
    I'd like to see the buildings that are on both sides of the street. Does the street run right through the middle of the building? ;)

    Or maybe you could be living at 7 Möbius Strip?

  • JC (unregistered) in reply to Roy
    Roy:
    > I'd like to see the buildings that are on both sides of the > street. Does the street run right through the middle of the > building? ;)

    The John Lewis department store in Kingston upon Thames in England straddles a major road.

    Indeed. http://maps.google.co.uk/maps?ie=UTF8&oe=UTF-8&hl=en&q=&ll=51.411661,-0.306673&spn=0.002583,0.006491&t=k&z=17&om=1

    Obviously this program was designed to handle situations just like this.

  • (cs)

    wasn't there a sidebar post recently that showed how people like to name streets

  • Robert Hanson (unregistered)

    Reminds me of the French class I took. In French, you modify the verb being used depending on whether the subject is "male", "female" or "plural". Some things are obviously male or female, while others are not (is a book male or female?)

    My instructor told us that trying to "reason out" the gender of an object is useless. Just memorize which bucket a thing goes into; one bucket is "male" and the other is "female".

    In this example, you're really classifying addresses into three buckets; we call one "even", one "odd" and one "both". They could have been called "North/West; South/East" and "Other", or any other set of names.

    We may not understand the business rules for determining which bucket an address goes into; and clearly the code implimenting the business rules is broken (2 mod x); and perhaps the names of the buckets are poorly chosen. But the end result is an address goes into one of the three buckets, in accordance with the business rules.

  • Maciej (unregistered)

    Also, the old Post Office in downtown Chicago.

    http://maps.google.com/?ie=UTF8&t=k&om=1&ll=41.875585,-87.638251&spn=0.005832,0.010042&z=17

  • (cs) in reply to blunden
    blunden:
    Nice one.

    Odd comment.

  • (cs) in reply to Dustin_00
    Dustin_00:
    blunden:
    Nice one.

    Odd comment.

    Actually, it is an Even comment. (#141320)

  • (cs) in reply to Robert Hanson
    Robert Hanson:
    Reminds me of the French class I took. In French, you modify the verb being used depending on whether the subject is "male", "female" or "plural". Some things are obviously male or female, while others are not (is a book male or female?)

    My instructor told us that trying to "reason out" the gender of an object is useless. Just memorize which bucket a thing goes into; one bucket is "male" and the other is "female".

    Especially since "reasoning out" the gender is often wrong. In French, the word for "handbag" is masculine and the word for "mustache" is feminine, for instance.

  • Michael (unregistered) in reply to Gsquared
    Gsquared:
    Hate to say it, but the end result of the code actually makes sense.

    1551 N. Anywhere St = odd 1552 N. Anywhere St = even Building A S. Nowhere Ave = both

    "Neither" would be a better word for it, but having it be 3-state is actually necessary.

    The purpose of such division is for postal presorting. If you want to run what's called a "walk sequence presort", which gets you the best possible postal rate, you need to have those three states.

    Wouldn't it be easier to just say that if a street doesn't allow for the distinction, that all addresses on that street will be arbitrarily label as being on the "odd" side? That way you don't need to complicate what should be simple logic:

    if (isNumeric(address) && (address % 2 == 0)) { sideType = "E"; // Even } else { sideType = "O"; //Odd }

    See? Simple. Even making the "walk sequence" requires no extra logic, because all "Odd" would have the same sequence as all "Both". Even if you came to realize that "Building A" is in the middle of the "Even" side of a street that otherwise contains numbered addresses, you can just manually change the sideType entry in the database for that one case, and all the logic still works out the same.

  • (cs) in reply to Robert Hanson
    Robert Hanson:
    Reminds me of the French class I took. In French, you modify the verb being used depending on whether the subject is "male", "female" or "plural". Some things are obviously male or female, while others are not (is a book male or female?)

    My instructor told us that trying to "reason out" the gender of an object is useless. Just memorize which bucket a thing goes into; one bucket is "male" and the other is "female".

    Not quite. "Odd" and "even" would not be as good names for the French genders as "masculine" and "feminine" (note the distinction: "masculine" and "feminine" are grammatical genders; "male" and "female" are biological sexes). The reason: men's names are masculine and women's are feminine.

  • (cs) in reply to Jim
    Jim:
    Steve Boyko:
    I'd like to see the buildings that are on both sides of the street. Does the street run right through the middle of the building? ;)

    Or maybe you could be living at 7 Möbius Strip?

    I cast my vote for best reply of the day.

  • (cs) in reply to Coincoin
    Coincoin:
    Jim:
    Steve Boyko:
    I'd like to see the buildings that are on both sides of the street. Does the street run right through the middle of the building? ;)

    Or maybe you could be living at 7 Möbius Strip?

    I cast my vote for best reply of the day.

    i concur
  • (cs) in reply to Someone You Know
    Someone You Know:
    Robert Hanson:
    Reminds me of the French class I took. In French, you modify the verb being used depending on whether the subject is "male", "female" or "plural". Some things are obviously male or female, while others are not (is a book male or female?)

    My instructor told us that trying to "reason out" the gender of an object is useless. Just memorize which bucket a thing goes into; one bucket is "male" and the other is "female".

    Especially since "reasoning out" the gender is often wrong. In French, the word for "handbag" is masculine and the word for "mustache" is feminine, for instance.

    Actually, some words are both masculine and feminine, such as "amour" (love). So, yeah, there is also a Both bucket for french words.

  • sol (unregistered)

    What if we just use the mean of the char code? That way we can make it even more useless and still use numeric values...

    Really it seems like a case of invalid logic to me.

    120 FooBAR St Apt. 107B Impossible, CPU 55555-5555

    ^------- both?

    The way the code looks and what was said about how "usually" odds are on one side and evens on different sides makes sense though. So you would pretty much always want to check a numeric value not the entire address.

  • (cs) in reply to RobbieAreBest
    RobbieAreBest:
    Coincoin:
    Jim:
    Steve Boyko:
    I'd like to see the buildings that are on both sides of the street. Does the street run right through the middle of the building? ;)

    Or maybe you could be living at 7 Möbius Strip?

    I cast my vote for best reply of the day.

    i concur
    I don't get it. Anyone care to explain?
  • (cs) in reply to Jim
    Jim:
    Steve Boyko:
    I'd like to see the buildings that are on both sides of the street. Does the street run right through the middle of the building? ;)

    Or maybe you could be living at 7 Möbius Strip?

    I saw a möbius stripper once. I thought she was a bit two dimensional.

  • sol (unregistered) in reply to freelancer
    freelancer:
    RobbieAreBest:
    Coincoin:
    Jim:
    Steve Boyko:
    I'd like to see the buildings that are on both sides of the street. Does the street run right through the middle of the building? ;)

    Or maybe you could be living at 7 Möbius Strip?

    I cast my vote for best reply of the day.

    i concur
    I don't get it. Anyone care to explain?

    how do you spell culdasac?

  • (cs) in reply to freelancer
    freelancer:
    RobbieAreBest:
    Coincoin:
    Jim:
    Steve Boyko:
    I'd like to see the buildings that are on both sides of the street. Does the street run right through the middle of the building? ;)

    Or maybe you could be living at 7 Möbius Strip?

    I cast my vote for best reply of the day.

    i concur
    I don't get it. Anyone care to explain?

    A mobius strip, here's how to make one.

    1. Cut a strip of paper.
    2. Give the paper a half twist.
    3. Join the two ends together to form a "ring".

    Now guess how many sides this strip of paper has. It actually only has one side. To prove it, take a pen and without lifting it draw along the middle of the side until you reach your stating point, then find the side without a line. Interestingly, there is also only one edge. It is a two-dimensional figure in three dimensional space. Now theoretically joining two of them together along their edges will also produce a Kline bottle. Go ahead and Google that one.

  • Kyle Söze (unregistered) in reply to Tidus
    Tidus:
    JC:
    Haven't they used the Mod function incorrectly as well?

    2 Mod CType(StreetNumberValue, Integer) = 0 will check to see if 2 divides by the street number when surely they want it the other way round.

    You're definitely right. Also, the semantics of the sy;bols used is wrong ... EVEN and ODD are good. But to be logical, BOTH should have been something more like NONE or UNUSED ...

    Kyle Söze says:

    Kyle Söze:
    MY WAY OR THE HIGHWAY!
  • (cs) in reply to barfoo
    barfoo:
    sorta - i agree should be NONE or NON-NUMERIC or something other than BOTH.

    Depends on the point of view. If you're asking, "Is this address odd, even, or xxx," xxx should probably be "neither." But if your question is, "What addresses does this postal code cover, odd ones, even ones, or xxx," xxx makes more sense as "both" that as "neither" (since it does cover odd and even addresses). Without knowing the context, we can't say that this doesn't make sense.

    How about: ODD EVEN FILENOTFOUND

    End of discussion!

  • (cs) in reply to Coincoin
    Coincoin:
    Jim:
    Steve Boyko:
    I'd like to see the buildings that are on both sides of the street. Does the street run right through the middle of the building? ;)

    Or maybe you could be living at 7 Möbius Strip?

    I cast my vote for best reply of the day.

    And He Built a Crooked House is about a man who built a house that is a (four-dimensional) HyperCube. In the story, you walk from room to room but never find your way out.
  • TheReligion2000 (unregistered) in reply to Someone You Know
    Someone You Know:
    Robert Hanson:
    Reminds me of the French class I took. In French, you modify the verb being used depending on whether the subject is "male", "female" or "plural". Some things are obviously male or female, while others are not (is a book male or female?)

    My instructor told us that trying to "reason out" the gender of an object is useless. Just memorize which bucket a thing goes into; one bucket is "male" and the other is "female".

    Especially since "reasoning out" the gender is often wrong. In French, the word for "handbag" is masculine and the word for "mustache" is feminine, for instance.

    and vagina is male and penis female

    Those frogs

  • (cs) in reply to Michael
    Michael:
    Gsquared:
    Hate to say it, but the end result of the code actually makes sense.

    1551 N. Anywhere St = odd 1552 N. Anywhere St = even Building A S. Nowhere Ave = both

    "Neither" would be a better word for it, but having it be 3-state is actually necessary.

    The purpose of such division is for postal presorting. If you want to run what's called a "walk sequence presort", which gets you the best possible postal rate, you need to have those three states.

    Wouldn't it be easier to just say that if a street doesn't allow for the distinction, that all addresses on that street will be arbitrarily label as being on the "odd" side? That way you don't need to complicate what should be simple logic:

    if (isNumeric(address) && (address % 2 == 0)) { sideType = "E"; // Even } else { sideType = "O"; //Odd }

    See? Simple. Even making the "walk sequence" requires no extra logic, because all "Odd" would have the same sequence as all "Both". Even if you came to realize that "Building A" is in the middle of the "Even" side of a street that otherwise contains numbered addresses, you can just manually change the sideType entry in the database for that one case, and all the logic still works out the same.

    Actually, if you want the full data on it, you just have to read thoroughly about 8,000 pages of postal regulations on presorting requirements.

    As for "manually changing the one entry", what do you do if you're mailing 6-million pieces and 300-thousand of them have alpha data in their street address number? Do you pay for a huge number of man-hours of looking up each of those manually? Remember, a lot of online mapping programs use the odd-even rule and figure out where an address is based on that, rather than having actual geographic data in them (my father's house is 3 miles away from where Google maps says it is, because of a numbering convention deviation on that street). So, to "manually correct" those 300-thousand addresses, you would have to pay people to actually go and verify their locations.

    Or, you could differentiate them as "both" and pay a slightly higher postal rate on those 300-thousand than what you pay on the rest of the mailing, and let the postal carrier figure those ones out on his/her own. Most likely, if they've worked the route for more than a week, they already know where they want it in their boxes. Postal presorting allows for some of the mailing to be at one rate and the rest at another (or more complex breakdowns).

    So, which would you rather do: Pay thousands of man-hours and delay the mailing by up to several months, while you gather data and manually update your database 1 row at a time, or set a flag to "both" and pay an additional 3 cents * 300-thousand pieces ($9000.00)?

    Of course, if you merge your "both" and "odd" flags, you'd end up paying a lot more, because every "odd" address would get bumped up to the "both" rate.

  • (cs) in reply to TheReligion2000
    TheReligion2000:
    Someone You Know:
    Robert Hanson:
    Reminds me of the French class I took. In French, you modify the verb being used depending on whether the subject is "male", "female" or "plural". Some things are obviously male or female, while others are not (is a book male or female?)

    My instructor told us that trying to "reason out" the gender of an object is useless. Just memorize which bucket a thing goes into; one bucket is "male" and the other is "female".

    Especially since "reasoning out" the gender is often wrong. In French, the word for "handbag" is masculine and the word for "mustache" is feminine, for instance.

    and vagina is male and penis female

    Those frogs

    I guess they are named as to who wants more of each.

  • Call Me Joe (unregistered) in reply to KattMan
    KattMan:
    I saw a möbius stripper once. I thought she was a bit two dimensional.
    Weird... when I saw her she just seemed to be going over the same routine she'd gone over a thousand times before...

Leave a comment on “Odd or Even... or Both?”

Log In or post as a guest

Replying to comment #141327:

« Return to Article