Fun Friday: Links And Fun for 6/20/2014

Spring Chicken

Oh, Mama! Is that Daddy? Is he in jail? Are you fighting him? We are so confused.

Image from Library Of Congress

This week’s links are all about Microsoft programming tools and technology.

I’ve been heavily Linux, Node and Raspberry Pi for a while, so time for Microsoft links this week.

Async in ASP.NET MVC 4

Async Actions In ASP.NET MVC 4

This is from last year, but a good read. I’m planning a blog post this weekend to go into detail, but if
you aren’t programming ASP asynchronously, you can’t handle very much traffic.

If all goes well I’ll have stats and info outlining the problem and helping you avoid some pain. For now read this
article about how to write async actions.

Samples, Samples, Samples

Microsoft All-In-One Code Framework

All their samples are belong to us? Something like that.

If you need sample code on a wide range of topics, this site is a good place to look. Microsoft
posts samples of code to help with tasks developers have posted in MSDN forums and on social media.

I found this one thanks to Greg Duncan’s post
Thousands of code samples at your finger tips over at Channel 9.

Dependency Injection in ASP vNext

Dependency Injection in ASP.NET vNext

First what is dependency injection? Is it like Botox?

No, it is a technique for loosely coupling software so that you can swap one module for another as needed without
necessarily knowing at coding time which will be used.

Of Mice And Lego

If you think Lego bricks, it helps to understand DI (Dependency Injection).


With Lego bricks you could have red, blue and green bricks that each have 4 pegs.


If you are building and you need a brick with 4 pegs, it doesn’t matter which color you pick. They will all fit.


With DI, you write your code in such a way that you snap things together via interfaces.


Lets use pets as an example.


We have cats, dogs and snakes.


Each of these implements the “pet” interface. It needs to eat, it has eyes, and a name.


Cats and dogs also implement the “mammal” interface. They have four legs (among other traits).


Since they all implement “pet” and pets have names, we could write code that assigns names to pets.


We could make a factory object that takes in a pet interface and assigns a name to it.




Now we have code that depends on a factory to name our pets. The Injection part comes in because
we could have several different factories that all take in a “pet” and name it, but do so
in different ways. We need a mechanism to specify at runtime which factory to use.

One factory could look up a list of names from a database and pick one at random, while
another could just randomly put letters together to make gibberish names.

Our program depends on a factory that names pets, but it doesn’t need to know which
factory it will get. We inject that at runtime.

Get Real!

I know this sounds complicated, and more trouble than it’s worth, right? How about a real world example?


Here’s a good example. Unit testing a web app.


Let’s say we have a web app that uses our pet naming factory.


We want to write a test for our method that calls the factory. We’re not testing the factory here, we
have other tests for that. We just want to know that our code that gets a pet and hands it to the factory works.


Assuming our factory is the one that uses the database, do we really want to connect to the database
and pull back values when we run this test? What if we have 50,000 such tests to run?


With DI, we can make a factory that gets a pet and assigns the same name to each pet. Our test can
tell our code to run with the simple, non-database version of the factory. It injects the dependency (factory)
into our code. Our code doesn’t know if it’s getting a production factory or a test factory. It doesn’t
need to know.




Back To The Links!

Oh, yeah. Now that we know what DI is, we can appreciate that the new version of
ASP.NET called vNext will have a simple DI framework built in.


The link talks about how you can use it or plug in your favorite DI library.


Oh, and here’s the link again so you don’t have to scroll way back up there to
find it: Dependency Injection in ASP.NET vNext

IE Developer Channel

Internet Explorer Developer Channel


If you want to play with early or experimental bits for IE, this is the place for you.


The one that caught my eye was the ability to use an XBox 360 controller in a web game
written in JavaScript. That’s cool!

That’s it for this week.

Sorry I ran so long on the bit about Dependency Injection, but I felt the link would be meaningless to anyone
who didn’t know what DI is or why you might use it.

Have a great Friday and see you next week!

Fun Friday: Links And Fun for 6/13/2014

Fun Cats

Unlike modern cats, in 1898 kittens studied hard and learned proper grammar.

Image from Library Of Congress

This is the first post I’ve written mostly on my DIY Productivity Tablet.

I call it my “poor man’s Surface.”

What I like about the Surface is that it can run a real, productive operating system on a tablet.

What I hate about the Surface is that it costs more than a high end notebook. That means I’d never carry it around as a tablet.

My little Kindle and Raspberry Pi combo could be completely replaced for about $250.

As much as I’d hate to lose it, I could replace it without too much heartache.

It helps that I like Linux and the text editor Vim.

With the Ultisnips plugin for Vim I can write my DocPad Markdown files pretty
darned efficiently.

Don’t mistake that comment as an encouragement to learn Vim yourself. I’d never
recommend Vim to another person. It has taken me years to feel
even minimally competent in Vim. That only makes sense if you spend most of
your time at a keyboard and you are a dedicated touch typist who finds
reaching for a mouse to be a supreme annoyance.

Enough, Jeff! Get to this week’s Links!

Warp Six, Mr. Sulu!

NASA Physicist Dreams Big

Starship Image

Wicked cool warp drive starship.

courtesy of Mark Rademaker/Flickr

If you are going to make plans for something you have neither the tech nor cash to build
it, DREAM BIG!


A NASA physicist published conceptual plans for an honest to Sulu starship.


Since theortical physics theoretically allows theoretical warp bubbles,
why not start planning a ship?


I would really, really like to see a starship in my lifetime, but just
imagining a powersource powerful enough to warp actual space hurts my head.


If we don’t dream it before it is possible, we will never achieve it. Here’s
to dreaming big!

C# 6.0 Preview

Graphic: A preview of new features in C# 6.0


OK, this one is cool for two reasons. First it highlights some super cool syntatic sugar in C# 6.0, and second it
is done in a really slick graphic.


Fiona Taylor Gorring posted it on her blog. You should check her blog out because it looks awesome. Who
says you can’t share solid technical info with style?

Batmobile!

I am going to drive the batmobile.


Oh, yes, I am.


Really looking forward to this game.



Grunt For Beginners




Grunt for people who think Things Like Grunt are Weird or Hard


Really good intro to using Grunt to automate web development tasks. I need to learn Grunt and this looks like
a good place to start.

Fun Friday: Links & More - 6/6/2014



Not sure how much fun this Friday was.

Frank Friday Fletcher

Image from Library Of Congress

Big thanks to Lifehacker
and Adafruit
for linking to my post DYI Productivity Tablet!

Kind of an inception thing if you click on the Lifehacker link from my site then click their link to Adafruit
then THEIR link to come back to my blog.

Whoa.

I had a great time working on that project.

I’m hoping to start the next set in the series this weekend.

In the second set I’ll configure Raspbian to look and function better on the Kindle screen. Think bigger icons, text, etc.

I’ll also talk about setting up to work with DocPad.



  1. Monthly Raspberry Jam and Electronics Workshop


    This is a local event for me. My daughter and I are attending this one and it will be our first. I love the concept
    of Geekspaces. Shared access to tools and equipment you wouldn’t otherwise have. Reminds me of Benjamin Franklin’s
    subscription library.




  2. Dropping Resistor Calculator


    OK, it’s been a while since I needed to figure out which resistor I need to keep from burning
    something up…


    This site is awesome because it explains the whole process as well as giving you a calculator
    you can plug your values into.


    My daughter and I are working on a project that requires wiring up some LEDs to a rotary switch and a battery pack.
    Didn’t want to burn up those LEDs…




  3. How to turn Vim into a full-fledged IDE


    Vim has become my go-to text editor over the past couple of years. It is lightweight, fast and capable.


    Make no mistake, the learning curve is still the size of
    Olympus Mons, but if you are a touch typist
    who hates reaching for that infernal rodent to move your cursor around, you might like Vim.


    One of the super cool features of Vim is that there are so many plug-ins. I use several of the ones mentioned
    in this post.




  4. Deploying DocPad Sites To Azure


    This is basically what I do.


    I work locally in MarkDown files that are processed into static HTML files. Then I use Git to push the
    static files to BitBucket. BitBucket sends a signal to Azure Websites which then pulls the latest version
    of the master branch.


    It is easier than it sounds, but not for everyone.


    I wrote about it in my
    Top 5 Reasons To Blog With A Static File Generator



  5. Links to my links


    Adafruit


    Lifehacker


    I really appreciate the links back to my blog. I also appreciate any re-tweets or shares. Thanks!



Fun Friday: Links, Tweets and More: 5/30/2014

The Fun Kind Of Railroad Disaster

Apparently the “fun” kind of railroad disaster. Somehow in Switzerland.


Image from Library Of Congress



Here we are for the third installment of Fun Friday links!

This is a berry focused set of links this week.

That’s right. I made a berry joke.

I’ve spent some time playing with the Raspberry Pi this week, and I wanted to share some related links.

It’s pi time we had this discussion.

Quote Of The Week




  1. Raspberry Pi Home


    I love the Raspberry Pi. It is a scrappy little $35 computer on a board that includes HDMI out, ethernet in,
    audio and video out, two USB ports, an SD card slot and a whole bunch of I/O ports you can physically
    wire to darn near anything you can dream up.


    This takes me back to why I got into computers in the first place. I’m having fun just hacking with this thing.



  2. How To Turn A Raspberry Pi Into A WiFi Router


    Case in point. This link takes you step by step through setting up your Raspberry Pi to act as a router. Say what?


    Yes I have a router. No, I’m not always near it.




  3. Make Magazine’s Raspberry Pi Category


    Make Magazine is the geeky hacker’s big, glossy magazine. Their website has a ton of great links and
    content.





  4. Raspbian


    Raspbian is the go-to Debian Linux distro for the Raspberry Pi. There are several options, but this
    is considered the best starting point.





  5. This brings me to my self-serving recap of my own posts for the week.


    This week I was on vacation and spent some time with a project I’ve been kicking around for some time:
    combining my Raspberry Pi and Kindle Fire HD into a FrankenTabletBook.


    My number one goal was to be able to use Vim, DocPad, Git and Node on my Kindle to write and publish blog posts.


    I already have a VM in the cloud that I can remote desktop into, but what about times when I can’t get to it?


    That’s where I got the idea to RDP into the Pi using it as a router (since the Fire can’t do ad hoc or peer to peer
    WiFi).


    This turned into two blocks of posts, the first block of which I’ve finished.




Well that’s it for this week. Have fun and see you next week!

DIY Productivity Tablet

Kindle With Leather Cover

Kindle Fire HD with Leather Cover.


I love my Kindle Fire HD because it is about the size of my old Franklin Day Planner (7”) and
is an outstanding entertainment device.

It lacks a few things, however, that I’d like to remedy.

What it’s missing is a full desktop OS that lets me get some work done when I’m not
at my computer.

Why Not A Surface Pro?

I’d love a Microsoft Surface Pro, but it has a few drawbacks as well.

My main complaint against the Surface Pro line is that the cost is so high I’d be
afraid to really use it as a tablet.

My Kindle has frankly been places and done things I’d be horrified to take a Surface.

For $229 I could replace my Fire with a much more capable Fire HDX and not lose sleep
over the expenditure.

The cheapest Surface Pro I can find today is the Pro 2 with 128 GB of storage for $999.

Essentially the cost of 3 Fire HDXs.

If I were to drop that and break it I would be a danger to myself.

Complaint 2 is the size. I don’t want to lug around something the size of a small notebook.

I will likely eventually get an 8” Windows tablet, but for now…

Raspberry Pi + Kindle Fire = Frankentabletbook




If you aren’t familiar with the Raspberry Pi, it’s a $35 ARM computer that runs Linux.

It uses very little juice and is tiny.

Before anyone gets too excited, remember that the Pi is a single core ARM processor that performs
roughly at the level of a PC from 1999 or thereabouts.

This is not the equivalent of a modern PC.

It is also $35.

By the time you buy an enclosure, SD card, powered USB hub and WiFi dongle, you’ll probably be out about $50-60
depending on which ones you choose.

I’ve been playing around with the Pi for other projects, so I already had all the parts.

Keep in mind that the Pi is for when I can’t get to an internet connection and connect to my
“desktop in the sky.” I blogged about that in Windows Touch UI On Azure VM.

Warning
If you follow this plan all the way through you will NOT be able to use your Pi to connect to a WiFi router!
You are telling your Pi to be a router.

If you skip configuring your Pi to act as a router, you can still use Remote Desktop to access it, but
only when the tablet and Pi are both connected to a router.

Having said that, I will likely later either buy a second WiFi dongle or write scripts to
switch modes.

Since this is a Pi we’re talking about, maybe I’ll make a physical switch!

Project Plan

Rather than make this a 10,000 word blog post, I’ll break the project up into a series of posts.

Follow the links below to the individual posts that make up the series.

The summary of the plan runs as follows:


  1. Install remote desktop service on the Pi.

  2. Connect the Kindle to the Pi via remote desktop over WiFi.
    Note that it’s the same post as item 1)

  3. Configure the Pi to act as a WiFi router.

That is Phase I.

Phase II will be setting up DocPad so I can edit my blog:


  1. Install Git on the Pi.

  2. Install Node.js on the Pi.

  3. Install DocPad on the Pi.

  4. Configure Vim for editing.

  5. Write blog post from Frankentabletbook.

In the individual posts I’ll explain things like “why you want your Pi to act as a router.”

Should You DIY?




That depends on what you want and what you have on hand.

If you have a non-Windows Pro tablet AND a Raspberry Pi on hand, plus you enjoy diving in
to a Linux project with hardware overtones, then this might be a project you’ll enjoy.

If you are currently rocking a Surface Pro 3, hate the command line, and expect outstanding
performance, then you will hate this project.

Only try this project if you think you will enjoy the process. If you just want a really solid
productivity tablet, then go buy yourself a Windows tablet. You can go high-end, expensive with
the Surface Pro 3 ($800-$3,000) or low-end, inexpensive with a Dell Venue Pro ($300 or less).

I personally enjoy the process or else I’d just buy a Dell.