Thursday, 15 July 2010

.NET SerialPort Woes - Zach Saw's Blog

.NET SerialPort Woes - Zach Saw's Blog

Very interesting post regarding a potential bug in .NET serial port implementation.

Monday, 12 April 2010

Get name of current Windows user

This function returns a string of the currently logged in user on Windows. An empty string is returned if a valid name cannot be obtained.

   1:  /// <summary>
   2:  /// Returns the name of the currently logged on Windows user.
   3:  /// </summary>
   4:  /// <returns>
   5:  /// Current user logon name string. Returns an empty string if a valid name cannot be obtained.</returns>
   6:  private static string GetWindowsUserName()
   7:  {
   8:      System.Security.Principal.WindowsIdentity win_id = null;
   9:      string userName = String.Empty;
  10:   
  11:      try
  12:      {
  13:          // Get an object with details about the currently logged on Windows user.
  14:          win_id = System.Security.Principal.WindowsIdentity.GetCurrent();
  15:   
  16:          // Get current user domain name and logon name strings.
  17:          // [0] = Domain name.
  18:          // [1] = Logon name.
  19:          string[] names = win_id.Name.Split(new Char[] { '\\' }); // win_id.Name returns "Domain\Logon"
  20:   
  21:          if (names.Length == 2) { userName = (names[1]); }
  22:      }
  23:      catch (System.Security.SecurityException)
  24:      {
  25:          // Retrieving Windows user details failed so ensure returned name is an empty string.
  26:          userName = String.Empty;
  27:      }
  28:      finally
  29:      {
  30:          // Dispose of windows identity object.
  31:          if (win_id != null) { win_id.Dispose(); }
  32:      }
  33:   
  34:      return userName;
  35:  }

Sunday, 7 March 2010

Google Reader - Too USA obsessed.

I have been using Google's Reader application for a while now and have had no problems. It's very easy to use, it does all I need it to do and everything is ok in general. One thing bothers me though, and that is the recommendations feature. As I understand it, this should present selections that it think may be of interest based upon things that you select as 'Like' and possibly your browsing activity. Maybe other criteria too, I don't know.

Despite this, almost everything that is presented to me in 'Recommendations' is American based. American news, American sports, American TV, American bloody Idol, yada, yada, yada.

Now I don't have anything against Americans, but there IS a world outside the good ol' US of A.

Monday, 22 February 2010

ASUS Eee PC 1201N netbook. Why are we waiting?

The potentially mould-breaking ASUS Eee PC 1201N netbook was released in the US during November (or possibly even October) which allowed a lucky few living on the other side of the pond to find one under the Christmas tree.

Fine, ASUS have to roll out their shipments and as I assume that the US is the largest market, it is only natural that they come first. As for the UK, an initial availability date was set for January. Indeed, Amazon UK listed this netbook on the 6th January with an initial delivery estimate of '1 to 3 months'.

Yet here we are on the brink of March and they are still as rare as rocking horse s**t, with Amazon STILL quoting '1 to 3 months' estimated delivery. Quite why the estimate cannot be any more accurate than that escapes me.

Come on ASUS, pull your finger out. Why does it take FOUR MONTHS (at least) longer to release it over here?

UPDATE 01/03/2010:
Well, the first of March is here, and still no sign of this netbook appearing in the UK. In fact, a review of various online sellers show that shipping dates are slipping even further, and yup, Amazon still shows '1 to 3 months'. Unbelievable.

UPDATE 26/03/2010:
Finally, FINALLY got this delivered after much shenanigans with Amazon UK's delivery agent HDNL (Home Delivery Network Limited.) Tales of woe include 'unable to find address', 'delivery van breakdown' and 'unable to contact driver'. I was almost too scared to open the box in case I found something else entirely within it. However, it is all present and correct.