Categories
Uncategorized

Anitra and I are presenting “Building augmented reality experiences” at Tampa Bay UX / Tampa Bay Front End Meetup

On Thursday, June 14 at 6:30 p.m. at the Bank of the Ozarks’ Innovation Lab, Anitra and I will be do a presentation on augmented reality at the joint Tampa Bay User Experience / Tampa Bay Front End Design meetup. We’ll talk about building user experiences for augmented reality apps on mobile devices and show some AR apps that I’ve built. Join us!

Categories
Uncategorized

How to program: How does DidThanosKill.me work?

Shortly after the release of Avengers: Infinity War, the site DidThanosKill.me appeared, and many of my friends visited it and shared their results. There were two possible outcomes:

  • You were spared by Thanos.
  • You were slain by Thanos, for the good of the Universe.

If you tried to reload the page to get a different result, you quickly learned that you can’t cheat fate. Once you got a result from DidThanosKill.me, it stayed that way, no matter how many times you reloaded the page.

If you’re new to programming, or if you’ve hit that point where you can follow a programming tutorial but are having trouble taking an idea and turning it into an application, this article is part of an ongoing series that will help you.

Nerd interlude (or: a little background for people who didn’t read comics in the ’90s)

The eradication of half the life in the universe happened (both in the 1991 comic book The Infinity Gauntlet and the movie, which borrows bits and pieces from the comic book) when Thanos gathered the Infinity Gems/Stones (in the comics, they’re Gems, and they were originally called the Soul Gems; in the movies, they’re Stones)…

…into the Infinity Gauntlet, giving him near-unlimited power. In the comics, Thanos did this to impress and win the love of Death — the cosmic entity, personification of death, and Thanos’ dream woman:

The “to challenge humans is to court death” post-credits scene from the first Avengers movie gave the non-comic-book-reading audience its first glimpse of Thanos and hinted at the possibility that they might go with the same storyline…

…but instead, they went with a more mundane, Malthusian motivation for Thanos: bringing balance to the universe, and population control. It’s a pity, because the Marvel Cinematic Universe had already introduced a great death goddess character who would’ve worked wonderfully with the “Thanos is in love with Death” idea:

How DidThanosKill.me works: The high-level version

In both the movies and the comics, when Thanos finally gets all the gems/stones in the Gauntlet, he uses its power to kill off half the life in the universe by random selection. The word random should be your hint that a random number generator is involved.

The other thing that DidThanosKill.me does is remember whether or not Thanos killed you. When a web app remembers something about a particular visitor without requiring that visitor to log in first, that’s your hint that it’s probably making use of a cookie.

How DidThanosKill.me works: Looking at the actual code

Let’s take a look at DidThanosKill.me’s source. This is the complete source for that page, which you can see when you use your browser’s View Source functionality on DidThanosKill.me:

<!DOCTYPE html>
<html>
    <head>
        <title>Did Thanos Kill You?</title>
        <meta name="description" content="Did Thanos kill you?">
        <meta name="keywords" content="did,Thanos,kill,me,you,avengers,infinity,war,half,fifty,50,percent,snap">
        <meta name="author" content="Tristan Bellman-Greenwood">
        <script>
            function getCookie(cname) {
                var name = cname + "=";
                var decodedCookie = decodeURIComponent(document.cookie);
                var ca = decodedCookie.split(';');
                for(var i = 0; i <ca.length; i++) {
                    var c = ca[i];
                    while (c.charAt(0) == ' ') {
                        c = c.substring(1);
                    }
                    if (c.indexOf(name) == 0) {
                        return c.substring(name.length, c.length);
                    }
                }
                return "";
            }
            
            function onLoad() {
                var displayElement = document.getElementById("display");
                
                var randomNumber = getCookie("thanosNumber");
                
                if (!randomNumber) {
                    randomNumber = Math.random();
                    document.cookie = "thanosNumber=" + randomNumber + "; expires=Fri, 3 May 2019 00:00:00 UTC";
                } else {
                    randomNumber = Number(randomNumber);
                }
                
                if (randomNumber < 0.5) {
                    displayElement.textContent = "You were slain by Thanos, for the good of the Universe.";
                } else {
                    displayElement.textContent = "You were spared by Thanos.";
                }
            }
            
            function clearCookie() {
                document.cookie = "thanosNumber=; expires=Thu, 01 Jan 1970 00:00:00 UTC";
                location.reload();
            }
        </script>
    </head>
    <body onload="onLoad()">
        <div style="width: 100%; height: 100%;">
            <span id="display" style="position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%); font-family: sans-serif; font-size: 4em; text-align: center;"></span>
            <!-- <button onclick="clearCookie()">Clear Cookie</button> -->
        </div>
    </body>
</html>

Making the code run as soon as the page is done loading

On line 50, you’ll find the body tag:

<body onload="onLoad()">

This is an often-used technique to make something happen when the page loads:

  • The onload event occurs when the object it belongs to has fully loaded.
  • In the case of the body tag, the onload event happens when the body of the web page has fully loaded, which means that it has loaded all content, including images, scripts, CSS, and so on.
  • With this particular body tag, once the web page has fully loaded, it executes the onLoad() method.

The method where everything happens

The onLoad() method lives in the script tag (it starts at line 25) and looks like the code below, with one key exception: I’ve added a couple of numbers at the end of key lines, which correspond to the items below the code.

function onLoad() {
    var displayElement = document.getElementById("display");  // 1
    
    var randomNumber = getCookie("thanosNumber");             // 2
    
    if (!randomNumber) {                                      // 3
        randomNumber = Math.random();
        document.cookie = "thanosNumber=" + randomNumber + "; expires=Fri, 3 May 2019 00:00:00 UTC";
    } else {                                                  // 4
        randomNumber = Number(randomNumber);
    }
    
    if (randomNumber < 0.5) {                                 // 5
        displayElement.textContent = "You were slain by Thanos, for the good of the Universe.";
    } else {                                                  
        displayElement.textContent = "You were spared by Thanos.";
    }
}

1. It gets the HTML element that will display the “You were slain” or “You were spared” message.

It does this by getting the element whose id is display and assigns it to the variable displayElement.

If you look at line 52 of the source, you’ll see that this element is a span that is:

  • Set in the center of the screen (as determined by position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%); in the style attribute)
  • Has a large font size (as determined by font-family: sans-serif; font-size: 4em; in the style attribute)
  • Is center-aligned (as determined by text-align: center; in the style attribute)

The span will eventually contain the text that will display either “You were slain by Thanos, for the good of the Universe”, or “You were spared by Thanos.”

2. It checks to see if the user’s fate was already determined and memorized during a previous visit.

This is done by calling a method named getCookie(), which tries to get the value of the cookie with the given key. In this case, the key is thanosNumber. A cookie with the key thanosNumber would exist on the user’s system only if the user had visited the site before and didn’t clear the browser’s cookies since then.

  • If user’s system contains a cookie with the key thanosNumber, getCookie("thanosNumber") returns the value associated with that key, and that value gets put into the variable randomNumber.
  • If the user has never visited DidThanosKill.me before (or cleared their cookies since their last visit), the user’s system not contain a cookie with the key thanosNumber. The call to getCookie("thanosNumber") would result in a null value, which would then be put into the variable randomNumber.

At this point, randomNumber contains either nullor a value.

3. If  the user’s fate hasn’t already been determined and memorized, it determines and memorizes the user’s fate.

If randomNumber contains null, the following happens:

  • A random number between 0 and up to (but not including) 1 is generated and stored in randomNumber. This number represents the user’s fate.
  • The value in randomNumber is saved to the user’s system in a cookie with the keythanosNumber.

4. If  the user’s fate has already been determined and memorized, it recalls the user’s fate.

The value in randomNumber is converted to its numerical equivalent.

5. It displays the user’s fate.

At this point, as a result of either step 3 or step 4, randomNumber is guaranteed to contain a number between 0 and up to (but not including) 1.

  • If the value in randomNumber is less than 0.5, the user was slain by Thanos, and this fate is displayed onscreen.
  • If the value in randomNumber is greater than 0.5, the user was spared by Thanos, and this fate is displayed onscreen.

And thus half the universe is spared, and half the universe dies.

An exercise for the reader

There are still two bits of the code that I haven’t yet explained, and they’re the ones that read and write the cookie data. The first is the getCookie() function…

  var name = cname + "=";
  var decodedCookie = decodeURIComponent(document.cookie);
  var ca = decodedCookie.split(';');
  for(var i = 0; i <ca.length; i++) {
      var c = ca[i];
      while (c.charAt(0) == ' ') {
          c = c.substring(1);
      }
      if (c.indexOf(name) == 0) {
          return c.substring(name.length, c.length);
      }
  }
  return "";
}

…and the second is clearCookie():

function clearCookie() {
    document.cookie = "thanosNumber=; expires=Thu, 01 Jan 1970 00:00:00 UTC";
    location.reload();
}

See if you can figure them out. I’ll explain how they work in a future article.

Categories
Current Events Tampa Bay Uncategorized

What’s happening in the Tampa Bay tech/entrepreneur/nerd scene (Week of Monday, June 11, 2018)

Every week, I compile a list of events for developers, technologists, tech entrepreneurs, and nerds in and around the Tampa Bay area. We’ve got a lot of events going on this week, and here they are!

Monday, June 11

Tuesday, June 12

Wednesday, June 13

Thursday, June 14

Friday, June 15

Saturday, June 16

Sunday, June 17

Categories
Uncategorized

In light of GitHub, a brief history of Microsoft’s bigger/better-known acquisitions

By now, you’ve probably heard that Microsoft has acquired GitHub for $7.5 billion. Reactions have been all over the map, but have you wondered how Microsoft’s acquisitions fared after the fact? Here’s a quick run-down of some of the bigger and better-known ones:

Acquisition

Details

Outcome

86-DOS (1981)

Originally named QDOS (short for Quick and Dirty Operating System), it was developed by Seattle Computer Products for systems based on the Intel 8086. Its command structure was modeled after the then-relatively-widely-used CP/M operating system created by Digital Research.

IBM wanted to use CP/M as the operating system that came with their soon-to-be-released PC, as there were a number of applications already written for it. There are many versions of the story why this didn’t happen, but the most credible one is that Digital’s licensing representative hesitated to sign IBM’s NDA.

Microsoft, who were providing the BASIC programming language for the PC (back then, many desktop computers provided a ROM-based BASIC interpreter), heard about IBM’s problem, bought 86-DOS, and hired Tim Paterson to port it to the PC, which used the less expensive Intel 8088.

Microsoft first purchased a non-exclusive license to use 86-DOS for $25,000 in December 1980 (about $80,000 in 2018 dollars). In July 1981, they purchased all rights to the operating system for $50,000 (about $143,000 in 2018 dollars).

Two words: World domination.

I’ll let Wikipedia do the talking:

“Ultimately it was the key product in Microsoft’s growth from a programming language company to a diverse software development firm, providing the company with essential revenue and marketing resources. It was also the underlying basic operating system on which early versions of Windows ran as a GUI.”

DOS had a 19-year run, from its 1.0 version released on August 12, 1981, to the final version, 8.0, released on September, 16, 2000.

Forethought (1987) You’ve probably heard of their stuff. One of their products was a presentation application called Presenter, which they later renamed to PowerPoint. They also developed the rights to develop the Mac version of a DOS database application called Nutshell; they named this application FileMaker.

PowerPoint became part of Microsoft Office, where it’s one of its most (ab)used applications.

In 1998, FileMaker was acquired by Claris, an Apple subsidiary, which became FileMaker, Inc. in the late 1990s. For some reason that eludes me, FileMaker still exists.

Hotmail (1997) Originally called HoTMaiL (with the H, T, M, and L capitalized), this was one of the first web-based email services. Launched in July 1996 with a 2MB free storage limit (top-of-the-line machines in 1996 had 32MB RAM), it acquired over 8.5 million subscribers by December 1997 when they were bought by Microsoft.

Hotmail was replaced by Microsoft’s Outlook.com in 2013. Outlook.com had over 400 million users as of July 2016.

You may find this worth reading: How Hotmail changed Microsoft (and email) forever.

Visio Corporation (2000) Visio, a diagram-drawing application, was first shipped by Shapeware Corporation in 1992. It became Shapeware’s flagship application, and they renamed themselves to Visio Corporation in 1995, which Microsoft acquired in 2005. Visio remains an active Microsoft product, and while a stand-along application, has been promoted as one that can be used in conjunction with Microsoft Office and Visual Studio.
Great Plains Software (2001) Great Plains was best known for its accounting application for mid-sized businesses. It was one of the first multi-user accounting applications to run on 32-bit Windows. Microsoft completed the acquisition of Great Plains in 2001. Great Plains lives on as Microsoft Dynamics GP, which is the mid-market accounting application in the family of Microsoft Dynamics products.
Navision (2002) A multi-user client/server accounting system created by Danish software company PC&C A/S (Personal Computing and Consulting) in 1987. PC&C renamed itself to Navision after its flagship product in 1995. Microsoft acquired Navision as a complement to its acquisition of Great Plains. Navision lives on as Microsoft Dynamics NAV, which is the ERP (enterprise resource planning) application in the family of Microsoft Dynamics products.
aQuantive (2007) This was the parent company of three tech companies:

  • Razorfish, a digital marketing agency
  • Atlas Solutions, who built the online ad platform that Razorfish used, and
  • Drive Performance Solutions, an advertising network.

Microsoft acquired aQuantive in August 2007.

aQuantive was absorbed into Microsoft’s then-new Advertiser and Publisher Solutions Group. This business never did well, and in 2012, Microsoft took a $6.2 billion writedown, most of which was related to the aQuantive acquisition.

Publicis Groupe purchased Razorfish from Microsoft in August 2009, and in 2016 merged with SapientNitro to go under the even more unweildy name SapientRazorfish.

FAST Search and Transfer (2008) A data search/search engine company founded in Olso in 1997 that offered FAST ESP, an enterprise search product. They built strategic alliances with Lycos, Dell, and TIBCO in 1998 and 1999, and in 2003 narrowed their focus to enterprise search, selling their web search businesses to Overture (which was eventually acquired by Yahoo!). The company ran into serious financial trouble and controversy over its mismanagement in the mid-2000s, which is what probably led to its acquisition by Microsoft in January 2008. FAST lives on as a subsidiary of Microsoft known as Microsoft Development Center Norway.
Skype (2011) Another Danish company on this list! Founded in 2003, this text, voice, and video chat application was built on the same back-end software used by the music-sharing application Kazaa. eBay acquired Skype in 2005, and then the combination of Silver Lake, Andreesen Horowitz, and the Canada Pension Plan Investment Board bought 65% of Skype in 2009. Microsoft acquired Skype in May 2011. Microsoft has re-focused Skype on the corporate market, and in this writer’s opinion, made it more like its other communications products — that is, worse. Many consumers have since switched to competing and more consumer-focused offerings from Facebook, Apple, and Google.
Yammer (2012) Started as the internal communications application for Geni.com (a genealogy website), Yammer became a stand-alone enterprise social networking application in 2008. Microsoft acquired Yammer in 2012 for $1.2 billion. Yammer lives on as yet another enterprise communications platform under the Microsoft umbrella.
Nokia’s mobile hardware division (2013) The oldest company on this list (it was founded in 1865, when it was a pulp mill and later expanded into rubber and cables), they grew into a mobile telephony powerhouse in the 1990s. In the early 2000s, they were one of the top mobile vendors, but were unseated by the rise of iOS and Android. Combined with a disastrous Microsoft-ization with the installation of Microsoft VP Stephen Elop as its CEO and subsequent partnership with Microsoft and focus on Winwos Mobile, Nokia sales plummeted and announced the sale of its mobile and devices division to Microsoft in September 2013. Nokia still exists as two business groups:

  • Nokia Networks, the world’s 3rd-largest telecom equipment manufacturer, and
  • Nokia Technologies, which develops consumer products and licenses Nokia-branded tech.

The Nokia acquisition lives on in pieces as Microsoft’s devices division. Microsoft took a $7.6 billion writedown as a result of acquisition.

Mojang (2014) One word: Minecraft! Founded by Markus “Notch” Persson in 2009, Minecraft was released as a 1.0 product in 2011 and acquired by Microsoft in 2014 for $2.5 billion.

Minecraft lives on as a successful product under Microsoft.

Notch has gone on to be an unhappy, bored, lonely, and all-round unpleasant person, who despite repeated, unhinged rants about so-called “SJWs”, took a surprisingly neutral stance on GamerGate.

Xamarin (2016)

The descendant of the GNOME desktop UI project for Linux, the Mono project was launched by Miguel de Icaza and Nat Friedman to build a Linux version of the .NET framework. Mono became Ximian, which was acquired by Novell in August 2003. Ximian was acquired by Attachmate, which laid off hundreds of people in the Novell workforce, including Mono’s developers.

Xamarin was formed in May 2011 to continue the Mono project, which was now largely focused on .NET developer tools for Android, iOS, and Windows Mobile. Xamarin was acquired by Microsoft in February 2016 for somewhere between $400 million and $500 million.

Xamarin lives on within Visual Studio for both Windows and MacOS.
LinkedIn (2016) Founded in the last days of 2002 and launched in May 2003, LinkedIn grew into the de facto business social network. In May 2015, LinkedIn bought the online video course site Lynda.com for $1.5 billion. As of April 2017, LinkedIn had 500 million members. Microsoft completed its acquisition of LinkedIn in December 2016, for which it paid about $26.4 billion. If you read this blog, you’re probably on LinkedIn! It continues to grow, although this recent Forbes article credits external factors rather than Microsoft, including:

  • Twitter’s stagnation
  • Facebook’s focus on consumer networking rather than business networking
  • Google Plus’ flop
  • A lack of competition, with the failure of alternatives like Xing.

 

GitHub (2018)

If you read this blog, the odds are pretty good that you have a GitHub account (and if you were curious, mine’s here). Founded as Logical Awesome, LLC, GitHub provided web-based hosted version control using git, the version control system developed by Linus Torvalds and the de facto standard today. GitHub is the spiritual successor to SourceForge, which was the go-to place for open source projects during the “Cathedral and Bazaar” days.

In addition to developing the service that bears its name, GitHub are also behind the Atom text editor and Electron framework.

Since Microsoft makes its own cross-platform code editor — Visual Studio Code (which is my current go-to editor) — it should be interesting to see what happens with Atom. While you might think that they might kill it immediately, Microsoft has been known to have competing versions of the same thing as a result of acquisitions; think of their mess of communications platforms, FoxPro and Access, competing frameworks, and so on.

It’s just the beginning! It has been announced that Ximian co-founder Nat Friedman, who has some serious open source credentials and goodwill, will be GitHub’s new CEO.
Categories
Current Events Tampa Bay Uncategorized

What’s happening in the Tampa Bay tech/entrepreneur/nerd scene (Week of Monday, June 4, 2018)

Every week, I compile a list of events for developers, technologists, tech entrepreneurs, and nerds in and around the Tampa Bay area. We’ve got a lot of events going on this week, and here they are!

Monday, June 4

Tuesday, June 5

Wednesday, June 6

Thursday, June 7

Friday, June 8

Saturday, June 9

Sunday, June 10

Categories
Current Events Tampa Bay Uncategorized

What’s happening in the Tampa Bay tech/entrepreneur scene (Week of Monday, May 28, 2018)

Every week, I compile a list of events for developers, technologists, tech entrepreneurs, and nerds in and around the Tampa Bay area. We’ve got a lot of events going on this week, and here they are!

Monday, May 28

Tuesday, May 29

Wednesday, May 30

Thursday, May 31

Friday, June 1

Saturday, June 2

Sunday, June 3

Categories
Uncategorized

My mind is like my web browser…

Poster: My mind is like my web browser. At least a dozen open tabs, 3 of thos etabs are frozen, and I have no clue where the music’s coming from.

Based on a find from Mendel Mendelovits.