This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var ca = (function(rule, grid_size) { | |
var radius = 5; | |
var ruleset = _.map(_.range(1 << radius), function(i) { return (rule >> i) & 1; }); | |
var grid = _.times(grid_size, _.random.bind(_, 0, 1)); | |
for(var i=0; i<10; i++) { | |
grid = _.map( | |
_.zip.apply(_, _.map(_.range(-Math.floor(radius/2), Math.floor(radius/2)), _.partial(_.arr.rotate, grid, _))), | |
function(m) { return ruleset[_.foldl(m, function(a, b, i) { return a + (b * (1 << i)); })]; } | |
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require_once('imlcaptcha/IMLCaptchaReader.php'); | |
$captcha = new IMLCaptchaReader(); | |
$errors = array(); | |
$success = False; | |
if(isset($_POST['submit'])) { | |
$captcha->validate($_POST['imlclookup'], $_POST['imlcinput']); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if(!$captcha->checkSuccess()) //The verification failed |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$captcha->validate($_POST['imlclookup'], $_POST['imlcinput']); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<form name="contact" action="" method="post"> | |
<label for="name">Name</label> | |
<input type="text" name="name" id="name" /> | |
<br/> | |
<label for="email">Email Address</label> | |
<input type="text" name="email" id="email" class="email" /> | |
<br/> | |
<label for="message">Message</label> | |
<textarea name="message" id="message" rows="8" cols="40"></textarea> | |
<br/> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?=$captcha?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<!-- IE Fix for HTML5 Tags --> | |
<!--[if lt IE 9]> | |
<script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script> | |
<![endif]--> | |
<link rel="stylesheet" media="screen" href="imlcaptcha/default.css" /> | |
</head> | |
<body> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class IMLCaptchaReader { | |
private $appid = "0"; //change this line | |
private $appid = "97063e821b852033ad9f4d3effc10e1c"; //to the equivalent of this |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require_once('imlcaptcha/IMLCaptchaReader.php'); | |
$captcha = new IMLCaptchaReader(); | |
?> |