Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

My workday

Name: Anonymous 2012-10-11 5:27

I was assigned to some ERP project. That shit is boring as hell so I accidentally opened FIOC interpreter and wasted some time.

Damn I hate enterprise crap.


Python 2.7.2 (default, Jun 12 2011, 15:08:59) [MSC v.1500 32 bit (Intel)] on win32
Type "copyright", "credits" or "license()" for more information.
DreamPie 1.1.1
>>> u = (1,1,1)
>>> v = (2,2,2)
>>> zip(u, v)
0: [(1, 2), (1, 2), (1, 2)]
>>> def dot(u, v):
...     sum(a*b for a, b in zip(u, v))
>>> dot(u, v)
>>> def dot(u, v):
...     return sum(a*b for a, b in zip(u, v))
>>> dot(u, v)
1: 6
>>> def intrsct(ld, so, sr):
...     ld = unit_vec(ld)
...     base = dot(ld, so) # direction . center point
...     discr = dot(ld, so) ** 2 - dot(so, so) + sr ** 2
...     if (discr < 0):
...         return []
...     elif discr == 0:
...         return [x * base for x in ld]
...     dists = [base + math.sqrt(discr), base - math.sqrt(discr)]
...     return [[x * dist for x in ld] for dist in dists]
>>> def unit_vec(u):
...     ulen = dot(u, u)
...     return [float(x) / ulen for x in u]
>>> unit_vec(v)
2: [0.16666666666666666, 0.16666666666666666, 0.16666666666666666]
>>> def unit_vec(u):
...     ulen = math.sqrt(dot(u, u))
...     return [float(x) / ulen for x in u]
>>> import math
>>> unit_vec(v)
3: [0.5773502691896258, 0.5773502691896258, 0.5773502691896258]
>>> intrsct([1, 0, 0], [0, 0, 0], 1.0)
4: [[1.0, 0.0, 0.0], [-1.0, -0.0, -0.0]]
>>> def draw_shit(spheres, rows, cols, camdist=2.0):
...     result = [[0 for i in range(cols)] for j in range(rows)]
...     for row in range(rows):
...         for col in range(cols):
...             y = float(row) / rows - 0.5
...             x = float(col) / cols - 0.5
...             raydir = (x, y, camdist)
...             if any(len(intrsct(raydir, sphere[0], sphere[1])) > 0 for sphere in spheres):
...                 result[y][x] = res
...     return result
>>> spheres = [([0.1, 0, 5], 1)]
>>> rs = draw_shit(spheres, 40, 40)
Traceback (most recent call last):
  File "<pyshell#16>", line 1, in <module>
    rs = draw_shit(spheres, 40, 40)
  File "<pyshell#14>", line 9, in draw_shit
    result[y][x] = res
NameError: global name 'res' is not defined
>>> def draw_shit(spheres, rows, cols, camdist=2.0):
...     result = [[0 for i in range(cols)] for j in range(rows)]
...     for row in range(rows):
...         for col in range(cols):
...             y = float(row) / rows - 0.5
...             x = float(col) / cols - 0.5
...             raydir = (x, y, camdist)
...             if any(len(intrsct(raydir, sphere[0], sphere[1])) > 0 for sphere in spheres):
...                 result[y][x] = 1
...     return result
>>> rs = draw_shit(spheres, 40, 40)
Traceback (most recent call last):
  File "<pyshell#18>", line 1, in <module>
    rs = draw_shit(spheres, 40, 40)
  File "<pyshell#17>", line 9, in draw_shit
    result[y][x] = 1
TypeError: list indices must be integers, not float
>>> def draw_shit(spheres, rows, cols, camdist=2.0):
...     result = [[0 for i in range(cols)] for j in range(rows)]
...     for row in range(rows):
...         for col in range(cols):
...             y = float(row) / rows - 0.5
...             x = float(col) / cols - 0.5
...             raydir = (x, y, camdist)
...             if any(len(intrsct(raydir, sphere[0], sphere[1])) > 0 for sphere in spheres):
...                 result[row][col] = 1
...     return result
>>> rs = draw_shit(spheres, 40, 40)
>>> len(rs)
5: 40
>>> len(rs[0])
6: 40
>>> for r in rs:
...     print ''.join(r)
Traceback (most recent call last):
  File "<pyshell#23>", line 2, in <module>
    print ''.join(r)
TypeError: sequence item 0: expected string, int found
>>> for r in rs:
...     print ''.join(map(str, r))
0000000000000000000000000000000000000000
0000000000000000000000000000000000000000
0000000000000000000000000000000000000000
0000000000000000000000000000000000000000
0000000000000000000111111000000000000000
0000000000000000111111111111100000000000
0000000000000011111111111111111000000000
0000000000001111111111111111111100000000
0000000000011111111111111111111110000000
0000000000111111111111111111111111000000
0000000001111111111111111111111111100000
0000000001111111111111111111111111110000
0000000011111111111111111111111111110000
0000000111111111111111111111111111111000
0000000111111111111111111111111111111000
0000000111111111111111111111111111111100
0000001111111111111111111111111111111100
0000001111111111111111111111111111111100
0000001111111111111111111111111111111100
0000001111111111111111111111111111111100
0000001111111111111111111111111111111110
0000001111111111111111111111111111111100
0000001111111111111111111111111111111100
0000001111111111111111111111111111111100
0000001111111111111111111111111111111100
0000000111111111111111111111111111111100
0000000111111111111111111111111111111000
0000000111111111111111111111111111111000
0000000011111111111111111111111111110000
0000000001111111111111111111111111110000
0000000001111111111111111111111111100000
0000000000111111111111111111111111000000
0000000000011111111111111111111110000000
0000000000001111111111111111111100000000
0000000000000011111111111111111000000000
0000000000000000111111111111100000000000
0000000000000000000111111000000000000000
0000000000000000000000000000000000000000
0000000000000000000000000000000000000000
0000000000000000000000000000000000000000
>>> rs = draw_shit(spheres, 40, 60)
>>> for r in rs:
...     print ''.join(map(str, r))
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000011111111110000000000000000000000
000000000000000000000001111111111111111111100000000000000000
000000000000000000001111111111111111111111111100000000000000
000000000000000000111111111111111111111111111111000000000000
000000000000000011111111111111111111111111111111110000000000
000000000000000111111111111111111111111111111111111000000000
000000000000001111111111111111111111111111111111111100000000
000000000000011111111111111111111111111111111111111110000000
000000000000111111111111111111111111111111111111111111000000
000000000001111111111111111111111111111111111111111111100000
000000000011111111111111111111111111111111111111111111110000
000000000011111111111111111111111111111111111111111111110000
000000000111111111111111111111111111111111111111111111111000
000000000111111111111111111111111111111111111111111111111000
000000000111111111111111111111111111111111111111111111111000
000000000111111111111111111111111111111111111111111111111000
000000001111111111111111111111111111111111111111111111111100
000000000111111111111111111111111111111111111111111111111000
000000000111111111111111111111111111111111111111111111111000
000000000111111111111111111111111111111111111111111111111000
000000000111111111111111111111111111111111111111111111111000
000000000011111111111111111111111111111111111111111111110000
000000000011111111111111111111111111111111111111111111110000
000000000001111111111111111111111111111111111111111111100000
000000000000111111111111111111111111111111111111111111000000
000000000000011111111111111111111111111111111111111110000000
000000000000001111111111111111111111111111111111111100000000
000000000000000111111111111111111111111111111111111000000000
000000000000000011111111111111111111111111111111110000000000
000000000000000000111111111111111111111111111111000000000000
000000000000000000001111111111111111111111111100000000000000
000000000000000000000001111111111111111111100000000000000000
000000000000000000000000000011111111110000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
>>> def print_shit():
...     rs = draw_shit(spheres, 40, 60)
...     for r in rs:
...         print ''.join(map(str, r))
>>> def print_shit():
...     rs = draw_shit(spheres, 40, 75)
...     for r in rs:
...         print ''.join(map(str, r))
>>>

Name: Anonymous 2012-10-11 21:23

>>10
APL is unreadable.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List