Replies

This profile is from a federated server and may be incomplete. Browse more on the original instance.

conorh, to random
@conorh@mastodon.sdf.org avatar

During lunch a friend mentioned that you can just supply a HTTP URL to vim on the command line and it would use curl to download that resource and allow you to edit the content. I jokingly asked whether if you enter :w it would then issue a HTTP POST back to the origin which is of course ridiculous.

It issues a PUT

alex,
@alex@moreati.org.uk avatar

@conorh vim foo.txt.gz transparently decompresses the file, then recompresses on save. vim bar.tar.gz or vim baz.zip shows a list of the files in the archive, so you can choose which ones to edit tranparently.

fanf, to random
@fanf@mendeddrum.org avatar

heh look what i just found in an old .bashrc

export CVS_RSH=which ssh

alex,
@alex@moreati.org.uk avatar

@fanf was dig eject.cdrom.fanf.eng.demon.net ever wired in to anything? 🙂

alex, to python
@alex@moreati.org.uk avatar

I may write a client library to automate/replace clicking around the web UI of the router my ISP provided (Nokia HA-140W-B). I'll check for existing implementations first, or frameworks I can adapt #HyperOptic #Python

alex,
@alex@moreati.org.uk avatar

@CenturyAvocado I may do eventually, for now it's good enough and I'm happy to self nerd-snipe

nedbat, to random
@nedbat@hachyderm.io avatar

My test suite has just one dot on the last line. What would you do?

  • Delete one test
  • Change the width of the terminal
  • Keep it as a visceral reminder of the uncomfortably chaotic nature of the universe
  • Write more tests
alex,
@alex@moreati.org.uk avatar

@nedbat rewrite the pytest progress indicator using braille characters, so more passing tests fit on a single line.

jpmens, to random
@jpmens@mastodon.social avatar

deleted_by_author

  • Loading...
  • alex,
    @alex@moreati.org.uk avatar

    @jpmens oing? Wasn't that in an old Batman episode? Adam West fought a pig on a pogo stick.

    hynek, to random
    @hynek@mastodon.social avatar

    is there any research on the causality between not bringing ANC headphones and the density of screaming babies because I have a datapoint

    alex,
    @alex@moreati.org.uk avatar

    @hynek could be an opportunity for cross disciplinary collaboration with the meteorology dept., on the Umbrella Hypothesis.

    tubetime, to random
    @tubetime@mastodon.social avatar

    fun fact! the numbers in coin cell part numbers are dimensions. a CR2025 is 20mm diameter and 2.5mm thick!

    alex,
    @alex@moreati.org.uk avatar

    @tubetime also true of cylindrical cells. An 18650 cell is nominally 18 mm diameter by 65 mm long. AA cells are sometimes called 14500, nominal 14 mm dia. by 50 mm length.

    kushal, to python
    @kushal@toots.dgplug.org avatar

    https://strftime.org/ is always a very useful site #python #datetime #time #help

    alex,
    @alex@moreati.org.uk avatar
    sldrant, to random
    @sldrant@mastodon.social avatar

    @Edent sorry if this is a stupid question, but I've been wondering about hardware tokens (fido etc) for a while...

    Do you need a spare in case you lose one or do most sites offer some other secure recovery?

    And how hard is it to enroll a replacement device should you lose one? Do you need to do it on every site again?

    alex,
    @alex@moreati.org.uk avatar

    @Edent @sldrant most sites don't enforce a 2 hardware token minimum. Apple ID does, it's he only one I know of.

    alex,
    @alex@moreati.org.uk avatar

    @Edent @sldrant I didn't mean to contradict your good rule. (Resisting British urge to apologise**2)

    hynek, to random
    @hynek@mastodon.social avatar

    I love writing on my 2018 iPad Pro but god has it gotten slow… please daddy Tim Apple give us new ones in 2024 🥹

    alex,
    @alex@moreati.org.uk avatar

    @hynek I'm probably due too. I hear there's a new connector for docking.

    alex, to python
    @alex@moreati.org.uk avatar

    I've inherited some Python code that calls import('somepkg.module, fromlist=[''])
    Has anyone seen this elsewhere?Is there a significance of an empty string in fromlist?
    Current guess is it's a bug, or a workaround for Python 2.4 era behaviour. The code is https://github.com/mitogen-hq/mitogen/blob/798032b979bf5cabf50d3665f113f67cb5b33152/mitogen/core.py#L682, it's been around since the initial commit https://github.com/mitogen-hq/mitogen/blob/6d403481d44cdffb85ee36cc9e01642bcbc447df/mitogen/core.py#L461

    alex,
    @alex@moreati.org.uk avatar

    I'm looking at this because in modern Python it causes sys.meta_path finders to be called with mpf.find_spec('somepkg.module.', ...), (note the trailing fullstop). Which I'm fairly certain is wrong.

    alex,
    @alex@moreati.org.uk avatar

    import(..., fromlist=['']) isn't unique to Mitogen. It's also in imagepy, webpy, cherrypy, and others https://grep.app/search?q=. Most examples use the returned value. I think it's meant as a way to get the leaf module, rather than the top-level package, e.g.
    >>> import('xml.dom.minidom')
    <module 'xml' from '.../xml/init.py'>
    >>> import('xml.dom.minidom', fromlist=[''])
    <module 'xml.dom.minidom' from '.../xml/dom/minidom.py'>

    alex,
    @alex@moreati.org.uk avatar

    Historical trivia: import() first appeared in Python 1.2, released April 1995

    alex,
    @alex@moreati.org.uk avatar

    import(..., fromlist['']) is handled by code that swallows the exception. A comment notes "Backwards-compatibility dictates we ignore failed imports triggered by fromlist for modules that don't exist." https://github.com/python/cpython/blob/v3.12.2/Lib/importlib/_bootstrap.py#L1414-L1422 So I think it's a trick that became widespread in early Python (pre 2.x?), enough to be a grudgingly accepted unofficial API. I should specifically handle it as a corner case in Mitogen's find_spec(). #Python #Mitogen

  • All
  • Subscribed
  • Moderated
  • Favorites
  • provamag3
  • InstantRegret
  • mdbf
  • ngwrru68w68
  • magazineikmin
  • thenastyranch
  • rosin
  • khanakhh
  • osvaldo12
  • Youngstown
  • slotface
  • Durango
  • kavyap
  • DreamBathrooms
  • JUstTest
  • tacticalgear
  • ethstaker
  • cisconetworking
  • modclub
  • tester
  • GTA5RPClips
  • cubers
  • everett
  • normalnudes
  • megavids
  • Leos
  • anitta
  • lostlight
  • All magazines