as we all know it’s 12.
Yesterday my 5 year old daughter was in the car with my wife and call’s out to Heather (my wife) and says “Mom, 6 plus 6 is 12!” Heather says “yep you are right how did you know that?” Daughter: “I thought it in my head.” Then she goes on to say, “Can you turn the radio off?” Heather complies and there is silence for a few minutes… “Mom, 12 plus 12 is 24!”
So we haven’t spent a lot of time with our oldest daughter on math… nor did they do it in pre school… Having scored high on the SATs and GREs in Math and logic… I wonder if she is picking up some math stuff on her own. (We have talked about what addition and subtraction are but a long time ago). It’s really cool to see how she is growing mentally. She also understands what patterns are and doesn’t have a wrote response when you ask her.
I remember asking her what a pattern was and she looked around and said “It’s like when you have a piece of broccoli next to a piece of chicken, next to a piece of broccoli, next to a piece of chicken …. ” (she happened to be eating chicken and broccoli at the time. Another time she said “We are sitting in a pattern of adult, child, adult child!”
Pretty cool stuff!
I wish I was a better teacher, but I am totally loving this stage of her life!
Last nite I’m sitting in the family room and from the top of the stairs I hear:
“Daaad, Daaaaaaaaaaaad, DAAAAAAAAAAAAAAAAAAAAAAAADDDDDDDDDDDYYYYYYYYY!”
So I go to the bottom of the stairs, it’s my 3 year old and she says “Well, my blanket fell off can you put it back on?”
So I trundle up the stairs and say to her “I’ll help you but it’s late and you now have to stay in bed for daddy ok?”… “ok”.
Into bed she goes blanket on, quick goodnite kiss, I start walking away… “Daddy?”, “Yes?”… “Can I have a hug”
“Ok honey”. Hug ensues my 3 year old says: “I love you” and gives me a hug and a kiss.
DAMN Kids can just melt your heart
So the whole gay marriage ballot initiative is bothering me. In my mind ballot questions only serve to get our representatives out of having to make a decision that they think would have negative political ramifications on their candidacy. Look at the income tax ballot questions too… legislature ignores those in order to balance the budget (or at least attempt to
).
So I think I’ve determined that both my representatives want the ballot question. (they are opposed to gay marriage and want to put the question on the ballot so that they don’t have to “take” responsibilty if a ban passes… knowing that a ban is immoral and discriminatory.)
I wonder if sending them a letter will do anything? I tend to doubt it… what do you all think?
So I’m working with Databases a lot right now and one thing I am running into again and again is the ol’ enum to DB mapping issue.
If I have in my code an enumeration such as userStatus with values : Active, Deactivated, and Reactivated and I have a user table in my database with a userStatus column. I am constantly asking myself… What’s the best way to implement this?
The simplest approach is to declare userStatus Column as an int in the DB and have the enum declare the int equivalent of the enum values. So the enum would look like:
public enum UserStatus
{
Deactivated = 0,
Active = 1,
Reactivated = 2
}
and in all my Database commands (stored procedures) do comparisons against the integer values. ie:
Select * from [user] where [userStatus]=1
to get all active users.
As you could imagine this approach is somewhat dangerous. Anyone looking at the Sprocs would need to “know” what the values 0,1,2 mean. What if someone corrupted the database with a different value on an insert or update? Since my system is somewhat contained (we control the DB and the code that accesses the DB) I’ve chosen this approach. But like any good developer, I reserve the right to change my mind.
Another approach would be to have the userStatus column in the database be a string. So the userStatus column in the DB and all the sprocs would be “human” readable. .Net gives us a handing enum.Parse() method that let’s me parse a string into an enum. (and I go the other way with toString()). I’m starting to think this may be better than the approach I’ve taken… However there is performance to consider. I think that compares with integers is generally faster than strings. Since I’m building a scalable system I have to consider that. Also we have to be concerned with possible data corruption.
select * from user where userStatus='Active'
Yet another approach would be to have an “enum” table in the database for the enum. it’d have an integer identity (1, 2, 3) column AND a text column “Active, Deactivated, Reactivated”. The User table would have a foreign key constraint to the enum table. So the user table would still have 1, 2 or 3. but the key would constrain the user to adding only a value that is in the enum table (you couldn’t put 2). You also could quickly lookup the enum values in the enum table if you were reading the data in the database. If you have lot’s of different enums however you could end up with lots of enum tables. And the sprocs still reference integers. and you’d need to know what enum was being referred to.
The easy answer is that your choice probably depends on your situation… But What approach do you favor?
So I was just reading on Boston.com that the NFL fined Brian Urlacher for wearing a hat (vitawater or something like that) with a logo on it at an NFL event. This company is not an official sponsor of the NFL. So apparently this is against NFL rules and such… I guess I don’t have too much of a problem with having rules… But Mr. Urlacher was fined $100K. HOLY CRAP! Does this say something about our society?
Yeesh!