April 28, 2010

Meal planning takes making a grocery list one step further. Planning out every meal of the week saves a bunch of time at the grocery store. It also keeps food costs down, and motivates one to think about what is going on the rest of the week.

Brett (@belahm) invested in some meal planning stationary (its from Lobotome). I was skeptical at first, but I now think it is very beneficial to plan out each meal and buy only what is needed from the store. The meal sheet for this week is shown below:

I have the same thing everyday for breakfast and lunch, so there is no need to plan those. Each night, write what is for dinner on the left and the required ingredients on the right. It only takes a few minutes each week, and saves a bunch of frustration when trying to figure out what to cook.

Nate (@natelowry) pointed me at an interesting article detailing the daily routines of 25 famous thinkers. The article (from onlinecollege.org) gives a few details into the lives people like C.S. Lewis, Benjamin Franklin and Winston Churchill.

I really like articles like these. They are short, interesting and give the reader a sense of attachment with the people they are reading about. It reminds me of the bookseries On the John University. The books contain short passages to be read on the john (hence the name). Content in this form is intriguing, educational and just the right length.

Some of the people mentioned in the article match their routines very well. Barack Obama is on a strict schedule all day, but still eats breakfast and dinner with his family. Charles Darwin kept a very tight schedule as well. Ernest Hemingway, in contrast, is much different. He would write until he had said what he needed to say. That would be a dream job for a man of few words.

My favorite daily routine was Winston Churchill's. He would get up at 7:30 am but not leave bed until 11. during this time he would eat breakfast, read and dictate to secretaries. He would work for the rest of the day (squeezing in a 2.5 hour working lunch). After a post work nap, Churchill would have dinner and socialize until roughly midnight. He would then get some more work done before bed.

Here is how I think it went down. Churchill woke up every morning (hungover) at 7:30 am. After getting out of bed (and his first cocktail) he would work until lunch. Lunch always ran long (more drinks) and he was out of the office by 5 pm (happy hour). After a quick nap, Churchill would entertain dinner guests (Does whiskey count as a guest?) well into the night. After realizing that he should get some last minute work done, he buckles down and finishes his day (by passing out at his desk).

I had a few takeaways from this interesting article:

Get up early. Anyone who is getting anything done gets up very early.

Take time for non-work. It is surprising how much time these great thinkers spend not working.

Ignite Lincoln is the inaugural Nebraska Ignite event being held in Lincoln on Thursday night. An Ignite event is a series of 5 minutes talks from people with a wide range of backgrounds and topics. Each talk is structured exactly the same. The speaker has five minutes and 20 slides. The slides auto-advance every 15 seconds. Organizers of the event in Lincoln will have the event biyearly.

I will be speaking about cooking and the unique role that it plays in my life. Even though I am not a professional chef, I am deeply passionate about cooking. I uploaded my slides to SlideShare but there is little content on them. They are mostly pictures, but they will help me stay on track during the talk.

April 27, 2010

Since moving into our house last year, we have always had some sort of recycling strategy. We recycle the most common items, like cans and bottles. One thing that we always have around are plastic grocery sacks. These are unavoidable, and can quickly pile up if you don't use reusable mesh grocery bags.

Trying to recycle these sacks is tricky, because normal recycling centers do not accept them. Recently, I have noticed that Walmart does accept plastic bags for recycling. As far as I know, that is the only item that Walmart accepts for recycling (tires and automotive batteries maybe, but that is a given).

When I went into the store earlier this evening, I found it odd that they prominently displayed the crate to recycle plastic bags. Why would they accept only plastic bags? Why not cans and plastic bottles? I formulated the following theory about why they accept plastic bags for recycling while waiting 15 minutes as the cashier rang me up. It might not seem like a long time, but he started at 10:40 pm and I left the store at five til 11.

Walmart accepts plastic bags for recycling because that is the only realistic option for them to sack groceries. Walmart check lanes are operated by one cashier and no baggers. That means that a cashier checking out a cartload of groceries needs to sack all of them. It is only efficient when using plastic sacks on the turntable. Give the cashier a bag of mesh sacks and prepare to wait.

This begs the question - why would Walmart allow people to bring their own grocery sacks? It takes the cashier nearly triple the amount of time to sack groceries in reusable sacks. They are making more work for the customer by strongly encouraging the use of plastic sacks, hoping that the customer will remember to bring them back.

When given that much time to reflect, it is easy to come up with an explanation of why things are the way they are. It is loads cheaper to have cashiers sack groceries, so Walmart has made it incredibly efficient for the use of one process (using plastic bags) and nearly impossible for another process (bringing reusable mesh bags).

April 21, 2010

Something that I have thoroughly enjoyed when working more with C# and .NET has been data access with LINQ to SQL. It is a nice mix between using an ORM and making direct changes to a database. One issue remains with using LINQ to SQL is handling the database connection properly. I was recently told to wrap data access code in a using statement for better performance.

The using statement guarantees that resources are properly disposed of after their use. This eliminates the need to remember to close database connections and will dispose of objects wrapped in the statement as soon as they leave scope. Even though the .NET Framework has built in memory management, there is still time between when the objects are no longer needed and when their unneeded memory is released to the rest of the program.

April 19, 2010

A Windows Service is a program that runs in the background of any Windows installation. These are similar to Daemon processes in Unix. The programs are designed not to have any user interaction and be long running.

The project I am working on right now uses a Windows service to broadcast webcam video over the internet, emulating an IP Camera. Using laptops, webcams and a Window service allows a client application to view webcam video from multiple sources at the same time.

Developing the Service Application

This is not the focus of the post, but it is important to recognize where Windows services are built. Windows services are available as a project template in Visual Studio 2008. The screenshot below shows the Window Service project type.

Windows services cannot be run and debugged like any other .NET project. The project did not require extensive testing, but more information would be needed if the Windows service needed to be tested before deployment.

Installing the Service

To install the service, use a command line tool called "installutil.exe." There should be an executable in the "C:\Windows\System32" directory. If it is not there, make a copy of it from another location and paste it into the System32 directory.

Run the command prompt as an administrator and the shell will open in the System32 directory. The following command installs a Windows service from the command line:

installutil "C:\path\to\the\service\executable"

Make sure that the path to the executable is memorable to make things less confusing when uninstalling. To uninstall the service, use the same command but insert a /uninstall between installutil and the path.

To start the service, type the following into the command window:

net start ServiceName

ServiceName is the name of the service in Visual Studio. Do not confuse the path to the executable with the ServiceName. To stop the service, use the same command as above with stop instead of start.

The newly started service should be in the list of locally running services. Navigate to Control Panel\System and Maintenance\Administrative Tools\Services to see the list of running services. Services can also be started and stopped with this interface.

April 18, 2010

In a previous post, I detailed how simple it was to list the files in a directory and access other file information. One piece of information that is not directly apparent in the FileInfo Object is file size. I was initially looking for a size attribute, but file size is handled by the length attribute. So calling .Length on a FileInfo object will return the size of the file in bytes.

Dividing that length by a power of two will give the file size in a appropriate format. The example below is the listing of the sizes of files in a directory in gigabytes.

onefile.Length returns the size of the file in bytes, so dividing by 1073741824 will give the size of the file in gigabytes. Wrapping the division in Math.Round truncates the length to 3 decimal places.

I used this quick table to lookup the powers of two factors for Kilobytes (1024), Megabytes (1,048,576), Gigabytes (1,073,741,824) and Terabytes(1,099,511,627,776.)

A portion of my senior design project is a media center component, so I needed an easy way to check the contents of multiple directories. From there, I compare the contents with a database that contains more information about the files.

Retrieving the contents of a directory in C# is very easy, and the code is included below.

The DirectoryInfo object points at a directory on the system. From here, the program has access to create and delete other directories, list directories and files, and view last accessed time information. GetFiles() returns an array of FileInfo objects, and from there, the program has access to information about each file in the directory.

April 17, 2010

I wanted to build a simple bench for the front porch of my house. Brett (@belahm) talked me out of making a backrest for the bench to keep things simple. Also, I wanted to keep costs down as much as possible, so I used recycled wood from Nebraska Ecostores, with very good results. The bench did need a few bolts and a box of screws, so after a quick trip to Menard's I had everything I needed to get to work.

The most notable part of this bench was its microscopic cost. The wood cost around $6 for eight weathered 2 x 4s - not bad at all. Throw in a few dollars for screws and bolts and the entire project cost me under $10. The bench was a very easy build - the steps are below.

Legs

The legs took a bit of thought, but after looking at a few different options, I went with angled legs and bolted them together in the middle.

Cut 4 boards to 2' long segments.

Mark a line 2" from each end of each board. Draw a line between the corner of the board and the corner that is made with the edge of the board and the line. Shown in the first picture below.

Cut the boards along the lines so the ends are parallel with each other.

Lay the boards down in an "X" against a flat edge. Press a board against the other ends of the legs. Make sure all ends of the legs are flush and straight. Shown in the second picture below.

Drill a hole through the intersection of the two legs. Since I am using 3/8" bolts, I used a 3/8" bit. Be sure to drill through the first leg and start on the second leg. You can finish the second leg separately.

Bolt the two legs together. Tighten the bolt making sure that the legs are flat on the ground. Be sure to use washers with the bolts (I forgot). Shown in the third picture below.

Bench Top

Simplicity is key here. Based on the span of the legs, the top of the bench may need to grow or shrink by a board or too. Steps to build the top are described below.

Cut 5 boards (4 for the top and one for a lip to cover the front) to 3'6".

Lay 4 boards down side by side to form the top. Square them against a straight edge. Lay the sides for the top face down on the floor.

Cut 3 boards to 14". These will be used to hold the top together.

Lay the 3 boards equidistant from each other across the 4 boards.

Put a screw into each board on each cross board (12 screws total)

Bench Assembly

This was the trickiest part of the whole process. Try to get as many screws into the legs without going through the top.

Keep the top of the bench face down on the floor and place the legs on each end of the bench.

Drive 4 screws (one in each leg) at on angle so they go through the leg and into the top of the bench.

Drill 2 more screws (one on each side) through the inner leg on each side into the cross boards. The underside of the bench in shown in the image below. The legs are flush with the top supports. Drilling into this will provide more stability.

Add a support beam between each set of legs. Drilling from the outside of the legs into the beam will provide a lot of stability.

Add a quick piece of trim to the front of the bench to hide the supports. The trim is on the right side of the bench in the image below.

Enjoy the finished product!

That completes the very simple bench. Flip it over and take it for a test sit. It is a very sturdy bench that supports over 500 lbs. Pictures of the finished product are shown below. It's a great addition to our front porch.

April 14, 2010

I recently overheard a Ted Talk that piqued my future thinking curiosity, so I decided to check it out. Kirk Citron: And Now, the Real News (embedded below) was a very brief snippet (less than 3 minutes) that presented the question: What news is really going to matter in the future?

Kirk details looking in the long run (50 to 100 years) and observes that the top news stories from the last year will not matter in the long run. There is a different news filter that one has to apply to find the news that will matter in 50 years. Any stories related to:

Science and Technology,

Natural Resources,

Expansion (particularly China), and

New Discoveries.

He gave examples that were very intriguing, like without genetically enhanced crops, Great Britain will starve to death. He noted that the discovery of water on the moon will make it easier for someone (could be NASA, could not be) to build a colony there. Kirk's point - in the long run, some news stories are more important than others.

Here is the very brief Ted Talk:

For more information on the subject - check out long news, there are some pretty interesting articles.

April 13, 2010

Jamie Oliver's Ted Talk about educating kids about food goes along with his current TV series Jamie Oliver's Food Revolution. The talk and the show both focus on obesity problems facing young Americans. I had heard of the show (but not watched it) before listening to the talk, so I will have to check it out this week (Wednesday night on ABC).

The talk starts off with an interesting statistics about causes of death in America. Four of the top six categories are diet related. Diseases like heart disease and diabetes. Another interesting statistic from the talk was that obesity costs Americans $150 Billion per year. That is 10% of the nation's healthcare bill.

Oliver observes that the evolution of the food culture in America has been warped and distorted. He details problems with food at home, food from the grocery store and school food. Oliver even goes as far to say that society should be guilty of child abuse because the high amount of sugar in school lunches.

The talk did have some great take aways. Oliver proposed that every supermarket in America should have a food ambassador. Someone to show people what to buy and how to cook it. Something like this would create thousands of jobs across the country. The life skills takeaway for kids in school is also a great point. Children would learn to cook 10 recipes that would save their life.

What I was waiting for Oliver to address in the talk never came. I wanted him to explain why eating healthy is so expensive? I try to eat as healthy as possible, but it is hard when a green pepper costs $1.28. Healthy food is much more expensive than processed food, and many people cannot afford to spend hundreds of dollars a week on fruits and vegetables. There was no mention of the raw cost of healthy groceries compared to unhealthy, processed groceries.

April 9, 2010

Chapter 7 of Crush It stood out to me as being a very meaningful chapter. Hence the chapter name, "keep it real ... very real." This is the gut check chapter of the book. I would wager that people reading this book would be completely optimistic to quit their jobs and start making their living online - until this chapter.

Gary bursts everyone's bubble that Crushing It will not be a half-time, pajama type job. To accomplish any kind of success through the methods mentioned in the book, your new boss (yourself) has to be a slave driver. That is what differentiates yourself from the rest of the competition. That is why there is not 1000s of Gary Vaynerchuks running around.

He mentions a specific point in the chapter that I can relate to - Investing in the important stuff. He gave a great example of investing in the important stuff with the scenario of someone asking him what kind of equipment he uses to record his videos? His response - "Does this really matter?" Why would someone even worry about that.

It is like learning to golf. $1200 clubs are not required for a novice golfer. A novice golfer cannot feel the difference between those and a $200 set. Grab the $200 dollar set and get to work. When a golfer can make the ball sit, stay, rollover, and play dead with the $200 dollar set, then it might be time to upgrade the gear.

The Netflix OData Catalog API was announced during the second keynote of Mix10 earlier this year. This announcement also meant that the live preview of the service was now publicly available. This means that all of the movie information built into the Netflix site (movies, actors, genres, release dates, etc.) is now available through an easy to consume service.

I have a very, very unorganized movie collection, and have been trying to write a system to keep track of what I have and where I have it stored. Whenever I tried to write it I always had to stop myself because I could not get the right amount of information about the movies. I even went has far as scraping the information box on movie pages from Wikipedia. This was promising, but I stopped working on the system after a few days.

Now, armed with the NetFlix Catalog API, I can finally get the right amount of information into my system to make it fun and useful. This is a quick demo of how to get information from the NetFlix Catalog Service.

To get going with the NetFlix Catalog API, whip open a new .NET MVC2 Visual Studio Project and get to work.

To access the Catalog API, a Web Reference will need to be added to the project. Right click the project then Add a Service Reference. Complete the dialog box like the picture below:

Once the Service reference is added to the project, we can access the NetFlix Catalog data.

Please note that this code will not run without adding a reference to a WindowsBase dll. Mine was at C:\Windows\winsxs\msil_windowsbase_31bf3856ad364e35_6.0.6000.16708_none _9540b0033275cea4\WindowsBase.dll

Use the service to build a linq query, then load that query into a DataServicesCollection object. Use the following code to display it on a page. Apologies in advance for the terrible way of doing a numbered list.

April 7, 2010

Brett (@belahm) created the DonateLincoln! guidebook for non-profit organizations in the Lincoln and Lancaster County area. It is meant to make the process of selection and donating to a local charitable organization easier.

Check out DonateLincoln! to download an electronic copy of the guidebook.

We had originally planned to have a full organization listing on the DonateLincoln! website, but we needed to get something out there this week. In the future, we will be adding:

A complete listing with links to organization websites

Social features to allow for commenting on organizations

Facebook tie-ins to share comments with Facebook friends

You can request a hard copy of the guidebook by e-mailing donatelincoln@gmail.com. Gorgeous full color printing was provided by Jacob North Printing - check out their newly redesigned website, it is definitely worth the trip.

April 5, 2010

Kyle Deterding (@deterding) dropped by the house last week to film a very short video on how to work a booth at a trade show. This video is meant to be as brief as possible, and provide a lead in to a discussion about working a booth at a trade show. The four principles that Kyle details in the video are:

Stand in front of your booth - Standing behind a booth can be intimidating.

Never leave your booth unattended - If you are at the show, you better be working the booth.

Read people - Tailor what you are saying to your audience.

Build a crowd - People are more likely to approach a booth if someone else is there.

This is not a very comprehensive or informative list, but it does get you thinking about working a booth. On top of what Kyle mentions in the video, I would make the general suggestion to stay calm and speak slowly.

Please pardon the poor video production quality - last week was a long one.

In Six Pixels of Separation, Mitch Joel outlines several themes to create a winning online strategy. Early on in the book, Joel goes into detail about the difference between Viral Marketing and Viral Expansion Loops. This difference requires the reader to understand the "how" behind wildly successful online marketing.

We all know what Viral Marketing is - hilariously explained by Wondertonic. The goal of viral marketing is to create spontaneous word of mouth advertising (we all have our own definition, I pulled mine from Wikipedia).

Viral Expansion Loops take viral marketing one step further, because they routinely replicate the effects of viral marketing. It is sustained viral marketing. The viral expansion loop is when a human participates in something that cannot, in itself, be sustained without participants. For example, trading Beanie Babies in the late 90s is a viral expansion loop. People were trading toys that could be bought for $5 and resold for hundreds. There was no hard value there (they were not made of gold) but the popularity of the toy created a viral expansion loop. People buying the toys then trading them would complete the loop.

A more realistic example of a viral expansion loop is the social network. Joel mentions Ning, a software company that allows users to create their own social networks. The value created in a social network is the participation of more users sharing their ideas. This draws more users in and completes a revolution of the loop. The added users will bring more ideas to the social network, which opens up the possibility for even more users to join.

The viral expansion loop is a powerful thing. It is principle behind the rapid growth of content on the internet.

I recently read Six Pixels of Separation by Mitch Joel for my Raikes School Design Studio Discussion group (Check out the Raikes School!). Joel is the President of Twist image, a digital marketing agency, and the writer of the Six Pixels of Separation Blog. The book and the blog present insights on how to reach customers on the global level through online strategies.

His blog is updated regularly with well-written posts around 500 words. The posts tie back to several of his main themes which he details in his book. A few examples of his themes are Engaging your Online Community and the concept of Digital Darwinism, where businesses have to evolve their online strategies to keep users coming back for more. He also has a podcast with nearly 200 episodes and does speaking events.

Six Pixels was Joel's first book, and I feel that it was missing some polish. The book is quite long, weighing in at 287 pages. Reading it in two separate sessions (I normally try to read cover to cover) confused me about the point he was trying to get across. The book does not have a main theme to communicate to the user, it has many. This makes trying to keep track of all of them difficult, especially when the book is so long. Each chapter has a central theme that it communicates with backing examples, but the chapters do not flow together as well as they could.

I would add a "how to read this book" section in the beginning of the book. Reading it cover to cover does not make sense, but reading it a chapter at a time does. I think the book would work better as an online strategy reference book than as a normal book. I feel this way because of the abundance of content presented in the book. It could be split into multiple books, with more supporting (and non-supporting evidence) to make the topics more realistic.

The content of the book is great though - I will be going into detail on that in a few future posts. I would recommend this book to anyone who is marketing online, but remember that it is not a silver bullet. Only Silver bullets are silver bullets.

April 2, 2010

I recently buzzed through Gary Vaynerchuk's 2009 book, Crush It. The book covers a wide array of topics related to social media, and how you can quit your job right now and start doing what you love for a living. I was quite skeptical when I sat down to read the book but I slowly warmed up to it and was able to see some key ideas that he meant to convey in the book.

For those that have not heard, Gary is a co-owner of his family's wine retail shop in New Jersey and the host of the Wine Library TV webcast.

The book goes into detail about Gary's childhood, which is the most entertaining part of the book. He recounts stories of the seven-year old Gary hustling lemonade stands around his neighborhood at age 7. He talks about his passion for baseball cards and how his business education comes from card shows. This is where I was really drawn into the book - the story of where he is coming from sets the tone for the rest of the book.

He is really practicing what he preaches before he even mentions it in the book, and that is to tell a story. I was sold to read the rest of the book after hearing the entertaining story about how he lost all his money at a Baseball card show when he was a teenager. Quoted directly from the text - "Storytelling is by far the most underrated skill in business."

Being able to tell a story will leave a customer with a positive attitude. It might even be so positive that they will come back and do business with you again. They might tell their friends.

Storytelling does not have to happen in person, and that is a theme in the various means of connecting to customers that are described later in the book. Gary mentions that providing content (Blog, Tweet, Podcast, etc.) should be telling a great story. This is a convincing reason as to why Woot is so popular. They could just be a shopping site that only sells one item per day. But they are so much more than that - they are a blog that personifies the items that they are selling. They have other posts that are games that the Woot team likes, or interesting headlines with one-liners mixed in.

That is why I continue to check Woot. I like the stories that they are telling. It is entertaining and is a great way for the company to draw my business in.

If you do have a few hours on your hands and are looking for some light reading material, do check out Gary's book. Definitely check it out if you are a fan of social media.