Apple Wireless Keyboard functionality on Windows

So with some help from some online forums, I’ve managed to compile an AutoHotkey script which will allow you to get more functionality out of your Apple Bluetooth Keyboard.

Functionality Includes:

  • Eject => Delete
  • Fn+F3 => Alt+PrtScrn
  • Fn+Alt+F3 => Alt+PrtScrn
  • Fn+F7 => Previous Media Track
  • Fn+F8 => Play/Pause Media Track
  • Fn+F9 => Next Media Track
  • Fn+F10 => Mute Volume
  • Fn+F11 => Volume Down
  • Fn+F12 => Volume Up
  • Fn+Up => PgUp
  • Fn+Down => PgDown
  • Fn+Left => Home
  • Fn+Right => End
  • Fn+F4 => Task Manager

You can download the AutoHotkey script here.

Integrating Node.JS, NPM and RequireJS into Visual Studio / MSBuild

Working at Deepend has exposed me to many new technologies which were out-of-scope for the projects I was involved in in my previous jobs.

In my current project, we’re using RequireJS, along with their supplied optimizer to minify, and uglify our solution. To achieve this, we are required to execute the compiler via node.js.

In an attempt to streamline this process, I’ve built upon the NuGet package manager’s solution for automatic download and installation of packages, and have it running successfully with Node.

Here’s a brief rundown of the steps involved:

  1. Create a .node folder in your solution root
  2. Place my custom node.targets file inside the .node folder
  3. Open your project file in a text-editor and add the following lines:
      <Import Project="$(SolutionDir)\.node\Node.targets" Condition="Exists('$(SolutionDir)\.node\Node.targets')" />
      <Target Name="BeforeBuild">
        <CallTarget Targets="CheckNodePrerequisites;RestoreNodePackages" />
      </Target>
  4. Download the latest npm package
  5. Extract the node_modules folder to your solution root
  6. Check files into source control, and optionally create any .gitignore or similar files to ignore all other packages placed inside node_modules folders
  7. When you build, your project should now automatically download node.exe into your .node folder

You are now free to use NPM to install packages into your project as normal, e.g.

npm init
npm install requirejs --save

If you need to execute any packages explicitly, you can add pre and post-build events to your project configuration, e.g.

    <PreBuildEvent>
      "$(SolutionDir).node\node.exe" "$(ProjectDir)node_modules\requirejs\bin\r.js" -o "$(ProjectDir)\static\js\main.build.js"
      "$(ProjectDir)\Deepend.ProjectSync.exe" $(ProjectDir)
    </PreBuildEvent>

These instructions should work for both packaged, and shrink-wrapped installs. I’ve only tested on packaged installations myself so far.

Next I’ll be working on getting NPM to come down automatically with node, and updating my ProjectSync tool to support insertion of node and other additional targets into project files, so this whole process will become automatic once you run ProjectSync once.

This of course is just the tip of the iceberg. I’ve now cloned the nuget project, and plan to modify and distribute a version that adds node package manager support direct to visual studio as a proper extension.

Raspberry Pi Programmable Power Board – Part 3

So after a year of being busy, I finally got around to putting together the electronics and testing out my circuit. Everything worked first go, though I had to remember a few things about the design when getting the software running against it.

One important change to the design so far, is that we are no longer building a Raspberry Pi Power Board, but instead an Arduino Power Board.

One thing I discovered during testing was that the 5V delivered by the 10W iPhone charger was still low-power. Apparently I need to hook some resistors through to the data lines to instruct the iPhone charger to run in high-power mode if I want to drive more than 2 of my relays.

Here’s a video of a single module of the board running off the Arduino

In the demo, you can see me disconnect the Arduino from power, indicating the circuitry is completely self-sufficient, and the Arduino is able to recover state accurately at any time, regardless of power outages.

Next steps are to update the Arduino software to run off ethernet instead of the Game-controller break-out board, and to expand it to multiple modules.

I’m also considering building my own rectifier and using a stepping regulator to deliver my 5V, rather than relying on an iPhone charger. Or I can just use a pre-built 5V PSU

Lamb Curry

8 BBQ chops – fat (keep bones)
1 can rozella tomato soup (large can)
1 tbsp brown sugar
1 tbsp french mustard
1 tbsp worcestershire sauce
1 tbsp vinegar
1.5 tbsp curry powder
1 onion

Mix everything except chops together
Once mixed add chops
Leave overnight
Cook for 1.5 hrs checking every half hour

Project Reference Disappears After Build

A few times now, I’ve added new projects to legacy solutions in Visual Studio, only to find that they have issues when it comes time to build.

Normally I sit there pulling my hair out checking references for 5 minutes before I remember my old foe: The .Net 4.0 Client Profile!

Updating the project’s framework from .Net 4.0 Client Profile, back to standard .Net 4.0 (or 3.5 or whatever flavour of Framework you desire) will fix the problem.