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
Running dependency resolution... | |
All dependencies up to date | |
==> ejabberd | |
Compiling 114 files (.erl) | |
src/gen_iq_handler.erl:43: can't find include file "xmpp.hrl" | |
src/gen_iq_handler.erl:170: undefined macro 'NS_CLIENT' | |
src/gen_iq_handler.erl:137: function process_iq/5 undefined | |
src/gen_iq_handler.erl:149: record iq undefined | |
src/gen_iq_handler.erl:154: record iq undefined | |
src/gen_iq_handler.erl:157: variable 'El' is unbound |
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
-- https://en.wikipedia.org/wiki/Pisano_period | |
fibs :: [Integer] | |
fibs = 0 : 1 : zipWith (+) fibs (tail fibs) | |
pisanoPeriod :: Integer -> Int | |
pisanoPeriod m = length $ 0 : 1 : helper (drop 2 fibs) | |
where | |
helper (x:y:xs)= | |
if a == 0 && b == 1 |
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
0x61430646CBA3D2d784C30d5B0C11c12DAb1eb824 |
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
// from https://apple.stackexchange.com/questions/57039/how-make-safari-download-pdf-files-instead-of-opening-them-in-page | |
You can make Safari on the Mac download ANY files (mp3, mp4, jpg, pdf and more) by doing the following. | |
Open the file (movie,music,etc) in Safari. That normally comprises of clicking the link to the pdf/movie/music etc. | |
Click on the url of the browser (in this case it would end in ".../xyz.pdf". | |
Hold option down and press Return(or Enter). | |
The file you are viewing downloads to the Downloads folder on the mac. | |
I've tested this with almost all file types possible. Very very useful little feature that unfortunately too few people know about. |
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
import binascii | |
import codecs | |
def to_hex(s: str, pad_until_length: int = 0) -> str: | |
""" | |
Args: | |
s: the string to be converted to it's hex representation. | |
pad_until_length: if the length of the `s` argument is less than this argument, the string to be converted will be padded | |
with binary zeros to the right until it's length is equal to this argument. |
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
import os | |
here = os.path.dirname(os.path.abspath(__file__)) | |
def local_file(file): | |
return os.path.join(here, file) |