/* BeejBlog */

JS Stack circa 2013Q4

A few technologies that have crystalized in the last couple years really help bring javascript development up to parity with how robust things were under Silverlight & C#/.Net framework.

  • nuget - the tight integration that nuget brings to our whole universe is huge... at first nuget was new and like, neat that's "handy"... but at this point it would be total madness w/o it... searchable repository where all these new libraries are easily managed ... easy to check versions and update to the latest... bringing all these scripting dependencies into a project as formal "references" (just like .Net assemblies) really helps keep you out of javascript hell
  • requires.js - a fairly automatic "include"/dependency management system for all the interdependent JS libs that have to get pulled into the client at runtime... it used to just be jQuery but the JS lib stack has exploded out into literally dozens of includes that all piggyback eachother and w/o a management wrapper around that we'd have to get the <script> file references in the correct order on every browser page... another big potential for madness avoided
  • bundling & minification - the latest VS2012 MVC project templates come bundled with support for taking all these raw scripts and bundling them into one big file, this means the web client is only making one optimal request for it's "framework" rather than 20 async requests for each individual script library before it can start rendering the dang page page ... that big file is also "minified", meaning all the white space is removed so it's as small of a network download as possible... both of those together are pretty huge in the new scheme of things
  • "LESS" - basically CSS syntax revamped to support variables and generally less repetitive syntax ... it's a huge deal when you want to set some basic highlight colors & metrics and have everything else reference those as variables so that it's easy to change your look and feel by tweaking the core variables used in all the other element styles... it's easy to configure your MVC project to automatically compile LESS into native CSS for the browser to consume what it understands... there are other CSS wrapper syntaxes out there... SASS is another one
  • make sure you get the VS 2012 Web Essentials add on - it does all kinds of handy little nice to haves like automatically showing you you a little image popup when you hover over a reference (in CSS as well)... shows html color tags with a little color block popup... etc. etc.
  • Resharper - resharper is one of those cool kitchen sync productivity boosters that really makes me feel like i'm driving on jet fuel in visual studio... the automatic syntax cleaning it does... robust javascript parsing / intellisense / reference navigation and on and on

HttpWebResponse from WebException

using (var response = (HttpWebResponse)((Func<WebResponse>)(() =>
{
  try { return(request.GetResponse());}
  catch (WebException ex) { return(ex.Response); }
}))()) //<-- too funny
using (var responseStream = response.GetResponseStream())
// ReSharper disable once AssignNullToNotNullAttribute
using (var readStream = new StreamReader(responseStream, Encoding.UTF8))
{
  return String.Format("{0} {1}. {2}", (int)response.StatusCode, response.StatusCode, readStream.ReadToEnd());
}

[SOLVED] Acer Aspire One won’t boot Syslinux USB thumbdrive

Looks like my particular issue was the default partition size on my 16GB thumbdrive. Once I formatted the USB with a 2GB partition and installed Syslinux to that, it booted up right away where previously it would hang on the first “Syslinux Copyright Peter Anvin” message.

More details:

  • Acer Aspire One model#: 722-C62bb (looks like this is an 11” model)
  • Always handy to have another computer to work from (for web searching, trial and error formats on the USB drive, etc) when trying to fiddle with boot issues on another… my other computer is a Win8 desktop.
  • Syslinux actually came into my picture because I was looking to create Comodo’s Rescue Disk. Comodo (v6.2) has a convenient point and click process to push their linux based rescue disk to a USB.
  • I used diskpart (on my Win8 box) to create the smaller partition… here’s the core commands:
    • list vol (to get a feel for your windows drive letters and not format the wrong one :)
    • list disk (same for raw physical disks)
    • select disk X (MAKE SURE YOU CHOOSE THE RIGHT ONE!!)
    • (MAKE SURE AGAIN)
    • clean (THIS WIPES THE DISK!!!)
    • create part primary size=2048 (2GB worked for me in this context)
    • active
    • format fs=fat label=”COMODO” quick (I chose old school FAT filesystem looking for most downlevel compatibility, not sure if it was actually necessary vs FAT32. NTFS is notably the least compatible option for linux booting. Quick means do a quick format.)
  • Then I just let Comodo do it’s thing and that result booted up right away for me – yay :)

Man Cave Bling - Beer Fridge - Koldfront 80 (BBR900BL) by EdgeStar

View larger image of Koldfront 80 Can Built-In Beverage Cooler - Black

  • First one was a dud out of the box. Just didn’t cool at all. EdgeStar support said it was missing coolant. Took them about 2 full weeks to turn around the replacement. They paid all replacement shipping via printed return label. It was a new serial number, not a repair of my old one, and it looked new.
  • I am very satisfied now with this second unit and would definitely recommend it.
  • The look is very nice. The glass is great. The blue light is great.
  • The size is great, very deep. Fit my under-the-bar-cabinet-slot really well. A little shorter than the broken down old “Scotsman” that was in there but nothing a couple 2x4’s didn’t fix.
    • Sure am glad to have found something in a more reasonable price range… I’m sure the Scotsman stuff must last forever but at upwards of $2k, not on my kids’ college budget :)
  • Cooling has been spot on for the 2 months I’ve had it so far <knock wood>.
  • The cheapest I was able to find it was from “Ideal Wine Coolers” for $400. Half retail and $100 less than Amazon.
  • Other considerations for this same general form factor are the:
    • “EdgeStar 80” (CBR901SG) for $500 if you’re interested in the stainless steel look, and the
    • “EdgeStar 84” (OBR900SS) for $750 if you want outdoor certified cooling capabilityDSC_0991-50%… they indicate that a unit should be specifically designed to run outdoors or it will burn itself out quickly running non stop… that one would look great next to a hot tub :)

DSC_0967-50%

What’s this? A pretty decent “Time Machine” built into Win8!?

image
http://lifehacker.com/5958865/how-to-use-windows-8s-new-file-history-backup-aka-time-machine-for-windows
i've always considered the Vista/Win7 "previous versions" facility to be pretty similar to Time Machine just lacking Apple's meticulous care to making it drop dead easy to use.
i hadn't yet noticed the MS boys had taken yet another swipe at simplifying the UI in Win8... i'm assuming there's still a usability gap that the Mac boys can laugh at us, but gee, first impression is "not bad Balmer you ol’ dog”
  1. search for "file history" in win8 home screen
  2. fire up the ui
  3. select my backup drive
  4. click the "turn on" button
  5. in normal explorer window right mouse all my favorite folders and add them to the documents "library" - since that's included in what gets backed up (libraries are those fancy pants folder buckets that came along probably with Vista)
  6. click the "run now" link
  7. click "restore personal files" link and yep sure enough all the stuff is piling up out there
defaults to hourly file versions, just like time machine, but can be readily bumped down to minutes in obvious "advanced settings" UI if you want, just like time machine.
the restore UI is clean simple and has exactly what I'd want/expect out of the box... a standard folder explorer big current time stamped version at the top and previous, next and a big restore button (see attached)
not bad i say, not bad at all... 'bout f'ing time.




Light Custom Configuration Section

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Configuration;

namespace WebServiceClient
{
    /*URLElement class below represents a bundle of properties (URL, password, etc) for each endpoint we need to send to... 
  
    And the following custom app.configuration section allows us to maintain a list of these URLElements. 
    copied from here: http://www.abhisheksur.com/2011/09/writing-custom-configurationsection-to.html 
    and here: http://stackoverflow.com/questions/1755421/c-sharp-appsettings-is-there-a-easy-way-to-put-a-collection-into-appsetting 
    The basic gist is 3 fairly light implementation classes -- 
    URLElement = individual elements, URLCollection = collection of elements, and URLSection = new custom app.config section. 
    */
    public class URLSection : ConfigurationSection
    {
        //nugget: it seems that the [ConfigurationProperty()] attribute does not work on a static property (maybe that's true for all attributes??), 
        //so the _URLs *instance* propery satisfies this attribute requirement, but made it private since don't plan on using it directly. 
        //then exposing the URLs collection as a public *static* property. 
        //this rigamarole merely allows for the slighty more succint "URLSection.URLs" from the calling code rather than "URLSection.urlSection.URLs" 
        public static URLCollection URLs { get { return _urlSection._URLs; } }

        [ConfigurationProperty("URLs")]
        private URLCollection _URLs { get { return this["URLs"] as URLCollection; } }
        private static readonly URLSection _urlSection = ConfigurationManager.GetSection("URLSection") as URLSection;
    }

    //nugget: the xml tag name of the element level nodes must be "" by default 
    //to change to something else, it looks like one must implement a few more overrides like the ElementName & ConfigurationElementCollectionType properties. 
    //leaving it as the default seems just fine for current needs. 
    public class URLCollection : ConfigurationElementCollection
    {
        public URLElement this[int index] { get { return (URLElement)BaseGet(index); } }
        protected override ConfigurationElement CreateNewElement() { return new URLElement(); }
        protected override object GetElementKey(ConfigurationElement element) { return ((URLElement)(element)).Name; }
    }

    public class URLElement : ConfigurationElement
    {
        [ConfigurationProperty("Name", IsKey = true, IsRequired = true)]
        public string Name
        {
            get { return (string)this["Name"]; }
            set { this["Name"] = value; }
        }

        [ConfigurationProperty("Url", IsRequired = true)]
        public string Url
        {
            get { return (string)this["Url"]; }
            set { this["Url"] = value; }
        }

        [ConfigurationProperty("ContextID", IsRequired = true)]
        public string ContextID
        {
            get { return (string)this["ContextID"]; }
            set { this["ContextID"] = value; }
        }

        [ConfigurationProperty("Password", IsRequired = true)]
        public string Password
        {
            get { return (string)this["Password"]; }
            set { this["Password"] = value; }
        }

        [ConfigurationProperty("IgnoreWebServiceException", DefaultValue = false)]
        public bool IgnoreWebServiceException
        {
            get { return (bool)this["IgnoreWebServiceException"]; }
            set { this["IgnoreWebServiceException"] = value; }
        }

    }

}

[SOLVED] SSRS (2012), Excel export, “Not a legal OleAut date” error

Wound up being related to executing TimeSerial(0,0,secs) when specified secs represented more than 24 hours. Somehow the Excel rendering pipeline was the only one out of the various export formats that was susceptible to this issue which is interesting. From the TimeSerial specs I don’t see anything inherently invalid about going that high… the docs indicate it simply rolls it into the day portion of the resulting value as I would expect. Given that the error refers to “Ole”, there is some other intermediate data type conversion going on here… perhaps it passes through a time only type???