Jef Claes
On software and life
Home
All posts
Tags
code
30
Jul 2017
Fast projections
Most EventStore client libraries allow you to subscribe to a stream by passing in a callback which is invoked when an e...
18
Sep 2016
Commands and events with JustSaying and AWS
I've been looking into handing a bit of our messaging infrastructure over to a managed alternative. Managing your own me...
24
Apr 2016
Using a batch layer for fast(er) aggregations
In the oldest system I'm maintaining right now, we have an account aggregate that, next to mutating various balances, pr...
17
Apr 2016
Notifications from an event log
User notifications are a feature that came as an afterthought, but turned out to be rather easy to implement - without t...
28
Mar 2016
Functional one-liner for running totals in C#
Visualizing some data earlier this week I had to compute the [running total](https://en.wikipedia.org/wiki/Running_total...
20
Dec 2015
Visualizing event streams
In my recent talk on [Evil by Design](http://www.jefclaes.be/2015/11/slides-from-my-talk-evil-by-design-at.html), I show...
18
Oct 2015
Bulk SQL projections with F# and type providers
Early Summer, I had to set up an integration with an external partner. They required of us to daily provide them with a ...
11
Sep 2015
Aspect ratio calculation
Earlier today I was writing a migration script in F\# where I had to calculate the aspect ratio based on the given scree...
22
Jun 2015
Basic casino math
In a previous series of posts, I went over the models used by casinos to spin a wheel ([spinning](http://www.jefclaes.be...
24
May 2015
Consumed: Queries and projections (F#)
This is the third post in my series on porting a node.js application to an F\# application. So far, I've looked at ...
17
May 2015
Consumed: Handling commands (F#)
As [I wrote earlier](http://www.jefclaes.be/2015/04/parsing-command-line-arguments-with-f.html), I've been working on po...
26
Apr 2015
Finding unused code (F#)
Coming from C\#, I'm used to the compiler warning me about unused variables. Relying on the compiler to help me with [ch...
19
Apr 2015
Consumed: Parsing command line arguments (F#)
Last year, I set out to write my first node.js application; a small web application for keeping lists of [everything I c...
29
Mar 2015
Checked errors in F#
In the land of C\#, exceptions are king. [By definition](https://msdn.microsoft.com/en-us/library/ms173160(v=vs.80).aspx...
15
Mar 2015
Scaling promotion codes
In our system a backoffice user can issue a promotion code for users to redeem. Redeeming a promotion code, a user recei...
23
Feb 2015
Domain Language: The Playthrough Bonus
Since online gambling has been regulated in Belgium, basically each eligible license holder has complemented their land ...
18
Jan 2015
Averages are not good enough (F#)
Let's (no pun intended) look at a set of response times of a web service. ```fsharp let responseTimes = [ 18.0; 21.0;...
14
Dec 2014
Spinning the wheel: clustering and near misses
The previous post showed a simple model casinos use to manipulate the odds. Instead of relying on the physical wheel for...
11
Dec 2014
Spinning the wheel: manipulating the odds
The previous post defined a basic set of data structures and functions to spin a wheel of fortune in F\#. There was...
09
Dec 2014
Spinning the wheel
In this post, I'll define a basic set of data structures and functions to spin a wheel of fortune. In the next post, I'l...
16
Nov 2014
Hot aggregate detection using F#
Last week, I wrote about [splitting a hot aggregate](http://www.jefclaes.be/2014/11/splitting-hot-aggregates.html). Disc...
26
Oct 2014
Programmatically force create a new LocalDB database
I have spent the last week working in an integration test suite that seemed to be taking ages to run its first test. I r...
19
Oct 2014
Print out the maximum depth of recursion allowed
[Karl Seguin](https://twitter.com/karlseguin) tweeted the following earlier this week: "An interview question I sometime...
05
Oct 2014
Read an Event Store stream as a sequence of slices using F#
I'm slowly working on some ideas I've been playing around with whole Summer. Since that's taking me to unknown territory...
04
May 2014
Glueing the browser and POS devices together
I have been occupied building a modest Point of Sale system over these last few weeks. Looking at implementing the clien...
06
Apr 2014
Rebinding a knockout view model
As you might have noticed reading my last two posts, I have been doing a bit of front-end work using [knockout.js](http:...
23
Mar 2014
Sending commands from a knockout.js view model
While I got to use [angular.js](http://angularjs.org/) for a good while last year, I found myself returning to [knockout...
16
Mar 2014
Building a live dashboard with some knockout
Last week, we added a dashboard to our back office application that shows some actionable data about what's going on in ...
02
Mar 2014
Alternatives to Udi's domain events
Almost four years ago [Udi Dahan introduced an elegant technique](http://www.udidahan.com/2009/06/14/domain-events-salva...
09
Feb 2014
Reading an EventStore stream using JavaScript
Over Christmas break, I set out three days to play with the [EventStore](http://geteventstore.com/). One of the things I...
05
Jan 2014
Command and event semantics
Yesterday, I read [this blog post by Michael Feathers](https://michaelfeathers.silvrback.com/when-it-s-okay-for-a-method...
10
Nov 2013
An event store with optimistic concurrency
Like I mentioned [last week](http://www.jefclaes.be/2013/11/event-source-all-things.html) - after only five posts on the...
27
Oct 2013
Event projections
In my first two posts on event sourcing, I implemented [an event sourced aggregate from scratch](http://www.jefclaes.be/...
20
Oct 2013
An event store
Last week, I implemented [an event sourced aggregate from scratch](http://www.jefclaes.be/2013/10/an-event-sourced-aggre...
13
Oct 2013
An event sourced aggregate
Last week I shared [my theoretical understanding of event sourcing](http://www.jefclaes.be/2013/10/my-understanding-of-e...
15
Aug 2013
Eventual consistent domain events with RavenDB and IronMQ
Working on side projects, I often find myself using [RavenDB](http://ravendb.net/) for storage and [IronMQ](http://www.i...
09
Jun 2013
Angular.js and IE8 caching
Older Internet Explorer versions are notorious for agressively caching AJAX requests. In this post, you'll find two tech...
20
May 2013
Validating composite models with knockout validation
When you use [knockout validation](https://github.com/Knockout-Contrib/Knockout-Validation) to extend observables with v...
07
Apr 2013
Designing entities: immutability first
The first year I wrote software for a living I spent my days mostly writing forms over data applications; most of my eff...
24
Mar 2013
Reading large files in chunks with proper encapsulation
I've been doing some work lately which involves sequentially reading large files (> 2 to 5GB). This entails that it's...
17
Mar 2013
Putting my IronMQ experiment under stress
Two weeks ago, [I shared my first impressions of IronMQ](http://www.jefclaes.be/2013/03/first-ironmq-impressions.html). ...
10
Mar 2013
Some experimental infrastructure for IronMQ pull
I wrote about using [IronMQ as a cloud-based message queue](http://www.jefclaes.be/2013/03/first-ironmq-impressions.html...
03
Mar 2013
First IronMQ impressions
First time I touched messaging was in the first few years of my professional life working on software that supported fir...
03
Feb 2013
Raising events in commandhandlers
I've explored quite a few options on how to handle commands and queries in the last few posts. I finally settled on [thi...
27
Jan 2013
Organizing commands and queries
In the last few posts I settled on an architecture for handling commands and queries. A byproduct of [the described appr...
24
Jan 2013
RavenDB: Drop all collections
I never stub or mock the database when I'm using [RavenDB](http://ravendb.net/). Generally, I use an embeddable document...
20
Jan 2013
Separating command data from logic and sending it on a bus
In [my first post on this topic](http://www.jefclaes.be/2012/10/commands-queries-and-testing.html), I started out with a...
13
Jan 2013
Self-contained commands with dependencies
*Also read: [separating command data from logic and sending it on a bus](http://www.jefclaes.be/2013/01/separating-comma...
02
Dec 2012
Some notes on performance tuning with NHibernate
A few weeks back, I spent an intensive day performance tuning parts of a, to me, relatively unfamiliar part of our codeb...
15
Oct 2012
Commands with dependencies
*Also read: [Separating command data from logic and sending it on a bus](http://www.jefclaes.be/2013/01/separating-comma...
14
Oct 2012
Commands, queries and testing
*Also read:* 1. [*Self-contained commands with dependencies*](http://www.jefclaes.be/2013/01/self-contained-commands-w...
02
Sep 2012
Supporting the OPTIONS verb in ASP.NET Web API
[ASP.NET Web API](http://www.asp.net/web-api) controllers support only four HTTP verbs by convention: GET, PUT, POST and...
15
Jul 2012
Should I unit- or integration test my ASP.NET Web API services?
Over the last two weeks, preparing for a talk, I have been doing some research on [ASP.NET Web API](http://www.asp.net/w...
08
Jul 2012
HtmlHelper to generate a top-level menu for areas
Last week, we had to set up a new ASP.NET MVC web application, using a somewhat customized [Twitter Bootstrap](http://tw...
17
Jun 2012
Persisting model state when using PRG
I've been working on an ASP.NET MVC application in which we frequently apply the [Post/Redirect/Get pattern](http://en.w...
11
Jun 2012
Making my first NancyFx test pass
Like I already said last week, I have been dabbling a bit with [NancyFx](http://nancyfx.org/) lately. This week I t...
20
May 2012
Painless database logging with mongoDB
While browsing the source code of the [ELMAH mongoDB provider](https://github.com/CaptainCodeman/elmah-mongodb), I learn...
17
Apr 2012
Some Servicelocator pattern stinks
I have been working on a somewhat legacy codebase which makes use of the [Servicelocator pattern](http://martinfowler.co...
11
Apr 2012
Visualizing the offline application cache update progress
I wrote about using the HTML5 application cache [earlier](http://jclaes.blogspot.com/2012/03/html5-offline-web-applicati...
02
Apr 2012
Check for local file browsing with JavaScript
Because I do most of my research while commuting by train, I often pull entire websites offline using [httrack](http://w...
01
Apr 2012
Add images to a GitHub readme
Today I wanted to add some screenshots to a GitHub readme for the sake of documenting. While this wasn't particularly ha...
25
Mar 2012
How a web application can download and store over 2GB without you even knowing it
I have been experimenting with the [HTML5 offline application cache](http://www.w3.org/TR/html5/offline.html) some more ...
14
Mar 2012
HTML5 Offline Web applications as an afterthought in ASP.NET MVC
Recently I prototyped a mobile web application using ASP.NET MVC, [jQuery Mobile](http://jquerymobile.com/) and some HTM...
25
Feb 2012
ASP.NET MVC4 bundling in ASP.NET MVC3
One of the new wildly evangelized features of [ASP.NET MVC4](http://www.asp.net/mvc/mvc4) is the [built-in support for b...
06
Feb 2012
Testing DI bootstrappers
While your [Dependency Injection](http://martinfowler.com/articles/injection.html) bootstrappers - being responsible for...
19
Jan 2012
How Wikipedia uses HTML5 to save bandwidth
Something I hadn't noticed until recently is that Wikipedia tries to use the browser's native [SVG](http://www.w3.org/TR...
15
Jan 2012
Autocorrecting unknown actions using the Levenshtein distance
This weekend I prototyped an idea I had earlier this week: autocorrecting unknown actions in ASP.NET MVC. ### Handl...
24
Nov 2011
Rewriting an if
Yesterday I came across an if statement that looked something like this. ```csharp if (arg == "a" || arg == "b"...
09
Nov 2011
Programming for the future of mobile
I have been working on something small on the side lately. I hardly have anything to show for it though, most of it is s...
26
Jul 2011
Merge sorting in JavaScript
The latest addition to my [data structures and algorithms in JavaScript](https://github.com/JefClaes Data-structures-and...
23
Jul 2011
My js data structures and algorithms now on GitHub
If you have been reading my blog lately, you know that I'm implementing some data structures and algorithms in JavaScrip...
18
Jul 2011
Overoptimizing my JavaScript stack implementation for fun
[Davy Brion](http://davybrion.com/blog/) made a comment on [my JavaScript stack/queue implementation](https://jefclaes.b...
12
Jul 2011
Stacks and queues in JavaScript
The second assignment in my 'implementing data structures and algorithms in JavaScript' quest consists of two popular da...
07
Jul 2011
Simple sorting in JavaScript
About three years ago I graduated and got my degree in Applied Computer Science. Although it says Computer Science, we h...
21
May 2011
Checking for anonymous types
Because I blogged about anonymous types [last month](https://jefclaes.be/2011/04/anonymous-type-equality-follow-up.html)...
26
Apr 2011
arealdeveloper.com
[A Real Developer](#) is a side-project I built over the weekend poking around with [WebMatrix](http://www.asp.net/webma...
24
Apr 2011
Anonymous type equality follow-up: Equals()
After publishing [yesterday's post on anonymous type equality](https://jefclaes.be/2011/04/anonymous-type-equality.html)...
23
Apr 2011
Anonymous type equality
Let's say you instantiate two variables (a and b) using [anonymous types](http://msdn.microsoft.com/en-us/library/bb3976...
11
Apr 2011
Using C# keywords as variables
Hold it, don't shoot me. I know this would be an awful practice, but it is an interesting C\# compiler quirk nonetheless...
12
Mar 2011
Keeping WebSockets alive
The problem with using stateful connections on an imperfect place as the internet is that connections might drop. The se...
26
Dec 2010
HTML5: Exception handling with the Geolocation API
In [my previous post](https://jefclaes.be/2010/12/html5-geolocation-api-is-scary-good.html) on the [Geolocation API](htt...
19
Dec 2010
HTML5: The Geolocation API is scary (good)
I read about the [HTML5 Geolocation API](http://dev.w3.org/geo/api/spec-source.html) in the [Pro HTML5 Programming](http...
12
Dec 2010
HTML5 selectors and jQuery
In [my first post on the HTML5 javascript Selector API](https://jefclaes.be/2010/11/html5-new-in-javascript-selector-api...
05
Dec 2010
HTML5: Drawing images to the canvas gotcha
While I was playing with the [Canvas API](http://www.w3.org/TR/html5/the-canvas-element.html) I came across a weird issu...
05
Dec 2010
HTML5: More on selectors
[Last weekend I blogged](https://jefclaes.be/2010/11/html5-new-in-javascript-selector-api.html) on new addittions to the...
29
Nov 2010
HTML5: New in the javascript Selector API
Because I finally got the MCTS 70-536 certification out of the way, I can start experimenting with some fun stuff again....
23
Sep 2010
Things good to know about SQL State Server
While installing a [SQL State Server](http://msdn.microsoft.com/en-us/library/ms178586.aspx) last week, I came across a ...
14
Jul 2010
Switching with non-constant cases in C#
Last week I came across a scenario where I wanted to switch over non-constants (aka variables), but while I was compilin...
23
May 2010
Handling the AggregateException
Last week I showed you how you can use the `AggregateException` to apply consistent exception handling in batch operatio...
15
May 2010
Exception handling in batch operations with the AggregateException
Doing batch operations and elegantly handling exceptions is a problem which every developer has faced before. In .NET 3....
13
Mar 2010
Cannot Start Service from the command line or debugger. A Windows Service must first be installed (using installutil.exe)..
When you create a new Windows Service project and try to debug it, Visual Studio will show you a Windows Service Start F...
15
Feb 2010
Webforms lessons learned the hard way (Part 2)
If you missed part 1, you can find it [here](https://jefclaes.be/2010/02/webforms-lessons-learned-hard-way-part.html). ...
14
Feb 2010
Webforms lessons learned the hard way (Part 1)
I've been spending a lot of my days in Webforms the last two years. In this post I want to share some best practices I'v...
20
Jan 2010
Log4Net: log.Debug(String.Format()) versus log.DebugFormat()
[Log4net](http://logging.apache.org/log4net/index.html) is one of the most popular opensource logging frameworks availab...
05
Dec 2009
Response.RedirectPermanent in .NET 3.5 and older
One of the new features in ASP.NET 4.0 is permanently redirecting to a page using [Response.RedirectPermanent](http://ms...