Thursday, October 02, 2008
After losing the last two games at home to Dallas and on the road in Tampa Bay, the Packers need to figure out what is wrong and correct it as soon as possible. On paper there is really no reason why the Pack should have lost either game. Dallas is one of the best teams, if not the best, in the NFC but they proved they are beatable when they lost to Washington last week. Tampa turned the ball over only one less time that the Packers but simply moved the ball more effectively which is why Green Bay couldn’t pull out a win.
The most notable issue I have seen in the last two games is the pure lack of running game. Green Bay had a total of 84 rushing yards with only 54 of those yards going to Ryan Grant (on 13 carries). Dallas had a whopping 217 total rushing yards on the Packers with 142 going to Marion Barber. Dallas also had 2 touchdowns on the ground from both Barber and Felix Jones, while the Packers only touchdown came to Aaron Rodgers on the ground. The Tampa Bay game was worse than the Dallas game for the Packers on the ground. Ryan Grant had only 20 yards on 15 carries and the Packers as a team had only 28 yards total on the ground. Ryan Grant has a total of 74 yards on 28 carries in the last two games for 2.6 yards per carry. Grant also has a pair of fumbles between the two games, which is starting to become a staple of Grant’s play this year. If the Packers cannot find a way to get the running game going they will be in trouble this season. Once Green Bay started running the ball well last year is when they really started grinding.
Aaron Rodgers has played ok the past two games, however he did turn the ball over 3 times (1 was a tipped ball by Brandon Jackson) in the Tamp Bay game. Rodgers also fell victim to injury in the Tampa game and was replaced with Matt Flynn, which was partly to blame for another of his interceptions. Rodgers posted 290 yards and completed 22 out of his 39 attempts for zero touchdowns and no interceptions against Dallas, and completed 14 of 27 for 165 yards with 2 touchdowns and 3 interceptions against Tampa. In the past two games Rodgers has completed 36 of his last 66 passing attempts (59%) and has a total of 455 yards, which is not bad despite his 3 interceptions.
Greg Jennings has been one of the only bright spots on the Packers squad the last two games and has grabbed a total of 224 yards on 14 receptions and has 3 100 yard games in a row. He had 8 receptions against Dallas for 115 yards however could not find his way into the end zone, and grabbed 6 balls for 109 yards against the Bucs and found himself dancing in the end zone twice. The rookie Jordy Nelson, who was the Packers first draft pick from Kansas State this year, has stepped up to be one of Rodgers’ favorite targets as well. In both games he had 4 receptions a piece and grabbed over 70 yards between the two games.
The next game for the Packers is on the road in Atlanta which should be a good chance for a win. Atlanta has a questionable defense and a pretty young offense. The Packers experienced defense should be able to put some pressure on Matt Ryan and force him to make poor decisions which will hopefully turn into some turnovers which need to be taken advantage of by the Packers offense. Nick Collins has been one of the leaders this year, especially in the last two games where he was the team’s leading tackler for the two game combined and had 2 total interceptions. I think this Atlanta game will be the turnaround the Packers need to get back on a winning streak.
GO PACK GO!
• Dallas 27, Green Bay 16
• Green Bay 21, Tampa Bay 30
• Mike McCarthy Post-Game Press Conference Transcript - Sept. 28
• Game Notes: Woodson Scores Again
• Game Review: Too Much To Overcome In Tampa
• Rodgers Injures Shoulder, Tries To Return
Punching Out - RF
Monday, September 29, 2008
The Indiana Hoosier’s football team suffered two losses in the past two games which could lead to a lack of a postseason this football season. The first loss to Ball State was a heart breaking thumping from a team that has gotten better and better every year the Hoosiers played them. The second loss came to the Michigan State Spartans , who purely dominated the second half against an injured and unprepared Indiana. There was some sparks from Indiana in the MSU game but poor concentration, poor officiating, and poor play calling lead to a stomping in the second half of the game. I especially liked the formation which saw Ben Chappell at quarterback with Kellen Lewis lining up as both wide out and “slot” back (for lack of a better term).
At this point in the season the Hoosiers have to do something to salvage a season that many (including this optimistic Hoosier fan) thought would end with another Bowl game appearance. The defense needs to play better against the run and the pass and the offense cannot turn the ball over like they have the past couple games. Indiana must get some sort of an established running game to take some of the pressure off of the struggling quarterback situation. This has to start with the offensive line that shows sparks of greatness at times only to let you down on the next play. Finally I think the defensive line needs to start getting more pressure on the quarterback to aid the struggling secondary which is suffering from both injuries and poor play. I think the linebackers have played pretty well and have really been the only sings of improvement from last years defense.
The Hoosiers returned many of the starters from last season’s Insight Bowl team, yet for some reason have not been able to display the same type of swagger they had last year. Though I had IU at 3-1 at this point in the season and they are only 2-2; the Ball State loss was, in my opinion, the game that would have gotten IU that 7-5 record that would have all but ensured a bowl game birth. The other issue I have seen in the past two games is the lack of consistency from the “stars” of the team, as well as poor coaching and play calling. Play calling was an issue with the Hoosiers last year, which I thought would have been corrected this season, but I never would have thought IU would see poor play from some of last year’s best players.
- Kellen Lewis has yet to find a grove this season and has played poorly is the last two games. He stands at 55 completions out of 94 attempts for 650 yards, 4 interceptions and 4 touchdowns. He does have 42 rushing attempts for 357 yards and 3 touchdowns.
- Ray Fisher for some reason has forgot how to catch the football when people are near him and has dropped more passes (that were catchable) than any of the other receivers. Fisher currently has 13 grabs for 65 yards and 2 touchdowns.
- Andrew Means has been consistent when he has played, but dealt with injuries in the MSU game. Means has 15 catches for 217 yards.
- Nick Polk, Austin Thomas, and Chris Phillips were all injured for the MSU game which left IU with no returning starters in the secondary from last year’s Insight Bowl Team.
- Marcus Thigpen has broken some big plays here and there but is not consistent and is not the back that should get the majority of the carries. At this point I would say Demetrius McCray but even he hasn’t stood out in a way that I would say he should be the “starter”. Thigpen is fast and gives IU chances for that “one big play” but I prefer a consistent down hill running back. It is hard to argue against 32 carries for 277 yards and 4 touchdowns but 3 of his carries where for 50+ yards (and 3 TD’s). I am still not sold on Thigpen… I know that may seem ridiculous.
- Greg Middleton has done basically nothing this season with only 6 tackles and 1 sack on the year.
Indiana still has some games at home that are winnable in Northwestern, Central Michigan, and Iowa. However Northwestern beat the Hoosiers last year in a barn-burner, and Iowa is always a tough game despite the fact that IU has beaten them the past two years. Central Michigan is looking like a tough game also, since Ball State came to Memorial Stadium and put up 42 points on a defense that was supposed to be the strong point of the Hoosier’s team this year (I know turnovers and penalties have killed IU this year but 42 is 42). The only game I fell that IU can grab on the road this year is Minnesota which is next week, but IU has consistently played bad at Minnesota. If these games end up as wins this would give IU a 6-6 record with really no wins of substance thus no post season game more than likely. If the Hoosiers were to surprise me and grab another win on the road against Purdue, Penn State, or Illinois or perhaps get a win over Wisconsin at Memorial Stadium then that would provide the extra win IU needs to get into a Bowl game at the end of the year.
My optimistic opinion is that we IU will win the home games against Northwestern, Central Michigan, and Iowa and they also win at Minnesota. The “surprise” win will be at Purdue or at Illinois to give IU the coveted 7-5 record. However the realist in me thinks it wouldn’t be too much of a surprise if IU dropped games against Central Michigan and/or Minnesota with no win at Purdue or Illinois to give us either a 6-6 record or a 5-7 record. There is also a chance IU could go 4-8 if Iowa proves to be tougher than I think.
Indiana vs Ball State – L – 20-42
• Lewis scampers for 164 and four TDs, runs Ball State to win
• Statistics
• Updated University Statement on Dante Love's Football Injury
Indiana vs Michigan State – L – 29-42
• Ringer helps Michigan State score wild win over Indiana
• Statistics
• Hoosiers double up with quarterbacks
• Hoosiers give up 42 in loss to Michigan State
• Hoosiers switch up new offense to utilize Lewis
• Infractions and miscues loom large
• Injuries giving IU pain
Punching Out - RF
Sunday, September 21, 2008
About three and a half weeks ago Erin went to one of her weekly doctor’s appointments, and was set to the hospital to stay until Aidan was born. Well finally our beautiful baby boy has arrived. Aidan Martin Fetz was born on September 13th 2008 at 9:14 AM, he weighted 8lbs 9oz and was 20.5 inches long.
On Thursday September 11th Erin was scheduled to receive cervidil at 6pm, so I left work after lunch and cam on into the hospital to be with her. She got the first round of the cervidil and started having small contractions which eventually puttered out after about 2 hours. With cervidil they leave the drug in for around 12 hours to soften the cervix to try and help the labor induction. After the first round they checked her cervix and it helped a little but she still wasn’t ready for the petosin which induces labor. Around 8am on Friday the 12th they started another round of cervidil which again came with a couple hours of contractions but nothing substantial. After about 8 hours on the second round the doctors checked again and this round had no effect on her cervix so they went ahead and started the petosin to see if that would help her to start dilating.
The petosin gave her a few contractions, but it wasn’t doing much. Since Erin was preclamptic her blood pressure started to rise and the doctors needed to start her on a magnesium drip to prevent seizures. The magnesium basically stopped any signs of labor and nothing progressed from there. Aidan’s heart rate started to drop a little so Dr. Stevens came in to talk to us. They took her off the petosin and scheduled her for a C-Section in the morning of the 13th.
At 7am Saturday September 13th, we got ready for Erin C-section and the birth of our baby boy. They took Erin back to the operating room and gave me and my mom some cool looking gowns to put on so we could go back and watch. Everyone talks about the feeling you get the moment you see your child or hear his/her first cry, but I am hear to tell you it is so surreal and beautiful I cant put it into words. I am not afraid to admit it but I cried like baby the moment I saw him for the first time, the emotion explosion I felt was too much I can’t describe it.
Aidan and Erin are both doing very well now, but there were a few hardships we had to jump over before we came home for the first time. Erin struggled with a lot of pain right after the surgery because some of her medicine didn’t kick in right away so they had to pump her full of morphine to help with everything. She did get to breast feed him fairly quickly after he was born which is something she really wanted to do. The first night we spent up in the labor and delivery ward because Erin had to be on magnesium for 24 hours after delivery to prevent seizures, and that night was pretty rough. Erin spiked to big temperatures that night which had to be broke by giving her a slew of antibiotics. The highest temp she spiked was 102.8, followed by a 101.3. After the temperature spikes the doctors thought she might have some sort of infection so they decided to put her on routine antibiotics for the next few days. Aidan’s first checkup by Dr. Sephiri was good; he did have some fluid in his lungs possibly, which Dr. Sephiri wanted to be monitored. The next day they put our little man on an IV where they started him on a bunch of antibiotics because there was a possibility that he could have caught the same infection that Erin may have had.
Finally on Wednesday the 17th we got to bring our baby boy to his new home. We stopped by Tumbleweed on the way home to get Erin some real food after eating the Floyd Memorial Hospital food for 3 weeks. Little did we know that the Buffalo Chicken Wrap would give Aidan a tummy ache that night and we would get zero hours of sleep! Since then he has been sleeping pretty well, however he won’t sleep in his cradle. We are sleeping in the living room because Erin can’t get in our bed because she is still sore from her C-Section.
All in all everything is going extremely well. Aidan is healthy and eating like a monster and Erin is moving around very well for only a week out of surgery. Make sure you check out the latest pictures of Aidan in the photo gallery. I will keep you posted.

Punching Out - RF
Thursday, September 11, 2008
Sending and email in C# using the .Net Framework is very simple, and I think everyone has seen examples of using the MailMessage and the SmtpClient objects within the System.Net.Mail namespace. If you google something like “C# Send Email” you will find hundreds of examples which looks similar to the following code snippet.
SmtpClient client = new SmtpClient("localhost");
MailMessage message = new MailMessage();
message.IsBodyHtml = true;
message.Subject = "My C# Email";
message.Body = "I love sending Emails in C#.";
message.To.Add("ryan_fetz@insightbb.com");
message.To.Add("ryan@ryanfetz.com");
message.From = new MailAddress("ryan_fetz@insightbb.com");
client.Send(message);
This is simple enough, but in my stride to make things simpler, and love of the using statement wouldn’t it be easier to write something like this.
using (EmailController emailer = new EmailController("localhost"))
{
emailer.Subject = "My C# Email";
emailer.Body = "I love sending Emails in C#.";
emailer.To.Add("ryan_fetz@insightbb.com");
emailer.To.Add("ryan@ryanfetz.com");
emailer.From = new MailAddress("ryan_fetz@insightbb.com");
emailer.Send();
}
I know it isn’t that much less code, but to me it seems simpler to read and easier to use than the standard method which the framework provides. With a little more work the email controller class, which is listed below, could be made to work with even less code. Maybe in a later post I will post an updated version of the EmailController listed below. You can also download this simple utility by clicking here.
Punching Out – RF (that one is for you Nate)
public class EmailController : IDisposable
{
private SmtpClient client = null;
private MailMessage message = null;
public EmailController(string host, bool isHTML)
{
client = new SmtpClient(host);
message = new MailMessage();
message.IsBodyHtml = isHTML;
}
public EmailController(bool isHTML)
: this("localhost", isHTML)
{
}
public EmailController()
: this("localhost", true)
{
}
public string Subject
{
get { return this.message.Subject; }
set { this.message.Subject = value; }
}
public string Body
{
get { return this.message.Body; }
set { this.message.Body = value; }
}
public MailAddress From
{
get { return this.message.From; }
set { this.message.From = value; }
}
public MailAddressCollection To
{
get { return this.message.To; }
}
public void Send()
{
this.client.Send(this.message);
}
public void Dispose()
{
message = null;
client = null;
}
}
Wednesday, September 10, 2008
The Packers first game of the season resulted in a huge win over division rival Minnesota. The 24-19 win saw a lot of great plays from some of the newer faces on the Packer squad, as well as the usual solid play by the veterans. Aaron Rodgers played very well in his debut game as the starting quarterback for the Green Bay Packers, and should have at least quieted most of his doubters. I know it is only one game into the season, but he has shown he can handle the job and play at a high level. Rodgers finished with 178 yards on 18 completions out of 22 attempts and 2 total touchdowns (1 rushing touchdown). Rodgers also finished with a 115.5 passer rating and a completion percentage of 81.2, which ranks as the second-best mark in league history by a quarterback (min. 20 attempts) in his first start. His rushing touchdown ended up being the deciding score of the game which gave the Packers their first win of the season, Rodgers ended the rushing touchdown with a much deserved Lambeau Leap.
The most impressive drive by Rodgers the Packer’s 3rd drive of the game which consisted of a long 56-yard pass to Greg Jennings, followed by a 1-yard pass to Korey Hall (Hall’s first career touchdown). The offense did struggle at times, punting 5 times and having one clocked field goal; however they got the job done. Ryan Grant had 12 total carries which resulted in 92 yards. Grant averaged 7.7 yards per carry and had an impressive 57 yard gain late in the game which led to the Packer’s final touchdown. Despite the long gain Minnesota really kept Grant in check for the most part. Aaron Rodgers was the team’s second leading rusher with 8 carries for 35 yards and a touchdown. Will Blackmon also provided some spark through special teams with a 76 yard touchdown punt return. The leading receiver for The Pack was Greg Jennings with 91 yards and five catches, followed by Donald Driver with 38 yards on 4 receptions.
The Packer defense played fairly well, however did look sloppy at times. Anytime you hold a running back like Adrian Peterson to 103 yards on 19 attempts you are doing pretty well. The Packers held Tarvaris Jackson to 178 yards through the air, and 65 yards on the ground. Jackson did make quite a few plays which led to the late comeback Minnesota put together (23-yard touchdown pass, and a slew on large gains on the ground). It seemed like the defense couldn’t get off the field in the third quarter where Minnesota controlled almost 13 minutes of the 15 minute quarter. The teams leading tackler was A.J. Hawk who grabbed 10 total tackles (7 solo), followed by Nick Barnet who has 8, and Brady Poppinga was the third leading tackler with 6 total. It is generally a good sign to see your Linebacker core as the team’s leading tacklers in a game. Atari Bigby, my wife’s favorite player, finished the game off with a fourth quarter interception that ended the Vikings’ chance of making any comeback. The first sack of the year for the Packers came to Aaron Kampman, to no suprise, who finished with 5 total tackles (fourth most overall).
It was good to see the team play well and start the season off right with a win. They need to continue this trend and keep working on the few areas where they struggled. Rodgers is the Packers quarterback and I am very happy with where the team is right now. Brett Favre is one of the greatest quarterbacks in the history of football and I am proud to say he played for the Packers. I hate how things went down during the offseason, but it seems like everyone will come out ok and Favre hasn’t stained my view or opinion of him. He will always be a Packer, and my favorite player of all time; but the Rodgers' era has started and I am on the bandwagon… It looks like it is time to put my #4 jersey in the "Hall of Fame" with my #89 Chumura jersey and put the #12 on.
GO PACK GO!!!
• Box Score
• Game Review: Not Pretty, But Victorious In Opener
• Rodgers Strong In Starting Debut
• Packers See Return From Blackmon
• Notebook: Great Catch Gives Hall 1st TD
• Mike McCarthy Post-Game Press Conference
Punching Out - RF
Monday, September 08, 2008
As promised in a previous post about custom configuration sections, here is my example of creating custom sections in a .Net configuration file using the new, not deprecated, ConfigurationSection. The ConfigurationSection class is the primary portion of using this method, however there are quite a bit of Attribute classes and other element type classes you will also have to use as well. The ConfigurationSection is a type of starting point for this method as this is the “Root” of your configuration xml. To add nodes, attributes, or lists of nodes to a section you will use the ConfigurationProprty attribute on the class’s properties that represent pieces of your configuration section. If you want to have a list of nodes in the section, or element, you will be implementing the ConfigurationElementCollection class, and node properties must inherit the ConfigurationElement class. Here is an example of a custom configuration section object which compares to the Settings class in the previous configuration file post. As you see there is the DoSomething property which will be an attribute in the “settings” node as well as an Information property which will be represented as a child node of the “settings” node. Each property must have the ConfigurationProperty attribute to mark it as a configuration property which is handled through reflection during instantiation.
[Serializable]
public class MySettingsSection : ConfigurationSection
{
private const string _doSomething = "doSomething";
private const string _information = "information";
[ConfigurationProperty(_doSomething,
DefaultValue = "false", IsRequired = false)]
public bool DoSomething
{
get { return (bool)this[_doSomething]; }
set { this[_doSomething] = value; }
}
[ConfigurationProperty(_information)]
public InformationElement Information
{
get { return (InformationElement)this[_information]; }
set { this[_information] = value; }
}
}
Now we have our custom configuration section which has a child node/element property that is type InformationElement. The InformationElement class inherits from ConfigurationElement which represents a configuration element inside a configuration file. This is similar to the section class above, as it should have properties with ConfigurationProprty attributes declaring how the properties should be reflected in the file. In this instance we have a Name element, an Environment attribute, and a list of Message elements inside our Information element. The message list is a MessageCollection object, which inherits from the ConfigurationElementCollection class. Notice the ConfigurationCollection attribute on the Messages property which declares the type of collection object it uses as well as the named of the methods for adding, clearing, and removing items from the configuration element list. Here is the source for the InformationElement class.
[Serializable]
public class InformationElement : ConfigurationElement
{
private const string _messages = "messages";
private const string _name = "name";
private const string _environment = "environment";
[ConfigurationProperty(_environment,
DefaultValue = "production", IsRequired = false)]
public string Environment
{
get { return (string)this[_environment]; }
set { this[_environment] = value; }
}
[ConfigurationProperty(_messages, IsDefaultCollection = false)]
[ConfigurationCollection(typeof(MessageCollection),
AddItemName = "addMessage",
ClearItemsName = "clearMessages",
RemoveItemName = "removeMessage")]
public MessageCollection Messages
{
get
{
MessageCollection items = (MessageCollection)base[_messages];
return items;
}
}
[ConfigurationProperty(_name)]
public NameElement Name
{
get { return (NameElement)this[_name]; }
set { this[_name] = value; }
}
}
The NameElement and MessageElement classes are very similar to the Name and Message classes from the previous example, with the difference being that they now inherit from the ConfigurationElement class and their properties now have ConfigurationProprty attributes. You will also see the addition of the StringValidator attribute which gives information about the valid type of information a property can accept. There are other validators for other types of properties such as a RegexStringValidator and an IntegerValidator attribute.
[Serializable]
public class MessageElement : ConfigurationElement
{
private const string _name = "name";
private const string _value = "value";
private const string _InvalidCharacters = "~!@#$%^&*()[]{}/;'\"|\\";
[ConfigurationProperty(_name, IsRequired = true)]
[StringValidator(
InvalidCharacters = _InvalidCharacters, MinLength = 1, MaxLength = 100)]
public string Name
{
get { return (string)this[_name]; }
set { this[_name] = value; }
}
[ConfigurationProperty(_value, IsRequired = true)]
[StringValidator(
InvalidCharacters = _InvalidCharacters, MinLength = 1, MaxLength = 250)]
public string Value
{
get { return (string)this[_value]; }
set { this[_value] = value; }
}
}
[Serializable]
public class NameElement : ConfigurationElement
{
private const string _value = "value";
private const string _InvalidCharacters = "~!@#$%^&*()[]{}/;'\"|\\";
[ConfigurationProperty(_value, IsRequired = true)]
[StringValidator(
InvalidCharacters = _InvalidCharacters, MinLength = 1, MaxLength = 100)]
public string Value
{
get { return (string)this[_value]; }
set { this[_value] = value; }
}
}
The source for the MessageCollection is pretty simple. It is simply a collection of MessageElements, and the base class pretty much does everything for you. I added a few methods for simplicity and overrode a few other methods to make things a little easier.
[Serializable]
public class MessageCollection : ConfigurationElementCollection
{
public MessageCollection()
{
MessageElement msg = (MessageElement)CreateNewElement();
Add(msg);
}
public override ConfigurationElementCollectionType CollectionType
{
get { return ConfigurationElementCollectionType.AddRemoveClearMap; }
}
protected override ConfigurationElement CreateNewElement()
{
return new MessageElement();
}
protected override object GetElementKey(ConfigurationElement element)
{
return ((MessageElement)element).Name;
}
public MessageElement this[int index]
{
get { return (MessageElement)BaseGet(index);}
set
{
if (BaseGet(index) != null)
{
BaseRemoveAt(index);
}
BaseAdd(index, value);
}
}
public new MessageElement this[string Name]
{
get { return (MessageElement)BaseGet(Name); }
}
public int IndexOf(MessageElement message) { return BaseIndexOf(message); }
public void Add(MessageElement message) { BaseAdd(message); }
protected override void BaseAdd(ConfigurationElement element)
{
BaseAdd(element, false);
}
public void Remove(MessageElement message)
{
if (BaseIndexOf(message) >= 0)
BaseRemove(message.Name);
}
public void RemoveAt(int index) { BaseRemoveAt(index); }
public void Remove(string name) { BaseRemove(name); }
public void Clear() { BaseClear(); }
}
Now that we have the structure of our custom configuration model, we are pretty much complete. I have added a simple Section “Grabber”, which gets a section from the configuration file. It uses the ConfigurationManager's GetSection() method to get the section from the file. It is a simple static generic class with a single method where the type T must inherit from the ConfigurationSection class.
public static class SectionHandler<T> where T : ConfigurationSection
{
public static T GetSection(string section)
{
T config = (T)ConfigurationManager.GetSection(section);
return config;
}
}
Now that we have the configuration model, and a “section getter” we need to add our section to the configuration file. Similar to the other post which used the IConfigurationSectionHandler interface; we have to declare the configuration section inside the configSections section of the config file. For the current example this would look something like the following.
<configSections>
<sectionGroup name="ryansGroup">
<section
name="mySettings"
type="ClassLibrary1.MySettingsSection"
allowLocation="true"
allowDefinition="Everywhere"/>
</sectionGroup>
</configSections>
Once the section group and section have been declared it is as simple as declaring the information for the custom configuration section. Based on our current example the configuration looks something like the following.
<ryansGroup>
<mySettings doSomething="true">
<information environment="development">
<name value="Ryan Fetz"/>
<messages>
<clearMessages/>
<addMessage name="Msg1" value="Hello World"/>
<addMessage name="Msg2" value="Go Hoosiers"/>
<addMessage name="Msg3" value="Go Pack Go"/>
</messages>
</information>
</mySettings>
</ryansGroup>
Now here is a simple example of using and getting the configuration information above.
public class Program
{
static void Main(string[] args)
{
MySettingsSection section =
SectionHandler<MySettingsSection>.GetSection("ryansGroup/mySettings");
InformationElement info = section.Information;
Console.WriteLine("Name: {0}", info.Name.Value);
foreach (MessageElement message in info.Messages)
{
Console.WriteLine("Message: {0}, {1}", message.Name, message.Value);
}
}
}
As you can see it is pretty simple to write your own custom configuration sections for use in your Web.config or App.config files. Since the IConfigurationSectionHandler method is deprecated in the newer version of the .Net Framework, I recommend this method of creating custom configuration sections. You can download the source for this example here. I hope this helps someone out there.
Punching Out - RF
Indiana’s running backs carried the load for the offence in their impressive win against Murray State this past Saturday, resulting in 6 touchdowns and 254 yards. The team’s leading rusher this game was Senior Marcus Thigpen, who didn’t have a very impressive game the previous week against WKU. Thigpen netted 100 total yards (7 carries) on the ground with the bulk of them coming off two huge runs which both resulted in touchdowns in the first quarter (67 and 31).
IU is used to having the bulk of the ground game come from Kellen Lewis; however this game Lewis stuck to passing the ball. He finished the game with 15 completions out of 21 attempts for a total of 170 yards and no touchdowns, (1 rush attempt for -2 yards). Backup quarterback Ben Chappell saw quite a bit of action in the second half and took advantage of almost every passing attempt he got. Chappell finished 6/7 for 52 yards as well as 14 yards on the ground and a touchdown.
Indiana as a team finished 21-28 through the air for a total of 222 yards. The Hoosiers ran the ball a whopping 53 times for 254 yards on the ground, and 476 yards of total offense. The Hoosier defense stepped up and held the Murray State offense to only 149 yards of total offense, with 28 of those resulting from the running game. Chris Hagerup, who struggled in the WKU game, seemed to find his foot this game with few solid punts averaging 39 yards/punt. Austin Starr converted only one field goal out of two attempts and nailed all five of his extra points.
The big story out of the game is the Indiana running game, which showed up in am impressive fashion after struggling to get much going against WKU the previous week. IU ran the ball with 5 different running backs, which all looked fairly impressive when they got their chance to run the ball. Thigpen showed what he can do when holes open up. His breakaway speed is unmatched, and he can be very explosive and create huge plays when everything goes right. He finished with 100 yards of 7 carries; however 98 of the yards came off two plays. If you the longest run away (67 yards) then his day wasn’t that impressive; but again when the play executes correctly Thigpen’s speed is unmatched by many defenses. The most impressive play I saw from the running backs came from freshman running back Zach Davis-Walker (5’8 185) in the second half, and Demetrius McCray. McCray finished the game with 47 yards on attempts (5.9yds/carry) and a touchdown. McCray seemed to be the most consistent of the back this game, opposed to Bryan Payton who had only 31 yards on 13 attempts (and a touchdown). Payton seemed to struggle a little when running between the tackles and never seemed to break anything big. Freshman Zach Davis-Walker, for me, stole the show in the later part of the game. He was very impressive in how fast he hit the holes. The way he explodes through the hole as soon as it opens up is quite remarkable for such a young back. He also seems to have great vision, and was able to maneuver wuite well through the line. Most of his yards seemed to be either off-tackle or between the tackles which is nice to see in a small back.
I though all the wide receivers played pretty well and it was nice to see the young guys stepping up and making plays. Andrew Means was his usual self, making great grabs and fighting for every yard after the catch. Means is obviously the most consistent of the core, however Terrance Turner (Sophmore), Damarlo Belcher (Freshman), and Tandon Doss (Freshman) all put up solid days with three or more catches each. Turner (3cat-41yds) had the longest grab of the day; a nice 24 yard grab from Kellen Lewis. True freshman Tandon Doss (Freshman) all put up solid days with three or more catches each. Turner (3cat-41yds) had the longest grab of the day; a nice 24 yard grab from Kellen Lewis. True freshman Tandon Doss (who missed last week) got to see some playing time (3cat33yds) because Ray Fisher sat out due to a injury suffered in the WKU game. Damarlo Belcher finished the game with 3 catches for 37 yards, another nice game for the freshman following his touchdown catch in the WKU game.
Indiana’s lone turnover came from a muffed punt by Jeremy Finch, however the Hoosiers grabbed 3 (2 fumbles, 1 interception) turnovers themselves. Nick Polk grabbed his first interception of the season on a nice break in the second quarter. Ryan Marando also caused and recovered a fumble knocking the ball out of the hand of the Murray State quarterback, which gave the Hoosiers the ball on the 4 yard line (which turned into a 2 yard touchdown run by Payton). The Hoosiers converted four 3rd-down conversions, and was 3-3 on fourth down conversions, and impressively committed no penalties.
All in all a great game for the Hoosiers, and a nice showing on both sides of the football. IU has the week off this weekend, and will start preparing for their game against Ball State on the 27th of September. On a side note I will be a father by the next time IU plays a football game as my son will be born on September 12th after my wife, Erin, will be induced early Friday morning.
GO HOOSIERS!
• Defense states its case for Hoosiers
• Indiana vs Murray State - Recap
• Box Score
• Running backs, where have you been?
• Thigpen, Hoosiers Run Past Racers
Punching Out - RF
Friday, September 05, 2008
There is two ways of creating and implementing custom app or web configuration sections. One is using the IConfigurationSectionHandler interface which has been deprecated in newer versions of the .Net Framework but is still supported, and the other is inheriting from the ConfigurationSection base class. In this post I will show you how to create custom configuration sections using the first one, by inheriting from the IConfigurationSectionHandler interface and utilizing the built in XML Object serialization framework. I also will give you a few base classes, and interfaces you can use to easily and quickly build custom configuration by simply implementing a simple interface and using an object factory to get the object representation of your custom configuration sections.
The interface that your “root” settings object must implement is a simple interface named IConfigSettings which has a single method, as shown below. The Serialize method will use a g eneric Settings serializer class for building the XML from the setting object.
public interface IConfigSettings
{
string Serialize();
}
You also need a class which implements the IConfigurationSectionHandler interface, which in my example is very simple. I have a base configuration section handler which "other" configuration handlers can derive from so you can add multiple handlers in your config files. The base handler, displayed below, must implement the Create() method which simply returns the XmlNode section which will be deserialized by a factory class.
public abstract class BaseConfigSectionHandler : IConfigurationSectionHandler
{
public BaseConfigSectionHandler()
{
}
public object Create(object parent, object configContext, XmlNode section)
{
return section;
}
}
public class MyConfigurationSectionHandler : BaseConfigSectionHandler
{
public MyConfigurationSectionHandler()
: base()
{
}
}
Here is the SettingsSerializer class, which is built based on a previous post about generic XML serialization. The class is a simple static class which serializes and desterilizes objects which implant the IConfigSettings interface (and are a class).
public static class SettingsSerializer<T>
where T : class, IConfigSettings
{
private static XmlSerializer ser = new XmlSerializer(typeof(T));
public static T BuildSettings(string xml)
{
object value = null;
using (StringReader sr = new StringReader(xml))
{
value = ser.Deserialize(sr);
}
if (value == null)
return null;
return value as T;
}
public static T BuildSettings(XmlDocument xml)
{
return BuildSettings(xml.OuterXml);
}
public static string Serialize(T item)
{
StringBuilder sb = new StringBuilder();
using (TextWriter w = new StringWriter(sb))
{
ser.Serialize(w, item);
}
return sb.ToString();
}
}
In this example I also built a simple factory class for building IConfigSettings objects which uses the generic serializer to build the objects. This class will be used by our manager class to read the XML from the config file.
public static class SettingsFactory<T>
where T : class, IConfigSettings
{
public static T BuildSettings(string xml)
{
return SettingsSerializer<T>.BuildSettings(xml);
}
public static T BuildSettings(XmlDocument xml)
{
return BuildSettings(xml.OuterXml);
}
}
The settings manager classes are also generic classes which you would inherit from a base manager class, which uses reflection to get the root node of the settings object it manages. Settings managers are the classes that read the XML, use the factory, and return the IConfigSettings object for which it manages. In the example here I created my setting manager as a Singlton for ease of use, as well as maintaining the same pattern as the ConfigurationManager class. The constructor of the base class uses the ConfigurationManager class to get the section for which the manager deals with, and then uses our SettingsFactory to build the object. It also uses the ConfigRoot property which uses reflection to read the SettingsRootAttribute that is attached to the derived class. Here is the attribute and the base class for the abstract settings manager.
public class SettingsRootAttribute : Attribute
{
private string _Name;
public SettingsRootAttribute(string name)
{
_Name = name;
}
public string Name
{
get { return _Name; }
set { _Name = value; }
}
}
public abstract class BaseSettingsManager<T>
where T : class, IConfigSettings
{
private T _Settings;
public T Settings
{
get
{
return this._Settings;
}
}
protected BaseSettingsManager()
{
XmlElement configElement = ConfigurationManager.GetSection(ConfigRoot) as XmlElement;
XmlDocument newDoc = new XmlDocument();
newDoc.AppendChild(newDoc.ImportNode(configElement, true));
_Settings = SettingsFactory<T>.BuildSettings(newDoc);
}
protected string ConfigRoot
{
get
{
object[] attribs = this.GetType().GetCustomAttributes(typeof(SettingsRootAttribute), true);
if (attribs.Length > 0)
{
return (attribs[0] as SettingsRootAttribute).Name;
}
throw new Exception("Missing SettingsRootAttribute on class: " + this.GetType().Name);
}
}
}
Now for inheriting the base class for our own specific settings manager. Notice the SettingRoot attribute which will be the root element of our settings object both in the XML serialization and inside the configuration file. As stated above I decided to design my manager class as a singleton, which is apparent below.
[Serializable]
[SettingsRoot("myconfiguration")]
public class SettingsManager : BaseSettingsManager<Settings>
{
private static SettingsManager _Instance = new SettingsManager();
private SettingsManager()
: base()
{
}
public static SettingsManager Manager
{
get
{
return _Instance;
}
}
}
Now we can define our custom Settings class, which must implement the IConfigSettings class as well as utilize the attributes inside the built in XML serialization framework. The XmlRoot attribute tells the built in serialization framework what this object’s element name, and this should be the same as the value used in the SettingsRoot attribute of the manager class. The XmlElement attribute on the Information property tells the framework that the property is serialized as a xml element and not an attribute.
[Serializable]
[XmlRoot("myconfiguration")]
public class Settings : IConfigSettings
{
private Information _Information;
public string Serialize()
{
return SettingsSerializer<Settings>.Serialize(this);
}
[XmlElement("information")]
public Information Information
{
get { return _Information; }
set { _Information = value; }
}
}
Inside out Information node/element we will have a Name element and a list of Message elements. For the list of messages we have to use the XmlArray and XmlArrayItem attributes to give the appropriate information about the type of object the list is derived of as well as the root element to use when encompassing the list of elements. Also in our Name and Message classes we are using the XmlAttribute attribute which makes the property serialize as an attribute inside the element.
[Serializable]
[XmlRoot("information")]
public class Information
{
private List<Message> Messages _Messages = new List<Message>();
private Name _Name;
[XmlArray(ElementName = "messages")]
[XmlArrayItem(ElementName = "message", Type = typeof(Message))]
public List<Message> Messages
{
get { return _Messages; }
set { _Messages = value; }
}
[XmlElement("name")]
public Name Name
{
get { return _Name; }
set { _Name = value; }
}
}
[Serializable]
[XmlRoot("name")]
public class Name
{
private string _Value;
[XmlAttribute("value")]
public string Value
{
get { return _Value; }
set { _Value = value; }
}
}
[Serializable]
[XmlRoot("message")]
public class Message
{
private string _Value;
[XmlAttribute("value")]
public string Value
{
get { return _Value; }
set { _Value = value; }
}
}
Now that we have our configuration objects built, and the managers, factory, and everything built it is time to add the configuration section to your config file. Here is an example of adding the above example to a config file.
<configSections>
<section name="myconfiguration"
type="Ryan.Fetz.Core. MyConfigurationSectionHandler, Ryan.Fetz.Core"/>
</configSections>
Now that the section is added you simply add the configuration inside the file.
<myconfiguration>
<information>
<name value="Ryan Fetz" />
<messages>
<message value="Go Hoosiers!"/>
<message value="Go Pack Go!"/>
<message value="Go Bayern Munich!"/>
</messages>
</information>
</myconfiguration>
Hope this helps someone out there. Stay tuned for my next post which will be an example of using the second way of building custom configuration sections.
Download the full source here.
Punching Out - RF
Bayern München and first year coach Jürgen Klinsmann grabbed their first victory of this year’s Bundesliga campaign comfortably (4-1) against Hertha Berlin. Klinsmann did decide to use the 3-5-2 formation he utilized in some of the pre-season competitions, which he stated as giving them an extra man over in the middle. The team captain Mark van Bommel sat the match out due to a red card in the match against Dortmund.
Luca Toni opened the scoring up with his first goal of the season in the first 12 minutes, which also opened up the overall dominance of the match for Bayern. Bayern quickly established a presence on the pitch, pressing hard in the early stages of the math. Phillip Lahm made it 2-0 with a brilliant display of passing between him and Zé Roberto and crisp shot 9 minutes after the half. Both Bastian Schweinsteiger and Miroslav Klose converted penalties to close out the scoring for the München. The goal for Klose closed out a long scoring draught going back to even the Euro 2008.
Berlin had only 3 shots on goal that were on target and only one squeaked by Bayern keeper Michael Rensing, while München had 19 shots on goal with 8 being on target. München also had 11 corners to Berlin’s 1.
FCB was without team captain, van Bommel, as well as Turckish national Hamit Altintop due to a foot injury. New signee Massimo Oddo was not chosen for the match however he did pull on a Bayern München shirt for Oliver Kahn’s final match this week. Making the substitutes list for the first time this campaign were Olympic players Breno and Sosa, as well as new keeper signee Hans Jörg Butt. The starting group was a little different that I had imagined. Klinsmann utilized Lucio, Demichelis, and Lahm in the back which is what I had imagined; however I am not sure how the lineup will look once Sagnol returns. In the middle Klinsmann started Christian Lell, Daniel van Buyten, Andreas Ottl, Zé Roberto, and Bastian Schweinsteiger while Luca Toni and Miroslav Klose were up top. The subs that saw action in the match included Lukas Podolski (Klose, 71), José Ernesto Sosa (Lell, 71), and Tim Borowski (Schweinsteiger, 71). I would like to see Borowski and Schweinsteiger play in the same lineup while Franck Ribéry is still out on injury.
The team and staff seems to be very excited about the win, and looks to build off this win in the next match against Lukas Podolski’s former club FC Köln on the 13th. However Uli Hoeneß did feel the team could have grabbed two or three more goals in the already one-sided match. Hertha Berlin Coach Lucien Favre seemed pleased to narrowly escape with a 3 goal deficit. Bayern also is looking toward a match with FC Nürnberg on the 24th in the DFB Cup and match against FC Steaua Bucuresti in the opening of the Champions League.
Links:
• Bundesliga: Bayern's first win as Hertha thrashed
• Box Score
• Rampant champions outclass Berlin
• Klinsmann: 'We're up to speed'
• Selfless team-mates help Klose end drought
• Allianz Arena in raptures after gala display
Punching Out - RF
Thursday, September 04, 2008
The Christian Academy Warriors men’s soccer team is looking to make a run towards the finals of their Sectional this year after last years narrow decision to the Jeffersonville Red Devils in the final. One of the leaders of this talented team is the junior midfielder Paul Devore. This year’s team is full of talented and experienced players as well as a group of young players who should also provide solid performances throughout the season. The Warriors should be able to make a strong push for a Sectional Championship with a strong front line attack from junior Andrew Rosenberg and sophomore Ross Heinz and the field general, my cousin, Paul Devore.
If you are looking to watch a solid team this season in Southern Indiana this year, I recommend attending a Christian Academy soccer match. And if you are looking to watch technically sound midfielder, I certainly recommend checking out the solid performance from a young man named Paul Devore. The Warriors have already notched some impressive wins in their fairly young season against some pretty talented squads, and they are improving in every match they play. As only a junior Paul displays some of the technical skills of a player with much more experience under their belt. He displays crisp passes, great touch on the ball, solid marking abilities, and the ability to make runs from the midfield which gives CAI great attacking possibilities. With his senior year still ahead of him, Paul displays the possibility of becoming a very good footballer. You can check out some pictures of the Warriors latest match in my photo gallery.
Go Warriors!
Punching Out - RF