I went to lunch with former coworkers today and some other thing-of-the-moment applications came up in conversation. moviepass.com is an app which allows you to pay a $45 per month subscription (and there is at least one cheaper/weaker option too) for a creditcardesque card and a mobile app that you may use to otherwise see movies for free in the theaters provided that you do not see more than one movie a day. That means that if you are seeing one movie a week with the system you are basically breaking even and if you are a real fan then you have a cost savings indeed. Yay! Major chains of theaters are on the system for this thing and so might be Alamo Drafthouse. Audible, which is Amazon-owned and at audible.com, was the other app discussed. I had heard of this one before from a current coworker. It's getting more and more trendy to listen to books as audio instead of reading books and this is a place to go for audio books.
Friday, February 3, 2017
Thursday, February 2, 2017
falsey six
Yikes! There are not five falsey values as I suggest here and here but instead at least six as the Boolean value for false is obviously falsey as it's literally false. This moreover makes a distinction between negative zero and zero and between an empty string defined with single quotes and an empty string defined with double quotes and all four things are falsey. The same thread suggests there is an obscure thing called document.all which is of old IE that is also falsey, so there could be as many as nine falsey shapes.
- undefined
- null
- false
- NaN
- 0
- ""
- ''
- -0
- document.all
Wednesday, February 1, 2017
When do I want to break up the falsey five?
Almost never. The convenience of checking to see if something is falsey is a convenience for a reason, you know? The one exception might be to see if a numeric property is set yet or not. In those cases you would want a distinction between a zero versus null and/or undefined. Do something like so:
if (whatever || whatever === 0) {
Something to avoid is to write a separate pipe (in an Angular 2 app for example) that tries to return true or false based on if something is undefined or null. The one line comparison against zero is the way to keep it simple. While I'm thinking of pipes, don’t use a pipe directly in TypeScript. If you need a repurposable blob of functionality that can work in both the front face Angular 2 markup and the TypeScript files you should write a service for it and then have a shim of a pipe for wrapping the service that exclusively is used in the markup.
isNaN should perhaps be avoided
You use it like this right?
if (isNaN(whatever)) {
You'd think this would be truthy or falsey based on whether or not whatever was a number or not, but that's not so. Some strings will cause false to be returned from this thing, specifically strings that will survive the trip through a parseInt or a parseFloat. Also an empty string or a string with a single space looks to me like it will sail through with a false output based upon what I'm seeing on StackOverflow.
funmoppet
The book "Generation X: Tales for an Accelerated Culture" by Douglas Coupland is credited with assigning the moniker "Generation X" to my generation. I just finished reading it this Sunday after having originally discovered a Swedish language version while on vacation in Stockholm last summer. I like what Doug had to say about my generation and, as he puts it, McJobs:
VEAL-FATTENING PEN: Small, cramped office workstations build of fabric-covered disassemblable wall partitions and inhabited by junior staff members. Named after the small preslaughter cubicles used by the cattle industry.
Vine has gone away with Obama.
Stupid apps like Gowalla come and go. Others like Digg die by way of shapeshifting. I kinda get the impression that Digg used to be something like what StumbleUpon is now though I've never used either app. Anyhow, Vine has been watered-down (shapeshifted) into Vine Camera for fifteen days now and while this was just another stupid app like Gowalla, Digg, and StumbleUpon I nonetheless fell in love with this one, embracing it completely. I could not get enough of it. I used to make six second movies all the time and kept one hundred and three of them. Thirteen of the most recent fifteen (the least recent of the most recent) are from a vacation I took in Stockholm, Sweden in the summer of last year which is the best vacation I've ever had.
Classic ASP
I am currently learning Angular 2 and it makes me glad I never learned Angular 1 honestly. The two are so very different and one is of the past and one (two) is of the future. I've been doing C# for a decade now and the modern Angular 1 versus Angular 2 circumstance makes me think of the old Active Server Pages in contrast to more modern modernity and makes me glad I never learned it given that it was all to get abandoned for .NET. Sure I dabbed in PHP and Cold Fusion in the ASP era, but in bailing for .NET it was like I was escaping to something better, not reluctantly cursing the fact that someone made a wildly different version of the thing I already knew. I've been there before in moving from the DOS (disk operating system) version of 3D Studio to 3D Studio Max back in the 1990s. PHP and Cold Fusion were probably better than ASP by a hair. You couldn't do any file uploading in old school ASP I recall. Cold Fusion had a low barrier to entry and PHP ran on dirt cheap hosting. Anyways, I do have a funny story to tell. In 2006 I was working at a consultancy which had a client that was a sizable organization with many departments. For example, Mechanical Engineering was one of the departments. The departments didn't have their own IT subdepartments within however. There was a common IT across all departments which was thus inattentive as everyone fought for its attention and Mechanical Engineering wanted to create an intranet site while sidestepping actually setting it up through IT as that would be a tedious waiting process with a bunch of red tape. This was a windowsland LAN environment and I was dispatched to see what could be done. I determined that without being able to set up a site in IIS (which only the ivory tower IT department could) that there would be no way to see the code inside a .NET .dll and hence .NET was out. I did determine that one could drop an old school ASP web site on a file share and hit the pages at a browser URL by way of going to an IP address in lieu of a domain name and then specifying the applicable file name for an entry point after a forward slash. What was more such an ASP site could successfully talk to a Microsoft Access database which could also just be dropped onto a file share! When I got back to the office I told Karl Parker my idea and he vetoed it. We ended up building the app the right way in .NET and then there was a bunch of drama and heartache in the name of getting IT involved to roll it out. And yet, I am proud of my ability to hack as exemplified here and I also wonder if this sort of hacking can't just be done at Windowland LANs today. Could you set up a rouge intranet site at your work with Classic ASP as the engine? What's in the way per se? Will this get me the ten at Black Hat I crave?