Author Archives: Richard Pianka

Test

test

Posted in Uncategorized | Leave a comment

“Until” extension method for integers in C#

I wrote this simple snippet today, and thought I’d share: public static IEnumerable<int> Until(this int from, int to) { for (int i = from; i <= to; i++) { yield return i; } } Its purpose is to return number … Continue reading

Posted in C# | Tagged , | Leave a comment

Haversine Distance Formula

I’m working on an analysis tool for GPS data in C# which needs to calculate the distance between two geographic coordinates, and I chose the Haversine formula (explanation).  So I figured I’d share my implementation: public class Point { public … Continue reading

Posted in C#, Math | Tagged , | Leave a comment

Modifying the Protocol Buffers compiler to support ScalaDoc

I’ve been building a server for a chess game in Scala, and chose protobuf as the serialization format.  When I hooked up ScalaDoc, I hit all sorts of errors, such as: Contracts.java:2125: error: not found: type BuilderParent private Builder(BuilderParent parent) … Continue reading

Posted in Java, Protocol Buffers, Scala | Leave a comment

Jack-o’-Lantern & Arduino

After a few glasses of wine, we decided to do some pumpkin carving: I chose a cat; she chose the ghost: and the finished product: Then I had the bright idea to put some LEDs into it. Add a little … Continue reading

Posted in Arduino | Leave a comment

Determine which process is locking the clipboard

I was having a peculiar error where some process occasionally appeared to be using the clipboard when my application went to handle copy & paste operations. There are some retry work arounds, and I had an acceptable solution in place, … Continue reading

Posted in C# | Tagged | Leave a comment

WordPress: Diagnosing “Error establishing a database connection”

I recently experienced the ever-so-helpful “Error establishing a database connection” message from my WordPress installation.  After about 30 minutes looking through Google results and watching some terribly useless YouTube videos, the best explanation I found was: there must be a … Continue reading

Posted in PHP, SQL, WordPress | Leave a comment

SQL query to find duplicate rows, in any table

I recently needed a SQL query that could find duplicate rows in any table, without specifying each column.  With some help from Tom H., I have a solution.  And with some modifications, a foray into dynamic SQL and a stored … Continue reading

Posted in SQL | Tagged , , , | Leave a comment

Karl Sims: Evolving 3D Body Morphology

One of my favorite research topics is artificial life.  Although this paper is not recent, Karl Sims published Evolving virtual creatures at SIGGRAPH ’94 and I still enjoy watching the video of these body shapes: I don’t think it’s technically … Continue reading

Posted in Artificial Intelligence, Evolutionary Computation | Tagged , , , , , | Leave a comment

Multi-Dimensional Analog Literals

I have a weakness for programming tomfoolery.  Something I just came across made me smile, so I thought I’d share it.  They’re called multi-dimensional analog literals, and they’re the work of some clever C++ templates.  Basically, it allows you to … Continue reading

Posted in C++ | Leave a comment