RiversideJS presentation on KnockoutJS

I recently joined a couple of user groups here in Riverside, one for Ruby and another for Javascript and so far I’m very glad that I did.

I’m always striving to stay on top of best software practices and to keep learning new things (which is why I browse GitHub Explore frequently). I feel that I’ve been doing that pretty well – but I’ve found there are some things you can’t get better at as a freelance developer without reaching out – specifically presentation skills.

So when Judd Lillestrand of Riverside JS asked if anybody wanted to give a presentation on something Javascript related, I decided to jump in with both feet and offer to give a presentation/demo on KnockoutJS –  a javascript library I use all the time to build dynamic user interfaces in the browser.

It was a great night, Jack (another member of the user group) gave a presentation on EmberJS which is a similar MV* library. It was great to see the comparisons between the libraries – the main one being that KnockoutJS is configuration over convention, whereas EmberJS is convention over configuration. I liked that with Ember you don’t have to do so much damn plumbing code.. definitely going to look at that for future projects.

As promised – you can find the demo code in a repository on my Github page here: https://github.com/cameronwilby/riversidejs_knockout.

Check it out if you want to see Knockout in action, but also go check out their learning site as they have a great beginners guide that essentially touches all the core components of Knockouts functionality.

Thanks to everybody that came out, and it looks like I’ll be giving a presentation on Brain.js in two weeks – a neural network library written in Javascript that I think might be useful to create applications that learn a users preferences automatically.

We’ll see how that goes..!

Swim Counter reaches 1000 users

swimcount-analytics

I released a “WatchApp” for the Pebble recently called Swim Counter. As the Pebble can be taken underwater, I thought it would be useful to have an app that would allow me to track the number of lengths I swim of each stroke.

I found out that Swim Counter reached 1000 users a few days ago, proud father moment!

Thanks to everybody that has downloaded it, hope you’re finding it useful.

“Fun” with .bash_profile in OSX

I’m learning me some cocos2d-x at the moment, and one of the things they ask you to do is to add a couple of PATH variables for convenience, such as the following:

  • NDK_ROOT – A reference to where the Android Native Development Kit lives on your system
  • SDK_ROOT – A reference to where the Android SDK lives on your system
  • ANT_ROOT – A reference to Apache ANT (A Java based build tool, kind of similar to ‘make’)

Usually the way you do this in a Linux/Unix terminal is to run the following command (For example, with NDK_ROOT)

export NDK_ROOT="/Users/cameronwilby/Source/android-developer-tools/ndk/"

The problem I found with OSX was that it would only save the NDK_ROOT variable for the current Terminal session. When opening a new terminal window, the variables would be lost. Very frustrating.

I found out that the reason is that Unix has two types of shells. A login shell (When you’re already in a desktop environment or logged in via SSH) and a non-login shell (Imagine in the good old days where you login via a green-text-on-black screen terminal).

Login shells execute .bash_profile before you start typing commands, and non-login shells execute .bashrc first.

When you run the above command, the PATH variable is saved to .bashrc, not .bash_profile.

Now, the problem is that OSX creates a new login shell every time you open Terminal and subsequent tabs, which executes .bash_profile, missing out on the PATH variables we saved in .bashrc.  Thus, any PATH variables saved in a Terminal session will not be loaded the next time Terminal is opened.

The solution according to Josh Staiger is to add some lines to .bash_profile that loads in the PATH variables from .bashrc using to avoid this problem. I did this and it seemed to fix it.

…. I f**king hate Unix. Seriously. I just want to make a game or something.