Words about things. Introverted, Geeky, DevOps.

Sunday Bike-Ride (18/05/14)


Thanks to Fergus for putting up with me - turns out, I'm awful at hills.

cycleroute-180514

I had a lot of fun, though, and was convinced of the necessity of cycling gear. I was going to get one of the r/Cycling jerseys, but shipping is half the cost of the item... plus I think I prefer last years version.

2013Jersey 2014Jersey

What do you think? Both quite nice, I agree.

Weight, what?


Weight = Some

To this end, do I really need a wi-fi enabled weighing scale?

fitbit aria

This simple-looking device will apparently do interesting things like "recognise me", and "weigh me", and "wirelessly upload my current weight and fat/body ratio to the vast pool of data known as the internet".
It does cost roughly ten to fifteen times what a regular electronic scale does, though, and probably two to three times an electronic scale with fat-measuring-tech.

I probably do need some scales, as being without any at all is affecting my ability to judge myself. And the gap between some and scales there is reminding me of a great sub-reddit - r/Keming. Curiously this font doesn't lend itself to that joke.

So anyway, I'm tempted to use some John Lewis vouchers I found buried under letters and manuals near my desk to get either a FitBit or Jawbone Up24 or something... Does anyone have any recommendations? Alternatively, I might subscribe to the Gym, which is all of 30 seconds away. Adult life, eh?

Edit: I've found that neither Fitbit nor Up nicely support cycling, so I'm entirely unsure what to do... but I'll probably do nothing. So no worries!

PoSH Fun


I was browsing r/Powershell (as you do), and noticed a chap complaining about the test at the end of a course, where he was asked to

Create a directory named "newdir" in every empty directory whose name is longer than 8 characters recursively.

His code went like this:

$currentdir=pwd;
$array=@()
get-childitem -recurse | where{$_.Mode -like "d*"} | foreach-object         {$array+=$_.FullName;}
$size=$array.Length;
for($i=0; $i -lt $size; i++)
{
if($array[$i].Length -gt 8)
{
cd $array[$i];
mkdir newdir;
}
}
cd $currentdir;
echo "Done"    

I've been pushing to go on a decent Powershell course for a while, but I think I'll need to pick another course, as I'm sure I can do something more PS specific. Let's have a go...

Though I did miss one requirement (only create files in empty directories), I began with this:

$targetdir = C:\Users\James\Work\Powershell\
$dirs = @()

gci $targetdir -Recurse -Directory | %{ 
    if(($_.Name).Length -ge 8){$dirs += $_.fullname}
}
$dirs | %{ mkdir (Join-Path $dir "newdir")}

Of course, changing that last line to a quick check solves the empty folders issue -

foreach ($dir in $dirs) {
    if (!(gci $dir)) {mkdir (Join-Path $dir "newdir")}
}

I do realise that I'm cheating a bit - apparently he was only using stuff available in Powershell 2.0 (poor chap), so the -Directory argument for GCI was unavailable.

Please also note, @stuidge, that Powershell is capable of more fun things, but I'm lazy (and I'd written this out for a reddit post last night... then not posted it, then rewritten it briefly for this).

Soundcloud


Mashups, mixes, and more - Soundcloud hosts a bizarre amount of great music, and pops up in a lot of the places I go searching for streamable tracks at odd times.

My account on Soundcloud is Jinoxide, and I occassionally reshare or like stuff - here's a playlist of stuff I've apparently enjoyed.