- Ensure your bank is usable in a browser without its app, just to be sure
- Backup authenticator codes
- Remove the SD card to prevent it from being written to, just to be sure
- Unlink your google account from the device to avoid factory reset protection. Note that this seems to delete all google one backups.
- Unlock the bootloader https://www.techmesto.com/guide-unlock-bootloader-nokia-android-phones/
- Follow the steps in https://wiki.oddsolutions.us/devices/PL2/install
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Optimal flow speed is when pipes are at half pressure. | |
const Node = struct { | |
// All of these must be positive, I'm just using signed types to avoid casting. | |
height: i32, | |
width: i32, | |
contents: i32, | |
potential_inflow: i32, | |
potential_outflow: i32, | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-# LANGUAGE ImpredicativeTypes #-} | |
module Futamura where | |
newtype C a = C {runC :: a} | |
newtype L a = L a | |
newtype Executable a = Executable {run :: a} | |
-- Given: | |
-- - A high level language L |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-# LANGUAGE RankNTypes #-} | |
module Lifetime where | |
import Data.Text (Text) | |
import Data.Text.IO qualified as Text | |
import System.IO (IOMode (..)) | |
import System.IO qualified as Base | |
import Prelude hiding (Handle, withFile) | |
import Prelude qualified as Base |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ pkgs ? import <nixpkgs> { } }: | |
with builtins; | |
rec { | |
inherit (pkgs) ghc lib; | |
uniqueStrings = strings: | |
attrNames (listToAttrs (map (name: { | |
inherit name; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module System.SafeIO where | |
import "base" Control.Concurrent ( ThreadId ) | |
import "base" Control.Concurrent qualified as Unsafe | |
import "base" Control.Exception ( AsyncException(..), Exception(..) ) | |
import "base" Control.Exception qualified as Unsafe | |
import "base" Prelude ( Applicative(..), Functor(..), Monad(..), const, ($), (.) ) | |
import "base" System.IO qualified as Unsafe | |
data Uninterruptible |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
newtype Pool r = Pool (TVar (Seq r)) | |
newPool :: [r] -> IO (Pool r) | |
newPool = fmap Pool . newTVarIO . Seq.fromList | |
getResource :: Pool r -> IO r | |
getResource (Pool pool) = STM.atomically do | |
rs <- STM.readTVar pool | |
case rs of | |
Seq.Empty -> STM.retry |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def caffeine(hours): | |
sip = hours * (1 - 0.5**(1 / 5)) | |
gulp = 1 - 0.5**((24 - hours) / 5) | |
total = sip + gulp | |
print("If you want to maintain a consistent amount of caffeine in your") | |
print("blood for {} hours after you wake up, you'll need to drink {:.1%}" | |
.format(hours, gulp / total) | |
) | |
print("of the amount of caffeine you want to drink in a day when you") | |
print("wake up, and {:.1%} during the {} hours thereafter, which is about" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdint.h> | |
#include <string.h> | |
#define MASK26 0x03ffffff | |
// Load 128-bit value from 4 32-bit limbs into 5 26-bit limbs. | |
void load26(uint32_t dst[5], const uint32_t src[4]) { | |
dst[0] = src[0] & MASK26; | |
dst[1] = (src[0] >> 26 | src[1] << 6) & MASK26; | |
dst[2] = (src[1] >> 20 | src[2] << 12) & MASK26; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Ever have trouble deciding whether to use a left or right fold? | |
-- Por que no los dos? | |
-- Fold left and right at the same time! | |
-- Use accumulated values from both directions for each step! | |
module Fold where | |
import Data.Set (Set) | |
import Data.Set qualified as Set |
NewerOlder