Thursday, September 13, 2012
How to Use Google Plus Circles
Sunday, September 9, 2012
Getting started with using Pub on Windows – The Dart Package Manager
The Dart language is a thriving community that is growing and with it come the tools that assist with doing modern development. One of the key tools that define modern development is a package manager and with Dart, the job of package management falls upon the Pub tool. You can read an overview of the Pub tool on the Dartlang.org website.
A common question that I see in new groups is “How do I use pub on Windows?”. In this article I’ll walk through using pub to help get the Dartsweeper application downloaded from GitHub and running on your machine. The basic steps that we are about to walk through are:
- Install the Dart Editor on your machine
- Install Git (distributed revision control and source code management (SCM) system)
- Update some Windows Environment variables
- Clone the Git source that we want
- Run Pub to install dependencies
- Run the application from within Dart Editor
OK, let’s get started
Get the Dart SDK
To get started, you need to have a few things in place on your machine. The first thing is to ensure you have the Dart SDK. The best way to get that is to download the Dart Editor which contains the Dart SDK files. You can get this from the Dart Editor Download Page.
Once you have downloaded the .zip file, simply unzip the files to a location on your local machine. The pub tool ships with the Dart SDK and you can find it at the following location: dart-sdk\util\pub
Configure Windows Environment Variables
You’ll need to configure a couple of Windows environment variables which make it easier to work with the SDK tools. First, add an environment called DART_SDK and point it at the root SDK folder in your unzipped Dart download. Next, update your Windows System Path variable and add a path which points to the bin folder of the SDK folder:
The reason for pointing the Path variable at the bin folder is because that’s where the main tools that you will need to use are located. The DART_SDK variable however needs to point at the root SDK folder because it is used to access SDK resources other than just the SDK bin tools alone – e.g. Libraries, Packages, and other Utilities.
Test that you have configured your environment variables correctly by opening a Windows Command Prompt and type ‘pub help’ and you should see Help text for the Pub tool displayed:
Install Git
Many of the packages that you will want to include will require Git to pull them down. Pub itself has support for working with Git via native protocol handlers which can be declared within the pubspec configuration files. To get Git, download the latest stable build from the Git website.
Test that you have Git correctly by opening a Windows Command Prompt and type ‘git –version’ and you should see the version number for your Git installation displayed:
Grab Dartsweeper from Git
Now that we have all of our tools installed, it’s simply a matter of using Git commands to fetch the Dartsweeper files and then we’ll use Pub to update all of its dependencies.
Open a Windows Command Prompt and change to a directory where you want to work from and type the following commands:
> mkdir %USERPROFILE%\dart
> cd %USERPROFILE%\dart
> git clone https://github.com/kevmoo/sweeper.dart.git
> cd sweeper.dart
> pub install
This will make a folder under your user profile called Dart and then clone the contents of Dartsweeper repo on GitHub into it. Finally we run the pub install command from within the newly downloaded Dartsweeper folder.
Here you can see the result of running those commands in real time:
Running Dartsweeper
Now that we have Dartsweeper installed, it’s time to open it up in the Dart Editor and run it. Open Dart Editor and open the sweeper.dart folder that we just grabbed from GitHub.
When you first open the application in Dart Editor, you will notice some red crosses against folders which indicate compiler errors:
The reason for this is that, currently in the Dart Editor, we need set the location for the packages on a per application basis. In this case, we simply need to open Tools|Preferences and change the location that we want the compiler to look in for packages for this application.
After doing that, you can right-click on the test folder and exclude it by choosing Don’t Analyze to remove it from the compilation analysis process. That should remove the remaining compiler error warning.
Now press Ctrl+R (or hit the Run button) to run the application in the Dartium build of Chrome:
Friday, September 7, 2012
BingItOn
BingItOn.com is another wasteful exercise by the Microsoft Bing team which attempts to con users into believing that its results are superior to those of Google’s Search product.
I remember travelling to Seattle 5 or 6 years ago and seeing this tool used internally at Redmond - now finally it appears that the mighty Redmond marketing machine has unleashed it upon the public at large.
The premise of this tool is that you run a search and two sets of results are returned - one from Bing and one from Google. You are then asked to make a choice about which set of results is more useful.
There are two problems here. First, Microsoft simply needs to turn its back on some of these old Ballmer fights and look instead to the future. Get back to innovating and delighting customers and walk away from this sort of stuff. They really don't need to fight meaningless fights just because Ballmer made some dumb promise all those years ago.
Second, how relevant is it to make a choice when you strip away the added value pieces that Google delivers to me in a normal search? Things such as personalized search results and added context through their knowledge graph enhancements. For example, when I run a search using the Microsoft BingItOn tool for AFL Football legend “Buddy Franklin”, I receive two walls of results:
Picking through them both to find a winner is tough and quite subjective. But let’s see how the results actually appear when I do the search on the actual site’s:
First I use Google and we can see that the results which are presented are far more useful than what is simply presented in the BingItOn tool. I’m given personalized results which are more engaging, presented better, and which have added context and knowledge about the topic.
Contrast that with a search on Bing.com and we can see Bing doesn’t actually make it much easier than the BingItOn tool:
Less engaging, less relevant, and potentially a lot more work to do on my behalf to get a result that I might be interested in.
Here I repeat the result by searching for the term “Adelaide Crows Players” and let’s look at the results:
Google presents me with a scrollable list of the current players with their playing positions at the head of the SERP.
With Bing on the other hand, it appears that the first half dozen results might even be advertisements:
Yet run it in the BingItOn tool and the results are far less clear:
So the message that I take away from the BingItOn tool is this... if we strip away all the stuff that makes Google search great and dumb it down to a certain level, which search engine do you prefer. It's not even a valid question to ask!