From SAT to SMT and back.
There is a Gist, see references [@gist].
Is a given formula (i.e. $\lnot A \land (B \lor C)$) satisfiable?
# Instrument binaries, pgo data to /data/pgo, serial make is important to not confuse the pgo generator | |
env CXXFLAGS='-march=native -fprofile-dir=/data/pgo -fprofile-generate=/data/pgo' cmake .. -DCMAKE_BUILD_TYPE=Release | |
make -j 1 | |
# Run instrumented program, generate and write pgo data | |
./runIt | |
# Use profile data and feed into gcc, correct for threading counter noise, serial make is important to not confuse the pgo generator | |
env CXXFLAGS='-march=native -fprofile-dir=/data/pgo -fprofile-use=/data/pgo -fprofile-correction' cmake .. -DCMAKE_BUILD_TYPE=Release | |
make -j 1 |
update-alternatives --install "/usr/bin/ld" "ld" "/usr/bin/ld.gold" 20 | |
update-alternatives --install "/usr/bin/ld" "ld" "/usr/bin/ld.bfd" 10 | |
update-alternatives --config ld | |
ld --version | |
GNU gold | |
export CPP=cpp-5 gcc-5 g++-5 | |
env CXXFLAGS='-march=native -flto -fuse-linker-plugin' cmake .. -DCMAKE_BUILD_TYPE=Release |
package com.example.view | |
import androidx.compose.runtime.* | |
import androidx.compose.ui.Modifier | |
import androidx.compose.ui.platform.LocalContext | |
import androidx.compose.ui.platform.LocalLifecycleOwner | |
import androidx.compose.ui.viewinterop.AndroidView | |
import androidx.lifecycle.Lifecycle | |
import androidx.lifecycle.LifecycleEventObserver | |
import com.mapbox.geojson.Point |
#!/usr/bin/env python3 | |
import sys | |
import csv | |
import json | |
import argparse | |
from pathlib import Path | |
def main(args): |
# Nix skeleton for compiler, cmake, boost. | |
# Dependencies (boost and others you specify) are getting built with selectec compiler (for ABI compatibility). | |
# Examples: | |
# nix-shell --argstr compiler gcc5 --run 'mkdir build && cd build && cmake .. && cmake --build .' | |
# nix-shell --argstr compiler gcc6 --run 'mkdir build && cd build && cmake .. && cmake --build .' | |
# nix-shell --argstr compiler clang_38 --run 'mkdir build && cd build && cmake .. && cmake --build .' | |
{ nixpkgs ? import <nixpkgs> {}, compiler ? "gcc6" }: | |
let |
#include <stdexcept> | |
#include <utility> | |
class Str { | |
public: | |
template <std::size_t N> | |
constexpr Str(const char(&a)[N]) : p(a), s(N - 1) {} | |
constexpr char operator[](std::size_t n) const { |
When you encrypt volumes like your laptop's SSD or USB sticks on Linux there's a high chance you're using Linux Unified Key Setup (LUKS) in the background. To decrypt volumes, LUKS uses your secret passphrase and puts it through a function to derive the actual volume decryption key. The key derivation function is supposed to be expensive to compute so that brute-force attacks are hard to pull off.
There are three problems with the LUKS setup in practice
That's why you should re-key y
#!/usr/bin/env python2 | |
# -*- coding: utf-8 -*- | |
# http://docs.sqlalchemy.org/en/latest/orm/self_referential.html | |
import json | |
from sqlalchemy import create_engine, Column, Integer, String, ForeignKey, CheckConstraint | |
from sqlalchemy.orm import sessionmaker, relationship, backref | |
from sqlalchemy.ext.declarative import declarative_base |
#!/usr/bin/env python3 | |
''' | |
pip install tqdm numpy pillow mercantile 'rasterio==1.0b1' 'rio-tiler==1.0a7' | |
''' | |
import os | |
import argparse |