Tell us what works and what could be better. We read every submission.
@albcunha·6 public vizzes
This visualization maps the geographic regions where the sun reaches a specific elevation angle (60.87°) at a given UTC time, showing both southern and northern hemisphere latitude ranges as colored polygons on a folium map. The code uses Skyfield’s ephemeris data to compute solar altitude for each longitude across a grid of latitudes, then identifies matching latitude bands within a tolerance. Folium renders the resulting polygons in red and blue, with the map centered at [0,0] and a zoom level of 2, illustrating the global path of equal solar elevation.
This example converts a tall image into a table-based OpenDocument (ODT) file by slicing it into horizontal strips of 75 pixels each. It uses Python’s Pillow library (`Image.crop`, `Image.new`) to segment the image, then embeds each slice into the ODT’s `Pictures/` directory via `zipfile`. The code dynamically writes XML content referencing table rows and images, with a helper function to update the archive. It processes all JPG and PNG files in the current directory, producing a spreadsheet-like visual layout from the original raster data.
This visualization batch-processes image files by running optical character recognition on each photo and storing the extracted text in the EXIF metadata field `ImageDescription`. It scans folders for JPG, JPEG, and PNG files, uses the `pyocr` library with Tesseract to recognize Portuguese text, and writes the result via `piexif`. The script employs `multiprocessing.Pool` for parallel execution and skips already-processed files by checking for existing descriptions or thumbnail files.
A Python script enables horizontal mouse wrapping across three monitors, allowing the cursor to jump from the left edge of monitor 1 to the right edge of monitor 3, and vice versa. It checks the cursor position via `win32api.GetCursorPos` and moves it with `SetCursorPos`, polling every 0.1 seconds in a loop. A system tray icon, created with `infi.systray.SysTrayIcon`, runs the monitoring process in a separate `multiprocessing.Process`, and the icon itself is decoded from a base64-encoded bitmap embedded in the script.
This macro script for LibreOffice renames the current document through a custom dialog, saving it under a new name and deleting the original file. It demonstrates the use of the Uno API to access the desktop, current document, and dialog controls, along with utility functions like `fileUrlToSystemPath`, `storeToURL`, and `loadComponentFromURL`. The script also employs `zipfile` and `os` for file operations, though their roles are not explicitly shown in the visible logic. It relies on Python’s `uno` module and the `com.sun.star.awt` interfaces for dialog creation and event handling.
This example captures book pages using two Android smartphone cameras as a book scanner. It fetches JPEG images from the IP cameras via HTTP requests with the `requests` and `grequests` libraries, then crops and rotates the images using PIL’s `Image` module. The code checks focus by displaying cropped previews before saving paired left and right page photos with sequential filenames.