Articles tagged 'el'

Happiest Man Alive Aug 29 2006

I’m currently on vacation in Atlanta, in the US of A. Yesterday was mine and my girlfriend’s one year anniversary together, and it’s been an amazing amazing year. We’ve accomplished so much together, and I knew I wanted to spend the rest of my life with her - so last night over our anniversary dinner I asked her to marry me, and she made me the happiest man alive by saying yes! I’m so so pleased, and so is she, and it’s made our first holiday together even more special!

Comments

21 Today Aug 23 2006

So, another year, another birthday. As I was getting older, the day itself was feeling less and less special, just a fact of life I guess. But I was wrong! Today so far has been amazing, and I’ve only been up a few hours!

My amazing girlfriend is making the day so special, we both have the day off work, so this morning I got my presents, now I’m just relaxing. In a little while we are heading over to my parents to have some lunch, and then we are all going into London to have a nice meal, and watch the mighty Fulham take on Bolton at Craven Cottage.

Between this post made on my birthday last year, and today, so much has happened, so much has changed in my life, all for the better. I now am living with the woman of my dreams, own my own home, and am enjoying every single day. With all that I’ve done, I have to keep reminding myself I’m only 21 - but I feel like I’ve grown up more in the last year than I did in the previous 20.

I’m off to enjoy the rest of my day, peace out.


Technorati Tags: , , ,

Comments

RubySharp Aug 22 2006

Recently I’ve been toying with John Lam’s pet project, RubyCLR. The very notion of Ruby and C# interaction interests me, as there are around a billion different situations in which I’d like to combine the two, to get the best of both worlds.



Now, I notice in a post today, that he has spotted that Tim Ng, a guy who works on the Visual Basic compiler team, has been playing with his creation. Only, the way he went about it seemed a little complex, and wasn’t using RubyCLR’s compatibility with interfaces to the max. So, I thought I’d outline a little test scenario I knocked up when I first started playing with it.



I’ll assume that you’ve followed the instructions, and are setup with the latest version of RubyCLR (I was using the code straight from the source tree).



Firstly, the code for the C# side of things (the “host”). This defines the interface, and provides a class for executing implementations of the interface:



Host.cs:


using System;

public interface IAddIn
{
string Name { get; }
string Author { get; }
void Work();
}

public class Host
{
public static void Execute(IAddIn addin)
{
Console.WriteLine("[{0}] : {1} by {2}",
addin.GetType().FullName,
addin.Name,
addin.Author);
addin.Work();
}
}

We can simply compile this into a standalone assembly:


csc -t:library Host.cs


This will output Host.dll, which we will now consume in our super-duper Ruby script, empowered by the magic RubyCLR. I won’t stick the entire contents of the client Ruby script here, however the full thing is available from here (the full C# source file from above is available here). For now, lets just look at the implementation of our C# written interface within Ruby:



class MyAddIn
implements IAddIn

def get__name
return "My first Ruby/.Net add-in!"
end

def get__author
return "El Draper"
end

def work
puts "This is coming straight from my Ruby written add-in!"
end
end

As you can see, in order to implement the Name and Author properties, we define Ruby methods called get__name and get__author (note the double underscore).


This is all useless unless within my Ruby script I actually call my C# host and pass an instance of my Ruby written add-in. After referencing the Host.dll assembly:


reference_file ‘Host.dll’


I’m able to make the call to the host:


Host.Execute(MyAddIn.new)


Running this is then easy - once you’ve executed the “setenv.cmd” batch file within the root of the RubyCLR project, simply execute:


ruby Client.rb


(ensuring that Client.rb and Host.dll reside in the same directory).


This then outputs:


[T32dda3e3] : My first Ruby/.Net add-in! by El Draper

This is coming straight from my Ruby written add-in!


(N.B. the type name changes each and every time the script is run, as the concrete wrapper type created around the Ruby code and passed through onto the CLR is dynamically generated at run-time using System.Reflection.Emit).


The above shows that we can define an object that implements a .Net interface within Ruby, and then pass an instance of this into a .Net written host class. It then executes methods directly on the object that itself then executes Ruby code. Pretty snazzy eh!


Like Tim, I have a number of things I’d like to be able to extend this with. For one, I’d like to be able to “compile up” the concrete CLR types representing Ruby objects, and then execute this from within a .Net host, namely a C# application. My work on tweaking the RubyCLR code so far has resulted in being able to correctly output the dynamically generated assemblies, however these types when executed within a C# host application result in memory errors, presumably because it is lacking the reference to the Ruby host context and the original Ruby source file. So I need to be able to instantiate a Ruby object from my compiled emitted assembly, and then somehow build a Ruby context back to the original source file so it can correctly execute the code, but all from within a .Net host. This is really a reverse of the main scenario that RubyCLR I think was probably invented for, but none-the-less I think it should be possible. Any ideas, John? ;-)


Technorati Tags: , , , , , , ,

Comments

Sweet deal Aug 17 2006

Hmm, check this out. Seems like a pretty interesting opportunity, in an amazing city…


Technorati Tags: , , , ,

Comments

Dirty Bird Aug 14 2006

Good start to the season for the Falcon’s, start as we mean to go on. I’ll be there in a few weeks time, cheering them on as they take on the Jacksonville Jaguars at the Georgia Dome.


Technorati Tags: , , , , ,

Comments

I'm back Aug 13 2006

So the regular visitors to blogs.eldiablo.co.uk (if there are any) will have already noticed the redirects in place to ensure all requests to the blog end up at its new home: www.crazycool.co.uk. This will be the new home for my personal blog, so everything from code, to rants, to observations on life and politics. I quite like the new design I stuck together for the blog, and I’m going to be building on it to eventually include widgets for easy access to archives, searching, recent comments, and my personal blogroll.

The blog software itself is a totally overhauled version of Scrawl, and this time its so customizable I can truly do whatever I want with it. I’m going to be testing this for a while longer now my own blog has gone live with it, then I’m going to be throwing it open to a few select people who can run their own sites hosted using it. Then we’ll see where else it goes :-)

Because of the overhaul, I haven’t blogged much recently. I’m going to try and get back in the swing of things with some more regular blogging, especially now I’ve got a kick-ass site to do it on ;-)

Comments

RIDE-ME, one time Aug 13 2006

So, RIDE-ME has hit version one, and I’m proud to say I was able to be a part of it. In fact this is the first release that has some of my work in it, namely the add-in architecture, and the console add-in built on top of that. It’s shaping up pretty nicely now, and recently I’ve been working on a Rails project using RM with almost no problems. I know I’m a bit behind the times blogging about the release, but come on people, please digg it - we are getting plenty of downloads but a spot on the digg.com frontpage wouldn’t go a miss ;-)

Comments

Can I Play With Madness Jul 18 2006

Some online fictitious craziness from dotnet funny man Rory Blyth. Was listening to an old DotNetRocks episode featuring him the other day, man he cracks me up.

Comments

RIDE-THIS Jul 18 2006

My first real contribution to project RIDE-ME, the add-in architecture, is now in the trunk of the source tree. Check it out, comment, submit patches or let me know feedback. I’m pretty pleased with it, and it should foster some nice add-in development hopefully :-)

Comments

Extra, extra, read all about it Jul 15 2006

Hmm, via SvN, Newshutch, a nice looking web based feed aggregator. Might be worth a play.

Comments

For all these times, that we walked away Jul 14 2006

Bit of a catch-up here, as it’s been far too long since I blogged:

  • England are out, and the World Cup is over.
  • I got me SkyHD installed, and it is sw-eeeet. I can now watch HD sporting events, movies, and other assorted goodies (including alsorts of random documentaries, which I’d never usually watch except for the fact that it’s in HD). The box itself is sleek and chic, and bar a couple of random lock-ups last couple of days, has behaved excellently for a first generation piece of equipment. Oh, and the Sky+ PVR system is fantastic, I forgot how much I missed being able to setup entire series to be recorded with a couple of remote clicks.
  • I’m wrapping up the add-in architecture for RIDE-ME. I hope to have it in my branch by the end of this weekend, and then merge it over after then to trunk. We can then test the hell out of it, while the other guys start to write whatever add-ins they can dream up. Eventually, in the 1.0 release, it’ll see the light of day, and we hope to build a nice add-in community around it. Oh, and I’m now hosting all of the resources for the RIDE-ME project.
  • Did I mention HD? I’m currently watching Die Hard With A Vengeance apparently in HD (didn’t even realise HD cameras were around back in ‘95), and Bruce Willis never looked so good.
  • I’ve been having a lot of fun with the object/relation mapping framework I’m working on at the minute, integrating it tightly with the model-view-controller framework I knocked together. It’s starting to come together, and I’ve just implemented associations in queries (read: joins). I’ve got a reason for putting all of this together, and that reason is almost ready for the big-time, so watch this space…
  • I’ve ordered a SleepTracker watch, but there’s no stock at the minute so I gotta wait.
  • The new Rise Against album is fantastic, along with the latest albums from Billy Talent and Lostprophets, expect reviews soon
  • RubyCLR is superb, I think John Lam might be a genius
I think that’s mostly it believe it or not, so peace out for now.

Comments

DotNetKicks... Jun 28 2006

is a Digg like clone, centered around .Net content. Useful resource for .Net developers.


Technorati Tags: , , , , ,

Comments

Page 2 of 7 | Next page | Previous page