Profile cover photo
Profile photo
Jeremy “Ibi-Wan” Kent
652 followers
652 followers
About
Posts

Post has attachment
thoughts?
https://gist.github.com/ibiwan/f9df9e6a2dbb1abaa036

Idea is "regular expression builder class for readability and maintainability"

I'm thinking this could be available in several languages, and even shore up some missing features (like named capture groups in js)
Add a comment...

so PHP just voted to put "scalar typehints" into PHP 7 -- function parameters can now be restricted to specified types.  previously this was available, but only for object/class types, not builtin scalars.  


now we can specify scalar types, but it allows /anything that can be coerced to/ the specified type... which in php, is almost every combination of scalar types


...oops
Add a comment...

Post has attachment
Think you’ve got what it takes to beat me in Real Racing 3?
Real Racing 3 - EA
Real Racing 3 - EA
firemonkeys.com.au
Add a comment...

Post has shared content

Post has attachment
anyone want a few hundred bucks to help these guys fix their mac build process?  a recent linux kernel update broke it and their mac guy is out long term http://www.planeshift.it/
Add a comment...

"There's nothing like tight keming to make a design look dean and modem."
Add a comment...

member element child node entity attribute property value field
Add a comment...

half-formed idea, want feedback:

Respect, Courtesy, Decorum —
Showing consideration for others, society, and yourself, respectively.
Add a comment...

y did I do that...

I just went through a "use the Y-Combinator to implement recursion to calculate factorial of 5" example from the Javascript Allongé book.  My observations are included:




function Y (f) {
  return ((function (x) {
    return f(function (v) {
      return x(x)(v);
    });
  })(function (x) {
    return f(function (v) {
      return x(x)(v);
    });
  }));
}

You use it like this:

 var factorial = Y(function (fac) {
   return function (n) {
     return (n == 0 ? 1 : n * fac(n - 1));
   }
 });
 
factorial(5)
//=> 120

// JEREMY'S NOTES AFTER RUNNING THROUGH THE PROCESS MANUALLY:
//
// Y creates a higher-order-function that takes itself and 'v' as (curried) parameters,
// using itself as the recursive call (passing itself on in the process)
// and 'v' as the parameters to the inner function
//
// pass the combinator a function whose parameter is to be used as the recursive call,
// and which returns a function with the actual recursive definition body
//
// finally, apply whatever mess all of this gives you to the parameter "5".
// then, magic.

function Y (f) {
  var a = function (x) {
    var b = function (v) {
      return x(x)(v);
    }
    return f(b);
  };
  return a(a);
}
fact = function (fac) {
   return function (n) {
     return (n == 0 ? 1 : n * fac(n - 1));
   }
}
var factorial = Y(fact);
 

factorial(5)

Y(fact)(5)

var a = function (x) {
    var b = function (v) {
      return x(x)(v);
    }
    return fact(b);
}
a(a)(5)

function (x) {
    var b = function (v) {
      return x(x)(v);
    }
    return fact(b);
}
(a)
(5)

function (x) {
    var b = function (v) {
      return a(a)(v);
    }
    return fact(b);
}
(5)

fact(a(a))(5)

function (n) {
    return (n == 0 ? 1 : n * a(a)(n - 1));
}
(5)

(5 == 0 ? 1 : 5 * a(a)(5 - 1))

5 * a(a)(5 - 1)

5 * a(a)(4)

5 *
function (x) {
    var b = function (v) {
      return x(x)(v);
    }
    return fact(b);
}
(a)
(4)

5 *
function (x) {
    var b = function (v) {
      return a(a)(v);
    }
    return fact(b);
}
(4)

5 * fact(a(a))(4)

5 *
function (n) {
    return (n == 0 ? 1 : n * a(a)(n - 1));
}
(4)

5 * (4 == 0 ? 1 : 4 * a(a)(4 - 1))

5 * 4 * a(a)(4 - 1)

5 * 4 * a(a)(3)

5 * 4 *
function (x) {
    var b = function (v) {
      return x(x)(v);
    }
    return fact(b);
}
(a)
(3)

5 * 4 *
function (x) {
    var b = function (v) {
      return a(a)(v);
    }
    return fact(b);
}
(3)

5 * 4 * fact(a(a))(3)

5 * 4 *
function (n) {
    return (n == 0 ? 1 : n * a(a)(n - 1));
}
(3)

5 * 4 * (3 == 0 ? 1 : 3 * a(a)(3 - 1))

5 * 4 * 3 * a(a)(3 - 1)

5 * 4 * 3 * a(a)(2)

5 * 4 * 3 *
function (x) {
    var b = function (v) {
      return x(x)(v);
    }
    return fact(b);
}
(a)
(2)

5 * 4 * 3 *
function (x) {
    var b = function (v) {
      return a(a)(v);
    }
    return fact(b);
}
(2)

5 * 4 * 3 * fact(a(a))(2)

5 * 4 * 3 *
function (n) {
    return (n == 0 ? 1 : n * a(a)(n - 1));
}
(2)

5 * 4 * 3 * (2 == 0 ? 1 : 2 * a(a)(2 - 1))

5 * 4 * 3 * 2 * a(a)(2 - 1)

5 * 4 * 3 * 2 * a(a)(1)

5 * 4 * 3 * 2 *
function (x) {
    var b = function (v) {
      return x(x)(v);
    }
    return fact(b);
}
(a)
(1)

5 * 4 * 3 * 2 *
function (x) {
    var b = function (v) {
      return a(a)(v);
    }
    return fact(b);
}
(1)

5 * 4 * 3 * 2 * fact(a(a))(1)

5 * 4 * 3 * 2 *
function (n) {
    return (n == 0 ? 1 : n * a(a)(n - 1));
}
(1)

5 * 4 * 3 * 2 * (1 == 0 ? 1 : 1 * a(a)(1 - 1))

5 * 4 * 3 * 2 * 1 * a(a)(1 - 1)

5 * 4 * 3 * 2 * 1 * a(a)(0)

5 * 4 * 3 * 2 * 1 *
function (x) {
    var b = function (v) {
      return x(x)(v);
    }
    return fact(b);
}
(a)
(0)

5 * 4 * 3 * 2 * 1 *
function (x) {
    var b = function (v) {
      return a(a)(v);
    }
    return fact(b);
}
(0)

5 * 4 * 3 * 2 * 1 * fact(a(a))(0)

5 * 4 * 3 * 2 * 1 *
function (n) {
    return (n == 0 ? 1 : n * a(a)(n - 1));
}
(0)

5 * 4 * 3 * 2 * 1 * (0 == 0 ? 1 : 0 * a(a)(0 - 1))

5 * 4 * 3 * 2 * 1 * 1

20 * 3 * 2 * 1 * 1

60 * 2 * 1 * 1

120 * 1 * 1

120 * 1

120
Add a comment...

Add a comment...
Wait while more posts are being loaded