Entries:
Comments:
Discussions:

Loading user information from Channel 9

Something went wrong getting user information from Channel 9

Latest Achievement:

Loading user information from MSDN

Something went wrong getting user information from MSDN

Visual Studio Achievements

Latest Achievement:

Loading Visual Studio Achievements

Something went wrong getting the Visual Studio Achievements

Discussions

Herbie Smith Dr Herbie Not dead yet.
  • Universal Windows App Programming -- not all it's cracked up to be.

    I'm resurrecting this thread as I now find I have some time to write a wrapper to hide the (IMHO) appalling API design that is ApiInformation.IsApiContractPresent. If the wrapper is good enough, I'll open source it.

     

    So, opinions on how to design the library, taking the 'VibrationDevice' as the starting point. Which seems like the better API:

    1. A static class where you just call

    VibrationDevice.Vibrate(TimeSpan.FromSeconds(2));

    And if there is a vibration device it will be used, but if there isn't nothing will happen (optional return value indicating whether it happened or not).

    2. The same format as the MS VibrationDevice class where you call

    var device = VibrationDevice.GetDefault();
    device.Vibrate(TimeSpan.FromSeconds(2));

    But without the nasty exception throwing, using a NullObject replacement to perform the empty implementation.

     

    I'm currently leaning to option 1 as it seems cleaner to call (being just a hardware interface) rather than having to create an instance using a static factory method.

    Other opinions are sought.

  • Anyone know any big things to download? :-)

    Unfortunately, most places with big things to download limit download speeds (usually to about 4Mb/s).

    But you can at least stream an HD movie to watch while you wait ...

     

  • Does this page open for you in IE or any browser?

    Works in Edge on Windows 10 -- grey screen for a couple of seconds before the loader displays.

     

  • October 6th ​Announcemen​ts

    Personally, I've got fingers crossed for the Windows Phone 10 release ...

     

  • Microsoft Big IoT announcement

    @kettch: Well sod it; I only bought a band about a month ago and now v2 is about to be announced ... :@

  • Universal Windows App Programming -- not all it's cracked up to be.

    @RamblingGeekUK: Run that code on your desktop Windows 10 device and it will throw an exception. That is not very 'universal'.

     

     

  • Universal Windows App Programming -- not all it's cracked up to be.

    A small rant ...

    Well I decided to dive in and take a look at re-writing one of my older Phone Apps as a Universal app for Windows 10.  Nothing too complicated, just a stopwatch and countdown timer.

    Came to the point of alerting the user.  Well, I thought, if it's able to vibrate the device that should happen.  So I looked up the code and found VibrationDevice.GetDefault().  Perfect, I thought, if there's a vibration device I'll use it and if there isn't a device I won't:

    VibrationDevice.GetDefault()?.Vibrate(TimeSpan.FromSeconds(1));

    Nope.

    If you call VibrationDevice.GetDefault() on a Windows device, it doesn't return null, it throws an exception. 

    An exception!?

    So trying to figure out if there is a vibration device available when there isn't one is an exceptional circumstance worthy of an error?

    FFS, framework team, for things to be properly 'universal' you're going to have do fix querying for device capabilities better than this! Let me know when the frameworks finished properly.

    I feel slightly better for getting that off my chest.  Thanks.

     

     

     

     

  • Should I trust my DBMS?

    Well, the 'correct' way to do it would be to re-query the database, just in case there are advanced techniques like calculated columns or triggered updates that would not necessarily show up in your entities before being saved.

    However, that adds quite a burden to the database so you might just go with using the in-memory data in the first instance but try and structure the code in such a way that it will be easy to change to read from the database should the need arise in the future.

  • Barry's angry

    "NO! I said I am my OWN hero!"

  • Working with ADO.NET, Entity Framework, Linq to whatever ...

    I still find myself using ADO.NET Datasets -- they're disconnected from any kind of 'session' and they keep their own change-tracking so you can pass them around easily for processing and then pass back for updating in the database.  I have a library of extension methods to make them a bit easier to use and to optimise serialisation.

    The only issue is a lack of async support which I suspect is more to do with MS resources than any technical reason. Have they open sourced ADO.NET yet?