The fun part about the Internet is that you can find solutions to things when you are not looking for them. I had a bad time formatting the code solution to a puzzle I was given a month ago. I stole some CSS from Phil Haack as I was looking at his code for a class factory from a description in an app.config file. The solution is at the bottom so you don’t have to scroll past it to read the rest of the entry. Config files have been a big source of frustration this last week or so. I have been working with log4net and NHibernate. I can get log4net working with a default configuration, but if I add setting to the config file, I don’t get anything. Same with NHibernate. I am feeling rather stupid at this point.
This last Sunday morning I woke up with a bad stomachache. Most of the day and Monday I spent running to the bathroom every hour or so. I was also running a fever. It’s passed now, much to my relief. Since I didn’t eat anything those days, you would think I might lose a little weight, but no such luck. It’s been sneaking up slowly but surely.
Patrick’s indoor soccer team has been doing well. They lost their game on Monday, but he played really well. I go out to dinner with my dad on Mondays, so I don’t get to see the games. I cancelled last Monday since I could not eat anyway, and took the opportunity to see a game. Patrick was on offense most of the time, and I was impressed. He can control and handle a soccer ball as good as any player on his team. Several times I saw him take the ball away from an opponent. He seems a long way from the five year old I coached.
Patrick has also taken an interest in playing catch with some baseballs we got at a game in Ohio. He is pretty good with throwing and catching, but he needs more practice with a bat. Even more interesting, the first time we played catch, it ended with my throwing one to him that bounced out of hit mitt and off his upper lip, cutting and bruising it. He wanted to go back out and do it again the next day.
On Mondays, as I said, dad and I usually go to Sizzler for dinner. It’s cheap, fast, and pretty good. He won’t go to many other places, and seems to think the only thing I want is steak. There’s a restaurant called El Matador opening up just outside of where he lives. It’s an established name, but Costco bought the land the old place was on. It looks like they got a good deal out of it, the new place is elaborate. It’s Mexican, as I keep pointing out to my dad as we pass. He has said he’ll try it. Anyway, last Monday, the server at Sizzler told us she hadn’t seen us there is a long time. We got a confused look, and told her we had been here every Monday for the last month or so. I guess it’s good that someone remembers us, but I don’t remember her, and I have seen the same faces.
Rachel was honored with a Student of the Month award. Her GPA is 3.95. She is doing very well in school this year. April and I went to Parent-Teacher conferences two weeks ago. Everyone is doing well in school. Thomas is having a little trouble paying attention and stop talking when he needs to, but Mrs. Platz says he fine otherwise. Apparently he is now comfortable with school. Patrick isn’t pulling the wool over his teacher’s eyes like I thought might. Mrs. Fenton is also the Vice Principal for the campus and I imagine she has seen his tricks before. He has also admitted he can’t see the board very well, and he has started wearing his glasses again. Rachel seems to like Mrs. Key. She not frustrated this year as she was last year. Not that Mrs. Higgs is bad, but her style of teaching did not work with Rachel.
Bob Allen’s fiftieth birthday was celebrated at the last Senior Officers Meeting for the Ticonderoga. Lori got the blame, but it was more Tonya’s idea. Next year the business meetings will move from Saturday afternoon to Wednesday night. This leaves us free to play activities for different days and times. The 3 PM time on Saturday left us with no time to do some things such as go swimming or to a museum.
Speaking of museums, Patrick went to the Hill Air Force Base Museum the Saturday before last with his Cub Scout troop. He was not too excited since he has been there before. This time the flight simulators were open, and the boys were fascinated with the F-16 cockpits attached to an F-16 Falcon software.http://beta.blogger.com/post-create.g?blogID=35868783
That’s about all I can remember for the last couple of weeks. I am sure there is much more, but this is long enough.
Music: The Pink Panther Theme by Henry Mancini
Mood: Ambidextrous (Latin for hopelessly confused)
Favorite Quote: “Agile programming does not just mean doing more work with fewer people” Scott Adams/Dilbert
using System;
namespace MissingValue
{
public class MissingValue
{
private int[] n;
private int[] a;
private int sum_n;
private int sum_a;
// No default constructor
private MissingValue()
{}
public MissingValue(int array_length)
{
// Allocate array of ints to requested length
n = new int[array_length];
// Allocate 'missing' array as one less
a = new int[array_length - 1];
// Fill array with unique values from 0
// to length of array
for (int x = 0; x < n.Length; ++x)
{
n[x] = x;
}
// Seed a random value
DateTime d1 = DateTime.Now;
Random rand = new Random(d1.Millisecond);
// Get a random value in the range from 0
// to array length
int num = rand.Next(0, a.Length);
for (int x = 0; x < a.Length; ++x)
{
if (x < num)
a[x] = x;
else
a[x] = x + 1;
}
}
public int FindMissingValue()
{
sum_n = sumArray(n);
sum_a = sumArray(a);
return sum_n - sum_a;
}
private int sumArray(int[] a)
{
int sum = 0;
foreach (int x in a)
{
sum += x;
}
return sum;
}
///
/// The main entry point for the application.
///
[STAThread]
static void Main(string[] args)
{
MissingValue mv = new MissingValue(100);
Console.WriteLine("the missing element is {0}",
mv.FindMissingValue());
}
}
}
// Output:
// the missing element is 35