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 intersect(l1, l2): | |
# l1 and l2 are lines specified by 3 coefficients, as in | |
# a x + b y + c = 0 | |
mat = jnp.stack([l1[:2], l2[:2]], axis=0) | |
vec = -jnp.stack([l1[2], l2[2]], axis=0) | |
return jnp.linalg.solve(mat, vec) | |
def intersection_depth(x, hd, seg): | |
def _cross(u, v): | |
return u[0] * v[1] - u[1] * v[0] |
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
#!/bin/bash | |
reliably_download() | |
{ | |
ssh_user=$1 | |
remote_host=$2 | |
remote_file=$3 | |
local_file=$4 | |
# default to 3 tries | |
max_tries=${5-3} |
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 java.io.*; | |
import java.util.zip.CheckedInputStream; | |
import java.util.zip.CheckedOutputStream; | |
import java.util.zip.CRC32; | |
import org.apache.commons.net.ftp.*; | |
public class Main implements java.io.Serializable | |
{ | |
public static void main(String[] args) throws Exception | |
{ |
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
/* | |
* Licensed to the Apache Software Foundation (ASF) under one or more | |
* import org.apache.log4j.Logger; | |
* contributor license agreements. See the NOTICE file distributed with | |
* this work for additional information regarding copyright ownership. | |
* The ASF licenses this file to You under the Apache License, Version 2.0 | |
* (the "License"); you may not use this file except in compliance with | |
* the License. You may obtain a copy of the License at | |
* | |
* http://www.apache.org/licenses/LICENSE-2.0 |