- 1 Post
- 14 Comments
LegoBrickOnFire@lemmy.worldto
Programmer Humor@programming.dev•Here comes a new JPEG challenger
4·2 months agoCompression algorithms are magic. Especially lossless compression.
LegoBrickOnFire@lemmy.worldto
News@lemmy.world•South Floridians spend more on transportation than almost anyone else in U.S.
1·4 months agoIn switzerland, a really expensive country when it comes to trains, you pay 4000 francs (1$=0.9francs) for one year of access to all of the country’s public transit. You can go basically everywhere confortably. Paying 14000 per year on transport is crazy!
It’s a greentext. A narration on 4chan of the poster in a certain style.
Opening announces that the poster is/was a straight boy.
It is strongly suggested that in the redacted part, the poster discovers that she is neither straight nor a boy.
LegoBrickOnFire@lemmy.worldto
Climate - truthful information about climate, related activism and politics.@slrpnk.net•Temperature Change in Switzerland.3·5 months agoI remember this news end of last year discussing that we still installed a lot of non-renewable heating:
Pour accélérer ce rythme, la solution pourrait être politique. Le peuple suisse a accepté l’an dernier de soutenir financièrement la rénovation des bâtiments, grâce à l’isolation et à l’installation de pompes à chaleur. La Confédération va investir deux milliards de francs sur dix ans dès l’année prochaine.
Il s’agit là de mesures incitatives, mais certains cantons misent, eux, sur des interdictions. A Genève par exemple, à quelques rares exceptions, les propriétaires ne peuvent pas installer des chauffages fonctionnant aux énergies fossiles.
En Valais, par contre, les chaudières à combustible fossile sont toujours autorisées lors des rénovations. Toutefois, à partir du 1er janvier, le Canton posera certaines conditions, notamment sur l’isolation des bâtiments.
Si les réalités régionales varient, le défi est national. Plus de 50% des habitations suisses sont encore chauffées au mazout ou au gaz. Et devront donc, à terme, être rénovées.
LegoBrickOnFire@lemmy.worldto
Climate - truthful information about climate, related activism and politics.@slrpnk.net•Temperature Change in Switzerland.1·5 months agoI’m surprised. I don’t think it is done nation-wide. In which canton is it done?
LegoBrickOnFire@lemmy.worldto
Climate - truthful information about climate, related activism and politics.@slrpnk.net•Temperature Change in Switzerland.9·5 months ago- Ban cars on sundays again.
- Remove all harmful subventions on meat production
- Ban the installation of fossil fuel based heating
- Everyone can buy a bike today, it’s on the state!
LegoBrickOnFire@lemmy.worldto
Hardware@lemmy.world•Google announces 1st and 2nd gen Nest Thermostats will lose support in October 2025English
3·7 months agoTo those who know the product, is if possible to extend the connected functionnalities with selfhosting?
LegoBrickOnFire@lemmy.worldto
Technology@lemmy.world•Python Performance: Why 'if not list' is 2x Faster Than Using len()English
1·8 months agoI dislike treating None as an equivalent for the empy list, but that does not further the discussion…
I hurt myself in confusion while reading the second quote. Is it the right quote? (also, nazi (relating to the nsdap) is probably not the right word, did you mean fascist?)
LegoBrickOnFire@lemmy.worldto
Technology@lemmy.world•Python Performance: Why 'if not list' is 2x Faster Than Using len()English
1·8 months agoI agree. So if None is a valid input we should check it first, and then check if the length is zero. In this situation, we see a type error only if the programmer screwed up and everything is explicit
LegoBrickOnFire@lemmy.worldto
Technology@lemmy.world•Python Performance: Why 'if not list' is 2x Faster Than Using len()English
1·8 months agoI don’t really understand the point about exceptions. Yeah “not foo” cannot throw an exception. But the program should crash if an invalid input is provided. If the function expects an optional[list] it should be provided with either a list or None, nothing else.
LegoBrickOnFire@lemmy.worldto
Technology@lemmy.world•Python Performance: Why 'if not list' is 2x Faster Than Using len()English
1·8 months agoPassing None to a function expecting a list is the error…
LegoBrickOnFire@lemmy.worldto
Technology@lemmy.world•Python Performance: Why 'if not list' is 2x Faster Than Using len()English
1·8 months agoWell, in your case it is not clear whether you intended to branch in the variable foo being None, or on the list being empty which is semantically very different…
Thats why it’s better to explicitly express whether you want an empty collection (len = 0) or a None value.
LegoBrickOnFire@lemmy.worldto
Technology@lemmy.world•Python Performance: Why 'if not list' is 2x Faster Than Using len()English
1·8 months agoI really dislike using boolean operators on anything that is not a boolean. I recently made an esception to my rule and got punished… Yeah it is skill issue on my part that I tried to check that a variable equal to 0 was not None using “if variable…”. But many programming rules are there to avoid bugs caused by this kind of inattention.


I guess there are two kinds of magic. There is the magic of Fourrier which is lossy with funny math. But it is understandable that one can get higher compression ratios when it’s lossy. But I find it even more magic that we can still find better ways to encode images losslessly. I would have thought we had already long found the optimal way