-
Notifications
You must be signed in to change notification settings - Fork 0
/
xtileseg.html
122 lines (114 loc) · 7.21 KB
/
xtileseg.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html;charset=utf-8">
<title>xtileseg.py</title>
<link rel="stylesheet" href="pycco.css">
<meta name="thumbnail" content="https://avatars0.githubusercontent.com/u/23156192?v=3&s=200" />
<link rel="shortcut icon" href="favicon.png" type="image/png">
</head>
<body>
<div id='container'>
<a href="https://github.com/ttv1/src/blob/master/xtileseg.py"><img style="z-index: 10; position: absolute; top: 0; left: 0; border: 0;" src="https://camo.githubusercontent.com/567c3a48d796e2fc06ea80409cc9dd82bf714434/68747470733a2f2f73332e616d617a6f6e6177732e636f6d2f6769746875622f726962626f6e732f666f726b6d655f6c6566745f6461726b626c75655f3132313632312e706e67" alt="Fork me on GitHub" data-canonical-src="https://s3.amazonaws.com/github/ribbons/forkme_left_darkblue_121621.png"></a>
<div id="background"></div>
<div class='section'>
<div class='docs'><h1> xtileseg.py</h1><p> This is ttv1 code (Timm tools, version 1).</p></div>
</div>
<div class='clearall'>
<div class='section' id='section-0'>
<div class='docs'>
<div class='octowrap'>
<a class='octothorpe' href='#section-0'>#</a>
</div>
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-55634425-2', 'auto');
ga('send', 'pageview');
</script>
<p><img
src="https://avatars0.githubusercontent.com/u/23156192?v=3&s=200"
align=left
width=120>
<br> <br>
<a href="http://ttv1.github.io">home</a> | <a href="#discussion">discuss</a> | <a href="https://github.com/ttv1/src/issues">report bug</a>
<br>
<script>
(function() {
var cx = '009630129455493240085:aja5uvdnjeo';
var gcse = document.createElement('script'); gcse.type = 'text/javascript'; gcse.async = true;
gcse.src = (document.location.protocol == 'https:' ? 'https:' : 'http:') + '//www.google.com/cse/cse.js?cx=' + cx;
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(gcse, s);
})();
</script>
<div style="width:0px;overflow:hidden;height:0px;"> <!-- if you use display:none here, it doesn't work-->
<gcse:search></gcse:search>
</div>
<form style="margin-left: 20px;" id="searchbox_009630129455493240085:aja5uvdnjeo" action="">
<input value="009630129455493240085:aja5uvdnjeo" name="cx" type="hidden"/>
<input value="FORID:11" name="cof" type="hidden"/>
<input id="q" style="" name="q" size="25" type="text"/>
<button class="btn">Search</button>
</form></p>
<p><br clear=all></p>
<hr />
<p>from xtile import xtiles,xtile
from random import random as r</p>
<p>@eg
def _xtile1():
tiles, nums, table = xtile(r() for _ in range(1000))
print("pretty",tiles,table)
print("raw ",nums)</p>
<p>@eg
def _xtile2():
n = 100000
s1= "s1",[r()<strong>4/2 for _ in range(n)]
s2= "s2",[r()</strong>2 for _ in range(n)]
s3= "s3",[r()<strong>0.5*1.5 for _ in range(n)]
s4= "s4",[r()</strong>0.5*0.33 for _ in range(n)]
for (a,b,c),d in xtiles([s1,s2,s3,s4]):
print(a,c,":",d)</p>
<p>if <strong>name</strong> == '<strong>main</strong>':
eg()</p>
</div>
<div class='code'>
<div class="highlight"><pre><span class="n">____</span>
<span class="o"><</span><span class="n">img</span> <span class="n">align</span><span class="o">=</span><span class="n">right</span>
<span class="n">src</span><span class="o">=</span><span class="s">"https://raw.githubusercontent.com/timm/timm.github.io/master/timm.png"</span>
<span class="n">width</span><span class="o">=</span><span class="mi">170</span><span class="o">></span></pre></div>
</div>
</div>
<div class='clearall'></div>
<div class='section' id='section-1'>
<div class='docs'>
<div class='octowrap'>
<a class='octothorpe' href='#section-1'>#</a>
</div>
<h1> Copyleft</h1><p> This is ttv1 code (Timm tools, version 1).</p>
</div>
<div class='code'>
<div class="highlight"><pre><span class="n">Copyright</span> <span class="o">&</span><span class="n">copy</span><span class="p">;</span> <span class="mi">2016</span> <span class="n">Tim</span> <span class="n">Menzies</span> <span class="o"><</span><span class="n">tim</span><span class="nd">@menzies.us</span><span class="o">></span>
<span class="n">This</span> <span class="n">program</span> <span class="ow">is</span> <span class="n">free</span> <span class="n">software</span><span class="o">.</span> <span class="n">It</span> <span class="n">comes</span> <span class="n">without</span> <span class="nb">any</span> <span class="n">warranty</span><span class="p">,</span> <span class="n">to</span>
<span class="n">the</span> <span class="n">extent</span> <span class="n">permitted</span> <span class="n">by</span> <span class="n">applicable</span> <span class="n">law</span><span class="o">.</span> <span class="n">You</span> <span class="n">can</span> <span class="n">redistribute</span> <span class="n">it</span>
<span class="ow">and</span><span class="o">/</span><span class="ow">or</span> <span class="n">modify</span> <span class="n">it</span> <span class="n">under</span> <span class="n">the</span> <span class="n">terms</span> <span class="n">of</span> <span class="n">the</span> <span class="n">Do</span> <span class="n">What</span> <span class="n">The</span> <span class="n">F</span><span class="o">*</span><span class="n">ck</span> <span class="n">You</span> <span class="n">Want</span>
<span class="n">To</span> <span class="n">Public</span> <span class="n">License</span><span class="p">,</span> <span class="n">Version</span> <span class="mi">2</span><span class="p">,</span> <span class="k">as</span> <span class="n">published</span> <span class="n">by</span> <span class="n">Sam</span> <span class="n">Hocevar</span><span class="o">.</span> <span class="n">See</span>
<span class="p">[</span><span class="n">http</span><span class="p">:</span><span class="o">//</span><span class="n">www</span><span class="o">.</span><span class="n">wtfpl</span><span class="o">.</span><span class="n">net</span><span class="p">](</span><span class="n">http</span><span class="p">:</span><span class="o">//</span><span class="n">www</span><span class="o">.</span><span class="n">wtfpl</span><span class="o">.</span><span class="n">net</span><span class="p">)</span> <span class="k">for</span> <span class="n">more</span> <span class="n">details</span><span class="o">.</span>
<span class="n">Share</span> <span class="ow">and</span> <span class="n">enjoy</span><span class="o">.</span></pre></div>
</div>
</div>
<div class='clearall'></div>
<div class='section' id='section-2'>
<div class='docs'>
<div class='octowrap'>
<a class='octothorpe' href='#section-2'>#</a>
</div>
</div>
<div class='code'>
<div class="highlight"><pre></pre></div>
</div>
</div>
<div class='clearall'></div>
</div>
</body>