I hereby claim:
- I am kokx on github.
- I am kokx (https://keybase.io/kokx) on keybase.
- I have a public key ASBqJFX5rR_o2KNCUAFDcepTyziSljiI0Zzllu3hqwvwQQo
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
install: | |
- ./texlive-install.sh | |
- export PATH="$PATH:$HOME/texlive/bin/x86_64-linux" | |
- tlmgr install wrapfig | |
script: | |
- pdflatex file.tex |
#define replace_cost(s,t) 1 | |
#define insert_cost(s) 1 | |
#define delete_cost(s) 1 | |
// String mag ook een vector van iets zijn wat te comparen is | |
int levenshtein(string s, string t) | |
{ | |
int sl = s.length(); | |
int tl = t.length(); | |
// init DP table |
Disclaimer: I have no idea if this are indeed the correct answers. I just solved the exercises like this. I think that they are right though.
I have added my own code to this gist. It is ugly as hell, just like you can expect from code created in a contest like this.
Difficulty: easy
It is simple to see that a greedy solution is good enough.
<?php | |
namespace User\Form; | |
use Zend\Form\Form, | |
Zend\Form\Element; | |
class Register extends Form | |
{ |
<?php | |
return array( | |
'routes' => array( | |
'user-register' => array( | |
'type' => 'Literal', | |
'route' => '/user/register', | |
'defaults' => array( | |
'controller' => 'User\Index', | |
'action' => 'register' | |
) |
<?php | |
/** | |
* @pre count($a) == count($b) | |
* @post \forall ( $x \in \N : \ret[$x] == $a[$x] + $b[$x] ) | |
*/ | |
function add(array $a, array $b) | |
{ | |
$c = array(); | |
for ($i = 0; $i < count($a); $i++) { |
<?php | |
// you simply call this with Singleton::getInstance() | |
class Singleton | |
{ | |
private static $instance; | |
private function __construct() | |
{} |
\item $n^{-1}$ | |
\item $16 = 2^{\log 16}$ | |
\item $\log \sqrt{n}$ | |
\item $\log n^3$ | |
\item $n$ | |
\item $n + \log n^4$ | |
\item $n^{\log 4} \ (= n^2)$ | |
\item $n^2 \log n$ | |
\item $4^{\log n}$ |
#!/usr/bin/php | |
<?php | |
function genChildName($min = 4, $max = 11, $consonants = 'aoiue', $noncons = 'qwrtpsdfghjklzxcvwnmy') | |
{ | |
$len = rand($min, $max); | |
$name = ''; | |
for ($i = 0; $i < $len; $i++) { |