|
Have you checked your keyboard connection? Wireless? plug in a wired one to test.
- I would love to change the world, but they won’t give me the source code.
|
|
|
|
|
i checked caps lock and my keyboard is lit anyway. Besides, that wouldn't explain the web pages going unresponsive or the shell not responding to clicks.
It wasn't my (< 6 month old) keyboard.
Real programmers use butterflies
|
|
|
|
|
It works on my computer (famous last word).
CI/CD = Continuous Impediment/Continuous Despair
|
|
|
|
|
I've managed to avoid problems with VS updates - having not installed one for years.
Once upon a time it was a nice tight coding environment. And then it wasn't. And more wasn't.
So, tired of wasn't I went to isn't.
Ravings en masse^ |
---|
"The difference between genius and stupidity is that genius has its limits." - Albert Einstein | "If you are searching for perfection in others, then you seek disappointment. If you seek perfection in yourself, then you will find failure." - Balboos HaGadol Mar 2010 |
|
|
|
|
|
I just have to hit alt-ctrl-del to make the login button appear (instead of it being visible right away after restart by moving the mouse), but apart from that, it works. I have not restarted a second time though.
|
|
|
|
|
The news item posted by Kent today about a new "PriorityQueue" feature in NET 6 [^] triggered an itch i call: "i-could-make-one-of-those."
Since I had never experimented with SortedSet, I decided to use that and see where it took me. And, it took me to an interesting place as i wrestled with how to define a generic wrapper structure ... SortedSet<T> requires a Type with an IComparer implementation.
After muddling around for an hour or so (several mental buffers needed refreshing), i had a working example that i then tested.
And, then i got snagged as i changed a value in a SortedSet element ... a DateTime Property ... and it appeared the Set did not sort as expected.
With growing frustration, I tried different values, and re-tested.
i began to get angry as my cherished image of myself as an expert debugger began to resemble the aging wreck i see in any mirror i am unlucky enough to look into by accident
Finally, it dawned on me: i expected the wrong result ! Yes, the beast was doing what i told it to do.
i think we need a new word for this special kind of bruised-ego chagrin mixed with plummeting self-esteem ... i'll try to think of one, later ... first, I need to go outside and scream some more.
p.s. code on request
«One day it will have to be officially admitted that what we have christened reality is an even greater illusion than the world of dreams.» Salvador Dali
|
|
|
|
|
|
I heard a song when I read this response: [^]
fwiw: the "seems ugly" part of working with .NET sorted collections is having to remove, then re-insert a changed value, to force an update.
«One day it will have to be officially admitted that what we have christened reality is an even greater illusion than the world of dreams.» Salvador Dali
|
|
|
|
|
When dealing with a straight collection class yes, but most dictionaries and lists have indexer properties that allow you to update a value.
I wasn't trying to show anyone up but I guess I see how it could come across that way. I posted it before coffee imbued me with appropriate tact.
Real programmers use butterflies
|
|
|
|
|
When you want a collection to auto re-sort based on changes to one or more properties of items in the collection ... I have yet to explore the idea INotifyPropertyChanged might be used. Be interested to hear your ideas. I need to go back and explore the various Sorted structures available.
"show anyone up" ? not to worry ... just my own wicked sense of humor
91F feels like 114F, humidity 57%, here, at 10AM ... brain-fog thickening ...
«One day it will have to be officially admitted that what we have christened reality is an even greater illusion than the world of dreams.» Salvador Dali
|
|
|
|
|
Sorted collections are supposed to enforce sorted order *always*
So I'm not sure what you're trying to accomplish.
If you want a container that's not sorted until you sort it you should consider using an unsorted list and then running sort on it.
Otherwise I don't understand why you'd need it to resort on property changed, unless wait .. are you trying to change the sorting rules?
Depending on the context, you might consider IBindingListView if you want it to be bindable. If you're thinking INotifyPropertyChanged, you're probably better off implementing the above ,or maybe just using BindingList<t> - i think that handles sorts with rules.
Real programmers use butterflies
|
|
|
|
|
honey the codewitch wrote: Sorted collections are supposed to enforce sorted order *always* Unfortunately .. not ... for Sorted-xxx reference Types where the re-sort "trigger" you want is a change to a Property
Here's what I have to do to force an update:
public void ChangeValue(Project ptochange, DateTime newdate)
{
Projects.Value.Remove(ptochange);
ptochange.DeadLine = newdate;
Projects.Value.Add(ptochange);
} And the Project Class:
public class Project : IComparable
{
public Project(string name, DateTime deadLine)
{
Name = name;
DeadLine = deadLine;
}
public string Name { set; get; }
public DateTime DeadLine { set; get; }
public int CompareTo(object y)
{
if (ReferenceEquals(this, y)) return 0;
if (ReferenceEquals(null, y)) return 1;
return this.DeadLine.CompareTo(((Project)y).DeadLine);
}
} I'll post an example on the C# forum, and, I hope you'll respond there.
«One day it will have to be officially admitted that what we have christened reality is an even greater illusion than the world of dreams.» Salvador Dali
|
|
|
|
|
I don't know what you're deriving from. SortedXXXXX collections sort on add.
I'm at a loss. I've never heard of a SortedXXXX flavor that doesn't sort on add or edit in .NET
I'd like to know what class it is, just for starters.
Edit: Link me when you post on the other forum. I haven't seen it yet
Real programmers use butterflies
|
|
|
|
|
honey the codewitch wrote: SortedXXXX flavor that doesn't sort on add or edit in .NET Aye, there lies the rub.
Projects.Value is a SortedSet<Project>
Removing and re-inserting to force an update is ... gnarly.
«One day it will have to be officially admitted that what we have christened reality is an even greater illusion than the world of dreams.» Salvador Dali
|
|
|
|
|
Ah, I see what you're saying.
It's not really gnarly. Consider that when you need to edit a value you will have to resort the set anyway no matter how you slice it. And when you remove and readd there will never be a new allocation because you just had a free slot, so it's almost instant aside from the sort which had to happen anyway.
If your actual problem with it is it *looks* ugly, write an extension method I guess but it will just turn two lines of code into one.
Real programmers use butterflies
|
|
|
|
|
honey the codewitch wrote: when you remove and readd there will never be a new allocation because you just had a free slot ... unless the collection auto-sizes on remove ?
«One day it will have to be officially admitted that what we have christened reality is an even greater illusion than the world of dreams.» Salvador Dali
|
|
|
|
|
They do not do that. They only ever increase in capacity - unless they have a Trim() method or allow you to set the Capacity property but the collections since 2.0 typically don't
Real programmers use butterflies
|
|
|
|
|
thanks ! I may have been thinking of SortedSet:
Starting with .NET Framework 4, the SortedSet<T> class provides a self-balancing tree that maintains data in sorted order after insertions, deletions, and searches. This class and the HashSet<T> class implement the ISet<T> interface. or, I may have made an unwarranted generalization from the auto-sizing facility of List<T>
«One day it will have to be officially admitted that what we have christened reality is an even greater illusion than the world of dreams.» Salvador Dali
|
|
|
|
|
List<t> doesn't shrink it's capacity. It grows and grows and grows and grows.
But I was wrong about SortedSet<T> after looking at SortedSet.cs in the reference implementation. Sorry.
I could have sworn they implemented it like Dictionary<TKey,TValue> .
In the dictionary they use a hashtable, but the hash just holds indexes into an internal array that grows when you add items.
In sorted set it's just a straight binary tree. unoptimized. So you were right about it shrinking on remove.
I should have looked it up before I said something. Mea culpa.
I don't trust any SortedXXXXX implementation under the ComponentModel now after seeing that.
Unfortunately the way to do it would be to reimplemented sorted set properly so instead of say
class Node {
public Node Left;
public Node Right;
}
It should be
struct Node {
public int LeftIndex;
public int RightIndex;
}
with
Node[] m_nodeList;
as an internal member, and that should grow.
That's how dictionary for example does things except it uses a hash instead of a tree.
ETA: The other option is to just use a sorted array. I'd consider that route.
Real programmers use butterflies
|
|
|
|
|
thanks for that very informative reply ! re: List<T> ... i am wrong ... what was i thinking ?honey the codewitch wrote: I don't trust any SortedXXXXX implementation under the ComponentModel now after seeing that. While there is sort-related "stuff" in that NameSpace, there are no sorted-xxx data structures; however, that is where INotify-xxx lives.
Now convinced my brain needs either a lobotomy or a systematic review of sorting, and PropChange-xxx ... I remain ... curious
Take a look at what Marc Gravell of SO uses for prop change: [^]
«One day it will have to be officially admitted that what we have christened reality is an even greater illusion than the world of dreams.» Salvador Dali
|
|
|
|
|
BillWoodruff wrote: i began to get angry as my cherished image of myself as an expert debugger
"Rebuggering" ???
|
|
|
|
|
"Woodruffing" has a nice ring to it.
Ravings en masse^ |
---|
"The difference between genius and stupidity is that genius has its limits." - Albert Einstein | "If you are searching for perfection in others, then you seek disappointment. If you seek perfection in yourself, then you will find failure." - Balboos HaGadol Mar 2010 |
|
|
|
|
|
BillWoodruff wrote: the beast was doing what i told it to do
This is why I love programming.
cheers
Chris Maunder
|
|
|
|
|
i sometimes think part of the seductiveness of programming is the sense one's efforts occur in a kind of virtual reality sandbox... where the equivalent of real-world train-wrecks, earthquakes, tsunamis, etc., don't put you in a real morgue, or hospital.
however, i've never had code i wrote bring a satellite down, crash a server, or, cause a company to lose a zillion dollars.
«One day it will have to be officially admitted that what we have christened reality is an even greater illusion than the world of dreams.» Salvador Dali
|
|
|
|
|
BillWoodruff wrote: i think we need a new word for this special kind of bruised-ego chagrin mixed with plummeting self-esteem
In the best tradition of turning adjectives into nouns and then into verbs, I suggest "to bad"
("bad" ==> "my bad" ==> "to bad")
Freedom is the freedom to say that two plus two make four. If that is granted, all else follows.
-- 6079 Smith W.
|
|
|
|