Archive for Technology category

Acer Aspire S7 review – two months in

Given my new focus on Windows 8 apps and the loss of my MacBook Pro I was in the market for a Windows 8 laptop.

My requirements were that it had a touchscreen display with at least 1080p resolution, fast (i5 or better with an SSD) and very slim. You’d be surprised at how such simple requirements leave you with such a small selection right now.

I settled on the Acer Aspire S7 although I had a couple of reservations as it supports a maximum of 4GB of RAM and a glossy display. Here’s my thoughts so far after two months of almost-daily use:

Buying experience

I picked up the machine from my local Microsoft Store in the mall. The process was quick and painless and I was in and out in under 10 minutes even though the store was rather busy. I did have to decline a free Windows 8 tutorial but otherwise it was plain sailing.

Unboxing

The product was well packed and nicely presented very much like an Apple product. The similarities ended there however as unlike Apple the box included a bunch of items Apple would charge extra for. These were:

  1. Leather-like slip-cover
  2. Small Acer-branded Bluetooth mouse
  3. USB to Ethernet adapter
  4. Mini-HDMI to VGA adapter

The adapters are very useful, the mouse of no use to me (I only use Logitech G5/G500′s) and the slip-cover I thought would be useful but is a bit unwieldy and it started to break after light use.

Anyone complaining that the machine doesn’t have Ethernet or VGA physically built into the device (I’m looking at you ZDNet) would do well to remember that both those connectors are thicker than this machine and there are plenty of thick klunky machines to choose from if having it built-in is important to you.

There is a good video on YouTube that shows somebody else actually going through the unboxing process.

Display

The tiny 13.3″ display sports almost the same resolution as my 24″ Dell at 1600 x 1080 and at this size and resolution the screen is great. Small text is not unreadable  at the regular DPI and larger text feels smooth and refined.

The touch aspect of this screen is incredible and I’m able to reliably move 8 objects concurrently on the game we wrote called Sticker Tales. The display actually supports ten concurrent touch points but at 13.3″ trying to find space for ten fingers to move is tricky unless you have tiny fingers.

That’s not to say everything about the display is good. As usual the gloss finish is incredibly annoying and within a week it has three indentations presumably from being pressed against small specs when closed against the keyboard although I’ve not seen the actual cause. Thankfully you can only spot them when the screen is mostly dark and the display is very bright and colorful.

Unlike some of the current touch-capable machines the screen on this one doesn’t completely flip over. It can however go completely flat… that might erm, be useful… to someone?

Keyboard

The keyboard is a mixed bunch. The basic layout and feel of the keyboard is good and it follows an almost-flush (2mm raised) chiclet style keyboard with back-lighting. Okay, that’s the good news.

The bad news is that there are no function keys so it’s Fn+numbers for those. The back-light comes on every time you bring the machine out of sleep and you have to tap Fn+U several times to get rid of it. There are a bunch of Fn special keys across Q through O the worst of which is Fn+T which is easily hit and turns off the trackpad with no notification. You’ll be incredibly confused the first couple of times you do this when you meant to press Ctrl+T to open a new tab.

Another annoyance for developers and power users is that the home/page up and end/page down are flush with the left and right arrows. Get used to typos. Symbols and the caps/enter keys are also a bit unusual too. Overall the keyboard feels more style over usability.

Trackpad

The trackpad is probably good enough for most people. Frankly my mind is so hard-wired from the hard-button on my pre-unibody Macbook Pro that I’ve been struggling with buttonless trackpads ever since. Thankfully the included software lets you disable some of the more annoying gestures like zoom if you’re having issues retraining your digits.

Weight and size

I have to admit the weight is awesome and despite my reservations after 4 years on a 17″ laptop the size is great. I really wouldn’t want to go any smaller though and when I get my own personal machine (this Aspire is a work one) later this year it will likely be a 15″ primarily because of the keyboard space limitations on a 13.3″ and the fact I don’t want…

Graphics

Like all sub-15″ ultrabooks you’re stuck with the Intel HD 4000 graphics that are actually embedded inside the Ivy Bridge Intel Core i5/i7 CPU. Yes, even Apple’s 13″ MacBook’s suffer this limitation too.

If you want better graphics performance in an Ultrabook you’re probably going to have to wait until June when Intel’s new replacement for Ivy Bridge comes out and the graphics get ramped again.

Conclusion

This is a great machine for overall regular and light usage but I can’t recommend it to developers.

The lack of function keys mixed with the 4GB RAM limit are going to be painful for users of virtual machines or IDEs. If Acer had sense they would up the RAM on the i7 version to 8GB to further differentiate the two.

[)amien

For the love of pixels

There’s something entrancing about the pixel. Square and elegant and when pushed by the right people they can form beautiful art, stunning animations and gorgeously crisp text.

But as resolution and pixel density increase these building blocks of the screen become smaller and individually insignificant especially as the dpi of displays hits 220+ppi. What once was a building block of art and design becomes nothing more than a indistinct element in a photo-realistic image or a glint in a faux-texture supporting a skeuomorphism.

And so the art style of the visible pixel is doomed… or is it?

Games

Screenshot of Sword and SworceryA resurgence in retro games over the last 10 years has helped keep pixels front-and-center (and sometimes off-screen to the right in the case of horizontal scrolling beat-em-ups).

Minecraft brought 3D pixel art to the mainstream with its wild success across PCs, iOS and even the Xbox. Some people say it’s despite the graphics but I think they’re part of the charm.

Skrillex Quest is a 3D Flash game with textures made up of large pixels and all manner of 8 and 16-bit style graphic corruption that lends to the retro feel while music from the man himself ensures your ears stays as overwhelmed as your eyes.

Sword & Sworcery: EP is a recent discovery for me but its gorgeous 2D landscape, fun story and great sound make for awesome atmosphere. It’s currently available on Steam for the PC or Mac and available from the iOS store too.

LucasArts Adventure Pack on Steam gives you a bunch of point and click adventures including two installments of Indy, Loom and The Dig. They also have a Secret of Monkey Island 1 & 2 Bundle that has updated graphics but your can toggle back to the pixelated 256-color VGA version at any time.

Scott Pilgrim The Game is a fun little horizontal-scrolling beat-up up created a couple of years back. Some of the graphic artists have some great pages up showcasing their pixel animating talents.

Home from Benjamin Rivers is a creepy whodunnit horror mystery where the story unfolds and changes based on your own actions. Who knew pixels could be so creepy.

Art

Fall City by Mark J. FerrarieBoy is a three-man team that has been creating isometric pixel art for years sometimes for magazines and adverts but primarily available as posters and wallpapers and now puzzles too.

Color Cycling revisits the technique of animating hand-illustrated Amiga artwork that achieved the effect of animation simply by cycling parts of the color palette. This effective technique was incredibly space efficient and was something every Deluxe Paint user tried (and likely failed) at some point.

Iotacons by Andy Rash are very low-resolution icons of various celebrities and well known pop-culture figures lovingly adorned in digital format and, on occasion, as a real-world cross-stitch.

DeviantArt have an entire category dedicated to pixel art many of which are lovingly animated. If the cuteness of these pixels doesn’t make you miss them then nothing will.

F David Thorpe produced some great loading screens for computers in the 80s despite their crazy technical limitations. Binary Zone has a great page that highlights some of his best.

Animated backgrounds from various fighting games look beautiful.

Fonts & icons

I’ve covered some great pixel fonts from older 8-bit and 16-bit computers already but there are plenty more great examples to be found:

FontStruct is an online tool that lets you build fonts from blocks and so lends itself well to people wanting to reproduce bitmap fonts. They have almost 500 fonts in their gallery already tagged with ‘pixel’

Semplice Pixelfonts has some beautiful proportional pixel fonts in TrueType format.

Guidebook has screenshots of various pixelated desktops throughout the years including shots of early Macintosh, Amiga, Atari, OS/2 and more.

Fashion

Star Wars pixel shirt from We Love FineThinkGeek have the I See Dead Pixels T-Shirt, the 8-bit tie and the less practical 8-bit hair bow.

WeLoveFine also have a great selection of 8-bit wears just flowing over with pixels.

Red Bubble have a Mac Cursor Icons T-shirt that the original Apple fans can appreciate.

Even sunglasses get the pixel treatment in black or blue… or even regular clear glasses.

In the real word

Cube Craft Pixel Pages consists of a bunch of icons you can print out, cut and fold to create a pixel-deep real-world rendering when placed against a solid surface.

My Desk is 8-bit happened when Alex Varanese wondered what a video-game would look like rendered on his desk. It’s a labor of love 1:18 long video with great chip music too.

Swedish Subway shows that the small square tiles that adorn the walls of subways can be put to creative use when you think of them as pixels such as this homage to video-games.

Playing Cards featuring pixel art including some from video games such as space invaders.

8-bit pop-up cards are a fun way to make a gift card with more pixel goodness.

A love of pixels can however go too far.

Dithering

Wikipedia has an excellent article on the screen resolutions and color capabilities of 8-bit and 16-bit computers. With such few colors available it was necessary to blend colors together to achieve the effect of more colors or shades. This tutorial at Deviantart is a good start although there are a few different algorithms available including the most famous Floyd-Steinberg and the ordered dithering of Windows older users may be familiar with.

Derek Yu, Pixel Schlet and Garmahis provide tutorials showing you how to do it by hand!

Further exploration for those still with me…

Teletext (aka Videotex, Ceefax) was a low-resolution graphics system long before the Internet. It was available in some countries such as the UK via television and some early computer systems (Prestel, Micronet) used it over incredibly slow (1200/75bps) modems although it had a certain charm.

Creating graphics and pages in it was quite a challenge and I actually have a Cambridge University IT Certificate for doing so while at school where we also used a special adapter with our BBC Micro to let them download programs by holding a TV aerial up and waiting a lot. The French also had a system based on this called Minitel which was shut down earlier this year :(

Of course for the ultimate pixels experience you could also just dive back in to the old games such as those provided by Good Old Games (PC) on the amazing World of Spectrum.

[)amien

8 things you probably didn’t know about C#

Here’s a few unusual things about C# that few C# developers seem to know about.

1. Indexers can use params

We all know the regular indexer pattern x = something["a"] and to implement it you write:

public string this[string key] {
  get { return internalDictionary[key]; }
}

But did you know that you can use params to allow x = something["a", "b", "c", "d"] ?

Simply write your indexer like this:

public IEnumerable<string> this[params string[] keys] {
  get { return keys.Select(key => internalDictionary[key]).AsEnumerable(); }
}

The cool thing is you can have both indexers in the same class side-by-side. If somebody passes an array or multiple args they get an IEnumerable back but call with a single arg and they get a single value.

2. Strings defined multiple times in your code are folded into one instance

Many developers believe that:

if (x == "" || x == "y")

will create a couple of strings every time. It won’t.

C#, like many languages, has string interning and every string your app compiles with gets put into an in-memory list that is referenced at runtime.

You can use String.Intern to see if it’s currently in this list but bear in mind that doing String.Intern(“what”) == “what” will always return true as you just defined another string in your source. String.IsInterned(“wh” + “at”) == “what” will also return true thanks to compiler optimizations. String.IsInterned(new string(new char[] { ‘w’,’h’,’a’,’t’ }) == new string(new char[] { ‘w’,’h’,’a’,’t’ }) will only return true if you have “what” elsewhere in your program or something else at runtime has added it to the intern pool.

If you have classes that build up or retrieve regularly used strings at runtime consider using String.Intern to add them to the pool. Bear in mind once in they’re there until your app quits so use String.Intern carefully. The syntax is simply String.Intern(someClass.ToString())

Another caveat is that doing (object)”Hi” == (object)”Hi” will return true in your app thanks to interning. Try it in your debug intermediate window and it will be false as the debugger will not be interning your strings.

3. Exposing types as a less capable type doesn’t prevent use as their real type

A great example of this is when internal lists are exposed as IEnumerable properties, e.g.

private readonly List<string> internalStrings = new List<string>();
public IEnumerable<string> AllStrings { get { return internalStrings; }

You’d likely think nobody can modify internal strings. Alas, it’s all too easy:

((List<string>)x.AllStrings).Add("Hello");

Even AsEnumerable won’t help as that’s a LINQ method that does nothing :( You can use AsReadOnly which creates a wrapper over the list that throws when you try and set anything however and provides a good pattern for doing similar things with your own classes should you need to expose a subset of internal structures if unavoidable.

4. Variables in methods can be scoped with just braces

In Pascal you had to declare all the variables your function would use at the start of the function. Thankfully today the declarations can live next to their assignment and use which prevents acidentally using the variable before you intended to.

What it doesn’t do is stop you using it after you intended. Given that for/if/while/using etc. all allow a nested scope it should come as only mild surprise that you can declare variables within braces without a keyword to achieve the same result:

private void MultipleScopes() {
  { var a = 1; Console.WriteLine(a); }
  { var b = 2; Console.WriteLine(a); }
}

It’s almost useful as now the second copy-and-pasted code block doesn’t compile but a much better solution is to split your method into smaller ones using the extract method refactoring.

5. Enums can have extension methods

Extension methods provide a way to write methods for existing classes in a way other people on your team might actually discover and use. Given that enums are classes like any other it shouldn’t be too surprising that you can extend them, like:

enum Duration { Day, Week, Month };

static class DurationExtensions {
  public static DateTime From(this Duration duration, DateTime dateTime) {
    switch duration {
      case Day:   return dateTime.AddDays(1);
      case Week:  return dateTime.AddDays(7);
      case Month: return dateTime.AddMonths(1);
      default:    throw new ArgumentOutOfRangeException("duration")
    }
  }
}

I think enums are evil but at least this lets you centralize some of the switch/if handling and abstract them away a bit until you can do something better. Remember to check the values are in range too.

6. Order of static variable declaration in your source code matters

Some people insist that variables are ordered alphabetically and there are tools around that can reorder for you… however there is one scenario where re-ording can break your app.

static class Program {
  private static int a = 5;
  private static int b = a;

  static void Main(string[] args) {
   Console.WriteLine(b);
  }
}

This will print the value 5. Reorder the a and b declarations and it will output 0.

7. Private instance variables of a class can be accessed by other instances

You might think the following code wouldn’t work:

class KeepSecret {
  private int someSecret;
  public bool Equals(KeepSecret other) {
    return other.someSecret == someSecret;
  }
}

It’s easy to think of private as meaning only this instance of a class can access them but the reality is it means only this class can access it… including other instances of this class. It’s actually quite useful for some comparison methods.

8. The C# Language specification is already on your computer

Providing you have Visual Studio installed you can find it in your Visual Studio folder in your Program Files folder (x86 if on a 64-bit machine) within the VC#\Specifications folder. VS 2010 comes with the C# 5.0 document in Word format.

It’s full of many more interesting facts such as:

  • i = 1 is atomic (thread-safe) for an int but not long
  • You can & and | nullable booleans with SQL compatibility
  • [Conditional("DEBUG")] is more useful than #if DEBUG

And to those of you that say “I knew all/most of these!” I say “Where are you when I’m recruiting!” Seriously, it’s hard enough trying to find C# devs with a solid understanding of the well-know parts of the language.

[)amien

Using your Xbox Kinect as a webcam for Skype on Windows

Thanks should go to ScottOrange on the MSDN forums however it’s along thread that has lots of pieces to pick out and try.

Still getting odd noise, corruption and other issues in Skype. Wouldn’t recommend using a Kinect as a webcam on Windows right now.

What worked for me (eventually):

  1. Download the Kinect SDK from Microsoft
  2. Install the Visual Studio 2010 Runtime if you don’t already have it
  3. Go to the KinectCPP site and download KINECTSQM.DLL and MSRKINECTNUI.DLL
  4. Create a folder for your Kinect camera drivers to live and copy those two files there
  5. Go to Wildbill’s Github repo and download the three files there into the same folder
  6. Open a Command Prompt as Administrator and CD into the folder
  7. Type install and press return

You should get a success message. If you don’t then you probably missed steps 2 or 3 – if all else fails open KinectCam.ax in Dependency Walker and see which DLL it claims it can’t find. (the IESHIM one missing is fine)

Restart Skype and see if it shows up in the list of cameras. If it doesn’t.

  1. Quit Skype entirely
  2. Go to %appdata%\Skype\shared_dynco in Windows Explorer
  3. Delete dc.db
  4. Restart Skype

[)amien