Hackpad’s reassurance for habitual Ctrl-S pressers

Three decades in software development has given me ample experience with those horrifying moments where the gut-wrenching realization dawns on you that x number of hours of work just scooted at lightening speed into the black hole of an application (or machine) crash.

It’s a horrible feeling.

You know you have no way to recover that work. There is no recycle bin from which to undelete it.

There is only one option and that is to do the work all over again. And hope that the same brilliant insights you had first time around, will come to you again. (Why is it that you always expect the second time around to be worse rather than better?)

Anyone who has experienced this at least once, is likely to turn into a habitual and incessant Ctrl-S presser.

I know I am one. I am pretty bad. I’d say I press Ctrl-S or Ctrl-Shift-S every time I pause my typing for longer than a couple of seconds. Especially when I’m coding, it’s like an uncontrollable OCD (Obsessive Compulsive Disorder). I am bad, but by no means the worst. I have (had) colleagues afflicted with this far worse than I am.

Many web applications, and admittedly many desktop applications, have addressed this auto-saving what you do and providing easy means of reverting your changes.

Not all applications do, however. And there can be good reasons for that. Though I’d say that in most cases sticking with explicit saving is a cop-out. The only good reason I can think of is when saving is resource intensive and auto-saving would interfere with a user’s flow.

Regardless of the reasons for explicit-save still being around, the fact that it is still a widespread phenomenon, keeps the Ctrl-S OCD alive. And while I have grown pretty good at keeping it under control when I know the site or application I am using has proper auto-save, it still sometimes rears its ugly head when it is totally unnecessary.

Most auto-saving apps just ignore the Ctrl-S. Something to be said for that. After all, pressing Ctrl-S is superfluous in those apps.

Hackpad has a different way of dealing with Ctrl-S presses. I like it. A lot. It’s non-intrusive and educational. May even save me from some RSI as it helps reduce my OCD.

Hackpad Response To Ctrl-S

Posted in User Experience
Tags: , , , , ,

Current date and time just one key away in Notepad

Today, I discovered a nice little feature in Notepad. By accident.

I was starting up for the day, opening the apps I tend to use all the time: Notepad for my activity logbook, Chrome, and the usual other stuff. Chrome’s new tab page has this nice feature of displaying eight most frequently (or recently) used websites.

Google new tab page

Except. It doesn’t. Not always.

When Chrome has been closed and your computer has hibernated, slept or restarted, Chrome’s new tab page does displays 8 sites based on old data.

Luckily, there is an easy work around: presssing F5. That reloads the new tab page and then it does display 8 sites based on the most recent “most recent/frequent” data.

That F5 has been added to my “getting started for the day” muscle memory.

Then… Serendipity.

From the corner of my eye, I saw text changing in Notepad. Reflexively, I switched to Notepad and pressed Ctrl-Z to undo it. A lot more text disappeared than I expected. So I pressed Ctrl-Z again to see what had disappeared. Turned out to be a time stamp.


How did that end up there?

Started playing with some keys. Then noticed that the new tab page in Chrome hadn’t updated yet.

Switched to Chrome, pressed F5… Brain clicked. Somehow my previous F5 had ended up in Notepad?

Switched to Notepad, hit F5 and yes, hey presto, a time stamp appeared.

Notepad F5

Never knew that Notepad could do that. Haven’t found any “insert …” menu options or whatever either.

Makes me wonder. Are there any other nifty hidden features in our oldest and dearest Windows’ text editor?

Posted in Tips and tricks
Tags: , , ,

Ends and means

Old quest

You might say my Linux quest failed miserably. I got defeated in the land of unexplained instructions and fairyland errors that had no right to exist.

But, you would be wrong. Using Linux as a platform for a website never was a real goal. It was a means to an end. And means can change while the end stays the same. In my case the end was learning. Mixed with a bit of nostalgia from times when running a site on Linux could have been an end, but would have been a means as well. (That is, a means towards cutting costs except that probably it would have meant incurring quite a steep learning bill far exceeding the price of the license fee saved.)

As learning was the end and getting an ASP.NET5 site running on a Linux shared hosting account was just the means, the quest was a success. I learned a ton.

Apart from the solutions to the problems encountered, which are always nice little conquests, I learned, perhaps again, that I am not cut out to work with Linux or any other OS or application from the land of unexplained instructions. At least, not just to satisfy my curiosity. I like a challenge and I’d happily have continued the quest if I had really needed to do something with Linux. Right now, I’d rather delve into ASP.NET 5 itself than wrestle with the ring in which it is running.

Don’t get me wrong. I like getting out of my comfort zone. That’s a huge part of my “Learner” make up. The point is that I have plenty of more pleasurable ways to get out of my comfort zone.

Sooooo… back to safety (ha!). Back to Windows and learning ASP.NET 5 and MVC 6 in their native wrestling ring.

New quest

ASP.NET 5 and MVC 6 being the subject to learn, it stands to reason that we will be building a web application and who knows, one with its own WebAPI to boot.

First steps:

  • Get the ASP.NET 5 samples running on an Azure Windows VM
  • Get the bare bones web site created for the Linux quest running on that as well
  • Set up the infrastructure for easy deployment of new versions.

After that, it’s a free for all. Any feature is fair game. That said, I do intend to follow a specific structure. Given a feature to build:

  • Is shopping the shelf an option, or perhaps even a “must”?
  • What software design alternatives do we have and why choose one over the other?
  • What contraints do the design of ASP.NET 5 and MVC 6 put on our design?
  • Then “just do it”

So, what features is the quest’s application going to have? What is it going to be about? What is it going to need? Both in terms of “core application functionality” and in terms of “basics you just gotta have”?

What are the questions and challenges people face when they are starting out building a web application?

Couple of things come to mind immediately:

  • Signing in. What’s the use of a web application if you can’t distinguish amongst your users?
  • Billing. I don’t know about you, but personally I’d like to create something that maybe one day I can apply to build me something I can live off. So, yes, billing.
  • Notifications. People don’t like having to log in just to see nothing happened while they were away. So let’s be kind and tell them when something interesting (to them!) happened on the site.
  • Direct messaging. Users can send each other messages through our web application ensuring they can keep their contact details private and still interact with other users.
  • Q&A StackOverflow style (but with less pompousness about what fits their Q&A format).

What else would be worth digging into?
What order should we address them?
Would you be interested in contrasting ASP.NET 5 / MVC 6 with previous versions? Or would you rather just forget about those?

__Please let me know in the comments.__ Apart from the first steps of the quest, I am not particularly fussed about priorities, so let me know and I’ll adapt.

One constraint I am going to put on all this, is: don’t code anything that isn’t core functionality of your application.

For example, when you are building a SaaS enabling self-employed people to bill their clients, then billing would be both “core” (your users billing their clients) and “just gotta have” (you billing your users). In the first case you want total control over what it does and how it does it as that is how you distinguish your application from the gazillion other billing applications. In the second case billing is just something “you gotta do”, and what you need to do to get the bills to your users is not part of their user experience. So shopping the shelf and just coding the integration of your application with a third party service probably has a much higher ROI. After all, even though we are of course capable of doing a better job of it ourselves, we can only spent our time once and spending our time on stuff that provides value for our users is much to be preferred.

If you don’t want to miss any of my future adventures: subscribe below and get every post delivered straight into your inbox.

Posted in Learning

Not quite running the samples on McCoy – my be… Linux VM

The status of the quest to get a bare bones ASP.NET 5 (aka vNext) website running on a shared Linux hosting account:

So now that dnx is running on the McCoy Linux VM, it should be a breeze to get the ASP.NET 5 samples up and running, shouldn’t it? Let’s see.

Referring back to the “Running the samples” instructions, we got stuck at step 3 “Run dnu restore to restore the packages required by that sample.”

Ok. Fire up Leonard on McCoy, change to the folder of the project I chose to use as our proof of the pudding (the HelloMvc project) and run that dnu restore command. Hey ho! This time that command actually starts a whole lot of activity. It looks all nice and dandy, except that it comes to a premature high-pitched screeching halt.

dnu restore crash

What the …?!? Isn’t there anything about this quest that can go right in one take?

At least there is a stacktrace and some debug information: “This usually indicates a fatal error in the mono runtime or one of the native libraries used by your application.”

Should be nonsense of course, didn’t mess with the mono runtime and I didn’t code the sample, so if any native libraries are used by the project, they should not normally pose a problem. After all, can’t imagine the ASP.NET team wanting to shoot themselves in the foot by providing faulty samples. So, it must be something on McCoy (again!)

Then I notice the “1.0.0-beta5” in the folder name. D’oh. To solve our DNX challenges, we upgraded to the latest version. Would it be wise to upgrade the ASP.NET 5 source and samples as well? Well, ya, d’oh! While we are at it, let’s make sure everything ASP.NET 5 connected is upgraded to the latest version. Which means

  • First DNVM itself (as we learned the hard way)
    • dnvm update-self
    • and . ~/.dnx/dnvm/dnvm.sh
  • then DNX
    • dnvm upgrade -u
  • and finally the ASP.NET 5 source with its sample projects
    • git clone https://github.com/aspnet/home

Now, we are still in the ~/home/samples/1.0.0-beta5/HelloMvc folder, while our upgrade just installed 1.0.0-beta7. That’s perhaps being stubborn. The lack of a GUI doesn’t make me want to go hunt for newer vesions. If the version numbering pattern I think I spotted, has some merit, then there should now be a ~/home/samples/1.0.0-beta7/HelloMvc folder. Nope, no such luck. According to GitHub there are samples specific for beta6. So let’s try those. Nope, no luck. No 1.0.0-beta6 folder under samples. There is a latest, but if we don’t have 1.0.0-beta6, then latest most probably wasn’t updated.

Ok, so git clone didn’t do what I expected it to do? It did all sorts of stuff, but it didn’t update to the latest version. No, blondie, of course it didn’t. Well I dispute the “of course” bit, but to update a cloned repository with the latest changes on the remote, we need git pull. Yes. That brought down a whole lot more, including a samples1.0.0-beta6` folder.

So let’s restart the “running the samples” instructions, cd to the beta6 folder and run dnu restore from there. Yes, it starts doing its thing again. Keeping our fingers crossed… And … we screech back to a halt. This time on a different package, one before the package that caused trouble before.

second dnu restore crash

At least it is getting the newer packages. The number on the “Cannot handle address family” is different as well. But the debug information is the same: “This usually indicates a fatal error in the mono runtime or one of the native libraries used by your application.” Working on the assumption that we just addressed the “native libraries used by your application” by upgrading everything that is ASP.NET and samples related, this now points to Mono as the culprit?

Hang on.
Why was I doing this again?
… To run ASP.NET on a shared Linux hosting account.
Why did I want to do that again?
… Because umpteen years in the past Linux hosting was much cheaper than Windows hosting.
… Oh and yes, because I like learning.

The first is moot. Reasonably priced Windows hosting is easily found, even if you get less resources (disk storage, traffic, databases, or whatever) than for Linux hosting at the same price.

The second is still true. And giving up usually is not an option for me. But in this case, I think I have had my fill. So, sorry, but I am calling it and throwing the towel into the ring. It’s not like someone is paying me to get this working. And even then… there are so many other things to learn that will be a lot more enjoyable to dig into.

If you don’t want to miss any of my future adventures: subscribe below and get every post delivered straight into your inbox.

Posted in Learning
Tags: , , , ,

Suddenly we have lift off

Right. I like a challenge. This ASP.NET on Linux quest had me stumped though. And that was getting on my nerves. I had been following all the instructions and shaving a few Yaks on the go and yet it still refused to work.

Which is nonsens of course.

I am not the only trying this. Others have gone before. And there have not been any outcries of the stuff not working at all. So it has to be Leonard or McCoy, or the installation so far.

Which means, that apart from calling in the help of a few good men like Hugo and Kit, I am looking at posing a question on the stackexchange network or one of the asp.net or linux / ubuntu forums.

Distilling down what I have done so far is going to take a lot of time though. So let’s first try to use my Google Fu to see whether I can bring up any results showing other people having the same kind of trouble I am having.

Typing in dnvm dnx linux brings up all the installation and running samples information I have already seen. But, second in those results, is an entry that catches my eye.

Search result

download but not make dnu or dnx executable

That sounds interesting.

It could explain the “already installed” and “not found” confusion. Sort of anyway. When you take “not found” to (also) mean “I found it, but it isn’t marked executable”.

This search result leads to [Linux] Latest DNX packages are incompatible with older dnvm.sh scripts #31. While the versions are different – I have 1.0.0-beta5 and the information talks about “from 1.0.0-beta6”, the page provides a solution and I decide to give it a go.

Leonard is fired up on McCoy and told to

dnvm update-self
. ~/.dnx/dnvm/dnvm.sh

Update self

The first ensures that dnvm itself is updated. No explanation as to what the second does, but I guess it executes that “dnvm.sh” script that takes care of adding folders to the Linux equivalent of a Windows’ search path.

Then I ask McCoy to upgrade dnx with the latest – unstable – version (-u flag).

dnvm upgrade -u

Beta7 installed

And hey ho, DNX is upgraded to 1.0.0-beta7. And without any “not found” complaints!

So I get all gung ho and giddy with excitement and tell McCoy to dnx. And …

Lift off

Yes! Lift off!

So all you boys and girls out there, be sure to update dnvm itself and executing dnvm.sh before getting it to get new dnx versions. Just adding those two commands may save you a whole lot of headaches.

If you don’t want to miss anything: subscribe below and get every post delivered straight into your inbox.

Posted in Learning
Tags: , , , ,

Don't want to miss out?

Subscribe now and receive a regular influx of practical information on ASP.NET vNext, unit testing and software design.
* = required field