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
def pairwise_dist (A, B): | |
""" | |
Computes pairwise distances between each elements of A and each elements of B. | |
Args: | |
A, [m,d] matrix | |
B, [n,d] matrix | |
Returns: | |
D, [m,n] matrix of pairwise distances |
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
/* | |
* hirschberg.c implements Hirschberg's algorithm for global string | |
* alignment in C. To test it, compile it with | |
* `c99 -o hirschberg hirschberg.c` and then run | |
* `./hirschberg <string1> <string2>`. (hirschberg.c uses | |
* variable-length arrays, so the 99 standard is necessary.) | |
* | |
* Copyright (c) 2015 Lari Rasku. This code is released to the public | |
* domain, or under CC0 if not applicable. | |
*/ |
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
using UnityEngine; | |
public static class ConfigurableJointExtensions { | |
/// <summary> | |
/// Sets a joint's targetRotation to match a given local rotation. | |
/// The joint transform's local rotation must be cached on Start and passed into this method. | |
/// </summary> | |
public static void SetTargetRotationLocal (this ConfigurableJoint joint, Quaternion targetLocalRotation, Quaternion startLocalRotation) | |
{ | |
if (joint.configuredInWorldSpace) { |