A collection of bookmarks covering the topics of
- functional programming with haskell
- type theory
- category theory
- formal verification
- interesting stuff for haskellers
""" | |
Enum union based on and compatible with the standard library's `enum`. | |
""" | |
# MIT License | |
# | |
# Copyright (c) 2020 Paolo Lammens | |
# | |
# Permission is hereby granted, free of charge, to any person obtaining a copy | |
# of this software and associated documentation files (the "Software"), to deal |
Rank | Type | Prefix/Suffix | Length | |
---|---|---|---|---|
1 | Prefix | my+ | 2 | |
2 | Suffix | +online | 6 | |
3 | Prefix | the+ | 3 | |
4 | Suffix | +web | 3 | |
5 | Suffix | +media | 5 | |
6 | Prefix | web+ | 3 | |
7 | Suffix | +world | 5 | |
8 | Suffix | +net | 3 | |
9 | Prefix | go+ | 2 |
import 'package:flutter/material.dart'; | |
import 'package:flutter/gestures.dart'; | |
import 'package:flutter/widgets.dart'; | |
import 'package:flutter/rendering.dart'; | |
void main() => runApp(MyApp()); | |
class MyApp extends StatelessWidget { | |
// This widget is the root of your application. | |
@override | |
Widget build(BuildContext context) { |
import 'package:flutter/gestures.dart'; | |
import 'package:flutter/rendering.dart'; | |
import 'package:flutter/widgets.dart' hide PageView; | |
/// This is copy-pasted from the Flutter framework with a support added for building | |
/// pages off screen using [Viewport.cacheExtents] and a [LayoutBuilder] | |
/// | |
/// Based on commit 3932ffb1cd5dfa0c3891c60977ee4f9cd70ade66 on channel dev | |
// Having this global (mutable) page controller is a bit of a hack. We need it |
# Synchronize history between bash sessions | |
# | |
# Make history from other terminals available to the current one. However, | |
# don't mix all histories together - make sure that *all* commands from the | |
# current session are on top of its history, so that pressing up arrow will | |
# give you most recent command from this session, not from any session. | |
# | |
# Since history is saved on each prompt, this additionally protects it from | |
# terminal crashes. |
///$(which true);FLAGS="-g -Wall -Wextra --std=c17 -O1 -fsanitize=address,undefined";THIS_FILE="$(cd "$(dirname "$0")"; pwd -P)/$(basename "$0")";OUT_FILE="/tmp/build-cache/$THIS_FILE";mkdir -p "$(dirname "$OUT_FILE")";test "$THIS_FILE" -ot "$OUT_FILE" || $(which clang || which gcc) $FLAGS "$THIS_FILE" -o "$OUT_FILE" || exit $?;exec bash -c "exec -a \"$0\" \"$OUT_FILE\" $([ $# -eq 0 ] || printf ' "%s"' "$@")" | |
#include <stdio.h> | |
int main() { | |
printf("Hello world!\n"); | |
return 0; | |
} |
#!/bin/bash | |
YOUR_WINDOWS_USERDIRECTORY_NAME_HERE="" | |
WIN_TEMP_PATH="/mnt/c/Users/$YOUR_WINDOWS_USERDIRECTORY_NAME_HERE/AppData/Local/Temp" | |
CURRENT_DIR=`pwd` | |
if [ $# -eq 0 ] | |
then | |
echo "No arguments supplied" | |
exit 1 |
#!/usr/bin/env python2.7 | |
"""Find the Access Codes | |
In order to destroy Commander Lambda's LAMBCHOP doomsday device, you'll need | |
access to it. But the only door leading to the LAMBCHOP chamber is secured with | |
a unique lock system whose number of passcodes changes daily. Commander Lambda | |
gets a report every day that includes the locks' access codes, but only she | |
knows how to figure out which of several lists contains the access codes. You | |
need to find a way to determine which list contains the access codes once |
/** | |
* Base contract that all upgradeable contracts should use. | |
* | |
* Contracts implementing this interface are all called using delegatecall from | |
* a dispatcher. As a result, the _sizes and _dest variables are shared with the | |
* dispatcher contract, which allows the called contract to update these at will. | |
* | |
* _sizes is a map of function signatures to return value sizes. Due to EVM | |
* limitations, these need to be populated by the target contract, so the | |
* dispatcher knows how many bytes of data to return from called functions. |