2016s
Validation with Either data type in C#
In this article we will employ a functional monadic concept Either to make validation code more expressive and easier to maintain.
Read more...Fire-and-forget in Service Fabric actors
At the recent Webscale Architecture meetup we discussed two implementations of the Actor model in the .NET ecosystem: Akka.NET and Azure Service Fabric Actors. One important discussion was around Ask vs Tell call model.
Read more...Monads explained in C#
The newer and much longer version of this article is now available: Monads explained in C# (again)
It looks like there is a mandatory post that every blogger who learns functional programming should write: what a Monad is. Monads have the reputation of being something very abstract and very confusing for every developer who is not a hipster Haskell programmer. They say that once you understand what a monad is, you loose the ability to explain it in simple language. Doug Crockford was the first one to lay this rule down, but it becomes kind of obvious once you read 3 or 5 explanations on the web. Here is my attempt, probably doomed to fail :)
Read more...Building a Poker Bot: Card Recognition
This is the first part of Building a Poker Bot series where I describe my experience developing bot software for online poker rooms. I'm building the bot with .NET framework and F# language which makes the task relatively easy and very enjoyable.
Read more...Akka.NET-style actors in Service Fabric
Akka.NET and Service Fabric are the two actor frameworks that emerged in .NET world in the last year. The two implementations of actor models are quite different. These differences are multi-faceted but today I want to focus on API to define an actor and to communicate to it.
Read more...Building a Poker Bot: String and Number Recognition
This is the second part of Building a Poker Bot series where I describe my experience developing bot software to play in online poker rooms. Reading cards and other fixed images was the first step. The bot should also be able to read different text-based information from the screen.
Read more...Unit testing Dapper repositories
Dapper is a micro-ORM library which is very simple and super fast. Quite often the data access code is difficult to be unit tested. In this post, I present some ideas of testing Dapper-based database access.
Read more...Building a Poker Bot: Mouse Movements
The last step of the poker bot flow: clicking the buttons. The screen is already recognized, the hand is understood, the decisions are made and now the bot needs to execute the actions. This means clicking the right button at the poker table.
Read more...Aurelia Map Component with Leaflet
This is a short tutorial on how to create a map control in an Aurelia.js application. I am using the Leaflet library with custom tile source and I also show the way to implement your own overlay layer.
Read more...Functional Actor Patterns with Akka.NET and F#
My exploration of Actor model started with Akka.NET framework - a .NET port of JVM-based Akka. Actor programming model made a lot of sense to me, but once I started playing with it, some questions arose. Most of those questions were related to the following definition:
Read more...Building a Poker Bot with Akka.NET Actors
This post lays out the most exciting part of the bot. I'll compose the recognition, flow, decision and mouse clicking parts together into the bot application. The application is a console executable interacting with multiple windows of poker room software.
Read more...T-SQL MERGE statement is underrated
How many times did you write a SQL to save a row without knowing whether the same primary key already exists or not? You just get an object in your data access layer and you want to save all fields into the database.
Read more...Tweaking immutable objects with C# and Fody
Immutable data structures provide a lot of benefits to programmers, especially when representing domain value objects. Immutability is an essential part of functional programming paradigm. The concept is useful in object-oriented languages too, but you have to pay some price to get this advantage.
Read more...Dependency Inversion Implies Interfaces Are Owned by High-level Modules
Dependency Inversion is one of the five principles of widely known and acknowledged S.O.L.I.D. design guidelines. This principle is very powerful and useful when applied consistently. But in my experience, it’s actually quite easy to misunderstand the idea, or at least to mentally simplify it to somewhat less profound technique of Dependency Injection.
Read more...Building a Poker Bot: Functional Fold as Decision Tree Pattern
This is the fifth part of Building a Poker Bot series where I describe my experience developing bot software to play in online poker rooms. I’m building the bot with .NET framework and F# language which makes the task relatively easy and very enjoyable. Here are the previous parts:
Read more...Mocking API calls in Aurelia
Aurelia is a modern and slick single-page application framework. “Single-page application” aspect means that it’s loaded into the browser once, and then the navigation happens on the client side and all the data are loaded from a REST API endpoint.
Read more...Comparing Scala to F#
F# and Scala are quite similar languages from 10.000 feet view. Both are functional-first languages developed for the virtual machines where imperative languages dominate. C# for .NET and Java for JVM are still lingua franca, but alternatives are getting stronger.
Read more...Getting started with Azure Application Insights in Aurelia
Azure Application Insights is an analytics service to monitor live web applications, diagnose performance issues, and understand what users actually do with the app. Aurelia is a modern and slick single-page application framework. Unfortunately, there’s not much guidance on the web about how to use AppInsights and Aurelia together in a proper manner. The task gets even more challenging in case you are using TypeScript and want to stay in type-safe land. This post will set you up and running in no time.
Read more...Azure SQL Databases: Backups, Disaster Recovery, Import and Export
Azure SQL Database is a managed cloud database-as-a-service. It provides application developers with SQL Server databases which are hosted in the cloud and fully managed by Microsoft.
Read more...Leaflet plugin to render geographic corridors
Yesterday I’ve published a simple Leaflet plugin called
leaflet-corridor.
The plugin defines a new Leaflet primitive L.Corridor
.
When initialized with an array of geo points and width, it renders a polyline with width fixed in meters, not in pixels. That means that line width changes whenever zoom level changes.
Read more...Event Sourcing and IO Complexity
Event Sourcing is an approach, when an append-only store is used to record the full series of events that describe actions taken on a particular domain entity. This event store becomes the main source of truth to reconstruct the current state of the entity and its complete history.
Read more...Introducing Stream Processing in F#
The post was published for F# Advent Calendar 2016, thus the examples are themed around the Christmas gifts.
This article is my naive introduction to the data processing discipline called Stream Processing.
Read more...