A story of corporate bureaucracy hacking, programming, automation and depth first search optimization algorithms.
A thread.
At a previous job, everyone was required to track the amount of time they spent on different projects. This is a pretty standard thing but, of course, at this place it was harder than it needed to be.
E.g. instead of saying "X% on task Y" it was "X hours on task Y" AND
there were constraints e.g.:
- You couldn't work more (or less) than 40 hours a week
- Each day had to be exactly 8 hours
Plus, we were an ops team so this was all "funny money"
There could even be .5 hours e.g.
- 8.5 hours on Project X
- 3.5 on Project Y
If you're saying "Wait, this is like a crazy bin packing problem", you are right!
And, we had to do it EVERY week!
The first couple weeks, I tried doing this all by hand which, of course, took a LONG time so I decided to attach this using my old standby: #perl
Thanks @xkcd!
I basically wrote up an algorithm that would start assigning .5 hour blocks to the weekly hour grid and used a Shortest Path Algorithm style search that would traverse the search space for a distribution of hours that met the constraints.
aka a classic optimization problem.
This meant I could enter my time in only a few minutes (basically as fast as I could enter the time into the form). Most excellent!
At this point, I was feeling pretty proud of myself for saving myself time AND using programming to do it.
One day, my manager saw me doing this (we worked in an open plan office) and said "Hey! How are you doing that so quickly??"
I proudly showed her the script I had written.
Her response: "This is amazing! Can you do it for me too? Oooh, can you do it for the whole team too?"
So I quickly added in everyone else's constraints and made it smart so it would look up the unix id of who was calling the script and would only output their schedule.
Everyone loved it and we all started using it for the next couple months.
Months go by and my boss's boss (BB) calls me over and sitting next to him is someone I don't recognize.
(FYI, names have been changed)
BB: "Alex, I would like to introduce you to Maria. She is the CFO for our division (1K+ people). She has some q's for you. Don't lie to her!"
I immediately start going through the game theory in my mind:
- Does he mean lie to her?
- But then why would he say that?
- Maybe that's part of his plan?
- Who knows?
- Do I know?
Eventually, I decided to just tell the truth about whatever she asked.
BB: "You know that script you wrote that fills out our hours for us?"
What I said: "Yes"
What I was feeling:
BB: "Because of that script, we are the ONLY team in the whole division that is 100% compliant. In fact, we are the only team to have even 30% compliance."
Me:
BB: "And because of that, Maria was wondering if we could use your script for the entire division?"
What I said: "Uh, sure!"
What I thought:
And if you like this thread, check out some of my past threads:
GitHub has a talk from 2013 where the Ops guy says:
"We don't have dashboards. If something goes wrong, the alerting system generates a chart showing the error, screenshots it and then drops it in the ops channel"
I think about this quote every time I see a dashboard.
Running a #restaurant Italian style vs American style.
OR
“I could run this whole place with 4 people”
A thread.
Think about your most recent experience at a restaurant in America:
Your waiter:
- took your order
- brought your drinks
- brought your food
- maybe even bussed your table
- brought you the check
They probably were doing this for a section of the restaurant aka a bunch of tables.
This means that any given time, the server is managing a 2 dimensional status board in their head with tables on one axis and order, drinks etc on the other.