Unless global warming gets sufficiently bad, in which case that will be the worst damage.
54 karma · joined September 13, 2017
Unless global warming gets sufficiently bad, in which case that will be the worst damage.
(In this particular case I did not vote on the OP.)
Can you recommend a specific one? I'd like to integrate a secret-sharing system into my personal set of computers and applications.
In case you are wary of giving recommendations, perhaps you could just list the top three instead. But ideally I'd like to have a specific recommendation. Also, if said secret-sharing system is written in rust an is available as a library I'd be extra super happy.
Having just said that, I decided to do a search on crates.io. https://crates.io/search?q=secret. It seems that at least a couple of those are about the thing that we are talking about here.
So to anyone else buying the bundle primarily for the books on OpenBSD, and who happen to support FreeBSD also:
1. Log in or create an account.
2. Go to https://www.humblebundle.com/store/select-charity/charity/21... and select it as your chosen charity to support.
3. When you go to pay for the books adjust the sliders so that you give some percentage (I chose 100%) to charity and under charity adjust the slider for The FreeBSD Foundation (once again I chose 100%).
Deal? Deal!
https://en.wikipedia.org/wiki/List_of_countries%27_copyright...
Edit:
http://coffeescript.org/#whats-new-in-coffeescript-2 answers this I think.
> The biggest change in CoffeeScript 2 is that now the CoffeeScript compiler produces modern JavaScript syntax (ES6, or ES2015 and later). [...] There are very few breaking changes from CoffeeScript 1.x to 2 [...]
So probably that means that the language reference is up to date.
And then the app developers upload the depth data to their servers and use it to track users, and then the servers are hacked and the depth data is taken by the hackers and then the hackers sell the depth data and then someone can use that data to unlock stolen iPhones. Sounds great /s
Once I get to that point I will stop working on that specific problem until the next day, but swearing about it in the commit message helps me not think about it anymore and also when I come back to it the next day I can see from the commit what I was struggeling with.
Obviously only do this for repositories that you aren't sharing with anyone.
You could also do it in a shared repo if you don't push the commits and you squash them first. Personally I'm not a squash kind of person and I'd also fear that I pushed without remembering to squash even if I really were planning on squashing.
>>> import operator
>>> def add(it):
... return reduce(operator.add, it)
Ooh, I like this one. Thanks! 'hello' + 'world'
but not sum(['hello', 'world'])
Intuitively I would have expected the latter to be possible given the former but I guess it comes down to how the + operator and the sum function are implemented in Python, such that counter to my expectation sum is not a function that "applies the + operator" to it's arguments. The notion that this is how it should work stems from my impression that "sum" belongs to the same family as do "map", "reduce" and "apply" -- that these are somehow "functional" in nature in the sense that is observed in the Lisp family of languages. #!/usr/bin/env python3
# Word of factor
wof = { 3: 'Fizz', 5: 'Buzz', 7: 'Bar' }
def fizz (i):
out = ''.join([wof[k] for k in sorted(wof.keys()) if not(i % k)])
return out or str(i)
for i in range(1, 101):
print(fizz(i))
Some notes on my version:1. I used dicts like the parent to yours. Tuples are almost just as fine and you do get a little bit nicer code in the part that you say
word for x, word in outputs
where our say wof[k] for k in sorted(wof.keys())
However, when I wrote mine I imagined myself sitting in front of an interactive interpreter session.Now let's say that we've each typed in the code we have here and then the interviewer says "now make it say Bazinga when the number is divisible by 19, and keep the order like with FizzBuzzBar".
Since my wof is global, I can add to it directly
wof[19] = 'Bazinga'
But let's pretend that yours was global as well outputs.append((19, 'Bazinga'))
So aside from the global / not global we are on equal ground thus far.But then the interviewer says "now make it say Fnord when the number is divisible by 13, and keep the order still".
Then once again I can simply
wof[13] = 'Fnord'
Whereas if you did outputs.append((13, 'Fnord'))
then now you are out of order.So you have to do some extra steps to ensure it's in order. Either you have to redeclare the whole thing (imagine there were one million pairs of numbers and strings!), or you have to sort it, or you have to find where you are going to insert and split it in two and join it around.
Not saying that mine is in any way better, just felt like sharing how I thought about this :)
2. (Wow note #1 was looong, sorry 'bout that.) I prefer splitting up my code like
out = ''.join([wof[k] for k in sorted(wof.keys()) if not(i % k)])
return out or str(i)
as opposed to your all-at-once return ''.join(word for x, word in outputs if i % x == 0) or str(i)
In my opinion splitting it exactly the way I did is more readable. Again, not a critique against what you wrote. Esp. since you said it yourself that your code was a bit tongue-in-cheek.3. Even when split like I did there, I actually don't think my
out = ''.join([wof[k] for k in sorted(wof.keys()) if not(i % k)])
is all that nice either.One thing, which others have pointed out about this often is that too much is happening in one line but also there is another issue.
We all make typos or logic errors every now and then. In my exprience it's much more difficult to debug list comprehensions compared to... well whatever we call that which is not list comprehensions. Both with regards to error messages and with regards to following what's going on. I maintain that this is true even if you have a habit of using a lot of list comprehensions.