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. None World Cup related.

None World Cup related.

Scheduled Pinned Locked Moved The Lounge
csharpphpwpfcomtools
18 Posts 13 Posters 1 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.
  • P Offline
    P Offline
    Pete OHanlon
    wrote on last edited by
    #1

    I think I speak for all of us when I say WTF??? :wtf: Have a look at this[^] little beauty - VSFW (very safe for work).

    "WPF has many lovers. It's a veritable porn star!" - Josh Smith

    As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.

    My blog | My articles | MoXAML PowerToys | Onyx

    N D L E D 6 Replies Last reply
    0
    • P Pete OHanlon

      I think I speak for all of us when I say WTF??? :wtf: Have a look at this[^] little beauty - VSFW (very safe for work).

      "WPF has many lovers. It's a veritable porn star!" - Josh Smith

      As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.

      My blog | My articles | MoXAML PowerToys | Onyx

      N Offline
      N Offline
      NormDroid
      wrote on last edited by
      #2

      Crikey I amazed anybody is using LISP commercially.

      Two heads are better than one.

      1 Reply Last reply
      0
      • P Pete OHanlon

        I think I speak for all of us when I say WTF??? :wtf: Have a look at this[^] little beauty - VSFW (very safe for work).

        "WPF has many lovers. It's a veritable porn star!" - Josh Smith

        As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.

        My blog | My articles | MoXAML PowerToys | Onyx

        D Offline
        D Offline
        Dalek Dave
        wrote on last edited by
        #3

        As a programmer, I am but an Acorn amongst so many mighty Oaks, however even I at my worst, laziest, cut and pastiest would never do something as kludgy and inelegant as that! It smacks of Yuck! I mean obviously it is functional, but ugly.

        ------------------------------------ I will never again mention that I was the poster of the One Millionth Lounge Post, nor that it was complete drivel. Dalek Dave

        1 Reply Last reply
        0
        • P Pete OHanlon

          I think I speak for all of us when I say WTF??? :wtf: Have a look at this[^] little beauty - VSFW (very safe for work).

          "WPF has many lovers. It's a veritable porn star!" - Josh Smith

          As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.

          My blog | My articles | MoXAML PowerToys | Onyx

          L Offline
          L Offline
          Luc Pattyn
          wrote on last edited by
          #4

          He clearly missed an excellent opportunity for using a switch statement. Yet another reason why programmers shouldn't be payed by the hour or the number of LOC. :)

          Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles] Nil Volentibus Arduum

          Please use <PRE> tags for code snippets, it preserves indentation, improves readability.

          E 1 Reply Last reply
          0
          • P Pete OHanlon

            I think I speak for all of us when I say WTF??? :wtf: Have a look at this[^] little beauty - VSFW (very safe for work).

            "WPF has many lovers. It's a veritable porn star!" - Josh Smith

            As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.

            My blog | My articles | MoXAML PowerToys | Onyx

            E Offline
            E Offline
            Electron Shepherd
            wrote on last edited by
            #5

            Might not be so much of a WTF - it might be deliberate. The compiler will concatenate the static strings at compile time, so there is only ever one string concatentation operation, and (assuming an even distribution of number lengths), an average of 50 integer comparisons. That may be *much* faster than the "better" implementation of a for loop or similar which could involve lots of string concatentations. In time-critical code, allocating memory on the heap (as most string concatenation operations do), can be quite expensive, especially with a multi-threaded CRT. Granted, the call to Data.substring(length-2,length); when length is 2 is silly, but I bet that the substring function has some optimisations for the special case of start = 0, length = (length of string). As with a lot of these Daily WTF code examples, you need a broader context to fully appreciate it. If this code is called once per day, it's completely stupid. If it's called thousands of times per second as part of a real-time algorithmic trading application, it makes much more sense.

            Server and Network Monitoring

            D J A 4 Replies Last reply
            0
            • P Pete OHanlon

              I think I speak for all of us when I say WTF??? :wtf: Have a look at this[^] little beauty - VSFW (very safe for work).

              "WPF has many lovers. It's a veritable porn star!" - Josh Smith

              As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.

              My blog | My articles | MoXAML PowerToys | Onyx

              D Offline
              D Offline
              Dave Parker
              wrote on last edited by
              #6

              I had a good laugh at this one[^] the other day.

              C P 2 Replies Last reply
              0
              • P Pete OHanlon

                I think I speak for all of us when I say WTF??? :wtf: Have a look at this[^] little beauty - VSFW (very safe for work).

                "WPF has many lovers. It's a veritable porn star!" - Josh Smith

                As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.

                My blog | My articles | MoXAML PowerToys | Onyx

                E Offline
                E Offline
                Ennis Ray Lynch Jr
                wrote on last edited by
                #7

                Now if I could just get Visual Studio to alternate the code row line colors like that.

                Need custom software developed? I do custom programming based primarily on MS tools with an emphasis on C# development and consulting. A man said to the universe: "Sir I exist!" "However," replied the universe, "The fact has not created in me A sense of obligation." --Stephen Crane

                1 Reply Last reply
                0
                • E Electron Shepherd

                  Might not be so much of a WTF - it might be deliberate. The compiler will concatenate the static strings at compile time, so there is only ever one string concatentation operation, and (assuming an even distribution of number lengths), an average of 50 integer comparisons. That may be *much* faster than the "better" implementation of a for loop or similar which could involve lots of string concatentations. In time-critical code, allocating memory on the heap (as most string concatenation operations do), can be quite expensive, especially with a multi-threaded CRT. Granted, the call to Data.substring(length-2,length); when length is 2 is silly, but I bet that the substring function has some optimisations for the special case of start = 0, length = (length of string). As with a lot of these Daily WTF code examples, you need a broader context to fully appreciate it. If this code is called once per day, it's completely stupid. If it's called thousands of times per second as part of a real-time algorithmic trading application, it makes much more sense.

                  Server and Network Monitoring

                  D Offline
                  D Offline
                  Dinobot_Slag
                  wrote on last edited by
                  #8

                  How about: left("000000...00000000", 100 - length(data)) + data

                  E 1 Reply Last reply
                  0
                  • D Dinobot_Slag

                    How about: left("000000...00000000", 100 - length(data)) + data

                    E Offline
                    E Offline
                    Electron Shepherd
                    wrote on last edited by
                    #9

                    Yep, that would also work (with a special case for length > 100)

                    Server and Network Monitoring

                    P 1 Reply Last reply
                    0
                    • E Electron Shepherd

                      Might not be so much of a WTF - it might be deliberate. The compiler will concatenate the static strings at compile time, so there is only ever one string concatentation operation, and (assuming an even distribution of number lengths), an average of 50 integer comparisons. That may be *much* faster than the "better" implementation of a for loop or similar which could involve lots of string concatentations. In time-critical code, allocating memory on the heap (as most string concatenation operations do), can be quite expensive, especially with a multi-threaded CRT. Granted, the call to Data.substring(length-2,length); when length is 2 is silly, but I bet that the substring function has some optimisations for the special case of start = 0, length = (length of string). As with a lot of these Daily WTF code examples, you need a broader context to fully appreciate it. If this code is called once per day, it's completely stupid. If it's called thousands of times per second as part of a real-time algorithmic trading application, it makes much more sense.

                      Server and Network Monitoring

                      J Offline
                      J Offline
                      J4amieC
                      wrote on last edited by
                      #10

                      TopCod3r... is that you?????

                      1 Reply Last reply
                      0
                      • D Dave Parker

                        I had a good laugh at this one[^] the other day.

                        C Offline
                        C Offline
                        Chris Losinger
                        wrote on last edited by
                        #11

                        OMFG :laugh:

                        image processing toolkits | batch image processing

                        1 Reply Last reply
                        0
                        • E Electron Shepherd

                          Yep, that would also work (with a special case for length > 100)

                          Server and Network Monitoring

                          P Offline
                          P Offline
                          peterchen
                          wrote on last edited by
                          #12

                          or length < 0 you never know, you know! :rolleyes:

                          Agh! Reality! My Archnemesis![^]
                          | FoldWithUs! | sighist | µLaunch - program launcher for server core and hyper-v server.

                          1 Reply Last reply
                          0
                          • L Luc Pattyn

                            He clearly missed an excellent opportunity for using a switch statement. Yet another reason why programmers shouldn't be payed by the hour or the number of LOC. :)

                            Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles] Nil Volentibus Arduum

                            Please use <PRE> tags for code snippets, it preserves indentation, improves readability.

                            E Offline
                            E Offline
                            El Corazon
                            wrote on last edited by
                            #13

                            Luc Pattyn wrote:

                            Yet another reason why programmers shouldn't be payed by the hour or the number of LOC.

                            I was at a presentation last week where a national military standards group qualified time-savings & dollars through LOC generated by a tool. Now given it will take you a week to install the thing, a week to get your "object model approved" and who knows how long to design the damn object model given that there is no way to verify on-site that the darn thing is correct other than generating code, compiling and failing, so going back to check your Object Model change something, generate code, compile, fail... etc... until it works. It sends data in a bogged down 85% overhead packet on the network, with a middle-man communicator in-between.... :) Gotta love all that time&dollar savings! all of their $ figures came from LOC. The middleware library freely given is saving your company x$ because of the 50,000LOC. Plus the OM code generator is saving you y$ for every 1000LOC it generates. :rolleyes: :rolleyes: The worst part is, they were completely serious, AND the military uses their numbers as proof of project worth.... :rolleyes:

                            _________________________ John Andrew Holmes "It is well to remember that the entire universe, with one trifling exception, is composed of others." Shhhhh.... I am not really here. I am a figment of your imagination.... I am still in my cave so this must be an illusion....

                            L 1 Reply Last reply
                            0
                            • E El Corazon

                              Luc Pattyn wrote:

                              Yet another reason why programmers shouldn't be payed by the hour or the number of LOC.

                              I was at a presentation last week where a national military standards group qualified time-savings & dollars through LOC generated by a tool. Now given it will take you a week to install the thing, a week to get your "object model approved" and who knows how long to design the damn object model given that there is no way to verify on-site that the darn thing is correct other than generating code, compiling and failing, so going back to check your Object Model change something, generate code, compile, fail... etc... until it works. It sends data in a bogged down 85% overhead packet on the network, with a middle-man communicator in-between.... :) Gotta love all that time&dollar savings! all of their $ figures came from LOC. The middleware library freely given is saving your company x$ because of the 50,000LOC. Plus the OM code generator is saving you y$ for every 1000LOC it generates. :rolleyes: :rolleyes: The worst part is, they were completely serious, AND the military uses their numbers as proof of project worth.... :rolleyes:

                              _________________________ John Andrew Holmes "It is well to remember that the entire universe, with one trifling exception, is composed of others." Shhhhh.... I am not really here. I am a figment of your imagination.... I am still in my cave so this must be an illusion....

                              L Offline
                              L Offline
                              Luc Pattyn
                              wrote on last edited by
                              #14

                              El Corazon wrote:

                              they were completely serious

                              Numbers are particularly suitable for telling the future. If only all assumptions were explicit, known, valid, and constant over time. Quod numquam. :)

                              Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles] Nil Volentibus Arduum

                              Please use < PRE > tags for code snippets, it preserves indentation, and improves readability.


                              40 characters to let.

                              E 1 Reply Last reply
                              0
                              • L Luc Pattyn

                                El Corazon wrote:

                                they were completely serious

                                Numbers are particularly suitable for telling the future. If only all assumptions were explicit, known, valid, and constant over time. Quod numquam. :)

                                Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles] Nil Volentibus Arduum

                                Please use < PRE > tags for code snippets, it preserves indentation, and improves readability.


                                40 characters to let.

                                E Offline
                                E Offline
                                El Corazon
                                wrote on last edited by
                                #15

                                Luc Pattyn wrote:

                                Numbers are particularly suitable for telling the future. If only all assumptions were explicit, known, valid, and constant over time. Quod numquam.

                                I wonder how their record for predicting the future meets up with mine? :-D

                                _________________________ John Andrew Holmes "It is well to remember that the entire universe, with one trifling exception, is composed of others." Shhhhh.... I am not really here. I am a figment of your imagination.... I am still in my cave so this must be an illusion....

                                1 Reply Last reply
                                0
                                • D Dave Parker

                                  I had a good laugh at this one[^] the other day.

                                  P Offline
                                  P Offline
                                  Pete OHanlon
                                  wrote on last edited by
                                  #16

                                  My head hurts. :omg:

                                  "WPF has many lovers. It's a veritable porn star!" - Josh Smith

                                  As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.

                                  My blog | My articles | MoXAML PowerToys | Onyx

                                  1 Reply Last reply
                                  0
                                  • E Electron Shepherd

                                    Might not be so much of a WTF - it might be deliberate. The compiler will concatenate the static strings at compile time, so there is only ever one string concatentation operation, and (assuming an even distribution of number lengths), an average of 50 integer comparisons. That may be *much* faster than the "better" implementation of a for loop or similar which could involve lots of string concatentations. In time-critical code, allocating memory on the heap (as most string concatenation operations do), can be quite expensive, especially with a multi-threaded CRT. Granted, the call to Data.substring(length-2,length); when length is 2 is silly, but I bet that the substring function has some optimisations for the special case of start = 0, length = (length of string). As with a lot of these Daily WTF code examples, you need a broader context to fully appreciate it. If this code is called once per day, it's completely stupid. If it's called thousands of times per second as part of a real-time algorithmic trading application, it makes much more sense.

                                    Server and Network Monitoring

                                    A Offline
                                    A Offline
                                    AspDotNetDev
                                    wrote on last edited by
                                    #17

                                    I supposed they may not have been aware of StringBuilder. Or string.Concat. Or the string constructor that takes a character and the number of times to repeat it. Or populating an array once up front (using a for loop, a bunch of index operations, or one of the above listed concatenation techniques) and then using an index operation to access the appropriate string of zeroes. And I supposed they may not be in an environment where they can create a static variable (i.e., an array). My guess is they are just inexperienced.

                                    [Forum Guidelines]

                                    1 Reply Last reply
                                    0
                                    • E Electron Shepherd

                                      Might not be so much of a WTF - it might be deliberate. The compiler will concatenate the static strings at compile time, so there is only ever one string concatentation operation, and (assuming an even distribution of number lengths), an average of 50 integer comparisons. That may be *much* faster than the "better" implementation of a for loop or similar which could involve lots of string concatentations. In time-critical code, allocating memory on the heap (as most string concatenation operations do), can be quite expensive, especially with a multi-threaded CRT. Granted, the call to Data.substring(length-2,length); when length is 2 is silly, but I bet that the substring function has some optimisations for the special case of start = 0, length = (length of string). As with a lot of these Daily WTF code examples, you need a broader context to fully appreciate it. If this code is called once per day, it's completely stupid. If it's called thousands of times per second as part of a real-time algorithmic trading application, it makes much more sense.

                                      Server and Network Monitoring

                                      A Offline
                                      A Offline
                                      AspDotNetDev
                                      wrote on last edited by
                                      #18

                                      Oh, that looks like another language (JavaScript?) than what I was initially thinking (C#). I supposed join would be the way to go in that case.

                                      [Forum Guidelines]

                                      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