List of freely available resources to study computer graphics programming.
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
local SoulType = require(game.ReplicatedStorage.Shared.define.play).SpiritType | |
local UIConfigGlobal = { | |
} | |
UIConfigGlobal.StatsPanel = { | |
[SoulType.Red] = { | |
Name = "Hyper Star", | |
Color = Color3.fromRGB(255, 0, 127), |
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
public static class SieveOfEratos { | |
private static int[] GenerateArray(int n) => Enumerable.Range(2, n-1).ToArray(); // generate from 2 -> n | |
private static bool[] GenerateArrayOfOnes(int n) => Enumerable.Repeat(true, n).ToArray(); | |
public static int[] SieveofEratosAlgorithm(int upperLimited) | |
{ | |
int[] allNumbers = GenerateArray(upperLimited); | |
bool[] allMarker = GenerateArrayOfOnes(allNumbers.Length); | |
int maxValue = allNumbers[allNumbers.Length - 1]; // last value (always the greatest) | |
for (int i = 0; i < allNumbers.Length; i++) |
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 Godot; | |
using System; | |
public abstract partial class BaseSingleton<T> : Node where T : Node | |
{ | |
private static T _instance = null; | |
public static T Instance => _instance; | |
// Called when the node enters the scene tree for the first time. | |
public override void _Ready() |
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 csv | |
def filter_and_print_columns(filename, column_names, filename_output): | |
""" | |
This function reads a CSV file, filters and prints data from specified columns. | |
Args: | |
filename: The path to the CSV file. | |
column_names: A list of column names to print data from. |
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
public class Tool: EditorWindow | |
{ | |
[MenuItem("Tool/Create Prefab", false, -10)] | |
private static void CreatePrefab(UnityEditor.MenuCommand command) | |
{ | |
GameObject selectedOb = (GameObject)command.context; | |
Transform selectedTransform = selectedOb.transform; | |
GameObject rootObject = selectedTransform.root.gameObject; |
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
func ParseStringToEnum(enum_type: Dictionary, string_value: String) -> int: | |
var clone = enum_type.duplicate() | |
var keys = clone.keys() | |
var index = keys.find(string_value) | |
if index != -1: | |
return index | |
else: | |
print("String not found in enum.") | |
return -1 | |
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 os | |
import shutil | |
# Script to remove duplicate books in Calibre | |
# 1. Use Calibre's "Find Duplicate" plugin & run check (binary check) to remove all binary files that are duplicated | |
# 2. Run this script, point to the book directory. | |
# How it works? | |
# - Duplicated folders have no ebook format. They only has 2 files: image (book cover) & metadata files. | |
# - This script purge all folders that has less than or equal to 2 files. | |
# |
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
/* | |
* Source: https://forum.unity.com/threads/have-words-fade-in-one-by-one.525175/ | |
*/ | |
using System.Collections; | |
using System.Collections.Generic; | |
using TMPro; | |
using UnityEngine; | |
public class FadeinTxtSon : MonoBehaviour |
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 System; | |
using System.Collections.Generic; | |
using System.Linq; | |
namespace ConsoleApp1 | |
{ | |
public class FrameContainer | |
{ | |
public Frame FirstFrame; |
NewerOlder