Are words in a poem lyrics?
Deebster
Mild spoilers ahead, but you're reading the solutions thread.
I was just doing some preliminary checking of the data on my phone with Nushell (to see how much my ageing laptop would suffer) when I discovered there weren't any non trivial cases.
Normally I get the test data working before trying the input data, this is definitely teaching me the value of investigating the data before heading down into the code mines.
Unfortunately I can't get the second star yet because I missed a few days.
Sounds like perhaps unified codes would be the answer to that problem!
Interesting stuff, thanks for writing it up.
I did know that US codes weren't standardised, partially because the video covers it - perhaps I should have phrased it as "a police code" to be more technically correct. Edit: or bothered to check the video so could have written "Philadelphia police code" - but then I would have missed out on your reply.
If you read the article, you learn that the authorities never properly searched any of these freighters - that's probably a more sensible place to start.
https://www.youtube.com/watch?v=laZpTO7IFtA is worth the 15 minutes, but the TL;DW is that the kids are just using it as an in-joke marker (i.e. the phrase is a shibboleth), but its origin is in lyrics* by the rapper Skrilla referring to police codes for a dead body.
* are rapped words lyrics?
nushell
I'm still travelling, so another phone attempt. Jet lag says sleep, so just part 1 for now:
def part1 [filename: string] {
mut input = open $filename | lines |
each { parse '{index}: {children}' | update children { split row " " } | first } |
insert paths { null }
print $"Data loaded, ($input | length) devices"
$input = explore-path $input you
$input | where index == you | get 0.paths
}
def explore-path [devices, start: string] {
print $"Exploring ($start)"
let dev = $devices | where index == $start | first
if ($dev | get paths) != null {
print "Already explored"
return $devices
}
# Shadow with mutable version
mut devices = $devices
mut paths = 0
let is_out = $dev | get children | where ($it == out) | is-not-empty
if $is_out {
print $"Found an out device: ($start)"
$paths = 1
} else {
for child in ($dev | get children ) {
$devices = explore-path $devices $child
$paths += $devices | where index == $child | get 0.paths
}
}
# Shadow with immutable... wtf
let paths = $paths
print $"Setting paths for ($start) to ($paths)"
$devices = $devices | update paths { |row| if $row.index == $start {
$paths } else {} }
$devices
}
Firefox does seem to be clearing out their old bugs (another example is MKV support) but perhaps it's buses arriving together and not due to some policy.
I can't code today because of travel, just as the one that might run slow enough to geek out on benchmarking the various options. Does seem like it's a bit of a jump in difficulty from previous days.
We’re still preparing the notes for this release, and will post them here when they are ready. Please check back later.
Oh come on guys
edit: they're up now
Yeah, it's quite a mean trick really - kinda a big middle finger to anyone who does TDD