Tuesday 27 August 2013

Eclipse loses your stuff, but that's okay

The last time that I mentioned Eclipse I hadn't yet come across any major issues, but I recently came across an error that makes it appear as though you have lost all of the work that you have ever done in Eclipse. It forgets where it has put all of your things, and you need to import all of your projects back into Eclipse. Despite repeatedly stressing 'all' back there this isn't a huge drama, but if you don't know that it is easily fixed there will be all of the swearing.

The error will say:

The file does not exist        org.eclipse.core.filebuffers

That is okay though, because we can fix it in two easy steps that are actually made up of a couple of steps each, but you could skip the whole first step and it's sub-steps, but you should read it to find it if you need to first.

1. Workspaces 

You will need to know where your workspace is, so if you are certain that you know, go to step 2. Otherwise follow these directions.

Windows -> Preferences

Once the preferences pane is open, expand 'General', then 'Startup and Shutdown' in the menu on the left. Click on workspaces. This should show you a list of your workspaces. Most people should only be using a couple. If there is more than one, and you aren't sure which one you want, find them in explorer.

2. Import

File -> Import

Once the import pane turns up expand 'General' and select 'Existing Projects into Workspace', and click 'Next'.

Browse to your original workspace folder (which we looked up in step 1), because the files haven't actually moved. Once you have done this a list of your projects will appear in the window. Make sure the ones you want are ticked. If they are grayed out, they should already be viewable by Eclipse. If you use nested projects, tick that box too. You won't need to tick 'Copy projects into workspace', because they are already there.

I was pretty frustrated by this, and I'm not entirely sure what brings it on, but it hasn't really put me off Eclipse. It would be nice if it just didn't do this, but it does and it is still a fantastic IDE even with this special feature. While it appears to be a relatively major issue, the fact that is so quickly and easily fixed renders it a nuisance at worst. I came across another incredibly tedious fix for this, but importing is quicker and easier.

Monday 26 August 2013


I recently got myself a twitter account, because I was required to for my Social Web Analytics practicals. If I get enough followers and people talking about 'united by glue', I will probably be able to use 'united by glue' data for my assignments and practicals.

There is another @unitedbyglue, so make sure you use the camelled @UnitedByGlue.

Wednesday 21 August 2013

The sharp hand of fate

There are certain conversations that become part of your academic landscape. Conversations where we exchange knowledge, opinions and ignorance in the form of hypotheticals pertaining to whatever field we happen to be studying. I remember this being particularly loose at art school, and the purest form of ignorant auto callipygian osculation while I was studying philosophy. These conversations have been a little more down to Earth while studying ICT. Well, to be strictly honest some of them are pretty wild, but for the most part they usual centre around professional projects or assessment tasks. The second most common of these concerns situation specific language preferences.

I was having one of these second most common conversations with some of my fellow study monkeys, when I was queried as to in which language I would prefer to work given a specific assessment task, Java or C# (C-Sharp). I gave the perfectly reasonable answer that I would prefer to work in Java, because I had no experience with C# and though I assumed it was similar to C++ (which it really isn't), I wasn't prepared to jump into a project without knowing where and how it differed.

Later that same day, I said to another student who had been absent from the original conversation, "I hope I never have to learn C Sharp, just so that I can decrease the risk of having to deal with people who call it C hash." BAM! Right there. The Fates heard that, and in it they saw a certain poetry in striking my wind-pinkened cheeks.

That was the Thursday before last, and it turns out that the Fates make up their own long weekends, because they got round to me on Monday last, when I met with my tutor with whom I am going to work on some research related activities, such as research. We had a similar, but far less hypothetical discussion about the project at hand, with the presented options being JavaScript and C#. Now, as a more experienced programmer with a foreign accent, he swayed me quickly and easily to his point of view, and C# became a part of my life.

As I considered the irony of this situation, I made my way to the library, only because getting even mildly across the new language seemed like the prudent thing to do, where I picked up a book with a fish on it. Not more than fifty metres from the library did I come across one of the students with whom I have forged some sort of social relationship. "Hey, you on your way to the tute?" he asked, referring to the next class that we shared. I responded in the affirmative, and the conversation lapsed momentarily. Noticing the book he continued, "Why are you learning C hash?", and so the nightmare began.

Wednesday 14 August 2013

Realworld applications for statistics

This morning I found myself uncomfortably close to a stranger on a crowded Sydney bus. Generally speaking this is not how I like to make the trip to work. The two of us had found ourselves awkwardly positioned by the sudden influx of passengers, a desire to remain upright and an unwillingness to press our more intimate body parts into the faces of those passengers who had boarded the bus early enough to be seated. There was an initial mutual acknowledgement that neither of us would normally stand this close to a stranger without at least first being on the right side of a good couple of hours of drinking, then we both fulfilled the obligatory attempts at finding somewhere for our eyes to be that weren't each other. It's a ritual and it is time honoured.

Standing as close as I was, it was difficult not to notice the even coverage of his three (or four) day stubble. Those that have stood close enough to my unshaven face, will know that a man of my facial follicle spread is want to appreciate, and perhaps covet, a more consistent patterning. This isn't what caused me to stare, and I did stare. each hair seemed so similar in size to those that surrounded it, while differing from those situated around other areas of his face. Clear and neat patterns of length and direction swirled before me in tiny pitch black vectors against the consistent hue of his brown skin. They seemed so perfect that not for a second did I doubt that I could plot them in R, given the right formula. I imagined the elegantly nested loops that I would write, paying homage to Turing in my mimicry of nature. I could scan his cleanly shaven face, and call the image to set my plot against it. It could be a game. An exquisite game. A race to the formula that would reproduce the brilliant display that lay before me.

I don't know when he noticed, but it was definitely before I did. By the time I realised that I had been staring, I looked up into his eyes and saw a very particular kind of discomfort. I considered explaining myself and what I thought about doing with his face, but it occurred to me that this could be the wrong thing to do. You don't tell strangers that you want to make a game out of their face. Our previously discussed positioning prevented either of us from removing ourselves from this newly heightened discomfort, and we simply made the rest of the trip in silence.

He could've been famous.

Friday 9 August 2013

Unity in three easy steps

I mentioned Unity a little while ago, and said that I would get back to it at some stage, well that stage is NOW! I'm not going to go into too much detail about everything to do with Unity, and cover all of it's good and bad points. That time is not now, and honestly may never be. I will drop three tutorials on you that I fell everyone should be able to complete with minimal difficulty. I will talk briefly about those tutorials, but I think you should hook into the free downloads and let them speak for themselves.

A quick word on monitor sizes before we get too far into this. I having been playing around with Unity on a couple of systems and a couple of different monitor sizes, and while some other system resources don't seem to have made a lot of difference, the difference between 13", 15" and 22" monitors is definitely worth mentioning. I found working on the smaller monitors frustrating, and often found that it negatively affected my workflow (as well as my mood). You can still use Unity on smaller monitors, but in this instance bigger is better. If you are thinking about getting into this seriously and are working with a laptop or smaller monitor, you can pick up reasonably priced monitors from MSY, and other places of that ilk. I'd love to quote my friend Adrian on monitor sizes during his experience with modelling software, but his exact words escape me. Maybe he'll comment.

Getting Started

The current version of Unity is 4.2, and you can retrieve (download) it from unity3d.com. When you install it, you will be asked which version you would like to use. I recommend the free version for now. You will also be asked to register a Unity account. Do this. This isn't one of those pointless things that is about getting your e-mail address, and flinging spam, this lets you access the asset store, so pick your favourite e-mail and get started.

Beginner Tutorial Modules

The tutorial modules cover a surprising amount of stuff. They are incomplete for the time being (2013-08-09), but would hardly be classified as useless. Far from it. While only beginner level tutorial modules are provided on the site, they introduce you to the editor, graphics, physics, audio and scripting. This is about all you need to know to get started.

To get into these tutorial modules you will need the Unity Labs 01: Robot Lab, which will have all of the assets and things that you will need for the tutorials. The other thing you will probably need is a link.

3D Platformer Tutorial

This was the first one that I completed, and you could probably jump in here. The game is very basic, but you still feel productive. I also really like the way that this tutorial is written. It was made by the Unity guys a few years ago for a previous version of Unity, but it is still pretty straight forward. There are only a few minor differences between what is in the tutorial and what you will need to do.

Whenever colours come up the with RGB and opacity values the opacity value needs to be multiplied by 2.5ish. In the old version of Unity the opacity scale was out of 100, but most programs use a 0-255 scale now.

There are going to be a few extra things, as well as things moved around when they show you screen shots of the user interface. Nothing major, just be careful.

The other thing worth keeping in mind is that some of the values for things, like particle systems, tend to err on the cautious side. The tutorial was written a few years ago, so you can jack up some of the values fairly substantially for bigger effects. Just play around with it. You can get it through the asset store built into Unity or you can grab it from the site.

UPDATE: There are more problems with this tutorial in more recent versions of Unity, which include the sound.

Project #01: Stealth

I've read through this one, but haven't had time to start it. There isn't really anything in it that should throw you if you have done the other tutorials, but the final product is definitely more impressive, and is playable online. Unlike the 3D Platformer Tutorial, this one was actually written for the current version of Unity, but like the modules, the instructions for the tutorial are online, at the projects page, and the assets are in the asset store, under Unity Projects 01: Stealth.

Let me know how you go.

(All of the images including the Unity logo are the property of the people over at Unity, and are nabbed from their website. I'm not really across the rules for this stuff, but I thought that seeing as I am promoting them they probably wouldn't mind so much. I'll drop them an e-mail and see how they feel. Either way I will be talking about Unity again.)

Tuesday 6 August 2013

Double Dragon Style Java

I haven't had much time lately, which I'm using as my excuse for not posting recently. I've been busy with some different things, a lot of which is related to university. I am actually still very busy, so I will keep this short.

There are a great many debates surrounding the best way to learn programming, and many a heated discussion has centred on the value of learning 'real programming' versus learning logic and theory in programming courses. Everyone seems to have their own opinion, and it is crazy factional. Yay, factions! Anyway, I am a proponent of the Double Dragon Style of programming education. I believe that in order to be a true master you will need to master both of the Dragons, and understand how they work together. You must move between the dragons, benefitting from the strengths of each as you progress. In this instance Greenfoot represents the logic oriented dragon, while Eclipse is the 'real programming' dragon. Both of these tools have tutorials that cover a variety of different skills and skill levels, and both of these tools are so straight forward that I would even go so far as to suggest that even early high school (maybe even primary) students shouldn't have any difficulty with the projects included in the early tutorials. Additionally both of these tools are available for OSX, Windows and the major Linux distributions. They also both use Java, which I think is a good thing. Java is a good place to start learning to program. There are a number of reasons why and why not, but the short versions tend to sound a lot like, "Java is universal", "It's object-oriented", "It's easy" and "The more recent versions handle their own garbage collection (or so I have heard)". It may not end up being the most useful language you ever learn, but it is a fantastic language to get started on.

Our first Dragon will be Greenfoot is a good place to start, as the early tutorials will cover programming logic in a simple way while still making you feel like you are actually making things, and those things that you will be making will be games. There are a lot of fun things you can make very quickly with Greenfoot. You won't be doing a lot of 'real programming', but you will be. Programming isn't that difficult, it just seems overwhelming, and Greenfoot does a good job of circumventing some of the early boogeymen. Look, the term 'real programming' is one that I have heard a few people throw around when hating on and around Greenfoot, but in my experience it is mostly thrown around by people with a more traditional programming educational experience. It is easy to be negative about logic oriented learning, because it is often overlooked, well at least it seems to be. Either way, logic is incredibly important to programming, and figuring out a way to learn it is just as important. There is a lot of surprising stupid code out there in the bowls of the interwebs (and the all of the app stores), and it is probably best if you don't contribute to the rubbish heap.

Where Greenfoot turns the process around and focuses on logic first and 'real programming' later, Eclipse uses the more traditional approach of replicating specific tasks that is common in university courses and DIY books like Sams Teach Yourself Java 6 5th Ed. This is the way that most people learn to 'program', which is to say that it will teach you how to write code and will show the solutions to specific problems. The problem with this method is that it produces a lot of terrible coders. It is great for learning good form, but it isn't good for learning to write clever code. While clever code is important, good form is also important, and for many of the projects on which you might find yourself working closing off scanners and memory management could well be far more important to you, and the people who use your apps on their phones and tablets. The other major benefit of learning programming like this is that you will learn some of the best ways of coding common functions and solving common problems, so that you don't spend the majority of your time reinventing the wheel.

I have checked through (read as 'completed') quite a few of the tutorials, and tried to check that there aren't any major oversights. That said I can't swear that learning this way is truly effective, or that none of the important fundamentals are overlooked, because I didn't learn this way. I started with other programming languages and tools, and learned logic mostly through games, but this back and forth between the two styles makes the most sense to me. In the end these are two of probably thousands of tools out there that could be used in the Double Dragon Style, and they may not be the best, but I will vouch for these two, because I am certain that they are two of the best. That and if you come to me for help, I will probably know what you are talking about and where you are stuck.

You will need to make sure that you have the latest version of Java (7u25 at the time of writing, though I read somewhere that 8 is on the horizon) and install the JDK (Java Development Kit) to use either of these tools. If you have any questions, comments or difficulties, please comment below or e-mail me at jacob dot c dot w dot henwood at gmail dot com. I'd rather you commented though, just in case I end up fielding the same questions.

Next time on United by Glue: Three Unity tutorials that anyone could finish.