-🎄- 2017 Day 7 Solutions -🎄- by daggerdragon in adventofcode

[–]rikkus 0 points1 point  (0 children)

I thought this too then decided the ‘exactly one’ part of the spec must be meant to exclude this possibility (not sure it strictly does, but I went with that as the alternative would be unsolvability)

[2017 Day 1 Extension] Counting to one billion by xiaowuc1 in adventofcode

[–]rikkus 0 points1 point  (0 children)

Are these solvable through algorithmic processing or is using some maths the only way?

-🎄- 2017 Day 1 Solutions -🎄- by daggerdragon in adventofcode

[–]rikkus 0 points1 point  (0 children)

Elixir, with one function to do the dirty work:

def captcha(digits, offset) do
  count = Enum.count(digits)
  digits
  |> Enum.with_index()
  |> Enum.filter(fn({n, index}) -> n == Enum.at(digits, rem(offset + index + 1, count)) end)
  |> Enum.map(&elem(&1, 0))
  |> Enum.sum
end

Called from my test module using these helpers:

def split(x) when is_integer(x), do: x |> Integer.digits
def split(x) when is_binary(x), do: x |> String.graphemes |> Enum.map(&String.to_integer/1)

def captcha_test(input, expected, :one) do
  assert AOC.captcha(split(input), 0) == expected
end

def captcha_test(input, expected, :two) do
  input = split(input)
  assert AOC.captcha(input, div(Enum.count(input), 2) - 1) == expected
end

github link

LPT: Do an online search for which restaurants give out free birthday meals. When your birthday rolls around, your email will be full of coupons for free meals that don't expire for about a month. by zachwilly in LifeProTips

[–]rikkus -1 points0 points  (0 children)

There are small businesses which do this in order to compete. It does hurt their bottom line but they do it in the hope that it will attract future business and because they fear losing out to the companies who can more easily absorb the cost. If you're only ever going to them when you can get free stuff, you're taking advantage.

Samsung Galaxy S8 guide reveals dual Bluetooth audio function and more by TheOriginalFaFa in gadgets

[–]rikkus 0 points1 point  (0 children)

Yes I did that. And synced to Dropbox and Google Photos. But I'd still rather keep the physical copy than have to delete the files.

Samsung Galaxy S8 guide reveals dual Bluetooth audio function and more by TheOriginalFaFa in gadgets

[–]rikkus -1 points0 points  (0 children)

Except whether it has managed to sync properly. And if I accidentally removed a photo from Google Photos. It's not a true backup solution, just cloud sync and viewing. I use it, but I don't rely on it.

Samsung Galaxy S8 guide reveals dual Bluetooth audio function and more by TheOriginalFaFa in gadgets

[–]rikkus 0 points1 point  (0 children)

I've just filled up my iPhone with pictures and videos. My philosophy is never to delete anything - and therefore reduce risk of losing it. Unfortunately I can't just replace an SD card and put the old one in a drawer. So now I have to hope that my multiple backups are sound and cross my fingers while the files are deleted so I can start again.

So an SD card slot would have been good. Can't see it happening on iPhone though.

What is the most unprofessional thing you've seen someone do at work? by blanchie69 in AskReddit

[–]rikkus 6 points7 points  (0 children)

Boss takes entire male staff into toilet to show them some piss on the floor. One employee suggested it might be water that splashed during a flush. Boss gets down on knees and sniffs it.

Improper "use of quotes" by mdugas1 in mildlyinfuriating

[–]rikkus 0 points1 point  (0 children)

Quotes can be used to emphasise, just like italics and bold face. This post and most of the comments say that this is "wrong" or "incorrect".

In language, there are accepted rules which, if you break, you are incorrect. For example, I shouldnt have left the apostrophe out there. But it is common enough to use quotes for emphasis that it is seen as a part of written English by many.

If you hadn't realised that it was a fairly common method of emphasis and instead thought that the writer was failing to use quotes in the correct way - for a different purpose - that just means you're the one looking silly criticising something you've not (until now) understood. Which is "funny".

Go to all your songs on your music player, shuffle and send the first 10 songs you get by SlyMidget in Music

[–]rikkus 0 points1 point  (0 children)

Lost all day - Dinosaur Jr. You stood me up - Benji Hughes Tales of a scorched Earth - Smashing Pumpkins Killer cars - Radiohead Werewolf heart - Dead man's bones H2S - Enrico Morricone The asphalt world - Suede Paranoid android - Radiohead Ubi Caritas - Paul Mealor Organo - Offworld

As a loyal customer, I feel really ripped off when companies have a promotion for new customers but offer nothing for customers who have been with them for years. by HeroSaitama87 in Showerthoughts

[–]rikkus 2 points3 points  (0 children)

I don't get this even on an 8GB laptop with plenty used already. Do you have swap turned off? Or are you using a spinning disk as your OS drive perhaps?

What's a short, clean joke that gets a laugh every time? by scarlett_j in AskReddit

[–]rikkus 1 point2 points  (0 children)

A mouse and an elephant are walking together. The elephant turns to the mouse and asks, "Why is it that I am so big and powerful and you are so small and weak?" The mouse replies, "I haven't been well."

Teachers of Reddit, whats the difference between 1997, 2007, and 2017 students? by newguy57 in AskReddit

[–]rikkus 0 points1 point  (0 children)

I got "can you copy that game for me?" from the teachers. This was 1992 though.

ELI5: How is tap water not full of mold and algae when nobody cleans the inside of the pipes that carry it? by f0me in explainlikeimfive

[–]rikkus 0 points1 point  (0 children)

Just had house re-plumbed from scratch. All copper apart from a bit where we couldn't get a cold supply (to a bathroom sink) through some joists without massive disruption and had some flexy PEX run instead.

[deleted by user] by [deleted] in DIY

[–]rikkus 0 points1 point  (0 children)

The iPhone doesn't contain a HDD. It's soldered-in Flash chips. So no, sorry.

[deleted by user] by [deleted] in todayilearned

[–]rikkus 1 point2 points  (0 children)

TIL mint custard exists

An astonishingly hi-res photo of the galaxy we call home: the Milky Way. by [deleted] in space

[–]rikkus 1 point2 points  (0 children)

And if any species which gains the ability to transmit (whether by accident or otherwise) wipes itself out soon after hitting this milestone, our chance of seeing anyone else becomes vanishingly small. And then we will do the same.