About Jonathan

The platform’s rookie. I spend my days honing my machine learning skills, coding in Python and rock climbing (in no particular order).

Mutable Default Arguments in Python

A member of the platform recently stumbled upon a bug in his python code. Once we got to the bottom of it, we were surprised to find that the bug in question had been caused by a peculiar behavior of Python. Let's take the following code as example : def foo(bar=[]):     bar.append('a') return bar Intuitively, this piece of code might seem like it ought to return the list ['a'] whenever it is run. In practice, it is not quite so. >>>foo() [...]

By | 2017-05-01T09:53:39+00:00 August 7, 2015|Categories: Python|0 Comments

Client-side storage on the web

Web applications can provide users with cross platform tools which can easily be maintained and updated. It is therefore little wonder why bioinformatic tools are often published as web applications. However, some legal as well as computer security considerations can arise while operating on certain types of data  (e.g. medical or proprietary). In such cases, it may be preferable to store some of this data locally on the client's browser. Local data storage options are plentiful but can quickly become a little disorientating. Here's a small rundown [...]

By | 2017-04-29T15:47:47+00:00 January 28, 2015|Categories: Computer science|Tags: |0 Comments