2,144 karma · joined February 16, 2013
Makes me appreciate the current role more, which has 4 office events a year, a kids Christmas party where the parent-provided presents are reimbursed, and a standard formula for a leaving drinks budget (roughly enough for one drink per employee per year of employment). People still talk about when a 5- and 7-year veteran both finished up in the same week.
This is the first job outside of the public sector that I’ve seen union materials prominently displayed on internal notice boards.
I struggled to see the value-add, I think it does automatic bundling & inserts polyfills based on UA strings. The whole pika project looks like a rewrite/alternative to the npm servers, kind of like MetaCPAN is for perl's CPAN+search.cpan.org
I struggled because the landing page & about were very light on the project/product's overview, too details-focused for me and I suppose anyone else who wasn't already aware of it.
People = collections.namedtuple('People', ['Englishman', 'Spaniard', 'Ukrainian', 'Norwegian', 'Japanese']) # etc.
def rule_10(people): return people.Norwegian == 0
def rule_2(people, color): return people.Englishman == color.Red
def rule_6(color): return color.Ivory - color.Green == 1
def rule_15(people, color): return abs(people.Norwegian - color.Blue) == 1
def rule_4(beverage, color): return beverage.Coffee == color.Green
# etc.
constraints = [ rule_1, rule_2, ... ] # etc.
def inject(func, vars=locals):
signature = inspect.signature(func)
args_from = operator.attrgetter(signature.parameters.keys())
return func(*args_from(vars))
houses = range(0,5)
for people in map(People._make, perms(houses)):
for color in map(Color._make, perms(houses)):
for beverage in map(Beverage._make, perms(houses)):
for cigarette in map(Cigarette._make, perms(houses)):
for pet in map(Pet._make, perms(houses)):
if all(map(inject, constraints)):
print(f'The {People._fields[beverage.Water]} drinks water')
print(f'The {People._fields[pet.Zebra]} owns the zebra')
sys.exit(0)
print(f'Sorry, no idea who drinks water or owns a zebra')
sys.exit(1)
No pruning of the solution space but `all` will exit early if it can. You could change `inject` (terrible name) to pass the list of rules & call those whose signatures are fulfilled at the beginning of each for-loop, and return a list of the uncalled rules + the results of the called rules, and test the results with `all` & keep the uncalled rules handy for the next for-loop. I didn't do it because there's already too much boilerplate in the for-loopsThat's... just economic growth in capitalism
The battery glue is like a 3M command strip, you're supposed to remove it by applying tension to the side. You need the heat source if the strip breaks and gets trapped underneath, but I used dental floss instead.
I think the root of this black-and-white thinking (the is a right answer to “what pattern should I us?”) & the social disparaging of making a mistake/being wrong both stem from logocentrism in Western critical thought.
The attitude of “being right trumps any objections” is reinforced by CS grads trained by examinations where there are correct answers and doesn’t set them up for the wide world where clients don’t want the technically correct solution when it comes at the cost of delivery speed, brittleness, inflexibility, etc. This is one place where Software Engineering is superior, since it trains students in various techniques and the associated trade-offs. Imagine civil engineers & architects taking the position that, since A Pattern Language says that four square walls and a peaked roof exemplifies the timeless way of building, they insist that is the only way to construct a house.
The real value-add of patterns is giving a standard vocabulary/shorthand for discussing designs without getting bogged down in the boring technical details of the implementation. Uncritically cleaving to them as some sort of defence of quality is pure cargo culting.
scene.updateFlatGraph();
after adding new shapes, before updating the graph & rendering(see https://github.com/metafizzy/zdog/blob/master/js/anchor.js#L...)
edit: made an issue https://github.com/metafizzy/zdog/issues/21
> 2015 MBP Retina 15" - bought I believe in 2016 from Apple website