Tux Machines

Programming Leftovers

Posted by Roy Schestowitz on Jan 04, 2023

=> Events: FOSDEM 2023 and PGDay Chicago | Openwashing and Proprietary Software

Paul Wise: FLOSS Activities December 2022

=> ↺ Paul Wise: FLOSS Activities December 2022

This month I didn't have any particular focus. I just worked on issues in my info bubble.

GStreamer compilation with third party libraries - Herostratus’ legacy

=> ↺ GStreamer compilation with third party libraries - Herostratus’ legacy

Suppose that you have to hack a GStreamer element which requires a library that is not (yet) packaged by your distribution, nor wrapped as a Meson’s subproject. How do you do?

Enrico Zini: Things I learnt in December 2022

=> ↺ Enrico Zini: Things I learnt in December 2022

Python's multiprocessing is prone to deadlocks in a number of conditions. In my case, the running program was a standard single-process, non-threaded script, but it used complex native libraries which might have been the triggers for the deadlocks.

Python: How to Use the If-Else Statement in One Line - ByteXD

=> ↺ Python: How to Use the If-Else Statement in One Line - ByteXD

Conditional statements in python are commands for controlling actions and decisions. These conditional constructs take action based on a condition. The given condition evaluates to true or false (if condition is true then take action).
In many cases, the executed action that is taken by a true condition is merely returning a value (assigning a new value to a target variable). Therefore, due to the simplicity of these types of if statements, many languages, including Python support inline if-else expressions.
In this article, you will learn how to use inline conditional expressions in Python.
The method of using if and else in the same line is usually referred to it as conditional expressions or ternary operations. The most common ternary conditional operator is ?: for many languages.
For example, the subsequent ternary expression: (a ? b : c), which returns b if a is true, or to c if the a condition is false. However, there is a different syntax for Python. Its ternary expression looks like the following: (a if condition else b), just as before, the expression returns a if condition is true, otherwise to b if condition is false.
In the later sections, we will explain how to use inline if-else expressions with examples.

=> gemini.tuxmachines.org

Proxy Information
Original URL
gemini://gemini.tuxmachines.org/n/2023/01/04/Programming_Leftovers.gmi
Status Code
Success (20)
Meta
text/gemini;lang=en-GB
Capsule Response Time
182.943998 milliseconds
Gemini-to-HTML Time
0.896432 milliseconds

This content has been proxied by September (3851b).