Skip to content

Instantly share code, notes, and snippets.

import sqlite3
from collections import deque
import time
import vk_api
TOKEN = '...'
START_ID = ...
conn = sqlite3.connect("people.sqlite")
cursor = conn.cursor()
@KivApple
KivApple / openh264-android-build.sh
Last active September 28, 2023 15:19
Script to build OpenH264 library for Android NDK under Linux (requires Android NDK, curl, unzip)
#!/bin/sh
export NDK=~/Apps/AndroidSDK/ndk-bundle # Change me
export JNILIBS_DIR=../../app/src/main/jniLibs # Change me
export INCLUDE_DIR=../../app/src/main/cpp/libopenh264 # Change me
export DOWNLOAD_URL=https://github.com/cisco/openh264/archive/master.zip
mkdir -p tmp
ln -sf $NDK/prebuilt/linux-x86_64/bin/yasm tmp/nasm
export PATH=$(pwd)/tmp:$PATH
@KivApple
KivApple / BigInteger.kt
Created January 3, 2018 10:50
BigInteger pure Kotlin implementation
package com.eternal_search.bignum
import kotlin.math.max
class BigInteger(private val sign: Int, private val digits: IntArray, private var digitCount: Int,
private var digitsOffset: Int = 0): Number(), Comparable<BigInteger> {
override fun toLong(): Long {
var result = 0L
for (i in digitCount - 1 downTo 0) {
result = result shl INTERNAL_DIGIT_WIDTH
@KivApple
KivApple / numbers.js
Created August 17, 2017 06:53
JavaScript: BigNumber
export class BigNumber {
static INTERNAL_RADIX = 16777216;
static DEFAULT_REAL_PRECISION = 4;
constructor(value, dotPos, sign) {
if (value === undefined) {
value = 0;
}
if (Array.isArray(value)) {
typedef struct RadioChannel {
size_t curRxPacketChunkCount;
RadioChannelPacket *curRxPacket;
mailbox_t rxMailbox;
msg_t rxMailboxBuffer[RADIO_CHANNEL_MAILBOX_SIZE];
mailbox_t txMailbox;
msg_t txMailboxBuffer[RADIO_CHANNEL_MAILBOX_SIZE];
} RadioChannel;
typedef struct RadioChannelChunk {