Mike,
That might work for me in most cases, though I would
have to do things a little differently. I want to rescale
photos that start at about 2000x3000 pixels, to about 1r3
ratio. So approximately 667r2000 would likely give an even
distribution. eg:
_20]\200{.(>?~ )/@(2&x:) 667r2000
0 0 0 1 0 0 0 0 1 0 0 0 1 0 0 1 0 0 0 1
1 0 1 0 0 1 0 0 0 0 1 1 0 0 0 0 0 0 0 0
0 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 1 0 1
0 1 0 1 0 0 1 1 0 0 0 1 1 0 0 0 0 0 0 0
0 0 1 1 0 1 0 0 0 0 0 0 0 1 0 1 1 0 1 0
0 0 0 0 1 1 0 0 0 0 0 0 1 0 0 0 0 1 0 1
1 0 1 0 0 0 1 1 0 1 1 1 1 1 0 1 0 1 0 0
0 0 0 0 0 0 0 1 1 0 0 0 0 1 0 0 1 0 0 1
1 1 1 1 1 1 0 1 1 0 0 1 0 0 0 0 0 0 1 0
1 1 1 0 1 1 0 1 0 0 0 0 0 1 1 0 0 0 0 1
That might be a reasonable approach.
Thanx,
On Mon, 4 Feb 2008, Mike Day wrote:
+ Brian
+
+ RE Boss has reminded us of 2 x: , but as for your requirement
+ of a boolean of 7 ones in 10, this does it randomly, though not
+ necessarily evenly:
+ +/7>10?10
+ 1 0 1 0 1 1 1 1 1 0
+
+ If that's what you need, a tacit verb to do it is:
+ (>?~ )/@(2&x:)
+ as in
+ (>?~ )/@(2&x:)3r20
+ 0 0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0
+
+ Mike
+
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm