HNHacker News
TopNewBestAskShowJobs

bsdz

754 karma · joined April 1, 2019

submissionscomments
bsdz··on Google refuses to reinstate account after man took medical images of son’s groin
That's an interesting dystopia. Using the same lens, I can see similarities between Google and other pioneering companies of the past such as the East India Company (EIC) which sported its own army and ruled large parts of the British Empire.

Other similarities might be market share, i.e. EIC controlled 50% of world trade at its height [1] vs Google's Search being used by 52% of the world in 2019 [2].

That all said, I'm squinting a bit to see this. Unlike Company rule in India [3] where one had little recourse as a subject if the EIC ruled against you; if Google rules against you then you can move to some other provider (of which there are many).

It's still fun to think of these analogies. I was always fascinated by the mega corporation, OCP, in Robocop that sought to privatise large US cities like Detroit [4].

[1] https://en.wikipedia.org/wiki/East_India_Company [2] https://review42.com/resources/google-statistics-and-facts/ [3] https://en.wikipedia.org/wiki/Company_rule_in_India [4] https://robocop.fandom.com/wiki/Omni_Consumer_Products

bsdz··on Inky Impression 5.7“ – Colour e-ink display for Raspberry Pi
Also direct from Pimoroni in the UK for less than £70 although, unfortunately, currently out of stock :(

https://shop.pimoroni.com/products/inky-impression-5-7

bsdz··on Air France announces end to research monkey transport
> as well as testing the drug on a real creature

Please re-read my original comment. In particular, the 92% bit

> you have to test on a full organism

Are you suggesting testing on humans? Clearly that's the only way to clear those "surprises".

> Organoids just don't have the complexity of living creatures

I think the gist of my argument against animal testing is that animal models aren't very good at predicting outcomes in humans.

Furthermore, there have been some disasterous human clinical trials where drugs have passed all the animal model testing but left many of the human participants dead.

bsdz··on Air France announces end to research monkey transport
Many are using these alternatives. For example, a computer model for cardiotoxicity has higher accuracy than animal models.

https://pubmed.ncbi.nlm.nih.gov/28955244/

It's an educational process. A lot of folk just go along with the status quo and feel there's no alternative to animal research.

bsdz··on Air France announces end to research monkey transport
I didn't say that. There are a many alternatives to animal models before "jumping to human trials directly", e.g. testing on human cells & tissues, human-based computer models (like those used for cardiotoxicity) and more recently organ-on-a-chip technologies.
bsdz··on Air France announces end to research monkey transport
Actually it's probably the opposite. Using animal models can lead to drugs that are not safe or effective for humans and it can lead to drugs being rejected that might have been safe or effective. 92% of drugs which prove promising in animal trials fail in human clinical trials.
bsdz··on Ask HN: How is Python's OOP is superior vs. Lisp CLOS?
I think I might be missing your point. Instead of calling super().foo() why not use explicit super(self.__class__, self).foo()? Afaik super uses some runtime binding to set the parameters so if one's skipping that execution due to monkey patching then one has to use explicit form.
bsdz··on 5 Charged with Stalking, Harassing, Spying on US Residents for PRC Secret Police
I've been surprised how nationalist some older Chinese expats are. In particular, I found some older HKers were very pro PRC. This was all before the Umbrella Movement. I put it down to becoming more conservative as you age (anecdotal evidence).
bsdz··on 5 Charged with Stalking, Harassing, Spying on US Residents for PRC Secret Police
ah! indeed that's another possibility, they simply don't get caught (at least this time)
bsdz··on 5 Charged with Stalking, Harassing, Spying on US Residents for PRC Secret Police
Anyone else curious about the ages of the defendants? 59, 73 and 62 years old respectively. Is it harder for the PRC to recruit younger "spies" or are older ones just more reliable?
bsdz··on On Being Indispensable
Many banks, and perhaps other organisations, check for indispensability by means of a mandatory vacation policy. If one is indispensable then it should become apparent when they are forced not to work, log-in or reply to emails for this short period. This policy might also pick up other issues such as some types of fraud that might require constant attention (e.g. hiding evidence as it appears).
bsdz··on Why Do So Many Humans Need Glasses?
Actually, those eye drops are to treat presbyopia which uses a different mechanism.

Presbyopia typically affects older people and presents as long-sightedness (not short-sight like I described earlier). Presbyopia causes the lens in the eye to lose its elasticity and causes the eye to focus light behind the retina.

Curiously, a similar effect (longsight) can be caused by the eyeball being too short (hypermetropia).

That said the eye drops sound like pretty cool treatment.

bsdz··on Why Do So Many Humans Need Glasses?
I'm no expert but from what I've gleaned from various articles around the web and some recent questions to my optician is that myopia is caused by how light rays focus inside our eyes. Rays that don't focus correctly at the back of the eye (perhaps outside the macula?) create a feedback loop that causes the eye to grow longer. Unfortunately there's no opposite effect to make the eye shorter. So naturally there's a predisposition for everyone to become short sighted with this mechanism (perhaps a primary cause of coronavision?):

"It is believed that the trigger for the eye to continue growing beyond its optimal length is in the way rays of light entering the visual system are focused on the back of the eye. In myopia, these rays or images focus in front of the retina causing a blurred image. Spectacles or contact lenses for myopia help focus these rays of light directly onto the retina in the central area correcting the vision, however, in the peripheral areas of the eye the rays of light are focused on theory “behind” the retina. It is believed this is a stimulus for the eye to grow. Myopia control or myopia management spectacles lenses and contact lenses are designed with more than one point of focus and therefore diminish this stimulus for the eye to grow."

Above quoted from:

https://www.openaccessgovernment.org/myopia-management-looki...

bsdz··on Ask HN: What is one book you would recommend everyone to read?
How the mind works - Steven Pinker.
bsdz··on Calling Go Functions from C/Python/Ruby/Node/Java
This article might be a little outdated now (2017).

Recently, I've enjoyed using the Python cffi module to interface with C libraries:

  # not tested!
  this_dir = Path(__file__).parent

  ffi = cffi.FFI()
  ffi.cdef((this_dir / "awesome.h").read_text())
  lib = ffi.dlopen(str(this_dir / "awesome.so"))

  print("awesome.Add(12,99) = %d" % lib.Add(12,99))
bsdz··on Todo-or-die – Provides procedural macros that act as checked reminders
I like the idea and it has a fun name albeit somewhat dramatic (vs todo-or-do-not-compile). Personally, I'd prefer to just add some defensive unit tests to a code base to check upstream functionality is behaving as expected. That said, you can't test for everything and it hasn't been the last time I've been bitten by an upstream library. This is where version pinning is helpful and where upstream vendors / developers have some useful major/minor versioning. At least with a promise (within reason) that minor version bumps are backward compatible and only major version bumps require significant downstream developer attention.

Edit: it was perhaps implicit in my comment. Normally we/I won't ship/release if unit tests fail during CI.

bsdz··on Raspberry Pi SSD/SD Card Image Manager
That's true. Are there any other advantages to using Ubuntu over Raspberry Pi OS? Most of my projects run headless and take advantage of the GPIOs / built in camera. Does Ubuntu support those features well too?
bsdz··on Raspberry Pi SSD/SD Card Image Manager
If, like me, you've a few Raspberry Pi projects and need a standard way to create your base images before first boot then this CLI tool might be for you. So far, I've only tested with a couple of scenarios and the tool has worked very well. I still have to play with using a Custom Phase Script to set up custom drivers / non-standard packages. I'm confident it will work flawlessly. Very impressive IMHO.
bsdz··on Show HN: A simple lazy Python calculation engine, with spreadsheet demo
No reason in particular. Qt has some easy to use widgets and is well documented. I've also some experience with Qt.
bsdz··on Show HN: A simple lazy Python calculation engine, with spreadsheet demo
True. Just an old habit.
bsdz··on Show HN: A simple lazy Python calculation engine, with spreadsheet demo
Yes, you can use any existing python modules. In the demo you'll see I am using pandas dataframes in individual cells. Pandas is built on numpy.
bsdz··on Show HN: A simple lazy Python calculation engine, with spreadsheet demo
Yes I am. Thanks for sharing.
bsdz··on Show HN: A simple lazy Python calculation engine, with spreadsheet demo
Yes you're right! There was something wrong with poetry build system. When I initialised the poetry project roughly a year ago it placed an unpinned dependency (for the build part) for cryptography which recently switched to rust. I'm not sure why poetry hadn't vendorized that package or, at least, pinned the version. In any case, I updated the repo's pyproject.toml to use poetry's new build settings. Then, to check the install works in docker I switched to python's base images and did the following:

  docker run -it --rm python:latest /bin/bash
  curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python -
  cd /tmp
  git clone https://github.com/bsdz/calcengine.git
  cd calcengine
  python3 -mvenv --prompt calceng .venv
  . ./.venv/bin/activate
  pip install "cppy>=1.1.0"
  ~/.poetry/bin/poetry install -E demo
Note that I had to force cppy to install using pip. At some point I'll refresh the poetry lock file to fix these glitches that seem to appear as an untouched project ages.
bsdz··on Show HN: A simple lazy Python calculation engine, with spreadsheet demo
Indeed. Actually with-in the demo samples folder you can find a simple QuantLib example (quantlib.json). Although you'll need to install the QuantLib package separately as I didn't include it in the dependencies.
bsdz··on Show HN: A simple lazy Python calculation engine, with spreadsheet demo
Thank you. Hope there's something useful in there for you :-)
bsdz··on Show HN: A simple lazy Python calculation engine, with spreadsheet demo
It doesn't look like it:

  $ grep name poetry.lock | cut -d" " -f3 | tr -d '"' | tr '\n' ', '
  appdirs,attrs,black,click,cycler,flake8,kiwisolver,matplotlib,mccabe,
  mypy,mypy-extensions,numpy,pandas,pathspec,pillow,pycodestyle,pyflakes,
  pyparsing,pyqt5,pyqt5-sip,python-dateutil,pytz,regex,six,toml,typed-ast,
  typing-extensions
bsdz··on Show HN: A simple lazy Python calculation engine, with spreadsheet demo
That's very strange. The core library uses pure python and demo uses pyqt5, pandas, matplotlib and pillow. I wasn't aware that any of those projects (or sub projects) depend on Rust. I'm running on Linux / Ubuntu 20.04 with Python 3.8. How about you?

(The pip command I just gave should only install the core library and so only depends on base python).

bsdz··on Show HN: A simple lazy Python calculation engine, with spreadsheet demo
Good spot. You can actually just run the following if you don't want to use poetry.

  pip install git+https://github.com/bsdz/calcengine.git#master
Unfortunately, this will only install the core library without the demo spreadsheet files. Even if you were to add the extras modifier "[demo]", it would only install additional dependencies and not the actual demo code. To use the demo you'll need to clone and follow instructions in my other comment.
bsdz··on Show HN: A simple lazy Python calculation engine, with spreadsheet demo
This is something I built a little while ago. It's a proof-of-concept and inspired by what I was doing in my day job.

To play with the demo spreadsheet you'll need to clone the repo and run the demo script, ie:

  git clone git@github.com:bsdz/calcengine.git
  cd calcengine
  python3 -mvenv --prompt calceng .venv
  . ./.venv/bin/activate
  poetry install -E demo
  python demo/spreadsheet/main.py
There's an inline gif showing the spreadsheet in use.

Hope it's interesting :)

bsdz··on SciPy 1.7.0rc1 Release Notes
In python context to "vendor" a 3rd party package usually means bundling it within your own. This makes it easier to build / install your library without having to search for individual dependencies.
← PreviousPage 3 of 5Next →