Why would you want to use a console?

You probably have a desk. You can put things on the desk, or move things, or pile things on top of one another. You have a folder in which you put important documents. Maybe that folder sits along many other folders in a filing cabinet.

Your computer also has a desktop. You can create files and folders, which appear as magic. Some time ago, computers did not have desktops. Computers did not have mice, windows, or icons. “It must have been very slow to use computers,” I hear you say. “I’m glad it’s no longer necessary to learn how to use a computer without a graphical interface,” I hear often.

I must pull you from your fantasy. Graphical interfaces are that: interfaces. They allow us to easily interact with an underlying system. But what if I told you you can interact with the system directly, the same way that was used to create the system in the first place?

mkdir week{1..5}  

Many clicks of the mouse are required to do that line of code using a graphical interface. It creates five folders, called week1 to week5.

Even more powerful is nesting:

mkdir -p week{1..5}/lesson{1..3}  

As that creates folders week1 to week5, with each folder having the following three sub-folders: lesson1, lesson2, and lesson3.

Naturally you can use the console for far more than creating folders. Time-consuming tasks like finding which files in a directory contain the text “Find me”:

grep -l "Find me" *  

You still haven’t convinced me

Fine, the console looks ugly and you don’t want to use it. The time it saves isn’t worth the effort of learning how to use.

Well, sorry but you don’t have a choice.

If you want to deploy your applications to a server, you need to use a console. There is simply no other reliable way to interact with a remote server. Graphical interfaces are too slow to load over an internet connection and they require too much power.

It is very likely that if you use a web server, it will be running some Linux distribution (http://w3techs.com/technologies/details/os-unix/all/all). This makes it all the more important for you to learn to find your way around a Linux console.

Writing Closed Captioning for Videos

Writing Closed Captioning for Videos

If there’s something that I’ve found out I don’t really like doing, is write closed captions for my courses. It entails transcribing each video and then changing the text to .SRT format.

Here’s how it would go normally:

  1. Transcribe the video manually by listening to it, optionally at a lower speed if typing speed isn’t up to scratch (which mine isn’t);
  2. Open up ScreenFlow and the caption track, and then paste the sentences into each of the caption track elements;
  3. Change the length of the phrases to match the talking speed.

Optimise for time

If the course is it a stage where you are wanting to include closed captions in it, it probably is making some money. If not, you’ve got other things to worry about (like, making it profitable).

If it’s making money, then we can make the closed-captioning process substantially quicker by doing some or all of the following:

Use a transcriber

You can use something like Dragon Dictate (on Mac), or a Windows alternative, to help you transcribe the videos. It won’t be perfect, but it may shave off a few minutes per video. You’ll still have to go back and change many things.

Alternatively, if the course is making enough money, it may be worth hiring a transcriber from somewhere like Fiverr. If you find a decent one, you’ll get good transcriptions in a few days, for a cost as low as $5 per 10 minutes of video.

Convert to .SRT easily

Again, once you have the transcription you can hire someone to convert that to closed captions for each of your videos from Fiverr. This will set you back for, again, around $5 per 10 minutes of video.

Optionally, and the method I’ve been going for, is somewhat more time-consuming, but substantially less so than doing it manually in your video editor of choice.

The method is simple because the only work you have to do is split the transcription into 3-second chunks, and then use a small program to convert the text into a .SRT file.

So make your text look like this, with each line being around 3 seconds long in your video:

Hello, and welcome back to the course! In this

video we're going to be looking at

how to create our next program. It's going to be

a program to explore how to make web requests using Python  

Then, run a short program that will make it look like this:

00:00:00,000 --> 00:00:03,000  
Hello, and welcome back to the course! In this

00:00:03,000 --> 00:00:06,000  
video we're going to be looking at

00:00:06,000 --> 00:00:09,000  
how to create our next program. It's going to be

00:00:09,000 --> 00:00:12,000  
a program to explore how to make web requests using Python  

Then you can import that into ScreenFlow or whatever program you are using to record or edit your videos.

The program can be accessed here.

To use the program, you’ll need to execute it from the terminal (Terminal.app in Mac, or Console in Windows). You'll need to have Python installed, which is very simple.

Then, you can run it like so:

$ python srt_typing.py .
Enter file to read: <your_file_name>  
Enter the file to save as: <output_file_name>  

That’s it!

Normally, I will hire a transcriber, and then quickly change the phrases to three-second lengths, and use the program to change the text content to subtitles.

That means that instead of a few hours to write subtitles for a few videos, I spend more or less exactly the duration of the video, since I do have to watch it once while adjusting the words-per-three-seconds.

Using OpenGL in Mac OS X

Using OpenGL in Mac OS X

This post has been mostly taken from http://blog.hwrd.me/2014/05/07/beginning-opengl-development-on-os-x/ and a couple other sources.

1. Install Homebrew

Install homebrew from here: http://brew.sh

2. Install GLFW3

Once that is installed, install GLFW3 like so:

# Tap into homebrew/versions where GLFW3 lives
brew tap homebrew/versions

# Install it
brew install glfw3  

3. Install Glew

Glew is used to allow your programs direct access to some OpenGL commands without having to go through Mac OS X system calls.

Using Homebrew, install like so:

brew install glew  

4. Install TextMate

You can also use CLion or even XCode if you wish to fight them when creating your builds. I've tried using CLion but gave up since they only support CMake.

If not, use something like TextMate, Sublime, or vim.

Download TextMate from http://macromates.com/download (version 2.0 is beta and open-source).

5. Create sample project and code

Download the sample code from http://blog.hwrd.me/2014/05/07/beginning-opengl-development-on-os-x/, direct link: https://gist.github.com/hahuang65/0c7d14a6fedb221c8b87#file-main-cpp

6. Create Makefile

In the same folder, create a Makefile. If you are unsure what Makefiles are, read: http://mrbook.org/blog/tutorials/make/

Write the Makefile from http://blog.hwrd.me/2014/05/07/beginning-opengl-development-on-os-x/, direct link: https://gist.githubusercontent.com/hahuang65/0c7d14a6fedb221c8b87/raw/25410d0a023fd22c3cdd969afb33707f456dd2f6/Makefile

7. Compile and run

Then simply go to your terminal, navigate to the appropriate directory (where your Makefile and sample code live), and compile using make:

cd <directory>  


If you get an error when compiling (missing separator), then make sure tabs are used instead of spaces when indenting the very last line in the Makefile provided: http://stackoverflow.com/questions/3315108/makefile-missing-separator

The Reputation of Universities and how it affects us

The Reputation of Universities and how it affects us

We've got a big problem with University education in our field. Some people leave knowing a lot, and having enormous amounts of practical experience, while others leave knowing very little, or not being able to apply their knowledge to real-world problems.

I think this has been accepted as a standard. "Internships are there to fill this gap", or "You'll get practical experience at your job". But if it is the case that when someone leaves an institution in which they have been for up to 4 years (or more, with a master's degree!), and the expectation is that they'll learn everything on the job, we're probably doing something wrong. We might as well not go.

On the other hand, we've got "coding bootcamps", which have a questionable reputation, although their focus is to provide practical experience and help their students get jobs. These bootcamps have questionable reputation because many students finish them without knowing the fundamentals of Computer Science, like algorithms, complexity, data structures, general design principles and patterns, etc... Which University would provide.

When hiring, what we're interested in is on whether you can do the job, and personal traits, culture fit, and the like. Often, doing the job implies learning, so being able to learn is necessary as well. The question is: does University achieve either of these things?

Can you do the job?

At University, I didn't learn about many things that I use daily on my job:

  • Python
  • JSON
  • CSS
  • Git
  • Scrum
  • JavaScript
  • Any JavaScript library or framework
  • Bootstrap
  • Design of applications and user interfaces
  • Deployment of applications and continuous integration
  • Using libraries, building from source, and general knowledge
  • Servers

I did learn some things though:

  • Java
  • General Object-Oriented Principles
  • Algorithms and data structures
  • Game programming
  • How to make class diagrams and Gantt charts (like really?)
  • Bash
  • Introduction to Functional Programming
  • HTML
  • Some Agile notions
  • How to write ethics submissions
  • Working as a team (or, more often than not, how not to work as a team, which is even more important)

Some nice things in there, and a lot of things I wouldn't have learned if I didn't go to University, such as functional programming, ASP.NET, or writing ethics submissions. So University is clearly useful in some measure, but why are they not teaching the useful stuff, as well as the fundamental stuff?

Why are there no modules on Git, JavaScript, web design, creating APIs, deploying applications, deploying servers, and more things that a lot of people are going to be using daily?

Are you able to learn?

Learning about the fundamentals of Computer Science can be tough; there's some maths, some complex theory, design principles, etc; so that will definitely help learning. But the practical stuff also requires a lot of focus and patience, especially in the beginning when you can't make anything work. University does not help with this.

We need to learn about developing applications and making working software. We need to be able to read documentation and pick up frameworks or libraries. We need to learn more than just Java, as other programming languages become more and more popular in the industry. We need to learn a mentality that, while difficult to inculcate in many people, is essential for learning and adapting.

Being able to do the job is nice, but with an ever-changing landscape in this industry, it's unavoidable to become irrelevant unless we can learn, and more importantly, unless we want to learn.

The reputation of Universities

Universities have reputations to maintain, often using metrics like percentage of graduates with jobs within 6 months, or percentage of students that pass their degree, or amount of papers published in research journals. I don't think these are good metrics for software development. These metrics encourage the following:

  • Help graduates find jobs (any job), and
  • Make sure graduates pass
  • Do research and employ researchers instead of software development professionals as lecturers

There is nothing there about quality. We have a huge shortage of people in this industry, so of course most people will find jobs. We also want everyone to pass, so we'll decrease our standards until we meet our desired pass rate. They'll find jobs anyways.

When a graduate applies for a job knowing a bit of Java and HTML, I feel sad. Or when someone leaves university "knowing" HTML but unable to add an ssh key to their GitHub account. Or when the password to MongoLab is stored in plain text in the Git repository (we'll just change that in the next commit!).

These are things that should raise red flags that we're missing a big part of University education in Computer Science. Why are our students not interested in learning more and making better software?

But they'll learn these things in the job, so that's not a problem.