Friday, August 5, 2016

Minecraft Stop-Motion Movie Creator - too many frames

This post is a work in progress.

My kids love using the "Minecraft Stop-Motion Movie Creator". They've just finished putting together an epic animation (> 400 frames) and went to save the movie but were greeted with "Too many frames - please remove 91 frames". They were crestfallen. Surely this limit should be advertised somewhere?

Anyway, I attached the device to my computer to take a look - with the idea of downloading all the frames myself and using different software to stitch them together.

This was done on a Mac - I used androidfiletransfer to connect and browse the device (a Hudl2 in this case).
For any of you who want to do the same the relevant files are in: Android->data->com.mattel.MCSMMC->files->Movie. Each movie has it's own number and each frame of each movie is in an individual, numbered, folder. e.g. Movie->9->Frame->11 contains the files for frame 11 of movie 9.

I'll update this post when I've figured out how to resolve the issue - probably by creating the movie using separate software or by splitting the movie on the device.

Tuesday, July 26, 2016

List user installed R packages

It's handy having a list of packages you've installed on hand.

This script will output the package name and version number:

Sunday, January 17, 2016

Evernote sync error - "the content is invalid"

I've been getting these on and off for months. It's been a pain to try and sort out what's going on and there seems to be nothing in the Evernote forums that's particular to my issue. I have a set of notes that just won't sync with nothing obviously wrong with them. The error in the log looks like this:
-[ENSyncEngine(Errors) addSyncErrorForObjectWithID:title:message:underlyingError:] | Adding error: Error Domain=ENSyncEngineErrorDomain Code=-2000 "The content is invalid." UserInfo=0x... {underlyingError=, NSLocalizedFailureReason=Could not sync note ‘Work Done: 2015-12-09 (Wed)’., localObjectID=0x... , NSLocalizedDescription=The content is invalid.}

So, this makes it sound like there's an issue with a 'TODO' element (checkbox?) and that the tag, for some reason, contains content. Looking at the XML export of that particular note doesn't show anything amiss/unusual around the TODO/checkbox elements.

Solution: In my case, the issue turns out to be the emoticons - I use smileys and Evernote helpfully converts the ASCII versions into lovely little images. These seem to cause the invalid content issue. If I highlight the areas around the emoticons and 'simplify formatting' (Formatting dropdown) the note will now sync just fine.

Tuesday, November 17, 2015

Ergotron Workfit-S - fix for reduction in range of motion

I've been using one of these Ergotron standing desks for a few years now: Ergotron WorkFit-S 33-341-200 . The maximum height it'd raise to has reduced over time; it took me a while to realize it as this was quite a slow process.

It turns out the fix is really simple. I found this entry in the Ergotron forums: WorkFit-S Dual Maximum height.

The main point is in the second comment (a reply from an Ergotron tech):

One thing that you can try is "resetting" the WorkFit-S. To do this, lower it with one hand on the handle & one hand on the workstation surface - when it gets to the low point, push on the workstation surface a little bit - you should hear the sound of the desk "reset". Afterwards, you should be able to have the full range of motion that you had before.

This worked well for me - at least after I realized the 'workstation surface' was really anywhere on the movable arm (my Ergotron doesn't have a workstation surface). I had to press quite hard, the arm moved further down than it's base resting position and then had the full range of motion back. This meant that standing was comfortable again (before, my arms were bent as the keyboard tray was too low).

Thursday, November 12, 2015

Git: remove files from the index which are ignored by .gitignore

If you update your patterns in .gitignore, you're often left with a set of files in the index and repository that should be removed. This can be achieved as follows:

You now have the ignored files staged for deletion.

Wednesday, February 25, 2015

RMarkdown - making and using a general Rmd file for re-use

There are some tasks I do a lot and it'd be good to have general .Rmd documents available to report on the outcome of those tasks. Some examples would be a standard report on an ML experiment, or an overview from a data curation pipeline. I've been using rmarkdown for generating reports, but it has some limitations for this. I don't want to have a new Rmd file for every report. I'd like to have a configurable template file that lives in a shared location that I can run each time.

Unfortunately, if you try to do this you'll soon find that rmarkdown expects the Rmd file to be in your working directory - well, the working directory is set to the location of the Rmd file. See the following line in render.R: github-render.R_L96

My current work around for this (and please let me know if you have a better way) is to have a helper script which copies over the Rmd file to the current working directory, generates the report and then removes the temporary files: The Rmd file has a line for loading in the configuration:
library(yaml)
config <- yaml.load_file("model_report.yaml")

The YAML configuration file contains the project specific variables (e.g. output suffix, flags for adding/subtracting items from a report, important dir locations). This file could easily be generated on the fly via arguments to the bash script.

Wednesday, February 18, 2015

Rmarkdown: automatically select correct output type for xtable

I was initially setting the xtable output type manually - either globally or in each print statement. This got annoying very quickly when switching between HTML and PDF outputs. This is how you get xtable to automatically use the correct output format: