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 | |
### steps #### | |
# verify the system has a cuda-capable gpu | |
# download and install the nvidia cuda toolkit and cudnn | |
# setup environmental variables | |
# verify the installation | |
### | |
### to verify your gpu is cuda enable check |
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
""" | |
python quaternion to euler | |
same logic as in three.js | |
""" | |
import math | |
class Euler: | |
def __init__(self, x=0, y=0, z=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
// dependencies: | |
// stomp_dart_client: ^1.0.0 | |
import 'dart:async'; | |
import 'dart:convert'; | |
import 'package:stomp_dart_client/stomp.dart'; | |
import 'package:stomp_dart_client/stomp_config.dart'; | |
import 'package:stomp_dart_client/stomp_frame.dart'; |
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
""" | |
`dynprm` is a vector of actuator dynamic parameters that includes the actuator’s mass, damping, and spring constant 1. | |
`gainprm` is a vector of actuator gain parameters that includes the actuator’s proportional gain, derivative gain, and integral gain 1. | |
`biasprm` is a vector of actuator bias parameters that includes the actuator’s bias force and bias torque | |
""" | |
model = mujoco.MjModel.from_xml_path(xml_path) | |
data = mujoco.MjData(model) |
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 time | |
import mujoco | |
import mujoco.viewer | |
import math | |
from transforms3d import quaternions | |
from lib.BaseRender import BaseRender | |
class BaseRender: |
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
""" | |
vibration wave data, for a full (100000, 3) file, the size is 1,070,89KB | |
""" | |
if __name__ == "__main__": | |
time_spent = [] | |
for file in os.listdir(WAVE_DATA_DIR): | |
start = time.time() |
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/node | |
// - A group is an array of player names who have recently played with each other. | |
// - Each member in a group must have played with each other member. | |
// - Each group must have at least two names, and duplicate groups must be discarded. | |
// - If a group is entirely contained in a larger group, it must be discarded in favor of the larger group. | |
/** | |
* A brutal force solution to this problem is as follows | |
* 1.find all of the subset of the given players list with minimum size of 2 |
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
class SegmentTree(): | |
def __init__(self, array): | |
# first pad array to nearest 2^k | |
# https://stackoverflow.com/questions/466204/rounding-up-to-next-power-of-2 | |
n = len(array) - 1 | |
n |= n >> 1 | |
n |= n >> 2 | |
n |= n >> 4 |