All posts by Steven

Why you should not shop at TigerDirect

On the hunt for a new TV during the 2013 Black Friday madness I saw that TigerDirect had a normally $499 TV for $299. Seemed a great deal and the convience of getting it shipped directly to my house wihout having to deal with waiting queues.

So I thought.

The first TV arrives, I gleefully unpack it and set it up – oh so shiny. Turn it on an experience a true “ah shit” moment. A crack in the lower right corner about 4″ in length. Sigh… So packed it up contacted TigerDirect got an RMA and sent it back. Another week I will wait for my exchange process.

The second TV arrives. I again with much excitement anticipate the elusive OOB experience and unpack the TV. But wait, the cords are not just right. They are not perfectly machine liked rolled together they are more like wrapped around themselves like someone put it together in haste. Humm. Oh well keep going I say to myserlf, ah, where is the remote. There isn’t a remote in the box. I must have missed it, turn the box over look under the packing thingies. Damn it! Moving my hand around the TV I realize there is only a single button as well – a power button. Well suffice to say its an experience trying to change the input and do the initial setup without a working remote. I ultimately was lucky enough to find a Uverse Remote Code that controls the TV just enough to work the menus and toggle power.

So back to my computer to contact TigerDirect thinking (obviously foolishly) that I would just ask them to send me a remote to go with this obviously returned (most retailers call that sort of merchandise an “Open Item”) TV.

The online chat button brings this conversation;

Please wait while we find an agent to assist you…
All agents are currently busy. Please stand by.
You have been connected to Relvin Borbolla.
Relvin Borbolla: Thank you for contacting us today, how may I assist you?
Steven Hildreth: Hello I ordered a TV, it came it was cracked. I got RMA sent it back received second TV – it was an open item and does not have a remote.
Steven Hildreth: I don’t think its fair that the second TV sent to me is an Open Item, I didn’t order an Open Item and I don’t know why its Ok to send an Open Item as a replaced for a defective item.
Steven Hildreth: It’s nearly impossible to use this TV without a remote.
Relvin Borbolla: Please contact the manufacturer directly at (800) 701-0680 for further assistance in order to get a remote.
Relvin Borbolla: We apologize for any inconvenience.
Steven Hildreth: Uhm wait, the item sent to me from TigerDirect is a return of someone else, the manufacturer isn’t going to help me as its not their issue.
Steven Hildreth: Its TigerDirect’s problem, as they sent me the TV without a remote.
Steven Hildreth: The second TV was clearly a return as the cords were not in original packages.
Relvin Borbolla: So you want to return it for a replacement again?
Relvin Borbolla: Unfortunately, we do not carry the remote for this item.
Relvin Borbolla: That is why you need to contact the manufacturer for the assistance.
Steven Hildreth: So I have two options; 1. Send the TV back to TigerDirect a second time to get a third TV that has a remote or 2. Purchase a TV remote (which should be included with the TV and would be if TigerDirect wasn’t sending out returned incomplete merchandise). Is this correct?
Relvin Borbolla: We can still process a return for an incomplete item for a replacement.
Relvin Borbolla: You can contact first the manufacturer in order to get a remote on
this item so you cannot return the item and wait for the replacement in 2-3 days.
Relvin Borbolla: Is there anything else I can assist you with?
Steven Hildreth: No you have helped me realize why I should not
solicit TigerDirect in the future. I will purchase a replacement remote on my own. Good day.

So to recap; TigerDirect thinks its Ok for them to replace a defective item with an returned (read: used, returned, “Open Item”) and seemingly an incomplete returned item at that. Furthermore its also Ok that when the customer calls asking for the missing pieces of the item to tell them to contact the manufacturer or return the item again (how lucky do you feel?).

With the likes of Newegg, Amazon and Best Buy I personally will not bother TigerDirect again to have to deal with seemingly unreasonable expectations with customers.

30 Days with IE11

I decided that when I installed Windows 8.1 I was going to give Internet Explorer 11 a try. Put aside my historical prejudices and see if in fact IE11 is a better IE. Well I used it as my exclusive primary browser for 30 days on my home machine. No Chrome and no Firefox (other than developing against, yay! Firebug).

After 30 days (that’s today) I am moving back to Chrome. I can say that IE11 is infact a better IE, in fact I can say its (and I almost have to clinch my teeth to get this out) isn’t a horrible browser. There are some great improvements in particular with the Javascript and HTML engine and I was more than once impressed at how fast the rendering engine rendered a busy page.

That’s right I said it, IE11 isn’t the scourge that IE once was, and in fact I will go so far to say that IE11 is actually a decent browser. If your wondering “well if its not so bad why are you going back to Chrome?”.

Simple IE11 has improved the experience for the user when surfing the internet when using Internet Explorer, however its still IE. What?! Meaning the internet is still written to handle IE in a “different” way. Several websites have IE specific coding and CSS layouts because of the IE of yesterday. It’s a real pain to have to add a site to the “Compatibility View Settings” so that IE11 renders that page like IE10 – just to get the page to work.

Why do I like Chrome better than Firefox? One simple reason: it syncs better with my Google account. I use Chrome on several computers and its awesome to have my bookmarks, passwords, history synced up across those machines – and to have that all linked with my Google account. I know Firefox has a sync capability but its with Mozilla and frankly its not as slick as the integration you get with Chrome and Google.

My Pylons (Pyramid) Notes

I had this idea that I would make a new site using Pylons as the framework. So I headed over to www.pylonsproject.org and I see that its no longer Pylons its Pyramid. Ok so be it.

Well download the doc and I find out the Pyramid guy doesn’t seem to like MVC for web development, eh?:

You Say Pyramid is MVC, But Where’s The Controller?
The Pyramid authors believe that the MVC pattern just doesn’t really fit the web very well. In a
Pyramid application, there is a resource tree, which represents the site structure, and views, which
tend to present the data stored in the resource tree and a user-defined “domain model”. However,
no facility provided by the framework actually necessarily maps to the concept of a “controller”
or “model”. So if you had to give it some acronym, I guess you’d say Pyramid is actually an
“RV” framework rather than an “MVC” framework. “MVC”, however, is close enough as a general
classification moniker for purposes of comparison with other web frameworks.

So right off the bat i got a bad taste as I personally *LOVE* MVC and I cannot understand why anyone with any real experience in using it would say otherwise in a decent size web application.

At any rate I start to get into Pylons, er excuse me Pyramid, kudos to that team for some great documentation. After reading, perhaps browsing is better stated?, the 700+ page PDF I decided its not really the framework I would use in any production environment.

Why? Well several things struck me as very odd;
1. The author of a web framework doesn’t like MVC – yea really that’s a big deal for me.
2. Since its not using “controllers” per say its a bit confusing the “routing” – again a hangup for me with my MVC heavy background.
3. Too many choices. Yes really this is a complaint. I say this as the docs point out 3 ways to do something good, but really nothing done well. I rather take an opinionated stance and show how to do what you think is best – well.
4. Seems either over enginered or just complicated by the many config files; setup.cfg, *.ini, setup.py.
5. Static asset routing seems really odd. I guess I expect to just set a route to a path and that automatically serve requests for objects in that view. Meaning I would expect “/favicon.ico” is served via a route setup pointing “/” to a folder – not having to setup a static route for every file.

Its an interesting framework, just not for me. I kept reading the documentation thinking – this would be so much easier and cleanly implemented in MVC.

Ah well onto CherryPy.

Ruby Impressions So Far

Well I have decided to try to learn Ruby and see what I can create with its web frameworks (something like Sinatra or even Rails). So I picked up a couple of books and started reading.

So far here are my (read; from a long time C# developer) Ruby take aways.
* Class inheritance is single (like C#) but you can include unlimited number of “modules” as you like
* All Classes are partial.
* Basic built in classes is small set; Fixnum, Bignum, String, Range, Array and Hash
* Several of the “methods” do different thing based on case, ie “%w” and “%W” string delimiter – eek
* The inclusive and exclusive range of “..” and “…” is well weird.
* True, False, “0” and “1” are all logically “true” and only nil is “false” – uhm wow; this seriously tweeks my head.
* An array can contain any type (or object) which means “Array” is like Dictionary
* .freeze will let you make a class that cannot be modified – but evidently you will be ostracised by the Ruby community for using it.
* Class “Attributes” are like Clas Properties.
* The distinction between “@variable” and “@@variable” is that the single is instance variable and double is class variable (persists, think const).
* Methods (code that is def … end) doesnt need a “return” it magically returns the last value in the method. This is very strange to me as I want to see the “return batman;” – syntactical sugar I realize.
* Mixin method inheritance call is seemingly backwards from constants in their order of location. Is this just to confuse people? Seems like it to me.
* Same as JS with the ‘==’ and ‘===’ comparison operator. I wish C# had this operation as succient as this. The “is” and comparision of typeOf works but isnt as clear.
* “Unless” conditional statement is interesting. Its like reverse of an “if”.
* Statement modifiers are nice, but I can see it being confusing as its the logic to perform the statement after the statement, but it does make for succient code.
* Case statements dont have “fall through”
* “while” and “until” are opposite. “while” loop is as long as the condition is true, and “until” is until the condition is false.
* “for” loop is like “for each” in C#, meaning you get a local variable in the loop scope for iteration through a variable collection.
* “rescue” is like “catch” in exception handling
* “ensure” is like “finally” in exception handling
* “raise” is like “throw” in exception handling
* Exceptions bubble up the stack if no “rescue” handler is found – exactly like C#
* For a class definition the “<" is the same as ":", ie "class MyError < RuntimeError" same as "class MyError : RuntimeError" * Class method "initialize" is same as "~" * Using the "File.Open ... end" block is like a using() statement, in that the File is closed on block exit. * Threading is much simplier in design in Ruby over .NET threading - much.

Arch Linux + lighttpd + Mono == ASP.NET MVC 3

I had a time getting my cheap linux box hosting configured to host my ASP.NET MVC 3 application. These notes are how I got it working using mono 2.6.10 on my Arch Linux 200510

In this example I setup a directory to host my application (I will get to what files and how later) I placed these files in the ‘/srv/http/mysite’ folder.

1. Install mono, lighttpd and fcgi on the box

pacman -Sy
pacman -S mono lighttpd fcgi

2. Setup lighttpd to use FastCGI edit the ‘/etc/lighttpd.conf’ file and modify this line;

server.document-root    = "/srv/http/mysite"

3. Add this line to the end of your ‘/etc/lighttpd.conf’ file;

include "fastcgi.conf"

4. Put this into your ‘/etc/lighttpd/fastcgi.conf’ file;

include "mono.conf"
server.modules += ( "mod_fastcgi" )
fastcgi.server = (
        "" => ((
                "socket" => mono_shared_dir + "fastcgi-mono-server4",
                "bin-path" => mono_fastcgi_server,
                "bin-environment" => (
                        "PATH" => "/bin:/usr/bin:" + mono_dir + "bin",
                        "LD_LIBRARY_PATH" => mono_dir + "lib:",
                        "MONO_SHARED_DIR" => mono_shared_dir,
                        "MONO_FCGI_LOGLEVELS" => "Standard",
                        "MONO_FCGI_LOGFILE" => mono_shared_dir + "fastcgi.log",
                        "MONO_FCGI_ROOT" => mono_fcgi_root,
                        "MONO_FCGI_APPLICATIONS" => mono_fcgi_applications
                ),
                "max-procs" => 1,
                "check-local" => "disable"
        ))
)

5. Put this in your ‘/etc/lighttpd/mono.conf’ file;

index-file.names += ( "index.aspx", "default.aspx", "Default.aspx" )
var.mono_dir = "/usr/"
var.mono_shared_dir = "/tmp/"
var.mono_fastcgi_server = mono_dir + "bin/" + "fastcgi-mono-server4"

### The root of your applications
# For apps installed under the lighttpd document root, use:
var.mono_fcgi_root = server.document-root

### Application map
# A comma separated list of virtual directory and real directory
# for all the applications we want to manage with this server. The
# virtual and real dirs. are separated by  a  colon.
var.mono_fcgi_applications = "/:."

Make sure you didn’t fat monkey up the conf files by doing this;

$ lighttpd -t -f /etc/lighttpd/lighttpd.conf

Should return a “OK”

Now go into your ASP.NET MVC app and setup the references to be “Copy Local” True on these assemblies (if you don’t have the assembly reference by the project add it, you might need to look in “Assemblies -> Extensions” to find some of these) ;

System.Web.Helpers.dll
System.Web.Helpers.xml
System.Web.Mvc.dll
System.Web.Mvc.xml
System.Web.Razor.dll
System.Web.Razor.xml
System.Web.WebPages.Deployment.dll
System.Web.WebPages.Deployment.xml
System.Web.WebPages.dll
System.Web.WebPages.Razor.dll
System.Web.WebPages.Razor.xml
System.Web.WebPages.xml

Make sure you DO NOT have the Microsoft.Web.Infrastructure.dll file, it doens’t work with Mono and causes errors.

Now just publish your project to a folder somewhere, then go into that folder and get the entire contents to the ‘/srv/http/mysite’ folder. Sure you can setup FTP and all that fanciness but I just use WinSCP and copy directly from my publish folder into the ‘/srv/http/mysite’ folder.

Now start lighttpd on the box and you should have the joy of ASP.NET MVC 3.

Enjoy!

References;

http://www.mono-project.com/Release_Notes_Mono_2.10#ASP.NET_MVC3_Support
http://redmine.lighttpd.net/wiki/1/Docs:Configuration
https://wiki.archlinux.org/index.php/Lighttpd
http://www.mono-project.com/FastCGI_Lighttpd

Just delete the damn folder…

So I run into a problem where there are folders on my “Storage” drive (like drive “D:” that is way bigger than my boot drive) that for some unknown friggin’ reason I am unable to delete, Windows 7 just gives me some run around and makes me want to take a sledgehammer to the damn thing.

So searching around and I found how to delete it; Change the owner the admin, change the acl’s, then use rmdir from cmd line.

Like so (to whack folder “D:\delete_damnit”);

  • Right-click on folder -> Properties -> Security Tab
  • Click on Advanced button -> Owner tab
  • Edit.. button
  • Select Administrators in ‘Change owner to’, check ‘replace owner on subcontainers and objects’
  • Open cmd.exe as administrator
  • Run ‘cacls D:\delete_damnit /T /e /g Administrators:f’
  • Run ‘rmdir /S D:delete_damnit’

Enjoy!

Adventures in dlna with Blu-Ray players

So the wife and I decided that we would get on NetFlix and be able to stream movies versus going out to BlockBuster. We thought we would go ahead and pick up a new Blu-Ray player that has the streaming built in, and hey while we are at it get one that will also be dlna compliant and connect to my Arch linux powered minidlna media server.

Well getting minidlna setup on Arch via Yaourt is super simple, just a “yauurt -S minidlna” and boom installed. Yay for just works! yay!

So onto getting the Blu-Ray player hooked up to stream pictures, music and video from the dlna server, should be easy enough to get a dlna certified player and, ah, it just happen, right? Pffft.

Off to NFM to pick up a Sony BDP-S470 seems they have it on sale for around $125 and from the manufacturer site it has evertyhing and then some.

I set it up and sure it sees the dlna server, plays the pictures and the music but does not see any movies – no avi, mkv, wmv – nothing. Grrrr. I Make sure the dlna server is working by playing movies via the Xbox 360; works fine indeed.

So return that player and then pick up the Panasonic DMP-BD65, heck its on sale for around $90 and from my cursory search on the net it is dlna certified.

Get it home, hook it up. Humm. Where is the dlna part? Look around the web and find out that the dlna part is only for the European market; not available in the US models. Good grief.

Then off to pick up the LG BD-570 its the most expensive one in my adventure, around $165, but it seems to have Wifi built in and it does have the dlna sticker on the box.

Get it home, hook it up. Endure looks from the wife that I am losing my mind and working on becoming some sort of Blu-Ray exporter. Aha! Eureka right off the bat it sees my dlna server and, wait for it …. Yes! it plays the movies, pictures and music just fine.

Sure the WiFi part stutters a bit playing back some 1080p video (Big Buck Bunny ftw!) but connected on the wired it seems to be excellent in both video and audio.

After some more checking the NetFlix and Vudu works as well. Woot!

Enjoy!

Redirect old aspx to new MVC

I upgraded Dvdcrate.com to be ASP.NET MVC and one of the problem is the old pages are indexed by search engines and being served on search results. So I have the old *.aspx page that I need to fix up and send along to the MVC page.

An example of the page in the search database;
www.dvdcrate.com/viewdvd.aspx?upc=5027035006161

And I need it to go to the new MVC controller and action like this;
www.dvdcrate.com/Media/Detail/5027035006161

So I did it this way, I put this in the Global.aspx.cs file;

        protected void Application_BeginRequest (object sender, EventArgs e)
        {
            var requestUrl = Request.Url.ToString().ToLower();
            if (requestUrl.Contains("/viewdvd.aspx"))
            {
                var equalPos = requestUrl.LastIndexOf("=") + 1;
                var upc= requestUrl.Substring(equalPos, requestUrl.Length - equalPos);
                Context.Response.StatusCode = 301;
                Context.Response.Redirect("/Media/Detail/" + upc);
            }
       }

Probably not the most elegant, but it does work.

Enjoy!

jQuery UI Themeswitcher Cookie Expires

So I disagree with the current setup that is the default configuration with jQuery UI Themeswitcher, it expires the cookie at the end of the session. I mean really if the user is going to change the cookie to some color scheme they like chances are its going to be for longer than the current session and for crying out loud the user is going to expect your site to load the theme they selected last – else it looks broken. Just a poor decision in my opinion – so here is how I fixed it to last 1 year.

Download the themeswitcher.js and save it locally wherever you like.

Now add the “cookieName” below this to the options defition in the file;

    var options = jQuery.extend({
        loadTheme: null,
        initialText: 'Switch Theme',
        width: 150,
        height: 200,
        buttonPreText: 'Theme: ',
        closeOnSelect: true,
        buttonHeight: 14,
        cookieName: 'jquery-ui-theme',
        cookieExpires: 365,
        onOpen: function () { },
        onClose: function () { },
        onSelect: function () { }
    }, settings);

Now modify where the cookie gets made to use this new “cookieExpires” option (line 49);

        $.cookie(options.cookieName, themeName, { expires: options.cookieExpires });

Know you can either use the default set here (365) or set your own in the initializer in your calling script;

    $('#switcher').themeswitcher({ cookieExpires: 365, path: '/', loadTheme: "Sunny"});

Enjoy!

Securing ELMAH with ASP.NET MVC

So I like Elmah and its logging of my unhandled exceptions suer, but I don’t need every yahoo with visibility to that. This is the steps I took to only allow Elmah access to users in the “Admin” role and have it still work with ASP.NET MVC.

Put this into the web.config;

  
    
      
        
      
      
        
        
      
    
  

Now put this into your global.asax, up top (before all the other routing) is best;

            routes.IgnoreRoute("admin/elmah.axd");
            routes.IgnoreRoute("admin/{resource}.axd/{*pathInfo}");

You don’t have have any controller action setup, the handler builds this on the fly to handle the incomding axd request. Nice and simple.

Enjoy!