Skip to content

Instantly share code, notes, and snippets.

@ajrouvoet
ajrouvoet / -
Created January 16, 2014 11:07
pageno = int( request.GET.get( 'page' )) - 1
page = pbatches[ PBATCH_PAGE_SIZE*pageno : PBATCH_PAGE_SIZE*(pageno+1) ]
has_next = len( pbatches ) >= PBATCH_PAGE_SIZE*(pageno+1)
has_prev= pageno > 0
@ajrouvoet
ajrouvoet / -
Created February 2, 2014 23:28
autoload colors && colors
# history settings
export HISTSIZE=10000
export HISTFILE="$HOME/.history"
export SAVEHIST=$HISTSIZE
setopt hist_ignore_all_dups
setopt inc_append_history
setopt share_history
@ajrouvoet
ajrouvoet / -
Created February 2, 2014 23:28
autoload colors && colors
# history settings
export HISTSIZE=10000
export HISTFILE="$HOME/.history"
export SAVEHIST=$HISTSIZE
setopt hist_ignore_all_dups
setopt inc_append_history
setopt share_history
Bitcoin Redlist Attack
======================
Consider the following scenario:
Miners are split in two groups: A and B.
A has adopted redlist Ra, whereas B has adopted redlist Rb.
Let A be the strongest group, meaning that if A and B chase each-other for the longest chain, A will
win.
using System;
using System.Collections.Generic;
namespace System.Reactive
{
public static class Observable
{
/// <summary>
/// Creates an observable sequence object from the specified subscription function.
/// </summary>
using System;
using System.Collections.Generic;
namespace System.Reactive
{
public static class Observable
{
/// <summary>
/// Creates an observable sequence object from the specified subscription function.
/// </summary>
using System;
using System.Collections.Generic;
namespace System.Reactive
{
public static class Observable
{
/// <summary>
/// Creates an observable sequence object from the specified subscription function.
/// </summary>
---
title: Assignment 6
author:
- Arjen Rouvoet
---
## 1: Weighted Max-SAT
It's trivial to perform this parallel to the proof in the book.
Let $Z_i$ be a random variable indicating whether clause $i$ is satisfied ($Z_i$ is $1$ if $i$ is
@ajrouvoet
ajrouvoet / Minesweeper.scala
Last active August 29, 2015 14:03
Minesweeper board init
import scala.util.Random
object Main {
type Board = List[List[Int]]
def main(argv: Array[String]) = {
val size: (Int, Int) = (80, 80)
val bombs = 250
##
## Put me in ~/.irssi/scripts, and then execute the following in irssi:
##
## /load perl
## /script load notify
##
use strict;
use Irssi;
use vars qw($VERSION %IRSSI);