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
% You are a detective trying to solve a murder case. | |
% There are three suspects - Art, Burt, and Carl. | |
% They are also the only three witnesses. | |
% | |
% Here are their statements: | |
% | |
% Art: | |
% Burt was the victim's friend, but the victim and carl were deadly | |
% enemies. | |
% |
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
; The infamous FizzBuzz programming interview | |
; | |
; Youri Ackx | |
; assmbler=dasm | |
; | |
include "upstart.dasm" | |
processor 6502 | |
PRINT_PTR equ $10 ; Print string at address | |
COUNT_TO equ 100 ; How much of FizzBuzz |
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
#!/bin/bash | |
for lib in lib{gmp,mpfr,mpc}.la; do | |
echo $lib: $(if find /usr/lib* -name $lib| | |
grep -q $lib;then :;else echo not;fi) found | |
done | |
unset lib |
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
;********************************************* | |
; Boot1.asm | |
; - A Simple Bootloader | |
; | |
; Operating Systems Development Tutorial | |
;********************************************* | |
bits 16 ; we are in 16 bit real mode |
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
// Check Groovy intersect bug | |
def checkIntersectBug() { | |
def foo = [[1], [2], [3]] | |
def bar = [[2], [3], [4]] | |
if (foo.intersect(bar).size() != 2) { | |
println '''Warning! | |
The version of Groovy that you are running contains a bug on Collection.intersect(). | |
Upgrade to 2.4.7 or later. | |
See http://stackoverflow.com/questions/35493088/groovy-strange-collectionintersect-behaviour |
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
assert (1..63).sum() == 2016 | |
assert 666 + 666 + 666 + 6 + 6 + 6 == 2016 |
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
;----------------------------------------------; | |
; | |
; A minimal bootloader that prints a hello world | |
; then halts. | |
; | |
; nasm -f bin hello-boot.asm -o hello-boot.bin | |
; | |
; @YouriAckx | |
; | |
;----------------------------------------------; |
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
#!/usr/bin/env groovy | |
/* | |
* Remove nasty trailing spaces inserted by the naughty Hippo | |
* at the end of some .xml files. | |
*/ | |
@Grab('org.apache.commons:commons-lang3:3.3.1') | |
import org.apache.commons.lang3.StringUtils |
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
// Peano integers are represented by a linked | |
// list whose nodes contain no data | |
// (the nodes are the data). | |
// http://en.wikipedia.org/wiki/Peano_axioms | |
package main | |
import "fmt" | |
// Number is a pointer to a Number |
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
#!/usr/bin/env groovy | |
import static groovyx.gpars.GParsPool.withPool | |
import groovy.transform.* | |
import java.util.concurrent.* | |
@TypeChecked | |
class Philosopher { |