|
Visuals are actual in-game footage
It's how the game looks all the time, breathtaking at moments!
|
|
|
|
|
I'm writing a function which will join two collections and two filters for each.
public class Teacher
{
public string Id{ get; set; }
public string Name{ get; set; }
public string TeacherFilter{ get; set; }
...
}
public class Student
{
public string Id{ get; set; }
public string Name{ get; set; }
public string StudentFilter{ get; set; }
public string TeacherId{ get; set; }
...
}
public class TeacherStudents
{
public string Id{ get; set; } -- from teacher
public string Name{ get; set; } -- from teacher
public IEnumerable<Student> Students{get;set;}
}
public class TeacherStudents
{
public string Id{ get; set; } -- from teacher
public string Name{ get; set; } -- from teacher
public IEnumerable<Student> Student{get;set;}
}
public class TeacherStudent
{
public string Id{ get; set; } -- from teacher
public string Name{ get; set; } -- from teacher
...
public Student Student{get;set;}
}
Get(string TeacherFilter,string StudentFilter).
Here is how i implement it
var query = teacherCollection.Aggregate().Match(x => x.TeacherFilter== TeacherFilter);
var query1 = query
.Lookup<Teacher, Student, TeacherStudent>(studentCollection, t => t.Id, s => s.TeacherId, l => l.Student)
.Unwind(x => x.Student, new AggregateUnwindOptions<TeacherStudent>())
.Match(x => x.StudentFilter== StudentFilter)
For the teacher collection, useless data has been filter out before lookup which will reduce the data size when doing the lookup(join). But for the student collection, the match stage is appended after the lookup. so does all the data from student will join with teacher behind the scenes? is it possible to filter out some student data before the lookup?
|
|
|
|
|
Step one: Refer to the red link at the top of this page.
Software rusts. Simon Stephenson, ca 1994. So does this signature. me, 2012
|
|
|
|
|
Teachers shouldn't lookup students.
You end up on all sorts of Registers if you do that, as well as being banned from teaching.
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
"Common sense is so rare these days, it should be classified as a super power" - Random T-shirt
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
So you posted this in QA[^]; reposted it in the database forum[^]; and now you've posted a third copy in the forum which explicitly forbids programming questions.
Your impatience and inability to follow the rules clearly know no bounds.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
at least for me. One of the ways I rate it is longevity which implies extendibility and flexibility.
It has been about a year since I started working on GFX, after having the idea of creating a device independent graphics library using generic programming with customizable/definable binary pixel and bitmap formats.
It has held up. I've thrown more platforms and more features at it - building it out for a year, adding true type fonts, faster alpha blending, progressive jpg loading, etc. And it integrates it all seamlessly and with reasonable if not good performance.
It's my most popular project on github, and it's probably what I'm most proud of in the moment.
You know where you can sit and reflect on something you built, and come away ... satisfied, but somehow better than just satisfied? Anyway, that feeling. That. It makes all the effort worth it, you know?
To err is human. Fortune favors the monsters.
|
|
|
|
|
|
Agreed. My current work project is replacing a Windows service in one of our products that's landed in my lap. The old code is pretty crufty, as it got its start back in 2000 and four products ago. It's had numerous hands on it since then, and my boss is willing to let me do a rewrite.
Anywho, it's been fun architecting the thing. I've got the outer layers in place, and am working toward the middle. I think the thing I'm enjoying the most is being able to make 'large' changes in how I do things without disrupting pesky details.
Software Zen: delete this;
|
|
|
|
|
Especially when you come back to it 2 years later and can dive right back in because the design is logical and the variables have names that make remembering easy!
-edit: Oh, wait! Yours is template metaprograming. Never mind!
|
|
|
|
|
old code
baked in a less elegant time
its functions rusty
its features, anachronistic
every encounter with it reminds me of my past failure of imagination.
if I could only think ahead a few more steps
i'd never have
old code
To err is human. Fortune favors the monsters.
|
|
|
|
|
|
It rhymes in binary.
To err is human. Fortune favors the monsters.
|
|
|
|
|
... aaaand I always forget to expect a hex...
|
|
|
|
|
honey the codewitch wrote: It rhymes in binary.
Sure - but its definately not kid-sister safe in octal!
If you can't laugh at yourself - ask me and I will do it for you.
|
|
|
|
|
|
just ruminating. and procrastinating a rewrite.
To err is human. Fortune favors the monsters.
|
|
|
|
|
But rewrites are fun! Until you start retesting...
|
|
|
|
|
This one is complicated by multiple screen modes, each of which must be represented by a different concrete type with not much in the way of common base class.
The screen mode function itself is a bit odd at first, being like
auto scmode = screen.mode<1,4>();
then you can draw to scmode.
I don't like it but the way my graphics library is designed, pixels of different formats are different concrete types so like
gfx::gsc_pixel<1>; gfx::gsc_pixel<8>; gfx::rgb_pixel<16>; gfx::ycbcr_pixel<24>; gfx::rgba_pixel<32>;
therefore different modes with different pixel formats must be different types.
it has a number of advantages. this is just one area where i don't care for it.
To err is human. Fortune favors the monsters.
|
|
|
|
|
1 bit, 4 bits, 1 byte, 2 bytes, 3 bytes, 4 bytes works with food (Pun intended) and bitmaps. Lots of bookkeeping, though.
Unlike old soldiers, old code may never die and it may never fade away.
|
|
|
|
|
Code matures slowly
Function forgotten, it dies
I wrote it to last
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
"Common sense is so rare these days, it should be classified as a super power" - Random T-shirt
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
"
Ancient computers ranged in the long caves deep in the bowels of the planet tick away the dark millennia, and the ages hang heavy on their dusty databanks.
They take the occasional potshot to relieve the monotony.
" -- Slartibartfast
|
|
|
|
|
The wheel of time always keep turning, there will always be old code!
|
|
|
|
|
code is like cars, as soon as you drive it off the lot, its old.
|
|
|
|
|
Code is like life that way.
The second a routine is born,
the fates have cut its skein to an exact length that you may never know even though it is YOU that weaves it into that tapestry known as a program.
|
|
|
|
|
"The ancient machine was but a pale shadow of its original glory. It had performed its duty, destroying the fifth planet in this system. Like all of its kind, it had not expected to survive what should have been its penultimate moment. An collection of debris accidently shielded it from dissolution, eventually casting it into orbit around the next planet inward.
At some point in its long, long journey its intelligence was restored by the repair automata sufficiently that the mission became its primary concern yet again. Many systems no longer existed, or could not be repaired. Still, the mission must be performed.
It searched, deep in the few uncorrupted records it still contained. There must be a method for completing the mission. In recent orbits small bits of metal debris had been expelled by the third planet. Some of the bits had even landed on the planet below, emitting weak electromagnetic signals. The ancient records were emphatic that this was one of the few warnings it would receive.
The machine continued to watch, and wait."
Software Zen: delete this;
|
|
|
|