Category: Life

Every other post.

  • End of the First Semester

    End of the First Semester

    I MADE IT. Almost.

    I have one last assignment and a few exams to do, but the classes and labs are pretty much done. Tuesday, Wednesday and Thursday were pretty much a single uninterrupted day for me. I realized at one point that I hadn’t eaten in 30 hours.

    It’s been a challenge. Going back to a chemistry lab after a nine year break, when they assume that you had done it all last semester, has meant I had a fair bit of extra catching up to do. Finding time for work has been tough, though I’m very fortunate in having an employer that’s given me the flexibility to choose my own hours. Finally, going from making $2500 a month to $1000 has been a most humbling experience.

    I have much to be thankful for. Things are working out, and no matter how it all unfolds later, I wouldn’t of been able to get this far without the support of those closest to me. I honestly don’t know how I did it the first time round, but I know for sure that if it wasn’t for people like you, this second go at school would of been nothing more than a nice thought.

    So this is to you.

  • My Ideal Visual Programming Environment

    My Ideal Visual Programming Environment

    Introduction

    I’m going to talk a bit about visual programming and how I’d like to see it done. Be warned, this post reads like one of those start-up pitches from a business student.

    Grouping & Infinite Canvas

    Flowcharts are a natural and intuitive way of representing logic. It’s how some existing visual programming environments such as the Illumination Software Creator go about it, and it’s how I’d approach the subject as well.

    The big limitation of doing things this way has to do with complexity. Say each block of the flowchart represents an action. With only a few blocks on display, the program’s logic is immediately clear. But start to tack on block after block, and that flowchart becomes an opaque mess.

    The way I would overcome this is to allow groups to be grouped together on an infinite canvas. I’ve done a quick mockup to illustrate what I mean, shown below.

    On the left is a flow chart representing a program that retrieves the current weather for my city and then displays it for me. First it loads the data from a web page, then it parses the contents of that page for the relevant information, before finally displaying it.

    The parsing stage is a bit more involved than what’s presented, but those details aren’t relevant to the big picture. So the boxes that would make up that more intricate logic are grouped together in a single box labeled “Parse Data.” Zoom in, and the logic that makes up that step is revealed. You could keep siphoning portions of logic away like this, always making sure that what the program does is clear, while the mechanics of how it functions is hidden until needed.

    Only Show the Minimum

    Many existing visual programming environments tend to show every possible action with one of the blocks. Take the following screenshot for Apple’s Quartz Composer.

    Visual Programming: Quartz Composer

    In this image, you can see that all the possible ways to interface with each block is stipulated. While this is practical while programming, it undermines the clarity afforded by using flowcharts. You end up with a bunch of text on display that are entirely irrelevant to the final workings of the project. So I would only present these options when explicitly desired, by way of a radial menu that pops up when the mouse approaches a block. Otherwise, they’re hidden away.

     

    The blocks that appear would be shaped to indicate whether they’re inputs, or outputs.

    High Level for Modern Times

    I argue that high-level languages aren’t so high-level anymore. Yes they are more abstract than their antecedents, but the problems they’ve been asked to solve get more and more complex while the languages and their standard libraries remain frozen in the time of their inception. The end result is that the amount of boiler plate code programmers need to write goes up as the language gets older, less they embrace third-party libraries.

    I’d move up the bar of what high level is. Software developers would no be required to explicitly open and close files – when they’d want to write to a file, they would just put a block symbolizing the file to write to. For HTTP requests, it would be as simple as specifying a URL to send/receive from. Cut down the boiler plate code.

    Likewise, don’t burden the programmer with types. Think about all ways we can store numbers: a two byte integer, a four byte integer, an unsigned integer, a single or double precision floating point number, a complex number, something like BigNum, etc. There’s very good reasons why these types exist, but in most cases, which one is the right one could be determined automatically at run-time. So this language would be a dynamically and loosely/weakly typed. The only thing that would matter is if there’s one of it, or many of it (see below.)

    Embrace Concurrency & Parallelism

    The flowchart model lends itself well to concurrent programming, where you have multiple logic trees being executed simultaneously. With traditional programming languages, you’d have to set-up threads for each piece of code you wanted to run at the same time. With visual programming languages, it’s as easy as having “two arrows coming out of your block.”

    Earlier I said that variables would be typeless, and that the only distinction would be whether there was one of it, or many of it. By  keeping track of whether there’s many of it, we open the doors to easy parallelism. Thin arrows between blocks indicate “one of it”, and thick arrows mean “many of it.” Applied to a block that adds a number to an input, you could have the computer do calculations in parallel. Each item in the “many of it” could itself be an array, opening up the doors to multi-dimensional datasets.

    Event-Driven from the Get Go

    Any application that reacts to asynchronous I/O events relies on executing code following an event. It can be as simple as an infinite while loop, but it’s there. That’s almost every single modern application out there. Yet we always start from a baseline where that isn’t the case, and we have to put in an event loop ourselves or whatnot.

    Many visual programming languages are already event-driven. This one would be too.

    The Best of All Languages

    For this theoretical programming environment to gain traction, it has to be useful. Yet it’ll be anything but if only supports a handful of use cases on launch. So to give it any chance of widespread adoption, you have to ride on the success of others.

    In other words, allow people to easily integrate code written in something like Python. That way if there’s no blocks to do what they want, they can invoke a “Python” block where they can call libraries that let them perform the specialized task.

    Built-In Revision Control

    To my knowledge, no visual programming environment has built-in revision control. And current text-file oriented systems are entirely inadequate to show how one revision in a visual environment differs from another. So I’d integrate revision control into the programming environment.

    I envision it as something where you can slide back and forth between commits, and see how the the contents of the canvas morph. Animations would show blocks move if they did, or pop in with a visual cue if they were added. You could see the changes by branch or by user.

    Integrated Debugging & Profiling

    If your program didn’t behave as expected, you would be able to execute the code in steps, block by block. The arrows in between blocks would animate as data travelled from one to another. Or you could set breakpoints where the program pauses when it reaches a specific point. The data passing through any arrow could easily be exposed.

    Mouse or Finger, Will Travel

    This software needs to be an experience that works as well with touch-only interfaces as with those systems that have a mouse and keyboard. It cannot feel like “it’s made” for the other input device. Sure, it’ll embrace the information-spartan paradigm common to mobile applications, but that doesn’t mean it has to be any less pleasant to use with the good old mouse.

    So what does that mean? For fingers, pinch and drag will zoom, while for the mouse, it will be achieved by the scrollwheel. To select multiple blocks, the mouse might click and drag, while fingers might swipe around the objects. Right-clicks will still deliver contextual menus, and so forth.

    Yep, Looks *ARE* Important

    There’s a train of thought that places general appearance as a secondary consideration. I believe that if you want people to embrace your product, you have to make looks a first-class citizen. I think the developers who made the platform pictured below had the right idea.

     

    tumblr_memb77v5n01qz4mo8o1_1280

     

    There is a very functional reason for this: every thought you put into how things will appear translates into a better experience. The user may never have seen this environment before, but if you tap into that wealth of things they’re already familiar with, they’ll be able to use it much sooner. It reduces the learning curve. It makes understanding how the blocks all fit together take that much less time, by for instance, having all the arrows between boxes animate to show which way the information is flowing.

    Make this easy enough, and you might tap into an audience of “casual programmers” that use this to assist them in their daily doings. No one’s come up with a successful programming analogue to the likes of Microsoft Access that appeals to the likes of secretaries and payroll officers. There’s room for one.

    Conclusion

    If you think any of these ideas are good, please steal them. Not that I should be credited for any of what I wrote here, given that there’s prior art in all instances.

    Relevant Reading

  • Peanut Butter Oat Bars

    Peanut Butter Oat Bars

    I still don’t know whether this was a bad idea or not. I fell asleep last night with this idea in my head that I wanted to make oat bars, something that was more cookie than granola bar. So I plagiarized the dough recipe from a cookie recipe I liked, and substituted some flour for oats. I also added peanut butter and concocted my own brown sugar using molasses.

    Ingredients:

    • 2 Cup Oats
    • 2 Cup Flour
    • 1.5 Cup Sugar
    • 1 Cup Butter
    • ¼ Cup Peanut Butter
    • 2 Tbsp Molasses*
    • 1 Tsp Baking Soda
    • 1 Tsp Salt
    • 2 Eggs

    *Alternatively, you can substitute the molasses and sugar for: 1 Cup White Sugar + ½ Cup Brown Sugar.

    Instructions:

    1. Mix the wet ingredients: sugar, butter, peanut butter, molasses, eggs.
    2. Mix in the rest of the ingredients (dry stuff).
    3. Set the oven to 350F. Shape the dough into bars, and place them on a tray to put in the oven. Bake for 12-15 minutes.
    4. Take out the tray and let cool.

    Verdict:

    There weren’t enough oats. I think next time I’d do 1.5 cup flour, 2.5 cup oats.

  • TVO Axes Signature Shows

    TVO Axes Signature Shows

    It was announced today that TVO, the provincial public broadcaster, will cut up to 40 jobs and cancel the shows Allan Gregg in Conversation and Big Ideas, as well as its ad-free Saturday Night at the Movies. The movies were always good picks, but the first two shows in particular represented some of the best in quality Canadian programming. We’re talking about content that challenges the mind by exposing it to new ideas, with a bias to issues that mattered to Canadians.

    These cost-cutting measures are part of a new reality in this age of austerity, and follow the CBC’s own axing of such well-regarded shows as Dispatches. What’s particularly unfortunate about all of this is that these programmes have no substitute of equal merit in the audiovisual medium or beyond. They have intellectual content that private broadcasters will never embrace, as shows that cater to the lowest denominator simply earn more. Meanwhile, the underground podcast scene primarily lacks the access that comes with significant fiscal resources and established journalistic credibility.

    It’s not that I have an attachment to television in this age of Netflix. In fact, both TVO and the CBC have been very adept at embracing shifting media consumption patterns, releasing their shows as podcasts and on YouTube. It’s that these departures leaves a void that is being left unfilled. We as Canadians are being deprived of the means through which to gain a better understanding of the world around us, and we’re the poorer for it.

    The sad thing is, I don’t believe this trend will reverse any time soon, if at all.

  • Pulled Pork Sandwiches

    Pulled Pork Sandwiches

    This was a day alone for me, and I decided to treat myself with a pulled pork sandwich. I turned on the slow cooker in the morning and threw in tenderloins, chopped up onions, BBQ sauce, tomato soup, basil, garlic powder, a bit of water and some salt. Basically, what I had laying around.

    I also made a loaf of whole wheat bread. The pork tasted great; I think next time I’d butter the bread and toast it a bit before serving.