This file contains 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
;;; Known issues: | |
;;; | |
;;; - Weird results for windows with custom decorations such as | |
;;; Chrome, or programs with a Ribbon interface. | |
;;; - Emacs will be maximized behind instead of in front of | |
;;; the taskbar. Workaround: WinHide ahk_class Shell_TrayWnd | |
global id2undoer := Object() | |
#SingleInstance force |
This file contains 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
For several types of locks, the best known means of bypassing them is by by picking. | |
For many locks, including pin-tumbler, wafer-tumber, disc-tumbler, and tubular lock, picking requires not just a pick to fiddle with the innards of the lock, but also a tensioner to keep the fiddled-with components in the position that the person picking the lock has moved them to. | |
This idea is to make a lock which cannot be tensioned, which in turn means that it cannot be picked. | |
Here's how it works: | |
The lock plug, the part of the lock which the user puts the key into, and which would normally be rotated by turning the key, and which is normally connected to the latch or deadbolt, is instead welded/bolted/splined to the housing / lock body, and is not connected to the latch or deadbolt. Naturally, it is unable to be turned. |
This file contains 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
This is an idea for a memory allocator which whose purpose is to make it much faster to save and load lots of pieces of data. | |
The fucntions of the library would be named persistant_malloc, persistant_free, persistant_realloc, persistant_calloc, persistant_pointer2integer, persistant_integer2pointer, all of which take a first argument which has a handle which contains all of the data tables typical of a malloc library. There would also be something like persistant_malloc_fopen, persistant_malloc_fsave, persistant_malloc_fclose, for creating the handle, storing it's contents to disk, and freeing the handle. | |
None of the three allocation functions will use sbrk to allocate memory, nor do they use mmap with MAP_ANONYMOUS to ask the OS to give them new blank pages; instead, they lengthen a certain disk file, and then mmap the region from the file's former end to it's new end, with the flags MAP_SHARED, and PROT_READ | PROT_READ. | |
The pointer2integer function gets a handle and a pointer; the pointer must have bee |
This file contains 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
#include <iostream> | |
#include <deque> | |
// This code requires -std=c++11 or better because lambda. | |
int main() { | |
std::deque<unsigned> primes; | |
std::deque< std::deque<unsigned> > factors( 3 ); | |
unsigned a_prime = 3, a_square_prime = 9, maybe_prime = 3; | |
std::cout << "2 3"; |
This file contains 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
#!perl | |
package AutoNick; | |
use strict; | |
use warnings; | |
use HexChat qw,:all,; | |
# Change this to a true value to see some debug output. | |
use constant DEBUGGING => 0; |
This file contains 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
use nqp; | |
module NativeCall { | |
use NativeCall::Types; | |
use NativeCall::Compiler::GNU; | |
use NativeCall::Compiler::MSVC; | |
#'{ | |
my package EXPORT::DEFAULT { |
This file contains 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
#include "Perl6.h" | |
#include <moar.h> | |
#define HEXCHAT_PLUGIN_HANDLE (perl6hc_ph) | |
#include "hexchat-plugin.h" | |
#define PNAME "Perl6" | |
#define PDESC "Perl 6 scripting interface" | |
#define VERSION "0.1" |
This file contains 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
sub ben_sort { | |
return unless @_ > 1; | |
while( 1 ) { | |
my $prior = shift; | |
my @sublists = ([$prior]); | |
my $sublist_ix = 0; | |
for my $item (splice @_) { | |
my $cmp = $item <=> $prior; | |
$sublist_ix += $cmp; | |
if( $sublist_ix < 0 ) { |
This file contains 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
use v6; | |
sub ack(Int $m is copy, Int $n is copy) { | |
my @stack; | |
loop { | |
if $m > 3 { | |
--$m; | |
push @stack, ($m xx $n).Slip; | |
--$m; | |
push @stack, (3 .. $m).reverse.Slip; | |
$n = 13; |
This file contains 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 https://docs.perl6.org/routine/trusts.html | |
class B {...}; | |
class A { | |
trusts B; | |
has $!foo; | |
method !foo { return-rw $!foo } | |
method perl { "A.new(foo => $!foo)" } | |
}; | |
class B { | |
has A $.a .= new; |
NewerOlder