I gave a talk about Aspect Ori­ented Pro­gram­ming at this year’s DDD South West, the slides is avail­able on SlideShare:

The source code I used can be found here.

 

A big thank you to the guys for mak­ing DDD South West the great event it was and for hav­ing me on-board this year, I had plenty of fun! Hope every­one who made it to my ses­sion enjoyed what I had to say and are think­ing about using AOP in their projects.

If you couldn’t come to the ses­sion I’ll be talk­ing to VBUG Bris­tol on the 13th June so hope to see you then!

Share

After a long day I’m proud to say that we have release two new slots that run on our F# slots engine – BATTLESHIP Jack­pot Com­mand on Lucky Gem Casino and CELESTIAL SIMIANS on Jack­potJoy Slots.

 

BATTLESHIP Jack­pot Com­mand is a 50-line slot with pro­gres­sive wins and some pretty unique features.

image

The DEATH CHARGES and MINES will descend and ascend respec­tively and expand into a col­umn of WILD sym­bols to give you the chance to really win big!

image image

When you have 2 Patrol Boats, 3 Sub­marines, 3 Destroy­ers, 4 Bat­tle­ships or 5 Car­ri­ers in one row, it’ll trig­ger a spe­cial win (in addi­tion to any pay line wins for those sym­bols) and a spe­cial ani­ma­tion will be played:

image

Three bonus sym­bols will trig­ger the bonus game, where you first play a mini pick bonus to deter­mine how many can­nons you can fire in the Jack­pot Com­mand bonus game:

image image

Once inside the Jack­pot Com­mand bonus game you will be able fire up to 4 can­nons (actual num­ber depends on the out­come of the pre­vi­ous pick bonus), each manned by one of your trusted friends!

A can­non will fire 1 – 10 shots which will land ran­domly on the 10 x 10 grid. If you man­aged to sink one of the 5 ships then you will win the cur­rent pro­gres­sive amount asso­ci­ated with that ship!

image image

image image 

 

CELESTIAL SIMIANS on the other hand, is a more tra­di­tional 25-line slot, albeit with some funky graph­ics and sound effects!

image

Win­ning with three or more Bonus sym­bols will trig­ger the bonus game, in addi­tion to a rather hand­some coins award.

image image

In the bonus game, you’re faced with 20 alien invaders and your task is to destroy as many of these bad­dies as you can before they shoot you down!

If you man­age to destroy all 20 aliens then you’ll get a spe­cial bonus equal to 25 times your total stake for this spin.

image image

Oh, did I men­tion that both games are run­ning against our F# engine Winking smile

Share

To find out if a string con­tains a piece of sub­string, here are three sim­ple ways of going about it in C#, just to name a few:

Out of curios­ity I wanted to see if there was any notice­able dif­fer­ence in the per­for­mance of each of these options.

Given a sim­ple string “Mary had a lit­tle lamb”, let’s find out how long it takes to test whether or not this string con­tains the terms ‘lit­tle’ (the match case) and ‘big’ (the no match case) using each of these approaches, repeated over 100k times:

image

As you can see, Regex.IsMatch is by far the slow­est option in this test, although using RegexOptions.Compiled yielded slightly faster exe­cu­tion time. What was also inter­est­ing is that String.Contains turned out to be sig­nif­i­cantly faster than String.IndexOf.

If you take a look at the imple­men­ta­tion for String.Contains in a reflec­tor you will see:

image

So that explains the dif­fer­ence between the exe­cu­tion times for String.Contains and String.IndexOf, and indeed if I change the String.IndexOf test to use StringComparison.Ordinal (default is StringComparison.CurrentCulture) then I get an iden­ti­cal result to String.Contains.

With all that said, String.Contains and String.IndexOf is only use­ful for check­ing the exis­tence of an exact sub­string, but Regex is much more pow­er­ful and allows you to do so much more. How­ever, you do end up pay­ing for them even when you don’t need those addi­tional capabilities!

Share