|
You are here |
austinhenley.com | ||
| | | | |
www.uraimo.com
|
|
| | | | | Swift provides a convenient set of functionalities for fixed size integers and binary operations but you'll soon discover that in some cases the language is a bit opinionated in regard to how those operations should be performed. This post explains some of the gotchas and describe Bitter, a Swift bit manipulation library. | |
| | | | |
www.oranlooney.com
|
|
| | | | | A common example of recursion is the function to calculate the \(n\)-th Fibonacci number: def naive_fib(n): if n < 2: return n else: return naive_fib(n-1) + naive_fib(n-2) This follows the mathematical definition very closely but it's performance is terrible: roughly \(\mathcal{O}(2^n)\). This is commonly patched up with dynamic programming. Specifically, either the memoization: from functools import lru_cache @lru_cache(100) def memoized_fib(n): if n < 2: return n else: return memoized_fib(n-1) + memoiz... | |
| | | | |
blog.burntsushi.net
|
|
| | | | | I blog mostly about my own programming projects. | |
| | | | |
berty.tech
|
|
| | | You have probably already heard about cryptography and, more specifically, about end-to-end encryption. But do you know what it really is? | ||