Because you can't get the docs.
Create a transliterator:
greek2latin = icu.Transliterator.createInstance('Greek-Latin')
def djb2 str | |
hash = 5381 | |
str.each_byte do |b| | |
hash = (((hash << 5) + hash) + b) % (2 ** 32) | |
end | |
hash | |
end | |
def djb2a str |
# remove sendmail from a FreeBSD system | |
echo 'sendmail_enable="NO"' >> /etc/rc.conf | |
chmod 0 /usr/libexec/sendmail/sendmail | |
chmod 0 /usr/sbin/sendmail | |
mv /usr/libexec/sendmail/sendmail /usr/libexec/sendmail/sendmail.bak | |
mv /usr/sbin/sendmail /usr/sbin/sendmail.bak | |
(deffn sxml->xml (sxml) | |
(with (tag (car sxml) attrs nil children nil) | |
(if (= (caadr sxml) '@) ; if we have attributes | |
(do (if (is-a? (car (cdadr sxml)) 'list) | |
(set attrs (cdadr sxml)) ; association list attribute mode | |
(set attrs (pairs (cdadr sxml)))) ; pair list attribute mode -- plan only | |
(set children (cddr sxml))) | |
(set children (cdr sxml))) ; else, if we don't have any attributes | |
#!/bin/sh | |
tr -Cd '][.,<>+-'|sed 's/\./putchar(*p);/g;s/,/*p=getchar();/g;s/[+-]/&&*p;/g;s/[<>]/&&p;/g;s/\[/while(*p){/g;y/]<>/}-+/;s/^/main(){int a[30000];int *p=a;/;s/$/}/'|cc -xc - |
; kind of a stupid implementation but with | |
(define-syntax define-macro | |
(er-macro-transformer | |
(lambda (exp rename compare) | |
(if (symbol? (cadr exp)) | |
(let ((name (cadr exp)) | |
(expndr (caddr exp)) | |
(-exp (gensym)) (-rename (gensym)) (-compare (gensym))) | |
`(define-syntax ,name |
import unicodedata as u | |
def itergraphemes(str): | |
def modifierp(char): return u.category(char)[0] == 'M' | |
start = 0 | |
for end, char in enumerate(str): | |
if not modifierp(char) and not start == end: | |
yield str[start:end] | |
start = end | |
yield str[start:] |
#include <stdlib.h> | |
unsigned long utf8_strlen(unsigned char *s) { | |
unsigned long len = 0; | |
s--; | |
while (*++s) { | |
len += !(*s >> 7) || (*s >> 6); | |
} | |
return len; | |
} |
diff -rNu mk.old/libbio/Make.Darwin-x86_64 mk.new/libbio/Make.Darwin-x86_64 | |
--- mk.old/libbio/Make.Darwin-x86_64 1970-01-01 01:00:00.000000000 +0100 | |
+++ mk.new/libbio/Make.Darwin-x86_64 2017-12-18 11:33:22.000000000 +0100 | |
@@ -0,0 +1,7 @@ | |
+CC=gcc | |
+CFLAGS+=-Wall -Wno-missing-braces -Wno-parentheses -Wno-switch -O2 -g -c -I. -I${PREFIX}/include | |
+O=o | |
+AR=ar | |
+ARFLAGS=rvc | |
+NAN=nan64.$O |
import os | |
import os.path | |
import fcntl | |
import ctypes | |
from ctypes.util import find_library | |
import re | |
libc = None | |
F_CLOSEM = None | |
strategy = None |