teleren/devto huggingface dataset:
le webRTC
Published: 2023-01-18 13:36:37

**1. Comprendre le concept de WebRTC**
     WebRTC (Real-Time Communications) est un ensemble d’API et de technologies qui permet aux applications web de fournir une communication audio et vidéo interactive en temps réel entre les utilisateurs.

**2. Explorer les fonctionnalités offertes par le WebRTC**
      Le WebRTC offre une variété de fonctionnalités, notamment des codecs audio et vidéo, la transmission vidéo haute qualité, la voix sur IP (VoIP), la messagerie instantanée et d'autres mécanismes de communication en temps réel qui peuvent être utilisés dans des applications et des services web.

**3.Apprendre le fonctionnement de WebRTC**
      Pour mieux comprendre le WebRTC, vous devez en apprendre un peu plus sur son fonctionnement. WebRTC utilise le protocole signaling (la communication entre les différentes connexions) pour établir des sessions audio et vidéo entre les utilisateurs. En plus de signaler, WebRTC utilise des serveurs de routage pour transmettre le streaming audio et vidéo entre les différentes connexions.

**4. Comprendre l’architecture de WebRTC**
      WebRTC est conçu autour d’un environnement client-serveur où le client est généralement un navigateur web et le serveur une application WebRTC dédiée. Les clients utilisent le WebRTC API du navigateur pour interagir avec le serveur qui, à son tour, fournit les informations de session vidéo-audio et / ou de messagerie instantanée à l’utilisateur.

**5. Explorer les utilisations courantes de WebRTC**
       Les utilisations courantes de WebRTC incluent des services tels que la visioconférence, les appels VoIP, la diffusion en direct et les jeux d'interaction en temps réel. Les plateformes de streaming ​​et les services de messagerie instantanée à base de WebRTC sont également disponibles sur le marché.

**<>Code**(https://github.com/bedjoi/webrtcVd.git)
Troubleshooting weird DB connection errors in Rails with PostgreSQL
Tags: rails, postgres, ruby, troubleshooting
Published: 2023-01-18 13:28:08

There are a number of errors that occur when attempting to use a database connection that has suddenly become dead.

Errors like `PG::ConnectionBad: PQsocket() can't get socket descriptor:`, `PG::UnableToSend: no connection to the server`, `PG::ConnectionBad: PQconsumeInput() server closed the connection unexpectedly`, `PG::UnableToSend: SSL connection has been closed unexpectedly`, and so on.

They may be caused by a few different factors, e.g. long command run, or long SSH connection, or closed connection in separate thread(like in ['parallel' gem](https://github.com/grosser/parallel/issues/62)), or long code processing before save.

## The cause

If you see errors like that, and do have some slow processing, there are several things to check:

1) Rails's database `idle_timeout` setting, which is 300 seconds by default. This means that if a connection is idle for more than 300 seconds, the server will close it.
2) PgBouncer `client_idle_timeout` setting. This setting controls how long a connection can be idle before PgBouncer closes it. If this setting is set too low, it can cause the same errors as Rails's idle_timeout.
3) PostgreSQL `idle_session_timeout` settings (from PostgreSQL 14) and `idle_in_transaction_session_timeout`(for sessions that were idle in transaction).
4) TCP or other network or firewall timeouts(e.g. there is a case of the timeout in Azure Cloud)

## The solution

To solve this problem, there are a few possible solutions:

0) Speed up slow processing
1) Increase the `idle_timeout`(or another guilty timeout) setting to a higher value to prevent a server from closing idle connections too soon.
2) Add a database setting called `reaping_frequency: 10`, which will clear and restore connections more frequently to prevent them from becoming idle.
3) Add manual reconnection, like the code snippet below, which releases the connection and re-establishes it before saving a record to the database.
```
    ActiveRecord::Base.connection_pool.release_connection
    ActiveRecord::Base.connection_pool.with_connection do
      # save record in database
    end
```

## Resources

Links:
[(1)](https://api.rubyonrails.org/v5.1/classes/ActiveRecord/ConnectionAdapters/ConnectionPool.html)[(2)]( https://apidock.com/rails/ActiveRecord/DatabaseConfigurations/HashConfig/reaping_frequency)[(3)](https://github.com/mperham/sidekiq/wiki/Problems-and-Troubleshooting#postgres-connection-corruption)[(4)](https://github.com/rails/rails/blob/v5.2.4.3/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb#L283) Info about `reaping_frequency`
[(5)](https://juanitofatas.com/series/rails/active-record-connection-pool)[(6)](https://api.rubyonrails.org/v7.0/classes/ActiveRecord/ConnectionAdapters/ConnectionPool.html) Info about Rails's `idle_timeout`
[(7)](https://github.com/mperham/sidekiq/issues/3128)[(8)](https://github.com/grosser/parallel/issues/62)[(9)](https://stackoverflow.com/a/65242944/11736429) Solutions with manual reconnection
(Solution) Know Basic Maths - Strivers A2Z DSA Course/Sheet
Tags: dsa, cpp, java, programming
Published: 2023-01-18 13:19:16

a. Count Digits - GFG Question
Given a number N. Count the number of digits in N which evenly divides N.


Example 1:

Input:
N = 12
Output:
2
Explanation:
1, 2 both divide 12 evenly

Solution :
```
class Solution{
    static int evenlyDivides(int N){
        int evenD = 0,cp=N;
        while(cp>0){
            int lastD = cp%10;
            if(lastD ==0){
                cp /= 10;
                continue;
            }
            if(N%lastD==0){
                evenD++;
            }
            cp = cp/10;
        }
        return evenD;
    }
}
```
Wednesday Links - Edition 2023-01-18
Tags: java, jvm, kotlin, api
Published: 2023-01-18 13:16:05


Java 20: An Almost Infinite Memory Segment Allocator (5 min)♾️
https://minborgsjavapot.blogspot.com/2023/01/java-20-almost-infinite-memory-segment.html

ProjectReactor and sun.misc.SharedSecrets (30 sec)💥
https://twitter.com/rotnroll666/status/1614936931464249347

The new Spring Boot version validation and upgrade support in Spring Tools (5 min)✅
https://spring.io/blog/2023/01/17/the-new-spring-boot-version-validation-and-upgrade-support-in-spring-tools

Examples of floating point problems (10 min)🧨
https://jvns.ca/blog/2023/01/13/examples-of-floating-point-problems/#example-2-tweet-ids-in-javascript

A few programming language features I’d like to see (6 min)🎋
https://neilmadden.blog/2023/01/18/a-few-programming-language-features-id-like-to-see/

API Design Patterns (8 min)✴️
https://blog.frankel.ch/api-design-patterns/

Physical Key Decoding application (1 min)🔑
https://github.com/MaximeBeasse/KeyDecoder

Beyond Git: The other version control systems developers use (12 min)🏰
https://stackoverflow.blog/2023/01/09/beyond-git-the-other-version-control-systems-developers-use/

How Gradle Works - Startup (3 min)🎬
https://blog.gradle.org/how-gradle-works-1

Running Kotlin coroutines on Project Loom's virtual threads (3 min)🧵
https://kt.academy/article/dispatcher-loom

Kotlin 1.8.0 Released (1 min)🎉
https://blog.jetbrains.com/kotlin/2023/01/kotlin-1-8-0-released/

Mockito 5 Released (1 min)🎉
https://github.com/mockito/mockito/releases/tag/v5.0.0
Speed docker build up the build by 10X times for frontend applications
Tags: docker, node
Published: 2023-01-18 13:12:44

I'm developing on macOS, and my Kubernetes cluster is on linux.

---

The configuration before was:

Dockerfile:
```
FROM node:14.17-alpine as a builder
...
FROM nginx
...
```

I ran the command:
```
docker build --platform linux/amd64 -t fe-spa:latest .
```

The assembly began to take 20 minutes

---

I changed the configuration and started doing this:

Dockerfile:
```
FROM node:14.17-alpine as a builder
...
FROM --platform linux/amd64 nginx
...
```

I ran the command:
```
docker build -t fe-spa:latest .
```

The assembly began to take 2 minutes

---

the transfer of the platform selection allowed us to get an increase in speed
Finding Your Ideal Customer Is Pain in the Ass
Tags: webdev, programming, ai, machinelearning
Published: 2023-01-18 13:11:30

Couple of days ago, my product went viral on Reddit. 

It received over 50,000 views. And many people started bombarding me with messages.

They wanted to try the product.

![Viral Reddit Post](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/oxvih9cisi6f99fqvf50.png)

But despite all this buzz, I only got few sign ups and zero paying customers.

Here are the reasons why!

## The Product

My product is still in the early stages. 

I only started working on it 7 days ago. And it only has one core feature.

It's still a cool product, but it doesn't evoke a lot of trust.

## The Customer

I got a lot of messages.

People were interested. They wanted to test the product. But they didn't understand it.

To put it as simply as I can, they didn't fit my customer profile. 

My product is beneficial for development teams, but I received messages mostly from solo developers learning their craft.

They still wanted to try it out, but I could alredy see it won't help them in any way.

## The Only Thing That Matters

At the end of the day, only one thing matters.

Are you getting new customers?

All the buzz around your product. All the virality. All the good comments.

It's just a fluff. And it won't help you that much.

From my Reddit post, I got a nice virality spike. But that was about it.

## What I Learned

Don't get me wrong. I'm still very glad for all the eyeballs I got.

I received some nice feedback. And a lot of positive comments about my product.

But the most important thing I learned is that Reddit might not be the best platform to find the customers for my product.

And here's why.

My product is [AI code-review assistant](http://whisprai.com). It helps software teams to run more effective code-reviews.

But it's only beneficial for a team.

In order to get a new customer, I need to get in front of someone who can make executive decision, and purchase this product for their team.

And as it turned out, I didn't find these people on Reddit. At least not yet.
9 Interesting Reasons Why BMW & Toyota have Chosen Flutter for their Mobile App
Tags: mobile, flutter, ios, android
Published: 2023-01-18 13:04:25

Developing a cross-platform app calls for a blend of constant brainstorming, creative approaches, usability, niche, and the technology that is going to nurture the App throughout.

Flutter is an ideal and the most popular cross-platform framework used by global developers.

Flutter’s integration with Firebase makes it even easier to create powerful, dynamic applications. As the industry continues to evolve, it is likely that Flutter will become even more popular with businesses looking to create mobile applications in 2023.

Not Only that but big brands like Alibaba, BMW, Toyota, etc… are trusting flutter.

## BMW Group with Flutter
In 2018, BMW found that the feature and design dissimilarities between their iOS and Android offerings had expanded. They urgently needed to get an optimal solution, so that the apps offered the same functionality to all consumers, regardless of mobile OS, BMW, and MINI brand, without seriously inflating costs.

In October 2019, a selected group of BMW engineers met in Munich to discuss how to move forward with Flutter.

Less than a year after getting started, the My BMW App was launched in July 2020 and has established itself in 47 countries on five continents as a universal interface providing the user a seamless experience between mobile phone, vehicle, and the digital world.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/n4r6lm35agdxt6bjvhyj.png)
[Source](https://flutter.dev/showcase/bmw)

## Toyota with Flutter
Toyota had always developed their in-vehicle technology themselves, they were intrigued by Flutter and wondered how it could help them improve the user experience for their drivers.

All thanks to Flutter’s highly competent rendering engine and features such as AOT compilation, the team felt convinced that they could produce something that felt more like a smartphone app than a standard embedded system.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/u22oxpug60hrovf9lrfn.png)
[Source](https://flutter.dev/showcase/toyota)

## 9 Interesting Reasons Why BMW & Toyota have Chosen Flutter for their Mobile App

💡 Hot Reload to reduce code development time
💡 Own a high-performance rendering engine
💡 Delivering UI consistency over all platforms
💡 Writes custom platform-specific code
💡 Improved time-to-market speed
💡 Customizing any complexity
💡 Compliant for Fuchsia
💡 Dedication to mobile
💡 Cognate with native

Check out our latest blog to learn how this open-source framework can help you create high-performance, visually attractive apps for multiple platforms with a single codebase: https://bit.ly/3IRfaoq
What is CSS? Basics Explained
Tags: css, webdev, beginners, tutorial
Published: 2023-01-18 13:00:00

[CSS](https://maxlockwood.dev/category/css/) stands for **Cascading Style Sheets**.

- **Cascading** refers to the way CSS applies one style on top of another.
- **Style Sheets** control the look and feel of web documents.

**CSS** and **HTML** work hand in hand:

- [HTML](https://maxlockwood.dev/what-is-html-basics-explained/) sorts out the page structure.
- CSS defines how HTML elements are displayed.

To understand CSS, you should already have a basic knowledge of HTML.

## CSS Syntax

CSS is a rule-based language, which means that you define the rules by specifying groups of styles to be applied to specific elements or groups of elements on your web page.

Here is an example of a simple [CSS rule](https://maxlockwood.dev/what-are-css-rules-and-selectors/), that makes the main heading show as large red text and a font-size of 5rem. In CSS rem stands for “root em”, a unit of measurement that represents the font size of the root element.

```css
h1 {
  color: red;
  font-size: 5rem;
}
```

## What are CSS style sheets used for?

CSS (Cascading Style Sheets) is used to style and layout web pages, such as changing the font, colour, size, and spacing of your content, splitting it into multiple columns, or adding animations and other decorative elements.

## Why Use CSS?

CSS allows you to apply specific styles to specific HTML elements.

The main benefit of CSS is that it allows you to separate **style** from **content**.

Using just HTML, all the styles and formatting are in the same place, which becomes rather difficult to maintain as the page grows.

All formatting can (and **should**) be removed from the HTML document and stored in a separate CSS file.

## Is CSS a programming language?

Cascading Style Sheets (CSS) is a stylesheet language that instructs the browser how we want our HTML to appear; **it is not a programming language**.

## Conclusion

Let’s summarise what we’ve learned about CSS and how it helps with web page aesthetics:

- CSS was designed to work in tandem with other markup languages such as HTML.
- CSS (Cascading Style Sheets) is used to style and layout web pages.
- CSS allows you to apply specific styles to specific HTML elements.

Now that you understand what CSS is, let’s go to [CSS – Max Lockwood](https://maxlockwood.dev/category/css/) to learn some more concepts about CSS.

### See also

[What are the 3 Ways to Style in CSS?](https://maxlockwood.dev/what-are-the-3-ways-to-style-in-css/)
[What are CSS Rules and Selectors?](https://maxlockwood.dev/what-are-css-rules-and-selectors/)
[What are the Most Common CSS Units?](https://maxlockwood.dev/what-are-the-most-common-css-units/)

If you liked this article, then please share. You can also find me on [Twitter](https://twitter.com/maxlockwood88) for more updates.
if statement: Haqida malumot.
Published: 2023-01-18 12:48:25



```cpp
tanlov bayonotlari
Ikki yoki undan ortiq ijro yo'llari o'rtasidan tanlimiz.
If iborasi if esle iborasi switch iborasi.


```
 

```cpp
Misoolar
   Bizga butun qiymat berilgan
Agar musbat (>0) bolsa,qiymatni ekranga chiqaramiz.
Agar manfiy bo'lsa,(<0) -1ni ekranga chiqaramiz.

```
```cpp


int main () {
int age1, age2;
  cin>> age1>> age2;
  
  if (age1 > age2){
  cout << "Birinchi kiritilgani katta: Bu son:" << age1;

  }
  if(age1 == age2){
    cout << "ular teng!";
  }
```

```cpp
Agar ifoda rost bo'lsa, 1- bandni bajaring.
sintaksis.
If (ifoda){
bayonot1
}
```
**MIsol uchun , agar x o dan katta bo'lsa,
"musbat raqami"ni ekranga chiqaramiz\n
**
```cpp
int main(){
int x;
cin >> x;
if(x > -10 && x < 10){
x = 0;
cout << x;
  }
return 0;
  }

```
Subgrid devlog.1
Tags: devjournal, tui
Published: 2023-01-18 12:47:31

This is the start of devlog of an experimental UI library inspired by the text video modes of the past and their console UI. Typical terminal emulator is a regular grid where each cell contains a exactly one character drawn with a monospaced font. Some terminals are known to use two cells to draw the characters like CJK.

This experiment is to verify if text mode approach with smaller cells makes sense. With smaller cells even the ASCII character can occupy several cells, for example the "i" letter takes one cell, the "A" takes two cells and the wider symbols like "W" takes three cells.

Why would anyone would like to do this? Well, with smaller cells we can have high information density by using the duospaced fonts and UI decorations.
if - agar
Published: 2023-01-18 12:32:37

`if` buning aniq manosi bu ingliz tilidan olingan bolib agar degan manoni anglatadi

```cpp
#include <iostream>
using namespace std;
int main() {
int  n;
cin >> n;
  if (n == 0){
  
  cout << "bu zero!" ;
  
  }
  
```
bunda `if` buyruq manosida keladi masalan:
buyerda deyapti agar n 0 ga teng bolsa `console` ga bu zero yani bu nol degan sozni chiqardegan buyruq yozilyapti


lekin bitta muammo bor `if` faqat 1 yani `togri` ni qabul qiladi agar `if` ni yozib uning shartiga mos bolmagan natija chiqadigan bolda xech narsa chiqmaydi `console` da! 



@dawroun
Realtion Operator haqida ma'lumot: Logical operator.
Published: 2023-01-18 12:16:32



```cpp
Aloqa operatori.
chap va o'ng tomon o'rtasidagi munosabat
Natija har doim  to'gri yoki notog'ri
True 1ni, False esa 0ni qaytaradi.
c da 0 dan boshqa har qanday qiymat rost deb hisoblanadi.

```
 

```cpp
int i = 5;
  int j = 10;
  int k = 15;
  cout << ( i == k/j);
  }

```

```cpp
< chap tomoni o'ng tomonidan kichiqroq.
<= chap tomon kichiqroq yoki o'ng tomonga teng.
== chap tomon o'ng tomonga teng.
>= chap tomon o'ng tomondan katta yoki teng.
> chap tomoni o'ng tomonda kattaroq.
!= chap va o'ng tomonlari bir xil emas.

**unga misol:**

```cpp
int ogirlik;
  cout << (ogirlik > 100);
  cout << ogirlik ;

  

  
 cout << ( a > 0 && a < 100);
  
  cout << ( a > 0 && a <100);
   
  int olma;
int apilsin;
   cout << ( olma != apilsin);
  
  int x;
  cout << (x == 0);
```
    LOGICAL OPERATORI

```cpp
BIR YOKI BIR NECHTA SHARTLARNI SOLISHTIRISH VA ULARNING NOTO'G'RI EKANLIGINI ANIQLASH.

```
#include <iostream>
using namespace std;
int main (){
  int yosh;
  cin >> yosh;
   (yosh <=12 || yosh >=50) ? cout << "30 % li chegirma sizda bor": cout << " yoq";
  }

int main () {
  string pasport;
   int age;
  cout << " passportingiz bormi (bor yoki yo'q)" << endl;
  cin >> pasport;
  cout << "Yoshingizni kiriting" << endl;
  cin >> age ;
  (pasport == "bor" && age >=18)? cout << " siz saylash huquqiga egasiz" : cout << "saylash huquqiga ega emassiz";
  }
⚛️⚡️ Introduction to React Hooks
Tags: react, webdev, beginners, javascript
Published: 2023-01-18 12:08:12

What are Hooks?

Let's start by understanding what Hooks are, Hooks are an innovation, a modification that the React team has made available to us since version 16.8

Hooks are basically a way to create components and create your application's features without creating entire classes with a lifecycle, constructors, defining various states, binding functions, and so on. Now with a simple variable we can create a complete and complex component with the use of Hooks, Hooks have come to change the way we code our features in order to use even less code and with more performance.

So, if we compare a component created using Hooks with a component created with classes, the one created with Hooks is infinitely smaller in terms of the amount of code, and this is very beneficial both for production time and for your productivity.

Anyway, Hooks are functions (which always start with the word use) that allow you to “connect” to React's state and lifecycle resources from functional components, and just to point out Hooks don't work inside classes.

**Three important features about Hooks:**

1. They only work on functional components.
2. They must always be invoked in the main scope of your component (for example outside ifs and functions).
3. And finally, they cannot be linked to any conditional to be executed.

React provides some built-in Hooks like useState (we'll see in the next post), but you can also create your own custom Hooks to reuse state behavior between different components.

Hope this article helped you to understand more about React Hooks
Configure video recording in OBS for import into Davinci Resolve in Ubuntu
Published: 2023-01-18 12:01:56

---
title: Configure video recording in OBS for import into Davinci Resolve in Ubuntu
published: true
description: We look into how to record video in OBS so we can import it into Davinci Resolve in Linux.
tags:
cover_image: https://i.ytimg.com/vi/z1yMpwVD9VA/maxresdefault.jpg
---

{% youtube z1yMpwVD9VA %}

We look into how to record video in OBS so we can import it into Davinci Resolve in Linux.
OSD700 - Setting up Telescope and more
Tags: opensource, javascript, docker
Published: 2023-01-18 11:56:00

Last semester in OSD600, we were introduced to the Telescope project, maintained by developers at Seneca College. It was a daunting experience to set it up locally initially, as I ran into issues with authentication and correctly seeding the Postgres database. With support from the project's maintainers, I could run Telescope properly on my operating system and contribute to both the client side and the project's backend. 

### Steps I take to Start Telescope

1. Load Docker Desktop client
2. Run the `pnpm services:start` script
3. Stop `parser` using Docker Desktop client
4. After all the containers are started, run: `cp ./src/db/env.example .env` 
5. Run `pnpm db:init` script
6. Restart `parser` using `pnpm services:start parser`

### Memory Issues

I have no issues running Telescope on my machine, except that specific containers consume too much memory space, which makes my system lag. I also helped one of my peers connect to the Telescope's backend locally. 

### Goals
This semester, I look forward to familiarizing myself more with microservices and Docker, so I am comfortable using these technologies in the future.