Thursday, December 24, 2009

We're getting ready for Little M's second Christmas

but it's the first one where he'll actually know what's going on. He was only two months old last christmas, so he wasn't really aware that anything different was going on. So I'm excited for him!

He's walking, and talking, well, burbling, and we play along. He's such a social baby, I can't wait for him to get to play with the new cousins. His cousin coming from Aunt K is due in Feb. And the cousins from Aunt S are just a could of months younger than him, so they should be fun to see together this weekend.

If the weather doesn't thwart all our plans. I'm annoyed that we don't even know what we'll be doing when tomorrow until we wake up and see how back things are outside.

Oh, well, wish us luck, it's the last celebration At Gigi and Papa's where Little M is the baby. Next year Sushi will be the baby! And Merry Christmas to you and yours wherever you all are!

Friday, December 4, 2009

I know it's been while...

and I do apologize, but we've had a lot going on!

First of all, Little M is a walking man! The day after he turned 13 months he took his first step. That was two weeks ago. He's gotten up to about 9 steps in a row, and he does try a little each day, but he's doing a lot more "walking" on his knees so he can still hold things in both hands, but get there without having to stand up. Kinda cheating, but creative!

He's eating grown-up foods, but mostly meats. He is not so crazy about the grown up veggies. So we'll try to expose him to more and see if he'll start to get interested. He is definitely interested in WHATEVER I have if I'm eating with him at mealtime, so it looks like my days of fast food and pizza are over. Which is better for both of us anyway. And my waistline is already showing the lack of crap in my diet, I'm down about 5 pounds so far (probably more, but I'm trying to NOT get on the scale every day, it easily become an obsession.

Also, I got a job! Well, I got an offer for a job to start in February. But it's on the project I've been interested in for awhile, they have a great location, good benefits, fabulous policy on work schedule, and are very family-friendly. Not to mention that if we need Shady Grove Fertility again I can look out the building and see them from where I'll be working. Just three contingencies with this job. The position has to open (the person who is leaving has to actually leave), the client has to approve me, and another one that I can't say anything about. I could tell you, but then I'd have to kill you. Just kidding! Ah, IT humor.

I actually had a great time at the interview for this position, some of it was intimidating because I feel like it's been sooooo long since my mind was in work mode. But one of the technical guys gave me a problem to work out and I did so, but it was weird working it out in front of people. The process was ugly, but I came up with a partial answer on the spot. Of course on the ride home I had a better idea, so here's what it was:

The problem: Say you're running a swim club and you have to assign people to a section of your swim class. You have some number of students that you have to distribute evenly over however many classes are available. The number of students are passed into your method, as is an array with the section numbers of the available classes.

Here's what I came up with on the ride home. For those not familiar with Java and wanting to know what the heck this says, well, you're just out of luck. Sorry, but I can't imagine anyone who isn't a Java Programmer would care. But see below and I'll explain what happens when the code is run. And if you are a Java Programmer, I don't want to hear how stupid my solution is and how I could have done it better, faster, with less code, whatever. No critiques accepted. Just stop reading now.

(I put it great spacing to make everything readable, but this stupid editor takes it ALL out. Whatever.)

1 public void assignSections (int numStudents, ArrayList[String] sections){
2
3 int numClasses = sections.size();
4 while (numStudents!= 0){
5 for (int i = 0; i < numClasses; i++;){
6 String section = sections.get(i);
7 Student student = getStudent(numStudents);
8 addStudentToSection(student,section);
9 numStudents--;
10 }
11 }
12}

WHAT HAPPENS:
So say I pass in that there are 13 students and 3 sections:123A, 124B, and 125C, so the call would look like this: assignSections(13,sections[123A, 124B, 125C]; . My numClasses would be 3 (Line3), and I'll hit the while loop (Line4) because my numStudentsis 13. I hit the for loop which creates an int i which is 0, and Line6 creates a string with "123A". Line6 creates a Student object by retrieving the student by number (13). So line8's variables, student and section would be (Student13,"123A"). And that student has been assigned. We subtract one from numStudents and now we have 12.
Back through the for loop and i is now 1, so it's still less than 3. section is 124B, student is Student12, that student is assigned on line8, and numStudents is now 11.
Back through the for loop and i is now 2, so it's still less than 3. section = 125C, student is now Student11, that student is assigned, and numStudents is 10.
Back through the for loop, but i is now 3, so we kick back out to the while loop, and since numStudents is 10 we start the for loop over again, which means we get the following pairings, Student10 in section 123A (because the list of sections starts over again)

So running this from the beginning goes through the following sequence of variables:
(AGAIN with the spacing CRAPOLA!)
numStudents numClasses i section student numStudents
-----------------------------------------------------
13 3 0 123A Student13 12
12 3 1 124B Student12 11
11 3 2 125C Student11 10
10 3 0 123A Student10 9
9 3 1 124B Student9 8
8 3 2 125C Student8 7
7 3 0 123A Student7 6
6 3 1 124B Student6 5
5 3 2 125C Student5 4
4 3 0 123A Student4 3
3 3 1 124B Student3 2
2 3 2 125C Student2 1
1 3 0 123A Student1 0

We're out of students and now we have 5 students assigned to section 123A, 4 to 124B, and 4 to 125C, which is what the question asked. Aren't you glad you read this far? Isn't your life better for trudging through some geek logic??? Does it look like I'm actually excited to go back to work?

If you've read this far, I PROMISE to NEVER do this again to you. But thanks for actually reading this far anyway!