Questions tagged [bounds]

In user interfaces and graphics, bounds refer to the size and location of a window or view.

In user interfaces and graphics, bounds refers to the size and location of a window or view. In 2D graphics, this is broken down into four parts. Combinations often used include:

  • x-location, y-location, width, and height.
  • x-location, y-location, right, bottom.

Likewise, in 3D graphics, bounds are often broken into 6 components:

  • x, y, z, width, height, depth
769 questions
2
votes
1 answer

Rust Traits with Type Bounds

I want to write a basic abstraction of a database, using Rust traits. pub trait Keyable { type Key; fn key(&self) -> &Self::Key; } and // type alias for result - DbError are defined elsewhere pub type Result = Result; pub…
2
votes
0 answers

Setting NSTextAttachment bounds doesn't work on iOS 15

let attachment = NSTextAttachment() attachment.image = UIImage(named: "icon") attachment.bounds = CGRect(x: 8, y: 0, width: 12, height: 12) The above code works well on mobile phones under iOS15, but the interval between text and image…
haha
  • 21
  • 1
2
votes
1 answer

Bounds in scipy curve_fit

I am trying to fit a two-component Gaussian fit: mu0 = sum(velo_peak * spec_peak) / sum(spec_peak) sigma = np.sqrt(sum(spec_peak * (velo_peak - mu0)**2) / sum(spec_peak)) def Gauss(velo_peak, a, mu0, sigma): res = a *…
alex
  • 71
  • 6
2
votes
2 answers

Flutter. GoogleMap. I need to find LatLngBounds from a list of LatLng(latitude, longitude) on screen?

I am using this package: [google_maps_flutter: ^2.0.1][1] And i have this list of LatLng: List _list = [ LatLng(PointA.lat, PointA.lng), // Point A LatLng(PointB.lat, PointB.lng), // Point B LatLng(PointC.lat, PointC.lng), // Point C …
Akbar Pulatov
  • 2,955
  • 2
  • 16
  • 33
2
votes
1 answer

Using parameters as bounds for scipy.optimize.curve_fit

I was wondering if it is possible to set bounds for the parameters in curve_fit() such that the bounds are dependent on another parameter. For example, say if I wanted to set the slope of a line to be greater than the intercept. def linear(x, m,…
2
votes
1 answer

How does GEKKO optimization with bounded variables work?

I am using GEKKO to estimate the parameters of a differential equation and I have bounded one of the variables between 0 and 1. However, when I solve the ODE, I get values outside of the bounds for this variable, so I was wondering if somebody knew…
user606273
  • 143
  • 6
2
votes
2 answers

Creating view with programmatic constraints causes the content to be drawn in the wrong place

I am adding a custom view to another view who then has its constraints set programatically. This results in the content of the view being drawn in the wrong place, and I'm not sure why. Here's the code I have and what I tried so far: // Called in…
CristianMoisei
  • 2,071
  • 2
  • 22
  • 28
2
votes
1 answer

Rust trait bounds for integral types

Suppose I have my own type as a tuple struct struct MyType(u8); And would like to implement the From trait for the other integral types in a generic way, like impl From for MyType { fn from(num: T) -> Self { MyType((num & 0xff) as…
Miguel
  • 658
  • 1
  • 6
  • 19
2
votes
1 answer

How to animate contentsRect property along a path?

I have a png sprite sheet and corresponding plist file loaded and I'm trying to animate contentsRect property of a CALayer to display a sprite animation from the above mentioned aprite sheet. Here is a code: CGFloat width =…
PrimeSeventyThree
  • 940
  • 2
  • 9
  • 24
2
votes
1 answer

i have this error: IndexError: index 40 is out of bounds for axis 0 with size 40, i can't understand the fount of the error. pls

import pandas as pd import numpy as np import sklearn from sklearn import linear_model import matplotlib.pyplot as pyplot import pickle from matplotlib import style data = pd.read_csv("student-mat.csv" , sep=";") data = data[["age", "traveltime" ,…
2
votes
1 answer

How to apply a downwards curve on a UIView at the top

So I've seen few posts with regards to how to add a curve on a UIVIEW such as How to apply Curve at bottom of UIImageView? but I haven't seen any with regard to how to add a downward curve at the top of a UIView. I have tried playing around with the…
Simon McNeil
  • 293
  • 1
  • 13
2
votes
1 answer

Create a Bound Exponential Column in R

How can I create an exponential percentage column in a data frame between the years 2022 and 2040 which is bound by the range 1% and x% where I can set the "peak" of the exponential equation? In the expected outcome table below, the percentage…
SharpSharpLes
  • 302
  • 4
  • 20
2
votes
1 answer

Geopandas Spatial Join - AttributeError: 'NoneType' object has no attribute 'bounds'

I have the following geodataframes, corresponding to a regular grid: id grid_id geometry 0 48 0 (POLYGON ((2.052457758079306 41.42493869117656... 1 49 1 (POLYGON ((2.052470852112577…
Rodrigo Vargas
  • 273
  • 3
  • 17
2
votes
0 answers

GAMS: How to solve for initial function value too large?

In GAMS, I get the following error message if I increase a parameter above a certain threshold: ** An initial function value is too large (larger than 1.0E+10). Scale the variables and/or equations or add bounds. Is there a way I can get GAMS to…
pelorn
  • 21
  • 5
2
votes
4 answers

Custom UIView with smaller bounds than frame

Is it possible to create a custom uiview (loaded from a nib) with bounds smaller than the frame. So I would like to show a part of the frame/view. On a button press I want to slide the bounds to the right to see the whole frame. Can this be done?
user517153
  • 205
  • 2
  • 8