Hierarchical data metrics that allows fast read operations on tree like structures.
Based on Left and Right fields that are set during tree traversal. When entered into node value is set to it's Left, when exiting node value is set to it's Right.
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width"> | |
<title>Select2 with Bootstrap 4 theme</title> | |
</head> | |
<body> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.0.0/js/bootstrap.bundle.min.js"></script> |
############################################################### | |
# File: gps_continuous.py | |
# Description: Connect to a GPSD daemon and print the latest | |
# coordinate datapoints to the console. | |
# | |
# Author: Carlos Garcia-Saura (@CarlosGS) - 2018 | |
# Modified by: Author (email) - year | |
############################################################### | |
import gpsd |
############################################################### | |
# File: lightweight_camera_motion.py | |
# Description: Connect to an MJPG stream and compute the | |
# general direction of motion. | |
# The script first crops and downsamples the | |
# JPEG frames using the JPEGtran library, | |
# to allow processing in low power platforms | |
# like the Raspberry Pi. | |
# | |
# Author: Carlos Garcia-Saura (@CarlosGS) - 2018 |
# Fast reading from the raspberry camera with Python, Numpy, and OpenCV | |
# Allows to process grayscale video up to 124 FPS (tested in Raspberry Zero Wifi with V2.1 camera) | |
# | |
# Made by @CarlosGS in May 2017 | |
# Club de Robotica - Universidad Autonoma de Madrid | |
# http://crm.ii.uam.es/ | |
# License: Public Domain, attribution appreciated | |
import cv2 | |
import numpy as np |
#!/usr/bin/perl | |
# The user this runs as under the collectd exec plugin must | |
# have sudo to run contrack. | |
# | |
# Something like: | |
# | |
# my_user ALL = NOPASSWD: /usr/sbin/conntrack | |
# | |
# contrack must also be in the users path. Example collectd config: | |
# |
#!/bin/bash | |
# Fix for cron incorrect paths | |
HOME='/root' | |
# Sync database1 to database2 | |
SRC_DB='database1' | |
DST_DB='database2' | |
EXCLUDE_TABLES=(table1 table2) |
Hierarchical data metrics that allows fast read operations on tree like structures.
Based on Left and Right fields that are set during tree traversal. When entered into node value is set to it's Left, when exiting node value is set to it's Right.
<?php | |
class BinarySearchTree { | |
private $_root; | |
public function __construct() { | |
// setup sentinal node | |
$this->_root = new BinarySearchNode(null); | |
} | |
public function getRoot() { | |
return $this->hasNode() ? $this->_root->right : null; |
<?php | |
/* | |
* Mysql database class - only one connection alowed | |
*/ | |
class Database { | |
private $_connection; | |
private static $_instance; //The single instance | |
private $_host = "HOSTt"; | |
private $_username = "USERNAME"; | |
private $_password = "PASSWORd"; |