Archive for the ‘programming’ Category

To Mac or not to Mac

As you may know, I am the extremely happy owner of an iPhone. I also happen to be doing a degree which has something to do with programming (apparently…), leading me to wonder what would happen if I were to try combining these two!

I’ve previously had one or two ideas put to me for iPhone software, and also have thought of some myself. Objective-C looks like a bit of a pain in the backside to learn, but challenges are fun! The only obstacle left in my way is Apples decision to only let you run their iPhone development software on their own OS.

This leaves me with a couple of options. Firstly, I could put together a hackintosh on some old hardware, providing I’ve got some hardware lying around that it will work with! The only downside of trying that approach is that this is likely to happen. The other option is to buy one, I’ve been having a look at Mac Minis, which would probably cost somewhere in the region of £600 with student discount.

I don’t know if I’m ready to give up my Mac-hater stance and actually buy one, but I’m tempted…

Windmills

As part of my Software Applications module this year, I have a sub-module called Digital Imaging. Basically, we learned how to use Java3D to model things and then animate them.

The assignment set for this term was to create a wind turbine…

turbine

Above is what I created! Obviously you cannot see here, but the blades move round the appropriate axis, and the entire head of the turbine rotates around the Y-axis when you click on the mast. Pretty impressive – huh?! I didn’t think so either! If, for whatever reason, you do think it’s impressive – you may download the .jar file here. It will need Java3D and possibly some other stuff installed to run.

The main thing I learnt doing this was how much of a pain J3D really is – it’s a completely obsolete extension of Java that doesn’t really have much use, apart from for making simple animations such as this one. I can’t think of anyone who would use Java to make a serious 3D game, the processing power just isn’t there to allow decent use of physics, lighting or anything else essential to make an immersive environment. For example, when I was trying to make the turbine cast a shadow on its environment, I found it wasn’t just as simple as allowing the light source to throw a shadow onto the grass object – oh no – I had to calculate the exact shape that the shadow would be, based on the position of the light relative to the turbine, then draw it manually to the floor. As you can imagine, this would be a huge task – and lets not even get started on running this 40+ times a second to get the moving blades, or even considering the opacity of the shadow in different places, or the fact that multiple light sources exist, or that the turbine would shadow itself in parts…

I’ve used programs before (GameMaker stirs a memory?) that will do all that for you in 2 or 3 lines of code, however in J3D I was looking at separate classes, and 2 or 3 times the existing code I had to make the turbine work. No thanks, I’ll just pretend it was a very bright day!

I’m quite glad I’m rid of J3D now – I’ll be even happier when I’m rid of Java completely. I’d be really happy if I never had to see a wind turbine ever again… but they had to go and drop that into our Software Engineering project as well. More to follow on that…

The Ethics of Scraping

I’ve recently been given a commission to do a piece of coding involving grabbing information from another website and displaying it in a different manner. Obviously I won’t say much more about the brief – don’t want to annoy the customer or expose myself!

The brief got me wondering – how legal is it to grab content from another website? I guessed it was probably another one of the ‘grey areas’ that surround the internets at the moment, however another issue concerned me slightly more… how ethical was it? My script essentially steals information from a website for use in other ways, that the original publisher has no control over. Since the website in question publishes no open API or content feeds for this purpose, surely they mustn’t want this information being scraped from them? The website being scraped is essentially just a collection of many different items, published by their own individual owners. Do they want the information scraped and re-published?

I’ve heard of another case from a friend (again, won’t get into details) whereby a company is keeping a tight fist around its data. This is sort of understandable, but again the website in question is aggregating many different peoples data. Is the website being anti-competitive  by not releasing APIs?

I will sleep better once this script is out of development and off my server – I know I wouldn’t like it if someone else was doing this to my website! However – the customer is always right, and I won’t disappoint!