LessThanDot Site Logo

LessThanDot

A decade of helpful technical content

This is an archive of the posts published to LessThanDot from 2008 to 2018, over a decade of useful content. While we're no longer adding new content, we still receive a lot of visitors and wanted to make sure the content didn't disappear forever.

Mapping Complex types to/from JSON with JSON.Net

In an earlier post I introduced a strongly typed Identity object I am using in an ASP.Net Core application to make my code and error messages more readable. I didn’t wanted that extra complexity reflected in my database or over the wire with an API. In this post we’ll look at a simple method to map my strongly typed properties in C# to simpler values in JSON. This is my desired state:

Read More...

SPA Routing in ASP.Net Core

One of the challenges of SPA applications is making sure a bookmark or hard refresh knows how to load just enough of the content from the server before applying the client-side routing logic to that base page. This is not guaranteed to be the only way to do this, just the one that worked for me. Goals: Static files to live in “Assets” instead of “wwwroot” Client-side routes like ~/configure/userScenarios to return ~/index.

Read More...

Elasticsearch and my setup. Part 1: the why and the how.

Introduction Over the past few years I used elasticsearch, one bit for using as a fulltextsearch engine and one bit as using to store logdata. Somehow I ended up with 2 seperate elasticsearch server, each forming their own cluster. The cluster was in a yellow state most of the time if not red the ther time. Mostly caused by unassigned clusters. By default elastic tries to replicate every shard at least once.

Read More...

Mapping Complex Types to/from the DB with PetaPoco

Recently I was working on an application with rich C# objects that I wanted to store simplified in the database, without having to write custom logic for each new save or query that I add to the application. Luckily, the library I had chosen for data access (AsyncPoco, a variant Petapoco) has a mechanism that can automatically map complex C# Types to simpler SQL types. Case 1: Strongly Typed Identities to SQL ints A complex web application can end up passing object id’s through any number of controller methods, business functions, or storage calls.

Read More...

Software Development Survey 2017

  So, you're a developer? or an architect? or maybe even a technical delivery manager? Great 🙂 I need you! I'm currently doing some research for an upcoming book, and for a new software product, and who better to ask than those that are building and delivering software solutions each and every day? So I'd like you to share the wisdom of your experience, by filling in a survey that will take you about 10–15 minutes to complete, about your experiences with designing, building, running and managing software.

Read More...

Creating a Static-Generated Marketing Site

If you’re working on a free product or startup, you’re probably thinking frequently about how to balance your time across all the things that need doing. One of those millions of things is getting a marketing site up to tell people about your amazing thing, and do so in a way that looks professional, is easy to update and redeploy, doesn’t turn into a whole separate coding project, and so on.

Read More...

Catch my keynote at Chicago Code Camp 2017!

I have a notebook for my Ideas, and Dreams, and Goals. Here’s one of my Ideas. I watched a very inspiring keynote at That Conference, and I decided I wanted to be the person at the front of the room, giving a keynote, inspiring the audience. Achievement unlocked: on Saturday, April 29, 2017, I’ll be the keynote speaker at Chicago Code Camp 2017! This event, in its ninth year, is a free, volunteer-run, day-long conference in downtown Chicago.

Read More...

Learning Elixir and Phoenix – Getting a handle on the language

Recently I started learning Elixir and the Phoenix framework. I’ve found that mixing hands on programming with reading is the fastest way for me to get up to speed with a new language or framework, so if that’s your style you might find this useful. In this post I started at zero and ended at being able to write small modules, run unit tests, and work with the interactive console.

Read More...

Learning Elixir and Phoenix – Environments and Editors

Recently I started down the path to learn Elixir and the Phoenix framework. This is a language and framework I intend to use quite a bit, so my goal is to get from “barely able to read it” to “able to ship readable, idiomatic, testable apps”. Having learned a fairly large number of languages, libraries, and frameworks over the years, I know the best way I learn is by combining reading or videos with writing and debugging actual code (some intersection of chasing book smarts + street smarts).

Read More...

Using Azure Functions to add a Contact Form to a Static Site

My personal website is a static site: 100% HTML, JS, and CSS files with no server-side processing. I have custom code that pulls data from a variety of sources and builds updated versions of the files from templates, which are then deployed to the host. I do this to move the CPU latency of building the pages to my time, instead of charging it to visitors on each page hit.

Read More...