This file contains hidden or 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 "TurnTableCameraController.h" | |
#include <QtMath> | |
#include <algorithm> | |
using namespace std; | |
TurnTableCameraController::TurnTableCameraController(Qt3DCore::QNode *parent) | |
: m_mouseDevice(new Qt3DInput::QMouseDevice()), | |
m_mouseHandler(new Qt3DInput::QMouseHandler()), | |
m_camera(nullptr), |
This file contains hidden or 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 _TurnTableCameraController_h_ | |
#define _TurnTableCameraController_h_ | |
// TODO: forward declare | |
#include <Qt3DRender/QCamera> | |
#include <Qt3DInput/QMouseDevice> | |
#include <Qt3DInput/QMouseHandler> | |
#include <Qt3DInput/QMouseEvent> | |
#include <Qt3DLogic/QFrameAction> |
This file contains hidden or 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
find . -type f \( -name "*.qml" -o -name "qmldir" -o -name "*.vert" -o -name "*.frag" -o -name "*.geom" \) | sed -e "s/\(.*\)/<file>\1<\/file>/" | pbcopy |
This file contains hidden or 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
void writePGM(const Image& image, std::string fname) | |
{ | |
ofstream ofile; | |
ofile.open(fname + ".pgm"); | |
ofile << "P2\n" << image.dim(0) << " " << image.dim(1) << "\n255\n"; | |
int c = 0; | |
for (int i = 0; i < image.dim(0); ++i) { | |
for (int j = 0; j < image.dim(1); ++j) { | |
ofile << (int)(image.data[c++]) << " "; |
This file contains hidden or 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 <stdexcept> | |
template <typename T, typename R, typename... Args, typename... Args2> | |
R decorateTryCatch(R(T::*f)(Args...), T& inst, R&& returnValueOnError, Args2&&... args) | |
{ | |
try { | |
return (inst.*f)(std::forward<Args2>(args)...); | |
} catch (std::exception& e) { |
This file contains hidden or 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 | |
echo "The script that creates the header file (*.h) and source (*.cpp)." | |
if [ "$1" = "" ]; then | |
echo "Paramaters not exist!!!"; | |
exit 1; | |
fi | |
This file contains hidden or 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
import numpy as np | |
import sys | |
def image_from_stdin(): | |
row_list = [] | |
for line in sys.stdin: | |
row = line.split() | |
col_list = [] | |
for r in row: | |
col_list += [r.split(',')] |
This file contains hidden or 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/python | |
def set_rgb(r, g, b): | |
i = (r * 6 + g) * 6 + b + 16 | |
return "\x1b[38;5;%dm" % i | |
def set_reset(): | |
return "\x1b[0m" | |
r, g, b = [0, 2, 0] |
This file contains hidden or 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 __lwgetopts_hpp__ | |
#define __lwgetopts_hpp__ | |
#include <string> | |
#include <exception> | |
#include <vector> | |
#include <map> | |
#include <iostream> | |
namespace lwgetopts { |
This file contains hidden or 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 <regex> | |
#include <set> | |
#include <limits> | |
#include <boost/icl/interval_set.hpp> | |
// We want to parse strings that represents a list of intervals like: | |
// 1,8-17,5,31-, | |
// to get the intervals [1,2],[5,6],[8,17],[31,inf] | |
// Ensure that the last character is a ',' at end of the string |
NewerOlder