Friday, October 24, 2008

It's a girl!


Samantha Jane was born Oct 24 at 3:27 PM, 6lbs. 6oz., 19" long. Everyone is healthy and doing well.

More photos.

Monday, October 13, 2008

Command history in Windows



I was brushing some dust off my keyboard and accidentally hit F7 while in a Windows command prompt window. That brings up list of your command history. Cool. You learn something new every day.

Automatic Timestamping for Entity Framework

I was looking for a way to get ADO.NET Entity Framework to do magic timestamping à la Ruby on Rails ActiveRecord. I couldn't find any built in mechanism to accomplish this. Here's what I came up with:


public partial class MyEntityContext
{
partial void OnContextCreated()
{
SavingChanges += OnSavingChanges;
}

private void OnSavingChanges(object sender, EventArgs e)
{
var now = DateTime.Now;
foreach (var entry in ObjectStateManager.GetObjectStateEntries(EntityState.Added | EntityState.Modified))
{
if (!entry.IsRelationship)
{
var timestampedEntity = entry.Entity as ITimestampedEntity;
if (timestampedEntity != null)
{
timestampedEntity.DateModified = now;
var entity = entry.Entity as EntityObject;
if (entity != null && entity.EntityState == EntityState.Added)
{
timestampedEntity.DateCreated = now;
}
}
}
}
}
}

internal interface ITimestampedEntity
{
DateTime DateCreated { get; set; }
DateTime DateModified { get; set; }
}


Now for every entity that implements the ITimestampedEntity interface, the DateCreated and DateModified fields will automagically be set/updated.

The above code is covered under the Logos Code Blog License.

Saturday, September 20, 2008

Apparently I Look Like A Stoner

Yesterday I was walking out of the office after work. There were these three kids about seventeen years old walking down the sidewalk. They stared at me for about five seconds, sizing me up. Then one asked, "Hey, do you know where we can get some chronic?" I guess I look like a guy who would know where to score some drugs. It must be the 'fro.

Posted with LifeCast

Monday, September 15, 2008

RefTagger Bookmarklet

Here's a test of a RefTagger bookmarklet. Drag this link to your bookmark bar: Run RefTagger.

Browse to any page with a Bible reference, e.g. Grace Baptist Fellowship, and click the Run RefTagger bookmark. RefTagger will run on the page you are on and highlight the Bible references.

Monday, August 18, 2008

Prov-a-Day 2.0

Back when I was in junior high, my dad got something called Visual Basic at work, which made it very easy to write Windows programs. I started playing around with it quite a bit. When Visual Basic 3.0 came out, it added an embedded database, so I started playing with that. One of the first programs I wrote with VB3 was Prov-a-Day, which just displayed a random verse that I had typed in from the book of Proverbs. That was 1993. I am please to announce, 15 years later, Prov-a-Day 2.0. This time around, it's a widget that you can put on your blog or other web page and it pulls random verses from Proverbs from Bible.Logos.com, the project I've been working on at work.

BTW, I love my new job.

Thursday, July 3, 2008

Big Changes

So a lot of stuff has happened in the last few days. This weekend Davey started walking. He had been able to take a few steps before, but now he's making fully controlled two-footed journeys across the room. A day or two after he started walking, he started crawling in the normal style instead of what I can best describe as the breast-stroke across the floor.

On Monday I interviewed with Logos Research Systems, which is the number one Bible software company out there. I got an offer that night and immediately accepted. I'm excited to start work in two weeks. During my interview, I asked Bob, the company owner and president, about his vision for the company. To summarize, he wants the Bible and supporting texts to be ubiquitous so that nobody has an excuse for not knowing the truth. That's a vision I can get behind and be excited about. I'll be working on the content delivery team, which will be working on bringing data to the Internet.

Also on Monday, Tamara had an ultrasound. We're having a girl. It's a bit scary for me; I'm not sure why, but I'm afraid of little girls. Tam and I and most everyone else who weighed in thought we were going to have another little boy. I was excited to have a couple little guys growing up together, but this will be fun too, I'm sure.

Tamara wants to buy a different house too, but I don't think with a new kid and a job change, a new house is a bit much. The extra space, both inside and outside, would be nice, but I'm content where we are. Tam is too, but we can't entertain a very large group in our current house. Oh well, maybe next year.