July 26, 2010

Rework from 37signals


Rework is the recent page turner by Jason Fried and David Heinemeier Hansson, the co-founders of 37signals. The book is 288 pages, but every other page is either a drawing (not a diagram, a drawing) or a blank page. This made the book read exceptionally fast. Check out the excerpts or the trailers.

My initial reaction to the book was positive. I am a fan of their other book, Getting Real, a series of essays on software development. Rework had a much more broad appeal than Getting Real. It is 37signals’ fresh take on business and their unique philosophy on starting, running and growing businesses.

I respect the fact that the authors take an opinion in the book. I did not agree with everything in the book, but having an opinion and offering evidence to why that opinion is right is something to be applauded. Initially, I was taken aback by their approach, but have grown to like their upfront style of writing.

One of passages from the book that I enjoyed was their explanation of the real world. People immediately assume that new ideas will never succeed in the real world. Things like scalability and user adoption are common arguments to why the real world will crush your dream. Rework makes the counter argument that you don’t have to live in the real world. The real world problems are just that, problems. Waiting for solutions.

The book is full of interesting observations. Like the prison weapon approach, where prisoners are able to craft weapons out of virtually nothing. Just like taking an idea and turning it into a business out of thin air. Another idea in the book is Hero Mode, where an employee grinds on a task for hours until they reach hero mode and solve the problem. Everyone is guilty of overdoing a task. Most of the time, that 4 hour task can be solved in 20 minutes with outside input or taking a different approach.

Definitley read the book. It will only take a few hours, and they will be very thought provoking. I read the book as a result of a book sharing idea from this blog’s really cool post. Check them out.

June 23, 2010

Disable Current Line Highlighting in Visual Studio 2010

After installing the Visual Studio 2010 Pro Power Tools, Current Line Highlighting is enabled. This is alright for some, but it causes frustration when trying to view parenthesis, bracket and brace boundaries. Below is a screenshot of a program with the current line highlighting turned on.

To disable current line highlighting, Navigate to Tools -> Options. In the options dialog box, expand the environment section and click on the Fonts and Colors subsection. The screen contains a list of different types of text in Visual Studio and their associated formatting. Find the Current Line (Extension) Item and change the Item Background from Default to White. This will make the background of the Current Line White.

May 18, 2010

Food Roundup, Spring 2010

Because of IgniteLincoln, Spring was a very busy season for cooking. My lightning talk for the event described my passion for cooking, and the observations that I made over the month leading up to the talk. Video from the event will be posted soon.

I included a lot of food pictures in the slideshow for the event and had even more to share on Flickr. Most of the food in the pictures is Italian (the best food to cook), but there are a few different dishes, like Fish Tacos and Turkey Skewers.
Here is the link to the Spring Food Roundup - http://www.flickr.com/photos/njebert/sets/72157624084916842/

30/30 Recap - Congratulations Nate

Big props out to Nate(@natelowry) for completing the 30/30 April challenge. He has covered a wealth of different (and entertaining) topics like: What he has been reading, his work, and his music. This is the second year that Nate has dominated the 30/30 April challenge. Great work!

I failed the challenge yet again this year. It was a rough second half of the month, but I am glad I attempted the 30/30 April this year.

April 28, 2010

Weekly Meal Planning

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.

Check out all of Lobotome's stationary, it's pretty cool - http://www.lobotome.com/pages/notepads.html

Famous people have strange work habits

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 book series 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 - April 29th, 2010

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.

Nate (@natelowry) and myself will be speaking in the event this year. Also speaking are Tom Casady, Jay Wilkinson and Mark Kornbluh to name a few. There are 16 speakers, all of which have very different topics which promise to be intriguing.

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.
If you are free on Thursday night (and in Lincoln) check out Ignite Lincoln. Don't boo me too hard, because I am not used to getting heckled during presentations.

Check out Ignite Lincoln for more information about the free tickets - http://ignitelincoln.org/tickets.php.

Also, remember to checkout the site after Thursday night. I am sure that video will be uploaded after the event.

April 27, 2010

Why Walmart is the only place that will recycle plastic bags

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

The using Statement - C#

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.

The following is an example of data access using the using statement:
using(_ctx = new SampleDBDataContext()){

var mainQuery = (from c in _ctx.GetTable<SampleTable>()
where c.isMain == true select c);
...
}
The using statement defines the scope of _ctx. So as soon as the database operations are complete, _ctx is trashed.

Here is a more in-depth writeup of using using with data access - http://www.w3enterprises.com/articles/using.aspx

April 19, 2010

Installing Windows Services

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

Determining File Size - C#

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.
DirectoryInfo directory = new DirectoryInfo("F:/Media/Movies");
FileInfo[] files = directory.GetFiles();
foreach (FileInfo onefile in files){
Console.WriteLine(onefile.Name + ", length: " +
Math.Round((onefile.Length / 1073741824f),3) + " GB");
}
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.)

Original size conversion found here - http://dotnetperls.com/convert-bytes-megabytes

Listing Files in a Directory - C#

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.
DirectoryInfo directory = new DirectoryInfo("C:/some/directory");
FileInfo[] files = directory.GetFiles();
foreach (FileInfo onefile in files){
Console.WriteLine(onefile.Name);
}
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

Very Simple Recycled Wood Bench

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.
  1. Cut 4 boards to 2' long segments.
  2. 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.
  3. Cut the boards along the lines so the ends are parallel with each other.
  4. 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.
  5. 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.
  6. 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.
  1. Cut 5 boards (4 for the top and one for a lip to cover the front) to 3'6".
  2. 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.
  3. Cut 3 boards to 14". These will be used to hold the top together.
  4. Lay the 3 boards equidistant from each other across the 4 boards.
  5. 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.
  1. Keep the top of the bench face down on the floor and place the legs on each end of the bench.
  2. Drive 4 screws (one in each leg) at on angle so they go through the leg and into the top of the bench.
  3. 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.
  4. 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.
  5. 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

Kirk Citron - News That Will Matter

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 - Teach Every Child About Food

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.

The talk is embedded below - give it a listen:

April 9, 2010

Crush It - Keeping It Real

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.

OData and the NetFlix Catalog API

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.

Quick sidebar - If you are using .NET 3.5 SP1, you may need to download an update here - http://www.microsoft.com/downloads/details.aspx?displaylang=en&FamilyID=4b710b89-8576-46cf-a4bf-331a9306d555. The DataServiceCollection is not included as a part of System.Data.Services.Client, but the update fixes this.

From here, you can access the NetFlix Catalog in Visual Studio. Define an instance of a NetflixCatalog service as shown below.

        public ActionResult Index()
{
NetflixCatalog _nfCat = new NetflixCatalog(new Uri("http://odata.netflix.com/Catalog/"));
DataServiceCollection<Title> _titles = new DataServiceCollection<Title>();
var query = (from t in _nfCat.Titles where t.ReleaseYear < 1950
orderby t.ReleaseYear select t).Take(50);
try
{
_titles.Load(query);
}
catch (InvalidOperationException excep)
{
Console.WriteLine(excep.Message);
}
var titles = _titles.ToList();
return View("Index",titles);
}


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.

    <p>
This page will display the 20 earliest movies entered into the Netflix Catalog (Ordered by Movie Title)</p>
<h2>
Titles:</h2>
<ul>
<%int count = 1; foreach (var title in (IEnumerable<NFCatalog.NetFlixService.Title>)Model)
{ %>
<li>
<%=count %>. <%= title.Name%>, <%= title.ReleaseYear%></li>
<%count = count + 1;
}; %>
</ul>

The final page is displayed like this:


April 7, 2010

DonateLincoln!

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

Work a Booth like a Pro

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.

Six Pixels of Separation - Viral Marketing vs. Viral Expansion Loops

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.