Something which needed to be explained to a client which seemed worth keeping.

This is an up-goer 5 explanation of database locking. I kept the words “database” and “query” because those are too ubiquitous, and, presumably, if you’re asking about deadlocks, you at least have heard of a database.

Basically a lock is:

When something needs to write in the database, the database knows that this can cause problems if there are other attempts to write to the same area (usually this means a table or a row of a table). To make sure that this doesn’t happen, the database will “lock” that area and make it so that nothing else can get in and read or write at the same time. Sometimes the lock simply stops other queries (a query is some words given to the database which tells it to read or write something) from writing to the same place, and sometimes it stops other queries from even getting to that area.

A deadlock is:

Sometimes, when there are many locks in the database and more than one query is given at the same time, the different queries stop each other. One query will lock table A while it tries to write on table B, another query might be locking table B while it waits for the lock on table A to end. In this case, both table A and B will reach a point where both queries will not be able to finish because both need to read or write in the other’s locked table. This is a “deadlock”.

Posted in Uncategorized | Leave a comment

Open graph req’s

So… trying to get an open graph link to allow for an inline video player is annoying. It turns out you need to define a very specific set of OG properties:

    <meta property="og:site_name" content="$$domain$$" />
    <meta property="og:title" content="$$title$$" />
    <meta property="og:type" content="video"/>
    <meta property="fb:app_id" content="$$facebook ao ID$$">
    <meta property="og:description" content="$$description$$" />
    <meta property="og:url" content="http://$$domain$$/$$canonical URL$$" />
    <meta property="og:image" content="http://$$domain$$/$$path to icon$$" />
    <!-- Not sure if swf is 100% necessary, right now I'm simply adding this for quick ref. -->
    <meta property="og:video" content="http://$$domain$$/$$path to video$$.swf">
    <!-- This does need to reflect the content type of the above video -->
    <meta property="og:video:type" content="application/x-shockwave-flash">    
    <meta property="og:video:secure_url" content="https://$$domain$$/$$path to video$$" />
    <meta property="og:video:width" content="$$width$$">
    <meta property="og:video:height" content="$$height$$">
Posted in Scripts | Tagged | Leave a comment

Old data shouldn’t count

There is a new pizza restaurant in my town. Not that we needed one: we had at least five already, but now we have a sixth. This one is less than a half mile from two other pizza locations (and arguably the two best), and I do wonder what the owners are thinking. They must think that they have something truly excellent if they plan on pulling that off, especially in New Jersey, a state where everyone has a strong opinion about what makes a good pie.
Continue reading

Posted in Business | Tagged , , , , | 1 Comment

C# has no mixin.

Recently I came across a lovely bit of engineering by my favorite nemesis: Sitecore.

So, I have two controls, one is a Sitecore.UI.WebControls.HtmlControl and the other is a System.UI.WebControls.HtmlControl. Now, because they both serve the same purpose, have the same name, and have remarkably similar namespaces, you would imagine that the Sitecore one was an extension of the System one, right? Unfortunately not.
Continue reading

Posted in Languages, Sitecore, Worst Practices | Tagged , , , , , , | Leave a comment

F*%^ing windows permissions

So, today I had to deal with Windows deciding that it did not want to allow me to have all of the permissions that I should have to my machine. It was more than a little annoying. Fortunately, I am an admin. Unfortunately, the machine was convinced that admin privileges weren’t good enough for some deeply nested temp files. Of course, since I’m dealing with Sitecore, that meant that I could not properly run the site. Joy. I did eventually solve the problem, though. There is a command called icacls which let one change the permissions of a given file or, if used with the /T flag, an entire directory tree:

icacls {filename} /grant {username}:{permission} /T
Posted in Scripts | Tagged , , , | Leave a comment