20 random bookmarks
Тут будут ссылки на всё-всё, что я найду интересным
Тут будут ссылки на всё-всё, что я найду интересным
// Output the k! permutations of A in which the first k elements are permuted in all ways.
// To get all permutations of A, use k := length of A.
//
// If k > length of A, will try to access A out of bounds.
// If k <= 0 there will be no output (empty array has no permutations)
procedure permutations(k : integer, A : array of any):
if k = 1 then
output(A)
else
// permutations with last element fixed
permutations(k - 1, A)
// permutations with last element swapped out
for i := 0; i < k-1; i += 1 do
if k is even then
swap(A[i], A[k-1])
else
swap(A[0], A[k-1])
end if
permutations(k - 1, A)
end for
end if
The more time you spend designing systems, the more paranoid you get about things going wrong
Custom keyboard configuration builder
A - The task requirements and goals might not be clear enough. If you are trying to get yourself to “plan for a project” or “write a book” then it’s hard to identify the next actionable items. Put some time aside to figure out what physical things you can do to move the project forward. Try break down the larger tasks into the smallest pieces possible. The goal of the project might need identifying, or the requirements fleshed out from a supervisor.
B - The task might exceed your current competency. Sometimes we know what we have to do, but don’t know how to do it, and then we become avoidant rather than admitting this. In this case, it’s worth figuring out what you do know how to do and what you don’t know how to do, and be honest with that. Then slowly ask for help or read up on the things you don’t know.
C - The tasks might really not be worth it. Sometimes you are assigned tasks that don’t actually help you achieve your long-term goals, and so your brain demotivate you from doing them. Maybe the payoff is low, maybe you don’t learn anything new from them, or maybe a colleague you don’t like will gain credit for the tasks, or maybe you just wont be rewarded or appreciated for getting the tasks done.
Крупные технологические компании производят гораздо больше выбросов углерода, чем предполагают в своих отчетах об устойчивом развитии.
Они активно лоббируют переписывание правил о том, как рассчитываются выбросы, чтобы показать чистый ноль на бумаге, но не на практике.
In many other languages, you have to not only evaluate testing libraries, but also write your tests in a style that complies with that library’s expectations. Gophers are blessed to have a thoroughly adequate solution out-of-the-box, and even further blessed to have an active ecosystem where folks are making in-depth testing a walk in the park.
The coolest thing I've seen today!
Using UPPER or LOWER for case-insensitive search is not a good practice. Prefer using a _CI collation if possible or at least add the right indexes to make your query fast.
Fun fact: There is no limit clause in the SQL standard.
Everyone uses limit.
And yet, according to the standard, we should be using fetch
Now I use my inbox as a to do list of sorts. Emails are only there as long as they're relevant. Confirmation of a table reservation at a restaurant? It's at most relevant until the date of the booking has past. Archive it.
Rendering text, how hard could it be? As it turns out, incredibly hard! To my knowledge, literally no system renders text “perfectly”. It’s all best-effort, although some efforts are more important than others.
This site contains writings on the topic of reducing suffering, including the suffering of non-human animals and far-future beings. Most content is by Brian Tomasik, though a few pieces are written by others.
На этой карте показано, как далеко можно уехать по железным дорогам Европы за 8 часов
Online Vaporwave Radio