teleren/devto huggingface dataset:
[閒聊] 學習一門程式語言不應該如此辛苦
Tags: programming, beginners, python, learning
Published: 2024-02-11 03:44:03

學習一門程式語言不應該如此辛苦。

初學程式語言的人總是會習慣性的到網路上問過來人的經驗，想要藉由前人的經驗來加快學習進度，少走點冤枉路。有如約定成俗般，新手和老手們的話題總是圍繞著「練習」打轉，因此焦點不外乎是多看書、大量範例、大量實戰演練、寫題庫、做小遊戲、做專案⋯⋯等。

會有人鼓勵你，要有信心、耐心和毅力，每天不停的練習。十年寒窗苦讀，終會有出頭的一天。有時也會有人喜歡打擊新手，說得經過痛苦的試錯和累積的過程才可能學得會。

我們都有過這樣的經驗，一件事情努力了半天、無論試過多少種方法都只能原地踏步；但某人經過時看了看，指出你思考上的盲點，頓時問題變簡單了，解法再明白不過，甚至當下就能產出結果！

已故的蘋果老闆 Steve Jobs 曾說過：『每個人都應該去學一門程式語言，因為它能教你如何思考』。我認為學習程式語言的重點不在練習而在「思路」，也就是思考的方式。思路對了，只需適量的練習即可掌握核心知識，且能加以運用，可以開始寫真正有用的程式。大量練習只不過是加深肌肉記憶罷了！寫程式又不是運動比賽，不需要那麼即時的反應。

那些走過來的老手們很幸運，經過了幾十道的練習題之後，他們的思路就被打磨成可以實戰的模樣了。『我當年也是天天寫程式才學會的』，他們句句屬實，我毫不懷疑。聽到這，也許你開始落入負面思維之中，想說自己都練過上百題了，但是卻沒有成就感，遇到實戰腦袋就瞬間當機⋯⋯。

這是傳統教育制度的問題。近百年來成立學校的目的是為了要培訓出一批又一批的工人以符合工廠端的需求。那是以「硬體」為主軸的年代，一個工廠所生產的產品種類是非常有限的，也因此反覆地練習、大量的考試和背誦成為了主要的教育手段而顯少注重思考，因為在工廠裡工作的工人只需要「執行」而不是思考。

但是我們現在所處的是以「軟體」為核心的時代，這樣的教育方式就顯得格格不入，它與現代程式設計的需求相去甚遠。因為除了寫 code，我們還得交替地在規劃、歸納、整理和精煉等行為之間來回切換，需要大量的運用思考能力。我們所設計的軟體不但要功能豐富，還得具有變形能力以適應不同客戶的需求，更要能與第三方軟硬體相互搭配來實現更強大的綜合效果。因此這樣的學習環境需要被改變、被升級。

我在想，假如有辦法能把程式設計的「學習門檻」降低，那會是怎麼樣的場景！？不再有一直卡關的新手，他們能快速的跨過這個門檻，有更多的時間來學習其他技能（在軟體業工作不是只會程式就好），而不是把時間耗費在枯燥的解題地獄之中、或是困在沒有盡頭的語法迷宮之中，每天瞎忙卻不知這對自己有何幫助。

我認為我們需要跳脫傳統教育的框架。不可否認的，這世界仍然需要工人，因此傳統教育還是有存在的必要。但是既然我們身處軟體界，那麼我們就應該採取有別於傳統的教育和學習方式來增強自己的技能樹，讓對軟體有興趣的人們能發揮各自的專長來創造出更多更有趣的應用。

那是我所期望的未來。我會利用這樣的一個平台分享我個人的知識、經驗和技能，從 Python 這門程式語言作開端，讓想要開發應用程式的新手們能儘快脫離新手村，使用有別於傳統的思考方式來解決問題，讓軟體延伸到生活的每一個角落。

如果你對此有同感、或很有感觸，歡迎在下方留言，分享你過往的經驗和對未來的看法！
最近使用的几个工具
Tags: ipython, gomacro
Published: 2024-02-11 03:24:16

前段一直在使用go搞web3，有时候也用python写写web3,感觉web3py这个包经常因为python的版本问题，老是折腾，可能因为我喜欢用最新版，然后遇bug搞bug，所以有些疲惫。

最近关注了degenbot项目感觉挺好的，还提供了ipynb的脚本，感觉挺方便，我老是去etherscan上查接口，调用函数，其实用不着，感觉就是开一个ipynb的问题，这个查了，还是能保存结果，也不用每次查。人还是需要学习提升的。顺便学了下ape,也挺好用。原来我调用合约老是去etherscan上下载abi，再调用，发现用ape这个都是自动的。直接
```
nfttoken = Contract("0x7f59b64c6ee521c0d7e590cf8e4b843caa236f96")
print(nfttoken.name())
```
这样就可以，比上etherscan快多了。

网上随便看看，gomacro也不错，golang的ipynb内核。
除了内置的包，本地的包也能导入，基本上用法可以和ipython一样，用最新版的golang似乎有bug，不过问题不大，挺好玩的。

今年搞搞solana吧，争取把evm上玩的这一套都搞到solana上，资料比较少，适合折腾的。

基本放弃用emacs搞ipynb了，还是vscode方便。

哈哈，都是折腾。
How to use stored procedures and triggers to extend DBMS capabilities
Tags: beginners
Published: 2024-02-11 03:14:13

Stored procedures and triggers are database objects that can be used to extend the capabilities of a Database Management System (DBMS). They provide a way to encapsulate business logic, automate tasks, and enforce data integrity.

### Stored Procedures:

1. **Create a Stored Procedure:**
   - Use the `CREATE PROCEDURE` statement to define a stored procedure. It can include input parameters, output parameters, and a set of SQL statements.

   ```sql
   DELIMITER //
   CREATE PROCEDURE sp_example(IN parameter1 INT, OUT result1 INT)
   BEGIN
       -- SQL statements
   END //
   DELIMITER ;
   ```

2. **Call a Stored Procedure:**
   - Use the `CALL` statement to execute a stored procedure.

   ```sql
   CALL sp_example(1, @output);
   ```

3. **Input and Output Parameters:**
   - Define input parameters using `IN` and output parameters using `OUT`. Parameters allow you to pass values into and out of the stored procedure.

### Triggers:

1. **Create a Trigger:**
   - Use the `CREATE TRIGGER` statement to define a trigger. A trigger is associated with a specific table and is executed automatically when a specific event (e.g., INSERT, UPDATE, DELETE) occurs on that table.

   ```sql
   DELIMITER //
   CREATE TRIGGER tr_example
   AFTER INSERT ON table_name
   FOR EACH ROW
   BEGIN
       -- SQL statements
   END //
   DELIMITER ;
   ```

2. **Trigger Events:**
   - Specify the trigger event (INSERT, UPDATE, DELETE) and the timing (BEFORE or AFTER) using the `BEFORE` or `AFTER` keywords.

3. **Accessing Old and New Values:**
   - Use `OLD` and `NEW` to reference the old and new values in the trigger body. This is especially useful in UPDATE triggers.

   ```sql
   CREATE TRIGGER tr_example
   BEFORE UPDATE ON table_name
   FOR EACH ROW
   BEGIN
       -- Access old and new values
       SET @old_value = OLD.column_name;
       SET @new_value = NEW.column_name;
   END;
   ```

4. **Enforce Data Integrity:**
   - Triggers can be used to enforce data integrity by performing additional checks or actions when certain conditions are met.

   ```sql
   CREATE TRIGGER tr_check_balance
   BEFORE INSERT ON transactions
   FOR EACH ROW
   BEGIN
       IF NEW.amount > @account_balance THEN
           SIGNAL SQLSTATE '45000'
           SET MESSAGE_TEXT = 'Insufficient funds';
       END IF;
   END;
   ```

5. **Drop a Trigger:**
   - Use the `DROP TRIGGER` statement to remove a trigger from the database.

   ```sql
   DROP TRIGGER IF EXISTS tr_example;
   ```
Love Status Quotes: 150+ Best and Romantic Love WhatsApp Status Quotes for your BF and GF in 2024
Tags: quotes, love, lovequotes, whatappstatusquotes
Published: 2024-02-11 02:54:42

**_[Love status quotes](https://poeticexplorers.com/love-status-quotes/)_** are like best and sweet love letters in the digital world. They are a perfect way to express your romantic and love feelings on social media in a concise and charming manner. Whether you are in a new relationship or celebrating the warmth of a long term commitment these quotes make it easy to update your relationship status with creativity.

They capture the essence of love in a nutshell and provide a unique language for expressing emotions. Not only do they allow for personal expression but they also help connect with others who share similar sentiments turning the digital world into a shared space for **[love status quotes](https://poeticexplorers.com/love-status-quotes/)**.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/uf28jcldd9uwkmljw3m8.jpg)
[Read More](https://poeticexplorers.com/love-status-quotes/)
Fundamental SQL concepts
Tags: beginners
Published: 2024-02-11 02:50:29

Hi guys, this is the first day I learn IT (officially). I decide to take notes about whatever I think important and related. Hopefully I can form a network of knowledge one day. 
It would be so ideal if someone read my posts and help me improve. All suggestions are welcomed. Learning is detemined to be a road of loneliness, but one will go further with other lonely geeks. That's what I thought the meaning of communities.

### 1. **SELECT Statement:**
   - The `SELECT` statement is used to retrieve data from one or more tables.
   ```sql
   SELECT column1, column2
   FROM table_name;
   ```

### 2. **FROM Clause:**
   - The `FROM` clause specifies the table or tables from which to retrieve data.
   ```sql
   SELECT column1, column2
   FROM employees;
   ```

### 3. **WHERE Clause:**
   - The `WHERE` clause is used to filter rows based on specific conditions.
   ```sql
   SELECT column1, column2
   FROM table_name
   WHERE condition;
   ```

### 4. **AND, OR, NOT Operators:**
   - Combine conditions using `AND`, `OR`, and `NOT` operators in the `WHERE` clause.
   ```sql
   SELECT column1, column2
   FROM table_name
   WHERE condition1 AND condition2;
   ```

### 5. **ORDER BY Clause:**
   - The `ORDER BY` clause is used to sort the result set based on one or more columns.
   ```sql
   SELECT column1, column2
   FROM table_name
   ORDER BY column1 ASC;
   ```

### 6. **INSERT INTO Statement:**
   - The `INSERT INTO` statement is used to insert new records into a table.
   ```sql
   INSERT INTO table_name (column1, column2)
   VALUES (value1, value2);
   ```

### 7. **UPDATE Statement:**
   - The `UPDATE` statement is used to modify existing records in a table.
   ```sql
   UPDATE table_name
   SET column1 = value1, column2 = value2
   WHERE condition;
   ```

### 8. **DELETE Statement:**
   - The `DELETE` statement is used to remove records from a table.
   ```sql
   DELETE FROM table_name
   WHERE condition;
   ```

### 9. **JOIN Clause:**
   - The `JOIN` clause is used to combine rows from two or more tables based on a related column.
   ```sql
   SELECT column1, column2
   FROM table1
   INNER JOIN table2 ON table1.column = table2.column;
   ```

### 10. **GROUP BY Clause:**
    - The `GROUP BY` clause is used to group rows based on one or more columns, often used with aggregate functions.
    ```sql
    SELECT column1, COUNT(*)
    FROM table_name
    GROUP BY column1;
    ```

### 11. **HAVING Clause:**
    - The `HAVING` clause is used with the `GROUP BY` clause to filter the results based on aggregate values.
    ```sql
    SELECT column1, COUNT(*)
    FROM table_name
    GROUP BY column1
    HAVING COUNT(*) > 10;
    ```

### 12. **Aliases:**
    - Use aliases to provide temporary names for columns or tables in your queries.
    ```sql
    SELECT column1 AS alias1, column2 AS alias2
    FROM table_name;
    ```

### 13. **Comments:**
    - Use `--` for single-line comments or `/* */` for multi-line comments.
    ```sql
    -- This is a single-line comment

    /*
    This is a
    multi-line comment
    */
    ```
Enhancing S3 Bucket Security: Implementing Dual-Layer Server-Side Encryption on AWS Console
Tags: aws, awscommunitybuilder, serverless, beginners
Published: 2024-02-11 02:38:07


The security of Amazon S3 is critical due to the diverse and sensitive data it houses, ranging from personal information to intellectual property. Compliance with regulations like GDPR and HIPAA is essential, ensuring legal adherence and ethical data handling. S3's robust security features, including granular access controls and encryption mechanisms, bolster its reliability. 

Implementing Dual-Layer Server-Side Encryption (DSSE-KMS) enhances security by adding an extra layer of encryption without needing additional infrastructure. Utilizing AWS KMS for key management grants customers control over their encryption keys, fostering trust and enabling scrutiny of encrypted data. This reinforces S3's reputation as a secure storage solution suitable for highly sensitive workloads, extending its benefits to customers globally.

To implement DSSE-KMS on your S3 buckets, you can follow these steps: 
 
1. Go to AWS Console and navigate to Amazon S3 service.
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/mn3uqxvs821i3s03ro18.png)

2. Click the Create Bucket button.
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/98l0vl3bo573wx1qazfa.png)

3. Fill the configuration details. 
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/q11rr235yvyvjrw3nkoa.png)

4. In the Encryption section, select the Dual-layer server-side encryption with AWS Key Management Service keys (DSSE-KMS). 
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/hk17djtkz2znk30nd6hg.png)

5. Choose a KMS Key from the following options:
-> Choose from your AWS KMS keys.
-> Enter AWS KMS key ARN.

6. Click on Create Bucket.

You are now ready with your bucket that provides Dual-Layer Server-Side Encryption. You can verify this by going to the Properties tab for your bucket and looking at the Encryption section.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/l8n3i42b0glm7p20jhvk.png)
Solar System animation -- my version
Tags: codepen
Published: 2024-02-11 02:05:32

Trying to simulate Kepler's Laws with prettyness. Here is sort of what I'm envisioning. I can't say that it is my own work really except I asked my AI assistant to code some javascript simulating Kepler's Laws. I have no idea if it succeeded. I still don't even know if the planets are orbiting the Sun at a constant rate! (i.e., ignoring Kepler's 2nd law). Here is what I have so far

{% codepen https://codepen.io/lshriver/pen/vYPjwEQ %}
How to create a similar to Google maps pan an a zoom movement in Flutter flame
Tags: flutter, mobile, programming, tutorial
Published: 2024-02-11 01:42:03

Hello everyone, how are you? Here I am with another mini-tutorial that I learned in my day-to-day work. Recently, we needed a camera movement in our app similar to what Google does in Google Maps, and since we are using Flutter and, in conjunction, Flame, there wasn't much material available on this. So, with this challenge in mind, I researched extensively and tested various possibilities until one day I decided to try ScaleDetector and Pandetect from Flame. I discovered that ScaleDetector was nothing more than a superset of PanDetector.

In summary, we were able to create the solution, and here I am to document this code for you.

Note: Remember to check the Flutter Flame documentation to implement everything correctly, using the ScaleDetector mixin.

Flame doc -> https://docs.flame-engine.org/

```
void clampZoom() {
    camera.viewfinder.zoom = camera.viewfinder.zoom.clamp(0.8, 5);
  }

  static const zoomPerScrollUnit = 0.01;
  late double startZoom;
  @override
  void onScaleStart(info) {
    startZoom = camera.viewfinder.zoom;
  }

  @override
  void onScaleUpdate(ScaleUpdateInfo info) {
    final currentScale = info.scale.global;
    if (!currentScale.isIdentity()) {
      camera.viewfinder.zoom = startZoom * currentScale.y;
      camera.moveBy(info.delta.global);
      clampZoom();
    } else {
      final delta = -info.delta.global;
      camera.moveBy(delta);
    }
  }
```

I would also like to thank Lukas (@spydon ), who has been doing an excellent job in the development of Flame and its community.
Why we still have tech-debt?
Tags: codequality, codereview, python, javascript
Published: 2024-02-11 01:06:26

When a developer creates a pull request, the reviewer checks it for business logic. However, what often gets overlooked are:

- Data structure optimization
- Code security checks
- Function complexity and reusability
- Cleaning up dead and duplicate pieces

Let's break it down and understand all 3 stages.

**Stage 1 - Development Editor:**

We all add linters; they detect issues related to formatting and some anti-patterns. As developers, we see numerous issues, and even some paid linters stack rank the issues based on severity. However, it fails in multiple aspects because developers don't have time to manually fix these issues. Developers want these issues to be auto-fixed, or else they will silence them. Secondly, these static linters lack context about your codebase, so they may not effectively prioritize high-severity, high-impact issues for you.

**Stage 2 - Git Hook (Maybe):**

Some organizations have Git hooks in place to prevent certain bad practices from being pushed. The problem here lies in the depth of the rules, as most rules focus on high-level, framework-specific checks. You can think of these as extensions of your linters, with the added capability that you can't push the code if certain rules are not followed.

**Stage 3 - Pull Requests (PRs):**

Now, you have pushed your changes and created a PR, waiting for the reviewer to merge it. Here, the challenge is that the reviewer also has 10 other PRs to review, so they primarily check for the correctness of the business logic. Having reviewed over 1000 PRs, what I've learned is that no reviewer can ever have 100% context of their codebase. Therefore, we trust that the developer has followed all the checks, fixed anti-patterns, dead and duplicate code, ensured the use of correct data structures, etc. Additionally, awareness of security and compliance issues is not always present with most developers, so we don't review those aspects. Moreover, both the reviewer and developer are under pressure to ship the product faster, with the end goal being deployment in lower environments. If something breaks, we will fix it there.

The reality is that nothing will break because the existing checks primarily focus on unit or end-to-end tests for business logic, which are already reviewed. Consequently, "bad" code gets checked in and committed.

This situation results in technical debt. Why haven't we been able to solve it until now? It's due to a lack of enforcement that doesn't slow down developer velocity.

**What do we need then?**
We need tools that have a great context of the codebase, prioritize high-severity, high-impact issues, and suggest auto-fixing of these issues without breaking any existing logic. The tool should also seamlessly integrate with the developer journey starting from IDEs to PR checkers.

We are building [CodeAnt AI (YC W24)](https://codeant.ai/) on the same lines, and it is live; feel free to check it out [here](https://github.com/marketplace/codeant-ai).
AWS CloudFormation newest release - IaC Generator
Tags: aws, cloudformation, devops, cloudcomputing
Published: 2024-02-11 00:39:00

🚀 Big News in Cloud Computing! 🌩️

Hello, cloud enthusiasts! AWS has just rolled out an exciting new feature for CloudFormation: the IaC Generator. This innovative tool is revolutionizing how we handle Infrastructure as Code, making it easier and faster than ever!

🔧 What is the AWS CloudFormation IaC Generator?
The IaC Generator allows you to automatically create CloudFormation templates and AWS CDK (Cloud Development Kit) apps for existing AWS resources. This means if you have resources managed outside of CloudFormation, you can now easily bring them into the fold of IaC, saving weeks of manual work.

🌟 Key Features:

    Generate Templates Easily: You can generate templates for over 500 AWS resource types, streamlining the process of importing resources into CloudFormation.
    Customizable and Efficient: The tool offers recommendations for related resources, enhancing the accuracy and efficiency of your infrastructure management.
    Flexibility in Development: Convert templates into CDK apps in languages like TypeScript or Python, catering to various development preferences.

🔍 How It Works:
Using the AWS CloudFormation Console, you can select the IaC generator to start creating templates. It's also accessible via AWS CLI and SDK, offering diverse ways to integrate it into your workflow.

🌐 Global Availability:
The IaC Generator is available in AWS regions where CloudFormation is offered, expanding its reach globally.

👨‍💻 For Developers:
This tool simplifies the transition to IaC, especially for those who have been hesitant. With automation, safety, and scalability, it's a leap forward in managing cloud resources.

📣 Calling all cloud gurus and enthusiasts! What are your thoughts on this new AWS feature? Are you excited about how it will change the game in cloud infrastructure management? Share your insights below!

##AWS 

Learn more about AWS CloudFormation IaC Generator https://aws.amazon.com/about-aws/whats-new/2024/02/aws-cloudformation-templates-cdk-apps-minutes/
Deep Dive into Python's Context Managers
Tags: python, programming, tutorial, beginners
Published: 2024-02-11 00:32:05

## Introduction

Python's Context Managers are a powerful feature that allows developers to handle resources efficiently and in a more organized manner. It helps in managing resources such as files, database connections, and network connections by taking care of their initialization and cleanup automatically. In this article, we will delve deeper into the world of context managers and understand their features, advantages, and disadvantages.

## Advantages

- **Cleaner and More Readable Code:** One of the main advantages of context managers is that they provide a cleaner and more readable code. With context managers, we no longer need to worry about manually closing the resources we have opened, as they are automatically closed once the context manager exits. This not only saves time and effort but also reduces the chances of forgetting to close an important resource.

- **Efficient Error Handling:** Another advantage is that context managers help in handling errors more efficiently. In case of an exception, the context manager ensures that the resources are properly closed before exiting, thus preventing potential memory leaks.

## Disadvantages

- **Complex Implementation for Advanced Scenarios:** One of the disadvantages of context managers is that they can be difficult to implement for complex scenarios. This can lead to longer and more complicated code, making it harder to understand for beginners.

## Features

Context managers in Python can be implemented in two ways - using the `with` statement or by creating a class with `__enter__` and `__exit__` methods. They also allow for the use of multiple resources within a single context manager, making it easier to manage multiple resources at once.

### Example Using the `with` Statement

```python
with open('file.txt', 'w') as f:
    f.write('Hello, world!')
```

This example demonstrates how to use a context manager to handle file operations, ensuring that the file is automatically closed after writing.

## Example Creating a Class

```python
class ManagedFile:
    def __init__(self, filename):
        self.filename = filename

    def __enter__(self):
        self.file = open(self.filename, 'w')
        return self.file

    def __exit__(self, exc_type, exc_val, exc_tb):
        if self.file:
            self.file.close()

# Usage
with ManagedFile('file.txt') as f:
    f.write('Hello, world!')
```

This example shows how to create a custom context manager class for managing file operations, providing more flexibility for handling resources.

## Conclusion

In conclusion, context managers in Python provide a more efficient and organized way of handling resources in our code. They help in making the code more readable and reduce the chances of errors. While they do have their limitations, the advantages of context managers outweigh their disadvantages. It is a powerful tool that every Python developer should know and utilize in their code for better resource management.
TJ/RS inicia testes de transcrição de depoimentos com IA
Published: 2024-02-11 00:24:28




![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/6i4q8p8n8knzjncjreg1.jpg)
Nos próximos 90 dias, cinco comarcas do Judiciário gaúcho realizarão testes de transcrição de depoimentos com inteligência artificial em videoconferências. A Corregedoria-Geral da Justiça escolheu as unidades judiciais da área criminal das comarcas de Porto Alegre, Caxias do Sul, Santa Maria, Passo Fundo e Pelotas para dar início ao projeto denominado "Audiências Inteligentes".

A iniciativa prevê uma maior agilidade nos procedimentos, já que permite a transcrição dos depoimentos em tempo real.

Ao final, o texto poderá ser utilizado como ata da audiência, sendo verificado, no mesmo momento, pelos advogados e membros da Defensoria Pública e Ministério Público.

Segundo o DITIC - Diretor da Direção de Tecnologia da Informação e Comunicação do TJ/RS, Antônio Braz da Silva Neto, após os testes e conclusão da funcionalidade na plataforma em que são realizadas as videoconferências, o arquivo com a transcrição será automaticamente integrado ao sistema eproc.
CSS Equivalent of the "if" statement
Tags: css, programming
Published: 2024-02-11 00:15:37

Sometimes there is a need to select between two values based on some condition in css styling. One can uses simple two classes or javascript two select right stiling. But thanks to css variables if statements can be done also in pure CSS.  

To select between two values in pure CSS you can use folowing math trick

Pseudocod:

```
if( valueSel < th) 
  return valueA
else
  return valueB
```

This statement can be converted to folowing pseudocod:

```
selector = (sign(valueSel-th)+1)/2
return valueA * (1-selector) + valueB * selector
```

Which can be expresed with help of css variables as:

CSS:
```css
.some-class {
  --valueSel: /* Some Value - predicate */;
  --th: /* Some Treshold */;
  --valueA: /* Result A */;
  --valueB: /* Result B */;
  --selector: calc(clamp(0,tan( clamp(-1,var(--valueSel) - th, 1) ),1));
  --result: calc( var(--valueA) * (1 - var(--selector) ) + var(--valueB) * var(--selector) );    
}
```

The selection can be extended to selecting colors via `mix-color`

You can see usage if this in Pure CSS radiational progress bar
https://codepen.io/owcakw/pen/KKEGvgZ