Skip to content

Instantly share code, notes, and snippets.

How to not screw up IC

From the perspective of somebody who actually did

These days have drained us all:

  • Show you've got traction.
  • Build your narrative.
  • Practice your pyramids!

The reality is that you need to expect the unexpected, so here are my three top tips to not screw up IC (because in hindsight, everything is simpler!).

@hannesl
hannesl / cantor_pairing.php
Created December 18, 2013 23:02
Cantor pairing functions in PHP. Pass any two positive integers and get a unique integer back. Feed the unique integer back into the reverse function and get the original integers back. Explanation and JS implementation here: http://stevegardner.net/2012/07/09/javascript-cantor-pairing-function-and-reverse-function/
<?php
/**
* Calculate a unique integer based on two integers (cantor pairing).
*/
function cantor_pair_calculate($x, $y) {
return (($x + $y) * ($x + $y + 1)) / 2 + $y;
}
/**