This file contains hidden or 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
| shader_type spatial; | |
| uniform vec3 light_dir = vec3(1.2, -2.0, 0.2); | |
| uniform float water_depth = 1.5; | |
| uniform vec2 ripple_center = vec2(2.5, 2.5); | |
| uniform float ripple_strength = 0.5; | |
| uniform float decay_rate = 0.8; // Higher = loses height faster | |
| float get_height(vec2 pos, float time) { |
This file contains hidden or 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
| Input image (optional) → VAE encoder → latent z | |
| for t = T → 1: | |
| Add noise to latent → z_t | |
| UNet predicts noise: | |
| Inputs: | |
| - z_t (noisy latent) | |
| - t (timestep) | |
| - text embedding (from text encoder) | |
| Output: | |
| - predicted noise |
This file contains hidden or 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 sympy as sp | |
| from sympy.physics.mechanics import KanesMethod, Particle, ReferenceFrame, Point, dynamicsymbols | |
| t = dynamicsymbols._t | |
| x, y = dynamicsymbols('x y') | |
| u1, u2, u3 = dynamicsymbols('u1 u2 u3') # generalized speeds: xdot, ydot | |
| # Angular velocity | |
| theta_ = dynamicsymbols('theta') # rotation about z | |
| thetad = dynamicsymbols('theta', 1) | |
| kd = [u1 - x.diff(t), u2 - y.diff(t), u3 - theta_.diff()] |
This file contains hidden or 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 numpy as np | |
| from scipy.integrate import solve_ivp | |
| import matplotlib.pyplot as plt | |
| # --- parameters --- | |
| m = 5.0 | |
| I_th = 0.12 | |
| k_y = 300.0 | |
| k_th = 12.0 | |
| rho = 1.225 |
This file contains hidden or 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 numpy as np | |
| np.random.seed(42) | |
| # Expanded sentence: "The cat sat on the mat and the dog chased the cat." | |
| words = ["The", "cat", "sat", "on", "the", "mat", "and", "dog", "chased", "the", "cat"] | |
| # Randomly initialized Q, K, V matrices with 8-dimensional vectors | |
| Q = {word: np.random.rand(81) for word in words} | |
| K = {word: np.random.rand(81) for word in words} | |
| V = {word: np.random.rand(81) for word in words} |
This file contains hidden or 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 matplotlib.pyplot as plt | |
| import numpy as np | |
| from arch import arch_model | |
| import numpy as np | |
| import pandas as pd | |
| from arch import arch_model | |
| import yfinance as yf | |
| import seaborn as sns | |
| # data = yf.download("PEKGY.IS",end="2025-10-10",start="2020-01-01") |
This file contains hidden or 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 numpy as np | |
| # Your real price data (daily, for example) | |
| # Example: prices = np.array([100.5, 101.2, 102.3, ..., 120.4]) | |
| prices = np.array([ | |
| 2.04, | |
| 2.24, | |
| 2.46, | |
| 2.37, | |
| 2.6, |
This file contains hidden or 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
| #include <torch/extension.h> | |
| #include <cuda_runtime.h> | |
| #include <c10/cuda/CUDAStream.h> | |
| // Declare the kernel launcher (in .cu) | |
| void matmul_kernel_launcher(const float* A, const float* B, float* C, int N, cudaStream_t stream); | |
| // C++ wrapper | |
| void launch_matmul_kernel(torch::Tensor A, torch::Tensor B, torch::Tensor C, int N) { | |
| const float* A_ptr = A.data_ptr<float>(); |
This file contains hidden or 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
| #include <benchmark/benchmark.h> | |
| #include <map> | |
| #include <queue> | |
| #include <deque> | |
| #include <string> | |
| #include <functional> | |
| #include <iostream> | |
| #include <iomanip> | |
| // ----------- MatchingEngine and Order Definitions ----------- |
This file contains hidden or 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 re | |
| from sklearn.model_selection import train_test_split, GridSearchCV | |
| from sklearn.ensemble import GradientBoostingClassifier, RandomForestClassifier | |
| from sklearn.metrics import accuracy_score | |
| from sklearn.preprocessing import LabelEncoder | |
| from sklearn.impute import SimpleImputer | |
| import pandas as pd | |
| from sklearn.ensemble import AdaBoostClassifier | |
| from sklearn.model_selection import train_test_split | |
| import xgboost as xgb |
NewerOlder