Questions tagged [evenly]

21 questions
9
votes
7 answers

php split array into smaller even arrays

I have a function that is supposed to split my array into smaller, evenly distributed arrays, however it seems to be duplicating my data along the way. If anyone can help me out that'd be great. Here's the original array: Array ( [0] =>…
SoulieBaby
  • 5,405
  • 25
  • 95
  • 145
9
votes
1 answer

Evenly distribute repetitive strings

I need to distribute a set of repetitive strings as evenly as possible. Is there any way to do this better then simple shuffling using unsort? It can't do what I need. For example if the input is aaa aaa aaa bbb bbb The output I…
Guha
  • 93
  • 3
5
votes
1 answer

What is the best way to evenly distribute objects to fill a curved space in Unity 3D?

I would like to fill this auditorium seating area with chairs (in the editor) and have them all face the same focal point (the stage). I will then be randomly filling the chairs with different people (during runtime). After each run the chairs…
johnny117
  • 73
  • 1
  • 8
5
votes
3 answers

Coordinates of equally distanced n points on a circle in R?

I want to get the coordinates of the equally distanced n points on a circle in R. Mathematically the solution is: exp((2*pi * i)*(k/n)) where 0 <= k < n There are many SOF questions to handle this problem. All the solutions are in non-R…
Erdogan CEVHER
  • 1,788
  • 1
  • 21
  • 40
3
votes
2 answers

How to get an evenly distributed sample from Perl array values?

I have an array containing many values between 0 and 360 (like degrees in a circle), but unevenly distributed: 1,45,46,47,48,49,50,51,52,53,54,55,100,120,140,188, 210, 280, 355 Now I need to reduce those values to e.g. 4 only, but as evenly as…
janmartin
  • 361
  • 1
  • 3
  • 5
3
votes
1 answer

Equal sized cells in NSSegmentedControl

For my NSSegmentedControl, I use it do display a bar to control a NSTableView. I have code set up to control the size programmatically: for (NSInteger i = 1; i <= numberOfSegments; i++) { CGSize textSize = [[NSString…
Minebomber
  • 1,209
  • 2
  • 12
  • 35
3
votes
2 answers

Distributing an amount as evenly as possible

We have have a certain amount e.g. 300 units. This amount should be as evenly as possible distributed over 40 "slots". It would be easy if each slot would be the same - so it would be 7,5 at each slot. However, the slots vary in size and we cannot…
Fabian Stolz
  • 1,935
  • 7
  • 27
  • 30
2
votes
1 answer

Distribute evenly in 2D

So i'm trying to distribute 2D items evenly accros the screen. Right now I have it working in a way where i select all items and it calculates the size of the canvas, than calculates all widths of objects together to see how much whitespace it has.…
Patrick
  • 135
  • 1
  • 14
2
votes
2 answers

I want to make evenly distributed sphere in vtk (python)

As you can see in title, I want to make evenly distributed sphere in vtk (python) First, I saw this link " Evenly distributing n points on a sphere " which is a method to create evenly distributed sphere. Through that link, I got the x,y,z…
박태영
  • 75
  • 6
2
votes
2 answers

gnuplot - change scale of axis

I have the following data in cr.dat 0.03 0.0227352 0.02 0.0276084 0.01 0.0386684 0.009 0.0407197 0.008 0.0431688 0.007 0.04612 0.006 0.0497781 0.005 0.0545085 0.004 0.0608376 0.003 0.069918 0.002 0.0844434 And the following plot script set xtics (…
tiom
  • 137
  • 1
  • 2
  • 7
1
vote
1 answer

Distribute dataset evenly by range of id in PySpark

I'm very new to PySpark and been having a challenge with partitioning data. I have 2 datasets: Ad data set (very big) with ad_id and some attribute columns Ad transactions data set (smaller), includes ad_id and transaction date It appears to me…
Dan Pham
  • 107
  • 6
1
vote
2 answers

Distribute matches 'tournament friendly'

Say I have four teams, ABCD, I want to create matches so that the teams evenly have to do them: not desired A vs B A vs C A vs D B vs C B vs D C vs D desired A vs B C vs D B vs C A vs D A vs C B vs D Another way of putting it: I want the…
ManIkWeet
  • 1,298
  • 1
  • 15
  • 36
0
votes
1 answer

Evenly distribute arrays data between processes in MPI

I want to solve a load balancing problem using MPI with the C language. Each MPI task has an array of different size (consisting of integers). Initial situation : data is distributed unequally between MPI processes. And we want to get arrays with…
bous
  • 3
  • 2
0
votes
1 answer

distribute types of item in an array as evenly as possible

there are a different number of items of each type. Suppose I have items 'a', 'b' and 'c'. have an array of these items ['a','b','b','c','c','c','a','c'] for example and i want to re position the items in the array so they all get visited as often…
0
votes
3 answers

How can I make all Buttons the same height and width when one of them is facebook LoginButton

I want all Buttons to me the same height and width automatically. The Facebook Button however does not react to android:layout_weight="1", and as I did in the code setting the padding for it will not work consistently.
Tord Larsen
  • 2,670
  • 8
  • 33
  • 76
1
2