Skip to content

Technology articles

A case for my MacBook Pro: Snugg wallet case review  

I did it. Earlier this year I caved and purchased a MacBook Pro 15" Retina after being Mac-less for a few months despite some reservations about the lack of upgrade options.

Finally I had a lovely unibody machine. Now I needed something to prevent the beating my 17" acquired over the years – something with a bit of padding to prevent the occasional bump as my backpacks tend to be very thin.

Imagine my surprise when the people at Snugg asked if I was interested in a free case to review. I’d been considering something quite plain but my eyes lit up at their Snugg MacBook Pro 15 Wallet Case in Brown Leather.

The case arrived a few days later and you can just smell the leather. The outside is a slightly rough texture (on the brown at least) with very neat stitching while the inside is a very smooth microfiber – presumably to ensure the MacBook slides in nicely.

Front of my MacBook Pro case.

The front flap snaps down with quite a strong magnet – a worry for the older magnetic hard drive machines perhaps but not a concern for people with SSD drives. It also features a small business card holder and the back has a full-width pouch that easily fits a few documents.

The fit is great, it is indeed "snugg" without being tricky to remove. Despite providing good protection the case isn’t bulky and fits nicely into my backpack and on one occasion I’ve just carried it as-is. Hmm I wonder if you could attach a shoulder-strap…

Side view of my MacBook Pro in the case.

I’ve taken to putting the case under my laptop – the slightly thicker top angling the laptop keyboard to a more comfortable position.

Overall a very nice case – I might grab one for my iPad and my wife has made it known to me that she’d quite like one too!

[)amien

Probable C# 6.0 features illustrated  

C# 6.0 is now available and the final list of features is well explained by Sunny Ahuwanya so go there and try it with his interactive samples page.

Adam Ralph has a list of the probable C# 6.0 features Mads Torgersen from the C# design team covered at new Developers Conference() NDC 2013 in London.

I thought it would be fun to show some before and after syntax for comparison and in doing so ended up with a few thoughts and questions.

1. Primary Constructors

Shorter way to write a constructor that automatically assigns to private instance variables.

Before

public class Point {
    private int x, y;

    public Point(int x, int y)
        this.x = x;
        this.y = y;
    }
}

After

public class Point(int x, int y) {
    private int x, y;
}

Thoughts

  • Do you need to independently define x and y?
  • Can you still write a body?
  • How would you make the default private?

This solution feels too constrained, would have preferred something like:

public Point(set int x, set int y)

That set the property and optionally created a private one if it didn’t. Would allow bodies, use on multiple constructors etc.

2. Readonly auto properties

Readonly properties require less syntax.

Before

private readonly int x;
public int X { get { return x; } }

After

public int X { get; } = x;  

Thoughts

  • Love this.
  • Very useful for immutable classes.

3. Static type using statements;

Imports all the public static methods of a type into the current namespace.

Before

public double A { get { return Math.Sqrt(Math.Round(5.142)); } }

After

using System.Math;
...
public double A { get { return Sqrt(Round(5.142)); } }

Thoughts

  • Not something I’ve run into often but no doubt very useful for Math-heavy classes.
  • Could be useful for Enumerable LINQ-heavy classes if it works with static extension methods.

4. Property Expressions

Allows you to define a property using a shorthand syntax.

Before

public double Distance {
    get { return Math.Sqrt((X * X) + (Y * Y)); }
}

After

public double Distance => Math.Sqrt((X * X) + (Y * Y));

Thoughts

  • Small but useful syntax reduction.
  • Has nothing to do with System.Linq.Expression despite the name.

5. Method Expressions

Allows you to define a method using a shorthand syntax.

Before

public Point Move(int dx, int dy) {
    return new Point(X + dx1, Y + dy1);
}

After

public Point Move(int dx, int dy) => new Point(X + dx, Y + dy);

Thoughts

Same as Property Expressions.

6. Params for enumerables

No longer need to define your params methods as an array and force early evaluation of the arguments.

Before

Do(someEnum.ToArray());
...
public void Do(params int[] values) { ... }

After

Do(someEnum);
public void Do(params IEnumerable<Point> points) { ... }

Thoughts

  • Can have params methods for IEnumerable and array side-by-side? Probably not.
  • Is evaluation deferred until evaluated if you pass a single IEnumerable instead of a params?

7. Monadic null checking

Removes the need to check for nulls before accessing properties or methods. Known as the Safe Navigation Operator in Groovy).

Before

if (points != null) {
    var next = points.FirstOrDefault();
    if (next != null && next.X != null) return next.X;
}   
return -1;

After

var bestValue = points?.FirstOrDefault()?.X ?? -1;

Thoughts

Love it. Will reduce noise in code and hopefully reduce null reference errors everywhere!

8. Constructor type parameter inference

Removes the need to create static factory methods to infer generic types. This is helpful with Tuples etc.

Before

var x = MyClass.Create(1, "X");
...
public MyClass<T1, T2> Create<T1, T2>(T1 a, T2 b) {
    return new MyClass<T1, T2>(a, b);
}

After

var x = new MyClass(1, "X");

Thoughts

  • Another great addition.
  • Does it understand list and collection initializers to automatically determine the generic types too?

9. Inline declarations for out params

Lets you declare the out variables inline with the call.

Before

int x;
int.TryParse("123", out x);

After

int.TryParse("123", out int x);

Thoughts

  • Not a particularly large syntax reduction.
  • Shorter code for Try methods and DirectX.

Wrapping up

Hopefully there are a few more gems to come that would help reduce noise. Would especially like to see syntax that wired up an interface to an internal instance variable where not specifically overridden to aid in encapsulation, e.g.

public MyClass : IList => myList {
  private IList myList;

  public Add(object item) {
    // Do something first
    myList.Add(item);
  }
}

[)amien

Windows media keys on a regular keyboard  

Many full-size Windows keyboards come with extra buttons some of which are of questionable value but the volume and music controls are useful especially if you’re a programmer that likes to listen to music all day.

Unfortunately my two keyboards of choice (DAS Ultimate and Topre Realforce) do not come with such controls. Neither does my MacBook Pro but Apple do the elegant thing and repurpose some of the function keys.

Apple media control keys

If only I could do that on my keyboards and take advantage of the Windows global music controls. (It also makes testing a bit easier if you support background music playback in your Windows Store apps). In fact Windows 8 even has a great little pop-up that comes up to show you what you’re doing:

Windows 8 music overlay

Thankfully with the help of the wonderful AutoHotkey you can. This great little tool lets you remap keys globally or per-app and even put some scripting and macro’s in place to really take control of Windows.

My keyboards don’t have a Fn key like the Mac but given the Windows key is the modifier for system shortcuts we can repurpose that! Once you’ve unpacked and run AutoHotkey simply right-click on its system tray icon and choose Edit This Script then paste the following into the Notepad Window that opens and hit save:

; Windows Media controls in Mac positions
#F7::Media_Prev
#F8::Media_Play_Pause
#F9::Media_Next
#F10::Volume_Mute
#F11::Volume_Down
#F12::Volume_Up

Now simply right-click on AutoHotkey and choose Reload This Script and enjoy Windows media controls on your laptop or regular keyboard!

[)amien

Experiencing Chromecast – my review  

My eagerly-awaited Chromecast arrived a couple of weeks ago. Despite the reports that Google had run out of Netflix codes my 3-month streaming code arrived a few days before by email – a great deal given that it is also valid for current Netflix customers too.

Setup

The requirements for using a Chromecast are:

  • HDMI-capable display
  • 2.4 GHz 802.11 b/g/n Wi-Fi network
  • iOS device, Android device or laptop with Chrome

The box

The box was quite small but contained everything you need and a couple of things you might not, specifically:

  1. Chromecast device – with HDMI at one end and Micro USB at the other
  2. Micro USB to USB cable – to provide power to the device
  3. HDMI extension cable – if Chromecast is obstructed from fitting in your HDMI port
  4. USB wall socket adapter – if you don’t have USB ports available

The device itself is a rather small affair about twice as long as a HDMI connector and a little wider and thicker.

Power

Some people are upset that it needs a USB power cable given the promo shots show no such cable.

HDMI however only supplies 50mA of power wile USB supplies 500-900mA. Chromecast is a small computer with 1080p output and Wi-Fi so it’s going to be needing a lot more than HDMI can supply. If you were hoping HDMI 1.4 would address that you’ll be disappointed.

Given that your options are:

  1. Plug USB cable into TV USB socket (if it has one that is always-on)
  2. Use included USB wall socket adapter
  3. Find something in range with an always-on USB socket

Configuration

My Yamaha receiver/amp is the hub for my system and all devices have to go through to get sound (it also makes switching device simpler).

My amp lives in a small confided space below my TV which reduces the Wi-Fi range but the Apple Time Capsule is near enough for a strong single and indeed the spare USB port it has provides power.

Connecting Chromecast to an amplifier

Once connected and powered up you’ll be presented with something like this on your screen which cycles through one of many beautiful background images both during setup and when idle. I’m not sure if the images are location-aware or Google chose it because they’re also in the bay area.

Chromecast setup on TV

Cromecast starts up with it’s own temporary wireless network. Then you download one of the two setup programs for either Mac or Windows and it will switch you to that network (with no warning, I hope you weren’t downloading anything) and will prompt you for your Wi-Fi details. With any luck it will switch Chromecast over to that and it’s up to you to switch your machine back.

A WPS option would have eliminated the need for downloads and disconnects but given how few people know about WPS (it’s very hidden away on my Time Capsule) it’s an understandable omission.

Netflix Playback

iPad

The Chromecast is a very lightweight device and as such you need another device to control it. My wife and I both have iPad’s that are normally nearby so this is primarily the source of plays.

Basically the app looks as normal however you’ll see a little icon at the top right. I’m going to call this the “cast” icon as it’s also used in YouTube and the Chrome Cast plug-in. Tapping it shows which of your devices to play on. If something is already playing you get a blue bar at the top to let you jump in to control it:

Netflix + iPad asking what to play on Netflix + iPad showing already playing

Once the show or movie is playing you get artwork for the show and a bunch of controls to move forward/backward, change audio and subtitle options or go back. Hidden behind the stack of cards at the top is the episode menu for switching episode or season. This is useful as there isn’t yet a “post-play” experience to take you to the next episode automatically.

I ran into a problem that should your HDMI link be interrupted or your iPad sleep you may get the error I captured below. If you do you’ll need to quit the Netflix app and restart it to regain control.

Netflix + iPad showing already playing Netflix + iPad showing connect error

Android

Netflix for Android behaves in a very similar way to the iPad – the same blue bar while playing and a very similar during-playback experience and menu button. I’ve not included screenshots because it is so similar but I can put them up if anyone asks :)

Web/Silverlight

Running the Silverlight based player from the website also reveals the cast icon tucked between subtitles and sharing on the playback control but only if it is running within Chrome and the extension is installed. This works on both the PC and the Mac despite Silverlight for Chrome on the Mac never becoming officially supported by Microsoft.

Netflix + Silverlight showing play on

Firefox, Safari and Internet Explorer users are out of luck for now although it there is a possibility that Windows 8.1 and IE 11 with HTML5 based playback may have the option – I’ll have to try it and report back. (Windows 8.x DRM doesn’t work in a virtual machine)

Chrome

YouTube

I have a love-hate relationship with YouTube. I love the wide variety of content but hate the duplicate content, poor encoding, confusing channel organization, re-buffering and choppy full-screen performance on Chrome for Mac. (Works fine in Safari, how odd)

Thankfully Chromecast solves a couple of these. Re-buffering and full-screen performance are great here. Just find your video and hit the cast icon at the bottom right to choose where to start it in a similar way to Netflix.

YouTube asking what to play on

When it’s already playing the Chrome Cast extension gets involved and shows you what is going on:

Chrome Cast extension showing details

If you try clicking this icon to cast either YouTube or Netflix you’ll get a warning telling you to use the icons within the players themselves. This is a bit clunky and I would imagine Google will improve the interop here in the future so you can just always use the Cast button.

Web

As well as video streaming you can browse web sites from Chrome using the Cast extension. Simply hit the Cast button on the toolbar and choose again where you want it to go:

Chrome Cast extension menu

There are also various options available to control how things look on the screen.

Chrome Cast extension options

Rendering quality is okay from a distance but a mess close-up most likely due to the 720p limit and some sort of scaling going on. 1 pixel lines and curves are a mess as is small text.

Usability is okay as long as you are looking at your laptop and not your TV as there is no mouse pointer, context menus, toolbars and a second or two of lag even over fast solid Wi-Fi.

Weirdly selected text shows as selected and web sites with hover effects show that effect even with no mouse. I think these omissions and inclusions are simply the result of what Chrome renders via Webkit rather than a rational set of choices.

Oddly I received performance warnings on a MacBook Pro 2.6 GHz with no major apps running.

Desktop sharing

Usability and screen display quality were massively improved by choosing the semi-hidden and experimental “Cast entire screen”:

Chrome Cast desktop sharing option

This could give offices a very cool and simple way to setup sharing for presentations in Keynote/PowerPoint without the dreaded hunt for the right cable or adapter that always seems to happen.

Lag was also improved when dropping down to lower resolutions.

Suggested improvements

It’s a great device but there is always room for improvement. I’d like to see:

  1. More video streaming services – Hulu & Amazon Prime
  2. Some music streaming services – Spotify & Pandora
  3. DLNA streaming support for existing media/libraries
  4. Native Mac OS X & Windows drivers to add Chromecast as additional wireless display
  5. Configure a source for background images when not in use

More streaming services are coming so that’s covered.

Getting DLNA support (or indeed Airplay for Mac loving friends) will probably require some open source efforts. Thankfully Google have the start of a Google Cast API/SDK available so that should just be a matter of time.

The wireless second display option would be awesome for developers, testers and presenters. Let’s hope somebody figures that out.

Conclusion

The Chromecast is a great device.

From the time we switched it as completely taken over our Netflix home viewing. We were using an Xbox 360 but the Chromecast:

  • is faster to launch
  • is quieter
  • supports 1080p (the Xbox runs native 1080p on only a handful of titles, everything else is hardware upscaled)
  • supports Netflix profiles
  • doesn’t play cheesy UI effect noises through my surround system
  • uses less power

Additionally instead of watching YouTube on our laptops we just cast them over to the big screen and sound.

For $35 it’s an absolute steal.

[)amien

Disclosure: As a former Netflix employee I have stock options in Netflix.