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/sh | |
# | |
# boost.sh | |
# | |
# MIT License | |
# | |
# Copyright (C) 2015 Shota Matsuda | |
# | |
# Permission is hereby granted, free of charge, to any person obtaining a | |
# copy of this software and associated documentation files (the "Software"), |
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
takram::Line2d clip(const boost::polygon::voronoi_diagram<double>::edge_type& edge) { | |
const auto& cell1 = *edge.cell(); | |
const auto& cell2 = *edge.twin()->cell(); | |
takram::Vec2d origin, direction; | |
if (cell1.contains_point() && cell2.contains_point()) { | |
assert(cell1.source_category() == SOURCE_CATEGORY_SINGLE_POINT && | |
cell2.source_category() == SOURCE_CATEGORY_SINGLE_POINT); | |
const auto& p1 = points_.at(cell1.source_index()); | |
const auto& p2 = points_.at(cell2.source_index()); | |
origin.x = (p1.x + p2.x) / 2.0; |
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
readonly DEPOT_TOOLS_GIT='https://chromium.googlesource.com/chromium/tools/depot_tools.git' | |
readonly SKIA_GIT='https://skia.googlesource.com/skia.git' | |
readonly PROJECT_DIR="$(cd "$(dirname "$0")/../"; pwd)" | |
readonly BUILD_DIR="${PROJECT_DIR}/build" | |
readonly DEPOT_TOOLS_DIR="${BUILD_DIR}/depot_tools" | |
readonly SKIA_DIR="${BUILD_DIR}/skia" | |
download_depot_tools() { | |
echo 'Downloading depot tools...' |
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 <cassert> | |
#include <condition_variable> | |
#include <cstddef> | |
#include <mutex> | |
#include <string> | |
#include "boost/threadpool.hpp" | |
void NameThisThread(const std::string& name); |
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
readonly DESTINATION_DIR="@executable_path/../Frameworks" | |
follow_symlink() { | |
local file=$1 | |
local target | |
target=$(readlink "${file}") | |
if [[ "${target}" ]]; then | |
local directory | |
directory=$(dirname "${file}") | |
file=$(follow_symlink "${directory}/${target}") |
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
// | |
// sgss/singleton_holder.h | |
// | |
// MIT License | |
// | |
// Copyright (C) 2014 Shota Matsuda | |
// | |
// Permission is hereby granted, free of charge, to any person obtaining a | |
// copy of this software and associated documentation files (the "Software"), | |
// to deal in the Software without restriction, including without limitation |
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
# (1) Add OpenCV's dynamic libraries you need to the pre-created "Link Binary | |
# With Libraries" build phase. | |
# (2) Make a "Copy Files" build phase, configure the destination to | |
# "Frameworks", then add all of the OpenCV's libraries you linked. | |
# (3) Make a "Run Script" build phase and copy and paste the script below. | |
pushd "$BUILT_PRODUCTS_DIR/$FRAMEWORKS_FOLDER_PATH" | |
ls -F | grep -v "@$" | grep "libopencv" | while read; do | |
FILE=$REPLY | |
# Change the linked libraries to the copied ones |
NewerOlder