I use Ubuntu Mate instead of the usual Raspbian Jessie mainly because of the gcc version. ORB-SLAM2 requires C++11 support. Raspbian comes with gcc 4.9, which does not handle C++11 by default. That means you have to play around with some compiler flags in ORB-SLAM2's CMakeLists.txt to make it work. In contrast, Ubuntu Mate's gcc 5.4 handles C++11 naturally.
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
/** | |
Utility method to build a Boolean decision tree in the form of a compound | |
NSPredicate which can be used to perform a full-text search on a collection. | |
The resulting predicate will match only those objects which, for each search | |
term, have at least one keypath in the set of provided keypaths for which the | |
corresponding value matches the search term. The type of operator to perform | |
(prefix, contains, exact match) can be configured, as can diacritic-sensitivity | |
and case-sensitivity options. | |
@param searchString A space-delimited list of search terms |
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
#!/bin/bash | |
# Disallow undefined variables | |
set -u | |
default_gcc_version=4.2 | |
default_iphoneos_version=6.1 | |
default_macos_version=10.8.4 | |
GCC_VERSION="${GCC_VERSION:-$default_gcc_version}" |
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
#!/usr/bin/env python | |
# | |
# AccessDump.py | |
# A simple script to dump the contents of a Microsoft Access Database. | |
# It depends upon the mdbtools suite: | |
# http://sourceforge.net/projects/mdbtools/ | |
import sys, subprocess, os | |
DATABASE = sys.argv[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
#!/bin/bash | |
# Raspberry Pi ZRAM script | |
# Tuned for quad core, 1 GB RAM models | |
# put me in /etc/init.d/zram.sh and make me executable | |
# then run "sudo update-rc.d zram.sh defaults" | |
modprobe zram | |
echo 3 >/sys/devices/virtual/block/zram0/max_comp_streams | |
echo lz4 >/sys/devices/virtual/block/zram0/comp_algorithm |
Instructions tested with a Raspberry Pi 2 with an 8GB memory card. Probably also works fine on a Raspberry Pi 3.
Download the latest Raspbian Jessie Light
image. Earlier versions of Raspbian won't work.
Write it to a memory card using Etcher, put the memory card in the RPi and boot it up.
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
#!/bin/bash | |
# Inspired by: | |
# http://nialldonegan.me/2007/03/10/converting-microsoft-access-mdb-into-csv-or-mysql-in-linux/ | |
# http://cltb.ojuba.org/en/articles/mdb2sqlite.html | |
# Dave's Modifications: | |
# Line 25: Added code to remove COMMENT and SET statements. | |
# Lines 28 to 37: Added code to handle primary keys. | |
# Line 51: Added "postgres" to mdb-export command. |
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
#include <iostream> | |
#include <string> | |
#include <curl/curl.h> | |
static size_t WriteCallback(void *contents, size_t size, size_t nmemb, void *userp) | |
{ | |
((std::string*)userp)->append((char*)contents, size * nmemb); | |
return size * nmemb; | |
} |
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
Poco::JSON::Object obj; | |
obj.set("name", "blah"); | |
obj.set("language", "english"); | |
Poco::URI uri("http://the-uri-you-want-to-request-from"); | |
std::string path(uri.getPathAndQuery()); | |
if (path.empty()) path = "/"; | |
HTTPClientSession session(uri.getHost(), uri.getPort()); | |
HTTPRequest request(HTTPRequest::HTTP_POST, path, HTTPMessage::HTTP_1_1); |