### Racket Plisqin Module Setup Source: https://docs.racket-lang.org/docs_racket-lang_org_markdown/plisqin/Read_Me_First.html Shows how to import the main Plisqin library and set up a prefix for the adventure-works example module, making its schema and functions accessible. ```Racket (require plisqin) (prefix-in aw: plisqin-examples/adventure-works) plisqin-examples/adventure-works/schema ``` -------------------------------- ### Installing Racket-Mike via Mike Itself (Initial) Source: https://docs.racket-lang.org/docs_racket-lang_org_markdown/mike/mike-about.html Executes the Racket-Mike main script directly to perform an initial installation and setup from within the cloned repository. ```Shell racket ./mike/main.rkt PACKAGE_NAME=mike install setup ``` -------------------------------- ### Example Usage of Koyo Console Start Procedure Setup in Racket Source: https://docs.racket-lang.org/docs_racket-lang_org_markdown/koyo/console.html This snippet provides an example setup for using `start-console`. It shows how to require the necessary modules (`koyo/console` with a prefix and `racket/path`) and how to obtain the path of the current file using `path-only` and `syntax-source`, which can then be used as the `dynamic-module-path` argument for `start-console`. ```Racket (require (prefix-in koyo: koyo/console) racket/path) (define here (path-only (syntax-source #'here))) ``` -------------------------------- ### Installing Qi Package via Raco Source: https://docs.racket-lang.org/docs_racket-lang_org_markdown/qi/Introduction_and_Usage.html Provides the command-line instruction using the Racket package manager (`raco pkg`) to install the Qi library. This is a necessary setup step before using Qi. ```Shell raco pkg install qi ``` -------------------------------- ### Installing Frog with Raco Source: https://docs.racket-lang.org/docs_racket-lang_org_markdown/frog/Quick_start.html Installs the Frog static blog generator package using the Racket package manager, raco. This command fetches and installs Frog and its necessary dependencies. ```Shell $ raco pkg install frog ``` -------------------------------- ### Install Overscan Racket Package Source: https://docs.racket-lang.org/docs_racket-lang_org_markdown/overscan/getting-started.html Installs the Overscan library using the Racket package manager, `raco pkg install`, directly from its Git repository. ```Shell raco pkg install git://github.com:mwunsch/overscan ``` -------------------------------- ### Install GStreamer Good Plugins with AAlib and libvpx Source: https://docs.racket-lang.org/docs_racket-lang_org_markdown/overscan/getting-started.html Installs the 'good' set of GStreamer plugins via Homebrew, including optional dependencies like AAlib for ASCII art conversion and libvpx. ```Shell brew install gst-plugins-good --with-aalib --with-libvpx ``` -------------------------------- ### Install GStreamer Base Plugins with Pango Source: https://docs.racket-lang.org/docs_racket-lang_org_markdown/overscan/getting-started.html Installs the base set of GStreamer plugins via Homebrew, ensuring the Pango text layout library is included for text overlay functionality. ```Shell brew install gst-plugins-base --with-pango ``` -------------------------------- ### Example Racket Function Call Source: https://docs.racket-lang.org/docs_racket-lang_org_markdown/x64asm/Getting_Started.html A simple example showing a call to a Racket function `fib` with an argument, illustrating how Racket code examples are presented in this documentation context. ```Racket (fib 40) ``` -------------------------------- ### Install Ragg Package via Command Line Source: https://docs.racket-lang.org/docs_racket-lang_org_markdown/ragg This command uses the `raco setup` utility to install the ragg package from a local PLT file. This method is applicable for Racket versions 5.3.1 and earlier. ```Shell raco setup -A ragg.plt ``` -------------------------------- ### Installing Pygments with Pip Source: https://docs.racket-lang.org/docs_racket-lang_org_markdown/frog/Quick_start.html Installs the Pygments library, which is used by Frog for syntax highlighting in fenced code blocks. This requires Python 3 and uses the pip package installer. ```Shell $ python3 -m pip install pygments ``` -------------------------------- ### Build and Preview Site Source: https://docs.racket-lang.org/docs_racket-lang_org_markdown/frog/Quick_start.html Regenerates the static site files based on the content and configuration, and then starts a local web server to allow previewing the generated site in a browser. ```Shell raco frog -bp ``` -------------------------------- ### Print Denxi Examples Directory Path (Shell) Source: https://docs.racket-lang.org/docs_racket-lang_org_markdown/denxi-guide/index.html Executes a Racket expression from the shell to determine the file path of the Denxi examples collection. This command is provided to help users locate the example code on their local machine for further study and practice. It requires Racket and Denxi to be installed. ```Shell racket -e '(~a (collection-file-path \"examples\" \"denxi"))' ``` -------------------------------- ### Install GStreamer Ugly Plugins with x264 Source: https://docs.racket-lang.org/docs_racket-lang_org_markdown/overscan/getting-started.html Installs the 'ugly' set of GStreamer plugins via Homebrew, including the x264 library for H.264 video encoding. ```Shell brew install gst-plugins-ugly --with-x264 ``` -------------------------------- ### Setting up Racket Handin Client (Shell) Source: https://docs.racket-lang.org/docs_racket-lang_org_markdown/handin-server/Quick_Start_for_a_Test_Drive.html This command uses 'raco setup' to install or configure the 'handin-client' collection, making it available for use, typically within DrRacket. ```Shell raco setup handin-client ``` -------------------------------- ### Install GStreamer Core via Homebrew Source: https://docs.racket-lang.org/docs_racket-lang_org_markdown/overscan/getting-started.html Installs the core GStreamer framework and its dependencies, including GObject Introspection, using the Homebrew package manager on macOS. ```Shell brew install gstreamer ``` -------------------------------- ### Install Ragg Package via Command Line Source: https://docs.racket-lang.org/docs_racket-lang_org_markdown/ragg/index.html This command installs the Ragg package using the `raco setup` tool, which is part of the Racket distribution. It provides an alternative method to installing packages via the DrRacket GUI's 'Install PLT File...' option. ```Shell raco setup -A ragg.plt ``` -------------------------------- ### Scribble Text-Mode Examples Source: https://docs.racket-lang.org/docs_racket-lang_org_markdown/scribble/getting-started.html This snippet shows various examples of the @ syntax in Scribble's text mode, demonstrating how to use commands with arguments ([...]), text bodies ({...}), or both, and how to include Racket forms directly. ```Scribble @([require] scriblib/figure) @[section][#:tag "poetry"]{Of Mice and Cookies} See @[secref]["milk"]. @[section][#:tag "milk"]{@[italic]{Important} Milk Supplies} @[figure]["straw" @[elem]{A straw}]{@[image]["straw.png"]} ``` -------------------------------- ### Load and Start Racket Web Server Source: https://docs.racket-lang.org/docs_racket-lang_org_markdown/more/index.html Demonstrates the interactive commands used in the Racket REPL to load the server code from a file named 'serve.rkt' and then start the server process, listening for connections on port 8080. ```Racket (enter! "serve.rkt") (serve 8080) ``` -------------------------------- ### Install Darwin using Raco Source: https://docs.racket-lang.org/docs_racket-lang_org_markdown/darwin@darwin/Quick_start.html Installs the Darwin blog generator package using the Racket package manager, raco. This command fetches and installs Darwin and its dependencies. ```Shell raco pkg install darwin ``` -------------------------------- ### Install Racket Package as Link Source: https://docs.racket-lang.org/docs_racket-lang_org_markdown/vulkan/Setup.html Installs the current directory as a Racket package using a link, useful for contributors working directly with the source code. ```Shell raco pkg install --link ``` -------------------------------- ### Racket Plisqin Example Query Source: https://docs.racket-lang.org/docs_racket-lang_org_markdown/plisqin/Read_Me_First.html A demonstration of constructing a query using Plisqin's Racket syntax. It retrieves product details, filters, orders, and limits the results, showcasing the library's query building capabilities. ```Racket (aw:show-table (from p Product (limit 3) (select (ProductName p)) (select (CategoryName p)) (select (TotalSales p)) (order-by 'desc (TotalSales p)))) ``` -------------------------------- ### Using count-iters for Conditional Iteration (Racket) Source: https://docs.racket-lang.org/docs_racket-lang_org_markdown/kb-base/Getting_Started_with_Keybindings.html This example illustrates the `count-iters` form, which iterates based on a condition (`forward-sexp-exists?`), a step size (1), and a step type ('sexp'). It continues as long as the condition is true and progress can be made. A setup procedure is used to initialize the editor buffer content and cursor position before running the keybinding program. The form returns the number of successful iterations. ```Racket (test-kb-program (count-iters (forward-sexp-exists?) 1 'sexp) #:setup-proc (λ (editor) (send editor insert "() () ()") (send editor set-position 0))) ``` -------------------------------- ### Building and Previewing Frog Project Source: https://docs.racket-lang.org/docs_racket-lang_org_markdown/frog/Quick_start.html Builds the static blog site from the source files and launches a local web server to preview the generated site in a browser. The output shows the server address and instructions to stop it. ```Shell $ raco frog -bp Frog 0.26 Launching /usr/bin/python pipe.py Your Web application is running at http://localhost:3000/index.html. Stop this program at any time to terminate the Web Server. C-c C-c Web Server stopped. ``` -------------------------------- ### Installing Rosette Package (Shell) Source: https://docs.racket-lang.org/docs_racket-lang_org_markdown/rosette-guide/ch_getting-started.html This command uses the Racket package manager (raco) to install the Rosette system package. It is the standard way to add Rosette to a Racket installation. ```Shell raco pkg install rosette ``` -------------------------------- ### Example: Starting a dotmethod Module - Racket Source: https://docs.racket-lang.org/docs_racket-lang_org_markdown/dotmethod/index.html Begins an example module using the `#lang dotmethod` extension with `racket` as the base language. ```Racket #lang dotmethod racket ``` -------------------------------- ### Generating PDF Output with Scribble (Command Line) Source: https://docs.racket-lang.org/docs_racket-lang_org_markdown/scribble/getting-started.html This command uses the `--pdf` flag to generate a PDF document from a Scribble source file. This requires `pdflatex` to be installed on the system. The output is saved as a file with a `.pdf` extension. ```Shell scribble --pdf mouse.scrbl ``` -------------------------------- ### Introducing Procedures in Racket Source: https://docs.racket-lang.org/docs_racket-lang_org_markdown/describe/index.html Prints a header indicating the start of examples related to procedures. ```Racket (printf "~n--- Procedures ---~n") ``` -------------------------------- ### Install Rhombus Package via Raco Source: https://docs.racket-lang.org/docs_racket-lang_org_markdown/rhombus/Quick_Start.html This command demonstrates how to install the 'rhombus' package using the 'raco' command-line tool, which is part of the Racket distribution. This step is necessary if you did not install a Racket snapshot that includes Rhombus. ```Shell raco pkg install rhombus ``` -------------------------------- ### Manual Koyo Console Setup (Racket) Source: https://docs.racket-lang.org/docs_racket-lang_org_markdown/koyo/console.html Demonstrates the manual steps required to initialize and start the Koyo console. This involves defining the path to the dynamic module, creating and setting a namespace, specifying components to stub, and finally invoking the start procedure with the defined path and namespace. ```Racket (define dynamic.rkt (build-path here "dynamic.rkt")) (define start-console) (define ns (make-base-empty-namespace)) (current-namespace ns) (koyo:stubbed-components '(server pubsub)) (koyo:start-console dynamic.rkt ns) ``` -------------------------------- ### Running a RackUnit Test Suite in Racket Source: https://docs.racket-lang.org/docs_racket-lang_org_markdown/rackunit/quick-start.html This snippet shows how to execute a defined RackUnit test suite. It requires the `rackunit/text-ui` module to get the `run-tests` function, which then runs the specified test suite (`file-tests`) and prints the results to the console. ```Racket (require rackunit/text-ui) (run-tests file-tests) ``` -------------------------------- ### Example Usage of a Racket Component Source: https://docs.racket-lang.org/docs_racket-lang_org_markdown/component/index.html Demonstrates how to create an instance of the `mailer` component, check its initial state using the accessor `mailer-started?`, start the component using `component-start`, and verify the state change after starting. ```Racket ([define m (mailer #f)) (mailer-started? m) (mailer-started? ([component-start m)) ``` -------------------------------- ### Run Minimal Vulkan Example Source: https://docs.racket-lang.org/docs_racket-lang_org_markdown/vulkan/Setup.html Runs a basic Racket script that uses the Vulkan library to create and destroy an instance, confirming basic API interaction. ```Shell racket examples/minimal.rkt ``` -------------------------------- ### Quickstart: Initialize Client and Capture Exception (Racket) Source: https://docs.racket-lang.org/docs_racket-lang_org_markdown/sentry/index.html This snippet demonstrates the basic usage of the Racket Sentry SDK. It shows how to install the library, create a Sentry client instance with a DSN, set the client as the current one using `parameterize`, capture a simple exception, and finally stop the client to ensure events are sent. ```Racket (require sentry) (define client (make-sentry "https://key@sentry.io/12")) (parameterize ([current-sentry client]) (sentry-capture-exception! (make-exn:fail "an error" (current-continuation-marks)))) (sentry-stop client) ``` -------------------------------- ### Basic Denxi Launcher (Racket) Source: https://docs.racket-lang.org/docs_racket-lang_org_markdown/denxi-guide/index.html Defines a minimal Denxi launcher program using `#lang denxi/launcher`. It includes a `module+` block for the `main` entry point, which calls `launch-denxi!` to start the Denxi process. ```Racket #lang denxi/launcher (module+ main (launch-denxi!)) ``` -------------------------------- ### Getting Start State in OpenFST (Racket) Source: https://docs.racket-lang.org/docs_racket-lang_org_markdown/openfst/index.html Returns the state identifier for the start state of the given fst. If the FST lacks a start state, either due to being empty or invalid, the procedure returns #false. ```Racket procedure (fst-start fst) → (or/c #f exact-nonnegative-integer?) ``` -------------------------------- ### Installing Racket-Mike from Remote Catalog (Raco) Source: https://docs.racket-lang.org/docs_racket-lang_org_markdown/mike/mike-about.html Installs the Racket-Mike package from the official Racket package catalog using the raco package manager. ```Shell raco pkg install mike ``` -------------------------------- ### Importing Dependencies for RackUnit Test File Source: https://docs.racket-lang.org/docs_racket-lang_org_markdown/rackunit/quick-start.html Sets up a Racket test file (`file-test.rkt`) by specifying the base language and importing the necessary libraries: `rackunit` for testing capabilities and the local file (`file.rkt`) containing the code to be tested. ```Racket #lang racket/base (require rackunit "file.rkt") ``` -------------------------------- ### Run Racket with Honu at REPL Source: https://docs.racket-lang.org/docs_racket-lang_org_markdown/honu/Get_started.html Invoke the Racket command-line interpreter with the '-Iq honu' flags to start an interactive REPL session using the Honu language. This allows for direct evaluation of Honu expressions. ```Shell racket -Iq honu ``` -------------------------------- ### Starting the Racket REPL (Shell) Source: https://docs.racket-lang.org/docs_racket-lang_org_markdown/more/index.html Command to launch the Racket interactive environment (REPL) from the command line. This allows users to execute Racket code directly and interactively. ```Shell $ racket ``` -------------------------------- ### Run Denxi Launcher with Install Command (Shell) Source: https://docs.racket-lang.org/docs_racket-lang_org_markdown/denxi-guide/index.html Executes the `my-denxi.rkt` launcher script using the `racket` interpreter. It passes the `do` command with `++install-abbreviated` and specifies `definition.rkt` as the target, demonstrating how to use the launcher from the command line. ```Shell $ racket my-denxi.rkt do ++install-abbreviated definition.rkt ``` -------------------------------- ### Get Help for Tiny BASIC Example Source: https://docs.racket-lang.org/docs_racket-lang_org_markdown/tinybasic/index.html Display command-line help specific to a Tiny BASIC example script, such as the Guess Number game. Use the `-- --help` syntax to pass the help flag to the example script itself. ```Shell racket -l tinybasic/examples/guess-number -- --help ``` -------------------------------- ### Initialize Frog Project Source: https://docs.racket-lang.org/docs_racket-lang_org_markdown/frog/Quick_start.html Runs the Frog initialization command to set up a new project directory, creating the necessary structure and the default frog.rkt configuration file. ```Shell raco frog --init ``` -------------------------------- ### Call 'start' Label (Racket) Source: https://docs.racket-lang.org/docs_racket-lang_org_markdown/x64asm/Getting_Started.html Calls the procedure starting at the label `start` again. This is the second recursive call. `rel32` indicates a 32-bit relative call offset. ```Racket ([call] ([rel32] start)) ``` -------------------------------- ### Creating a Thing with Initial Procedures in Racket Source: https://docs.racket-lang.org/docs_racket-lang_org_markdown/qtops/things.html Illustrates how to provide a list of initial procedures when creating a 'thing' using `create-thing`, allowing the thing to respond to specific symbols immediately. ```Racket (define milkweed (create-thing "milkweed" (list (lambda (t) (list (cons 'pop (lambda () (printf "Pop!")))))))) ``` ```Racket (milkweed 'pop) ``` -------------------------------- ### Scribble Comment Syntax Examples Source: https://docs.racket-lang.org/docs_racket-lang_org_markdown/scribble/getting-started.html These examples demonstrate the two primary forms of comments in Scribble using the @; syntax: a block comment enclosed in braces and a line comment that runs to the end of the line. ```Scribble @;{ ‹comment› } @; ‹line-comment› ``` -------------------------------- ### Displaying Fitbit Client Command Line Help (Shell) Source: https://docs.racket-lang.org/docs_racket-lang_org_markdown/simple-oauth2/Example_Command_Line_Tools.html Shows how to display the help message for the `fitbit` command-line tool. Lists the available options, their short and long forms, and descriptions, including date range, units, format, and output file options. Useful for understanding tool usage. ```shell $ fitbit -h fitbit [