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

Why?

Scheduled Pinned Locked Moved The Weird and The Wonderful
comquestion
12 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.
  • A AspDotNetDev

    I made the following code, and I stand by it (kind of):

    var numTweets = parseInt("<%= NumTweets.ToString() %>", 10);

    Can you figure out why I would do such a thing? :)

    Thou mewling ill-breeding pignut!

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

    Because your tweets were numb? :confused:

    A 1 Reply Last reply
    0
    • P PIEBALDconsult

      Because your tweets were numb? :confused:

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

      :-D While most tweeters are numskulls, that is not the reason.

      Thou mewling ill-breeding pignut!

      1 Reply Last reply
      0
      • A AspDotNetDev

        I made the following code, and I stand by it (kind of):

        var numTweets = parseInt("<%= NumTweets.ToString() %>", 10);

        Can you figure out why I would do such a thing? :)

        Thou mewling ill-breeding pignut!

        A Offline
        A Offline
        Andrei Straut
        wrote on last edited by
        #4

        Because you really don't wanna know and don't care about the number of twits?

        Full-fledged Java/.NET lover, full-fledged PHP hater. Full-fledged Google/Microsoft lover, full-fledged Apple hater. Full-fledged Skype lover, full-fledged YM hater.

        A 1 Reply Last reply
        0
        • A AspDotNetDev

          I made the following code, and I stand by it (kind of):

          var numTweets = parseInt("<%= NumTweets.ToString() %>", 10);

          Can you figure out why I would do such a thing? :)

          Thou mewling ill-breeding pignut!

          C Offline
          C Offline
          Chris Meech
          wrote on last edited by
          #5

          What's the type of NumTweets? Perhaps it is not an int type and the conversion of it's type to var is different from the conversion of int to var. :)

          Chris Meech I am Canadian. [heard in a local bar] In theory there is no difference between theory and practice. In practice there is. [Yogi Berra] posting about Crystal Reports here is like discussing gay marriage on a catholic church’s website.[Nishant Sivakumar]

          A 1 Reply Last reply
          0
          • A AspDotNetDev

            I made the following code, and I stand by it (kind of):

            var numTweets = parseInt("<%= NumTweets.ToString() %>", 10);

            Can you figure out why I would do such a thing? :)

            Thou mewling ill-breeding pignut!

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

            Because you have written this in a JavaScript function in ASP.NET, and NumTweets could be any base number, but you want it translating back to base 10. Or, you're a masochist.

            *pre-emptive celebratory nipple tassle jiggle* - Sean Ewington

            "Mind bleach! Send me mind bleach!" - Nagy Vilmos

            CodeStash - Online Snippet Management | My blog | MoXAML PowerToys | Mole 2010 - debugging made easier

            A 1 Reply Last reply
            0
            • A AspDotNetDev

              I made the following code, and I stand by it (kind of):

              var numTweets = parseInt("<%= NumTweets.ToString() %>", 10);

              Can you figure out why I would do such a thing? :)

              Thou mewling ill-breeding pignut!

              S Offline
              S Offline
              Sentenryu
              wrote on last edited by
              #7

              I've made worse... in cases i were asleep:

              @{
              var style = "style=\"color=@color;\"";
              }

              I'm brazilian and english (well, human languages in general) aren't my best skill, so, sorry by my english. (if you want we can speak in C# or VB.Net =p)

              1 Reply Last reply
              0
              • A Andrei Straut

                Because you really don't wanna know and don't care about the number of twits?

                Full-fledged Java/.NET lover, full-fledged PHP hater. Full-fledged Google/Microsoft lover, full-fledged Apple hater. Full-fledged Skype lover, full-fledged YM hater.

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

                While true, it's not the reason. :)

                Thou mewling ill-breeding pignut!

                1 Reply Last reply
                0
                • C Chris Meech

                  What's the type of NumTweets? Perhaps it is not an int type and the conversion of it's type to var is different from the conversion of int to var. :)

                  Chris Meech I am Canadian. [heard in a local bar] In theory there is no difference between theory and practice. In practice there is. [Yogi Berra] posting about Crystal Reports here is like discussing gay marriage on a catholic church’s website.[Nishant Sivakumar]

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

                  It's an int. This is an ASP.Net page, so the code inside the string is VB.Net and the outside code is JavaScript.

                  Thou mewling ill-breeding pignut!

                  1 Reply Last reply
                  0
                  • P Pete OHanlon

                    Because you have written this in a JavaScript function in ASP.NET, and NumTweets could be any base number, but you want it translating back to base 10. Or, you're a masochist.

                    *pre-emptive celebratory nipple tassle jiggle* - Sean Ewington

                    "Mind bleach! Send me mind bleach!" - Nagy Vilmos

                    CodeStash - Online Snippet Management | My blog | MoXAML PowerToys | Mole 2010 - debugging made easier

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

                    All true (and that's sado-masochist to you!), but not the reason.

                    Thou mewling ill-breeding pignut!

                    1 Reply Last reply
                    0
                    • A AspDotNetDev

                      I made the following code, and I stand by it (kind of):

                      var numTweets = parseInt("<%= NumTweets.ToString() %>", 10);

                      Can you figure out why I would do such a thing? :)

                      Thou mewling ill-breeding pignut!

                      S Offline
                      S Offline
                      Sentenryu
                      wrote on last edited by
                      #11

                      just realized that this way you still get code formatting to your javascript, while if you'd used:

                      var numTweets = <%= NumTweets.ToString() %>;

                      the formatting from visual studio and the intellisense would've blown up

                      I'm brazilian and english (well, human languages in general) aren't my best skill, so, sorry by my english. (if you want we can speak in C# or VB.Net =p)

                      A 1 Reply Last reply
                      0
                      • S Sentenryu

                        just realized that this way you still get code formatting to your javascript, while if you'd used:

                        var numTweets = <%= NumTweets.ToString() %>;

                        the formatting from visual studio and the intellisense would've blown up

                        I'm brazilian and english (well, human languages in general) aren't my best skill, so, sorry by my english. (if you want we can speak in C# or VB.Net =p)

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

                        That is exactly correct! :thumbsup:

                        Thou mewling ill-breeding pignut!

                        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