I tried to build Ceph with the Clang (3.4) compiler. The only issue preventing the build to finish was a "VLA of non-POD type" usage which I fixed here:
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 <vector> | |
#include <iterator> | |
#include <algorithm> | |
#include <fstream> | |
#include <functional> | |
#include "tbb/task_scheduler_init.h" | |
#include "tbb/blocked_range.h" |
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
#ifndef BLOCKING_QUEUE_H | |
#define BLOCKING_QUEUE_H | |
#include <list> | |
#include <mutex> | |
#include <condition_variable> | |
#include <iterator> | |
template <typename T> |
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 python2 | |
# -*- coding: utf-8 -*- | |
# I used this in order to insert the preimages into a local ceph cluster, | |
# started in my ceph dev directory via src/vstart.sh. Adapt paths if needed. | |
import sys, os | |
srcdir = '/home/daniel/cn-work/ceph-dev/src' | |
pool = 'collisions' |
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 python2 | |
# -*- coding: utf-8 -*- | |
import sys, json | |
from collections import defaultdict | |
from scipy.stats import chisquare | |
# usage: ceph pg dump_json | ./check_distribution.py | |
if __name__ == '__main__': |
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 <thread> | |
#include <utility> | |
#include <stdexcept> | |
// takes ownership of the thread | |
class scoped_thread { | |
public: | |
explicit scoped_thread(std::thread t_) : t(std::move(t_)) { | |
if(!t.joinable()) throw std::logic_error{"no thread"}; |
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 <atomic> | |
class spinlock_mutex { | |
public: | |
spinlock_mutex() : flag(ATOMIC_FLAG_INIT) {} | |
void lock() { while(flag.test_and_set(std::memory_order_acquire)); } | |
void unlock() { flag.clear(std::memory_order_release); } | |
private: |
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 hy | |
(import [operator [eq]] | |
[itertools [chain count]] | |
[functools [partial reduce]]) | |
(defn map-indexed [f coll] | |
(map f (count) coll)) |
- Blog https://daniel-j-h.github.io/post/gentle-introduction-postgis/
- PostGIS reference: http://postgis.net/docs/reference.html
- Postgres, esp. II.7 Queries http://www.postgresql.org/docs/9.4/interactive/index.html
- geojson.io: http://geojson.io/
- Mapbox: https://www.mapbox.com/
- CartoDB: http://cartodb.com/
OlderNewer