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
/* | |
Compile-time resolution of correct data type based on the platform differency. For example, if the code is compiled in a 32-bit machine, | |
integral_ptr_t is resolved into uint32_t. Reinterpreting the pointer, which is a void pointer, into uint32_t and dereferencing later back to, e.g. int*, | |
is a thorough valid operation. -> Refer to https://en.cppreference.com/w/cpp/language/reinterpret_cast for further information. | |
Reference: https://en.wikibooks.org/wiki/C%2B%2B_Programming/Templates/Template_Meta-Programming | |
*/ | |
#include <iostream> | |
#include <cstdint> |
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> | |
#define N 1000 | |
/* | |
This is quite a good example of Template Meta Programming. Especially, in hackathons that accept executables or does not have | |
time limit in compilation, computation-heavy tasks as prime num discovery in a range can be hacked in compile time. And the result | |
can be expressed in O(1) or O(n) with some reasonable constant factor. | |
Reference: https://en.wikibooks.org/wiki/C%2B%2B_Programming/Templates/Template_Meta-Programming | |
*/ |
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
import time | |
import curses | |
if __name__=="__main__": | |
stdscr = curses.initscr() | |
curses.noecho() | |
curses.cbreak() |
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
#File raspberrytoolchain.cmake for ROS and system packages to cross compile. | |
SET(CMAKE_SYSTEM_NAME Linux) | |
SET(CMAKE_C_COMPILER arm-linux-gnueabihf-gcc) | |
SET(CMAKE_CXX_COMPILER arm-linux-gnueabihf-g++) | |
# Below call is necessary to avoid non-RT problem. | |
SET(CMAKE_LIBRARY_ARCHITECTURE arm-linux-gnueabihf) | |
SET(RASPBERRY_ROOT_PATH ${CMAKE_CURRENT_LIST_DIR}/arm_raspberry) |
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
<?xml version="1.0"?> | |
<robot xmlns:xacro="http://www.ros.org/wiki/xacro"> | |
<xacro:macro name="dji_m100_gimbal"> | |
<joint name="virtual_gimbal_joint" type="fixed"> | |
<origin xyz="-0.1 0 -0.04" rpy="0 0 0"/> | |
<parent link="base_link"/> | |
<child link="virtual_gimbal_link"/> | |
</joint> | |
<gazebo reference="virtual_gimbal_joint"> |
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
import networkx as nx | |
import matplotlib.pyplot as plt | |
""" | |
Implements Product Graph operator proposed in https://sites.cs.ucsb.edu/~xyan/tutorial/GraphKernels.pdf. | |
""" | |
def product_graph(G1,G2): | |
G = nx.lexicographic_product(G1,G2) | |
PG = nx.Graph() | |
for n in G.nodes(): |
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
<?xml version="1.0"?> | |
<launch> | |
<arg name="paused" default="false"/> | |
<arg name="gazebo_gui" default="true"/> | |
<!-- startup simulated world --> | |
<include file="$(find gazebo_ros)/launch/empty_world.launch"> | |
<arg name="world_name" default="worlds/empty.world"/> | |
<arg name="paused" value="$(arg paused)"/> | |
<arg name="gui" value="$(arg gazebo_gui)"/> |
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 bash | |
# This script shows how to build the Docker image and push it to ECR to be ready for use | |
# by SageMaker. | |
# There are 3 arguments in this script: | |
# - image - required, this will be used as the image on the local machine and combined with the account and region to form the repository name for ECR; | |
# - tag - optional, if provided, it will be used as ":tag" of your image; otherwise, ":latest" will be used; | |
# - Dockerfile - optional, if provided, then docker will try to build image from provided dockerfile (e.g. "Dockerfile.serving"); otherwise, default "Dcokerfile" will be used. | |
# Usage examples: |