Skip to content

Instantly share code, notes, and snippets.

View quanvuong's full-sized avatar

Quan Vuong quanvuong

  • UCSD
  • San Diego
View GitHub Profile
@quanvuong
quanvuong / box.sdf
Created January 12, 2021 05:52
Drake weldframe un-intuitive behavior when <static> is included in sdf
<?xml version='1.0'?>
<sdf version="1.7">
<model name="my_model">
<pose>0 0 0.5 0 0 0</pose>
<static>true</static>
<link name="box_link">
<inertial>
<mass>1.0</mass>
<inertia> <!-- inertias are tricky to compute -->
<!-- http://gazebosim.org/tutorials?tut=inertia&cat=build_robot -->
@quanvuong
quanvuong / py_to_pdf.sh
Last active August 9, 2018 05:52
Convert python files in a directory to pdf, with syntax highlighting
#!/bin/bash
echo "Looking for .py file in $1"
echo "Saving pdfs to $2"
echo
REPOSITORY=$1
while read source_file
do
@quanvuong
quanvuong / multiple_head.py
Last active October 3, 2023 13:43
Multiple head network with pytorch
import torch
import torch.nn as nn
from torch.autograd import Variable
# Do this to display pytorch version.
# The version used in this gist is 0.3.0.post4.
print(torch.__version__)
# There are three steps to demonstrate multi head network
# 1. build the network
@quanvuong
quanvuong / README.md
Created November 1, 2015 17:59 — forked from mbostock/.block
Collapsible Tree
@quanvuong
quanvuong / README.md
Created November 1, 2015 10:52 — forked from robschmuecker/README.md
D3.js Drag and Drop, Zoomable, Panning, Collapsible Tree with auto-sizing.

This example pulls together various examples of work with trees in D3.js.

The panning functionality can certainly be improved in my opinion and I would be thrilled to see better solutions contributed.

One can do all manner of housekeeping or server related calls on the drop event to manage a remote tree dataset for example.

Dragging can be performed on any node other than root (flare). Dropping can be done on any node.

Panning can either be done by dragging an empty part of the SVG around or dragging a node towards an edge.