Recursive String Permutations
https://www.interviewcake.com/question/python3/recursive-string-permutations
This links with one of the examples I saw in the Haskell book 202006061427, it recursively built up the permutations function.
def get_permutations(string):
# Generate all permutations of the input string
if len(string) in (0, 1):
return set([string])
head, tail = string[0], string[1:]
return set.union(*(interleave(head, tail_perm) for tail_perm in get_permutations(tail)))
def interleave(char, rest_of_str):
return {"".join((rest_of_str[:i], char, rest_of_str[i:])) for i in range(len(rest_of_str) + 1)}
uid: 202006231535 tags: #python #interviews
Jeffrey Epstein’s story
What kind of person I thought he was, and what his existence shows about society
My impressions of his life:
- He seems like the kind of person who seeks absolute joy in hanging things over other people, but at the same time relies on those people for his sense of self-worth.
- It is disgusting how candid he is about his sexual preferences for young teenage girls. It’s fucked up, and makes sense that Trump was with him along with the ride.
- I really should watch the Epstein documentary to learn more about him. I think in the conversation I had about him in my walk with Rohan 202006062329, that’s where Rohan got all of his information.
- I don’t even understand how he made money! Like the entire way he made money seems like just exploiting some financial shit? People gave him connections to stuff, also getting money from his mentor, some Leslie Wexner guy, was also a pretty big deal.
- I think it’s similar to the Bad Blood situation - all you need is for one sucker to believe in you, and then more and more get pulled in. These people at the top aren’t necessarily smart - in fact, they’re probably more disgusting and fucked up than the rest.
uid: 202006062315 tags: #politics
Zettlr review
It’s nice, but it seems to have a lot of features that I don’t really use. More generally, the smoothness of navigation that The Archive has (with the keyboard shortcuts, easy navigation, use of the omnibar) is crucial to me, and it’s unfortunately missing. This is also why I don’t really like Obsidian either 202006031443.
Also seems like there’s a grab bag of features, with no cohesive plan or theme mapping them all together. The pomodoro function seems wholly unnecessary.
Also, I can’t get my The Archive links to work properly in there. That might make sense, given that these apps don’t have a uniform guideline that they follow, but what’s more, I can’t get the autocomplete links to work either??? I’m not sure how this very core functionality is supposed to work, but it isn’t clear.
Finally, and this is something that I also observed in Obsidian 202006031443, I made a bunch of changes in the Zettlr’s preferences, but they didn’t save for some reason. Small, buggy stuff like indicates the difference between a polished, thoughtful developer and someone who’s more amateury. I’m more than happy to support The Archive if he keeps iterating on this.
uid: 202006031227 tags: #notetaking
Probability rules for how much longer something will last
If it’s a normal distribution, then use the average rule — something that’s close to the average, shifted a little bit by how much they’ve already been to so far.
If it’s a power-law distribution, then use the multiplicative rule: Take whatever sample data point you have, and multiple it by a constant value (for movies, it’s something like 1.4). Therefore, if you know that a movie has made 90 million, then it’s expected to make on the order of 126 million in total.
Finally, if it’s an Erlang distribution, the distribution modeling the length of the interval between two independent events, then use the additive rule: no matter how much time has passed, add a constant amount to predict how much longer it is going to last. This is a consequence of the memoryless properly.
For more practically applicable algorithms, see here 202006031201. As I fill out my book review for Algorithms to Live By 202005302204, I’ll add the things I learn from there into a broader list, that contains this note inside of it.
uid: 202006022154 tags: #knowledge
Why I should write
Whenever I need a reminder.
- “Why and how to write things on the Internet” 202301152336
- “Writing Helps You Think Better” 202204102301
- “The Need to Read” 202212101844
- “Show Your Work” 202207100236
- “Publishing your work increases your luck” 202210042120
- “Is it worth writing about?” 202212112114
Created from: Writing Helps You Think Better 202204102301
uid: 202302202137 tags: #index #writing
# Opinion | An Even Deadlier Pandemic Could Soon Be Here
source: https://ift.tt/rZGJp2w tags: #literature #covid uid: 202302202019 —
Alarmingly, it was recently reported that a mutant H5N1 strain was not only infecting minks at a fur farm in Spain but also most likely spreading among them, unprecedented among mammals. Even worse, minks’ upper respiratory tract is exceptionally well suited to act as a conduit to humans, Thomas Peacock, a virologist who has studied avian influenza, told me.