Software Release Day!

It’s not a terribly common scenario. Mostly, the dataset is pre-defined and static, but sometimes you have no idea what it will look like from one day to the next. This is the scenario I found myself in, recently. So I built a library.

It’s not a terribly common scenario.  Mostly, the dataset is pre-defined and static, and your designer can weave everything together into a thing of beauty and elegance, with absolute control over placement and flow.  Usually, that interface is then solidified, changing only after the design is discarded for something better, and then only in small ways.  But sometimes you have no idea what the dataset will look like from one day to the next, and it’s likely to change and shift regularly.  This is the scenario I found myself in with two completely unrelated projects, recently.

With one, the UI is designed to manage and maintain a complex gateway application, which itself relays incoming requests to myriad third-party services and locations, then presents the results in a unified format.  The settings for each of these third-party data sources include auth data, the exact composition of which is different for every one.  Anywhere from one to four values (in my experience so far) must be presented for a request to go through successfully, and hard-coding these defeats part of the design – we must support multiple sets of credentials for any given data source.  The answer here is a dynamically-generated form, defined by the same parts of the code that allow access to each particular third-party data source.

The other is much less complex.  It consists of what is essentially a survey.  Of course, things are complicated by the fact that the questions will change over time.  This could be handled by changing the underlying code every time – but the client is a non-profit, so the more they can do without having to pay for my time doing it, the better.  So again, the answer is a dynamic form.

But it gets trickier.  The form definition needs to be simple and take up as little space as possible, but it also needs to retain human-readability.  Perhaps the best candidate for this is JSON (JavaScript Object Notation), which most programming languages – not just JavaScript itself – can work with fairly easily.  So where’s the trickiness?  Well, in both cases the backend is forbidden from generating the form itself – for numerous other reasons, both are constrained to speaking JSON.

That means the front-end becomes responsible for the actual construction of the form.  Which in turn means DOM-manipulation.  OK, there are a number of ways to do that, so no huge deal, but there didn’t seem to already be a library to do it automatically – I’d have to implement it directly in the application both times.  And then I’d have to maintain both.  And what if I encountered yet another project that needed such functionality?  I resolved to build a library that could do what I needed, then simply include that library in both applications.

Both applications are built with AngularJS, which has native support for DOM-manipulating libraries in what it calls directives.  Essentially, directives are a way to extend HTML by defining (and then handling) new elements and attributes.  For the validation-paranoid, attributes can be prefixed with x- or data-, which keeps most validators happy.  You can also specify such extended functionality with classes, which sometimes makes more sense if what you’re building is a presentational extension – or your validator is too stupid ancient to allow x- or data- prefixed attributes.

So the natural result of all this is that I built the dynamic forms library as an AngularJS directive.  It is hosted on both GitHub and BitBucket, because GitHub is awesome for getting projects seen and worked on, and BitBucket is what we use at work, so it kind of made sense to put it there, too.  Both repositories have existed for several weeks, but I just now reached the point where the project is releasable, though probably only at a mature alpha or early beta level.  Which is why the release version is tagged as v0.0.0.  I don’t anticipate a large amount of involvement, because thus is such an uncommon use case, but it’s good to mention the release so the project’s visibility goes up (even if only for the search engines…).

Either way, let me know what you think!


TMI

I don’t know if anyone will read this within a day, a week, or even a year of its posting, but I suspect that’s not the point.  It doesn’t matter if it ever gets read.  What matters is that I write it.

Those who know me personally probably already know that I am taking medication for migraines.  Most of those also know that the medication I was prescribed is an anti-depressant, this specific variation of which is sometimes used for its side effect of reducing the frequency and severity of chronic pain.  A few will be aware that this might be a good thing for me beyond handling the headaches, since I’ve shown several of the symptoms of depression off and on for many years.

Well, now I’m out, and can’t afford to get any more.  The medication itself isn’t particularly pricey, but the office visit to renew the refills is.

Now, before anyone pulls out the wallet and heads to PayPal or whatever, I’m not looking for help with this.  I just want to discuss a few things with myself, as it were.  Get my head back on straight.

See, the pills were beginning to lose effectiveness on the headaches, but they were actually doing wonders (apparently) on my depression-like symptoms.  (I’m trying to avoid self-diagnosis so as to not marginalize those who actually for-certain have depression.  Unless/until someone with the training to know says I have something, it’s only symptoms.)

At least, since the meds started effectively leaving my system, my mood has been less predictable and more negative.

I’ll spare anyone reading this the full details of my symptoms, but it does bring up a few other items I feel are important enough to put out there, even though they are of little importance otherwise.  These are facets of my life that I start to fixate on whenever my mood turns this direction, and if I can get the discussion on them out of my own head, it may do me some good.

First, my belief system.  It’s both very simple and very complicated, all at once.  The simple part: I believe that the sheer force of belief itself shapes reality.  It certainly shapes our actions, at least, and I don’t know many rational people who would argue that our actions have no effect on reality.  Then there is the effect of shared beliefs on how objective reality is perceived, and thus explained and explored.  Whether this cascade effect continues to the level espoused by spiritualism and religion is ultimately beyond the point that those beliefs shape the actions of those who hold them, which in turn shapes the world we share with them.  That in itself is often enough.

The complexity, if that isn’t obvious already, comes from how those myriad beliefs interact, and how to determine which beliefs are most true at any given moment.  I tend toward treating them all as equally effective, since I don’t have sufficient data to know for sure in any case.

Second is a personal understanding of my own nature which, frankly, can only be interpreted as insanity given current knowledge and understanding of various scientific principles.  Probably schizophrenia, or one of its relatives.  I feel strongly about its truth, but my certainty doesn’t help in my attempt to defend myself.  I’ll leave this one at that.

Last is a facet of myself that isn’t widely known (mostly because it doesn’t really matter in the vast majority of situations), but which shapes my own thoughts and actions, sometimes in ways that make others uncomfortable.  This bit will probably make many people even more uncomfortable around me than they already normally are, but I think it’s beyond time I say it.

I am a practicing bisexual.

What does that mean?  It means that I love my wife, and we are as intimate as our bodies will allow.  But it also means that I am attracted to men just as much, and enjoy such intimacy with them as well.  This is not a surprise to my wife, who is wonderful beyond what I could possibly deserve.  We discussed the matter long ago, and decided that the main issue with extramarital intimacy wasn’t the sex itself, but rather the damage of trust.  So long as neither of us tries to hide a sexual relationship from the other, if it happens, it happens.

Now, this doesn’t mean we’re out sleeping around.  I won’t speak on her sex life (aside from the one she has with me) because that’s her story to tell or not as she pleases.  For my part, however, I don’t tend to find myself in situations where I could take advantage of this arrangement anyway.  That said, I have had a few exhausting nights with a member of my own sex.  And I enjoyed every minute just as much as I do the ones I share with my wife.  So, no, I’m not just “bicurious”.  I know I like playing both sides of the field.

That was as non-graphic as I could make it while still being clear about that bit of myself.  I suspect some – if not most – of the people reading this (assuming, again, that anyone will) will place as much distance between me and themselves as they can manage.  Hell, it’s even still legal for me to lose my job(s) over it.  (Well, not so much legal as not illegal, but in practice, they’re about the same…)  I accept that as something I cannot change.  But I feel the need to have it said is far more important than maintaining friendships or employment where this aspect of me justifies such reactions.  Indeed, if this is enough to end these relationships I’ve built even while being this person I’ve now admitted to being, then those relationships probably weren’t worth the time to cultivate in the first place.

I hope, though, that the relationships I have with others are strengthened by this knowledge, if they are affected at all.  That would be the best scenario for everyone, I believe.  It would certainly do a lot for my faith in people in general.

We will see, I am sure.


With all that written down, I am indeed feeling more sure of myself, as hoped, and could probably store this away someplace where it would never be read by anyone other than myself.  That wouldn’t be particularly honest of me, though.  Not after what I’ve written here.  So here you go, world.  I accept whatever damage this will do to my career(s), my friendships, and even my family, as I take full responsibility for it.

And who knows.  Maybe my fears are misplaced.