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
bool GetLookDirection(FVector2D ScreenLocation, FVector& LookDirection) const | |
{ | |
FVector CameraWorldLocation; | |
return DeprojectScreenPositionToWorld( | |
ScreenLocation.X, | |
ScreenLocation.Y, | |
CameraWorldLocation, | |
LookDirection | |
); | |
} |
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
bool GetSightRayHitLocation(FVector& HitLocation) const | |
{ | |
// Find crosshair position in pixel coordinates | |
int32 ViewportSizeX, ViewportSizeY; | |
GetViewportSize(ViewportSizeX, ViewportSizeY); | |
FVector2D ScreenLocation = FVector2D(ViewportSizeX * CrossHairXLocation, ViewportSizeY * CrossHairYLocation); | |
// "De-project" the screen position of the crosshair to a world direction | |
FVector LookDirection, LookStartLocation; |
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
''' | |
Very basic Q-Learner that is tailored for the cart-pole environment. | |
This implementation leaves a lot of space for improvements. | |
''' | |
import gym | |
from gym import wrappers | |
import math |
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
.tags-input { | |
display: flex; | |
flex-direction: row; | |
flex-wrap: wrap; | |
align-content: flex-start; | |
justify-content: center; | |
} | |
.tags-input .tag-entry { | |
user-select: none; | |
cursor: pointer; |
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
class Logger { | |
constructor() { | |
if (!Logger.instance) { | |
Logger.instance = this; | |
} | |
return Logger.instance; | |
} | |
log(...args) { | |
console.log(...args); |
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 scrapy | |
class CodelabsSpider(scrapy.Spider): | |
name = "codelabs" | |
def start_requests(self): | |
urls = [ | |
'https://codelabs.developers.google.com/' | |
] | |
for url in urls: |
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; | |
[ExecuteInEditMode] | |
public class DynamicScale : MonoBehaviour | |
{ | |
Vector3 lastPosition; | |
void Start() | |
{ | |
lastPosition = transform.position; |
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
// Used further down in the OnConstruction call to set values on one spline mesh | |
void ALane::BuildTrackElement(int32 atDistance, USplineMeshComponent* SplineMesh, UStaticMesh* LaneElementMesh, ESplineMeshAxis::Type LaneElementMeshForwardAxis) | |
{ | |
FVector currLocation, currTangent, nextLocation, nextTangent; | |
currLocation = SplineComponent->GetLocationAtDistanceAlongSpline(atDistance, ESplineCoordinateSpace::Type::Local); | |
currTangent = SplineComponent->GetTangentAtDistanceAlongSpline(atDistance, ESplineCoordinateSpace::Type::Local); | |
nextLocation = SplineComponent->GetLocationAtDistanceAlongSpline(atDistance + MeshSpacing, ESplineCoordinateSpace::Type::Local); | |
nextTangent = SplineComponent->GetTangentAtDistanceAlongSpline(atDistance + MeshSpacing, ESplineCoordinateSpace::Type::Local); |
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
openssl req -newkey rsa:4096 -days 1001 -nodes -x509 -subj "/C=US/ST=California/L=San Francisco/O=Twitch/OU=web/CN=localhost" -extensions SAN -config ".\openssl.cnf" -keyout "testing.key" -out "testing.crt" |
OlderNewer