Python 提供了两个基本的 socket 模块:
Socket
它提供了标准的BSD Socket API。SocketServer
它提供了服务器重心,可以简化网络服务器的开发。
下面讲解下 Socket模块功能。
#include "InterpolationLibrary.h" | |
#include "Kismet/KismetMathLibrary.h" | |
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// | |
// Critically Damped Spring Interpolations (ie: Similar to Unity's SmoothDamp, but will less operations) | |
// Inspired from Keijiro's code: https://github.com/keijiro/SmoothingTest | |
// Math reference: http://mathproofs.blogspot.jp/2013/07/critically-damped-spring-smoothing.html | |
FVector UInterpolationLibrary::VectorSpringInterpCD(FVector Current, FVector Target, FVector& Velocity, float DeltaTime, float InterpSpeed, float MaxVelocity) | |
{ |
# -*- coding: utf-8 -*- | |
from __future__ import division, print_function | |
import numpy as np | |
import copy | |
import matplotlib.pyplot as plt | |
import seaborn | |
def smooth(array, m=3): | |
_array = copy.deepcopy(array) |
# 3D IoU python Implementation | |
# [IoU](https://www.pyimagesearch.com/2016/11/07/intersection-over-union-iou-for-object-detection/) | |
def IoU(box0, box1): | |
# box0: [x, y, z, d] | |
r0 = box0[3] / 2 | |
s0 = box0[:3] - r0 | |
e0 = box0[:3] + r0 | |
r1 = box1[3] / 2 | |
s1 = box1[:3] - r1 |
# Customize BASH PS1 prompt to show current GIT repository and branch. | |
# by Mike Stewart - http://MediaDoneRight.com | |
# SETUP CONSTANTS | |
# Bunch-o-predefined colors. Makes reading code easier than escape sequences. | |
# I don't remember where I found this. o_O | |
# Reset | |
Color_Off="\[\033[0m\]" # Text Reset |