Skip to content

Instantly share code, notes, and snippets.

View MyelinsheathXD's full-sized avatar

Myelin Sheath MyelinsheathXD

View GitHub Profile
@MyelinsheathXD
MyelinsheathXD / PyTorchImageClassificaitonGPU.py
Created May 16, 2024 08:56 — forked from quickgrid/PyTorchImageClassificaitonGPU.py
CIFAR10 image classification using CNN with pytorch gpu. This is a simple network and accuracy reaches to 77% on 10 epochs.
import torch
torch.manual_seed(0)
import numpy as np
np.random.seed(0)
import random
random.seed(0)
torch.backends.cudnn.deterministic = True
torch.backends.cudnn.benchmark = False
#torch.cudnn.benchmark = True
@MyelinsheathXD
MyelinsheathXD / ArtBodyExtensions.cs
Created May 9, 2024 07:18 — forked from Gustorvo/ArtBodyExtensions.cs
Extension methods for working with ArticulationBody component for Unity
using System.Collections.Generic;
using UnityEngine;
/// <summary>
/// Extension methods for working with ArticulationBody component for Unity
/// </summary>
public static class ArtBodyExtensions
{
/// <summary>
/// Sets an articulation body drive target rotation to match a given targetLocalRotation.
@MyelinsheathXD
MyelinsheathXD / client.py
Created April 15, 2024 13:20 — forked from mlaves/client.py
Send a numpy array via socket to a C/C++ program.
import socket
import numpy as np
HOST = '127.0.0.1' # The server's hostname or IP address
PORT = 65432 # The port used by the server
data = np.random.rand(1000000)
with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s:
print(f"Sent {np.prod(data.shape)} elements.")
@MyelinsheathXD
MyelinsheathXD / CMakeLists.txt
Created January 31, 2024 12:57 — forked from Rod-Persky/CMakeLists.txt
Example cmake for windows including auto copy dll
# _______ __ __ _______ ______ _______ _______ _______ ______ #
#| || | | || || | | _ || || || | #
#| _ || | | ||_ _|| _ || |_| ||_ _|| ___|| _ |#
#| | | || |_| | | | | | | || | | | | |___ | | | |#
#| |_| || | | | | |_| || | | | | ___|| |_| |#
#| || | | | | || _ | | | | |___ | |#
#|_______||_______| |___| |______| |__| |__| |___| |_______||______| #
# #
# Modern CMake practices and importing the QT scripts by adding it to #
# your module path makes things a lot better than it used to be #
adding exucutable applications into path
add this path "myelin@myelincolor:~/ATP/intalls/24/01/bin$" line in the terminal , in this way in .bashrc file in home directory
like"myelin@myelincolor:~$ "
#myelin softdirs
export PATH="/home/myelin/ATP/intalls/24/01/bin:$PATH"
@MyelinsheathXD
MyelinsheathXD / Unreal Engine.cpp
Last active July 7, 2024 13:54
UE log console and Screen
//Pars: id, seconds, color, text
FString st1=FString::FromInt(8572);
st1+=L"Hello world";
GEngine->AddOnScreenDebugMessage(-1, 5.f, FColor::Red, TEXT("Screen Message"));
//with id
GEngine->AddOnScreenDebugMessage(0, 1, FColor::Red, TEXT("HI"));
GEngine->AddOnScreenDebugMessage(76867, 3, FColor::MakeRandomColor(), FString::FromInt(8572));
@MyelinsheathXD
MyelinsheathXD / EmbedPackage.cs
Created August 1, 2022 11:33 — forked from liortal53/EmbedPackage.cs
Embed package into your Unity project to modify the code more easily :)
using System.IO;
using UnityEditor.PackageManager;
using UnityEngine;
namespace UnityEditor.Extensions
{
#if UNITY_2017_3_OR_NEWER
/// <summary>
/// Editor extension for embedding packages as a local copy in the project.
@MyelinsheathXD
MyelinsheathXD / _GJK.md
Created April 18, 2022 17:59 — forked from vurtun/_GJK.md
3D Gilbert–Johnson–Keerthi (GJK) distance algorithm

Gilbert–Johnson–Keerthi (GJK) 3D distance algorithm

The Gilbert–Johnson–Keerthi (GJK) distance algorithm is a method of determining the minimum distance between two convex sets. The algorithm's stability, speed which operates in near-constant time, and small storage footprint make it popular for realtime collision detection.

Unlike many other distance algorithms, it has no requirments on geometry data to be stored in any specific format, but instead relies solely on a support function to iteratively generate closer simplices to the correct answer using the Minkowski sum (CSO) of two convex shapes.

transform only
https://drive.google.com/file/d/1o-21TPyiGoqDx91I6sWek6iVuQGAk19U/view?usp=sharing
using System.IO;
using UnityEditor.PackageManager;
using UnityEngine;
namespace UnityEditor.Extensions
{
#if UNITY_2017_3_OR_NEWER
/// <summary>
/// Editor extension for embedding packages as a local copy in the project.