Tuesday, February 8, 2011

Fix No Audio in Live Meeting

Tried to watch mvcConf today and Live Meeting would not give me any audio.

Make sure you have the latest version of Live Meeting:

The fix that worked for me was the change the default Playback Device:
  1. Right click the Audio/Speaker Icon in the Windows Task Bar and select Playback devices
  2. Right click a different playback device and select Set as Default Device

If that doesn't work go back into Live Meeting and play around with the Audio options:
  1. In Live Meeting select the Voice & Video menu
  2. Click Options -> Setup Audio and Video
  3. Try changing the Speaker you want to use.

Thursday, January 20, 2011

Android Browser Issues

Ran into a really frustrating issue with Android's Webkit browser today. I'm using jQuery Mobile in a project but have tweaked it quite a bit. The site works awesome on an iPhone. Android (2.2.1) not so much.

The symptoms:
1) Regular html select inputs where not opening up with the list of options.
2) Certain links and buttons had difficulty registering clicks.
3) One of my text boxes would get scrolled to the top of the page as soon as you started entering text.

The solution?
Make sure -webkit-backface-visibility is not set to hidden on any parent elements. The jQuery Mobile CSS has it set to hidden for the ui-page class. Overriding it for android by setting it to visible fixed all 3 of the above issues.

This took about 6 hours to solve.

Kill me now.

Sunday, January 16, 2011

MVC3 Boilerplate

Every time I create a new ASP.NET MVC3 project there are certain libraries and code I re-use regularly. One of them being HTML5 Boilerplate which I love. I did some googling for "MVC3 Boilerplate" and didn't find anything, so I decided to start my own and placed it here on GitHub.

With every release MVC3 included more awesome out of the box (finally has jQuery AND jQuery UI!), but I'd like to see the option to go further. One of the things I love about Ruby on Rails is it includes more of what you need to get you straight to coding like a de facto ORM (ActiveRecord). I also don't like how complicated AspNetSqlMembershipProvider is and the fact it doesn't store data in cleanly named "Users" table so I decided to add my own simple User class that can be modified and extended.

I'd love to see someone with more experience then me clean up, take over, re-do or otherwise improve on this idea. So feel free to fork my project or make suggestions. I'm not always the best and keeping projects up to date but I'll see what I can do.

Some of the features I've included are:
  • HTML5 Boilerplate
  • Elmah (error logging)
  • JSON Parser (comes in handy when making JSON based ajax calls)
  • Modernizr (part of HTML5 Boilerplate, but awesome enough to warrant its own mention)
  • AntiXSS Library (Most of the places this is used was based on the Tekpub MVC2 Starter Site, I'm probably doing it wrong and/or not using it enough)
  • Ninject (dependency injection)
  • SquishIt (used to compress and minimize javascript and CSS)
  • Sql Server CE (included so you don't need full MS SQL or SQL Express)
  • EF Code First (used as the ORM)
  • Bits from Tekpub MVC 2 Starter Site
  • Basic User Signup using simple POCO User object

I really don't know how much I'll keep this project up to date but even if it helps one person that's enough for me. ;)

    Tuesday, January 4, 2011

    Roku Support 2011 Bug

    This is the fun chat I had with Roku support today. To be fair this was an honest mistake and totally excusable, but what I'm not impressed with is the reason I had to contact them in the first place. I bought 2 Rokus as gifts last year. My sister's Roku had an issue and she contacted their support. They determined it needed to be replaced but they needed proof of purchase which means I had to contact them. Grrr. When I called they only offered a fax number to fax the email receipt from Amazon. I was finally able to get an email from Tom, but after forwarding the receipt they want me to call back later to confirm they got it and to proceed with the RMA. So I have to contact them 3 times to RMA a gift. Kill Me.

    Wednesday, December 22, 2010

    How We're Surprising The Kids with a Disney World Trip

    We booked a trip to Disney World for my fiance's 8 year old daughter and 10 year old son as their Christmas present. Which means we needed a good way to surprise them. I did some Googling and liked a couple ideas:
    • Wrapping up a mylar helium balloon with tickets attached so when the gift is opened the balloon floats out.
    • Putting a "gold ticket" inside a chocolate bar
    • Scavenger hunt
    Since I'm not that good at "arts and crafts" I decided to go with what I knew and make a website. 
    (best viewed using the Google Chrome web browser)

    We plan to surprise the kids Christmas night, so if you know us keep it a secret for a few more days.  ;)

    For any "non-programmers" reading this you can probably stop now. ;)

    For the geeks, I used StaticMatic and TextMate to do the coding. The site is a single page of HTML5 and jQuery (and jQuery UI). You can get the source code here on GitHub.

    The snow was Seb Lee-Delisle's work. It's a bit CPU intensive so if the application feels slow it's mostly due to the snow. The computer we'll be using to surprise the kids is fast enough to not be an issue.

    I modified the jQuery TickerType plugin to type out the "You're going to Disney World" message at the end. 

    If you've never used StaticMatic it's pretty cool. It allows you to use Haml and Sass to do your markup which is a fun quick way to code HTML. Great for a quick static website.

    Since I use pieces of Paul Irish's HTML5 Boilerplate in just about every site I do now (I'm even updating old sites to use it as I work on them) I went looking for a StaticMatic plugin for it and thankfully found staticmatic-boilerplate by Aaron Cruz on GitHub.

    Overall it was a fun break to use StaticMatic and TextMate (and OS X for that matter) versus the Visual Studio 10 environment I currently spend most of my time in.

    But there are two things I'd love to see improved with StaticMatic and/or the Boilerplate plugin:
    1) Make it easier to add jQuery UI to your site.
    2) Make it easier to switch between uncompressed Javascript while developing and the production minified and combined javascript.

    Friday, December 3, 2010

    Fixed: PowerPoint 2010 Crashes When Typing

    I ran into an issue where I'd open Power Point and as soon as I'd type a key into a slide it would lock up and crash.

    The issue seems to be with Boot Camp drivers 3.1 and up which affects Apple hardware running Windows via BootCamp.

    The solution that worked from me was found in this thread on the Apple Discussion forum posted by nallex:
    Open "Control Panel" from the Start Menu
    Select "Clock, Language, and Region"
    Select "Change keyboards or other input methods" 
    Click "Change keyboards..." button
    Click "Add..." button
    Roll down "English (United States)" (if it's not already expanded)
    Select "US"
    Click "OK"
    Click "OK"
    Click "OK"

    Hopefully Apple comes out with BootCamp drivers to fix this issue.

    Monday, November 29, 2010

    .NET WebClient 403 Forbidden Error

    Wasted 2 hours trying to track down the following error when making a simple WebClient DownloadFile request to an Amazon S3 url:
    The remote server returned an error: (403) Forbidden.

    Offending code and Url:
    Uri uu = new Uri("https://zencoder-live.s3.amazonaws.com:443/add9d5d739193c13fcde60d3d7ff5ba7%2Ffe33f4d52e1cff0ef06592ed4041a7dc.mp4?Signature=b%2FXw9ylREb4up4QDw6Tyv9GyQhU%3D&Expires=1291150754&AWSAccessKeyId=AKIAIIEXNN2J4YDTRUVQ");
    using (WebClient wClient = new WebClient())
        wClient.DownloadFile(uu, @"C:\output.mp4");

    I was able to use Fiddler to compare Firefox's request versus my .NET application's request.

    Firefox:GET /add9d5d739193c13fcde60d3d7ff5ba7%2Ffe33f4d52e1cff0ef06592ed4041a7dc.mp4?Signature=b%2FXw9ylREb4up4QDw6Tyv9GyQhU%3D&Expires=1291150754&AWSAccessKeyId=AKIAIIEXNN2J4YDTRUVQ HTTP/1.1

    .NET WebClient:GET /add9d5d739193c13fcde60d3d7ff5ba7/fe33f4d52e1cff0ef06592ed4041a7dc.mp4?Signature%3Db%2FXw9ylREb4up4QDw6Tyv9GyQhU%3D%26Expires%3D1291150754%26AWSAccessKeyId%3DAKIAIIEXNN2J4YDTRUVQ HTTP/1.1

    Notice that .NET is escaping my Url. Particularly the forward slash (%2F). You used to be able to pass a dontEscape parameter to the new Uri constructor but now that parameter is deprecated and is always false.

    Luckily I came across a workaround on StackOverflow by Rasmus Faber:
    Uri uu = new Uri("https://zencoder-live.s3.amazonaws.com:443/add9d5d739193c13fcde60d3d7ff5ba7%2Ffe33f4d52e1cff0ef06592ed4041a7dc.mp4?Signature=b%2FXw9ylREb4up4QDw6Tyv9GyQhU%3D&Expires=1291150754&AWSAccessKeyId=AKIAIIEXNN2J4YDTRUVQ");
    using (WebClient wClient = new WebClient())
        wClient.DownloadFile(uu, @"C:\output.mp4");
    void ForceCanonicalPathAndQuery(Uri uri){
      string paq = uri.PathAndQuery; // need to access PathAndQuery
      FieldInfo flagsFieldInfo = typeof(Uri).GetField("m_Flags", BindingFlags.Instance | BindingFlags.NonPublic);
      ulong flags = (ulong) flagsFieldInfo.GetValue(uri);
      flags &= ~((ulong) 0x30); // Flags.PathNotCanonical|Flags.QueryNotCanonical
      flagsFieldInfo.SetValue(uri, flags);

    Now the code downloads the file like without the error!