I hereby claim:
- I am ekinhbayar on github.
- I am ekin (https://keybase.io/ekin) on keybase.
- I have a public key whose fingerprint is D914 5696 5899 81E2 3509 E155 7625 F1AC 8203 700E
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
PHP_FUNCTION(strrev) | |
{ | |
zend_string *str; | |
char *e, *p; | |
zend_string *n; | |
if (zend_parse_parameters(ZEND_NUM_ARGS(), "S", &str) == FAILURE) { | |
return; | |
} |
<?php declare(strict_types = 1); | |
namespace Room11\Jeeves\Plugins; | |
use Amp\Artax\Cookie\Cookie; | |
use Amp\Artax\Cookie\CookieJar; | |
use Amp\Artax\HttpClient; | |
use Amp\Artax\Request as HttpRequest; | |
use Amp\Artax\Response as HttpResponse; | |
use Amp\Artax\Uri; |
Note: This is more of a math problem than an algorithm, yet it's a nice, fun one to play with, so I'm going for it.
You have 100 doors in a row that are all initially closed. You make 100 passes by the doors.
The first time through, you visit every door and toggle the door (if the door is closed, you open it; if it is open, you close it). The second time you only visit every 2nd door (#2, #4, #6, ...). The third time, every 3rd door (#3, #6, #9, ...), etc, until you only visit the 100th door.
function getSeconds(string $time){ // $time is either 18:00 or "2 hours" | |
if(preg_match("/(2[0-3]|[01][0-9]):([0-5][0-9])/", $time)){ // ^ | |
$format = 'Y-m-d H:i:s'; | |
$now = new \DateTimeImmutable(); | |
$future = new \DateTimeImmutable(date($format, strtotime($time))); | |
$h = ( ($t = $future->format('H')) == '00') ? 24 : $t; | |
$f = ( ($z = $now->format('H')) == '00') ? 24 : $z; | |
$d = $h - $f; | |
return $d * 3600 ?? false; | |
} |
! ! | |
# # | |
$ $ | |
% NN JJ VB SYM | |
%... : | |
%CHG NN | |
& CC NNP SYM | |
( ( | |
) ) | |
* SYM , : |
from nltk.corpus import brown | |
for category in brown.categories(): | |
words = brown.tagged_words(categories=category) | |
text = '\n '.join('%s, %s' % word for word in words) | |
filename = category + '.txt' | |
with open(filename, 'w') as outfile: | |
outfile.write(text) |
!, . | |
!, .-HL | |
&, CC | |
&, CC-HL | |
&, CC-TL | |
&, NP-TL | |
'', '' | |
', ' | |
'13, CD | |
'20's, NNS |
from nltk.corpus import brown | |
for category in brown.categories(): | |
words = brown.tagged_words(categories=category) | |
text = '\n'.join('%s %s' % word for word in words) | |
filename = category + '.txt' | |
with open(filename, 'w') as outfile: | |
outfile.write(text) |
# This file is for unifying the coding style for different editors and IDEs | |
# editorconfig.org | |
root = true | |
[*.php] | |
charset = utf-8 | |
end_of_line = lf | |
insert_final_newline = true | |
trim_trailing_whitespace = true |