Blog
C# 6 versus Enhanced C#
12 Aug 2014With some C# 6 features semi-officially announced, it’s time to comment on C# 6 and how it affects Enhanced C#.
A plea for html subsets
01 Aug 2014The following is a message I attempted to post to the Servo group. I attempted to post twice, but apparently it was rejected by the moderator.
.NET just keeps getting more annoying
23 Jul 2014It seems like the little design flaws of .NET get on my nerves more and more every week.
Building a table of contents in JavaScript
03 Jul 2014So you’re publishing a long document online and don’t have an easy mechanism to automatically add a table of contents on the server side? Well with JavaScript, you enslave the web browser to do it instead! This TOC generator…
How to export a blogspot blog to HTML/GitHub with C#
A LINQ-to-XML Example 01 Jul 2014I finally did it: I bought LINQPad’s Code Completion so I could write C# scripts easily. Now, sure, I could have used C# script for free, but… wait, why didn’t I do that?
Blogging on GitHub
29 Jun 2014GitHub has a “built-in” simple content management system called Jekyll. It’s unobtrusive; you can put ordinary HTML files in your webspace and they will be served unchanged, or you can create Jekyll files, which are text files that start with a header block that the Jekyll documentation calls “front matter” (a phrase that the documentation uses as if everyone knows what it means already). Among other things, Jekyll allows you to write web pages and blog posts in Markdown. And since it’s GitHub, you won’t be surprised to learn that your web space is version-controlled with Git, which means that you can update your web site with an ordinary Git push.
2D Convex hull in C#: 40 lines of code
14 May 2014This post was imported from blogspot.
If you want a convex hull and you want it now, you could go get a library like MIConvexHull. That library claims to be high-performance compared to a comparable C++ library, but that claim is implausible, especially for the 2D case, since the algorithm relies heavily on heap memory and dynamic dispatch, accessing all coordinates through an IVertex interface that returns coordinates as double[], and it uses LINQ rather liberally. (Update: Ouellet's Algorithm is a good choice.)Loyc.Utilities has a much simpler convex hull algorithm in the PointMath class that you might find easier to adapt to your own codebase, and although I haven't benchmarked it, you can plainly see that scanning for the convex hull takes O(n) time and needs only simple math, so that the overall running time will be dominated by the initial sorting step (which takes O(n log n) time). Because of the simple math used in this algorithm, it performs well both on powerful desktop machines and (given integer or fixed-point workloads) on lower-power machines with no FPU.