Inversion of Control (IOC) frameworks have become quite the rage as the software craftmanship movement has gathered steam. IOC makes it much easier to break complex multi-part programs into distict, and more importantly testable, components so that they can then be glued back together at run time. There are lots of nifty frameworks that can make this happen but at the moment I’m playing with Ninject.
Ninject is a very minimalistic IOC framework which focuses on what it calls a “fluent interface” that leverages the compiler and IDE rather than a huge XML file to map dependencies. Overall it’s very fast, very light weight, and very powerful. I’ve picked it up quickly and found it to meet almost all of my IOC needs.
Save one. And this is apparently a big problem for a lot of people. Ninject doesn’t like overloaded constructors. (more…)
Most of the software development I do is user-facing in some sense. In other words, the guy I expect to be clicking the buttons and pounding the keyboard when my applications are running isn’t a technology professional, he’s a mortgage broker from Topeka, or something like that. I’m developing software for my parents generation or at least that’s the way I like to think about it. So I try to make my interfaces clean, my options minimal, and my help-text easy to understand.
I’ve been doing that for a long time; so long in fact, that it’s easy to forget that not everyone writes code that way. (more…)
Power users are important, or they ought to be. Power users are the folks who can help you figure out what your product is really capable of doing; they encourage you to push the boundaries of your existing feature set and can really help to highlight aspects of your service that you didn’t know were important.
No one seems to have told this to the folks at Netflix. (more…)
The great thing about computers and the internet is that, almost no matter what it is that you do, someone else will figure out some clever way to do something novel with the fruits of your labor. The folks over at If This Then That or
Indeed, the concept of the Rich Web — all those clever interactive widgets that you depend on to get through your day — is an appropriation of a technology that was never designed to do what it now does. HTML is not and was not designed as a way to build applications but simply as a way to represent documents. Were the HTML standard maintained simply as a method of document representation — in other words, were its features and functionality updated with only an eye for its original purpose — the resulting changes would destroy huge chunks of the public web.
Obviously, this would be bad. (more…)
It’s no secret that I’m a bit of a political junkie. While I enjoy the challenge of software development, there’s something fascinating about the gamesmanship and strategy that goes into political contests. Ordinarily I have to keep these two aspects of my life separate but every so often they happen to overlap and, when they do, I can’t help but get a little giddy.
So while the political junkie in me was glued to a TV set on Tuesday night, obsessively checking reporting percentages for urban vs rural counties and referencing those against minority population figures and previous election results, the software developer in me didn’t care much about the election until today when I found a story entitled “
Dropbox, if you for some reason haven’t heard of them, provides cloud storage which syncs files between the various computers that you might own/operate. I, for example, have a desktop, a laptop, and another desktop at work. If I want a given file or directory to be available on all three I simply put it into my Dropbox folder and it magically syncs to the other systems. It’s rather brilliant.
Signing up for Dropbox gets you 5GB of such synced storage to start with, which is pretty decent, but if you want more you can either pay them or participate in one of their seemingly innumerable little sign-up drives to get more space. I never seem to qualify for those but recently was informed that they’ve started one for folks who sign up on University campuses.
I, as it turns out, still have access to an email address from my days at Radford, so I tossed that one through Dropbox’s entry form and, lo and behold, I got 3GB of additional space. What’s more, Dropbox informed me that if I sent others to that page I would get an additional 500MB for everyone who signed up. (more…)
This domain is no longer registered with GoDaddy in protest of GoDaddy’s support for the Stop Online Piracy Act or SOPA.
I am not a marketing person. In fact, as a technology person, I tend to find marketing people frustrating and infuriating. Most of what they say leads me to suspect that they might just be making things up as they go along. I’m not saying that’s the way marketing works, but I often can’t shake that nagging doubt.
Then again, there are clear cut cases where marketing is done well and its done badly. Apple knows how to market. Google does not. (more…)
My first real exposure to databases was with MySQL. Every database has its ups and downs and MySQL is no exception, but among its major ups was – to me anyway – a function called
If you’re not familiar with Group_Concat, consider a basic role based security system. You have numerous users, each of which has has one or more roles. It is easy enough to get back a list of user/role pairs, easy enough to get back a list of roles with one user per role, and easy enough to get back a list of users with one role per user; that’s all basic join syntax.
But what if you want a list of roles — one row per role — and want to know every user that has that role?
That’s what Group_Concat is for. Bicker and argue all you like about why one might or might not need this functionality, there are just times when it’s nice to have.
Unfortunately, MS-SQL doesn’t really implement it… or it didn’t. Recently
SELECT RoleName, UserNames FROM dbo.aspnet_Roles AS r CROSS APPLY ( SELECT u.UserName + ',' FROM dbo.aspnet_Users u INNER JOIN dbo.aspnet_UsersInRoles uir ON u.UserId = uir.UserId INNER JOIN dbo.aspnet_Roles rr ON rr.RoleId = uir.RoleId WHERE r.RoleId = uir.RoleId FOR XML PATH('') ) D(UserNames) GROUP BY RoleName, UserNames
The relevant parts of this are the XML cleverness and the CROSS APPLY, everything else is basic SQL.
The XML bit relies on MS-SQL’s XML support and is, bluntly, a hack. You can play with it independently with queries like this one
SELECT UserName + '' FROM dbo.aspnet_Users FOR XML PATH('')
Long story short, adding that FOR XML PATH(”) to the query results in instant concatenation of values. So now all that’s left is to properly relate this to the outer query. That’s where the CROSS APPLY comes in. CROSS APPLY allows you to specify what amounts to a derived table that can legally contain references to some outer information, in this case our outer query. That’s necessary to constrain our inner table so as to only get the users we are interested in. We can’t do it outside of the CROSS APPLY because, by then the concatenation has already occurred.
Despite my somewhat lacksidasical updating of Nephandus, my tiny handful of posts has gathered some 1,288 comments, of which perhaps 5 – charitably – are actually worthwhile.
The others are spam. All of them. (more…)