Map [1]
Operation | Time Complexity |
---|---|
Access | O(log n) |
Search | O(log n) |
Insertion | O(n) for <= 32 elements, O(log n) for > 32 elements [2] |
Deletion | O(n) for <= 32 elements, O(log n) for > 32 elements |
import argparse | |
import json | |
import os | |
import subprocess | |
ENCODING = "utf-8" | |
def check_output(cmd, split_lines=False): |
package main | |
import ( | |
"bufio" | |
"bytes" | |
"fmt" | |
"image" | |
"image/jpeg" | |
_ "image/png" | |
"io" |
package ciphers | |
import ( | |
"crypto/rand" | |
"crypto/rsa" | |
"crypto/sha512" | |
"crypto/x509" | |
"encoding/pem" | |
"log" | |
) |
I screwed up using git ("git checkout --" on the wrong file) and managed to delete the code I had just written... but it was still running in a process in a docker container. Here's how I got it back, using https://pypi.python.org/pypi/pyrasite/ and https://pypi.python.org/pypi/uncompyle6
apt-get update && apt-get install gdb
# Install https://github.com/rubencaro/cipher first | |
require Cipher.Helpers, as: H | |
defmodule Enc do | |
@random_key H.env(:keyphrase) |> Cipher.Digest.generate_key | |
def stream_encrypt(xml) do | |
{_, result} = | |
:crypto.stream_init(:rc4, @random_key) | |
|> :crypto.stream_encrypt(xml) |
#include <stdio.h> | |
#include <stdbool.h> | |
#include <string.h> | |
#define MAX_SIZE 100 | |
struct Stack{ | |
int top; | |
char arr[MAX_SIZE]; | |
} st; |
from pydub import AudioSegment | |
from matplotlib import pyplot as plot | |
from PIL import Image, ImageDraw | |
import numpy as np | |
import os | |
src = "./test.mp3" | |
audio = AudioSegment.from_file(src) | |
data = np.fromstring(audio._data, np.int16) |
import sqlalchemy as sa | |
import sqlparse | |
metadata = sa.MetaData() | |
tasks = sa.Table( | |
'tasks', metadata, | |
sa.Column('id', sa.Integer, primary_key=True), | |
sa.Column('bot', sa.String(255), nullable=False), | |
sa.Column('task', sa.String(255), nullable=False), |