All Projects → akalenuk → 16counters

akalenuk / 16counters

Licence: unlicense
GUI for those who don't do GUI

Programming Languages

assembly
5116 projects

Projects that are alternatives of or similar to 16counters

Imgui sdl
ImGuiSDL: SDL2 based renderer for Dear ImGui
Stars: ✭ 134 (+17.54%)
Mutual labels:  debugging-tool, gui
Guify
A simple GUI for inspecting and changing JavaScript variables
Stars: ✭ 111 (-2.63%)
Mutual labels:  gui
Easyfxml
A collection of tools and libraries for easier development on the JavaFX platform!
Stars: ✭ 102 (-10.53%)
Mutual labels:  gui
Jquery Querybuilder
jQuery plugin offering an interface to create complex queries
Stars: ✭ 1,499 (+1214.91%)
Mutual labels:  gui
Invmenu
A PocketMine-MP virion to create and manage virtual inventories!
Stars: ✭ 104 (-8.77%)
Mutual labels:  gui
Desktop
Go/HTML/CSS/JS Desktop application scaffold.
Stars: ✭ 109 (-4.39%)
Mutual labels:  gui
Python Examples
Python examples from my answers on Stackoverflow and other short scripts.
Stars: ✭ 101 (-11.4%)
Mutual labels:  gui
Flixel Ui
GUI library for HaxeFlixel
Stars: ✭ 111 (-2.63%)
Mutual labels:  gui
Blink
使用html来编写golang图形界面程序(only windows)
Stars: ✭ 110 (-3.51%)
Mutual labels:  gui
Hamster Gtk
A GTK3 time tracker. Powered by 'hamster-lib'
Stars: ✭ 106 (-7.02%)
Mutual labels:  gui
Horus ui
HorusUI Immediate Mode Graphical User Interface
Stars: ✭ 106 (-7.02%)
Mutual labels:  gui
Qtquickvcp
A Virtual Control Panel for Machinekit written in Qt/C++/QML
Stars: ✭ 104 (-8.77%)
Mutual labels:  gui
Nuklear Nim
Nim bindings for https://github.com/vurtun/nuklear/
Stars: ✭ 109 (-4.39%)
Mutual labels:  gui
Whatsappbot
Send messages to any person in any time how much you want.
Stars: ✭ 104 (-8.77%)
Mutual labels:  gui
Iframework
Simple Unity Framework
Stars: ✭ 110 (-3.51%)
Mutual labels:  gui
Glasgow
Scots Army Knife for electronics
Stars: ✭ 1,374 (+1105.26%)
Mutual labels:  debugging-tool
Scala Swing
Scala wrappers for Java's Swing API for desktop GUIs
Stars: ✭ 105 (-7.89%)
Mutual labels:  gui
Python Example
How to Build an Electron GUI for a Python Module
Stars: ✭ 108 (-5.26%)
Mutual labels:  gui
Lambda Toolkit
*DO NOT USE* - This project was done during my initial python and lambda's studies. I would recommend you the `serverless framework`.
Stars: ✭ 114 (+0%)
Mutual labels:  debugging-tool
Capturecalls.js
captureCalls('document.getElementById') to show a stack trace for document.getElementById on its every call
Stars: ✭ 112 (-1.75%)
Mutual labels:  debugging-tool

16 Counters

Professionally, I work on a Software Development Toolkit for 3D-printing applications. It's a sack of algorithms and data structures. I get to play with curves, meshes, voxels, and images. But it has no GUI on its own and sometimes this makes things cumbersome.

In 2006, I was in a similar position. I've been working on a 3D-engine with vectors, and triangles, and quaternions. But without any UI. Back then, I came up with the ersatz-GUI: an array of integer counters managed via WinAPI messaging. I named it counters.

The counters form a 4x4 matrix which is convenient for 3D-related things. But you can use it for anything really.

usage example

usage example

usage example

The buttons seem misaligned but there is logic in it. The buttons that has to do with the counters are closer to the counters. And the buttons that expose the window handler are closer to the window handler. And yes, the number on top is the window handler.

It's written in assembly which is good for visibility. You know that there are no hidden overheads, it doesn't eat up a lot of memory, and its performance doesn't depend on the compiler version. It's a separate process so it doesn't crash or hang when the main one does. And this is good for debugging when you want your program to stop every now and then. It's a separate window so Windows manages the message query instead of some third-party broker. And this is good for sustainability, it is 14 years old now and everything works as it was supposed to.

And that's why I'm using it to this day.

Messages

It uses native Windows messaging for communication. In Windows, every window has a handler. It's like a phone number. We can call every window, counters included, and ask it to do something for us. With counters, the whole messaging interface is just 7 patterns.

If you want to send an integer to a specific counter, send it with this message:

SendMessage((HWND)counters_window_handler, WM_USER, counter_idx, value);

To read a counter, use this:

counter_value = SendMessage((HWND)counters_window_handler, WM_USER, 'R', counter_idx);

It's quite common to simply increment and decrement counters so there are special messages for it.

SendMessage((HWND)655890, WM_USER, 'I', counter_idx);   // increment a counter

SendMessage((HWND)655890, WM_USER, 'D', counter_idx);   // decrement a counter

It isn't uncommon to nullify a counter either:

SendMessage((HWND)655890, WM_USER, '0', counter_idx);   // nullify a counter

The last two messages are about timing. Please note that this is not an accurate way to measure time. Nothing wrong with the timestamps underneath but the messaging itself goes in quants. The time between you send and recieve a message is in tens of milliseconds. Generally, you shouldn't try to measure anything in milliseconds not to mention microseconds with this timer.

But if you want some rough measurement, for instance, when you run an algorithm that runs for ten seconds and you want to check that it still runs for ten seconds after you change something, it's fine. It goes like this:

SendMessage((HWND)655890, WM_USER, 'T', counter_idx);
... some workflow long enough to be measured roughly...
SendMessage((HWND)655890, WM_USER, 'S', counter_idx);

Sending T starts the corresponding timer. Sending S stops it and displays elapsed time in milliseconds.

Buttons

  • [0] button nullifies all counters.
  • [N] button updates counters when realtime option is off.
  • realtime checkbox turns printing on and off. It might get laggy if you send tons of messages. This fixes the problem.
  • [W] button copies handler number (remember counters_window_handler?) to the clipboard.
  • [C] button copies a C-style SendMessage template to the clipboard.
  • [T] button copies all the counters to the clipboard.

When it Helps

I found it indispensable for tuning-up progress reporting. It's when your algorithm is crunching data and you want to know is it there yet at every given moment. You know, 0%, 5%, 10%, then 75%, and then 146%. This is something you would generally need a whole application with its dialogs, and slots, and events, and whatnot. Or you can use counters.

It also helps if you want to get some kind of performance monitoring when refactoring. It's when you move things around and suddenly your preprocessing takes 8 seconds instead of 2. Not a big thing if the whole algorithm runs for a minute but definitely a trigger to stop and rethink. Yes, a dedicated benchmark or a profiler will do this better but I don't run a profiler every time I rename a variable. Which, considering name shadowing, might not be the worst idea ever.

Or to count things from different threads. Like every time a thread processes a slice of image data, I increment a counter. Then I see 4096 reported slices for 78 real slices in the input and this explains why a simple image filter runs for a whole minute to begin with.

It's a simple thing that helps me in solving complex problems. If it could help you too, I'll be happy.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].