|
Batman Begins is the saga where Christian Bale plays batman. This saga is the one I like most because it shows a little more "real" possibilities (of course they still are films).
The fist "Batman begins" is IMHO good, but the second one is damm good. Heath Ledger as the Joker rocks.
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
Rating helpful answers is nice, but saying thanks can be even nicer.
|
|
|
|
|
Is that how they justify their votes?
Technician
1. A person that fixes stuff you can't.
2. One who does precision guesswork based on unreliable data provided by those of questionable knowledge.
JaxCoder.com
|
|
|
|
|
The AVL tree gave me a lot more trouble than it should have. That's what i get for porting some C++ code from a (probably) student's github - i can't even find his name or a license , but i had to learn the algorithm somehow and where a book is nice, code speaks volumes.
The performance results surprised me at first, but as I ran more tests I began to understand what was going on - shocking!
The splay tree is cool, but i need to eliminate some of the recursion in it so it can hold more than say 5-10 thousand items.
The b-tree performed far better than i expected at 1,000,000 entries +, even beating Dictionary (which doesn't have to sort - cheater!), but what really got me was it was beating SortedDictionary by about 100 entries or so. I figured I'd need thousands before it overtook it, so bonus.
My conclusion is as surprising to me - the BTree dictionary is a better all around dictionary for sorted search scenarios with 100 items or greater than any of the others.
I haven't actually seen the splay tree in best case scenario yet, but even from the middling to worst case tests i gave it, it really sped up like it should with locality of searches.
I'm a nerd so i think this stuff is neat! i love learning something while coding.
When I was growin' up, I was the smartest kid I knew. Maybe that was just because I didn't know that many kids. All I know is now I feel the opposite.
modified 13-Sep-19 8:45am.
|
|
|
|
|
B-tree work by divide and conquer, just like quick sort and merge sort.
So I'm not surprised at all, except for the part of even beating dictionaries.
I have to take a look at how the buckets are created (the number of buckets and their distribution). I believe therein lies the answer.
|
|
|
|
|
well in my tests i used positive ints for the keys, which based on the reference implementation gives a perfect spread for its hashcodes - 1 item per bucket so no extra equality checks. I gave it best case. Because the sorting ones were only comparing on ints i figured the dictionary should get the same advantage.
technically all of these sorting algorithms (not including Dictionary because it doesn't sort) work on divide and conquer, because of the tree structures, but yeah - the way the b-tree squashes the trees into multi-level indexes really helps here.
When I was growin' up, I was the smartest kid I knew. Maybe that was just because I didn't know that many kids. All I know is now I feel the opposite.
|
|
|
|
|
honey the codewitch wrote: well in my tests i used positive ints for the keys, which based on the reference implementation gives a perfect spread for its hashcodes
Perhaps not.
The code at referencesource.microsoft.com[^] for Int32 hashcode looks like this:
public override int GetHashCode() {
return m_value;
}
So if you don't use random ints there won't be a random spread
|
|
|
|
|
Since i was searching the same numbers I was adding I wasn't looking for a random spread. I gave it an even spread that was best case.
Or at least, that's my understanding. If i was doing random searches i'd give it a random spread.
There are zero hash collisions either so randomization isn't as important.
When I was growin' up, I was the smartest kid I knew. Maybe that was just because I didn't know that many kids. All I know is now I feel the opposite.
|
|
|
|
|
|
and because i haven't slept i forgot that i added the test to do random numbers as well.
When I was growin' up, I was the smartest kid I knew. Maybe that was just because I didn't know that many kids. All I know is now I feel the opposite.
|
|
|
|
|
And I'm back to looking at the dictionary implementation.
|
|
|
|
|
how it looks to me, and I've looked, because i was thinking of making my own - the stock one can't hold nulls as keys! - is like this:
It gets a hashcode, uses the hashcode to search its buckets, uses the bucket, and then does a comparison on equality for every item in the bucket.
so what you want to avoid is more than one item in one bucket, which happens when hashes collide.
or at least that's what the code looks like to me.
When I was growin' up, I was the smartest kid I knew. Maybe that was just because I didn't know that many kids. All I know is now I feel the opposite.
|
|
|
|
|
Yes, but since your test has an even spread that should not be the case.
Did you notice any difference between even spread and random spread?
|
|
|
|
|
that's only for the sequential tests. Since the keys are random in the random test, the spread is random.
When I was growin' up, I was the smartest kid I knew. Maybe that was just because I didn't know that many kids. All I know is now I feel the opposite.
|
|
|
|
|
Now you feel the power of the Dark Side. Many never even took a look at it. Not because they are so good and noble, but because they are lazy and happily believe in the myth that the classes in this or that framework are the last word in each and every case.
I have lived with several Zen masters - all of them were cats.
His last invention was an evil Lasagna. It didn't kill anyone, and it actually tasted pretty good.
|
|
|
|
|
well, in fairness it's not often people have to search and sort 100000 items without using a database
The b-tree is a bit heavy handed, but it works pretty well even with 100 items so it was worth having.
When I was growin' up, I was the smartest kid I knew. Maybe that was just because I didn't know that many kids. All I know is now I feel the opposite.
|
|
|
|
|
honey the codewitch wrote: well, in fairness it's not often people have to search and sort 100000 items without using a database Really. My first love was computer graphics and there you have to solve such problems all the time without resorting to a slowpoky database. On top of that, the problem can quickly be three or four dimensional. How else would you like to do something like this[^] in real time. Just think about how to handle the different levels of detail when zooming in or out. And forget about fancy graphics processors. The whole octree stuff is about figuring out what to feed to the graphics processor in the first place. No more and no less.
I have lived with several Zen masters - all of them were cats.
His last invention was an evil Lasagna. It didn't kill anyone, and it actually tasted pretty good.
|
|
|
|
|
I hear you, but graphics programming is kind of specialized and i wouldn't be doing near RT stuff in C# anyway.
I've tried playing a midi file without using MCI and just reading the MIDI data in C# and then sending the individual notes.
Even with the super hi res timer (native, better than stopwatch, and new with win7+ i think) it still skipped.
I'd never want to try anything like what you're talking about.
At most, I've written an NES emulator in C#. These days you could probably do SNES or certain MAME games. but that isn't about moving polys.
When I was growin' up, I was the smartest kid I knew. Maybe that was just because I didn't know that many kids. All I know is now I feel the opposite.
|
|
|
|
|
So you still underestimate the power of the Dark Side.
Look what I made.[^]. All home made except the .Net framework itself, including the server components, the UI and the graphics engine.
I have lived with several Zen masters - all of them were cats.
His last invention was an evil Lasagna. It didn't kill anyone, and it actually tasted pretty good.
|
|
|
|
|
maybe i do, but that doesn't look like a lot of polygons, or hit testing. just sayin. C# is great for a lot of things, but GC systems just aren't real time enough.
When I was growin' up, I was the smartest kid I knew. Maybe that was just because I didn't know that many kids. All I know is now I feel the opposite.
|
|
|
|
|
wonderful.
|
|
|
|
|
I think you are giving a fresh rounds of life-pulses to the Lounge. I've always loved to see casual technical discussions here.
It works like this in Lounge: All the great grand tech dinosaurs roam around here eating leaves (Discussing non-technical, trivial topics) pretending to be less muscular ones.
But the moment you tie a meaty goat(a worthy technical topic) and attract them into the treat, you could see all snarling up and showing fangs and morphing into huge godzillas and T-rex'. hehe
Then I would simply pick up my popcorn and watch all the muscle power show-offs. That's where a lot of learning really happens. At times I feel it's more educative than a well planned, scripted ARTICLE.
|
|
|
|
|
Thanks!
It's good to hear. Some of my discussions have gotten reported (not that they ended up being flagged) because they're "too technical for the lounge" so I'm glad to hear someone who appreciates my posts say so.
I spend a lot of my time thinking about how to solve problems of a technical nature, hence technical problems and solutions are a part of my life, ergo appropriate for the lounge, IMO.
I try to keep the actual articles to the articles, and this more casual, but the line is sometimes fuzzy.
When I was growin' up, I was the smartest kid I knew. Maybe that was just because I didn't know that many kids. All I know is now I feel the opposite.
|
|
|
|
|
Thanks! Please keep up the great work.
The unspoken truth about CP forums. We do have several forums for technical discussions. But the number people lurking around the lounge is far greater than in other forums.
So it's natural to see more replies/conversations here than in other forums.
While a serious technical question might break the rules of the lounge, A discussion on what we have done, some findings and looking for feedback for the same, I feel it's completely legit for the Lounge.
We should have a variety of discussions happening here. The mix is what makes it more lively.
Please keep sharing your technical findings. You could expect more dinos to come out from the cave and roar. Will be looking for it.
|
|
|
|
|
Interesting, I was under the impression that without recursion you can't really work with trees.
modified 20-Oct-19 21:02pm.
|
|
|
|
|
you just need a stack
When I was growin' up, I was the smartest kid I knew. Maybe that was just because I didn't know that many kids. All I know is now I feel the opposite.
|
|
|
|