teleren/devto huggingface dataset:
Paracetamol.ts💊| #30: Explica este código TypeScript
Tags: typescript, javascript, spanish, webdev
Published: 2023-03-10 14:00:00

## **<center>Explica este código TypeScript</center>**
#### <center>**Dificultad:** <mark>Intermedio</mark> </center>

```ts
abstract class Auto {
  protected color: string;
  private puertas: number;

  constructor(color: string, puertas = 4) {
    this.color = color;
    this.puertas = puertas;
  }
}

const car = new Auto("red", 6) // ??
```

- A. `No hay errores, todo funciona bien`
- B. `Cannot create an instance of an abstract class`
- C. `SyntaxError`
- D. `Ninguna de las anteriores`

{% spoiler **Respuesta** %} 

✅ B. `Cannot create an instance of an abstract class.`

En programación orientada a objetos una clase abstracta es aquella que, dada una jerarquía de clases, la clase escrita como abstracta no puede ser instanciada, en otras palabras, no es posible crear objetos de una clase abstracta, esta acción debe realizarla su o sus clases heredadas.

En este caso `Auto` es una clase abtracta, entonces no es posible hacer `const car = new Auto("red", 6)`. 


{% endspoiler %}

---

Puedes ver el último reto acá:

{% link https://dev.to/duxtech/paracetamolts-29-explica-este-codigo-typescript-2ndi?preview=1b8c9ba9a1660256b8c48ecb3611787fb4411ed942b114e2760e2b473cd758a2ea08cc32d9b52333bc4572b3d8a7e4d45ae4d40d787ccd5b7f9137e4 %}
The Top 1 Extension manager plugin in Chrome Webstore is Hijacking you
Tags: chrome, webextensio, productivity, security
Published: 2023-03-10 13:58:29

_I'm not giving any link in this post because I don't want readers to visit the extension's page.
_

`Extension Manager` is a Google Chrome extension (id: gjldcdngmdknpinoemndlidpcabkggco )that is popular among Chinese users. This manager mainly helps users quickly turn on or off some extensions.

The Google Chrome online store shows that it has more than 100,000 users, and 809 users gave a score of 4.5 stars (out of 5).

However, since last year, this extension program has been found by users to have hijacking problems. When users visit shopping websites, they will be hijacked and redirected from rebate websites.


I checked the comments of this extension and found that some users pointed out that there was a hijacking problem, but the developer replied to other inquiries but directly skipped this question.

On the V2EX , different users have also discovered hijacking situations and explained the hijacking code in detail. 

>When users visit websites such as Taobao and JD.com, they will be captured by this extension and then jump to the rebate site controlled by the developer before going to the real site.

This means that this extension not only privately hijacks users without consent, but may also monitor the websites visited by users in order to jump when necessary.


If you have installed a browser extension called Extension Manager (id gjldcdngmdknpinoemndlidpcabkggco), it is recommended that delete it.

I found that this extension program has also been launched on Microsoft’s browser store. Therefore both Google Chrome and Microsoft browser users should delete it.
Ma'lumot turlari
Tags: cpp, programming, beginners
Published: 2023-03-10 13:57:53

Data Type - Ma'lumot turlari:

```
#include <iostream>
using namespace  std;

int main()
{

int num = 123;                   //Butun sonlar uchin
float numq = 15.23;              // kasr sonlar uchun
double num3 = 95.6123;           //o'nli kasr sonlar uchun
char letter = "B";               //Belgilar uchun
bool Boolean = True "or" False;  //to'g'ri yoki noto'g'ri
string text = "Hello World";     //Tekst uchun


return 0;
}
```
**Ma'lumotlarni asosiy turlari**


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/dquwadasmrmyfgulczrc.png)



**Raqamlar uchun** - `int` - `integer` - faqat raqamlar va solar uchun ishlatiladi

```
#include <iostream>
using namespace std;

int main()
{

int num = 10;
int num1 = 130;
int num2 = 4560;

return 0;
}
```

**Kasr sonlar** - `float` faqat kasr sonllar uchun ishlatiladi;

```
#include <iostream>
using namespace std;

int main()
{

float num = 123.54;
float num1 = 12.548;
float num2 = 153.855;
float num3 = 4556.544;


return 0;
}
```

**double** - faqat kasr sonlar uchun ishlatiladi

```
#include <iostream>
using namespace std;

int main()
{

double num = 1.55815;
double num1 = 2.65454;

return 0;
}
```

**Farqai** `float` nuqtadan keyin 4 ta son bo'ladi `double` nuqtadan keyin 8 ta son bo'ladi

```
#include <iostream>
using namwspace std;

int main()
{

float = 1.2315;
duoble num1 = 1.12345678;

return 0;
}
```

**String**
`string` bu faqat matn va tekst turlari uchun ishlatiladi

```
#inlude <iostream>
using namespace std;

int main()
{

cout << "Men hozir Cpp ni o'rganyapman va Cpp juda qizik ekan";

return 0;
}
```
**char** - beldilar uchun;
`char` -  ma'lumotlar turi saqlash uchun foydalanadigan `yagona` belgi. Belgilar 'A', yoki 'c' kabi bir tirnoq bilan o'ralgan bolishi kerak

```
#include <iostream>
using namespase std;

int main()
{

char sing = "A";
char sing1 = "B";
char sing2 = "c";

cout << sing << endl;
cout << sing1 << endl;
cout << sing;

return 0;
}
```

`boolean` ma'lumotlar turi bilan e'lon qilinadi bool kalit so'z va faqat qiymatlarni qabul qilishi mumkin `true` yoki `false`.Qiymat qaytarilganda `true = 1` va `false = 0`

```
#include <iostream>
using namespace std;

int main()
{

bool true = 25;
bool true1 = 35;

cout << true =< true1; // bu to'gri `true`
cout << true1 =< true; // bu noto'g'ri

return 0;
}
```
C++ syntax
Tags: programming, cpp
Published: 2023-03-10 13:56:00

This section lays out basic C++ syntax.  The first step to learn any language is to study its rules and regulations which together are called as syntax. Formally, the term “_Syntax_” means an approved set of pre-defined protocols or rules that we need to follow while working in a programming language. Just like any other programming language, C++ has its own unique syntax.

So let us begin with a simple `“Hello World!”` program. Open any IDE or text editor and create file HelloWorld.cpp with following content.


```
// Basic header file for giving Input/output function
_#include <iostream>_
//Standard namespace
_using namespace std;_
//Entry point of the code 
_int main()_
{ 

           //Print Hello world on console and exit
             _cout<<"Hello world!"<<endl;_	
	     _ return 0;_
}
```


**Line 1** is a comment for the reader as to that why we are including the iostream header file. Comments are ignored by the compiler. C++ ignores white space. Whitespace denotes blanks, tabs, newline characters and comments. Whitespace gives logical separation and is used by compiler to identify where one element in a statement ends, and the next element begins.

**Line 2** tells compiler to include standard header iostream. Iostream is needed for input output functionality to a stream (console in this case). The compiler will look into the standard path for this. A user can include his own header file say XX.h that is located in same directory by simply writing #include “XX.h” 

**Line 3** is blank (kept blank for readability)

**Line 4** is comment to denote we are using standard namespace

**Line 5** tells compiler to use standard namespace in this file. Namespace is collection of names for objects and variables from the standard library. Namespaces allow us to group named entities into small and narrow scope that can be accessed privately for different programmes. This allows organizing the elements of programs into different logical scopes referred to by name. If you do not want to include standard namespace then you have to add std:: prefix before every standard object e.g. std::cout<<”…”;

**Line 6** gives comment about main() to tell reader that it is the main entry point of this code. This means it is the first function that is called when the program executes

**Line 7** starts definition of main(). Any code for a method that is written in {} gets executed.

**Line 8** and 12 are curly brackets that enclose the body of main()

**Line 9** gives comment 

**Line 10** uses cout function to print Hello world! On to console and then leave a line

**Line 11** gives return statement with return code telling compiler to take control back from this program. Return code 0 denotes successful execution.
C ++ Kirish
Published: 2023-03-10 13:48:46

C++ dasturlash tili C tiliga asoslangan. C esa o'z navbatida B va BCPL tillaridan kelib chiqqan. BCPL 1967-yilda Martin Richards tomonidan tuzilgan va operatsion sistemalarni yozish uchun
mo'ljallangan edi. Ken Thompson. 
C tilini Dennis Ritchie B dan keltirib chiqardi va uni 1972 yili ilk bor Bell Laboratoriyasida, DEC PDP-11 kompyuterida qo'lladi. C o'zidan oldingi B tildir. Unda C ga o'hshab strukturali
dasturlash yoki yangicha, ob'ektlar bilan dasturlash mumkin. Yangicha deyishimiz ham nisbiydir. Ob'ektli dasturlash
falsafasi paydo bo'lganiga ham yigirma yildan oshayapti. C++ funksiya va ob'ektlarning juda boy kutubhonasiga ega. Yani C++ da
dasturlashni o'rganish ikki qismga bo'linadi. Birinchisi bu C++ ni o'zini o'rganish, ikkinchisi esa C++ ning standart kutubhonasidagi tayyor ob'ekt/funksiyalarni qo'llashni o'rganishdir.
Kirish
Tags: beginners, programming, tutorial, cpp
Published: 2023-03-10 13:42:35

Salom dasturchi bugun siz bilan dasturlash tilida yangi bo'lgan til, dasturlash tilida yangi emas biz o'rganayatgan tillardan yangisi bilan tanishamiz . 

Bu oldin biz o'rgangan til paythondan farq qiladi . 
Bunda biz oldingi fonini emas orqa fonini o'rganamiz .

Paythonda faqat funktsiyalar bilan tanishgan edik . Bu tilda ya'ni c ++ da o'sha funktsiyalarni nima ish bajarishini bilib olamiz . 

**Hozir man c ++ nima ekanligi haqida ma'lumot beraman ** 
c ++ aslida c lar oilasiga mansub til bo'lib , yuqorida aytganimdek orqa fonni yozishda kerak bo'ladi ammo hozirgi kunda 
c ++ ni ko'p dasturchilar yo'nalish qilib tanlamaydi . Buning sababi esa u eski til hisoblanadi . Bu degani u yaxshi til emas degani emas u barcha tillarni o'zaki ya'ni mazmuni , mohiyati hisoblanadi . U orqali biz ko'plab o'yinlar , kompyuterlar , telefonlar ga ko'd yozishda foydalansak bo'ladi . va yana boshqa narsalar . 

Bu tilni Martin Richards 1967 - yilda ko'd yozadigan dastur shaklida yozgan . 

Nima uchun C++ dan foydalanish kerak?

C++ dasturlash tili dunyo bo'yicha keng foydalanib kelinayotgan dasturlash tili hisoblanadi.
C++ Barcha Grafik Interfeys ga ega Operatsion Sistemalarda uchratish mumkin.
C++ Bu obyektga yo'naltirilgan dasturlash tili hisoblanib. Tuzilgan dasturni osonlik bilan o'zgartirish imkoniyati mavjud.
C++ - Qiziqarli va o'rganishga juda oson.
C++ - Ko'chma va bir nechta platformaga moslashtirilish mumkin bo'lgan dasturlar yaratsangiz bo'ladi.
C++ - C# va Java dasturlash tiliga yaqin bo'lgan dasturlash tili bo'lganligi sababli almashtirish juda oson. 
**Shu sababdan bu tilni o'rganish barcha dasturchilarga kerak **

C ++ dasturchilarining eng yoqtirgan so'zi Hello world - buning tarjimasi salom dunyo  degani .
Identifikator
Tags: beginners, programming, cpp
Published: 2023-03-10 13:37:11

Indefikator bu ozgaruvchini nomini togri berish degani xozir man shunga oxshash misollar korsataman.


```
#include <iostream>
using namespace std;
​
int main() {
  int age = 24; 
  string name = "akbar"; 
  string country = "Cpp";
}
```
Iden tifikator lotin harflaridan boshlanishi shart;
Ikkinchi simvoldan boshlab raqamlardan foydalanish mumkin;
C++ da katta kichik harflar farq qiladi. Ya’ni quyidagilarning har biri alohida identifikator hisoblanadi:  KATTA, katta, KaTTa, kAttA, KattA, …
Probel C++ da so’zlarni ajratish uchun ishlatiladi. Shuning uchun identifikatorda probeldan foydalanib bo’lmaydi.
Xizmatchi (int, float, for, while kabi) so’zlardan identifikator sifatida foydalanib bo’lmaydi;
Constanta(C++)
Tags: beginners, programming, tutorial, cpp
Published: 2023-03-10 13:34:11

So nows theme is Constanta. Constanta-const is an invariant. In the C++ programming language, we can use the utility word "const" to declare constants. Constanta is only possible to read the value (take). For example we have created a single variable that we use the constant so that it is preserved and does not change. It's very important code if you planning to create a large project.
int main1() {

```
int main1() {

const int Num = 34;
Num = 45

return 0;
}
In this code C++ gives 45 an error.
That's all!
```
c ++ kirish
Tags: beginners, tutorial, programming, cpp
Published: 2023-03-10 13:32:00

> C++ Kirish.
Assalamu aleykum hurmatli dasturchi bugun siz bilan C++ dasturlash tilini boshlaymiz! C++ dasturlash tili orqali. Siz Kompyuterlar uchun Android va Arduino uchun dastur kod yozsangiz bo'ladi. C++ dasturlash tili ko'rinishidan juda sodda va tushunishga osonroq dasturlash tillari sirasiga kiradi.

Nima uchun C++ dan foydalanish kerak?

C++ dasturlash tili dunyo bo'yicha keng foydalanib kelinayotgan dasturlash tili hisoblanadi.
C++ Barcha Grafik Interfeys ga ega Operatsion Sistemalarda uchratish mumkin.
C++ Bu obyektga yo'naltirilgan dasturlash tili hisoblanib. Tuzilgan dasturni osonlik bilan o'zgartirish imkoniyati mavjud.
C++ - Qiziqarli va o'rganishga juda oson.
C++ - Ko'chma va bir nechta platformaga moslashtirilish mumkin bo'lgan dasturlar yaratsangiz bo'ladi.
C++ - C# va Java dasturlash tiliga yaqin bo'lgan dasturlash tili bo'lganligi sababli almashtirish juda oson.
C++ dasturlash tili 1985 - yilda Bjarne Stroustrup tomonidan asos solingan C dasturlash oilasiga mansub hisoblanadi.

C++ Dasturlash tilida yozilgan Dasturchilarning eng sevimli so'zi "Hello World" yozishni koramiz.

C++ nima ?

C++ bu yuqori samarali dasturla yaratish uchun ishlatilish mumkin bo'lagan Dasturlash tili hisoblanadi.
C++ bu C tilining kengaytmasi sifatida Bjarne Stroustrup tomonidan ishlab chiqilgan.
C++ - Dasturchi uchun xotirani boshqarish. Unumli foydalanish imkoniyatini beradi.

```
#include <iostream>
using namespace std;

int main()
{
cout << "Hello World";

return 0;
}

```
How to Push an empty commit?
Tags: webdev, beginners, git, commit
Published: 2023-03-10 13:30:49

Have you ever tried to push a commit to a Git branch without changing any files in order to re-run your integration process? If yes then you are at the right corner.

Create an empty commit

```
git commit --allow-empty -m “Message”
```

Problem

For continuous integration, we are using AWS CI/CD delivery pipelines which allow us to build, test and deploy applications on a single push to a specific git branch. It helps us to reduce the manual overhead of deploying code to the server and handle all the actions automatically.

But today I faced a problem where I needed to re-run my delivery pipeline of a branch without adding any extra space or changing any files in the repository, so I searched for the solution for a while and It turns out that Git is allowing us to push an empty commit without adding any staged files to the branch, by using one option --allow-empty during git commit.

Enough of the problem, let’s jump on to the solution

Pushing a commit with staged files

```
git add .

git commit -m "changes on app controller"

git push origin master 

```
The above commands will add all unstaged files and add commit and push the code to the master branch, after that our delivery pipeline will be started.

Once the pipeline process fails or you need to run the process again, you will have to push something to the branch but as I mentioned earlier, we will not make any changes to the files, and even then, We will be able to commit the branch with this command.

Pushing empty commit

```
git commit --allow-empty -m "rerunning the delivery pipeline"

git push origin master 
```

After the above commands, you can see that the commit has been pushed to your branch and the delivery pipeline will be started.
Increment va Decrement
Tags: beginners, programming, cpp
Published: 2023-03-10 13:26:25

Increment va Decrement bu ozi bitta qiymatni qoshish yoki ayirish uchun ishlatilinadi, masalan.

```
#include <iostream>
using namespace std;
int main() {
int a = 32;
++a;
cout <<a;
return 0;
}
```
shuday qilib qoshish mumkin ayirish uchun esa shunda oxshash qilib + ni orniga 2 ta minus qoyamiz
Revert Your Git Changes: A Step-by-Step Guide
Tags: webdev, howto, git, tutorial
Published: 2023-03-10 13:25:49

<p class="paragraph"> In this article, we will learn how to undo changes in Git using different methods such as <b>git revert</b>, <b>git reset</b>, and <b>git checkout</b>.&nbsp; </p><p class="paragraph"> Git is a popular version control system that allows developers to track and manage their code changes. However, mistakes can happen, and sometimes you may need to revert changes made in your Git repository.&nbsp; </p><h2>Revert Your Git Changes step by step</h2><h3>Method 1 : Git Revert</h3><p class="paragraph"> Git revert is a safe option for undoing changes in Git as it only reverses specific commits, preserving the project's history. To revert changes using git revert, you need to specify the commit hash that you want to revert. </p><p class="paragraph"> Steps: </p><ul><li>Open the command line in your local repository</li><li>Type git log to view the list of commits</li><li>Copy the commit hash of the commit you want to revert</li><li>Type git revert &lt;commit_hash&gt; to revert the changes</li><li>Push the changes to your remote repository using git push</li></ul><h3>Method 2 : Git Reset</h3><p class="paragraph"> Git reset is a powerful command that allows you to reset your repository to a previous state. However, it can also permanently erase commits and alter the project's history. </p><p class="paragraph"> Steps: </p><ul><li>Open the command line in your local repository</li><li>Type git log to view the list of commits</li><li>Copy the commit hash of the commit you want to revert to</li><li>Type git reset --hard &lt;commit_hash&gt; to revert the changes</li><li>Push the changes to your remote repository using git push</li></ul><h3>Method 3 : Git Checkout</h3><p class="paragraph"> Git checkout is a versatile command that allows you to switch between branches or restore specific files to a previous state. To undo changes in Git using git checkout, you need to specify the file or branch you want to restore. </p><p class="paragraph"> Steps: </p><ul><li>Open the command line in your local repository</li><li>Type git status to view the list of modified files</li><li>Type git checkout &lt;file&gt; to restore a specific file to its previous state</li><li>Or type git checkout &lt;branch_name&gt; to switch to a previous branch and restore its state</li><li>Push the changes to your remote repository using git push</li></ul><h4>Conclusion:</h4><p class="paragraph"> Git provides several methods to undo changes, each with its own benefits and drawbacks. Git revert is a safe option that preserves the project's history, while git reset allows you to reset the repository to a previous state, and git checkout is a versatile command that allows you to switch between branches or restore specific files. We hope this step-by-step guide will help you effectively revert changes in your Git repository. </p>
more good news about AFFiNE - the OpenSource knowledge-base:
Tags: webdev, notion, miro
Published: 2023-03-10 13:10:26


more good news about AFFiNE - the knowledge-base 


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5xmdvosvwy2y735kzj1v.png)

btw: allready more than 1k followers on Twitter - get more infos 


Demo: 
- https://affine.pro/

Artikel on Medium:  https://medium.com/@affineworkos/affine-the-next-gen-knowledge-base-to-notion-and-miro-403f0afd9fba 

AFFiNE - FREE, Open Source, Privacy First Monday Notion Miro Alternative 
https://www.youtube.com/watch?v=lYmjgzyckQc
C++ Identifikator
Published: 2023-03-10 13:08:09

          In the C++  programming language,  variables  are named with separate keywords. For example  ,  unique names like master , cpp  are Identifiers. Identifiers  can be short names (like x and y) or more descriptive names (young, master, cpp, teacher).

The identifier must begin with Latin letters;
Numbers can be used starting from the second character;
C++ is case sensitive. That is, each of the following is a separate identifier:   KATTA, katta, KaTTa, kAttA, KattA,
Probel is used to delimit words in C++. Therefore, a probe cannot be used in an identifier.
Servants ( such as int, float, for, while  ) cannot be used as identifiers;
Note : _It is recommended not to use "_" as the first character when choosing an identifier._
My editor is my castle: share your productivity setup
Tags: discuss, productivity, tooling, motivation
Published: 2023-03-10 13:04:13


Hi everyone 👋 

I thought it would be fun to share our best-loved editors, themes, extensions, and anything else that makes us more productive. Let’s exchange ideas and look for our new favorite thing!

I’ll go first: 

**Weapon of choice:** VS Code
**Theme:** [Night Owl](https://marketplace.visualstudio.com/items?itemName=sdras.night-owl) or, when I am feeling nostalgic,  [SynthWave84](https://marketplace.visualstudio.com/items?itemName=RobbOwen.synthwave-vscode) + 80s hits in the headphones 🎸
**Extensions:** 
👉 [GitLens](https://marketplace.visualstudio.com/items?itemName=eamodio.gitlens) for GitBlame (no need to say more! 🥇)
👉 [TODO Highlight](https://marketplace.visualstudio.com/items?itemName=wayou.vscode-todo-highlight) for keeping track of my TODOs ✍️
👉 and obv [VS Code pets](https://marketplace.visualstudio.com/items?itemName=tonybaloney.vscode-pets) for reducing stress levels 😸

Your turn!
Identificator(C++)
Tags: programming, tutorial, cpp, beginners
Published: 2023-03-10 12:44:08

Hello. Today we will talk about Identificator and Constanta. So let's begin! Identificator means naming variables. For example if we don't name our variable then we can't use and summon it. It's very importable thing. Naming variables is very easy. We need just write the name of variable and give the value. That's all with Identificators!

```
int main1() {

int Number = 1;

cout << Number << endl;

  return 0;
}
```
Resolvendo problemas no HackerRank: Uma árvore com ciclos diferentes
Tags: javascript, beginners, programming
Published: 2023-03-10 12:38:20

Olá, seja bem vindo a mais um Resolvendo problemas no HackerRank: no problema de hoje, averiguar o crescimento de uma árvore utópica, que cresce de maneira estranha. Vejamos:

**Utopian Tree -**

No caso de hoje, temos uma Árvore Utópica que passa por 2 ciclos de crescimento a cada ano. A cada primavera, ela dobra de altura. A cada verão, sua altura aumenta em 1 metro. Como o problema não revelou sobre os outros ciclos anuais, vamos ignorá-los e utilizar somente o que nos foi trabalhado: VERÃO  e PRIMAVERA.

- Temos o parâmetro `n` que irá guardar um array com todos os ciclos de crescimento dessa árvore.

- Caso seja VERÃO a árvore crescerá: 1
- Caso seja PRIMAVERA a árvore crescerá: 2x mais

Vejamos a execução do código:


```
function utopianTree(n) {
    // Write your code here
  let cycleTree = 1
  
  for (let i = 0; i < n; i++){
    if( i % 2 ==0){
     cycleTree = cycleTree * 2
    }
    else {
      cycleTree++
    }
  }
    
  return cycleTree
}
```

O código acima tem os parâmetros de ciclos em `n` e criamos uma variável `cycleTree` que tem o valor inicial 1. Criamos um laçõ de repetição `for`que irá iterar o que está dentro do parâmetro inicial.

Quando o index de um ciclo der o resto 0, ao ser dividido por 2, ele será par, o que fará com que cycleTree seja multiplicado por ele mesmo 2 vezes. Esse caso representa a PRIMAVERA

Caso contrário adicionará apenas +1 ao cycleTree crescendo 1x. Esse caso representa o VERÃO.

O resultado será:

```
2
0
1


1 // primeiro ciclo 
2 // terceiro ciclo
```
Com isso, concluímos mais um desafio do _Resolvendo problemas no HackerRank:_ . Até a próxima!!!