Skip to content

Instantly share code, notes, and snippets.

diff --git a/third_party/gloo/gloo/transport/tcp/device.cc b/third_party/gloo/gloo/transport/tcp/device.cc
index e56c2ad372ef..76caa79c5a8c 100644
--- a/third_party/gloo/gloo/transport/tcp/device.cc
+++ b/third_party/gloo/gloo/transport/tcp/device.cc
@@ -8,6 +8,7 @@
#include "gloo/transport/tcp/device.h"
+#include <array>
#include <ifaddrs.h>
@nicolov
nicolov / README.md
Last active March 7, 2019 19:01
Bazel to CMake for CLion integration

Bazel to CMake for CLion

This script generates a skeleton CMakeLists.txt from a Bazel project. The resulting file can be loaded as a project in CLion (build/test features won't work).

Use like:

./bazel_to_cmake.py //tensorflow:libtensorflow_cc.so
/vendor
/github-scraper
/.idea
@nicolov
nicolov / aria2patch.diff
Created November 1, 2017 05:27
aria2 patches
diff --git a/src/DownloadCommand.cc b/src/DownloadCommand.cc
index 91042ef1..f777dec0 100644
--- a/src/DownloadCommand.cc
+++ b/src/DownloadCommand.cc
@@ -306,7 +306,7 @@ void DownloadCommand::checkLowestDownloadSpeed() const
startupIdleTime_) {
int nowSpeed = peerStat_->calculateDownloadSpeed();
if (nowSpeed <= lowestDownloadSpeedLimit_) {
- throw DL_ABORT_EX2(fmt(EX_TOO_SLOW_DOWNLOAD_SPEED, nowSpeed,
+ throw DL_RETRY_EX2(fmt(EX_TOO_SLOW_DOWNLOAD_SPEED, nowSpeed,
@nicolov
nicolov / .gitignore
Last active January 24, 2024 19:37
Car speed estimation from a windshield camera
*.pyc
*.tar.gz
*.mp4
@nicolov
nicolov / tilt_torsion.py
Created August 9, 2016 16:58
Tilt-torsion decomposition for rotation matrices
import numpy as np
from tf.transformations import *
def tilt_torsion_decomposition(R):
z_axis = [0, 0, 1]
target_z = np.dot(R.T, z_axis)
axis = np.cross(z_axis, target_z)
angle = np.arctan2(np.linalg.norm(axis), np.dot(z_axis, target_z))
R_tilt = quaternion_matrix(quaternion_about_axis(angle, axis))[:3, :3]
R_torsion = np.dot(R, R_tilt.T)
@nicolov
nicolov / telecom_italia_sip.sh
Created July 10, 2016 11:05
Get SIP credentials for Telecom Italia softphone
#!/usr/bin/env bash
# Thanks http://superuser.com/questions/218340/
MAC_ADDR=00-60-2F`dd bs=1 count=3 if=/dev/random 2>/dev/null |hexdump -v -e '/1 "-%02X"'`
PHONE_NUMBER="12345678"
# Thanks http://www.giorgioravera.it/?p=169
curl -k \
-u 8Z6PlbuD6VFR8KLr:admin \
--data "Action=GetConfig&ClientID=$MAC_ADDR&Cli=$PHONE_NUMBER" \
@nicolov
nicolov / Vagrantfile
Created June 5, 2016 16:39
Vagrant configuration for Ubuntu 16.04 + Ros Kinetic
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure(2) do |config|
config.vm.box = "nicolov/xenial-ros"
# Create a forwarded port mapping which allows access to a specific port
# within the machine from a port on the host machine. In the example below,
# accessing "localhost:8080" will access port 80 on the guest machine.
# config.vm.network "forwarded_port", guest: 80, host: 8080
@nicolov
nicolov / Cargo.toml
Last active December 30, 2020 12:20
Rust API with Mysql
[package]
name = "api_example"
version = "0.1.0"
authors = ["nicolov"]
[dependencies]
iron = "*"
router = "*"
mysql = "*"
r2d2 = "*"
@nicolov
nicolov / launch_file.launch
Last active December 17, 2015 03:49
Convert SFly UAV datasets to a ROS bag
<!--
Some packages do not handle compressed images correctly. We use the image_transport
package to republished the JPEGs stored in the bags as Image messages. This is an
example launch file that does just that.
-->
<launch>
<node name="bag_play" pkg="rosbag" type="play"
args="--clock /home/ubuntu/hoveringDown.bag">
</node>