-
Add
pygments_global_config.rb
tomy-jekyll-project/_plugins/
. -
Add Pygments options to
_config.yml
markdown: redcarpet
-module(horr). | |
-export([malloc/0, free/1, read/1, write/2, test/0]). | |
% You can use `malloc` to get a globally sharable, mutable cell of memory. | |
% A difference to C's `malloc` is that such a cell doesn't have a certain size (you can't overflow) | |
% Memory is initialised with the atom `null`. | |
malloc() -> | |
spawn(fun() -> mem(null) end). | |
% As processes are not garbage collected, you have to call `free` when you're done with your memory: |
#!/usr/bin/env python3 | |
import sys | |
import socket | |
import select | |
def command(name, args=None): | |
return {'name': name, 'args': args} | |
def readcmd(): |
### | |
# Scheme code is translated to YARV byte code, then evaluated in the | |
# Ruby Virtual Machine | |
require 'rbconfig' | |
require 'dl' | |
require 'fiddle' | |
require 'strscan' | |
class RubyVM |
#!/bin/bash | |
# Bash script to run CQ daily maintenance operations, excluding TarPM Optimization and Tar Index Merge | |
# Author : Jayan Kandathil | |
# Version : 0.4 | |
# Last updated : May 24, 2013 | |
# Instructions : Copy to CQ's /bin folder, make necessary changes, enable the execute bit and run |
//Provide details around the bootdelgation state | |
println "Bootdelgation property value :- "+bundleContext.getProperty("org.osgi.framework.bootdelegation") | |
println "Felix bootdelgation entries" | |
bundleContext.bundle.framework.bootPackages.each { | |
println it | |
} |
EDIT! full code can be found here gist
So I played around with rust a bit now. And I thought I might share some random stuff.
So say you wanted to represent a expression tree with plus and minus nodes and a node for values. One way to do this would be to use rust's enum's.
In rust enums are like haskell's union types so you can specify the different values to be constructors carrying data.
#include <stdio.h> | |
void(*swap)() = (void(*)()) "\x8b\x44\x24\x04\x8b\x5c\x24\x08\x8b\x00\x8b\x1b\x31\xc3\x31\xd8\x31\xc3\x8b\x4c\x24\x04\x89\x01\x8b\x4c\x24\x08\x89\x19\xc3" | |
"Oh, there you are Mr. Insanity..."; | |
int main(){ // works on GCC 3+4 | |
int a = 37, b = 13; | |
swap(&a, &b); | |
printf("%d%d",a,b); | |
} |
The Challenge | |
------------- | |
Given the following riddle, write a regular expression describing all possible answers, | |
assuming you never make a move which simply undoes the last one you made. | |
The Riddle | |
---------- | |
You are on your way somewhere, taking with you your cabbage, goat, and wolf, as always. | |
You come upon a river and are compelled to cross it, but you can only carry one of the | |
three companions at a time. None of them can swim because this isn't THAT kind of riddle. |