(define list '((1 2) (3 4)))
(car list) ; -> '(1 2)
(car (cdr list)) ; -> '(3 4)
(cadr list) ; -> '(3 4)
(leaf 3) ; leaf-data
(node left_subtree right_subtree) ; node-data
[alias] | |
kosdast = git add . | |
co = checkout | |
br = branch | |
pu = push --tags | |
puff = push --force-with-lease | |
st = status --branch | |
ci = commit | |
ca = commit --amend | |
can = commit --amend --no-edit |
## Obtained from: https://aur.archlinux.org/packages/ccls-git | |
# Maintainer: Fangrui Song <i at maskray.me> | |
# Co-Maintainer: Shengyu Zhang <la@archlinuxcn.org> | |
pkgname=ccls-git | |
_pkgname=ccls | |
pkgver=20230115 | |
pkgrel=1 | |
pkgdesc='C/C++ language server supporting cross references, hierarchies, completion and semantic highlighting' |
#include <iostream> | |
#include <vector> | |
#include <memory> | |
using namespace std::literals; | |
class Base | |
{ | |
public: | |
virtual auto who() const -> std::string { return "Base"s; } |
#include <functional> | |
#include <iostream> | |
#include <memory> | |
#include <optional> | |
template <int T> | |
struct S { | |
int _[T]; | |
}; |
import telebot, asyncdispatch, logging, options, parsetoml, strformat, | |
httpclient, json | |
from strutils import strip, replace | |
var L = newConsoleLogger(fmtStr="$levelname, [$time] ") | |
addHandler(L) | |
var proxyURL{.threadvar}: string | |
#[ | |
The proxy should be an http one. If you have a socks based proxy, |
#include <algorithm> | |
#include <array> | |
#include <iostream> | |
#include <random> | |
#include <string_view> | |
const int LEN = 10; | |
using Indexer = int; |
#!/usr/bin/env python3 | |
# -*- coding: utf-8 -*- | |
class Table: | |
def __init__(self, table=None): | |
empty = [3 * [" "], 3 * [" "], 3 * [" "]] | |
self.table = table if table else empty | |
def __delitem__(self, key) -> None: | |
self.table.__delattr__(key) |
## | |
# Div by 10 in x64 | |
# | |
# @file | |
# @version 0.1 | |
.PHONY: default all run clean | |
default: a | |
all: default |
from scipy import spatial | |
import numpy as np | |
pos = np.c_[np.random.rand(100), np.random.rand(100)] | |
tree = spatial.cKDTree(pos) | |
dist, ids = tree.query(pos, 2) | |
print(f'min dist: {np.min(dist[:, 1]): 8f}') |