This file contains hidden or 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
#!/usr/bin/env python3 | |
from typing import List, Tuple | |
LEFT_RIGHT_DIRECTIONS = tuple(range(-1, 2)) | |
CENTRAL_DIRECTIONS = tuple(i for i in range(-1, 2) if i != 0) | |
with open("input.txt", "r") as f: | |
matrix = [line.strip() for line in f] |
This file contains hidden or 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
#!/usr/bin/env php | |
<?php | |
$jobs = new \SplQueue(); | |
$workers = (int) `nproc`; | |
for ($i = 0; $i < 5 * $workers; ++$i) { | |
$jobs->enqueue(rand(100, 500)); | |
} | |
This file contains hidden or 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
module.exports = (function () { | |
var prev = function (x) { | |
return x & (x - 1); | |
}, next = function (x) { | |
return (x | (x - 1)) + 1; | |
}, Summator = function (length) { | |
if (1 > length) { | |
throw { | |
message: 'Length is too small', | |
}; |
This file contains hidden or 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 | |
namespace Acme\DemoBundle\DependencyInjection\Compiler; | |
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface; | |
use Symfony\Component\DependencyInjection\ContainerBuilder; | |
use Symfony\Component\DependencyInjection\Reference; | |
class DoctrineEntityListenerPass implements CompilerPassInterface | |
{ |
NewerOlder