Wednesday, December 17, 2014

Pushing Initial Code to Your Github Repository via Windows





Git is not a scary monster that is hard to learn like a lot of devs who haven't used it assume it to be.  Git is not hard to figure out.  In fact it's so easy to get up and running and use I guess you can say it's kinda scary in that respect.


And you should use it.  It's a no-brainer not to.  No it's not that "it's cool" to use Git (well sure it is), but it's that Git really changes the game and makes things flexible, friction-less, and very powerful when dealing with source control both on the server-side and client-side.  Git is awesome.  It's painless.  It's flexible.  It's fast.  It's so much more.


In the past I've mainly been a Subversion guy.  Stayed far, far away from TFS when at all possible (heavy bloated, loves to bug the hell out of you in unexpected and frustrating ways, and loves to throw little fits and do weird things).  If you don't see that TFS users, you're blind.


And really, all-in-all there's a very small set of commands you really need to master with Git...it's not bad.  Once you get it and it gets repetitive it's nothing, and you'd never go back to another source control ever.  


There are a lot of git posts out there, but I just wanted to share step by step how to take code that lives locally and push it to a new repository on GitHub and show in as much detail as I can with some print screens from my laptop.  I wanted to be a little more detailed than most posts out there and you should do your homework also, I recommend you do first and take the time to read this documentation....there's quite a bit more in there.  Read that slow, and read it well

Scenario: You have an existing project locally on your windows PC.  It's a .NET solution or whatever.  You want to use GitHub to host your project.  And this the first time you're doing all this for that particular project.  


Some of this is a repeat from GitHub docs, but I wanted to show it as a real person doing it and I want to add other things in here that will hopefully serve as a shortcut for you...by reading this post.



Install Git

  1. Download git and install it
           
         

Configure Git

When you install Git it installs also Git Bash emulator, which is what you'll use for everything with Git.  It's a shell that allows you to run both Git and Unix commands and you'll need to use both.  (The other option is to go with some heavy GUI like Git for Windows or Atlassian Source Tree, etc.)


I much prefer command-line over an all UI based Git client or a Windows Explorer context menu because command line is much quicker for getting things done once you get the very small set of commands you'll need to do the majority of commands for basic daily Git usage.  And I like to truly know what's going on when I perform operations with Git down to the bare metal because it gives me a raw understanding of Git, so I truly know what it's doing under the hood.  I don't want all things hidden behind a big GUI showing me everything done visually (by performing "black magic" behind the scenes).  I want to know the core commands of Git, it allows you to understand under the hood which makes things much more easy when you know it inside out rather than outside (GUI) hiding in.


When you first open Bash, your default context starts at "~" which in windows the context is your Home directory which is C:/Users/[YourUserName]


To cd to a directory it's a little different than the windows command prompt but not by much.  You use forward slashes, no colon or backslash.  Remember these are unix commands, not Windows command prompt.  So e.g. cd /c/www/MyProject


Tell Git Who You Are
Configure your email, name, etc.  This is what will be part of commits etc.








Setup a .gitignore File

Lets set our gitignore file which will filter out file types and folders we don't want to include in our pushes to the repository.


You could just create a file and copy definitions into it which you can get from various places on the net

OR

You could setup a nice utility like GitIgnorer.

Manually

Open Bash, this is very easy using Unix commands

Create the file:




Move the file to the root of your project directory:




Go out and find some filter definitions that fit your development environment that exclude files you don't want checked into source control.  You can find these all over StackOverflow.com, blogs, and a nice list on GitHub itself.  Then copy that text into your .gitignore file.

Setup GitIgnorer (optional)

I'm using Gitignorer a little utility that allows you to quickly and easily grab one or more .gitignore templates from GitHub and mash them as you please.  

  1. Download Gitignorer
  2. Unzip it but put the exe wherever you want.  As long as you're cd'd whatever directory you placed the exe in (have cd'd to it), it should work
First lets use a Gitignorer's "list" command to give us a quick glance of the list that lies on https://github.com/github/gitignore so we can decide which .gitignore templates we want to use.

Note that I put that Gitignorer exe in C:\users\dave\documents...not the best place but I just wanted to get this working so will move it I'm sure later to a folder that makes more sense.























Lets grab the VisualStudio.gitignore file because this really has most of what we need for .NET development and Wnidows, etc.

First lets change directory to where we want this .gitignore file to be created. 






sure enough it created the fileand there are definitions inside it:

























but whoops! I don't want it in my documents, lets move it using Unix commands

               



Ok now it has been moved.

Lets also rename it to give it more meaning because I'm gonna put more stuff in here that it already has later on


             




and now we see

There are some patterns missing that I'd like in here so I added them:




Now lets tell Git that you want this ignore file to actually be a global ignore file and then verify it's set afterwards:
                

There are a number of 3rd party utilities or apps that we could use to show diffs.  

Sometimes this is one of those rare exceptions where you might want to see the diff in a GUI but nothing else, rest in the command line.



















Setup Your Local Repository

Initialize (only done once)


We must first create a local Git repository by using the init command:

init - creates an empty local Git Repository.  That's the .git folder you see created after running this command

A git repository will consit of git objects, heads, tags, and template files.




Stage your Files

Lets try to stage our files now, which is the next step before you commit to your local git repository. 

You stage your files with the add command.

We're first make our files trackable by doing a git add which adds your files to the staging area:

Add - files are now tracked and staged to be committed

Side note
    
         Be aware that your files can be in one of two states at any time in Git:

Tracked - files that were in the last snapshot; they can be unmodified, modified, or staged
  • When you first clone a repository, all of your files will be tracked and unmodified because you just checked them out and haven’t edited anything


Untracked files are everything else – any files in your working directory that were not in your last snapshot and are not in your staging area





"." means add all files












Commit Your Files to Your Local Git Repo














Lets check the status of our files now just to be sure everything looks good:






Clean - means there are no tracked and modified files
  • Tells us which branch we're on which means that it has not diverged from the same branch on the server
  • Master is the default branch
  • Git also doesn’t see any untracked files, or they would be listed here

Lets do a diff to see what files have changed that are unstaged:





Notice when you hit enter, there is nothing returned or shown.  That's because there are no changes as expected.

And lets take a look at what we have staged:





Once again notice when you hit enter nothing happens.  Nothing because we committed our last add (staged files), we haven't done any new adds or modifications to any files yet.  So there is nothing staged, it was committed already.

You can also see your branch history via a graph:





We haven't made any changes to files yet so all you'e going to see is it note an initial commit.


Setup Your Remote Repository on GitHub

Create a New Remote Repository on Github 

Log into your GitHub account and although it's self explanatory, here's where to add a new Repo:








GitHub creates a --bare repository by default.  

Notice that after you create your repository, now you have a url for anyone can use to clone your project files.  We'll be using that to create a new SSH key against this repo:






















Create an initial SSH Key

You'll need an SSH key 
as it will be used by Git for secure communication between your local Git Repo and GitHub

But before we try and create a new key, lets check to see if our PC already has one or not:







It did not find an .ssh file so we know we'll need to create one

Copy that clone url and use it to paste into this command below






Next we'll call a command that'll go get our key and copy it to the clipboard
    




Now we'll go to GitHub to add our new key so it is aware of it:

















Push Your local git repository to your Remote GitHub Repository

Lets summarize at a top level what we did so far:
  • Ran the add command to stage our code files
  • Ran the commit command to take our staged files and add them to our local git repository (.git folder contains the repo)
  • Created a new Remote repository on GitHub
  • Created a new SSH key locally through Bash then added that key to my GitHub security section
Now we're ready to finally do our first push.  That is, commit our code to our remote GitHub repository.

However at least for me there was one snag.  I like to enable 2-factor authentication.  Where you log in but then you have to get a code from your phone and enter that as a second layer of auth.  Problem is, if you enable it, you have to setup a static access token so that you can reuse it in Git...because you can't use dynamically created access tokens for Git, that wouldn't work...they'd keep changing.

In GitHub create a new token:


























now copy that token to the clipboard:






Push Your Code to Your Remote Repository on GitHub

Finally lets push (commit to a remote repo) our code to our GitHub Repository:

** Since we enabled 2-factor auth, for your password you'll input that token, not your GitHub password.

 









And sure enough it's now on GitHub:

Now developers (or yourself) can clone (copy) and start working on it locally.

Wednesday, August 20, 2014

DimeCasts.net Redesign - Part 1 - Getting to Know OS X Mavericks














The Current State of DimeCasts.net

Dimecasts.net (a personal pet project of mine outside my daily job) as it stands right now is a site that has been sitting there, stuck in time.  It's had static cast content that has not been updated with new content in more than 2 years, as the site had been untouched after 2012 by previous owner Derik Whittaker who had since then become busy doing other things such as now he's doing videos for Pluralsite, more blog posting, speaking, kids, job, etc.

As it stands right now the production site stack is the following:

  • ASP.NET MVC 1.0
  • NHibernate
  • SQL Server 2005
  • Tables drive the structure of the website
  • jQuery (very old version)

Redesign of DimeCasts.net

One of the goals of redesigning DimeCasts.net was to venture out of the Microsoft world including code.  I've worked a lot with Subversion, a little Git, some Dojo on the job, etc. but there's a ton out there and things are so much different now that it's a shame I'm still stuck in only .NET and MS tools mainly in the jobs I've been taking.  In fact I've tried very much to stayed away from painful tools like TFS, and others that are simply bloated and get in your way rather than make it easy for you to get your job done.  One would not know the pain one is dealing with in TFS unless they have ventured out and used other tools like Subversion, Git, etc.  

Most .NET devs look at me like are you crazy, TFS sucks?  Then I ask them is that all you've ever used?  It's usually "yes" OR "I tried subversion or Git and it's not good, it sucks, or it's hard".  That's just like saying "Resharper is no use" which both are completely bogus statements to be making.  If you haven't tried to use a tool like Subversion, ReSharper for more than a day before you give up, then don't tell me TFS is the bomb either.

I wanted to get more versed in stuff like Node.js, Angular.js, Express for Node.js, Grunt, Jasmine Test Runner, etc.  And what better personal project and opportunity to apply that than Dimecasts.

And one of the main things was I'm gonna do this using the Mac OS.  Yes you can run node in Windows but I want to know how the rest of the world does hit outside Microsoft.  So I am forcing myself to use the Mac OS for redesigning Dimecasts.net.  So this first post is about just getting around and my feet web in the OS.

As I started to use OSX Mavericks, I was pleasantly surprised at what a nice operating system this is.  Previously  I was in the boat of "Mac OS sucks" which is what most .NET devs will bitch about and run away from.  However, sometimes we have to open our eyes and stop making statements that are totally outdated and monolithic and actually try things again.  After all things have drastically changed since 5+ years ago.  

If you're still naive enough to say the Mac OS sucks, Node.js is puke, and JavaScript is trash, then you are being stubborn and speaking either on heir say or you are not informed when you say these types of comments.  Unfortunately I have to say it, that most .Net devs fall into that bandwagon.  It's sad, and I have realized that there are way more things outside .Net that are far more fun and being used more and more that it's just dumb of me not to get to know it.  I think it's sad that most .NET devs that I know at least are so biased and think that the only thing that should and does live in our world is Microsoft technology.  I'm not saying I don't like C#, ASP.NET MVC and sorts but MS falls short in a lot of tools where others make your life a hell of a lot easier that you could be using with your MS codebase.

When I did Dojo & Dojo MVC a couple years ago, it opened my eyes to what a JS Framework can do for you.  Granted Dojo is the older JS framework and less desired now that there are frameworks like AngularJS, Backbone, whatever but Dojo had apparently been drastically redesigned and now uses some of what most JS frameworks have, at least some of it.  

I wouldn't use Dojo as a framework personally but still, it has MVC, etc.  And showed how JS can be elegant and maintainable and fund to code in.  These frameworks show the power of JS.  Ok, ok for those of you who must have a T-Shirt that says "JS sucks", again, don't be so naive.  Yes it's a bit of a pain to debug but try out a framework, you'll find JS can actually be decent even though it's not a typed language.  That's where you need to again open your eyes and install tools like Webstorm, IntelliJ, etc. that have super rich intellisense that will drastically change how you debug and code in JS and make a lot of the chores an d pains of coding in this language melt away.

Remember, jQuery is not a framework, it's a JS Library, those are 2 completely different things with different purposes and uses, but both can be used together of course to create powerful websites.  jQuery can live on top of a JS framework Views to provide additional functionality, but it doesn't provide an MVC framework, stuff like Angular and other serious JS Frameworks provide you.

Don't get me wrong, we'll still be looking to add a ton more casts around .NET technology but we're also looking for casts on a slew of other code subjects outside MS as well now.

OS X Mavericks

One of the first things I missed form Windows (I am running Windows 8 dual on this Macbook Pro BTW) was OneNote because I put a ton of information and notes about code as I come across stuff I want to revisit or have handy, errors I've come across and how I resolved them, family and personal info, you name it.

One of the first wins after venturing around in the Mac OSX was I found out that OneNote is FREE through the app store which rocks.

After installing OneNote, I was ready to rock and roll because now I could document and create screen shots of stuff for both blogging and just for remember wtf I did in my journey to recoding this great site.

Second, being a Mac OS n00b, I noticed that Ctrl + C is not a shortcut in the MacOS for copy.   Not to mention you scroll in the opposite direction in the Mac OS in order to go up and down compared to what I'm used to in Windows.

Third, I wanted to get a pic off my DimeCasts twitter page to put in this blog post.  In windows 8, all I had to do was to use the OneNote very handy screen capture tool that lets you drag and select an area of your screen and then puts that into your clipboard for you...very convenient.  I thought to myself hmm, where is their image editor and how can I copy full or partial parts of my screen to the clipboard? TBH, other than of course resorting to searching the net, there was nothing in the apps or utilities list in the OS that yelled out at me as "Hey I'm an Image Editor!"....or "hey you can use me to capture parts or your entire screen".  I didn't even know how to print screen in the Mac OS.  So I started to get to know the Mac OS Maverick Shortcuts.  And then how would I get that image from my clipboard and into a file so that I could work with it in a graphic editing program?  And I quickly found out by doing a search that Preview is the default image viewer & editor in the Mac OS for image editing.

So far, other than finding an image editor and how to work with the clipboard and screen capture, the journey has been smooth.  

Stay tuned for Part 2.

Sunday, April 27, 2014

CodeZest: Buying an Espresso Machine - Advice to the Novice

CodeZest: Buying an Espresso Machine - Advice to the Novice: I wanted to take some time to share my experience with buying and owning espresso machines.  I want to share some things so that you don...

Buying an Espresso Machine - Advice to the Novice



This is a picture of my semi-automatic espresso machine at home, a Rancilio Silvia.   We all spend money on hobbies.  And this is just one of my hobbies which has saved me a TON of money and I love good coffee so it was worth my investment.  I no longer have to go to coffee shops every day.  I have something that makes great if not even way better coffee than most the shops out there...and I'm not kidding, this machine rocks.

No I'm not rich, not even close.  And in fact this machine if you think about it along with a very good grinder which is required totals only around $1100 ($600 for the machine and + $300 for a good burr grinder + $200 for a PID added on at checkout on seattlecoffeegear.com).  You can buy semi-automatics all the way up to 5k, or full automatics.  I found that you don't need to spend that much money to get espresso that is just as good as any coffee shop you find out there.  Mine is nothing fancy, but it is solid and proven.  It's made by Rancilio, a very good Italian company...and these have an average lifespan of 12-15 years if you look up info on it.

I wanted to take some time to share my experience with buying and owning espresso machines.  I want to share some things so that you don't make the same mistake I did, which is buy a super automatic espresso machine.  Instead if you are gonna spend some serious money, save your wallet, I have the solution for you without blowing a hole in your pocket.

Most super-automatic espresso machines cost anywhere starting at the low-end from $500 all the way up to $5000 or more.  

Right now I'm on my 3rd espresso machine.  And I'll tell you why all I had to do is buy the right espresso machine and I could have saved myself around $3000 because I wouldn't have had to buy the other two which lasted only 5 years and 2 years.

Super-Automatic Espresso Machines

A Super-Automatic Espresso Machine are ones that provide the following functions:
  • Some have a full frothing solution which minimal effort
  • Some have a frothing wand, which takes more effort but you get a lot more control and typically.  Others will have complete froth automation to where you have to do almost nothing manual to get froth generated
  • They are all push button, there is really nothing manual that you have to do to prepare and brew the coffee or espresso
  • They offer the option to create a full cup of coffee or an espresso shot
  • They usually provide some temperature variation that you can set that determines how hot the coffee comes out
  • They are very programmable, things like # of shots per pull, # of cups for coffee per pull, etc.
  • They all use burr grinders, the best grinder grade which is required for espresso machines to even operate well because burr grinders grind a very consistent and even grind and so you get much better coffee out of evenly ground coffee.  You may think your $50 grinds is good, but i'ts not.  Get a burr grinder, they are anywhere from $100 - 600 and well worth it and you will notice a huge difference even in your regular coffee machine
  • They allow you to tweak the grind somewhat, making it finer or courser
  • They are very low maintenance
    • it's easy to change water
    • it's easy to clean
    • it's easy to descale
  • They last anywhere from 2-7 (7 years if you're very lucky)
  • They are more expensive than semi-automatic espresso machines
  • Usually all parts inside are plastic

Semi-Automatic Espresso Machines

A Semi-Automatic Espresso Machine are ones that provide the following functions:

  • They have a frothing wand, and usually do not have a non-manual frothing solution
  • They are much less programmable.  Some are not programmable at all
    • think of it like a Professional SLR vs. an Amateur SLR Camera.  Professional is usually very manual so that it allows more control and precision whereas Amateur cameras do not provide a manual option and make it easy for the less serious, non-experienced photographer
  • They only allow the option to pull espresso shots, not full cups of coffee (however you can add water to the espresso shot in order to make essentially regular coffee)
  • They either come with what's called a PID or not.  A PID allows you to control temperature to a very precise degree which allows you to tweak your shot to make the best possible tasting shot.  Without a PID, the temparature is usually variable so not every shot can taste the same.  One shot might taste awesome, while another might taste sour if the temperature is too high or too low at the time you pull the shot
  • They require us of an external burr grinder whereas super-automatic has a burr grinder-built inside
  • They are more maintenance, but not that much more than a super-automatic
  • A lot of them are cheaper than super-automatic machine
  • All the parts are typically commercial grade.  Meaning most companies that make very expensive semi-automatic machines sell a consumer espresso machine.  These consumer machines almost always contain top notch parts inside that is comparable or the same as their big machines.  You will not see any plastic inside, so they are much more durable


Super-Automatic vs. Semi-Automatic Espresso Machines

Now listen up closely, this section is critical for you to read if you are thinking of spending $600+ on a machine.

Do not go with a Super Automatic Espresso Machine ever!

If I would have known to try a semi-automatic first, I would have saved myself a lot of money and would have been pulling much better shots and savoring much better coffee for the 7 years that I had super-automatic machines.

Yes I know the super-automatics look really cool with their digital displays and slick design but trust me, it's not worth it.

Here is why I say this, lets compare.  I'll take the points above for the super-automatic that I listed and debunk and tell you why what sounds good really isn't that good with them.

Traits of a Super-Automatic Machine and Their Downside

Some have a full frothing solution which minimal effort

      Counter
      • This might fine if you don't care about not being able to create think vs. think froth and are not that picky with the result of the froth and that you have no control over it during the process.  But I look at this as totally limiting.  You will find that you will want to change the froth to suit your tastes, believe me
Some have a frothing wand


      Counter
      • Yes, but usually the pump that is in these machines are weak.  They don't produce a ton of steam.  You may think they do but wait till you get a super-automatic.  So this affects the quality of froth.  Now you may not care about that, but I know I do, as I want to do latte art and have fun
      • The wand usually has some kind of plastic somewhere.  Either the wand itself is plastic or the parts that it connects to are plastic.  This is bad because obviously plastic doesn't wear well but also you have more parts to take out in order to clean it and plastic does not clean well.  Over time you get stuff caked on it which is very hard to remove like milk build-up and such
They are all push button and that's it, piece of cake
      Counter
    • Sounds great right?  I don't have to lift a finger except to push buttons, horray!  Well think again.  Buttons introduce more electronics into the machine that can potentially fail.  A friend of mine can be the first one to tell you it happened to him after only months of owning a $700 super-automatic espresso machine (Gaggia to be specific) and that's bogus.  Go online and you'll see this is not an uncommon issue either
    • What you see is what you get.  If the options are not there or the options do not do what you want well, you're stuck with them
Of the buttons that are on these machines they usually allow you to specify a full cup of coffee or an espresso shot to pull
     Counter

    • That's cool right?  Yes, some people like shots for either sipping straight up or making lattes and mochas.  Some people just want a plain cup of coffee.  There's really nothing I can say bad about that, so I can't really debunk that one and surface any cons for that except for again my friend had problems with buttons on a Gaggia Breva whereas he'd press the button to create a cup of coffee and no matter what it'd pull an espresso shot every time instead.  Now that's a real problem!

They usually provide some temperature variation that you can set
      Counter
    • Sure, but you only usually get about 3 levels of temperature and a lot of these machines are not producing very hot coffee even on its highest level
They are very programmable
      Counter
    • Again, this might seem nice, but you are banking on the machine not malfunctioning in terms of the motherboard behind it.  People have had problems with their board where buttons go wacky, and it's not that uncommon.  Do you really wanna deal with that possibility?  That means you send your machine in, get it repaired and it's not cheap, and you get it back only hoping it doesn't happen again
They all use burr grinders
      Counter
    • It's a requirement for any kind of high-end espresso so pretty much all have them, nothing to report here except that you have more control over the type of burr grinder, the type of material the grinder is using, and you have a whole range of grinders to choose from if you go with a semi-automatic machine.  I'd much rather be able to select different grinders than be suck with one, the one that comes with the machine.  The ones that come built into semi-automatic are very hard to clean as well and you can only clean so much of it
They are very low maintenance
     Counter
    • Sure, but again that's because you have less control, the machine gives you what you get and that's it
They last anywhere from 2-7 years  (7 years if you're very lucky)


     Counter
    • Yep, my last one was a Gaggia Breva and only lasted 2 years as no water was coming out one day by the pump
    • My Gaggia Titanium lasted me 5.  The pump simply got worn out.  Now being a rookie, I should have sent it in to get the pump fixed.  That is not cheap.  But the parts in these machines fail often, remember that.  So chances are I'll be fixing this thing a lot over its lifetime
They are more expensive than semi-automatic espresso machines
      Counter
    • yes, because they are more complicated machines to produce.  They are harder to engineer and require many more parts and digital interfaces in most cases so the cost to design and manufacture them is much more
Usually all parts inside are plastic
      Counter
    • Those parts break down sooner than later.  Why do you want to be seeing plastic parts after you pay $600+.  That's an insult to customers if you ask me.  If I pay that much I expect non plastic parts driving my very expensive machine
    • There are a higher number of plastic parts.  When you pop open a super-automatic vs. a Semi, the super-automatic will be a cluster f full of parts and it's amost impossible to repair yourself or get at some parts easily because it's so tight in there as the parts are many and have to be jumbled together in a very small space.  It's a mess of low quality parts essentially in sum


Wand and Froth Are Important



When I owned my last two super-automatic machines, I thought the froth was great.  That is until I wanted to create latte art.  I kept trying and trying but I just couldn't get the milk right.  I'd get very course bubbles in my froth no matter what I did to try to minimize that.  

I found out later after purchasing my semi-automatic that eventually I had such flexibility that I would be able to do latter art later as I practiced more. 

The reason that the semi-automatic machines create better froth, micro froth needed in order to create art is because of two reasons:
  • Semi-Automatics have more powerful water pumps for the frother
  • And they allow you to change out frothing tips or come with a tip that is much better than what a lot of super-automatic machines come with
Powerful Steam
The tip and the power of the steam both are critical in being able to create the right micro foam.  You will have a hard time doing that if not impossible with an super-automatic machine.


Espresso Shot Quality Is Important

Thicker Crema

Super-Automatic machines simply won't compare to a semi-automatic in terms of the quality of the shot.  Quality of the shot is what makes your latte or mocha or just straight up drinking takes awesome.  If your shot is too weak, too acidic, or doesn't have any crema  on top, it's useless.  It might test pretty good, but I can tell you once you get a semi-automatic, it'll blow it out of the water.

After buying my semi-automatic, the first sip just blew me away.  It was better than any coffee shop in town and I'm not exaggerating.  I live in the suburbs of Chicago so there are plenty of coffee shops to go around and I've also gone to Intelligensia, Star Lounge, and more.  I can tell you there is no coffee shop around my immediate area that compares to the coffee I can produce with my semi-automatic.  A $3000-5000 super-automatic can't even compete either.  I've tasted shots from those very expensive machines (Jura, etc.) as well at places like Williams & Sonoma, Sur La Table, etc. and again, it just does not compare.

What I noticed with my semi-automatic as compared to my last 2 super-automatic machines is I have total control.   I can get the shot as stong as I want, way beyond the levels the super-automatic provided me.  I can produce a much thicker crema as well, which is necessary for drinking a good shot of espresso...as well as helps with being a thick base for latte art which is necessary, as well as I can make sure I do not get sour shots.  I can play with it and get it to a point and fine tune it at a very micro level.  You simply can't do that with a super-automatic.  Again what you see is what you get with those.

Manual is Preferred over Automated

While semi-automatics don't have the cool interfaces on them (some due but very limited), it doesn't matter, you don't need them.  You don't want them.  You want to control it yourself anyway so you can fine tune your shots and froth anyway.

Yes, semi-automatic is a bit more manual but not by much.  About the only thing that is more manual is the fact that you have to grind the coffee yourself with an external burr grinder, and that you have to pack and place the shot before you pull.  Big deal, it might add 2 more minutes, which is trivial.

They clean up just as easy if not easier than super-automatics because there are less parts to deal with inside.  All you really need to do is just descale it.  super-automatics make you slide out the internal components as well and rinse them.  You don't do that with semi-automatics because they are designed in way that they don't have such complicated parts and all they need is a descaling.  

You do have to clean your porta filter, but again, big deal.

Lifetime

I had a very poor experience the length that super-automatics last.  Because they are made with all plastic parts inside, it's pretty obvious they will have a far shorter life-span than a machine with commercial grade components inside.

Just for comparison, a Gaggia Titanium ($1200 retail price) lasts around 5-8 years.  My $600 super-automatic Rancilio Silvia which has been around for 20 years, has been said to last on average 12-15 years if maintained properly.  Clearly it's smart to go with a semi-automatic.

Conclusion

Overall the amount of flexibility you get in terms of being able to tune your machine, control the quality of shots, and get that micro foam just how you want it is why you should be buying a semi-automatic.

Also, they last a long, long time as the parts are commercial grade inside.  Much longer than a super-automatic.

They cost much less and you'll taste far better coffee, closer to what good shops pull...and you find yourself almost never going to those places.  With my super-automatic I still found myself going to coffee shops because again, the super-automatic while good still didn't produce the level of quality that coffee shops produced.  My semi-automatic did.


What Model do I have?

I bought the Racilio Silvia v3 which is a very popular and proven Italian machine.  And I bought the Baratza Vario Burr Grinder.  This machine and grinder combination produces outstanding coffee, and rivals any other semi-automatic at higher prices levels by far.  I am still blown away to this day how good every shot comes out.  I can't think of anything better than the shots coming out of this machine.

I bought mine at seattlecoffeegear.com.  I like these guys better than a place like wholeLatteLove because they are just more insightful and willing to do more for you.

Make sure you add the option for PID!...it's critical:










Tuesday, January 28, 2014

Blurring out areas in an image

This isn't really a post I'd normally write, but since I get this question all the time from colleges, I thought I'd mention it.

I often blur stuff out in images on my blog or in just quick print screens I create at work sometimes for whatever reasons.

But first I will say I do not use free paint programs like Paint.NET or GIMP.  They just don't cut it for me for the following reasons:


  • while you may not care about quality in simple print screens for documentation or blog posts, well I do.  When I create images for my blog or even for pasting stuff in OneNote for work for remembering how I did stuff, clarity, sharpness, and just overall look matters to me.  Don't asky me why, it's just en-grained in me
  • The tools are sub par.  Sure they attempt to do the same things Adobe does, but again, you end up having to either take a lot of steps to do the same thing or you can do the same thing as in Adobe or the results areis just not that good when you apply effects or filtering I've noticed as compared to Adobe products.  Sure sounds stupid but this stuff matters to me
I can't afford Adobe Photoshop.  So the next best thing is Adobe Elements and I highly recommend it for developers at least.  IMO it's basically a very dumbed-down version of Photoshop probably and it's good enough for me.  It's got high quality and advanced tools, just enough for a developer but not over the top which this wouldn't hack it for a designer.  So it's perfect.  Elements is only $50 people, it's not like it's gonna break the bank.  Get it, it'll save you time (efficiencies) and provide you much better and more powerful control over the fine grained stuff as compared to Paint.NET, etc.  In fact Costco carries it for even cheaper sometimes.  Check there.

Anyway back to how I create that blur effect.  It's simply the Gaussian Blur.  


Pay attention to the options.  You can tweak the transparency (how strong the blur effect is) by moving the transparency bar left or right to get it just how you like it:


Note that in PhotoShop Elements, after you apply the filter once, then you get a nice keyboard shortcut that's activated that you can use from that point on to quickly apply the blur again



So I do this a lot with code to protect sensitive info:



Cheers.

Wednesday, January 22, 2014

Using ReSharper to remove Code Smells and Keep Code Cleaner




I promote ReSharper always as a necessary tool that I feel all developers should definitely be using.  In fact there are teams I've been on that require it as they've decided that the tool is so useful that everyone should be on board and using it because it helps so much that it became a requirement to use it literally.  And on those teams developers didn't debate using it, they were already using it or if they weren't they were all for it because they saw how it can literally help the team to be more efficient in so many ways.

One of the big reasons to try and make it a standard on your team is about is keeping code clean.  Some people don't think they have any use for a tool like ReSharper.  They're "proud of manually coding everything without much assistance from intellisense".  Well that's just ignorant.  And most likely those kind of developers are producing code smells for the rest of the team and they don't even know it or causing themself extra pains that they weren't even aware were walls/pains in the first place on a day-to-day basis!

And remember your code is everyone's code.  The code base belongs to the entire team, not just you.  So if you think it's ridiculous to keep even the smallest lines of code clean and it's below you, you might consider another profession.  Do you think accountants allow messes?  Doctors?  The answer is no and it should be no different in our profession as Software Engineers or "Craftsmen".  What you do affects everyone in your development team so you need to view the code YOU write as such at all times and be thinking about how it might be reusable, cleaner, etc. for everyone else who has to work with it in the future.

Turning back to ReSharper.  It's such a gem in that it clearly points out unnecessarily code in every class and every line of code in that class.

There's no reason if you have ReSharper installed that you aren't by habit removing unnecessary code as you come across it, which is part of the boyscout rule, keeping the code campground clean.  As you know the boyscout rule that so many great teams abide by is that every time you check in code, it should be a little better than what it was before you check it in.  Robert Martin's Clean Code book emphasizes the boyscount rule.

When you are in a class and you have ReSharper installed, this stuff just screams out at you.  And for me it's just a habit to remove it.  It feels gross to have it in here...and you should feel the same way.  It takes up no more time doing this;  It does not slow me down as it's just a few seconds to remove this stuff as you go and as you see it elsewhere in an entire class.

Look at these examples where ReSharper has pointed out/grey out unnecessary code (I pointed it out with yellow here):

unused usings









unecessary "this." where there is no object type conflicts whatsoever



unecessary Fully Qualified Types where you should have added a using statement








unnecessary explicit conversions:



unnecessary chatter:





unnecessary default assignments at times







Would the examples above give you "code itch" if you knew about them?  It's very much code smell, and it really should make you itch if you truly care about keeping your code base clean.

Why should we removed this stuff? for READABILITY, simple as that.  And having more readable code leads to easier maintenance for all.  Don't be lazy, get rid of it NOW while you are working in that class before you check it in.  ReSharper makes it stupid easy and quick do do this, and It's part of being a professional Software Engineer to keep this clean.

One of the things I do just by good habit right off the bat is when I make a new class in C#, I immediately remove the default usings that are generated at the top as initially they are unused anyway.  half the time you won't end up need a lot of them once you are done with the class anyway.  ReSharper will simply hint and allow you to add using statements quickly and easily anyway when it detects you need them.  So start off with a nice clean template is what I highly suggest so that this stuff is removed initially to start with.

Now you may be thinking "hey I like to show things explicitly to make code more readable". You know what?  you're actually making it less readable.  For instance if you think you still need to do something like establishing a variable with default such as int someVariable = 0; and you know though in certain cases you don't need to explicitly show that you're setting it to zero.  Seriously, stop over thinking and just get rid of it.  It's like the same with commented out code, get rid of it, it's clutter.  99% of the time you'll never use that commented code again.

ReSharper's Marker Bar

Now another thing that people who have even used ReSharper for a while don't know about or notice which for me is an awesome feature is  the Marker Bar.

When you open a class, look to the right.  ReSharper outlines problems, hints, or suggestions in code making it very easy to see an overview of your class in terms of code quality and errors that exist:



And all you have to do to get to that line of code that is a problem is to click on that colored bar on the right.  

ReSharper shows different colored bars to the right to point out different things:














Don't you love that?  In fact there was a team I worked with who decided that a good standard for the team as part of cleaning up code would be to check this in every class you've made changes to BEFORE you check in the code.  

So get rid of unnecessary code or use the hints to make the code more compact, do it, then check it in.  You start to view your classes different with this feature too.  Because when you open classes, you start to look to the right automatically and it just becomes a habit to use this feature to see if you can clean something up before saving your code and checking it in.

This just touches the surface in how ReSharper can help a team keep code consistently clean and uniform.  There are many more features that I'd like to resurface later in a future blog post.

While most ReSharper users already know about this, there are plenty of developers who have never heard of a tool like ReSharper, refuse to use it, or don't understand some of its benefits.  So I like to resurface some of this stuff once-in-a-while hoping a newbie finds out about ReSharper and some great stuff they and their team are missing out on.