Hacker News new | past | comments | ask | show | jobs | submit | Siecje's comments login

Compatible releases should replace older versions.

Why would you want to install an old version of ruff?


Because packages shouldn't be upgraded in a project until they have been tested. If you give me no way of downloading version 1.0 of a package in my project because 1.1 supersedes it and 1.1 breaks my project, what am I supposed to do?


>Why would you want to install an old version of ruff?

Because something else in your project is broken by the new version.


I'm against lead but I'm curious why people don't complain about brass?


That's a lot of lines going to the outdoor unit.

Is there two per indoor head?


It looks like that unit may have 3 indoor heads. Two lines per head. Power to each head. Power to the outdoor unit.


Looks like it. I'd suggest anyone looking at a system like that install at least 2 separate outdoor units. That way if one breaks the other can still work - and most of the year it will be powerful enough to handle the whole house (some rooms will be a little uncomfortable but bearable)


This is correct, 3 heads. One on each level of the house.


What is your podcast going to be about?


I have some open source Python projects that could use some help.

I have been working on a static site generator which uses Flask.

https://github.com/siecje/htmd

I have been learning trio (async Python library) by implementing beanstalkd.

https://github.com/Siecje/beanstalkd-asyncio


I wish I could disable shorts on Android.

I have a watch later playlist that I want to get through but I find myself scrolling on shorts.


Use asyncio. Bind to a socket, set blocking False, then asyncio.run(on_new_connection(sock)).

Inside that coroutine get the loop and await loop.sock_accept(sock)

And then asyncio.create_task(on_connection_data(connection)).

The only gotcha is you need to keep a reference to that task so it doesn't get garbage collected.


Thank you. Do you have more information regarding this? Why do I await the socket acceptance? How do I handle the disconnect? How do I send messages into and out of the coroutine?


Get garbage collected by what? Doesn’t Python use reference counting?


The reference implementation (CPython) does use reference counting, but that is not its only approach to garbage collection.

"The default build implementation is a generational collector. The free-threaded build is non-generational; each collection scans the entire heap."

https://devguide.python.org/internals/garbage-collector/

https://docs.python.org/3/library/gc.html

(And as someone else pointed out, asyncio's event loop keeps only weak references to tasks, so the GC implementation doesn't really matter here.)


asyncio doesn't store strong references to tasks. It is your responsibility to keep the ref: https://docs.python.org/3/library/asyncio-task.html#asyncio....

Consider organizing the code using TaskGroup.


Python has a GC.


8 degrees is not normal+/- 1 C is what I experience


8 degrees is not normal+/- 1 C is what I experience.


Does anyone make a keyboard where the caps lock button stays down so you know what state it's in?


Not really anymore nowadays. The Apple Extended Keyboard[0] did have that feature. Similarly, Cherry used to produce a lock variant of their MX switches[1] that could be used for a such purpose. However this switch really only ever saw use in industrial applications.

[0]: https://en.wikipedia.org/wiki/Apple_Extended_Keyboard

[1]: https://deskthority.net/wiki/Cherry_MX_Lock


The short answer, no. The state of Caps Lock is entirely in host software, to the keyboard it is just another key. To get what you’re looking would require some very expensive mechanical contraption to reflect the state of the LED. And then what if you have reassigned Caps Lock, as is common? As cool as it might look it’s going to be a very limited niche.


USB HID does have codes for locking versions of Caps Lock, Num Lock, and Scroll Lock¹. OS X might support these, given that older Mac keyboards had locking Caps Lock. Linux doesn't².

¹ https://www.usb.org/document-library/hid-usage-tables-15

² https://elixir.bootlin.com/linux/v6.7.3/source/drivers/hid/h...


Having written USB HID code for barcode scanners where this came up (thrilling I know). None of the major OSes support it including OS X. It’s sort of a homage to a historical artifact (that table dates to the early 90s) but useless because even if you use those old keyboards you will have to emulate with the usual scan code.


Barcode scanners are cool. I'm working on setting up a barcode system for my personal library and then probably home inventory. Do you have any recommendations?

I found 4 used scanners for cheap (Datalogic Gryphon GD4400).


I mean sure, in theory something else can activate caps lock. In practice, it's only ever activated through a button press on the keyboard used. Caps lock being activated by something else or being reassigned to another button is the edge case here.


A laptop with external keyboard is not exactly an edge case. In Windows the caps lock state is per session, not per keyboard and I believe this is the case with most Linux desktops, the Mac is an exception here. Even there, the other case you are missing in your truth table is button depressed when not connected (ie the initial state). None of the common OS have locking support out of the box.

> Caps lock being activated by something else or being reassigned to another button is the edge case here.

BS. There is more variety to the assignment of the caps lock key then I think you realize even if in isolation some of them are edge cases (input method switching is a big one). https://support.apple.com/en-euro/guide/mac-help/mchl84525d7... Windows has similar including chords in the standard configuration for Japanese on non Japanese keyboards.

I think pointing out edge cases while ignoring that the request is for something that doesn’t exist with no evidence of high demand is an edge case is quite silly.

I was going to say just get a Cherry MX lock and pop it in, but those have been discontinued for what seem to me to be obvious reasons.


Why does the keyboard send caps lock? I assumed it would either send capital character or lowercase character.


That’s not how it works because it is more flexible and sensible to do the translation of a physical key location to a logical function within the OS. While fancier keyboards do allow alternate key maps and macros, your basic standard keyboard is just a stateless matrix of numbers (scan codes). Any hardwired button state handling or latching diminishes straightforward programmability on the OS side.

Understand that you can configure any modern OS for any arbitrary keyboard layout regardless of what type of keyboard is connected. The keyboard itself has no concept of what is a capital letter and what is a lowercase letter, it’s just buttons. This makes sense, because at the end of the day touch typists don’t really care what is printed on the keycaps. If I want to use Chinese (eg pinyin), Japanese (which is a cluster of layouts), or Dvorak on a US keyboard why should it matter? This can be handled easily in the OS, the keyboard is dumb.

And the concept of uppercase and lowercase as it would apply to a QWERTY layout doesn’t make even make sense for many languages.

When you press the physical caps lock key you’re just sending a number just like the Q key or something. The OS decides what to do with it. I have virtually no use for caps lock personally so it’s a control key. Using it as a dual purpose key for input method switching is not uncommon. More generally another reason for not baking in functionality in the keyboard is provision of accessibility features such as Sticky Keys and Filter Keys.


As an alternative, my Surface Pro 3 has an LED on the Caps Lock key to indicate on/off. It is a terrible keyboard otherwise, but perhaps there's other keyboards out there with this feature.


Being able to feel the state is best. It means when you hit caps lock you know if it is in the wrong state and can hit it again.

It saves you from typing a couple characters and then removing them, fixing the caps lock state and re-typing them.


Ahh, my blind spot - tactile feedback. My hands aren't very sensitive to touch.


Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: