Initial reflections on client-side testing

This post is merely some early thoughts on my initial research into client-side testing. Client-side testing is simply a term for automatically testing code within a web-browser.

For my master thesis I’ve been working on a node.js project, more specifically a project that blends express.js as a mature framework, twitter bootstrap for styling and grunt.js for automatic building, reloading and testing of the project. And by testing it’s been solely backend testing using mocha.

I tried doing client-side testing using jasmine-jquery, which is an extension of the Jasmine test framework that includes functionality for dynamically loading html, manipulating them using jquery and checking for results using jquery. After a week of trial and error I was no wiser. So, I let it rest and happily continued coding.

Some weeks after, my programming speed slowed down to almost a halt. My plan for today was to implement a minor feature, but I took a painfully long time to do and as it stands now my code feels more like a deck of cards that I’m now hesitant to touch.

Perhaps you can relate to this experience: you open up your project with the intent of coding a new feature or fixing a bug, and you wonder, “Could the changes I’m about to make have unintended side effects? Will I break my code?”

Oh, yes I can relate to this quote! The quote comes from this article which provides sound arguments for giving client-side testing a second try. So, I’ll give it a second try and I’ll even report back with updates.  :)

Cheers,
Nils

Remap pause/break to insert using sharpkeys in Windows 7

Hi there,

Here’s a real quick tutorial on how to remap the pause / break key so that it becomes insert instead. Normally this would be a simple fix using sharpkeys. However, since the scancode for pause/break is slightly special we’ll have to tinker a little extra.

Resource on scancodes (the signals that a keyboard send to the computer).

This blog post solved nearly all of my worries, and my fix is largelly based on this. Nearing my goal I saw at the very bottom of the blog post that due to an issue with Windows 7, one had to use the final .reg file directly and alter it if one wanted other keys.

“11/17/2011 : I tested with Windows 7 and it works too. Using only Sharp Key would not work because it does not give you the option to select ‘E1_1D’. So you would have to run the registry file that I provided in the article to make this work. Or you can manually edit the registry entry. Thank you.”

Into the registry file we go. After a quick readup on scancodes I saw that delete sends scancode 53 while insert sends scancode 52. So, i opened up the registry file supplied by the aforementioned blogpost and did a simple search and replace for 53 and turned them into 52.

Here’s my adjusted .reg file for switching pause break with insert. This fix apparently affects the num-key as well, but I have no need for that key at this moment.

But strangly, NUM LOCK event is also occuring when I press “Pause”. Since I will not use NUM LOCK KEY at all ( I don’t have number pad anyway), I will add extra mapping entry to convert NUM LOCK event to be converted as “NO EVENT”.

 

How to stream on justin.tv using Adobe Flash Live Media Encoder

So, you would like to start streaming on say justin.tv or through a similar streaming service? Here’s a short list of resources I used in order to start my “soaring career of livecoding” (pun intended).

  1. Firstly, I downloaded Flash Media Live Encoder along with the FMLE configuration file created by justin.tv. I loaded the configuration file into FMLE which did give me an error, but most importantly setup the streaming key.

    You could probably skip this step one, if you just take the streaming key from your profile, enter it directly into FMLE and continue to step two. This was just the order managed to get everything working on the first try.

  2. I’ll now point you to this thoroughly written, Guide to Desktop Streaming: Using Flash Media Live Encoder (FMLE).
  3. Here’s how to make listeners hear what you hear, like music playing on your desktop. Enabling stereo mix / loopback using Windows 7/Vista.

This setup will allow you to stream to various sites, as well as save your streams locally into a neat video file. Here’s a sample of my livecoding to boot. Might not look like much, but it’s fun. :)


Watch live video from “Lonecoders” unite! on Justin.tv

 

Setup Kazam Screencaster to record application audio

Hi there,

Here’s just a real quick post about how to record application audio using the Kazam screencasting tool. 

Basically

  1. You need to install the pulseaudio volume control from the package manager of your choice.
  2. Under input devices locate the Show option bar, and switch it to All input devices.
  3. This will show you monitor of internal audio …, which needs to have its audio enabled. And you’re good to go! :)

Smørbrødliste for WordPressutviklerar

Liste av nyttige ressursar for folk som gjerne vil utvikle WordPressider.

Nyttige programmer

  • Firefox, ein snasen nettlesar.
  • FireBug, eit programtillegg til Firefox for å se på kildekoden.
    • Starte Firebug i Windows (firefox), [ctrl + shift + c].
    • Starte Firebug i Mac (firefox), [ctrl + shift + c].
  • FireFTP, eit programtillegg til Firefox for å laste opp filer.
  • Opera, nok ein snasen nettlesar. Kan være ein grei partner når det kommer til css editering av farger.
  • Sublime Text 2: Beta, finfin teksteditor for html og tekst editering.

Instruksjonsvideoer

Installasjon

Demonstrasjoner av finesser ved WordPress

Ressurser for arbeid med stilskjema (css)

Eksempler

Oppslagsverk

Plugins

Her følger lenker til hjemmesiden for dei ulike programtilleggene (plugins) til WordPress. NB. Den enklaste måten å installere desse tillegga er ved å gå inn Plugins menyen, når du er innlogget WordPress’en din.

 

Omslagsbilete, CC-Flikr: Christian Cable.

Semantic web application with Jena toolset, Maven and Jython in Eclipse

I expect you arrived here because you would like to use Python (Jython) to create a web application running on say Tomcat that also utilizes the Jena Semantic Web Framework? Maybe you also would like to add Maven to this mix?

You’ve come to the right place then!

This is not an in-depth tutorial. I will only point to good sources, talk about my experiences And assure you that such a Maven/Jython/Jena/Tomcat webapp can be done!

Resources (in the order I expect you would need them):

  1. Download Eclipse, I can tell you I used the Eclipse IDE for Java EE Developers.
  2. Setting up Maven in Eclipse (Good video tutorial)
  3. Webcached step-by-step guide, for creating a Jython web application that uses Maven and runs on a Tomcat server. Don’t know how long this will stay cached by Google, so I will include a text-export here. The author of that page has also released the sample project under an Apache 2.0 license, so you do have the option to just build upon his work directly.
  4. Install Git for Windows. The tutorial mentioned above will ask you to perform certain commands inside the project you’re creating. If you’re on Windows that might be a hazzle to navigate to the relevant folder with the cmd. Having installed Git you can instead right click the folder and select “Git Bash here” to fire up a command-line window that’s navigated to be exactly where you need to be before typing in the Maven commands.
  5. How-to change WTP version in Maven. The tutorial prompts you to do that, without saying how.
  6. Example: Using Jena with Jython. Just shows how you can interact with the Jena toolset. I modified that code just a little bit in order to make it into a servlet: See what I did (Gist).

There’s also an alternative

You could also use the Play Web Framework (excellent video introduction there), which is Java-based and supports rapid development. In our semantic web project we wanted to find an easy way to create a web application that uses the Jena Toolset. Frameworks like the Spring Web Framework seemed much to heavy for our purposes, so we we’re attracted to the idea of creating a Jython/Jena combo. After a lot of researching/googling/headscratching I made it work. (And felt quite proud for doing so.) Naturally, it didn’t take long before someone introduced me to the Play Web Framework. It seems awesome, and we might go with that instead. Nevertheless, there might be instances where you would like to use Jena in a pythonic way on a web server.

Cheers!