Skip to content

Instantly share code, notes, and snippets.

import java.io.Reader;
import com.fasterxml.aalto.in.XmlScanner;
import com.fasterxml.aalto.in.ReaderConfig;
public class BufErr {
public static void main(String[] args) {
try {
Reader rdr = new StringArrayReader(new String[] {
"<foo><bar>text<",
@stebulus
stebulus / holes.hs
Last active August 29, 2015 14:11
Example of static analysis with Applicatives: expression with named holes.
{-# LANGUAGE MultiParamTypeClasses, FunctionalDependencies,
FlexibleInstances, FlexibleContexts #-}
import Control.Applicative
import Control.Applicative.Lift
import Data.Functor.Compose
import Data.Functor.Constant
import Data.Maybe
import Data.Monoid
-- expr is an expression with named holes;
@stebulus
stebulus / text
Last active August 29, 2015 14:15 — forked from anonymous/text
The question was whether every σ-algebra which separates points
contains the singletons. Let's consider (σ-)algebras of clopen
sets of a topological space. (In fact, by Stone's theorem, there
is no loss of generality in doing so.) The desired conditions for a
counterexample then correspond to topological conditions on the space:
clopen sets separate points :: space is totally disconnected
singletons are not clopen :: no points are isolated
clopen sets form a σ-algebra :: G_δ sets are open
git init .
git remote add origin https://github.com/foo/bar
git config core.sparseCheckout true
echo sub/dir >> .git/info/sparse-checkout
git pull --depth 1 origin master # assuming you don't want history either
e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 ./.built
d6572bc52bd17e573ae0cba57540104d1a936dbcc5891ba6b1e2e2010f6baad4 ./bin/bash
c64b9beefe4b0c4c0933ca3d96e03eae41c48d28c14bb367330a603917d3905c ./bin/mount
0f70e9ab8bfe4b264ef9f2240f6d7bc688c64c084362954608cebb305f497be0 ./bin/umount
af2aa340acc8ed5bc7df17487a8176921d50eec88be9e87d0b1409c2156ca2bb ./boot/System.map
fafb409cc503345b05de3e4119c986df8c5756bc24d9b6f46327e11def4a1888 ./boot/grub/grub.cfg
dde989fbdd89e1a4cb97cd1d8f55a843492a2ef8b13ba869697a88fe627d665b ./boot/vmlinuz
3b24a975dcde688434258566813a83ce256a4c73efd7a8a9c3998327b0b4de68 ./etc/rpc
c4115a6976e2f1d9a99b323332e1877be2ab6d578281f91afa223062a9615f42 ./lib/modules/4.10.8/kernel/drivers/thermal/x86_pkg_temp_thermal.ko
3ee764781385f363306dbfc6d519742564d840a3d3e08dcc49f81b477a55d5f4 ./lib/modules/4.10.8/kernel/fs/efivarfs/efivarfs.ko
@stebulus
stebulus / getent.od
Created April 14, 2019 20:04
steven's egg from 7c63e6, od -c getent
0000000 177 E L F 002 001 001 \0 \0 \0 \0 \0 \0 \0 \0 \0
0000020 002 \0 > \0 001 \0 \0 \0 p % @ \0 \0 \0 \0 \0
0000040 @ \0 \0 \0 \0 \0 \0 \0 h \ 001 \0 \0 \0 \0 \0
0000060 \0 \0 \0 \0 @ \0 8 \0 \t \0 @ \0 & \0 % \0
0000100 006 \0 \0 \0 005 \0 \0 \0 @ \0 \0 \0 \0 \0 \0 \0
0000120 @ \0 @ \0 \0 \0 \0 \0 @ \0 @ \0 \0 \0 \0 \0
0000140 370 001 \0 \0 \0 \0 \0 \0 370 001 \0 \0 \0 \0 \0 \0
0000160 \b \0 \0 \0 \0 \0 \0 \0 003 \0 \0 \0 004 \0 \0 \0
0000200 8 002 \0 \0 \0 \0 \0 \0 8 002 @ \0 \0 \0 \0 \0
0000220 8 002 @ \0 \0 \0 \0 \0 034 \0 \0 \0 \0 \0 \0 \0
@stebulus
stebulus / getend.elf
Created April 14, 2019 20:06
readelf -a x/tree/usr/bin/getent
ELF Header:
Magic: 7f 45 4c 46 02 01 01 00 00 00 00 00 00 00 00 00
Class: ELF64
Data: 2's complement, little endian
Version: 1 (current)
OS/ABI: UNIX - System V
ABI Version: 0
Type: EXEC (Executable file)
Machine: Advanced Micro Devices X86-64
Version: 0x1
@stebulus
stebulus / installing
Created April 15, 2019 11:49
snippets from build.log
[DEBUG] ==> Executing: 'cp' '-v' 'bits/stdio_lim.h' '/home/steven/egg/x/cross-toolchain/x86_64-egg-linux-gnu/sysroot/usr/include/bits/stdio_lim.h'
[ALL ] 'bits/stdio_lim.h' -> '/home/steven/egg/x/cross-toolchain/x86_64-egg-linux-gnu/sysroot/usr/include/bits/stdio_lim.h'
[ALL ] Not over-writing existing bits/syscall.h
[EXTRA] Installing C library start files
[DEBUG] ==> Executing: 'mkdir' '-p' '/home/steven/egg/x/cross-toolchain/x86_64-egg-linux-gnu/sysroot/usr/lib'
[DEBUG] ==> Executing: 'make' '-j4' '-l' 'BUILD_CFLAGS=-O2 -g -I/home/steven/egg/tmp/cross-toolchain.QwiOO018/build/x86_64-egg-linux-gnu/buildtools/include ' 'BUILD_CPPFLAGS=' 'BUILD_LDFLAGS=-L/home/steven/egg/tmp/cross-toolchain.QwiOO018/build/x86_64-egg-linux-gnu/buildtools/lib ' 'csu/subdir_lib'
[ALL ] make[2]: Entering directory `/home/steven/egg/tmp/cross-toolchain.QwiOO018/build/x86_64-egg-linux-gnu/build/build-libc-startfiles/multilib'
@stebulus
stebulus / crtbegin
Created April 16, 2019 10:48
bzgrep crtbegin build.log.bz2
[FILE ] gcc-6.3.0/libgcc/config/i386/cygming-crtbegin.c
[FILE ] gcc-6.3.0/libgcc/config/ia64/crtbegin.S
[ALL ] /tmp/xxxxxx/build/x86_64-egg-linux-gnu/build/build-cc-gcc-core-pass-2/./gcc/xgcc -B/tmp/xxxxxx/build/x86_64-egg-linux-gnu/build/build-cc-gcc-core-pass-2/./gcc/ -B/tmp/xxxxxx/build/x86_64-egg-linux-gnu/buildtools/x86_64-egg-linux-gnu/bin/ -B/tmp/xxxxxx/build/x86_64-egg-linux-gnu/buildtools/x86_64-egg-linux-gnu/lib/ -isystem /tmp/xxxxxx/build/x86_64-egg-linux-gnu/buildtools/x86_64-egg-linux-gnu/include -isystem /tmp/xxxxxx/build/x86_64-egg-linux-gnu/buildtools/x86_64-egg-linux-gnu/sys-include -g -Os -O2 -DIN_GCC -DCROSS_DIRECTORY_STRUCTURE -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -isystem ./include -I. -I. -I../.././gcc -I/tmp/xxxxxx/build/src/gcc-6.3.0/libgcc -I/tmp/xxxxxx/build/src/gcc-6.3.0/libgcc/. -I/tmp/xxxxxx/build/src/gcc-6.3.0/libgcc/../gcc -I/tmp/xxxxxx/build/src/gcc-6.3.0/libgcc/../include -I/tmp/xxxx
@stebulus
stebulus / getent.elf
Created May 15, 2019 23:19
readelf -a x/tree/usr/bin/getent, egg-linux commit 8dc1b304da0450c1a6cbf59e868cc2420b7bd7b0, built on Ubuntu 14.04.5
ELF Header:
Magic: 7f 45 4c 46 02 01 01 00 00 00 00 00 00 00 00 00
Class: ELF64
Data: 2's complement, little endian
Version: 1 (current)
OS/ABI: UNIX - System V
ABI Version: 0
Type: EXEC (Executable file)
Machine: Advanced Micro Devices X86-64
Version: 0x1