Posts

SQL Porosity - CSV Element Calculation

Image
Background: Recently "walked" into a scenario where a client was storing an variable sized CSV string in a field.  This field held data that would eventually be evaluated as a "pseudo" entity for reporting purposes. Problem Due to the need for performance and reliability, the normal practice of splitting the string into a result set and then performing a SQL Count on the result set, would be overly complex and may cause performance issues as the length is variable  (i.e. varchar(max) ) Solution After reviewing several search queries, which most ended up at my old faithful Stack Overflow .  I came across an approach that is nothing more than Porosity .  For my purpose, it fit the bill very cleanly without overly transitioning a single value into a data-set and then calculating the data-set. Net Result Data-Set : Source: SQL Data - Source Value SQL Data - Comma's Voided Math n -  Len([Field]) m  - Len(Replace([Field], ',', ...

Acquiring List of controls - Classic JS

Recently ran into a scenario where I need to use the low-level JavaScript parser, instead of JQuery.  During this venture, I ran across a situation where it would be easier for me to select all the HTML Elements with an ID, assign it to a variable as JSON, and then operate on it from that point. So using my previous short-hand experience with JQuery, I started constructing a similar type of format to be used. *********** JQuery *************** // One line and your done, pretty much var cntrls = $('[id]') // Later on, you simply access the element from the variable var val = cntrls['someID'].value *********** JavaScript *********** // Not so one-liner; put in the DOM.Ready event for JS var cntrlIDs = {} var root = document.getElementById('rootID').querySelectorAll('*'); for (i = 0, n = root.length; i < n; ++i) { var el = root[i]; if (el.id) { cntrlIDs[el.id] = el; } } // Later...

Executing a Stored Procedure....The Proper Way

As we develop in Microsoft's Entity Framework family, we will at times run into a situation, or by design, the need to execute a Stored Procedure from the database (most likely Microsoft SQL Server ).  As we have discovered, they (Microsoft) evidently do not want us to do this inherently.  They hid the direct SProc execution well down into the Database object (off the DbContext object ) and even then it has a few names: SqlQuery and ExecuteSqlCommand .  Of course, both of these have their equivalent ASync execution versions. To make matters even more fun and interesting, is the problem of Ordinal execution.  Any proper DBA will tell you, if asked, that Ordinal execution is a bad implementation pattern.  And you developers, will simply respond: Well then don't change the order in which the Parameters exist.  Then the DBA responds, and the banter battle begins between a Developer and a DBA. My simple solution to avoid this whole needless verbal battle...

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...