misc stuff
C Shell APL TeX C++
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
apl
c++utils
gcc
latex
minecraft
rfkill
.gitignore
README.org

README.org

Misc Stuff

This is a collection of some scripts and snippets I wrote.

apl - contains some APL examples

trans.apl
simple rotation matrix
charcount.apl
reads a file foo.txt and prints a sorted character count
mastermind.apl
a quick game of mastermind in APL
roman.apl
Convert Arabic to Roman numbers. This problem was part (Problem 2) of the 2012 International APL Contest.

c++utils - contains some examples and utilities for C++

log2.c++
floor_log2 function to calculate $⌊ log_2(i) ⌋$.

gcc - a specs file improving -Wextra

Turns -Wextra into

-std=c++0x -pedantic-errors -Wall -Wextra -Weffc++ -Wlogical-op -Wdouble-promotion -Wmissing-declarations -Wsign-conversion -Wconversion -Wfloat-equal -Wredundant-decls -Winit-self -Woverloaded-virtual -Wnon-virtual-dtor -Wshadow -Wsign-promo -Wstrict-aliasing=1 -Wold-style-cast -Wcast-qual -Wcast-align

Usage

$ g++ -pipe -specs=/path/to/misc/gcc/warningspecs -Wextra -g3 foo.c++

See http://gcc.gnu.org/onlinedocs/gcc/Spec-Files.html#Spec-Files

latex - a latex template file

Includes all the useful packages.

Git Ignore file:

auto/*.el
*.aux
*.log
*.out
*.pdf
*.synctex.gz
*.bcf
*.run.xml

minecraft - Query minecraft server status

minecraft/minecraft.sh can be used to query the status of Minecraft servers (description, users online, maxium users). It is quite a hacky bash script and probably only works on Linux.

$ ./minecraft.sh someserver
someserver:25565: server description
3/10 players online
$ ./minecraft.sh -d ':' someserver
someserver:25565:server description:3:10

The -d option can be used to set a delimiter to make the output easier to parse. See the Minecraft Coalition Wiki for a specification of Minecraft’s server protocol.

rfkill - disable/enable radio transmission (wifi, bluetooth, etc.)

Rfkill is a Linux subsystem to disable/enable radio transmitters (wifi, bluetooth, etc.). rfkill.c is a small program to use this subsystem.

$ ./rfkill --block bt      # blocks bluetooth
$ ./rfkill --unblock bt    # unblocks bluetooth
$ ./rfkill --list          # list devices with rfkill support
id      type    state
0       bt      not blocked
1       wlan    not blocked