CurtBlog

My blog saw something.

25. May 2012 08:44
by skills0
0 Comments

Windows 8 Metro Javascript apps–Initial Thoughts

25. May 2012 08:44 by skills0 | 0 Comments

(This is a cross-post of a recent post I did for Clarity’s blogs).

For the past couple of weeks I’ve had a chance to take a closer look at the process of building Metro-style apps for Windows 8.  Since I have a long background in web development, I was curious about using the HTML/Javascript approach.  I was curious how much of my existing skillset I would be able to leverage.

I suppose it’s a bit hard to tell, since there is still a whole lot of new stuff to figure out.  It’s both easier and harder than I expected.

CSS Experience: If you already are proficient with CSS, it will certainly serve you fairly well when writing Metro-style apps.  I find CSS styling much more intuitive than trying to style things in a XAML environment, but then again I’ve been doing it for years.  The tools now make it very easy to see exactly what styles are being applied at different spots in the DOM.

On the other hand, the new proprietary “ms-grid” system that Microsoft wants you to use is a whole new thing to learn.  I’m not sure it improves much.  Feels like to me they are trying to take the WPF Gridview concept and apply it to a web layout.  I get that the point is to help keep you on a design grid to have a proper Metro appearance, but it’s not that intuitive for someone used to standard CSS.

Html Experience: You’ll have few issues making the leap to using Html to design a Metro-style app, but there are some quirky things. Right about the time we finally have Microsoft tools that support good semantic markup, we are back to a mismash of proprietary tags and Microsoft-only controls littering up the design. While HTML 5 is much more forgiving of this and even partially codifies it (I’m thinking of data binding syntax attributes for instance), it still feels messy. You also need to get familiar with the specific layout and design guidelines for Metro and understand how elements like the AppBar, Settings or buttons in general should look.  There are also specific recommendations for typography, margins for certain elements and so on.

Design Experience: I’m not a fan of this at all. In the Visual Studio 11 preview, you really have no visual layout tools at all, not even a preview.  While the purist in me who loves to handcraft html from scratch doesn’t mind this too much, it’s not a great developer experience.  The intention is you will open the solution in Blend and do your design and style definition work there. I guess if you already know Blend, this will feel natural. There is certainly some nice tooling there for design. But for me it’s definitely an awkward flow to bounce back and forth between the two environments. Not sure I would work that way.

What I ended up doing is making changes and refreshing the app in the simulator to see the result. This isn’t a good developer experience either.

Javascript Experience: This is where it really depends what kind of javascript developer you are. If you are already familiar with ideas like using namespaces to keep things out of global scope, modules, “classes”, promises and other more modern javascript design principles, you’ll be fine. (If you aren’t, check out some of the great posts over on Jacob Gable’s blog).  If you’ve worked a lot with third party libraries like jQuery or Knockout.js, you’ll understand many of the design decisions, but lament that you aren’t using those libraries.  The good news is you still can to a large degree, but you have to make them play nice with Microsoft’s event wire-up and app lifecycle patterns.

I found it a bit frustrating trying to figure out the WinJS way to do things to be honest. Doesn’t seem as elegant as jQuery.  The databinding uses mostly proprietary controls in the WinJS.UI namespace rather than existing HTML elements like Knockout.js.  This bugs me because it really isn’t necessary.  For instance, unless I’m missing something I can’t bind directly to a select element for a simple dropdown list.  I basically had to loop through my data and add option elements to the DOM.  This works fine, but REALLY?  That’s going to frustrate HTML developers.  Good news is you can fly in Knockout.js and use that type of binding instead, at least based on this post. Haven’t tried it yet, but it’s on my list.

You’ll also need to get really familiar with Promises, which is the javascript way of doing async programming.  If you look at Metro examples using XAML/C#, you’ll see most of the operation calls are using the new await syntax.  This is the javascript equivalent. It’s a pretty powerful programming model and not too hard to use once you wrap your head around it.  I found Mike Taulty’s series of posts to be very helpful.  In general his blog has a lot of good examples.

Data Experience: There isn’t one. Ok, I’m being overly dramatic, but certainly there’s not much of a local data story. I guess the idea is you’ll get everything from the cloud. That’s all well and good and certainly many applications are already moving that way. But once again it seems like right about the time we get cool small local database options like Sql Server Compact we can’t use them.

I needed a little data for a sample app I’m playing around with, so I ended up using WCF Data Services. This works fine except trying to get one of those services to output JSON is not as easy as it should be. Guess I probably should’ve used the new Web APIs and maybe I will play around with that option.  Short answer is you can use this behavior class with the long name (JSONP and URL-controlled format support for ADO.NET Data Services).  And that ends up being pretty easy to use, other than the weird JSON format that wraps everything in an extra “d” structure.  That’s a WCF data service thing, not sure what the point is. The good news is that if you already have an Entity Framework context, it’s pretty trivial to create a WCF Data Service from it. I didn’t care about doing anything fancy with security and I just needed read-only, so it was very quick to get up and running. I also don’t need anything too fancy from an OData query standpoint, but I could see that changing in a real-world application.

To sum up, if you are already a seasoned web developer, it’s definitely worth going the HTML/Javascript route for building Metro apps. Just don’t expect to jump right in.  There is definitely a learning curve.  I haven’t even gotten started on the Windows 8 specific concepts you’ll need to understand or the new WinRT way of doing certain things. Certainly you won’t be starting from scratch if you already know XAML/C# or you already know HTML/Javascript/CSS.  But this is certainly a whole new paradigm for building apps on the Windows platform, at least in certain key ways.  Best to start playing around now.

6. March 2012 12:37
by skills0
0 Comments

Announcing our new “Hatching A Plot” blog

6. March 2012 12:37 by skills0 | 0 Comments

Ever since we moved to Vermont, I’ve been a little better about keeping this blog updated.  It seems like most posts have to do with all the reasons we moved to Vermont.  This includes having more room and eventually land to do the things we want, including more gardening, having animals and just having more capacity to grow our own food.

I think blogs work best when they have a theme.  When I first started blogging, it was fine to be all over the map and that still works if you are a celebrity/super interesting person.  But most blogs I read regularly now have some sort of focus, whether it be farming, sustainability, a technical topic, movies or theology.  I like this because I generally know if I go to that blog, I’ll find something of interest on that topic.  And if occasionally a post isn’t on that topic, it’s usually something else interesting that the blogger is into and I don’t mind.

With all that said, I’ve decided to set up a new blog specifically focused on all the things we are trying to learn in Vermont.  Some of these are a continuation of hobbies we already had, such as home-brewing, gardening, cooking and fiber arts.  Some things are new, such as my first attempts at charcuterie, having a much larger garden to experiment in or learning from other farmers.

The new blog is called Hatching A Plot and I hope you’ll come check it out and subscribe to the RSS feed if that’s your thing.  I’ll pop some links up on Twitter and Facebook as well when I post, if you prefer to check it out that way.  It’s still a little rough around the edges, but close enough I wanted to start telling people about it.

The name Hatching A Plot takes a phrase everyone knows, but puts a new spin on it. We like the idea of “hatching” since we want to raise chickens and of course plot can refer to a garden or land used for all sorts of things. There is also the idea of figuring things out, of being a lifelong student and taking small steps each day in the purpose of a larger goal.

I hope to get Kristin to post occasionally too. She is still doing a lot of bread baking, experimenting with fermenting things (sauerkraut, kimchi, beverages) and trying to figure out some of the fiber arts.

We hope you’ll come along and follow us on our journey as we try to figure out this crazy life change we are on.  And be sure to tell anyone else you think might find it interesting.

25. February 2012 10:55
by skills0
0 Comments

First attempt at making sausage

25. February 2012 10:55 by skills0 | 0 Comments

I’ve been wanting to start learning how to make charcuterie (sausage, cured/smoked meats, bacon, etc.) as part of our overall trek towards growing and creating as much of our own food as possible.  We also may raise our own hogs at some point.  I got the Michael Ruhlman Charcuterie: The Craft of Salting, Smoking, and Curing book for Christmas and have been going through that for ideas.  I also bought Home Sausage Making: How-To Techniques for Making and Enjoying 100 Sausages at Home which is interesting for the sheer volume of ideas. Although vegetarian sausage?  I don’t think so, at least not for me.

I’ve been talking to a couple local pastured pork farmers about getting the raw materials.  The other night I took a trip over to Maple Wind Farm, about 20 minutes from here.  I picked up a whole pork belly that was just beautiful, a little over 8 lbs. and nice and thick.  Also grabbed two smaller pork shoulder roasts, which are really nice for making sausage.  The fat content is about 30% naturally, particularly when you buy heritage pastured breeds, which is perfect for sausage.  They had just gotten some lamb back from the butcher, so I got some of that as well.  Certainly more expensive than super market meat, but for good reason.  Better breeds, better feed, better living conditions and a lot more care goes into the animal husbandry.  It’s money well spent to me, both to know exactly what I’m getting and the quality of the meat.  If you are going to go to the trouble of making your own charcuterie, you want the highest quality meat you can get because the end result is only as good as the raw materials.

I made my first batch of about 3 lbs. of sausage last weekend, using the basic breakfast sausage recipe from the “Charcuterie” book.  It’s an interesting recipe, full of lots of fresh ginger, sage and garlic. You end up with a very clean tasting sausage, full of lively flavors.  I’m not sure I want it all the time as I like a spicier, more peppery sausage most of the time, but it turned out to be quite tasty.

Here are some pictures of the process.

P1000898

A few years ago we found an antique meat/food grinder in New Glarus, WI.  I think it is World War II era as the instructions mention a certain part is not available during the war (I guess due to metal rationing).  Kinda cool. One reason I bought it was the possibility of making sausage, plus I really love old kitchen tools. Particularly ones that don’t require electric.

P1000899

Everything you use has to be super cold, including the grinder if possible.

P1000902

The grinder set up and ready to go. You grind into a bowl or tray that is set in ice.  Once again, think cold, cold, cold.

P1000903

The season mixture, cubed and ready to grind.  This has been in the freezer as well until starting to get a bit icy, but not frozen.

P1000905

The primary bind, where you add just a bit of ice water to bring it all together.  As you can see, the grinder didn’t do a terribly fine grind.  I was a bit worried about this, but it came together just fine. A bit smaller would be nice, but this works.

P1000904

Quality control. It’s good to fry up a taster portion just to make sure the spices are where you want them.  You can still add a bit more spice or other ingredients at this point.

So now that I understand the basic process a little bit, the next step is to try stuffing the sausage into casings and try some other recipes.  There is a chicken sausage recipe that looks awfully good…

26. January 2012 08:52
by skills0
0 Comments

Google custom search for seeds

26. January 2012 08:52 by skills0 | 0 Comments

When we looked at buying seeds this year, we had a bunch of catalogs and seed companies to choose from.  It would be really great to be able to quickly determine who has what variety, the cost and whether it is still in stock.  Certain popular seeds tend to sell out quickly.

When I started looking into this, it seems like a task that would be difficult to accomplish without some direct assistance and interaction from the seed companies.  And I’m not sure they would be that interested.  I still think there might be a way to do this with some sort of screen scraping app, but it would take some doing.  And it might not make the seed companies happy, even though my goal is to support those who are selling organic and open-pollinated seeds. 

Still might be a fun project to try.  The problem is not everyone uses a distinctive enough url structure to make this easy.  It’s also not trivial to compare prices, since some companies sell by the number, some by the ounce and it also depends how large a quantity you are buying.  If you could find the price, I guess you could just display it.

In the meantime I created a Google custom search that searches all of my favorite companies.  I tried to filter down the urls to be as specific as possible (e.g. use the item detail page, not every url in the site). You can do this with some of the sites, but not all.  Makes me wish everyone was using MVC/friendly urls.  Mother Earth News already has a custom search like this, but it’s hidden in their site and they search several hundred companies.  So the signal to noise is pretty bad if you ask me.

You can check out mine and see if it’s helpful.  I will likely add some additional companies into the mix, but trying to keep it a bit more curated.

19. January 2012 08:39
by skills0
0 Comments

Review: Diane Ott Whealy - Gathering: Memoir of a Seed Saver

19. January 2012 08:39 by skills0 | 0 Comments

Article first published as Book Review: Gathering: Memoir of a Seed Saver by Diane Ott Whealy on Blogcritics.

First, a bit of background on the lens through which I read Gathering: Memoir of a Seed Saver. As a child, I spent a lot of time in the summer working in the garden and often could not wait to be done with it.

Fast forward a number of years, however, and I find myself interested again. The idea of growing your own food is a compelling one for many people, particularly in this age of economic uncertainty. I'm certainly very much in agreement with the goals of this organization and my review reflects that.

When my wife and I started researching various aspects of gardening and sustainability, some resources kept popping up in more than one book and one of them was Seed Savers Exchange. Seed Savers Exchange (SSE) is a non-profit organization with the mission of saving and sharing the richness of genetic and cultural diversity found in open-pollinated seed.

Today many of the seeds you find in the seed rack are hybrid types. But you can't save hybrid seed year after year; you must buy it again each time. This book is the memoir of Diane Ott Whealy, one half of the husband and wife team that brought SSE to life.

While it certainly helps if you are interested in the subject matter, there are aspects of this book that make it a compelling read for anyone interested in small business, entrepreneurship and the strength of the human spirit.

Diane and her husband Kent fought through many obstacles to bring Seed Savers to where it is today. Ms. Whealy is honest and forthcoming about the very real struggles that it took to develop the organization to where it is today.

When they were getting SSE off the ground, the idea of preserving genetic diversity and using sustainable gardening practices was going through a dark period. For hundreds of years, farmers had basically farmed organically, saving their best seed from year to year.

But starting in the early to mid 1900s, a new rush of "progress" pushed farmers to make production the primary goal, through the use of chemical fertilizers, unsustainable soil practices and the new hybrid seeds and later GMO seeds.

Open pollinated seeds must be regularly planted and saved or they can be lost forever. In addition, the diversity of seeds in catalogs for the home gardener was dwindling. Each year found more and more varieties unaccounted for and some seeds were only available from a single source. The Whealys recognized this as the problem it was and set about trying to do something about it, well before most people were thinking in these terms.

Scattered around the country, there were other individuals with the same dreams and goals. Seeds Savers provided a framework to bring these people together and work for the common good. They started in 1975 with only 29 gardeners exchanging and sharing seed. The tradition was started of a yearly meeting on the property, with like-minded folks coming from all over the country. By 1983, they had around 3500 different seed varieties in their collection, including 2000 different beans, 500 different peppers and 200 different squashes. For the most part, the business was run out of their home and there wasn't always money for a salary. Income came from the seed catalog they distributed each year.

Another struggle was finding the room to work and grow the business. The Whealys moved around several times before Seed Savers finally found the right property in Decorah Iowa. Eventually Kent Whealy won the MacArthur "Genius" grant in 1990 and there were some other grants along the way. These grants, along with growth in the business and help from other benefactors finally got SSE on stable footing.

Later the organization was also able to purchase an additional 700+ acre property of pasture and woods, giving them a large protected area to carry out their mission. But it was a long road to get there, years of laboring and putting everything back into the organization. This shows the perseverance that is often necessary to make your dreams come true.

This intense, sustained focus on the organization was not without its downsides. It took a toll on the Whealy's marriage, which ended in divorce in 2004. It is very difficult to pour your entire waking existence into a dream without some aspects of your life being neglected. This is food for thought for any entrepreneur. On the other hand it is often difficult to create something of good and lasting value without a lot of sacrifices along the way. Many people are grateful to the Diane and Kent Whealy for the lasting impact their life work has had and will continue to have on the sustainability and organic gardening movement.