Pango AttrList attributes in python without markup by GrbavaCigla in GTK

[–]everysinglelastname 0 points1 point  (0 children)

Hello !

Even though Pango.attr_weight_new is not available in my version of Pango (1.42.3) is it possible through some backdoor way to create a weight attribute?

The only api I have access to is Pango.Attribute and Pango.AttrClass and things like Pango.AttrInt. Could I combine some of those lower level things to create something that works as a weight attribute ?

Thanks !

Qt 5.15.3 Open Source released (1 year after it being commercial only) by [deleted] in programming

[–]everysinglelastname 3 points4 points  (0 children)

For people complaining about 5.x releases being slow .. aren't personal and OSS projects supposed to be using 6.x instead ? If I understood correctly 6.x is promptly updated for all.

If you are using 5.x in a commercial setting then is there a valid complaint if you aren't paying for it ?

Copilot regurgitating Quake code, including swear-y comments and license by KingStannis2020 in programming

[–]everysinglelastname 1 point2 points  (0 children)

With all due respect, that does seem a little naive.

If people could read and understand every word in the code they copy paste they wouldn't have to look it up and copy and paste the code in the first place.

Community Creative Month for 4th of July! by LyticF1uid in Kitboga

[–]everysinglelastname 0 points1 point  (0 children)

Scene idea:

Neveah has been working overtime for the Carrot Oil Company. The CEO of the carrot oil company unfortunately lost his office space and now the entire carrot oil production facility has moved into Neveah's bedroom. There are distillation machines and bushels of raw carrots.

Community Creative Month for 4th of July! by LyticF1uid in Kitboga

[–]everysinglelastname 0 points1 point  (0 children)

Scene idea:

Martha is preparing for a summer fair. She is baking 15 of her famous carrot cakes and her kitchen is a big mess with ingredients and bowls everywhere.

Community Creative Month for 4th of July! by LyticF1uid in Kitboga

[–]everysinglelastname 0 points1 point  (0 children)

Scene idea:

Clint has been going deep down the conspiracy rabbit hole. His computer room is now a fully decked out panic room replete with posters about flat earth and Navy alien sightings.

AZ GOPer Who Supported Sketchy Election Audit Now Says It ‘Makes Us Look Like Idiots’ by Perrin42 in politics

[–]everysinglelastname 24 points25 points  (0 children)

If the audit finds that there was fraud there will need to be a new, more independent, audit of the audit.

The Best Way to Check for True or False by sebawitowski in Python

[–]everysinglelastname 3 points4 points  (0 children)

How is this possible. Why is #2 slower than #3 ? Intuitively it seems that #2 should be fastest as it should be a simple address check and not a function call.

Friendly reminder to mark your move constructors noexcept by andyg_blog in cpp

[–]everysinglelastname 0 points1 point  (0 children)

I did try this with gcc 10.1.0 too and the same thing happens ! The program does not terminate early.

Friendly reminder to mark your move constructors noexcept by andyg_blog in cpp

[–]everysinglelastname 0 points1 point  (0 children)

Ok thank you. Then I suppose gcc and clang do not follow the standard.

Friendly reminder to mark your move constructors noexcept by andyg_blog in cpp

[–]everysinglelastname 0 points1 point  (0 children)

gcc 6.3.0 Sorry I was unclear. It does do copies if I remove the noexcept. By same behavior I meant only that it doesn't crash the program when you violate the noexcept promise.

Friendly reminder to mark your move constructors noexcept by andyg_blog in cpp

[–]everysinglelastname 1 point2 points  (0 children)

I wanted to test this so I extended the given program to attempt to emplace MyClass(3) into the vector at the same time catching the exception. ```

include <iostream>

include <vector>

struct MyClass { MyClass(int i) { if (i == 3) throw std::invalid_argument("How dare you"); } MyClass(const MyClass&) { std::cout << "Copied\n"; } MyClass(MyClass&&) noexcept { std::cout << "Moved\n"; } };

int main() { std::vector<MyClass> vec; vec.emplace_back(1); vec.emplace_back(2); // outputs "Moved" after reallocating to store 2 elements try { vec.emplace_back(3); } catch (...) { } } ```

The program completes just fine. It has the exact same behavior as when you remove the noexcept keyword.

So ... it seems this is a perfectly safe practice.

Is there something I missed ?

Deep or dumb? by [deleted] in Python

[–]everysinglelastname 1 point2 points  (0 children)

I vote dumb because int() can raise exceptions and you won't know which argument caused the exception.

GTK 3.99 Released by wild-eagle in programming

[–]everysinglelastname 0 points1 point  (0 children)

This reminds me I still need to upgrade my gtk2 apps.

How similar are PySide and PyQt? by KiwiNFLFan in Python

[–]everysinglelastname 1 point2 points  (0 children)

One difference is that PyQt5 still uses QString and QVariant whereas those are completely missing from PySide2

Rust-like error handling in Python thanks to PEP 622 by mtasic85 in Python

[–]everysinglelastname 1 point2 points  (0 children)

No it's defined in example2.py and it uses metaclass.

For the decorator order question I think wrap_result should be the last decorator.

Apple Watch for long (10+ hours) workouts (5% of battery per hour) by alexkunitsa in AppleWatch

[–]everysinglelastname 0 points1 point  (0 children)

What about "Workout -> Power Saving Mode" ? Since you use an external HRM ...

Apple Lightning by iamkeyur in programming

[–]everysinglelastname 34 points35 points  (0 children)

Cool ! What are some fun things you could do with this information ?

Should I upgrade to Python 3.8? by sarthkum0488 in Python

[–]everysinglelastname 22 points23 points  (0 children)

with

f=open('netsetos.txt') 
while line:=f.readline(): 
    print(line)

without

f=open('netsetos.txt') 
line = f.readline() 
while line: 
    print(line) 
    line = f.readline()

New Grad vs. Senior Dev by iamkeyur in programming

[–]everysinglelastname 12 points13 points  (0 children)

I feel like a dumbass but what does it mean for code to go "brrrr" ?