problem: how do we get a timestamp for the most recent sunday at midnight?
solution: var x = new Date(new Date().toDateString()) var lastSundayAtMight = x.getTime() - (1000 * 60 * 60 * 24 * x.getDay())
...
I had a pleasant walk into work today.
I saw some colleges from work on the way.
They had gelato.
They offered me some.
It was surprisingly flavorful — mint that reminded me of my mother's mint garden.
[spoiler alert]
I came up with a solution to that problem involving soldiers coordinating when to fire — I solved it first on paper, but I wasn't certain it would work, so I implemented it in javascript
my solution is messier, but essentially the same as the simple/slow one depicted on wikipedia — apparently it can be done faster using black magic
8/27/13
I said before that my roommate told me a cool puzzle,
involving soldiers coordinating when to fire their guns,
and I came up with a solution that seemed optimal,
I could prove it couldn't be faster,
which involved sending a signal all the way down the line,
and then back to the front,
but,
he says the soldiers are only allowed to have finite state machines for brains..
so they can't count..
the thought crossed my mind,
of some lobsters in a pot,
pulling each other down,
as they try to climb out,
screaming: please give us a policy to save us from ourselves!
8/26/13
I love people,
but,
there's this feeling of reverie I get,
where I feel in tune with my thoughts,
and I feel on top of things,
and it pops like a bubble when I need to open my mouth and talk