<?php
phpinfo();
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
/** | |
* Infix to postfix notation RegExp converter | |
* | |
* To implement RegExp machine (NFA, DFA) we need | |
* to transform first RegExp string to postfix notation | |
* for more convinient work with the stack. This function | |
* does exactly this. | |
* | |
* See: http://swtch.com/~rsc/regexp/regexp1.html | |
* |
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
int64_t ipow(int64_t base, uint8_t exp) { | |
static const uint8_t highest_bit_set[] = { | |
0, 1, 2, 2, 3, 3, 3, 3, | |
4, 4, 4, 4, 4, 4, 4, 4, | |
5, 5, 5, 5, 5, 5, 5, 5, | |
5, 5, 5, 5, 5, 5, 5, 5, | |
6, 6, 6, 6, 6, 6, 6, 6, | |
6, 6, 6, 6, 6, 6, 6, 6, | |
6, 6, 6, 6, 6, 6, 6, 6, | |
6, 6, 6, 6, 6, 6, 6, 255, // anything past 63 is a guaranteed overflow with base > 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
// A Fast, Compact Approximation of the Exponential Function | |
// http://www.schraudolph.org/pubs/Schraudolph99.pdf | |
inline double fast_exp(double y) { | |
double d; | |
*(reinterpret_cast<int*>(&d) + 0) = 0; | |
*(reinterpret_cast<int*>(&d) + 1) = static_cast<int>(1512775 * y + 1072632447); | |
return d; | |
} |
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
""" | |
Light weight head pose estimation with SolvePnP | |
Author: Yuanjun Xiong | |
""" | |
# parameters | |
fx = 1 | |
# model points |
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
""" | |
A minimal implementation of Monte Carlo tree search (MCTS) in Python 3 | |
Luke Harold Miles, July 2019, Public Domain Dedication | |
See also https://en.wikipedia.org/wiki/Monte_Carlo_tree_search | |
https://gist.github.com/qpwo/c538c6f73727e254fdc7fab81024f6e1 | |
""" | |
from abc import ABC, abstractmethod | |
from collections import defaultdict | |
import math |
-
Install the fonts on your computer:
git clone https://github.com/powerline/fonts.git cd fonts ./install.sh cd .. && rm -rf fonts
-
Then, open the settings (ctrl+p > "settings json" > enter) in vscode.
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 cv2 | |
import mediapipe as mp | |
import numpy as np | |
mp_face_mesh = mp.solutions.face_mesh | |
face_mesh = mp_face_mesh.FaceMesh(min_detection_confidence=0.5, min_tracking_confidence=0.5) | |
cap = cv2.VideoCapture(0) | |
while cap.isOpened(): | |
success, image = cap.read() |
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
# Copyright 2023 Holger Bruch (hb@mfdz.de) | |
# | |
# Licensed under the Apache License, Version 2.0 (the "License"); | |
# you may not use this file except in compliance with the License. | |
# You may obtain a copy of the License at | |
# | |
# https://www.apache.org/licenses/LICENSE-2.0 | |
# | |
# Unless required by applicable law or agreed to in writing, software | |
# distributed under the License is distributed on an "AS IS" BASIS, |
OlderNewer