Posts

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

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

CenturyAvocado,
@CenturyAvocado@fosstodon.org avatar

@alex I think the Nokia is one you can usurp the TR-069 for too and point it at your own server, make changes via API style communication. Though that sounds more work than your plan of faking UI presses!

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

I prototyped Python bindings for Linux adjtimex() with CFFI, ctypes, Cython, and PyO3 https://github.com/moreati/python-adjtimex-experiments Please be gentle, this is Baby's First Rust.

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

UK now has a £350 grant to install a cross-pavement solution for on-street charging of an EV. AKA cut a thin channel across the pavement for the cable to go in, with a flap so it doesn't trip or impede pedestrians. https://www.find-government-grants.service.gov.uk/grants/electric-vehicle-chargepoint-grant-for-households-with-on-street-parking-1#summary

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

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().

_chrismay,
@_chrismay@fosstodon.org avatar

@alex That's what I'm thinking too. I haven't seen "modern" code like that, The closest code I can think of was from the 2.x era.

The documentation says fromlist "gives the names of objects or submodules that should be imported from the module given by name," but I think you already figured that part out.

link: https://docs.python.org/3/library/functions.html#import__

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

Hypothetically, if you were redoing a small kitchen would it make sense to not fit a hob into the worktop and use plugin induction hob(s) instead? E.g. https://www.ikea.com/gb/en/p/tillreda-portable-induction-hob-2-zones-white-90497166/ You'd gain some worktop and flexibilty, but I'm not sure if I'm missing a big downside. Probably only an option in countries with 220 volt sockets.

sldrant,
@sldrant@mastodon.social avatar

@alex mine is pretty low profile built in to the worktop. Wouldn't want a smaller hob either

alex, to 3DPrinting
@alex@moreati.org.uk avatar

The knob for my cooker hood broke. A replacement is maybe £50. Fortunately the net is bright, and full of nerds. Time to Fix: 60 minutes. https://www.thingiverse.com/thing:4697405

Closeup of a repaired knob for an Ikea Underverk extractor fan. A 3D printed insert is holding the broken piece in place

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

Out of curiosity, what are these? I found them in the bottom of a small wall mount network cabinet, that was fitted in a house, by an electrician. The snipped wires look like CAT-5 solid core.

alex,
@alex@moreati.org.uk avatar

They are gel filled splice connectors, for UTP cable. Commonly called "scotch locks". Based on the search results I think they're more popular in Australia https://www.sciteq.com.au/product/telecom-splice-utp-connectors-red-3-wire-100pk/ https://en.algomtl.com/uy-connector-for-utp-cable-splice-1005402.html

sldrant,
@sldrant@mastodon.social avatar

@alex any idea what the gel helps with?
They do seem vaguely familiar

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

Cat loaf for dinner again

alex, to 3DPrinting
@alex@moreati.org.uk avatar

Printed some wooden-train bridge supports for one of my regulars https://www.thingiverse.com/make:1142793 Tried a different infill pattern (adaptive cubic) to shave 30 minutes of the print time, and save some filament.

alex,
@alex@moreati.org.uk avatar

@sldrant are the vent holes on the tunnel sections just decorative?

sldrant,
@sldrant@mastodon.social avatar

@alex yes, though I think both were printed in two halves as they're quite tall for most printers

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

If cars are going to be smart, should the connectivity be user replaceable? My car can phone home, somewhere under the bonnet is SIM and a modem. I don't know if it's 3G or 4G ( probably not 2G). 3G is being phased out in the UK https://www.bbc.co.uk/news/technology-59583783
Instead, imagine a USB WiFi and/or cellular modem that plugs in behind the rear view mirror. It's standardised and easy to swap out.

alex,
@alex@moreati.org.uk avatar

@sldrant we're also relying on our manufacturer to keep their cloud services running. I think I'll need to pay a subscription for that soon. Ditto for some home chargers with an internal SIM.

sldrant,
@sldrant@mastodon.social avatar

@alex my home charger is pretty dumb (and WiFi, not sim) the car OTOH has a bit more smarts and is def 2g/3g and suspect I'll need to pay for the modem upgrade

alex, to 3DPrinting
@alex@moreati.org.uk avatar

Maker World is Bambu Labs take on Thingiverse or Printables. I just noticed they've added Make My Sign - a simplified in-browser editor to make signs, keyrings etc with custom text. You must be logged in to see it https://makerworld.com/en/makerlab/makeMySign

alex,
@alex@moreati.org.uk avatar

I'm curious if there are other web tools for generating customised 3D models by filling just a few parameters. E.g. a bolt of thread T, length L, head H; a globe diamater d, land height H.
I know parametric CAD models exist, it's a streamlined UI I'm wondering about.

xorn,
@xorn@mastodon.social avatar

@alex Thingiverse customizer does that. However, my personal experience is that customizer is a bit slow and it's more pleasant to just install OpenSCAD and download the .scad files from thingiverse

https://www.thingiverse.com/apps/customizer/run?thing_id=193647

MakerWorld's sign generator is way nicer than customizer.

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

Teach a Gorillapod new magnetic tricks. Drill a hole in each foot, epoxy a rare earth magnet in each hole. Optionally cover with a thin layer of Sugru. https://www.instructables.com/Magnetic-Gorillapod/

sldrant,
@sldrant@mastodon.social avatar

@alex might depend on the shape of the bit. A wood one might work better than a steel/general one

alex,
@alex@moreati.org.uk avatar

@sldrant the wood bit didn't make much difference, apart from leaving a more ragged edge. A hollow bit (hole saw) might work, but those aren't easily available at 10mm diameter.

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

Can an electric vehicle charger (EVSE) know how how charged the connected vehicle is? Maybe, a thread 🧵.

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

/stdio gotcha: sys.stdout.write('something\r') might look like it didn't run. It did run, then '\r' returned the cursor to column zero and the output on that line was overwritten, perhaps by your command prompt. This toot inspired by performing unholy acts to sudo with the pty module https://gist.github.com/moreati/281db7b3e01cb63231e710e2178912c3

isagalaev,
@isagalaev@mastodon.social avatar

@orsinium @alex if I'm not mistaken, it's not Python's behavior, it's OS's. stdout/stderr are buffered by default and are flushed either when hitting a bufsize (4096 on Linux), or at the new line. You can always sys.stdout.flush() if you don't want a new line.

orsinium,
@orsinium@fosstodon.org avatar

@isagalaev @alex You're right!

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

Background investigation: do any smart watches have the whole watch face as a real clicky button? It's for use while wearing kote (padded mittens for ), so I don't think a touch screen or small side buttons will work.

alex,
@alex@moreati.org.uk avatar

@sldrant do you mean buttons around the edge? Those are typically too small to operate with kote on. I'm after something you can poke with 4 fingers at once.

sldrant,
@sldrant@mastodon.social avatar

@alex yeah, the 4 round the edge. I'd wager you could still work the larger watches with that on, but you'd want to try one before buying as that is some big mit.
Voice control? Or a BLE big button and a phone app?

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