Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View avanwieringen's full-sized avatar

avanwieringen

View GitHub Profile
@avanwieringen
avanwieringen / Vagrantfile
Created January 9, 2013 09:53
APC and XDebug not installing using Chef and Vagrant
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant::Config.run do |config|
config.vm.box = "precise32"
config.vm.network :hostonly, "33.33.33.10"
config.vm.network :bridged
config.vm.forward_port 80, 8080
config.vm.share_folder "web-app", "/web-app", "web-app"
@avanwieringen
avanwieringen / build.xml
Created November 23, 2012 10:45
Custom Ant DataType errors
<project name="datatypetest">
<path id="classpath">
<fileset dir="lib">
<include name="**/*.jar" />
</fileset>
<pathelement location="cls" />
</path>
<target name="compile">
@avanwieringen
avanwieringen / opdracht
Created April 19, 2012 19:05
Speurtocht
'##::::::::::'###:::::::'###::::'########::'######::'########:'########:::::'######::'########::::'###::::'########:::'##:::::::::::::::::::: ##:::::::::'## ##:::::'## ##:::... ##..::'##... ##:... ##..:: ##.....:::::'##... ##:... ##..::::'## ##::: ##.... ##:'####::::::::::::::::::: ##::::::::'##:. ##:::'##:. ##::::: ##:::: ##:::..::::: ##:::: ##:::::::::: ##:::..::::: ##:::::'##:. ##:: ##:::: ##:. ##:::::::::::::::::::: ##:::::::'##:::. ##:'##:::. ##:::: ##::::. ######::::: ##:::: ######::::::. ######::::: ##::::'##:::. ##: ########:::..::::::::::::::::::::: ##::::::: #########: #########:::: ##:::::..... ##:::: ##:::: ##...::::::::..... ##:::: ##:::: #########: ##.....::::'##:::::::::::::::::::: ##::::::: ##.... ##: ##.... ##:::: ##::::'##::: ##:::: ##:::: ##::::::::::'##::: ##:::: ##:::: ##.... ##: ##::::::::'####::::::::::::::::::: ########: ##:::: ##: ##:::: ##:::: ##::::. ######::::: ##:::: ########::::. ######::::: ##:::: ##:::: ##: ##::::::::. ##:::::::::::::::::::: ........::..:::::..::..:::::..:::::.
@avanwieringen
avanwieringen / base2base.m
Created April 18, 2012 11:33
Matlab convert numbers between different bases
function [ b ] = base2base( a, base_from, base_to )
M = base2dec(a, base_from);
n = floor(log10(M) / log10(base_to));
b = zeros(1, n+1);
for i = 0:n;
b(n + 1 - i) = mod(floor(M / (base_to^i)), base_to);
end
end
@avanwieringen
avanwieringen / combinations.java
Created October 28, 2011 14:32
Combinations in Java
package nl.falcon108;
import java.util.ArrayList;
import java.util.List;
public class Collections {
/**
* Creates 2-dimensional ArrayList from a List with all the combinations of length k
* @param collection
@avanwieringen
avanwieringen / combinations.m
Created October 27, 2011 12:17
Combinations
function [ comb ] = combinations( set, length )
comb = [];
for i=1:(size(set,2) - length + 1)
if(length > 1)
chcombs = combinations(set(i+1:end), length - 1);
for i_c=1:size(chcombs, 1)
comb(end + 1,:) = [set(i) chcombs(i_c,:)];
end
else
@avanwieringen
avanwieringen / symfony2-form-crud
Created June 19, 2011 14:05
Symfony2 Form Component + Doctrine2 CRUD problems
<?php
namespace Ingenii\HomeBudgetBundle\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;
class DashboardController extends Controller
{