Tell us what works and what could be better. We read every submission.
@adanner·7 public vizzes
This script displays the next three inbound and outbound trains from Swarthmore station, showing each train’s number and expected arrival time. It queries the Septa Next to Arrive API using Python’s `requests` library, then parses JSON responses to extract scheduled times and delays. The code computes expected arrivals by combining departure times with delay minutes, filtering out trains already past, and prints results as text lines for each direction.
A custom radial force in d3.forceSimulation arranges 80 brown nodes at a radius of 100 pixels and 160 blue nodes at 200 pixels, with d3.forceCollide preventing overlap. The SVG rendering shows two reference circles marking the target radii, while node positions update on each tick using the force simulation’s event handler.
This example presents a step-by-step terminal workflow for installing MIT App Inventor on macOS, sourced from a gist by adanner. It shows the sequence of downloading Java 7, Apache Ant, and PhantomJS, then editing `.bash_profile` to set `JAVA_HOME`, `ANT_HOME`, and `PATH`. The code then clones the appinventor-sources repository and runs `ant clean`, `ant MakeAuthKey`, and `ant` to build successfully. The rendering is plain text in a Markdown file, with no external visualization libraries or APIs used.
This example documents a troubleshooting workflow for fixing QtCreator’s failure to detect a C++ compiler when opening a CMake project. It shows the original error log, which displays an empty `CMAKE_CXX_COMPILER` string, alongside step-by-step text instructions and two screenshots illustrating the Tools->Options->Build & Run->Kits menu. The visualization uses static Markdown text and embedded PNG images to present the diagnostic information and the manual configuration fix.
This example shows the cryptographic proof flow of a Keybase identity claim, displaying the signed JSON message, the PGP signature, and the associated verification text from a GitHub gist. It uses the `keybase` command-line program to demonstrate how the identity is auditable. The visualization renders the proof structure directly from the raw text, with syntax highlighting applied to distinguish the JSON payload, signature block, and markdown-formatted narrative. It relies on standard Web APIs for text parsing and styling, presenting the static gist content as a transparent record of the signing process.
This snippet demonstrates how to query the local system for the number of available CUDA-enabled GPUs and assign one to a specific thread or MPI rank. It shows a two-step workflow: first, `getGPUCount()` uses `cudaGetDeviceCount` to retrieve the GPU count, returning zero on failure; second, `pickGPU()` maps a rank to a GPU via modulo arithmetic and activates it with `cudaSetDevice`, returning -1 if the assignment fails. The code relies on the CUDA runtime API and is intended for multithreaded or MPI environments to avoid device conflicts.
This example demonstrates the basic file-stream operations of the TPIE library through a small C++ program. It writes ten 3D segment structs to a file, copies that file to a second stream, and then reads the copy back, printing each item’s coordinates and the stream size. The code initializes TPIE’s memory manager and stream subsystems, sets a 50 MB memory limit, and uses `tpie::file_stream` with `write`, `read`, and `can_read` methods for sequential I/O. The output shows the original and copied data in text form.