1. UI Design in Hacker News

    It seems a week doesn’t get by without a post or two in Hacker News about GUI design or graphic design, often entitled something like “Design for Hackers” or “Design for Developers”.

    The trouble with all these posts is that they are trying to shortcut the methodology of design by various hacks, even something as lengthy as read 5 books is by-in-large a hack.

    There is no substitute for practise, for looking and appreciating your world in a different way (this can be self-taught, I will discuss more below) and for in-depth thinking about what either comes down to communication or feedback problems.

    Aesthetics largely is difficult to teach and learn and comes from confidence and a place in the brain that is hard to hack, but communication and interaction is learnt from early childhood by everyone – it just needs opening up and awareness of this as we mature.

    By looking at the Design of Everyday Things (the book or the things around you) you begin to appreciate or notice the failures in signs, handles, buttons, phones, car controls, packaging and if you are tuned into this way of thinking it can be hard to stop considering the amount of interactions with “things” we have everyday.

    Then taking this body of knowledge that is learnt one can then start objectively looking at one’s own design and interaction problems, using the same tools that you have been using to analyse potential problems as they occur and working them out to find the best solution. But knowledge of the best solution will also come from practise of working with the constraints of whatever medium are working in (for example print, application, touch screen, architecture or furniture design).

    This practise will mean mistakes – this is an important part of the learning process, just as it was when growing up, you will learn what works and doesn’t work and in the future intuitively work with this in mind.

    By timc3 on the
    January 15th, 2013
  2. 2012 to 2013

    So another year is gone by and another year where I haven’t really blogged much, concentrating instead of Cantemo which had a pretty amazing year.

    At the start of 2012 I made a list in Evernote of all the techie things that I wanted to achieve and I am going to review them here.

    New Website/Blog. Well I have started on this. This site and my portfolio site are now quite out of date, www.timc3.com even having my old title so its been time for an upgrade. Couple this with the fact that I have had this WordPress instance hacked several times then I have good reason to move. I have wanted to use a static site builder to ease the need for Database and dynamic hosting, reducing the attack surface but even those have a large amount of installations that are needed.

    I MUST do this in 2013.

    Shuttle Plugin. This was a Google Chrome plugin for automatically searching or jumping to a URL, primarily for RedMine, based on keywords. Inspired by DuckDuckGo I didn’t actually realise that there is some functionality in Chrome for already doing this. Mine has a nice logo though.


    Paint Wood in the Apartment. Not exactly technical, but a goal none-the less. I estimate I have done about 30% of what I need to do. Business and software writing took over.

    An easy goal for 2013 with the other renovations that I will be doing.

    Open source Project. I have posted a couple of projects up to GitHub and Bitbucket. Nothing really of note.

    Could do better in 2013 work depending.

    Working on Haiku. I loved the ideas and goals behind this operating system, and would love to contribute with my mix of coding and GUI design skills as from what I can see they could strongly do with the help.

    I fear that I won’t have time in 2013 to do anything here.

    MediaBox 1.4. This was a goal for work, release version 1.4 of MediaBox. Since I wrote that it has been renamed to Portal. We went on to release 1.5 and also the following goals met:

    • Adobe Premiere Pro integration.
    • Rough Cut Editor
    • Annotation Tool
    • Audit Tool

    Plenty more releases coming in 2013!

    So looking up at the above I still have some work to do in 2013. Add to that family time, a lot of apartment renovations, great software from Cantemo coming up, time at trade shows, and some trips abroad hopefully it looks like a busy 2013.

    By timc3 on the
    January 6th, 2013
  3. Raspberry PI update

    So a while back I got delivery of my Raspberry PI, but I have been so busy developing on our Rough Cut Editor, Annotation Tool and Adobe Premiere support that I haven’t had time to use it.

    But now I see a project that I really want to try:

    http://www.cl.cam.ac.uk/freshers/raspberrypi/tutorials/os/ – Baking PI or basically build your own OS 101. I have always wanted to do this, but have basically all my hardware in operation at once and nothing cheap to try it on. Well I guess here I am, have the hardware and the means for next to nothing…

    By timc3 on the
    September 2nd, 2012
  4. Xcode 4.4 and MacOSX SDK 10.6 on Lion.

    In XCode 4.4 Apple has made the decision to not ship the MacOSX10.6.sdk that is in use by 100s of apps. The choice is to either not install XCode 4.4 and continue using XCode 4.3 or if you have already downloaded XCode 4.4 you need to get the XCode 4.3 DMG from Apple and then extract the MacOSX10.6.sdk from it and place it with the other SDK versions.

    If you already have a /Developer/SDKs/MacOSX10.6.sdk SDK bundle, then its possible to symlink it in and skip these instructions.

    1. Go to Apple Developers download page and download XCode 4.3.3 for Lion.
    2. Mount the DMG on the desktop and right(option) click to choose Show Package Contents.
    3. Copy Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.6.sdk Folder
    4. In a terminal or iTerm2 open the SDK folder by typing
    5. open /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs
    6. Paste in the SDK folder with the other SDKs
    7. And continue on building

    Please note that I haven’t tested this on Mountain Lion, so your experience with MacOSX10.6.sdk on that platform might vary.

    By timc3 on the
    August 22nd, 2012
  5. Open Indiana NTP

    I really like OpenIndiana, but finding some documentation for even the most basic things sometimes is difficult. Take NTP for instance, should be easy right.. And it is if you know what you are doing.

    vim /etc/resolv.conf
    Setup the search domain above, then copy the ntp configuration file:
    cp /etc/inet/ntp.client /etc/inet/ntp.conf
    Edit the configuration file putting in the servers that are near to you.
    vim /etc/inet/ntp.conf
    Enable NTP:
    svcadm enable ntp

    By timc3 on the
    August 15th, 2012
  6. Profiling Django applications – part2

    Profiling using CProfile.

    Sometimes it is advantageous to look at what your application is doing before it goes in to production. Using tools like iPDB and PDB we can step through code, particularly in the view that you are working on, but it doesn’t tell the full picture of what is going on up-until that view is called, or after the HTTPResponse is starting to be returned.

    It is easy to start profiling django runserver using CProfile:

    python -m CProfile manage.py runserver --noreload > profileout

    Here what we are doing is starting up manage.py runserver wrapped in the profiler – CProfile. We start runserver with –noreload so that it doesn’t fork the filesystem watching process that probably doesn’t need to be profiled, and then we push the results of CProfile out to a file called “profileout”.

    This will give us output like this:

    So what we can see here is a list of calls, files and the time it takes to complete and how often they are called.
    This is some interesting information, and there are actually plenty of resources to look into this. In a later part of the serious we will further into these results.

    But I prefer that we actually look into where we spend the most time and so I often take the results of CProfile and create a graph of it.

    python -m CProfile -o output.pstats manage.py runserver --noreload

    This time we are running whilst outputing to output.pstats, a file that we can then feed into various utilities such as gprof2dot. This requires the dot library for generating graphs (installed on my OSX system using homebrew). Gprof2dot is available from http://code.google.com/p/jrfonseca/wiki/Gprof2Dot – simply download and install it. It requires graphviz.

    python gprof2dot.y -f pstats output.pstats | dot -Tpng -o output.png

    This will then create a png graph of where the most time is spent as a program is called.

    By timc3 on the
    August 13th, 2012
  7. Profiling Django applications – part1

    I have been doing some profiling of a Django application in different ways, and this is something that can be very useful to understand where bottlenecks are, why code behaves in certain ways and where we can trim the fat.

    There are multiple places where we can profile Django, and many of the pointers and resources from Python at large can be used when profiling Django. Things like Hotshot, cProfile and timeit are available, and there are helper libraries around these tools.

    In this series of posts I am going to be looking at what we can do to look at the performance of our Django application.

    Firstly if you are not using logging in your app then start here. Without logging you are seriously making life more difficult for yourselves. The Python logging module is fine, Django 1.3 and onwards includes built in ability to log and setup logs from the settings.conf file, before that you could get email logs from setting up email subsystem and admins. The error email gave you stack traces of errors. It is better than nothing, and you will get notification of others having an error on your site but having debug level logs for development and error logs on exceptions and exception catching middleware that logs will help you a great deal.

    Logging daemons
    If you are logging in a production environment a good first step is to use the tools that you have available to you on the operating system that you deploy to. This means use SyslogD or RSyslog on BSD and unix systems (unless you have very long logs – syslogd truncates long lines). This will give you automated rollover, the ability to configure central logging daemons and a logging infrastructure that most sysadmins will understand.

    The Django settings.conf allows you to setup logging to the daemons and as it uses the Python logging module you can benefit from logging to several places if you need to. For instance a common pattern I use is to email out exceptions to admins, log normally to syslog.d but when an exception occurs log to a separate file so that the stack trace doesn’t get truncated.

    Another reason to use a logging daemon and not just write to a file is that logging daemons can accept input from multiple sources. This really helps when you have multiple worker daemons on the same machine (which is most probably true if you are trying to take advantage of a multi-core system). Multiple daemons writing to the same file is not recommended with Python.

    External logging services.
    Moving on from here, if your site is in need of more logging capabilities consider using the excellent Django Sentry that was rolled out of Disqus. It will log to a central database, giving you excellent tools to deep dive into your logs for analysis.

    Lastly if you prefer a hosted solution you should consider newrelic – it costs money, but in my testing of it it has been excellent. Not only does it give you the abliity to collect logging information, it also provides centralised profiling and indepth information on the permformance of your applications.

    By timc3 on the
    May 10th, 2012
  8. Disqus

    In the battle to stop the hacking of WordPress I have migrated the comments over to Disqus.

    Looking at the logs over the past few days its quite clear that there is something wrong with the way that WordPress handles incoming comments, probably all it takes is to buffer overflow the comment URL and the hacker can inject code.

    So I have disabled the comments in WordPress and moved over to disqus, which was something that I have been wanting to do for a long time anyway. I want to migrate more and more away from WordPress until I get to the point of either using it as a static site generator or building a from a real static generator.

    By timc3 on the
    May 7th, 2012
  9. Firefox video performance

    There is not going to be much decided in this post, rather looking to vent.

    After spending about 7 hours yesterday looking into performance problems with Firefox I can’t but help be dismayed that webm and ogg playback take up so much CPU time.

    In my tests it is currently using 100% of one of my cores, but what is worse is that it effects anything else going on at the same time, meaning that I have to be really careful running loops, creating JavaScript objects and generally doing anything else on the same page.

    The sooner they implement support for native operating systems video support the better.

    By timc3 on the
    May 1st, 2012
  10. Celery ghetto queue

    Currently wondering how the ghetto queue might work for smaller installations.

    I have done larger installations using RabbitMQ, celery’s preferred message mechanism, but for smaller loads and services running straight from django and postgres might be a good idea.

    I guess it maintains the flexibility of having an upgrade path but is less to install and maintain, thus being kinder to sysadmins and support staff.

    Going to try it I think.

    By timc3 on the
    April 27th, 2012