/dpt/ - Daily Programming Thread

What are you working on, Jow Forums?

Last thread:

Attached: 1523642301499.jpg (1280x720, 263K)

Other urls found in this thread:

github.com/JuliaCollections/DataStructures.jl/blob/master/src/heaps/arrays_as_heaps.jl).
youtube.com/watch?v=bLHL75H_VEM
hakaran.com/
twitter.com/NSFWRedditImage

First for decorators
class Button:
def __init__(self):
self.click_handler = None

def on_click(self, func):
self.click_handler = func

def update(self):
click_event_happened = True

if click_event_happened and self.click_handler != None:
self.click_handler()


btn = Button()

@btn.on_click
def handler():
print("Button has been clicked")

btn.update()

>First
you mean zeroth?

OP is zeroth

No, 0P is the 0th poster

Fuckin yikes

is click_event_happened persistent across calls to update?
also you've gained literally nothing over just using func

Just going to be the first in this thread to mention that not all instructions are created equally some take longer than others to execute.

#instructiondescrimination

>What are you working on, Jow Forums?
A shorter fizzbuzz
(,&((;,>)Fizz`Buzz)@":{~+.&3-~0:

Attached: 1553459454479.jpg (1000x1000, 230K)

This code is disgusting. Never post this again.

Attached: DxXFVP5V4AACC0L.jpg (135x143, 6K)