- The current state/value of a widget should be obvious/visible.
- If the value doesn't fit the last digit should be faded to indicate that the value shown is only partial. A good heuristic would be to choose a size that is large enough to fit 3 digit numbers (e.g. selecting a value between 0-100)
- Expand the label when the user is interacting with the widget.
- The the widget's state/value should always be visible, move the location of the label if necessary (e.g. when pointer is interacting with the widget)
- A widget should optionally provide an indication of the min/max boundaries, where relevant.
- The slider should optionally provide an indication of intermediate values (e.g. axis ticks) between the min/max boundaries, where relevant.
- UI elements that are used for fine control (e.g. knobs) should be big enough to make them easy to grab.
- For widgets with a single functionality the entire widget's area should optionally be wired to trigger the widget's action.
| // Author: Victor I. Afolabi | |
| // Implementing the Fibonacci series using Rust's Iterator | |
| #[derive(Debug, PartialEq, PartialOrd)] | |
| pub struct Fib { | |
| current: usize, | |
| next: usize, | |
| } | |
| impl Fib { |
| // Author: Victor I. Afolabi | |
| // | |
| // Exploring Iterator Traits in Rust to implement Flatten functionality of 2D-iterators. | |
| // | |
| pub trait IteratorExt: Iterator { | |
| fn flatten_ext(self) -> Flatten<Self> | |
| where | |
| Self: Sized + std::fmt::Debug, | |
| Self::Item: IntoIterator, |
| /// Computes the greatest common divisor of two integers using Euclid's algorithm | |
| /// (https://en.wikipedia.org/wiki/Euclidean_algorithm). | |
| /// | |
| /// # Example | |
| /// | |
| /// ```rust | |
| /// assert_eq!(gcd(3, 5), 1); | |
| /// | |
| /// assert_eq!(gcd(2 * 3 * 5 * 11 * 17, 3 * 7 * 11 * 13 * 19), 3 * 11); | |
| /// ``` |
| fn gltf_node_spawner( | |
| mut commands: Commands, | |
| node_handles: Query<(Entity, &Handle<GltfNode>), Added<Handle<GltfNode>>>, | |
| assets_gltf_nodes: Res<Assets<GltfNode>>, | |
| assets_gltf_mesh: Res<Assets<GltfMesh>>, | |
| ) { | |
| for (parent, handle) in &node_handles { | |
| let Some(node) = assets_gltf_nodes.get(handle) else { | |
| warn!("GltfNode not found: entity {:?}, {:?}", parent, handle); | |
| continue; |
| # ---------------------------------------------------------------------------------- | |
| # r u s t f m t - C O N F I G | |
| # ================================================================================== | |
| # | |
| # Version: 0.7.1 | |
| # Author : Robbepop <robbepop@web.de> | |
| # | |
| # A predefined .rustfmt.toml file with all configuration options and their | |
| # associated description, possible values and default values for use in other | |
| # projects. |
| # To use this, you will want to change the location of the saved data | |
| # at least and possibly the functions called below (at the end of the file). | |
| # You first need to install the Python Shapely library for manipulating polygons: | |
| # http://trac.gispython.org/lab/wiki/Shapely | |
| from math import pi, sin, cos, atan2 | |
| import shapely.geometry | |
| import sys, copy |
If you are getting this in gdb on macOS while trying to run a program:
Unable to find Mach task port for process-id 57573: (os/kern) failure (0x5).
(please check gdb is codesigned - see taskgated(8))- Open Keychain Access
- In menu, open Keychain Access > Certificate Assistant > Create a certificate
- Give it a name (e.g.
gdbc)
Revision: 06.08.2023, https://compute.toys/view/398
fn sdCircle(p: vec2f, r: f32) -> f32 {
return length(p) - r;
}I have a Linux virtual machine inside a customer's private network. For security, this VM is reachable only via VPN + Citrix + Windows + a Windows SSH client (eg PuTTY). I am tasked to ensure this Citrix design is secure, and users can not access their Linux VM's or other resources on the internal private network in any way outside of using Citrix.
The VM can access the internet. This task should be easy. The VM's internet gateway allows it to connect anywhere on the internet to TCP ports 80, 443, and 8090 only. Connecting to an internet bastion box on one of these ports works and I can send and receive clear text data using netcat. I plan to use good old SSH, listening on tcp/8090 on the bastion, with a reverse port forward configured to expose sshd on the VM to the public, to show their Citrix gateway can be circumvented.
I hit an immediate snag. The moment I try to establish an SSH or SSL connection over o