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
| You are working in my Rust trading bot repository. | |
| Goal: | |
| Create a Rust UI library prototype that supports a retained-mode GUI suitable for a trading bot, with declarative function-call component authoring, signal-based reactivity, dirty region tracking, logical layers, custom nodes/widgets, custom GPU passes, and a demo app showing the system working. | |
| This should be a real working vertical slice, not only a design document. | |
| Important: | |
| Do not copy browser DOM architecture. | |
| Do not create a CSS/HTML clone. |
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
| /// OPENSEARCH TUTORIAL: Comprehensive Query Examples for Bakery Management System | |
| /// This tutorial covers: Basic CRUD, Search, Aggregations, Multi-search, and Percolator queries | |
| /// Use Elasticsearch VSCode extension for easy execution | |
| /// Get Elasticsearch version information | |
| GET / | |
| /// =================================================== | |
| /// STEP 1: INDEX SETUP AND DATA PREPARATION |
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
| //! # DType Macros | |
| //! | |
| //! This module provides a set of macros and traits for defining and working with strongly-typed | |
| //! enums and their associated tokens. These macros are designed to: | |
| //! | |
| //! - **Generate Tokens**: Define unique tokens for each variant of an enum using `build_dtype_tokens`. | |
| //! - **Define Enums**: Create enums with compile-time checks to ensure all variants are valid tokens | |
| //! using `build_dtype_enum`. | |
| //! - **Dynamic Downcasting**: Enable safe downcasting of enum variants to their underlying types | |
| //! or containers. |
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 bit_util_u64 { | |
| const SIGN_BIT_FLIP: u64 = 0x8000_0000_0000_0000; | |
| // magic numbers for bit interleaving | |
| const MAGIC: [u128; 7] = [ | |
| 0x5555555555555555_5555555555555555, | |
| 0x3333333333333333_3333333333333333, | |
| 0x0F0F0F0F0F0F0F0F_0F0F0F0F0F0F0F0F, | |
| 0x00FF00FF00FF00FF_00FF00FF00FF00FF, |
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 std::ops::Range; | |
| use derive_more::{Deref, DerefMut, Into}; | |
| #[derive(Debug, Deref, DerefMut, Hash, PartialEq, Eq, Clone, Into)] | |
| pub struct DirtyIndexRange(pub(super) Range<usize>); | |
| impl DirtyIndexRange { | |
| pub fn one(index: usize) -> Self { | |
| Self(index..index + 1) |
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
| open System.Threading.Tasks | |
| open FsToolkit.ErrorHandling | |
| open FsToolkit.ErrorHandling.Operator.Validation | |
| type TaskValidation<'a, 'err> = Task<Validation<'a, 'err>> | |
| [<RequireQualifiedAccess>] | |
| module TaskValidation = | |
| let inline map f (tv: TaskValidation<'a, 'err>) : TaskValidation<'b, 'err> = TaskResult.map f tv | |
| let inline bind (f: 'a -> TaskValidation<'b, 'err>) (tv: TaskValidation<'a, 'err>) : TaskValidation<'b, 'err> = TaskResult.bind f tv |
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 { useEffect, useRef } from 'react'; | |
| import './App.css'; | |
| import { DataUpdates, HistoricalDataRequest, Price, UTCTimestamp, Viper as ViperCharts } from "@viper-charts/viper-charts"; | |
| // import "@viper-charts/viper-charts/dist/style.css"; | |
| import { ViperDatabase } from "./ViperDatabase"; | |
| const db = createDB(); | |
| function onSaveViperSettings(settings: any) { |
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
| [config] | |
| # skip_core_tasks = true | |
| # skip_git_env_info = true | |
| # skip_crate_env_info = true | |
| # skip_rust_env_info = true | |
| [env] | |
| CARGO_MAKE_EXTEND_WORKSPACE_MAKEFILE = true | |
| SHARED_LIB_DIR = "${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/shared_lib" | |
| LIBRARY_EXTENSION = { source = "${CARGO_MAKE_RUST_TARGET_OS}", default_value = "unknown", mapping = {"linux" = "so", "macos" = "dylib" } } |
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 std::task::Poll; | |
| use futures::{Future, FutureExt, Stream}; | |
| use pin_project::pin_project; | |
| use tracing::debug; | |
| #[pin_project(project = StreamStateProj)] | |
| #[derive(Debug, Clone)] | |
| enum StreamState<F, S> | |
| where |
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
| package lib.cache | |
| import cats.effect.std.{UUIDGen, Supervisor} | |
| import cats.effect.syntax.all.* | |
| import cats.effect.{Async, Clock, Fiber, Outcome, Ref, Resource} | |
| import cats.syntax.all.* | |
| import fs2.Stream | |
| import io.chrisdavenport.mapref.MapRef | |
| import io.chrisdavenport.rediculous.RedisCommands | |
| import io.chrisdavenport.rediculous.RedisConnection |
NewerOlder