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. C# Command-Line Compiler

C# Command-Line Compiler

Scheduled Pinned Locked Moved The Lounge
csharpcssquestion
14 Posts 7 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.
  • B Offline
    B Offline
    Bassam Abdul Baki
    wrote on last edited by
    #1

    NOT A PROGRAMMING QUESTION! I don't do any development at my current company, so I'm using the C# command-line compiler instead. I just modified a console application that I wrote that uses a LinkedList. I'm writing to the console window:

    Console.WriteLine("{0} - {1} - {2} - {3}", i++, numbers_temp.Count, numbers_temp.First, numbers_temp.Last);

    where

    LinkedList<ulong> numbers_temp = new LinkedList<ulong>();

    The output comes out as:

    2 - 4 - System.Collections.Generic.LinkedListNode`1[System.UInt64] - System.Collections.Generic.LinkedListNode`1[System.UInt64]

    Haven't figured out how my LinkedList is defined and is being used in a loop, no less, but the first and last elements are undefined when the count is not. NOT A PROGRAMMING QUESTION! Just fascinated by how a little change can cause such odd behavior and how much easier visual development is. :)

    E N L L L 5 Replies Last reply
    0
    • B Bassam Abdul Baki

      NOT A PROGRAMMING QUESTION! I don't do any development at my current company, so I'm using the C# command-line compiler instead. I just modified a console application that I wrote that uses a LinkedList. I'm writing to the console window:

      Console.WriteLine("{0} - {1} - {2} - {3}", i++, numbers_temp.Count, numbers_temp.First, numbers_temp.Last);

      where

      LinkedList<ulong> numbers_temp = new LinkedList<ulong>();

      The output comes out as:

      2 - 4 - System.Collections.Generic.LinkedListNode`1[System.UInt64] - System.Collections.Generic.LinkedListNode`1[System.UInt64]

      Haven't figured out how my LinkedList is defined and is being used in a loop, no less, but the first and last elements are undefined when the count is not. NOT A PROGRAMMING QUESTION! Just fascinated by how a little change can cause such odd behavior and how much easier visual development is. :)

      E Offline
      E Offline
      Ed Poore
      wrote on last edited by
      #2

      They're not defined - shouldn't it be numbers_temp.First() not numbers_temp.First - what you're printing out is the name of the function First?


      I doubt it. If it isn't intuitive then we need to fix it. - Chris Maunder

      B 1 Reply Last reply
      0
      • B Bassam Abdul Baki

        NOT A PROGRAMMING QUESTION! I don't do any development at my current company, so I'm using the C# command-line compiler instead. I just modified a console application that I wrote that uses a LinkedList. I'm writing to the console window:

        Console.WriteLine("{0} - {1} - {2} - {3}", i++, numbers_temp.Count, numbers_temp.First, numbers_temp.Last);

        where

        LinkedList<ulong> numbers_temp = new LinkedList<ulong>();

        The output comes out as:

        2 - 4 - System.Collections.Generic.LinkedListNode`1[System.UInt64] - System.Collections.Generic.LinkedListNode`1[System.UInt64]

        Haven't figured out how my LinkedList is defined and is being used in a loop, no less, but the first and last elements are undefined when the count is not. NOT A PROGRAMMING QUESTION! Just fascinated by how a little change can cause such odd behavior and how much easier visual development is. :)

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

        Missing ToString override on LinkedListNode<T> :)

        Regards, Nish


        My technology blog: voidnish.wordpress.com Code Project Forums : New Posts Monitor This application monitors for new posts in the Code Project forums.

        B 1 Reply Last reply
        0
        • E Ed Poore

          They're not defined - shouldn't it be numbers_temp.First() not numbers_temp.First - what you're printing out is the name of the function First?


          I doubt it. If it isn't intuitive then we need to fix it. - Chris Maunder

          B Offline
          B Offline
          Bassam Abdul Baki
          wrote on last edited by
          #4

          Nope, it's correct. That part of the code hasn't changed, but stopped working. http://msdn.microsoft.com/en-us/library/ms132187.aspx[^]

          Web - BM - RSS - Math - LinkedIn

          1 Reply Last reply
          0
          • B Bassam Abdul Baki

            NOT A PROGRAMMING QUESTION! I don't do any development at my current company, so I'm using the C# command-line compiler instead. I just modified a console application that I wrote that uses a LinkedList. I'm writing to the console window:

            Console.WriteLine("{0} - {1} - {2} - {3}", i++, numbers_temp.Count, numbers_temp.First, numbers_temp.Last);

            where

            LinkedList<ulong> numbers_temp = new LinkedList<ulong>();

            The output comes out as:

            2 - 4 - System.Collections.Generic.LinkedListNode`1[System.UInt64] - System.Collections.Generic.LinkedListNode`1[System.UInt64]

            Haven't figured out how my LinkedList is defined and is being used in a loop, no less, but the first and last elements are undefined when the count is not. NOT A PROGRAMMING QUESTION! Just fascinated by how a little change can cause such odd behavior and how much easier visual development is. :)

            L Offline
            L Offline
            Lost User
            wrote on last edited by
            #5

            That just means that System.Collections.Generic.LinkedListNode<T> does not override ToString so the default one is used (which prints the type). You can confirm that it doesn't override ToString with the .NET Reflector. edit: oops, beaten by nish :)

            B 1 Reply Last reply
            0
            • N Nish Nishant

              Missing ToString override on LinkedListNode<T> :)

              Regards, Nish


              My technology blog: voidnish.wordpress.com Code Project Forums : New Posts Monitor This application monitors for new posts in the Code Project forums.

              B Offline
              B Offline
              Bassam Abdul Baki
              wrote on last edited by
              #6

              On First and Last? Don't think so. It was working that way before. That part of the code hasn't changed. Only the algorithm did, so I'm not sure why that is failing now.

              N 1 Reply Last reply
              0
              • B Bassam Abdul Baki

                On First and Last? Don't think so. It was working that way before. That part of the code hasn't changed. Only the algorithm did, so I'm not sure why that is failing now.

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

                Bassam Abdul-Baki wrote:

                On First and Last?

                Okay, so does LinkedListNode<> have a ToString override? If not it would not have worked before either. Unless in your old version, First and Last returned T directly (instead of LinkedListNode<>)

                Regards, Nish


                My technology blog: voidnish.wordpress.com Code Project Forums : New Posts Monitor This application monitors for new posts in the Code Project forums.

                B 1 Reply Last reply
                0
                • L Lost User

                  That just means that System.Collections.Generic.LinkedListNode<T> does not override ToString so the default one is used (which prints the type). You can confirm that it doesn't override ToString with the .NET Reflector. edit: oops, beaten by nish :)

                  B Offline
                  B Offline
                  Bassam Abdul Baki
                  wrote on last edited by
                  #8

                  Off to meetings at the client. This will have to wait until I get home tonight. :)

                  1 Reply Last reply
                  0
                  • N Nish Nishant

                    Bassam Abdul-Baki wrote:

                    On First and Last?

                    Okay, so does LinkedListNode<> have a ToString override? If not it would not have worked before either. Unless in your old version, First and Last returned T directly (instead of LinkedListNode<>)

                    Regards, Nish


                    My technology blog: voidnish.wordpress.com Code Project Forums : New Posts Monitor This application monitors for new posts in the Code Project forums.

                    B Offline
                    B Offline
                    Bassam Abdul Baki
                    wrote on last edited by
                    #9

                    I never did have overrides and it did work before, up to a few days ago was when I last tested it. I wonder if more updates from MS broke things. Anyway, I'll use Visual Studio from home to compare the previous code and this one. Unfortunately, working from a command-line without a (visual) debugger is a bugger. :)

                    1 Reply Last reply
                    0
                    • B Bassam Abdul Baki

                      NOT A PROGRAMMING QUESTION! I don't do any development at my current company, so I'm using the C# command-line compiler instead. I just modified a console application that I wrote that uses a LinkedList. I'm writing to the console window:

                      Console.WriteLine("{0} - {1} - {2} - {3}", i++, numbers_temp.Count, numbers_temp.First, numbers_temp.Last);

                      where

                      LinkedList<ulong> numbers_temp = new LinkedList<ulong>();

                      The output comes out as:

                      2 - 4 - System.Collections.Generic.LinkedListNode`1[System.UInt64] - System.Collections.Generic.LinkedListNode`1[System.UInt64]

                      Haven't figured out how my LinkedList is defined and is being used in a loop, no less, but the first and last elements are undefined when the count is not. NOT A PROGRAMMING QUESTION! Just fascinated by how a little change can cause such odd behavior and how much easier visual development is. :)

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

                      You could download Visual Studio C# Express Edition from here[^], it is free and easy, as it offers what you call visual development. :)

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

                      Please use <PRE> tags for code snippets, they preserve indentation, and improve readability.

                      B 1 Reply Last reply
                      0
                      • B Bassam Abdul Baki

                        NOT A PROGRAMMING QUESTION! I don't do any development at my current company, so I'm using the C# command-line compiler instead. I just modified a console application that I wrote that uses a LinkedList. I'm writing to the console window:

                        Console.WriteLine("{0} - {1} - {2} - {3}", i++, numbers_temp.Count, numbers_temp.First, numbers_temp.Last);

                        where

                        LinkedList<ulong> numbers_temp = new LinkedList<ulong>();

                        The output comes out as:

                        2 - 4 - System.Collections.Generic.LinkedListNode`1[System.UInt64] - System.Collections.Generic.LinkedListNode`1[System.UInt64]

                        Haven't figured out how my LinkedList is defined and is being used in a loop, no less, but the first and last elements are undefined when the count is not. NOT A PROGRAMMING QUESTION! Just fascinated by how a little change can cause such odd behavior and how much easier visual development is. :)

                        L Offline
                        L Offline
                        leppie
                        wrote on last edited by
                        #11

                        Try

                        Console.WriteLine("{0} - {1} - {2} - {3}", i++, numbers_temp.Count, numbers_temp.First.Value, numbers_temp.Last.Value);

                        ((λ (x) `(,x ',x)) '(λ (x) `(,x ',x)))

                        B 1 Reply Last reply
                        0
                        • L Luc Pattyn

                          You could download Visual Studio C# Express Edition from here[^], it is free and easy, as it offers what you call visual development. :)

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

                          Please use <PRE> tags for code snippets, they preserve indentation, and improve readability.

                          B Offline
                          B Offline
                          Bassam Abdul Baki
                          wrote on last edited by
                          #12

                          Government network. Nothing gets installed without a ten-mile long approval list. Besides, this isn't for work. :)

                          1 Reply Last reply
                          0
                          • L leppie

                            Try

                            Console.WriteLine("{0} - {1} - {2} - {3}", i++, numbers_temp.Count, numbers_temp.First.Value, numbers_temp.Last.Value);

                            ((λ (x) `(,x ',x)) '(λ (x) `(,x ',x)))

                            B Offline
                            B Offline
                            Bassam Abdul Baki
                            wrote on last edited by
                            #13

                            Ding, ding, ding, ding, ding! Now I really need to test it at home to see why the previous method worked and this one did not when that section of the code definitely hasn't changed.

                            P 1 Reply Last reply
                            0
                            • B Bassam Abdul Baki

                              Ding, ding, ding, ding, ding! Now I really need to test it at home to see why the previous method worked and this one did not when that section of the code definitely hasn't changed.

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

                              .First, .Last are nodes, not the values you put into the nodes.

                              Agh! Reality! My Archnemesis![^]
                              | FoldWithUs! | sighist | WhoIncludes - Analyzing C++ include file hierarchy

                              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