|
ye shot, got it working now, used the int[], its storing them and getting them. just need to sort them now, have the method in place, just assigning them now. so its almost done
Thanx
Dan
|
|
|
|
|
k all sorted now, sorting it perfectly. phew, that was stressful, wat a mission. cant believe it took me so long, im really rusty!
|
|
|
|
|
Glad to have been of help!
--
Cheers,
Gary
http://www.garyshort.org
|
|
|
|
|
what u people r doing i dont know..
this is a class room discusion or what..
sh*t...........
|
|
|
|
|
Daniel_Logan wrote: no its not homework, practising for an exam next week
Same thing, isn't it?
---
"Anything that is in the world when you're born is normal and ordinary and is just a natural part of the way the world works. Anything that's invented between when you're fifteen and thirty-five is new and exciting and revolutionary and you can probably get a career in it. Anything invented after you're thirty-five is against the natural order of things."
-- Douglas Adams
|
|
|
|
|
Ahoy there, Gary! (You were my TA in Patty Foutz's CS1070 class, Va Tech (Blacksburg), circa 1980!). How time flies! Trust you're well.
/ravi
|
|
|
|
|
I'm very well thank you, but I'm afraid I as not your TA, I'm based in Scotland, UK
--
Cheers,
Gary
http://www.garyshort.org
|
|
|
|
|
Sorry, I mistook you for someone with the same name who was my TA in 1980.
/ravi
|
|
|
|
|
You had a "territorial army"? WOW!! (Actually, I assume TA stands for something else, but I don't know what it is)
|
|
|
|
|
TA = Teaching Assistant
GTA = Graduate Teaching Assistant
RA = Research Assistant
GRA = Graduate Research Assistant
There was a guy named Gary Short who was the TA for my first CS course in '81. I was probably the only graduate student in the course.
/ravi
|
|
|
|
|
How can you know about technical details like boxing/unboxing without knowing List<int>?
|
|
|
|
|
I'm afraid your quesetion does not make much sense. Boxing does not have anything to do with generics per se.
--
Cheers,
Gary
http://www.garyshort.org
|
|
|
|
|
You might want to do a quick Google search.[^]
Generics allows creating general collection classes where no boxing/unboxing will take place when adding or accessing items.
The generic List collection is an example of such a collections (well, all of the supplied generic collections in .NET 2.0 are as far as I know, but the List is the replacement of the obsolete ArrayList originally mentioned).
Of course it is possible to create a list collection with int values where no boxing/unboxing is performed without using generics, but then the collection would have to be programmed specifically for the int type and could not be used for other value types (besides copy-paste-modify "code reuse" obviously).
|
|
|
|
|
Thank you I knew that, but your original question still makes no sense. It still doesn't make sense after your posting here.
--
Cheers,
Gary
http://www.garyshort.org
|
|
|
|
|
The suggestion was to replace the use of an ArrayList with an Array to avoid boxing/unboxig. Using List<int> instead of an Array of ints would give the same benefit without loosing the functionality of a collection.
The only reason I can see for suggesting an Array without even mentioning the List<T> collection is being unaware of the List<T> class - which (if you read through the forums and variuos internet postings) unfortunately is quite common. So I was a bit confused: How can someone understand enough about .NET to know about boxing/unboxing but not know about List<T>. The only logical explanation I can see is someone not aware of the .NET 2.0 features... but then .NET 2.0 isn't exactly new?
But never mind, I probably jumped to conclusion about the missing awareness of the generic classes - I simply went with the odds
|
|
|
|
|
Ah I'm with you now. No, it's okay I know about .Net 2.0 and generics. I mentioned int[] because the OP didn't mention what version of .Net he was using so I went with the universal solution.
--
Cheers,
Gary
http://www.garyshort.org
|
|
|
|
|
I always go for the newest solution. I consider it doing people a favor when I point out that they are wasting their own time on obsolete frameworks... Hmm... speaking of which... retreiving the items sorted using Linq is probably the best solution.
After all, we can as well be fancy instead of simply calling the Sort method available no matter if the integers are stored in an Array, ArrayList, or List<T>.
|
|
|
|
|
I agree, newest and shiny is always best You'd need linq to entity for this solution though and I'm not sure how performant that is at the moment.
--
Cheers,
Gary
http://www.garyshort.org
|
|
|
|
|
Linq for Entities provide uptimized queries when used with the Entity Framework, but it's not needed to query a collection.
From MSDN[^]:
.NET Language-Integrated Query defines a set of general purpose standard query operators that allow traversal, filter, and projection operations to be expressed in a direct yet declarative way in any .NET-based programming language. The standard query operators allow queries to be applied to any IEnumerable<t>-based information source.
With regards to performance I am quite sure it will be fast enough to handle the size of most collections encountered by someone who are at the level where they have to ask for help getting the item sorted in the first place.
|
|
|
|
|
After you set doublebuffer = true how do you swap buffers? Thanks in advance.
The most knowledge doesn't mean the most wise...
|
|
|
|
|
Hi,
GUI parts implement double buffering by:
- allocating a memory buffer
- drawing (both background and foreground) into that buffer
- then blitting everything to the screen
The painting code remains exactly the same, the Graphics class and the underlying stuff
takes care of it all.
As a result the paint operation seems much faster, in particular there is no
time gap between a paint background then paint foreground any more.
The programmer is not involved in this, he does not manipulate the buffer.
(it is not a ping-pong buffering system, where one buffer is painted in while the
other would be shown, and both would get swapped at the programmer's discretion).
Luc Pattyn [Forum Guidelines] [My Articles]
this months tips:
- use PRE tags to preserve formatting when showing multi-line code snippets
- before you ask a question here, search CodeProject, then Google
|
|
|
|
|
Oh, well... thanks, so you just turn it on?
The most knowledge doesn't mean the most wise...
|
|
|
|
|
yep
Luc Pattyn [Forum Guidelines] [My Articles]
this months tips:
- use PRE tags to preserve formatting when showing multi-line code snippets
- before you ask a question here, search CodeProject, then Google
|
|
|
|
|
It's cunning the way they named it DoubleBuffered and made it a boolean. Damn them for the way that they hide these things.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Friends...
I am doing my project in asp.net 1.1 and when I am adding any new page and setting that page as "Set as Start Page".every time I am getting this error " Could not load type Namespace.classname".
What is the reason behind that???
Please do suggest....
Thanks in advance....
adil kazmi
|
|
|
|