Tuesday, April 23, 2013

Trying a new diet

Smoothie

  On Saturday April 20, 2013, I made a life change. I have been following a couple of people on youtube and seeing receipts on pinterest. Every person I have seen said they are replacing two of their meals with a smoothie and they are losing over 10lbs a month. So I am going to give it a modified try. I know I can’t do two meals a day, so I am going to start with a single meal. I have been doing pretty well for the past four days. I will replace either my breakfast or my lunch and eating two normal meals. I am trying to stay away from vending machines and drinking a lot more water. So far I have lost 2lbs, so I think I will continue and once I get used to the one meal I might go to two meals. This smoothie was made with:

  • 1/2 cup Skim Milk
  • 3/4 Greek Yogurt non-fat plain
  • 2.5oz spinach
  • 1 medium banana
  • 1 medium apple
  • 1 cup blackberries

It turned out pretty good….I believe I am going to give this a month and see what happens.

Sunday, February 24, 2013

SYSTEM_SERVICE_EXCEPTION Windows 8 problem

So, I upgraded the wife’s laptop to Windows 8 about 6 months ago and about a month ago she started complaining that the OS continued to shut down on her. Every time I got up to see what the problem was she had already rebooted the machine, until today. I was able to see what message was being returned from the “Blue Screen of Death” and she was getting the system_service_exception. So naturally I went out and researched the problem and guess what, MANY people are experiencing this problem. I read a few recommendations, one was stop the automatic Windows update and another suggested that there was a memory issue. I have a different theory, mainly because after running the memory diagnostics and it found nothing, and turning off the auto-update feature, she had the problem again, I noticed that when we were in tile mode the store indicated that there were 15 items that needed updating. I slowly (like3 – 5 at a time) updated all of the applications and now the error has not re-appeared.

Sunday, December 23, 2012

Please don’t do this

Recently, I was asked to look at some code and I want to share something that I think should ever be placed in an enterprise level application. Let me say that we are not permitted to use Entity Framework, so everything that we do now is hand jammed.

In this application we have 20 classes in our DataAccessLayer and in 10 of those there is a private method called GetSql().

It looks like this:

public string GetSql()
{
StringBuilder sp = new StringBuilder();

sp.Append("Select");
sp.Append("Field1");
sp.Append(", Field2");
sp.Append(", Field3");
sp.Append(", Field4");
sp.Append(", Field5");
sp.Append(", Field6");
sp.Append(" FROM Table");

return sp.ToString();
}


If there were Joins and Where Clauses they would have their own methods that are designed the same way. I understand why you would use a stringbuilder, as a matter of fact there is a place where this is used in a proper scenario
static string Main(List<int> arguments)
{
StringBuilder builder = new StringBuilder();
foreach (int i in arguments)
{
builder.Append( i.ToString() + ",");
}
return builder.ToString();
}




But I ask and plead, please don’t write the first scenario, use the StringBuilder properly. That is my rant for today, thanks for reading.