This file contains hidden or 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
from pprint import pprint | |
import math | |
def Exo32(n): | |
M = [] | |
for i in range(n): | |
M += [[None] * n] | |
def fill(bounds, counter, i=None, j=None, reverse=False): | |
assert (i == None) ^ (j == None) |
This file contains hidden or 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
#! /usr/bin/env nix-shell | |
#! nix-shell -i sh -p coreutils findutils gnused ripgrep strace | |
# Usage ./get-command-nix-deps.sh ./script.sh 10s | |
timeout "$2" strace -qqfe execve sh -c "$1" 2>&1 >/dev/null | \ | |
rg '(/nix/store|/run/current-system/sw/bin)' | \ | |
sed -E 's=.*execve\("(\/.*)", \[.*=\1=g' | \ | |
xargs readlink -f | sort -u | \ | |
sed -E 's=/nix/store/[0-9a-z]*-(.*)-(.*)/.*/.*=\1 (\2)=g' | sort -u | |
This file contains hidden or 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
from anytree import Node, RenderTree | |
from functools import reduce | |
from itertools import groupby | |
import numpy as np | |
import os | |
import struct | |
class InvalidFileHeader(Exception): | |
pass |
This file contains hidden or 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
import random | |
import yaml | |
import json | |
from pprint import pprint | |
from anytree import Node, RenderTree | |
from anytree.exporter import DotExporter | |
from itertools import count,groupby,combinations_with_replacement | |
from pandas.core.common import flatten | |
from anytree import AnyNode,PreOrderIter | |
from anytree.exporter import DictExporter |
This file contains hidden or 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
{ config, pkgs, lib, ... }: | |
let | |
user = "nixos"; | |
password = "nixos"; | |
SSID = "MyBox"; | |
SSIDpassword = "..."; | |
interface = "wlan0"; | |
hostname = "MyPi"; | |
in { |
This file contains hidden or 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
// Credits go to https://stackoverflow.com/a/61340341 | |
package com.sample.piview | |
import android.content.Context | |
import android.util.AttributeSet | |
import androidx.preference.DialogPreference | |
class NumberPickerPreference(context: Context?, attrs: AttributeSet?) : | |
DialogPreference(context, attrs) { | |
override fun getSummary(): CharSequence { |
This file contains hidden or 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
// Credits go to https://stackoverflow.com/a/61340341 | |
package com.sample.piview | |
import android.content.Context | |
import android.os.Bundle | |
import android.view.View | |
import android.widget.NumberPicker | |
import androidx.core.os.bundleOf | |
import androidx.fragment.app.setFragmentResult | |
import androidx.preference.PreferenceDialogFragmentCompat |
This file contains hidden or 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
package com.sample.piview | |
import android.os.Bundle | |
import androidx.preference.Preference | |
import androidx.preference.PreferenceFragmentCompat | |
class SettingsPageFragment : PreferenceFragmentCompat() { | |
private val DIALOG_FRAGMENT_TAG = "NumberPickerDialog" | |
private lateinit var myPreference: NumberPickerPreference | |
override fun onCreate(savedInstanceState: Bundle?) { |
This file contains hidden or 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
let | |
str_sleep_time = builtins.toString 1; | |
# For extra determinism | |
nixpkgs = builtins.fetchTarball { | |
url = "http://github.com/NixOS/nixpkgs/archive/389249fa9b35b3071b4ccf71a3c065e7791934df.tar.gz"; | |
sha256 = "1z087f1m1k4pii2v2xai8n0yd3m57svgslzzbm7fwdjjzhn8g2rl"; | |
}; | |
openvpn3Nixpkgs = import (fetchTarball { | |
url = "https://github.com/NixOS/nixpkgs/archive/defadcb57b7afeb184f939463de0419e078bbf66.tar.gz"; | |
sha256 = "1cjhah0pjbz200rmbr5lpxcjx7j3clg1hn3chib0awfmqpjylgza"; |
This file contains hidden or 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
pythonCatchConflictsPhase | |
Found duplicated packages in closure for dependency 'xcffib': | |
xcffib 0.11.1 (/nix/store/7rysf86bnc8m8m6y3lfhz9xwdw63h467-python3-3.8.9-env/lib/python3.8/site-packages) | |
xcffib 0.11.1 (/nix/store/w001m900i44wcf2f89adj1rb44rqwql7-python3.8-xcffib-0.11.1/lib/python3.8/site-packages) | |
Found duplicated packages in closure for dependency 'six': | |
six 1.15.0 (/nix/store/7rysf86bnc8m8m6y3lfhz9xwdw63h467-python3-3.8.9-env/lib/python3.8/site-packages) | |
six 1.15.0 (/nix/store/nv3ryyaknp2g0qyjkmg4h83flqm0c0k3-python3.8-six-1.15.0/lib/python3.8/site-packages) | |
Found duplicated packages in closure for dependency 'pycparser': | |
pycparser 2.20 (/nix/store/7rysf86bnc8m8m6y3lfhz9xwdw63h467-python3-3.8.9-env/lib/python3.8/site-packages) | |
pycparser 2.20 (/nix/store/dbljgicq1dsjh7qbsi1v8whzmqcxyqqp-python3.8-pycparser-2.20/lib/python3.8/site-packages) |
NewerOlder