Posts

HTML Compatability Modes

As a web-developer, I find it unfortunately necessary to force a browser(s) to conform to my preferred platform.  That being said, i have not been able (as of this posting) to find a aggregate knowledge base of all the available Meta values for the "X-UA-Compatible" header entry.  So below you will find my currently identified valid values. Syntax: <meta http-equiv="X-UA-Compatible" content="<value>"> Possible Values for <value>, by Browser: Internet Explorer = IE IE=5 Quirks Mode; pretty much anything less than IE 7 IE=7 IE 7 Mode IE=8 IE 8 Mode IE=9 IE 9 Mode IE=10 IE 10 Mode IE=11 IE 11 Mode IE=edge Highest supported document mode of the browser Quirks Emulate Values (If a valid <!DOCTYPE> declaration is present) IE=EmulateIE7 IE 7 Mode; otherwise, Quirks Mode (equivalent to IE=5) IE=EmulateIE8 IE 8 Mode; otherwise, Quirks Mode (equivalent to IE=5) IE=EmulateIE9 IE 9 Mode; otherwi...

SysInternals - BgInfo for ALL Users

Image
I have seen various sites that have been pretty good at getting close to the point of getting Background Information created by the tool BgInfo but none of them have actually solved my specific problem. Solutions currently out there include: Placing into the "All Users" folder This did not work for me, as our implementation does not contain an "All Users" folder in the "Users" folder for profiles. Reg-Hacking and HKCU or HKLM entry This is the worst of all the bad choices available.  I am experienced with Registry Editing and I still would not want or find a need to do this. Placing into the "Default" folder This is good going forward but what about those 20+ user profiles that are already logged in.  FYI, if your server has 20+ user account profiles in the "Users" directory you have larger problems than I am willing to assist with in this posting. The solution that worked for me, will be described below in pain-staki...

SQL - IsNullOrWhiteSpace Function

Just another SQL Code-snippet to check for NULL or whitespace value: -- ============================================= -- Author: John Wood -- Create date: 20151129 -- Description: Returns a boolean value -- ============================================= ALTER FUNCTION [Int].IsNullOrWhiteSpace ( -- Add the parameters for the function here @val sql_variant ) RETURNS bit AS BEGIN declare @ret bit if(SQL_VARIANT_PROPERTY(@val, 'BaseType') in ('varchar', 'nvarchar', 'char', 'nchar')) begin declare @char varchar = cast(@val as varchar) select @ret = iif(ltrim(rtrim(@char)) = '', 1, 0) end else begin -- Return the result of the function select @ret = iif( @val IS NULL, 1, 0 ) end return @ret END GO

Time Scalar Function

Everyone knows that you can use the Convert DML  to convert a DateTime data-type to a string evaluation for either split storage or display to an consuming interface. As most of us use the Date portion of a DateTime value for 90% of everything we are rendering the data to.  But what about that 10% where we either need to split render the Date & Time seperately.  After much review, we only have two quick and easy values to use and neither are really interchangeable. Option #1, with 2 forms: select convert(varchar(10), getdate(), 108) -- Produces: 13:53:15 select convert(varchar(15), getdate(), 114) -- Produces: 13:53:15:707 Now when using these forms of conversion, about 75% you have met the need for your requirement.  But lets say you need to use the Time string created for say a Filename ( sometext_[[TIME]].txt ), what do you do? Well the next code segment is what will be produced in order meet the FileName convention of special char...

Execute Functions...solo or Array

I have found myself multiple times having to "re-invent" this methodology to execute a single pass-through function or an array, pending on the situation.   For myself, and to share with others, I am posting this code-snippet for consumption. /**** @func - function() or [function(), function(),...] ****/ function ExecuteFunction( func ) { if ( typeof func !== 'undefined' && func != null ) { if ( typeof func === 'function' ) { func(); } else { if ( func instanceof Array ) { func.forEach( function ( fn ) { ExecuteFunction( fn ); } ); } } } } And yes you can have a nested array of functions.  If some crazy reason you wanted to do this: var func = [ function(){ //do something }, [ function () { ...