Saturday 24 April 2010

Artificial - Harmonics (Part 3)



Well its been a while since I have made a new mix, but I have been collecting tracks for it for a while. This one came together fairly quickly actually, about two days worth of composition and then a few variations until I was happy with it. I decided not to add any movie samples to this one to keep it nice and simple, got alot of other projects on at the moment! Im not even sure if people actually like those movie samples tho, let me know if you do!

I have called it Harmonics (Part 3) as the third instalment in my Harmonics series is long overdue and I felt that it just kinda felt like a Harmonics Mix.

Anyways, I have uploaded the mix to SoundCloud and used the last remaining hour that the free account gives you ;) Give it a listen or download below:

Harmonics (Part 3) by Artificial on Mixcloud



The tracklist is as follows:
1. Hybrid - Disappear Here (Armchair Mix)

2. Trifonic - Broken (Specter Mix)

3. Canvas - Imogen Heap

4. Chris Zippel - Again feat. Adel Tawil

5. Obscure Celebrities - Farenheit (Ulrich Scnnauss Remix)

6. Woven - Prickly Pear

7. Moderat - Rusty Nails

8. Helios - Bounce Dive

9. Telepopmusik - Into Everything

10. Bjork - An Echo, A Stain

11. Telefon Tel Aviv - What it was Will Never Again

12. Max Richter - Vladimir's Blues

13. Sigur Ros - Hoppipollo

If you liked this mix and havent heard my other ones then you can grab those here: http://www.mikecann.co.uk/misc/sound-cloud-previous-mixes/

Thursday 22 April 2010

Android Running on the iPhone!



Wow! This is pretty mental. I know a while back someone had managed to get a Linux kernel running on the iPhone, but there wasnt much to see and I soon forgot about it. It appears now however that PlanetBeing from the Dev-Team has managed to take an Android build and get it to run on the iPhone! Check out the video of it below:



Very cool stuff. I cant wait to see some Flash 10.1 running on that!

Saturday 17 April 2010

Clever Spam Email..

Its not often that spam gets through my gmail spam filters but this one did, and its quite ingenious:



Whats clever about it:

  1. It uses my name, and my nickname at that to make it sound more personal

  2. It comes from a real sounding name "Bruce Thomas"

  3. It looks exactly like a standard forward email

  4. The attachment contains the name PDF

  5. It contains the "No virus found in the incoming message" text from AVG


In short it almost got me, when you are short of time and briefly glance at a mail you may look over things and download and open an attachment without thinking about it.

Anyways, thought I would share ;)

Tuesday 13 April 2010

mikecann.co.uk moved.. again.. too!



Well as my previous post was about how I had moved my personal presence I thought I would mention the move of my virtual presence too.

For a while I have been hosting my sites on Slicehost, and things having been going okay. Slicehost however is a basic VPS that simply gives you root access and then you are expected to know what to do next. I spent a long time setting it up in the beginning following various tutorials. I learnt alot of Linux along the way but unfortunately I dont think im ever going to have the time to learn enough to maintain this box, especially now that I have 7 domains of my own and am hosting two by other people.

So I recently started looking for a better solution. Thats when my partner in crime olip.co.uk recommendation that I checkout Web Fusion, so I did and was mightily impressed. For a very similar price to Slicehost I get a much bigger box with much more features, and ofcourse the awesome Plesk 9.0 admin tool.

So the last few days I have been moving over, its gone pretty smooth but there have been a coupple of growing pains, which others may wish to learn from:

Shared Rather Than Exclusive Hosting

If you wish to be able to create new clients using Plesk then allow those clients to create domains you must remember to set your VPS as "shared" rather than "exclusive" right at the beginning before doing anything. I found out the hard way that if you make domains on an "Exclusive" IP VPS then you can no longer set that IP as "shared" and therefore clients cannot make domains. The solution I was forced to take was to ring support (which was generally helpful, ive seen worse *cough* BT *cough*) and they were able to sort it for me.

Mod_Rewrite and .htaccess

This blog is wordpress and I wanted the pretty perma-links that Wordpress is capable of so http://www.mikecann.co.uk/about/ rather than http://www.mikecann.co.uk/?page=about. To achieve this I tried many different things before I hit on the correct solution which was to use FTP to modify the permissions on the httpdocs folder to 777 then go to the perma-links section of the Wordpress settings and allow Wordpress to setup .htaccess for me! I then just went back and changed the permissions back to 750, simples!

Sunday 11 April 2010

Moved.. Again!

Well as I have announced (rather pointlessly) every time I moved in the past, I thought I would continue the tradition by announcing that I have moved again. This time its back again to my old room in one of my previous flats, The Grand Mancehster.

As I have already done a video of this place, Ill just reuse it:



EDIT: It would appear that Youtube have removed the soundtrack to the video, so, while watching this video imagine "Manson - Wide Open Space" playing in the background ;)

Thursday 8 April 2010

Funk IoC - A New Dependency Injection Framework



Twitter can be a funny beast, what makes it great can also make it poor. I use Twhirl which keeps me updated any time one of the people I follow tweets about something, the only problem is that so many people tweet that if I dont happen to see it within about and hour or so of the Tweet, ill miss it. This time however I was lucky enough to catch a tweet by @Joa about his new Inversion of Control and functional-programming-like library, Funk AS3.

As I have been getting well into RobotLegs (a Dependency Injection MVCS framework) recently I was extremely interested to hear about this new project by Joa who I respect very much as a brilliant coder not least because of his excellent work on low-level Flash byte-code optimisation (see Apparat).

Joa has taken a different approach to doing dependency injection. The approach most frequently used (and the one used in SwiftSuspenders / RobotLegs) is to use meta-data to declare to a number of variables for injection. You then map a class to be injected and instantiate it using the injector.

As an example, with Swift Suspenders you would define a class for injection with something like the following:

[codesyntax lang="actionscript3" lines="normal" tab_width="4"]
class MyInjectedClass
{
public function sayHello(toSay:String)
{
trace("Hello "+toStay);
}
}

var injector : Injector = new Injector();
injector.mapSingleton(MyInjectedClass);

[/codesyntax]

Here we are telling the Injector to make a single instance of our class and hold it internally ready for when it is next requested, such as:

[codesyntax lang="actionscript3" lines="normal" tab_width="4"]
class MyDependantClass
{
[Inject] public var myClass : MyInjectedClass;

public function performAction()
{
myClass.sayHello("World");
}
}

[/codesyntax]

Here the [Inject] meta-data indicates that we want the framework to supply the class with an instance of type MyInjectedClass. The final part is to make an instance of the dendant class and inject into it:

[codesyntax lang="actionscript3" lines="normal" tab_width="4"]
var dependant : MyDependantClass = new MyDependantClass();
injector.injectInto(dependant);
dependant.performAction();

[/codesyntax]

As you can see this is a nice way of handling inter-module dependencies in your code, when coupled with a MVC framework such as RobotLegs it becomes and extremely powerful yet elegant way of coding.

It however isnt perfect and Joa, on his google code page mentions three drawbacks of this method:


  • Your injected properties are publicly exposed and mutable.

  • describeType is very expensive.

  • Steep learning curve.



This is where he suggests his alternative method, which is quite ingenious. Using the same example as above you would see something like the following:

[codesyntax lang="actionscript3" lines="normal" tab_width="4"]
class MyInjectedClass
{
public function sayHello(toSay:String)
{
trace("Hello "+toStay);
}
}

bind(MyInjectedClass).asSingleton();

[/codesyntax]

Then the dependant class would look like the following:

[codesyntax lang="actionscript3" lines="normal" tab_width="4"]
class MyInjectedClass
{
protected var myClass : MyInjectedClass = inject(MyInjectedClass);

public function performAction()
{
myClass.sayHello("World");
}
}

[/codesyntax]

And making an instance of it could be as simple as:

[codesyntax lang="actionscript3" lines="normal" tab_width="4"]
var dependant : MyDependantClass = new MyDependantClass();
dependant.performAction();

[/codesyntax]

As can be seen there are some benefits to this method, the biggest one in my opinion is that injected properties dont have to be public as they are provided by the call from within the class scope rather than from outside.

So how does Joa perform this magic? By abusing a little used ability of the Actionscript programming language known as package-level-functions. These are throwbacks from the old AS1 & AS2 days of global functions. There are actually a couple of common examples in AS3 still such as getTimer() and getQualifiedClassName() still used. What Joa has done is to use these package level functions as a method of generating concise looking code reminiscent of functional programming.

Performance wise, im not entirely sure whether by using package-level functions instead of describeType() calls used in meta-data driven IoC frameworks is any faster as Till Schneidereit of Swift Suspenders suggests:
I don't think that Funk's approach is any faster than an optimized
metadata-based IoC container: describeType may be slow (as in "takes a
few dozen microseconds to run"), but is only ever called once for each
class an instance of which is injected into. After that, it's just a
straight iteration over an array for all injection points instead of
Funk's multiple method calls for each injection point.

So the next step for me is to run some tests to see how things pan out. Either way im very impressed with both approaches and cant wait to see what kind of exciting advances will be developed in the coming months.