Skip to content

Instantly share code, notes, and snippets.

@ntraft
ntraft / test.sbatch
Created January 31, 2024 06:19
An example Slurm sbatch script (which also includes GPU usage)
#!/bin/bash
# Specify a partition.
#SBATCH --partition=bdgpu
# Request physical nodes (usually 1).
#SBATCH --nodes=1
# Request tasks (usually 1).
#SBATCH --ntasks=1
# Request processor cores (only if your program has multithreading/multiprocessing).
#SBATCH --cpus-per-task=3
# Request GPUs (delete if not needed).
@ntraft
ntraft / jupyter-server.sbatch
Last active January 31, 2024 05:48
A pair of scripts which can be used to launch Jupyter notebooks on the Vermont Advanced Computing Center
#!/bin/bash
# Specify a partition
#SBATCH --partition=bdgpu
# Request nodes
#SBATCH --nodes=1
# Request some processor cores
#SBATCH --ntasks=8
# Request a GPU
#SBATCH --gpus=0
# Request memory
@ntraft
ntraft / obstacles.cpp
Last active May 26, 2023 13:41
Identify dominant planes in a point cloud in ROS
/**
* Makes all the non-planar things green, publishes the final result on the /obstacles topic.
*/
#include <iostream>
#include <ros/ros.h>
#include <sensor_msgs/PointCloud2.h>
#include <pcl_conversions/pcl_conversions.h>
#include <pcl/ModelCoefficients.h>
#include <pcl/io/pcd_io.h>
@ntraft
ntraft / gist:7904518
Last active December 30, 2015 23:59
An Output for fingertip torque values. Uses an io_service to asynchronously queue sensor updates. Does practically nothing in the realtime thread, but still fails sometimes.
#ifndef FINGERTIP_TORQUE_OUTPUT_H_
#define FINGERTIP_TORQUE_OUTPUT_H_
#include <boost/asio/io_service.hpp>
#include <barrett/detail/ca_macro.h>
#include <barrett/products/product_manager.h>
#include <barrett/math/matrix.h>
#include <barrett/systems.h>
#include <barrett/systems/abstract/system.h>
@ntraft
ntraft / better-than-random
Created April 28, 2012 20:52
My first crosscram-playing bot
;;
;; Neil's Bot
;;
(defn- valid-empty-space? [board [r c]]
(cond
(not (< -1 r (count board))) false
(not (< -1 c (count (nth board r)))) false
:else (nil? (nth (nth board r) c))))