C# Command-Line Compiler
-
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. :)
-
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. :)
-
They're not defined - shouldn't it be
numbers_temp.First()
notnumbers_temp.First
- what you're printing out is the name of the functionFirst
?
I doubt it. If it isn't intuitive then we need to fix it. - Chris Maunder
-
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. :)
Missing
ToString
override onLinkedListNode<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.
-
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. :)
-
Missing
ToString
override onLinkedListNode<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.
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.
-
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 :)
Off to meetings at the client. This will have to wait until I get home tonight. :)
-
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.
Bassam Abdul-Baki wrote:
On First and Last?
Okay, so does
LinkedListNode<>
have aToString
override? If not it would not have worked before either. Unless in your old version,First
andLast
returnedT
directly (instead ofLinkedListNode<>
)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.
-
Bassam Abdul-Baki wrote:
On First and Last?
Okay, so does
LinkedListNode<>
have aToString
override? If not it would not have worked before either. Unless in your old version,First
andLast
returnedT
directly (instead ofLinkedListNode<>
)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.
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. :)
-
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. :)
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.
-
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. :)
Try
Console.WriteLine("{0} - {1} - {2} - {3}", i++, numbers_temp.Count, numbers_temp.First.Value, numbers_temp.Last.Value);
-
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.
Government network. Nothing gets installed without a ten-mile long approval list. Besides, this isn't for work. :)
-
Try
Console.WriteLine("{0} - {1} - {2} - {3}", i++, numbers_temp.Count, numbers_temp.First.Value, numbers_temp.Last.Value);
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.
-
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.
.First, .Last are nodes, not the values you put into the nodes.
Agh! Reality! My Archnemesis![^]
| FoldWithUs! | sighist | WhoIncludes - Analyzing C++ include file hierarchy