User talk:Danf

From Noisebridge
Jump to: navigation, search

Hi, Danf[edit]

Danf, it was a pleasure to meet you and Kevin last night. I just added a user page to this wiki. —Ben Kovitz (talk) 03:47, 27 May 2013 (UTC)

New device for now[edit]

Hi Dan, my roommate lilly has borrowed me her MindWave Mobie. It has the same ThinGear chip, but talks over bluetooth, not RF. I have a bluetooth receiver on my laptop, but I reckon the dream machine does not. Either way we can use it to debug the plexer code you're writing. Also see for an object oriented approach to reading data off sent by the ThinkGear. robintibor is more maticulous about data rows than akloister. See you at the pwn meeting tomorrow. User:bfb

whatsup hacka?[edit]


Nothing going tonight. Up late, needing sleep. See you tomorrow. PS found a light read on mind/brain sleep research in the 20th century, linked under current readings. -kevin


Thanks Immonad (talk) 18:40, 31 July 2013 (UTC)

this is an example of a note to say hello via wiki because email is a broken protocol, considered harmful, and depracatable[edit]

say what ??? --Danf (talk) 01:18, 22 August 2013 (UTC)

Good stuff[edit]

By golly have a listen

Connectivity Restored...[edit]

to switch 31, aka the collaboration station.


   def egcd(a, b):
       if a == 0:
           return (b, 0, 1)
           g, y, x = egcd(b % a, a)
           return (g, x - (b // a) * y, y)

I've never seen anything like it.

hey dan[edit]

Chris here. Good talking last night. Here's the deep learning site I mentioned. Curious to hear what you think.

Bluetooth Dongle[edit]

I think we have a BS009 from BlueSoleil

HTML5 Canvas Element[edit]

Thought you might like to play around with this.. I just stumbeled on this shape hacking a grid together.

       <script type="text/javascript">                                                  
         function rect(ctx, grid, step, cur){                                           
             ctx.lineTo(cur, 0)                                                         
             ctx.lineTo(cur, grid)                                                      
             ctx.lineTo(0, cur)                                                         
             ctx.lineTo(grid, cur)                                                      
             if (cur < grid){                                                           
                 rect(ctx, grid, step, cur+step)                                        
         function draw(grid){                                                           
           var canvas = document.getElementById('bg');                                  
           if (canvas.getContext){                                                      
             var ctx = canvas.getContsext('2d');                                        
             ctx.strokeStyle = '#808080';                                               
             rect(ctx, grid, 20, 20)                                                    
       <style type="text/css">                                                          
         canvas { border: 1px solid black; }                                            
     <body onload="draw(800);">                                                       
       <canvas id="bg" width="800" height="800"></canvas>         


from random import shuffle
# from itertools import combinations

def combinations(iterable, r):
    pool = tuple(iterable)
    n = len(pool)
    if r > n:
    indices = list(range(r))
    yield tuple(pool[i] for i in indices)
    while True:
        for i in list(range(r))[::-1]:
            if indices[i] != i + n - r:
        indices[i] += 1
        for j in range(i+1, r):
            indices[j] = indices[j-1] + 1
        yield tuple(pool[i] for i in indices)

def deck():
    r = list(range(3))
    d = [(a,b,c,d) for a in r for b in r for c in r for d in r]
    return d

def deal(d, n):
    if len(d) < n:
        return []
    return [d.pop() for i in range(n)]

def is_set(trio):
    att = lambda x: set(y[x] for y in trio)
    atts = (att(x) for x in range(4))
    return all(len(x) != 2 for x in atts)

def sets(h):
    return [trio for trio in combinations(h, 3) if is_set(trio)]

def pare(h, cards):
    for c in cards:
def replace(h, d):
    n = 12 - len(h)
    if n == 0:
        n = 3
    h.extend(deal(d, n))
def round(d, h):
    found_sets = sets(h)
    while found_sets:
        first_set = found_sets[0]
        yield first_set
        pare(h, first_set)
        found_sets = sets(h)
    replace(h, d)

def play():
    d = deck()
    h = deal(d, 12)
    found_sets = []
    num_rounds = 0   
    while len(d) > 2:
        num_rounds += 1      
        print("round %d" % num_rounds)
        for x in round(d, h):
    print("%d sets found in %d rounds" % (len(found_sets), num_rounds))