Thursday, July 18, 2019

Wednesday, July 17, 2019

Strategy for Debugging Stored Procs When you have very few Permissions

Preconditions:


Insufficient Privileges such that...

  1. Can't run debugger on stored procs in DB
  2. Can't create new stored procs in DB
  3. Can't modify stored procs in DB
  4. Can't delete stored procs in DB
You CAN:

Execute scripts and Modify Rows


Strategy:
  1. Copy entire Stored Proc
  2. Paste it into a new query window
  3. Change the proc's parameters to Variables (DECLARE @FOO AS VARCHAR(25) = 'Bar';)
  4. Remove all stored proc syntax from top and bottom of script
  5. Get it to run in SSMS Query Window
  6. Add Debugging code in the best form fitting the current circumstances
  7. If so desired, copy SQL into C# code and ADO.Net it from there (or whatever)

Just think outside the box.


Sunday, June 09, 2019

How to effectively deal with Tech-Debt(Part Two)


The astute reader will have, no doubt, detected the cheeky sarcasm in my previous post.
Of course, in reality, effectively coping with tech debt requires discipline and commitment.
Therefore any good tech-debt remediation program requires that an organization regularly circles back and repeats the first two steps. (Please see previous post).

How to effectively deal with Tech-Debt(Part One)

Dealing with tech-debt (I've learned) is a simple two-step process:


Step One: 

Acknowledge the tech-debt.


Step Two:

Resolve that someday soon you will circle-back and address the tech-debt.


Done!  You have just effectively dealt with all of your tech debt.  Sleep well.

I'm baaack

A little older, a little a little dummer, and a little wiser.
Ok, actually a lot of all three but back I am, indeed.

Please see my next post where I describe how the pros deal with Tech-Debt.

See you there!

Wednesday, February 13, 2013

BootStrap

Working through Pluralsight intro to Twitter's BootStrap:

"Sleek, intuitive, and powerful front-end framework for faster and easier web development."

So far, I'd agree with that description.

Pretty cool.

Totally smitten.

Listened to podcast about it about a month ago. Meant to check it out but things 'got crazy'.
Stumbled upon blog post referencing it.  Thanks to my friend Alvin Ashcraft.

Signed up for a Pluralcast free trial as a result.

Thanks Alvin!

Friday, June 25, 2010

App Fabric on win srvr 2008/IIS7


An application server like JBOSS and WebSphere.

Btw, what's so good about IIS7?

Thursday, November 19, 2009

Using ASP.Net MVC Framework to build a highly RESTful Web Service

I dreamed this whole thing and implemented it on my own over a year ago.

Download and install ASP.Net MVC Framework.

See steps 7 -9 of previous post for tweaking IIS.

See the RegisterRoutes method below.

"EntryPoint" is a concrete action method on a abstract base class. It performs common parameter massaging, environment intialization and authentication stuff then routes the request to the appropriate abstract Get(), Put(), Post(), Delete() or Head() method implemented by the current Controller subclass. It does this via a switch block driven by the value of "httpMethod" obtained thusly: string httpMethod = HttpContext.Request.HttpMethod.ToUpper();


public static void RegisterRoutes(RouteCollection routes) {

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

Route route;

route = new Route("Help", new MvcRouteHandler());
route.Defaults = new RouteValueDictionary(new { controller = "Help", action = "Index" });
RouteTable.Routes.Add(route);

route = new Route("{controller}/{id}.{format}", new MvcRouteHandler());
route.Defaults = new RouteValueDictionary(new { action = "EntryPoint" });
route.Constraints = new RouteValueDictionary(new { format = @"json|pox|xhtml" });
RouteTable.Routes.Add(route);

route = new Route("{controller}.{format}", new MvcRouteHandler());
route.Defaults = new RouteValueDictionary(new { action = "EntryPoint" });
route.Constraints = new RouteValueDictionary(new { format = @"json|pox|xhtml", id = "" });
RouteTable.Routes.Add(route);

route = new Route("{controller}/{id}", new MvcRouteHandler());
route.Defaults = new RouteValueDictionary(new { action = "EntryPoint", format = "xhtml" });
RouteTable.Routes.Add(route);

route = new Route("{controller}", new MvcRouteHandler());
route.Defaults = new RouteValueDictionary(new { action = "EntryPoint", format = "xhtml", id = "" });
RouteTable.Routes.Add(route);

route = new Route("", new MvcRouteHandler());
route.Defaults = new RouteValueDictionary(new { controller = "Home", action = "Index" });
RouteTable.Routes.Add(route);

}

Removing Services Without Using installutil /u

If you are unable to use intallutil /u assemblyName.exe becuase the assembly no longer exists or something like that, this is the EASY WAY :

sc delete SERVICENAME


I found this on "StackOverflow" derivative called "SuperUser" :

A collaboratively edited question and answer site for computer enthusiasts – on any platform. It's 100% free, no registration required.

http://superuser.com/questions/49185/how-to-remove-a-dead-service-in-windows-xp

Monday, November 17, 2008

Creating RESTful Web Service Using System.Web.Routing Part 1


  1. Created new ASP.NET web site using VS 2008

  2. Deleted default .aspx page

  3. Added Global Application File (Global.asax)

  4. Added following code to Application_Start() method in Global.asax

    Route route = new Route("students", new StudentsRouteHandler());
    RouteTable.Routes.Add(route);

  5. Added following class:

    public class StudentsRouteHandler : IRouteHandler, IHttpHandler {

    public IHttpHandler GetHttpHandler(RequestContext requestContext) {
    return (this);
    }

    public void ProcessRequest(HttpContext context) {

    context.Response.Write("<h1>Hello World!</h1>");
    }

    public bool IsReusable { get; set; }
    }



  6. Added the following to the httpmodules section of the Web.config :


    <add name="Routing" type="System.Web.Routing.UrlRoutingModule,
    system.Web.Routing, Version=3.5.0.0, Culture=neutral,PublicKeyToken=31BF3856AD364E35">




  7. Edited 'properties' of new web project on 'Web' tab configured it to use IIS server rather than visual studio development server. A new virtual directory is created as a side effect of this.

  8. In iis.msc edited properties of new site. On 'Directory Security' tab clicked on 'Configure' button and CHECKED the Integrated Windows Authentication check box all the way at the bottom

  9. Last but not least, in iis.msc edited properties of new site. On Virtual Directory tab clicked on 'Configuration' Button.

    Added:
    Executable: c:\windows\microsoft.net\framework\v2.0.50727\aspnet_isapi.dll
    Extension: .*
    All Verbs
    UN-CHECK 'Check that file exists'




While trying to get it to work I mixed in a superstitious IISReset. I'm not sure if its required but I think not.

Wednesday, November 12, 2008

Visual Studio Still Refuses to Eat Its Own Syntactic Candy

Its been available since VS 2005 but even as of VS 2008 the designer still generates:

_fooGrid.CurrentCellDirtyStateChanged += new System.EventHandler(this._fooGrid_CurrentCellDirtyStateChanged);


When this will suffice:

_fooGrid.CurrentCellDirtyStateChanged += _fooGrid_CurrentCellDirtyStateChanged;

C# Sucks!

JK!! Seriously, though, somewhere around C#-3 we should have inculcated ourselves with the question: "Does 'CAN' == 'SHOULD...