Softwire Blog


Walking desks: the new standing desks?


28 October 2015, by

WalkingDeskThere have been a lot of stories about how there are many benefits to standing all day rather than sitting in an office. But how about a walking desk?

We’ve offered employees the opportunity to use standing desks for a while now, which we provide using some carefully selected IKEA parts (a coffee table and a shelf) and with a small amount of effort result in a great desk for this purpose.

However, recently we decided to take this a step further and set up a walking desk. There are lots of commercial options out there, but as they are quite expensive, we decided it would suit our needs better to build our own. Fortunately we have a very good handyman who helps out with minor tasks around the office, and so we tasked him with building us a desk that:

  • Fit over the existing treadmill in our gym
  • Had a large work area
  • Was adjustable, so that it would be practical for people of all heights

We’ve been using this desk for a while now, and personally, I find it great for maintaining focus, and particularly useful for finally getting round to that task you haven’t been looking forward to all week.

Walking and working helps brings clarity to my thoughts and although it makes my handwriting near illegible, my typing is barely affected. The walking quickly feels natural and it’s perfectly easy to do an hour or so walking along at a slow pace.

The disadvantage of the walking desk is that it can be quite noisy. We got around this by installing it in our gym to begin with and we’ve now moved it to a more permanent home in one of our meeting rooms.

Overall, we think that walking desks are a great idea, and although no employees have planned to switch to one on a permanent basis, it works very well as a hot desk. So if you have the time and skill (or money) to try one out. I’d definitely recommend it!

OpenStack – An overview


16 October 2015, by

OpenStack Logo

What is it

OpenStack is open source virtualisation software that can be run on generic hardware, allowing you to build your own cloud. In order to provide high availability, several servers can be clustered together. This allows resources from several servers to be pooled into one place when deploying machines.

(more…)

Custom outlook filters


11 September 2015, by

Outlook is both a blessing and a curse. A recent post by the BBC suggests that receiving too many emails can damage one’s productivity. The extremist response here would be to ban internal e-mails, but realistically that’s probably not a very achievable solution. So is there anything you can do to help you wade through the information that’s being piped into your inbox? We think so, and the answer is outlook filters. (more…)

Mentoring the start-up talent of the future, at #Festival of Code 2015


21 August 2015, by

What is Young Rewired State and the Festival of Code?

FestivalOfCode2015YRS is a worldwide community of digital makers aged 18 and under. YRS started running the Festival of Code seven years ago, and it has grown hugely since then. It is free for all young people.

The Festival runs for a week early in the summer holidays. Young digital pioneers, working with the support of volunteer mentors, collaborate to build apps, websites, games and problem solving algorithms aimed to help improve their communities. The only rule is that their projects have to use at least one piece of Open Data – anything from Twitter feeds and weather data, to research data from CERN, so long as it’s free and publicly accessible.

At the end of the week, the coders converge to showcase their projects and compete in the finals. This year, they presented their projects to expert judges, mentors and the press at the Birmingham International Convention Centre on 1st and 2nd August.

What do the youngsters and mentors get out of it?

Who better to hear from than a youngster who got involved?! See what George says.

The mentors also have a great time! As Will said, ‘Everyone worked really hard and had a great time; people’s enthusiasm reminded me of why I learnt to program’.

What did the coders at the Bristol centre build?

  • A spoiler alert browser extension hiding content from TV shows from web pages across the internet.
  • A Top Trumps-like game about local places.
  • A weather and accident map visualisation to explore the correlation between the two.
  • A game where you bet points on whether search terms become more or less popular on google.
  • A map of airports and their associated live data.

Who won the nationwide competition?!

Here’s TechCrunch Mike Butcher’s post on this year’s Festival, with a run down of the winners.

Some noteworthy facts:

  • In seven festivals, the numbers of girls involved has grown from 2% to 30%. You can see more about this in Emma Mulqueeny’s post – she founded the Festival of Code.
  • This year, there were 66 regional centres in the UK with over 1200 coders participating at the weekend showcase.

A huge thank you to our Bristol intern Will Price and developer Jake McKenna for giving up their week to support the participants.

Softwire in 2015


20 July 2015, by

If you are interested in how we run as a company, you should watch the following video.

Writing good notes during meetings


19 May 2015, by

NotesHave you ever come away from a meeting with the feeling that you’ve missed or forgotten some important information? Below are some tips to help you write better notes: if you apply them (and practice) you will find that your notes are much more useful and you retain the ideas and information that come out of your meetings for longer. (more…)

Currying in Node.js


29 April 2015, by

Having been doing a lot of functional programming recently, I discovered myself wanting to curry functions while doing some work in Node.js recently, but the question arose as to how?
Currying a function is providing some of its parameters now, and the rest later and is very common in Functional languages:

Scala

def add(x:Int)(y:Int) = x + y
def add2 = add(2)
add2(10)     // 12

F#

let add x y = x + y
let add2 x = add 2
add2 10      // 12

But how can you do this in javascript when you have to provide all of the arguments to your function?
Well here are a few options:

  1. Get the extra variables in scope (not really the point, but will work in some situations).
    val y = 2;
    function add2(x) { return  x + y; }
    add2(10);    // 12
  2. Return a function from your function.
    function add(x) { return function(y) { return  x + y; }; }
    var add2 = add(2);
    add2(10);    // 12
  3. Use bind to perform partial application instead.
    var add = function(a, b) { return a + b; }
    var add2 = add.bind(null, 2);
    add2(10);    // 12
  4. Extend Function.protocol.
    Function.prototype.curry = function(){
      var slice = [].slice,
          args = slice.apply(arguments),
          that = this;
      return function() {
        return that.apply(null, args.concat(slice.apply(arguments)));
      };
    };
    var add2 = add.curry(2);
    add2(10);    // 12
  5. Use the curry library.
    var curry = require('curry');
    
    var add = curry(function(a, b){ return a + b });
    var add2 = add(2);
    add2(10);    // 12

The curry library is doing something very close to 2 behind the scenes. It will however also let you do partial application as well if you want.

var sum = function(){
  var nums = [].slice.call(arguments);
  return nums.reduce(function(a, b){ return a + b });
}
var sum2 = curry.to(2, sum);
sum2(2)(10);      // 12

Scala connections to your Cassandra database


30 March 2015, by

ORMs can be a complicated part of any app that you are writing, so it is always great to find one which makes life easier. On a recent Scala project, we chose to use Phantom to connect to our Cassandra database. The advantages it offers are that it provides a very simple interface for accessing data, and also creating column families while still being based on the datastax driver. This is great as it means that your code remains very readable, but you are also still free to use any advanced features which may not have found their way into the library yet. The following examples all compile against Phantom version 1.22.0.

Here’s a simple example of a class that could be used to access a column family:

import com.datastax.driver.core.Row
import com.websudos.phantom.CassandraTable
import com.websudos.phantom.connectors.RootConnector
import com.websudos.phantom.dsl._
import java.util.UUID
import scala.concurrent.Future

class FooTable extends CassandraTable[ConcreteFoo, Foo] {
 object id extends UUIDColumn(this) with PartitionKey[UUID]
 object bar extends StringColumn(this)
 object baz extends IntColumn(this)

 def fromRow(row: Row): Foo = {
 Foo(
 id(row),
 bar(row),
 baz(row))
 }
}

abstract class ConcreteFoo extends FooTable with RootConnector {
 def insert(row: Foo): Future[ResultSet] = {
 insert.value(_.id, row.id)
 .value(_.bar, row.bar)
 .value(_.baz, row.baz)
 .future()
 }

 def getById(id: UUID): Future[Option[Foo]] = select.where(_.id eqs id).one()
}

case class Foo(id: UUID, bar: String, baz: Int)

That’s now sufficient for us to do most of the interaction we want with the database. However, before we can interact with it, we’ll also need a database connection. This can be done using the following code (don’t forget to update the connection values to be correct for one of your cassandra nodes).

import com.websudos.phantom.connectors.{KeySpaceDef, ContactPoint}

object DefaultConnector {
 val connector: KeySpaceDef = ContactPoint.local.withClusterBuilder(_.withCredentials("admin", "password")).keySpace("keyspace")
}

class Database(val keyspace: KeySpaceDef) extends Database(keyspace) {
 object foo extends ConcreteFoo with keyspace.Connector
}

object Database extends Database(DefaultConnector.connector)

The Phantom library will take care of handling database connections for you when you access data through these objects.

Now that we’ve got a connection, it’s simple to:

Create the column family in the database:

Database.foo.create.ifNotExists().future()

Put some data into the database:

Database.foo.insert(Foo(UUID.randomUUID(), "new foo", 1234))

Get some data out of the database:

Database.foo.getById(UUID.fromString("uuid1"))

This simple interface should be enough to do most things with your Cassandra database, and hopefully the code snippets above will help in setting you up for easy database interactions!

If you would like to know some more advanced tips on phantom, check out the outworkers’ blog.

The best way to manage your task list


23 March 2015, by

Check ListI’m not about to give you the perfect task list. If I could, I would, but different people have different requirements for how their task list works, where it is, and how it reminds them of upcoming actions/events. At Softwire each employee chooses how to manage the tasks they need to do. In this blog post, we take a look at 6 different options that are used within our company. It’s up to you to decide if they’re the right option for you or not!

(more…)

David Simons on “When it’s right to be wrong”


24 February 2015, by

At a recent SoftCon talk, David Simons explains how there’s a trade off between speed and accuracy in algorithms, and what this means from a computing perspective.

See his talk here: