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
fn handle_mouse_interactions( | |
button_input: Res<Input<MouseButton>>, | |
windows: Res<Windows>, | |
mut interactables: Query<(Entity, &mut Interactable)>, | |
sprites: Query<(Entity, &GlobalTransform), With<Sprite>>, | |
rapier_context: Res<RapierContext>, | |
) { | |
//Sequence note: This happens first because we want to know if the mouse button was released event outside our window. | |
if button_input.just_released(MouseButton::Left) { |
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
// Fill out your copyright notice in the Description page of Project Settings. | |
#include "InventoryComponent.h" | |
// Sets default values for this component's properties | |
UInventoryComponent::UInventoryComponent() | |
{ | |
// Set this component to be initialized when the game starts, and to be ticked every frame. You can turn these features | |
// off to improve performance if you don't need them. |
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
mod testing_suite; | |
use std::ops::{BitAnd, BitOr}; | |
use std::marker::PhantomData; | |
#[derive(Debug, Clone, PartialEq, Eq)] | |
struct EnumSet<E, const N: usize = 2> { | |
flags: [u64; N], | |
_phantom: PhantomData<E>, | |
} |
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
use nalgebra::{Vector3, Vector6, Unit}; | |
// Converts an axis-angle representation to a twist | |
fn axis_angle_to_twist(axis: Unit<Vector3<f64>>, angle: f64) -> Vector6<f64> { | |
let angular_velocity = angle * axis; | |
Vector6::new(0.0, 0.0, 0.0, angular_velocity.x, angular_velocity.y, angular_velocity.z) | |
} | |
// Rotates a point using a twist | |
fn rotate_point(point: Vector3<f64>, twist: Vector6<f64>, angle: f64) -> Vector3<f64> { |
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
//! A compute shader that simulates Conway's Game of Life. | |
//! | |
//! Compute shaders use the GPU for computing arbitrary information, that may be independent of what | |
//! is rendered to the screen. | |
use bevy::{ | |
prelude::*, | |
render::{ | |
extract_resource::{ExtractResource, ExtractResourcePlugin}, | |
render_asset::RenderAssets, |
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
AActor* ActorToUse = /* Get the actor that implements the ItemInterface */; | |
if (ActorToUse && ActorToUse->GetClass()->ImplementsInterface(UItemInterface::StaticClass())) | |
{ | |
IItemInterface::Execute_Use(ActorToUse); | |
} |
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 argparse | |
import concurrent.futures | |
import copy | |
import enum | |
import faulthandler | |
import functools | |
import io | |
import itertools | |
import json | |
import math |
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
from langchain import LLMMathChain, LLMChain, ConversationChain, PromptTemplate | |
from langchain.chains.conversation.memory import ConversationBufferWindowMemory | |
from langchain.agents import Tool, initialize_agent | |
from functools import partial | |
import random | |
def random_gen(input=""): | |
return random.randint(0, 5) | |
def meaning_of_life(input=""): |
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
Traceback (most recent call last): | |
File "/home/blackroot/mambaforge/lib/python3.10/site-packages/gradio/routes.py", line 437, in run_predict | |
output = await app.get_blocks().process_api( | |
File "/home/blackroot/mambaforge/lib/python3.10/site-packages/gradio/blocks.py", line 1344, in process_api | |
inputs = self.preprocess_data(fn_index, inputs, state) | |
File "/home/blackroot/mambaforge/lib/python3.10/site-packages/gradio/blocks.py", line 1194, in preprocess_data | |
processed_input.append(block.preprocess(inputs[i])) | |
File "/home/blackroot/mambaforge/lib/python3.10/site-packages/gradio/components.py", line 2463, in preprocess | |
sample_rate, data = processing_utils.audio_from_file( | |
File "/home/blackroot/mambaforge/lib/python3.10/site-packages/gradio/processing_utils.py", line 133, in audio_from_file |
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
<script> | |
var canvas = document.getElementById('matrixCanvas'); | |
var ctx = canvas.getContext('2d'); | |
canvas.height = window.innerHeight; | |
canvas.width = window.innerWidth; | |
var characters = "ABCDEFGHIJKLMNOPQRSTUVWXYZ123456789@$%&"; | |
characters = characters.split(""); |