The periodic something else…., Fergal Moran's blog.

Deserves a repost

Posted on Friday, July 3rd, 2009 at 3:28 pm in Humour, Technology by Fergal.

Doesn’t matter how many times I see this, I still giggle.

Satellite News Channel interview with Euro 2004 fans in Lisbon…

Posted on Wednesday, July 1st, 2009 at 12:03 am in Humour by Fergal.

Satellite News Channel interview with Euro 2004 fans in Lisbon…

The reporter asked one man if he was disappointed that England had lost.
The man replied, “Not at all, I’m Irish, I’m from Cork”.
The reporter then asked, “But would you not support England when Ireland are not in the competition?”
The man replied “Jaysus no way”.
Reporter: “Why not?”
Man: “800 years of oppression!!”
Reporter: “Is there ever any time you would support England?”
Man: “Maybe if they were playing Kilkenny!!!”

Mike Murphy pwns Gaybo

Posted on Sunday, June 28th, 2009 at 10:51 pm in Humour by Fergal.

A bit of Irish tv history here..

I’m gonna write me a new minivan

Posted on Thursday, June 25th, 2009 at 10:23 am in Humour, Technology by Fergal.

Classic Dilbert from way back in ‘95

;)

Posted on Wednesday, June 24th, 2009 at 3:03 pm in Humour, Religion by Fergal.

Fucked up on Religion

Interesting new Beck project

Posted on Monday, June 22nd, 2009 at 10:36 pm in Interesting, Music by Fergal.

Beck, one of my favourite artists of the last 10 years, always known for genre hopping and wicked experimentation in the studio has just announced a new side project which looks to be pretty cool.

Basically, he’s getting together with  some buddies in the studio, picking an album and going to spend one day recording a cover of every track off it. Excellent concept and he kicks it off with one of my all time favourite albums, Velvet Underground – The Velvet Underground.

Here’s the first cut – and at the risk of using the word 3 times in this post – it’s probably my favourite Velvet Underground track….

Wicked juggling routing

Posted on Thursday, June 18th, 2009 at 12:43 pm in Humour, Interesting by Fergal.

Great juggling routine from TED talks.  Starts off with some easy crowd pleasers but stay tuned for the amazing club routine at the end. The Raspini brothers are real juggler’s jugglers, I had the pleasure of meeting them years ago at the Edinburgh Juggling Convention..

WCF woes

Posted on Friday, June 12th, 2009 at 6:42 pm in Technology by Fergal.

Currently developing a client portal site for clients to upload reports and share with their principals and stuff so I decided to learn some new stuff while I was about it. I have developed the portal using MVC (Model-View-Controller) and have to say it’s excellent, steep learning curve and the tools aren’t quite there yet but once you get going, creating new models and adding new views to those models is a breeze.

I’m fairly familiar with DJango (python MVC like framework) so I had a bit of a headstart. So, one of the things we need to do here is allow clients who are running our desktop application to upload reports they have created to different secured areas of the site. I wanted this to be as simple as possible and it needed to support very large files so I decided that the best bet was to stick a big button in the report viewer screen of our console labelled “Publish”, let the user whack that and start a background thread to asyncronously upload the file and let the user get on with their facebooking, notifying them once it’s been done.

This sounded much better than sticking an upload page somewhere on the site, as then the user would have to export the report from the console, fire up a browser, navigiate to the file and so on. I decided that using WCF sounded like the right thing to do here to accept the file from the console. 3 days later and I’ve only just got the file transfer working now, so I’m gonna blog my steps so I don’t forget and to add some helpful messages to google.

Error 1:

 Content Type multipart/related; type=\"application/xop+xml\"; start=\"\"; boundary=\"uuid:3ad7b705-4f19-4c84-b700-8878fbead215+id=1\"; start-info=\"text/xml\" was not supported by service http:///.svc. The client and service bindings may be mismatched

Error 2:

System.ServiceModel.ProtocolException: The remote server returned an unexpected response: (400) Bad Request. System.Net.WebException: The remote server returned an error: (400) Bad Request.

There were loads of other errors, but these where the 2 that really wrecked my head. I could transfer simple strings easily but not large streams (such as files) and no matter what I did to web.config I kept on getting the above 2 errors. They turn out to be down to the fact that the WCF service’s web.config and the desktop applications app.config are very heavily reliant on matching up exactly with each other. For the first day at this nothing I did would make a difference, turns out that even though the part of the desktop application that calls the WCF Service is in an external dll, it is still the Application’s app.config I need to change. I has assumed that because the service reference was in the dll, then the config should be here, not so! Anyhoo, onto the victory, I can’t really remember the steps that got me here, so I’ll just post my config

//Server Side – Interface

namespace IntelliWeb.Services {
[ServiceContract]
public interface IFileTransferService {
[OperationContract]
string UploadStream(System.IO.Stream stream);

[OperationContract]
string SetUploadDetails(string szGuid, int nClient, string szReportType, string szReportTitle);

}
}

//Server Side = web.config

<system.web> <httpRuntime maxRequestLength="2097151"/>  <system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="Obscured.Services.FileTransferService.FileTransfer" transferMode="StreamedRequest"
maxBufferSize="65536" maxReceivedMessageSize="2000000000" messageEncoding="Mtom" receiveTimeout="00:10:00" />
</basicHttpBinding>
</bindings>
<services>
<service behaviorConfiguration="Obscured.Services.FileTransferServiceBehavior" name="Obscured.Services.FileTransferService">
<endpoint address="" binding="basicHttpBinding" contract="IntelliWeb.Services.IFileTransferService" bindingConfiguration="Obscured.Services.FileTransferService.FileTransfer">
<identity>
<dns value="localhost" />
</identity>
</endpoint>
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior name="Obscured.Services.FileTransferServiceBehavior">
<serviceMetadata httpGetEnabled="true" />
<serviceDebug httpHelpPageEnabled="true"
httpsHelpPageEnabled="true"
httpsHelpPageUrl="Uri"
includeExceptionDetailInFaults="true"/>
</behavior>
</serviceBehaviors>
</behaviors>
</system.serviceModel>

//client side – app.config

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="BasicHttpBinding_IFileTransfer" transferMode="StreamedRequest"
maxBufferSize="65536" maxReceivedMessageSize="2000000000" messageEncoding="Mtom" receiveTimeout="00:10:00" />
</basicHttpBinding>
</bindings>
<client>
<endpoint address="http://obscured.domain.com/ClientService.svc"
binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IFileTransfer"
contract="IWS.IClientService" name="BasicHttpBinding_IFileTransfer">
<identity>
<dns value="localhost" />
</identity>
</endpoint>
</client>
</system.serviceModel>
</configuration>

That should be enough to transfer up to 2 Gb of data using WCF streaming. Next challenge is to get this working using Vipul Modi’s Dynamic Proxy. Should be a laugh!
<edit>
Got it working using Dynamic Proxy in about 5 mins – go figure. I assumed it would be a nightmare because as far as I’m aware Dynamic Proxy doesn’t read the app.config. Perhaps it does, I’ll have a look when my head settles down
</edit>

Don’t mess with the Heffalumps!

Posted on Tuesday, June 2nd, 2009 at 4:03 pm in Humour by Fergal.

Bloke on Questions & Answers

Posted on Thursday, May 28th, 2009 at 3:26 pm in Religion by Fergal.

There was a guy on Questions and Answers on Monday night giving his account of the “abuse, rape and buggery” he suffered at the hands of the “Christian” Brothers in the 50’s

I would urge anyone from Ireland to watch it on the rte.ie site (it should be up there fot he next 2 weeks). He’s the chap in the audience who asks the first question and his account of the horrors he suffered is quite compelling.