Source

yt.geometry_tests / bittwiddle.py

import itertools

i = 105231
h = 555358
h = 1146360

#h, i = 1146365, 105231
#h, i = 555355, 105231
#h, i = 1790047, 105231
#i -= 1
#h += 1

vals = []
bywise = []
flippy = []
for var in [i, h]:
    a = []
    tot = 0
    for j in range(27):
        v = ((var >> j) & 1)
        tot += v
        a.append(str(v))
    vals.append("".join(a[::-1]))
    bywise.append( [vals[-1][0::3],
                    vals[-1][1::3],
                    vals[-1][2::3]] )
    flippy.append("".join(itertools.chain(bywise[-1][::-1])))
    print
    print "".join(['abc']*9)
    print vals[-1], tot
    print "".join(['a']*9 + ['b']*9 + ['c']*9)
    print
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.