Following in the footsteps of Duncan Mackenzie and his REST API for Xbox Gamertag Data I’ve written an API of my own to replace his since he shut it down. It is available at xbox.samuel.kadolph.com. Since I never used his API I cannot compare mine to his so if you have any suggestions let me […]
Back at the start of April I wrote mysql2 ruby gem and Mac OS X: image not found to deal with the extremely relative path to libmysqlclient.16.dylib. I had said I would prefer not putting libmysqlclient.16.dylib in /usr/lib but I couldn’t find a dylib path that ruby uses. That is until today when I decided […]
If you are using the mysql2 ruby gem on Mac OS X you may have run into this problem before. > require 'mysql2' LoadError: dlopen(mysql2-0.2.7/lib/mysql2/mysql2.bundle, 9): Library not loaded: libmysqlclient.16.dylib Referenced from: mysql2-0.2.7/lib/mysql2/mysql2.bundle Reason: image not found – mysql2-0.2.7/lib/mysql2/mysql2.bundle So far the only solution I have found online is to use install_name_tool to update the […]
Around this time last year git added a "smart" HTTP transport that is faster than the old HTTP transport (and in some cases faster than SSH too). And a few months later GitHub added support for this new HTTP transport and made it the default selected url for repositories (that you aren’t a contributor for). […]
The using statement is an extremely useful feature of C# and it’s quite disappointing that Phidgets did not implement IDisposable. Thankfully it’s fairly easy to create a wrapper for any Phidget that implements it so we can simply some code.
One cool package for playing around with your phidget(s) is mono-csharp-shell which gives you an interactive C# shell (with tab completion). apt-get install -y mono-csharp-shell Once the package is installed, you can open it with csharp but just like with gmcs we have to include the reference to the Phidget library. csharp -r:Phidget21.NET.dll
Since we cannot install mono-complete on the PhidgetSBC2 currently, we are missing some of the C# namespaces. If you are trying to use any of the following namespaces and gmcs cannot find it, you will have to install the respective package. Namespace Package Mono.Data libmono-data2.0-cil System.Data libmono-system-data2.0-cil System.Data.Linq libmono-system-data-linq2.0-cil System.DirectoryServices libmono-system-ldap2.0-cil System.Messaging libmono-system-messaging2.0-cil System.Runtime libmono-system-runtime2.0-cil […]
So this Monday my PhidgetSBC2 arrived and I was super excited to get started playing around with the short-term goal of being able to open my door lock remotely. I really wanted to write the code in C# because it’s simply better than Java and it’s lot easier to implement a server in C# than […]
With some recent commits to rails comes the ability to have a default_scope with a lambda that gets evaluated at query time. Combine that with a multi-tenant column scoped database structure (wow, quite the mouthful) and you’ve got an quick and painless way to partition your tenant data without scattering code everywhere.
The methods that come with the standard ActionPack::Helpers::FormBuilder cover most cases of what you need to do but if you need to do something it doesn’t have a method for, things can get a little ugly. In my case I wanted to create a helper for autocompleted fields that all had the same attributes but different […]