Category Archives: Uncategorized

you have to love lamda’s…

i need to take a comma delimited string of doubles… which represent miles.

“12.0,11.6,5.4″ etc and convert it to a List<double>.

and in 1 line of code….

numberString.Split(',')
            .ToList()
            .ConvertAll(Convert.ToDouble)
            .ConvertAll(Conversion.MilesToFeet);

where Conversion.MilesToFeet is a static method.

 public static double MilesToFeet(double input)
 {
    return input * 5280;
 }

you have to love lamda's…

i need to take a comma delimited string of doubles… which represent miles.

“12.0,11.6,5.4″ etc and convert it to a List<double>.

and in 1 line of code….

numberString.Split(',')
            .ToList()
            .ConvertAll(Convert.ToDouble)
            .ConvertAll(Conversion.MilesToFeet);

where Conversion.MilesToFeet is a static method.

 public static double MilesToFeet(double input)
 {
    return input * 5280;
 }

TypeMock Launch a new ASP.NET bundle

Typemock are launching a new ASP.NET Typemock bundle. its a fully featured set of tools for hard to test .net technologies such as sharepoint, asp.net, wcf etc….

here’s the press:

Unit Testing ASP.NET? ASP.NET unit testing has never been this easy.

Typemock is launching a new product for ASP.NET developers – the ASP.NET Bundle – and for the launch will be giving out FREE licenses to bloggers and their readers.

The ASP.NET Bundle is the ultimate ASP.NET unit testing solution, and offers both Typemock Isolator, a unit test tool and Ivonna, the Isolator add-on for ASP.NET unit testing, for a bargain price.

Typemock Isolator is a leading .NET unit testing tool (C# and VB.NET) for many ‘hard to test’ technologies such as SharePoint, ASP.NET, MVC, WCF, WPF, Silverlight and more. Note that for unit testing Silverlight there is an open source Isolator add-on called SilverUnit.

The first 60 bloggers who will blog this text in their blog and tell us about it, will get a Free Isolator ASP.NET Bundle license (Typemock Isolator + Ivonna). If you post this in an ASP.NET dedicated blog, you’ll get a license automatically (even if more than 60 submit) during the first week of this announcement.

Also 8 bloggers will get an additional 2 licenses (each) to give away to their readers / friends.

Go ahead, click the following link for more information on how to get your free license.

they’re also running a little offer where if you blog about the launch they’ll send you some free licences…

check it out over here… http://blog.typemock.com/2009/05/get-free-typemock-licenses-aspnet.html

enjoy!!!

i hate regions (c#)

jesus they’re annoying.. i mean whats the point in this…

#region Constructor

public MainViewModel()
{
// Blank
}

#endregion

all it does in encourage people to write huge classes and huge methods that are a nightmare to debug/maintain/understand.. the list goes on…

if you need regions you definitely need to refactor your code…

starting a micro-isv

i’ve decided to go and start a micro-isv project. its been on my mind for a while now and its seems like the right time.
i’ve spent the last while learning ruby on rails, and even built an app with it. www.thephoenixhostel.com. which needs a designers touch :-)
but now that i’d talking about a business i need to put on my business hat!!
first things first, the micro-isv is going to be a web based sas app, for a business in a particular industry (which i’m going to keep to myself for now) to completely manage themselves, including online & offline.

i’ve not 100% decided what the core technology is. i’ve worked with java, .net and rails, and recently looked at scala & groovy, but for now i’m going to spike out some work in asp.net mvc, just focusing on non functionals.

first up security. asp.net has built in security, but i never really liked it much when i built sites in it, so i’m going to investiage Rhino Security from Ayende, ayende.com/Blog/category/548.aspx.
he’s been posting about it for a while and a few app’s have been built in it so why not!! no point in reinventing the wheel. and it’ll give me a chance to spike out a .net solution and see if i want to continue using it or look a something else.. i.e. rails…

anyways,
wish me luck :-)

the hype machine roles on!!! now we have the cloud to replace SOA…

i like infoq, they’ve got good content and a nice mix of good video presentations.. but looking at it tonight i got whacked with deja vu .. ive defo seen this before…
i was looking at the “Cloud” computing section…. with titles such as “The Cloud Security Alliance Wants Safer Clouds”, oh and by the way we’ll help u get there by hyping it up to the last,
build u a bunch of solutions and platforms and frameworks so u’ll be so much better off…
and “The Five Pillars of Cloud Computing”..this just so reminds me of SOA, im sure i can remember the pillars of SOA, and the committees and all of that.

sell’s lots of books though, whooppee!!!

anyways i maybe i’m just being cynical…

time will tell… :-)

dont call it agile.. in fact i hate all these names but what can u do??

agile like many things before it seems to have suffered the technology marketing hype kiss of death.

i’m not saying that agile is dead but rather its now in the annoying position of having myriad of experts and people who have an opinion.. especially the people who need something to blame..

how many times over the past few years have i heard someone go on about how they know agile but reason that its not suitable for this particular situation. i defintely think u need to evaluate something like a dev process before u jump in.. dont just be another fan boy, but i see it time and time again when you ask that person “what particular thing do u dislike??” and they say stuff like well u dont do any documentation, or you dont design, you dont have formal testing… and i hate all those stand up meetings.. they go on forever…

anyways i’m not going ot labour the point i guess that life, and that’s what happens as soon as something gets popular or in the mainstream…

as gojko adzic says, just do what you need to do in a corner make progress and people will take interest… and i guess that’s the whole point, rely on using the approach/tool and let it demonstrate its value,
AVOID the hype marketing friendly names until you’ve got something to back you up…

but when people are buying agile off the shelf and in books etc its hard to avoid those battles..

handy mac os x snippets

Show All Hidden Files in Finder:

defaults write com.apple.finder AppleShowAllFiles TRUE
killall Finder

Also in Terminal:

la -la

choosing a technology for my next project….

im in the middle of evaluating what technology i’m going to use or my next project, which will hopefully be the seed of a startup..at this stage its a 2 horse race..

rails vs asp.net mvc..

i’ve recently started working on a rails site and have really enjoyed the ruby langauge, i’ve had 8 years working with c# and also java… and i can say that when the penny drops with dynamic languages u really feel more productive with so much less code and verbosity..

but now i have a dilema… alot of what i like and have learned in my time on c#, stuff like persistence ignorance, domain driven design etc i’ve found harder to transfer to rails.. and i really think this project will have a non trivial domain. i like the idea of ActiveRecord, but not the implementation…

for example, with an active record model you dont declare the properties in the class, rather it reads them from the database, but at the same time u validate in the class.. which to me is confusing, why not just declare them there, and then do sometihng like why’s automigrations using the class definition..

but i think they’ll sort this stuff out for rails 3.o, datamapper for example uses this. but i found myself that with rails you’re best sticking to the rails way and so i didnt try and stray too far..

dont get me wrong i’m like rails alot, especially things like plugin architecture.. there’s a pluggin for everything… honestly :-)

when i look back i think it was a bit of frustration with asp.net (which is still the case when it comes to web forms) drove me to rails..  it still amazes me to this day that i can get a site up and running with little or no config, compared to the endless xml i had encontered before… but these days with mvc being much more open, more testable, and with stuff like c# 3 & 4 moving the langage forward, generics, lamda’s, fluent interfaces, and convention of configuration catching on i think the gap has narrowed…

also with IronRuby on the way i think i’ll be able to continue to utilize ruby in the mvc world.

cucumber & rspec are unrivalled IMO for testing, i think cucmber will be a serious model to follow (even though its an evolution itself) but hopefully using these tools will become common place in .net soon…

rails has kicked the development world in the ass.. and maybe because it wasnt some commerical tool fronted by a company. i’m not 100% decided yet..

but at the moment my heart say rails but my head says asp.net mvc…

adding mac “port” command to terminal

if you’ve installed mac ports but get this error message:

-bash: port: command not found

then open up your bash profile in a text editor, e.g. textmate

first check, with

macbook01:~ mick$ ls -la  ~

this will return the full list of files in your home directory, including hidden files e.g. .bash_profile

-rw——-   1 mick  staff   7943 17 Apr 21:17 .bash_history
-rw-r–r–   1 root  staff    430 13 Apr 15:42 .bash_profile

whether you’ve got the bash profile file or not u need to either create a new one or open the existing one.

macbook01:~ mick$ sudo mate ~/.bash_profile

then add the following line to the end of the file:

export PATH=$PATH:/opt/local/bin:

then restart terminal and away you go!!!