Live data from Hacker News

How many flies are in my apartment?

saml98.github.io

151–158 of 158 posts

Re: How many flies are in my apartment?

#151

Earlier quoted context omitted.

*insect abuse I think repeatidly slapping them with a pretty soft plastic attraption until they stop moving is even harsher though. Or slapping them outta the air, trying to electrocute them but having too little power on the shitty device so only their wings get burned. Or vacuuming them up Or flushing them down the drain. Honestly, whatever people usually do to them it's way way crueller

> I think repeatedly slapping them with a pretty soft plastic contraption until they stop moving is even harsher It's soft to you, not to the fly. You don't slap a fly "until it stops moving". When you swat a fly, it explodes.

Not the big ones. The first slap stuns them at best, sometimes not even that.

Re: How many flies are in my apartment?

#153

Earlier quoted context omitted.

How exactly do you that and can you interop with python?

I just used this in the Jupyter notebook (toldya it was very simple, written today :). It interoperates with python by being passed data to the draw call. Usage like: c = Canvas(); c.draw(xs); xs is a numpy array of shape (N, 2), the points to draw on the canvas. It's not fancy. But it drew animations faster than matplotlib (I ran this for thousands of frames, just to watch the simulation). import IPython.display as…

That's awesome. I'm probably gonna start using this instead of matplotlib

Re: How many flies are in my apartment?

#155

Earlier quoted context omitted.

I just used this in the Jupyter notebook (toldya it was very simple, written today :). It interoperates with python by being passed data to the draw call. Usage like: c = Canvas(); c.draw(xs); xs is a numpy array of shape (N, 2), the points to draw on the canvas. It's not fancy. But it drew animations faster than matplotlib (I ran this for thousands of frames, just to watch the simulation). import IPython.display as…

That's awesome. I'm probably gonna start using this instead of matplotlib

Maybe just use ipycanvas instead - it's on PyPI :) It works the same way except it's not a hack. I found it after I posted.

I went through:

- matplotlib animations (super slow, not live)

- writing an image with PIL and updating display (flickers)

- custom html+canvas code

- ipycanvas

I call display() on the canvas and then run the draw update loop on the canvas later in the same cell. That way the canvas is first displayed and then "live" updated.

Re: How many flies are in my apartment?

#157

Earlier quoted context omitted.

That's awesome. I'm probably gonna start using this instead of matplotlib

Maybe just use ipycanvas instead - it's on PyPI :) It works the same way except it's not a hack. I found it after I posted. I went through: - matplotlib animations (super slow, not live) - writing an image with PIL and updating display (flickers) - custom html+canvas code - ipycanvas I call display() on the canvas and then run the draw update loop on the canvas later in the same cell. That way the canvas is first dis…

Oh wow even better. Thanks for enlightening me on this

Re: How many flies are in my apartment?

#158
post #115
post #113

Earlier quoted context omitted.

I want a mosquito-killing turret [1] that you could put in your bedroom and sleep in peace. Turns out one exists [2] (in theory—no commercial product a decade later), but the one I was thinking of would use microphones rather than cameras [3] to detect the bloody suckers. Thing is, I can't find any prior research or even hints that people have considered this approach. (The closest I can find is an app [4] that detec…

My acoustically-minded friend had the following to say: > Off the top of my head, I'm guessing the problem has mostly to do with background noise, and it only working in moderately quiet environments. > As for locating the source of a sound, there's plenty of research that's been done about that. A directional mic doing sweeps is probably not your best bet, as it would be slow and difficult to cover three dimensions.…

All this work, to suggest a fly spotlight device is hysterical. That would be marginally helpful, and maximally frustrating. I lend the project my full support were it to ever materialize.

Thank you for this analysis.

Post reply on HN