Archive for August, 2013

On the road

August 30, 2013

On the road

There were some interesting patterns in light and dark on the way to a particular destination recently.

Experiments with WatiN

August 14, 2013

Hi folks,

So recently I decided that it’d be a good idea to get slightly up to speed with WatiN since I’ve gathered that it might come in handy to have an idea of a good automated testing framework, compatible with a decent development language, like C#.  It was certainly interesting learning how to use it.  After installing Visual Studio, I found this video, which seemed quite straightforward.  However I was stymied by my lack of resharper – a tool which costs about $200 for the latest version.  I decided to try the trial period for the tool, but then found out that I needed a license for Visual Studio (full release) as well, which would be at least another $800! So too much (even though resharper looks like a most excellent tool to have at one’s disposal, if say one was a hardcore .Net developer).

Luckily however I then found this video, and managed to run my first “Hello WatiN” script.  That was quite satisfying.

Naturally, of course, there are other testing frameworks out there, such as Selenium.  In particular, I installed the Selenium IDE for firefox 22 as a plugin, but didn’t really get around to playing with it before I became distracted by WatiN.  However WatiN seems more advantageous to a commercial organisation because it is inherently a plugin for Microsoft Visual Studio via the .Net framework, and the Microsoft .Net framework is built to run with the Microsoft office suite.  But being more or less still completely ignorant of Selenium (apart from the fact that scripts in Selenium can be recorded ? by actions in the browser ? and are recorded in a unique scripting language called “Selenese”) I will have to defer judgement until I have a better look at the tool.

In other news, I’ve started reading up on R.  A while back I downloaded R as well as R Studio, but for some time now they’ve been sitting on my machine, consuming space, waiting for me to eventually get around to learning how to use them.  So now I finally have, and am starting to get across such elementary ideas as vectors, booleans, dataframes, file i/o, and other basic commands in the kit.

My eventual goal is to become sufficiently competent with R that I can do linear regression, then implement additive/generalised linear models, and also be comfortable with various forms of hypothesis testing with the framework.  Ultimately I’d like to be at the frontline of work in computational statistics / data analysis / whatever the kids are calling it these days; but I anticipate this will likely take some time.

Simultaneously I’ve started to haunt kaggle.  My philosophy with kaggle is that it is a good way to cut my teeth on some elementary data problems, and build some legitimate skills (and maybe even some street cred in the process).   While on the site in particular I noticed a plug for a python package built by some Londoners called scikit-learn, so dutifully I’ve set up a virtual environment for it and have essentially playtested it to the point of completing my first “hello scikit-learn” script.  Apparently the strength of scikit-learn is that it is a great python library for machine learning – not sure how it compares to R though, particularly with R’s extraordinarily established community and extensive set of libraries.  But scikit-learn builds on numpy, scipy, and matplotlib.  And of course there are vast numbers of other python libraries.  So until I know more, or have had more time fooling around with the tools, I won’t know for sure if one toolset is definitely superior to the other – or whether they each have strengths in certain situations.

Finally, I thought I might share something really neat I learned of today (from the Unity blog).  Some of you have probably heard of the Oculus Rift – part of the renaissance in wearable computers / virtual / augmented reality that has been underway now for perhaps the past year or two, and largely facilitated by such enterprises as Kickstarter which itself was founded only in 2009.  There is a similar device too, called the Leap motion controller / detector.  Both are still largely alpha – Leap motion certainly is – however these developments, although groovy, are not the key development I wish to bring to the attention of this forum.

No, rather it is a recent development emerging from the labs of Columbia University, New York.  The meta is an augmented reality headset with a gesture driven interface, combining aspects of both the Leap and the Oculus.  They have some big names backing the project including Steve Mann, the father of wearable computing as chief scientist, and James Knight, head of performance capture on Avatar (the recent blockbuster movie with blue people).  So really, really interesting.  And the project is designed to work with Unity, too.

As for my Unity project, that is currently on the back-burner for the time being.  I’ve certainly not forgotten my aspirations to implement data persistence in the game world in question.  As for now, however, I have several other demands on my time and attention which I think I should give precedence to.

Unity, Git, and other meanderings

August 2, 2013

My Unity projects have been starting to become a bit large and in need of a good pruning / refactoring / reorganisation.  However, I am loath to do so with abandon, since I am afraid that I might break something irretrievably!  So, I’ve started to develop an interest in version control systems.  Indeed, with the release of Unity 4.2 I was interested in what could be done with the new version control system that is built to work well with it.

My initial best guess was that it would be Git – instead, it is a different animal, namely, Perforce.  Perforce, apparently, is supposed to be uniquely suited to dealing with teams working on very large (100s of MB, if not upwards of 1 or 2 GB) projects, offering the “best of Git” together with the “best of Subversion”.  Merging is apparently done on the server, rather than on individual machines (terminals?) of users – as opposed to Git, where the merges must be done locally.  Interestingly, it appears that it is possible to obtain fairly reasonably priced plans with the tech – in the cloud – for a reasonable amount of storage, too!

So I had a bit of a poke to see what the story was with implementing a setup of the thing.  Largely speaking, however, I found the profusion of products, terms, and other general goobledegook on the main perforce website a bit too confusing, and difficult to navigate to find, well, the main perforce VCS (maybe it is P4? not sure).   Indeed, even then, I’m still not convinced that it suits my purposes – since I am still working largely by myself with Unity, and therefore am just after a VCS where repositories can be locally managed.  This does not mean that using Perforce isn’t ultimately the best option for VCS with Unity – I’m sure that there may well be some logic to the whole thing – but I’m currently interested in a quick fix.

So, since I already understand Git – and have never version controlled a Unity project before, anyway – I decided to have a poke around the web for ways to get started directly using Git with Unity.  A post on the Unity forums led me to this series of posts, which is essentially more or less a comprehensive ‘how to’ of using these technologies together.

In other news, I’ve been starting to work on my first opensource collaboration.  This has been quite interesting.  I’ve been learning about Oauth for google and twitter, in terms of “logging in” to a service from a website.  Fascinating stuff!  Also some deep and interesting things about python, too.

While I was ferreting around on StackOverflow, moreover, and trying to understand the structure of the project in question, I came across another goldmine of useful information regarding things pythonic – a series of three posts written by a fairly knowledgeable chap.  They were:

There is also an extremely useful post / discussion about *args and **kwargs here.   The top two comments there clarified matters for me on these terms no end.

Regardless, I’m currently up to the stage with the project where I’ve managed to, sort of, get twitter authentication working.  The main roadblock I’m encountering now is a ‘pickle error’ (yes, another pythonesque thing I’ve never encountered before this point).  It turns out that in certain circumstances Python encodes objects (like functions or classes) as a bytestream (this is ‘pickling’), which is sent somewhere, and then decoded (this is called ‘unpickling’).  However certain things cannot be pickled.  For instance, if one function calls another function that is not instantiated within a base class object (as I have done), then that is a no-go.

So basically the plan to eliminate the pickle error is to consolidate a few functions, hopefully in a relatively sensible manner, into an authentication class.  That should be interesting.