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
<!DOCTYPE HTML> | |
<html> | |
<head> | |
<style> | |
body { | |
margin: 0px; | |
padding: 0px; | |
} | |
</style> | |
</head> |
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
//For three.js, based off of https://github.com/PierfrancescoSoffritti/pierfrancescosoffritti.com/blob/master/src/components/home/header/threejs/SceneSubject.js | |
import * as THREE from 'three' | |
import alphaTexture from './stripe6.jpg'; | |
export default scene => { | |
const group = new THREE.Group(); | |
const subjectGeometry = deformGeometry(new THREE.IcosahedronGeometry(7, 5)); | |
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 * as THREE from 'three' | |
import alphaTexture from './stripe6.jpg'; | |
export default scene => { | |
const group = new THREE.Group(); | |
const subjectGeometry = deformGeometry(new THREE.IcosahedronGeometry(7, 5)); | |
const subjectMaterial = new THREE.MeshStandardMaterial({ color: "red", transparent: true, side: THREE.DoubleSide, alphaTest: 0.1 }); | |
subjectMaterial.alphaMap = new THREE.TextureLoader().load(alphaTexture); |
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 * as THREE from 'three' | |
import alphaTexture from './clean-grey-gradient.jpg'; | |
export default scene => { | |
const group = new THREE.Group(); | |
const subjectGeometry = deformGeometry(new THREE.IcosahedronGeometry(7, 5)); | |
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
Lights: | |
import * as THREE from 'three' | |
export default scene => { | |
// const lightIn = new THREE.PointLight("blue", 30); | |
const lightOut = new THREE.DirectionalLight("fff", 1); | |
lightOut.position.set(40,20,400); | |
//scene.add(lightIn); |
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 * as THREE from "three"; | |
import alphaTexture from "./Images/clean-grey-gradient.jpg"; | |
import { Vector3 } from "three"; | |
export default scene => { | |
var raycaster = new THREE.Raycaster(); | |
var lastMouse; | |
const group = new THREE.Group(); | |
var speed = .1; | |
const subjectGeometry = deformGeometry(new THREE.IcosahedronGeometry(14, 4)); |
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
calculate() { | |
const programs = []; | |
const arrayOfNames = [ | |
...new Set(this.props.accounts.map(item => item.Program)) | |
].map(item => { | |
programs.push({ program: item, amount: 0 }); | |
}); | |
this.props.accounts.map(item => { | |
const index = programs.map(e => e.program).indexOf(item.Program); |
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
# The total cost of a node is calculated as | |
# f(n) = g(n) + h(n) | |
# g(n) is the cost from the start node to the current node, and | |
# h(n) is the estimated cost from the current node to the goal. | |
# f value is the sum of g and h and is used to compare nodes when deciding | |
# the parent attribute of a Node |
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
//TcpListener: A TCP socket server, listening for connections from TCP clients. | |
//TcpStream: Represents a TCP connection to a remote server, used for sending and receiving data. | |
use tokio::net::{TcpListener, TcpStream}; | |
//Connection: Manages a connection to a mini-Redis server, handling the sending and receiving of data frames. | |
//Frame: Represents a frame in the Redis protocol, which is a basic unit of communication in Redis, containing commands or data. | |
use mini_redis::{Connection, Frame}; |
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
use mini_redis::Command::{self, Get, Set}; | |
use mini_redis::{Connection, Frame}; | |
use std::collections::HashMap; | |
use std::sync::Arc; | |
use tokio::net::{TcpListener, TcpStream}; | |
#[derive(Debug)] | |
struct PlayerData { | |
client_ip: String, | |
client_position_x: f32, |