teleren/devto huggingface dataset:
Onda de demissões nas 'big techs' continua
Published: 2023-02-24 03:19:37

No início do mês de fevereiro de 2023, a **Dell** anunciou o corte de 6650 vagas no seu quadro de colaboradores. Outras companhias seguem o mesmo caminho, conforme podemos ver no quadro abaixo:

| Companhia | Colaboradores | % |
| --------- | -------------- | ---------------- |
| Yahoo | 1600 | 20% |
| Zoom | 1300 | 15% |
| Twillio | 1500 | 17% |
| Udemy | não informado | 10% |

(_fonte: [Crunchbase](https://news.crunchbase.com/startups/tech-layoffs/)_)

---

## Mas o que está acontecendo?
Empresas de tecnologia estão entre as mais rentáveis na atualidade, além de serem bastante atrativas para investidores de longo prazo.

Embora sejam fatores que favoreçam a geração de lucros, é importante analisar as estratégias adotadas nos últimos 24 meses para entender melhor o que está acontecendo neste momento.

A pandemia mudou radicalmente a maneira como trabalhamos, criando uma demanda elevada por dispositivos e serviços. E para atender esta necessidade, mais latente na parte de suporte e infraestrutura, as companhias realizaram contratações em massa durante o primeiro ano da pandemia, mantendo esse ritmo ao longo de 2021.

Tendo em vista que o cenário atual, com juros elevados e sem um vislumbre claro do fim da recessão global, essas companhias se viram obrigadas a cortar posições, piorando a situação econômica de diversas famílias.

---

## E quando essa onda vai passar?
Especialistas não tem uma previsão de quando o cenário ficará economicamente mais favorável. 

O mais importante é possuir uma boa estratégia para que desvios de demanda como o que o ocorreu em 2020, tenham seu impacto mitigado frente aos negócios.

Empresas como **Amazon** e **Meta**, que possuem capital aberto na Nasdaq - bolsa de valores americana que negocia exclusivamente ações de empresas de tecnologia - são obrigadas a reportar alterações no quadro de funcionários.

E de acordo com os relatórios divulgados por essas companhias, houve um crescimento de 38,5% e 30,4%, respectivamente, no quadro de colaboradores em 2020.

Em 2021, a **Amazon** aumentou seu quadro em 19,3% (metade de 2020) e a **Meta** aumentou seu quadro em 22,8%. Já a **Apple**, também com capital aberto na Nasdaq, reportou um crescimento de 7,3% em 2020 e 4,8% em 2021. 

Das 'big techs' a **Apple** foi a mais conservadora. Congelou contratações e não reportou corte de funcionários nos últimos 2 anos.

---

Não sabemos quando e como a economia global voltará a crescer. 

Enquanto isso, é importante estar preparado para as oportunidades que aparecerem, e neste momento, vale o ditado: "_Quando Deus fecha uma porta, abre uma janela_".

Até breve! :sunglasses:
JavaScript —— Aysnc
Tags: javascript
Published: 2023-02-24 02:52:47

## Promise

### 状态

- Pending: 初始状态
- Fulfilled: 成功
- Rejected: 失败

### 静态方法

- `Promise.resolve()`: Fulfilled 的 promise
- `Promise.reject()`: Rejected 的 promise
- `Promise.all()`: 所有 promise 成功为 Fulfilled, 否则为 Rejected
- `Promise.allSettled()`: 所有 promise 的结果数组
- `Promise.race()`: 最快 Fulfilled 或 Rejected 的 promise
- `Promise.any()`: 最快 Fulfilled 的 promise


### 实例方法

- `then()`: Fulfilled 或 Rejected 后执行
- `catch()`: 发生错误时执行
- `finally()`: 最后始终执行

---

## 异步函数

> 异步函数返回一个 Promise.

```javascript
async func1() {...}

async func2() {
  await func1()
  ...
}
```
JavaScript —— Class
Tags: javascript
Published: 2023-02-24 02:34:17

## 类定义

- 类声明: `class Person {...}`
- 类表达式: `const Person = class {...}`

> 类声明和函数声明不同的是, 类声明不会提升, 在类声明前使用, 将抛出 ReferenceError.

---

## 类方法

- 构造函数: `constructor() {...}`
- get 方法: `get name() {...}`
- set 方法: `set name() {...}`
- 原型方法: `func() {...}`
- 静态方法: `static func() {...}`
- 私有方法: `#func() {...}`

---

## 类属性

- 静态属性: `static name = 'itroger'`
- 公有属性: `name = 'itroger'`
- 私有属性: `#name = 'itroger'`

---

## 继承

- 类继承: `class Dog extends Animal {...}`
- 使用 `super` 调用父类
- 使用 `this` 引用类本身
7 reasons you must learn Kubernetes immediately
Tags: devops, kubernetes, devjournal, programming
Published: 2023-02-24 02:32:00

Kubernetes is by far the most popular platform to manage and orchestrate solutions based on containers. They won the war on it. 

## Here are 7 reasons you must learn it immediately:


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

Thanks for reading this.

If you have an idea and want to build your product around it, schedule a call with [me](https://calendly.com/pragyanatvade).

If you want to learn more in DevOps and Backend space, [follow me](https://dev.to/pragyanatvade).

If you want to connect, reach out to me on [Twitter](https://twitter.com/pragyanatvade) and [LinkedIn](https://www.linkedin.com/in/pragyanatvade/).
Magicaldrome String
Tags: beginners, programming, typescript, node
Published: 2023-02-24 02:29:50

[](url)A Magicaldrome String is a string of characters that reads the same forward and backward when characters are read in groups of two and the groups of two are always read from left to right.

For example, "abcdcdab" is a Magicaldrome String because the first two characters are the same as the last two characters in the string, namely "ab"; and the 3rd and 4th characters from the left are the same as the 4th and 3rd characters from the right, namely "cd".

Our task is to take an inputString consisting of lowercase letters and determine whether the string can be rearranged into a Magicaldrome String or not. Ifit can be rearranged into a Magicaldrome String return, "Yes"; if it cannot, return "No".

Example
Input: abbhbhab
Output: Yes

``` JavaScript
export default function isMagicaldrome(inputString: string): string {
  console.log(inputString);
  if (inputString.length % 2 !== 0) {
    return "no";
  } else {
    let chStr: string = inputString;
    while (chStr.length > 0) {
      if (chStr.slice(0, 2) !== chStr.slice(-2)) {
        return "no";
      }
      chStr = chStr.slice(2, -2);
      console.log(chStr);
    }
    return "yes";
  }
}
console.log(isMagicaldrome("abbhhbab"));
```
Zerando HackerRank ( 1 )
Published: 2023-02-24 02:26:41

Neste desafio fica claro que existe a necessidade da criação da função "compareTriplets" ou comparar trigêmeos que é uma clara referência a como essa função vai receber os parâmetros a fim de comparar os resultados e por fim apresentar.

Essa função ficou assim:

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

Essa função recebe 3 arrays, e se inicia com duas variáveis com o valor Zero.
Logo apos isso ela se utiliza de um FOR que se inicia a partir do primeiro elemento e percorre toda array.
Na primeira condicional ela compara se o valor de "a" é superior a "b", no caso da afirmação ser verdadeira ele adiciona + 1 a variável "aliceScore", 
Já na segunda condicional ela compara se o valor de "a" é inferior a "b", no caso da afirmação ser verdadeira ele adiciona + 1 a variável "bobScore",
E por fim ela retorna as duas variáveis.

Observação interessante:
Uma forma mais interessante para a mesma adição de + 1 a qualquer contador é utilizar o ++ a variável, não que adicionar + 1 esteja errada, mas é mais legal dessa forma:

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

Link deste desafio:
https://www.hackerrank.com/challenges/compare-the-triplets/problem?isFullScreen=true
The Tashi Game Architecture
Tags: multiplayer, unity3d, gamedev, anticheat
Published: 2023-02-24 02:26:13

Multiplayer game backend architecture is a complex and challenging field. There are many factors that must be taken into account when designing and implementing a multiplayer game, including performance, scalability, reliability, security, and data flow. Check out what a heavily simplified multiplayer game backend looks like




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



One approach that can make multiplayer game backends more robust and easier to reason about is the use of a message queue architecture with unidirectional data flow. This approach is inspired by the popular front-end data library Redux, which simplifies the management of application state.

In a message queue architecture with unidirectional data flow — which we refer to as the “Tashi architecture” — all in-game events are treated as messages that are added to a queue. These messages are processed in a predictable and deterministic way, with the game state being updated as a result of the processing of these messages. See how simple that is in the case of Redux:


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



## Redux architecture

This approach has several advantages for multiplayer game backends. First, it allows for easier debugging and testing, as the processing of messages can be traced through the system in a linear fashion. Second, it makes it easier to scale the non-multiplayer parts of the backend backend (you can leverage the Tashi multiplayer engine for that, currently in [closed beta](http://tashi.gg)), as messages can be processed in parallel and distributed across multiple servers. Third, it simplifies the implementation of new features, as all in-game events are available as a data stream that can be easily consumed — and added to — by other systems.

For example, if all in-game events are available as a data stream, it becomes much easier to implement analytics, advertising, and other additional functionality. This is because these systems can simply consume the data stream and perform their own processing on top of it, without having to be tightly integrated with the rest of the system.

In summary, the use of a message queue architecture with unidirectional data flow can make multiplayer game backends more robust and easier to reason about. By treating all in-game events as messages and processing them in a predictable and deterministic way, it becomes easier to debug and test the backend, scale it to meet the needs of the game, and add new features.

## How Do I Try It?

Simple! Sign up for our closed beta program [here](https://tashigg.typeform.com/closed-beta).
Tashi Consensus Engine — Why Fairness (and Less Netcode) Matters to Game Developers
Tags: webdev, gamedev, unity3d, web3
Published: 2023-02-24 02:09:21




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





Netcode, the underlying technology behind multiplayer gaming, is a crucial aspect of online gaming experiences. It is responsible for the transmission of data between players in real-time, determining the outcome of in-game events, and creating a sense of fairness and reliability.

However, writing effective and efficient netcode is a challenging task, and it requires an in-depth understanding of network protocols, data transmission, and low-latency gaming. Not only does it have to be performant, but it also has to maintain a perception of fairness. This is where [Tashi](http://tashi.gg) comes in.

Tashi's proprietary consensus protocol provides the fastest P2P multiplayer sessions possible while maintaining dedicated server-like authority. It assigns each in-game event a fair timestamp that is determined by the median of when the majority of players saw it. This eliminates the need for a centralized server and the need for lag compensation, providing the most reliable and fair experience for players.

Tashi’s multiplayer backend ensures that gamers are playing on a level playing field and that cheating is prevented through its consensus layer. By bringing the best of P2P and dedicated game servers together, you can think of Tashi multiplayer as the cheapest game server you’ll find, making for a more accessible game development experience, especially for indie game developers.

Tashi's approach to netcode is not just about fairness and performance, but also about providing a seamless gaming experience across the Web2 and Web3 world. The indisputable game results of Tashi sessions can easily integrate with smart contracts to bolster in-game economy, scaling Web3 games to AAA-levels or boosting player trust in traditional, Web2 games.

Convenience is a philosophy we live by, which is why in addition to offering a low-latency gaming experience, a sense of fairness, and reliability that is unmatched by other multiplayer solutions, Tashi provides the most painless multiplayer solution out there. Our [Unity plugin](http://tashi.gg) (closed beta is live right now) allows you to completely forget that you’re even using Tashi. **Tashi Network Transport (TNT)** integrates seamlessly with Unity’s [Netcode for GameObjects](https://docs-multiplayer.unity3d.com/netcode/current/about/index.html). There is almost nothing you need to change about your game other than import the plugin.
Hey Game Devs! Show us your first game.
Tags: gamedev, programming
Published: 2023-02-24 02:08:01

Hey friends!

It can be intimidating entering a new field and only seeing the incredible games people have spent years working on.

Help a beginner out and show me your very first game, be it a text-based adventure game, tic-tac-toe, or any code you wrote where you could interact with it and 'win'.
Tashi Consensus Engine (TCE) — Why Fairness Matters to Gamers
Tags: unity3d, gbaas, gamedev, web3
Published: 2023-02-24 01:54:39

When it comes to online gaming, lag — the result of slow internet speeds or distance from the game server (dedicated or P2P) — is the root of all evil. 


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



Who shot first — a diagram of your average in game chat

From a UX perspective, lag makes it difficult for players to move their characters smoothly and respond quickly to in-game events.

From a fairness perspective lag just plain ticks players off. Game netcode often tries to strike the balance between improving the in-game experience of players with higher ping — through lag compensation and other techniques — and maintaining the perception of fairness (the good ol’ who-shot-first problem). This is particularly important in competitive and high-stakes games where players expect to be treated fairly and to have the same chances of winning as their opponents. It’s a difficult task however, and it can make or break a game.

To address these issues, Tashi Network Transport (Unity TNT) has implemented a fair ordering consensus algorithm through its proprietary Tashi Consensus Engine (TCE). The TCE ensures that all players see the same events in the same order, regardless of their internet speed or latency. This eliminates the need for lag compensation and other arbitrary refereeing, making the game fairer and more enjoyable for all players.

The TCE operates by using a distributed ledger system to maintain an accurate and consistent record of all game events. Each event is verified by the majority of nodes in the network, ensuring that there is no single point of failure. This means that even if one node fails or is compromised, the TCE will still be able to maintain its integrity and provide a fair ordering of game events.

Tashi’s fairness goes beyond fair ordering and extends into game events that cannot be falsified by anyone - even by game developers or publishers. This is because the TCE operates on a decentralized network that is controlled by the players themselves, making it almost impossible for any single entity to manipulate the game in their favor. This ensures that all players have an equal chance of winning and that their in-game achievements are indisputable.

Indisputable and cryptographically provable game results have various implications for competitive and high-stakes games, where victories have real-world rewards and losses have real-world consequences. Web3 games can trusltessly support in-game economies and real payouts, while gamers can trust that even Web2 games/tournaments can’t fudge the numbers on their central server.
My vs code extensions
Tags: beginners, javascript, vscode, vscodeextension
Published: 2023-02-24 00:58:32

In this article, i want to show the extensions that helped me in the development of React Applications.

**Live Share**

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

This extensions is very good for share the code in real time with another person, without the need to commit the code.

**Material Icon Theme**

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

This extensions it was the first to be installed to help identify the folders and icons.

**Live Server**

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

This is very important to run the pages on browser, fast and easy.

**Code Runner**

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

Run code snippet or code file for multiple languages, this for run javascript file its very good

**ESLint**

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

In the front-end development we have specifics with lint in the files, use this extensions for lint.

**Jest**

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

Testing is a part that requires a lot of attention, this extensions help for debug, run only one test and many others things.

**GitLeans**

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

To complete my setup in vscode, this extensions to help with git.

So, i like to get to know and test other extensions and add to my vscode.

I thank all the people who add to my new journey with front
Conax Infotech
Tags: conaxinfotech, training, software, company
Published: 2023-02-23 12:50:25

**About Company: **
[Conax Infotech ](https://conaxinfotech.com/)is an ISO 9001: 2015 Certified software training company headquartered in Naini Prayagraj, that provides short-term and long-term software training programs for Computer Science/ Civil /Mechanical / Electrical Engineering and other background students.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/fsjhiw3hh433sibr8mec.png)
**History**
Conax Infotech was founded in 2022 by a team of experienced IT professionals with the vision of creating a company that could deliver innovative software training programs across the globe for job seekers and beginners along with experts. In upcoming years, the company wants to grow to become a trusted training partner for top engineering, polytechnic, ITI colleges, and corporate sector.

**Services**
Conax Infotech offers a wide range of training programs that cater to the diverse needs of engineering students. Its training services include web and mobile app development training, digital marketing training, programming languages training, framework training, database development training, graphic designing training, AutoCAD, CorelDraw, and photoshop training. The company also provides computer diploma courses and Nielit courses for academic students.

In addition, Conax Infotech also offers special computer classes for CBSE/ICSE/UP Board students.

**Conclusion**
Conax Infotech has established itself as a leading provider of software training programs, with a team of experienced professionals and skilled instructors in a short time.
Python - สลับ seleniumlibrary version ด้วย venv
Tags: python, venv
Published: 2023-02-24 00:41:05


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

พอดีมีน้อง QA ในทีมท่านนึง เจอปัญหาต้องดูแล robotframework & seleniumlibrary คนละ version ทำให้ต้องสลับ keyword ไปมาระหว่างพัฒนาเทส วันนี้เลยขอเสนอท่า venv (virtual environments) เพื่อแก้ปัญหานี้กัน

**virtual environment คืออะไร ?**
virtual environment คือความพยายามที่จะสร้าง Python environment ให้เหมาะสมสำหรับการทำงาน ปัญหาหลัก ๆ ที่เรามักจะเจอกันคือการใช้ dependency library ที่ไม่ตรงกัน version กัน 

เช่น
- โปรเจค A ต้องการ lib `X==1.0.0`, `Y==2.0.0`
- โปรเจค B ต้องการ lib `X==2.0.0` และ `Z==3.0.0` 

หรือบ้างครั้งเราแค่อยากทดลองลง upgrade version และทดสอบดูว่ามีอะไรพังไหมเท่านั้น ดังนั้นถ้าเราสามารถสร้างและแยก environment ให้สามารถสลับกันไปมาได้ระหว่าง lib `X==1.0.0` กับ `X==2.0.0` ได้ก็จะสะดวกไม่น้อยเลย

**ขั้นแรก check python version กันก่อน**

```
C:\Users\tumit>python --version
Python 3.11.2
```

ซึ่งตั้งแต่ version 3.5 ขึ้นไป venv ถือว่าเป็นท่าที่ recommended ในการสร้าง virtual environments

**เริ่มสร้าง virtual environment และใช้ สำหรับ seleniumlibrary v.5 กัน**
ต่อมาเราจะมาสร้าง virtual environment สำหรับลง seleniumlibrary v.5 เพื่อ support robot เก่า ๆ ที่อาจจะยังไม่พร้อมที่จะ move on ไป version ใหม่ เริ่มจากคำสั่ง

```
C:\Users\tumit>python -m venv rf-selenium-5 // ชื่อตามที่เราอยากได้เลย
```

มันจะทำการสร้าง folder ที่ชื่อ rf-selenium-5 ให้เราประมาณนี้

```
C:\Users\tumit>dir .\rf-selenium-5
 Volume in drive C has no label.
 Volume Serial Number is EXXX-0XXB

 Directory of C:\Users\tumit\rf-selenium-5

02/24/2023  07:11 AM    <DIR>          .
02/24/2023  07:11 AM    <DIR>          ..
02/24/2023  07:11 AM    <DIR>          Include
02/24/2023  07:11 AM    <DIR>          Lib
02/24/2023  07:11 AM               270 pyvenv.cfg
02/24/2023  07:11 AM    <DIR>          Scripts
               1 File(s)            270 bytes
               5 Dir(s)  74,569,793,536 bytes free
```

จากนั้นเราก็จะทำการ activate เพื่อเลือก environment นี้ในการพัฒนากันด้วยคำสั่ง
```
// คำสั้ง activate จะอยู่ใน path นี้นั้นเอง
C:\Users\tumit>.\rf-selenium-5\Scripts\activate 
```

จะสังเกตุว่าที่ prompt ของเราจะมี (rf-selenium-5) ที่แสดงว่าเรา active อยู่ที่ environment นี้แล้ว 


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

จากนั้นเราก็ install library ใน version ที่เราต้องการได้เลยเช่น 
```
pip install robotframework
pip install robotframework-seleniumlibrary==5.0.0
```

เราสามารถใช้คำสั้ง `pip freeze` เพื่อแสดง dependency libraries ได้ประมาณนี้


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


และถ้าต้องการจะออกจาก environment นี้ก็สามารถทำได้ ด้วย command `deactivate`  ง่าย ๆเลย 

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


จบปิ๊ง ~

references:
- https://docs.python.org/3/library/venv.html
- https://www.dataquest.io/blog/a-complete-guide-to-python-virtual-environments/
- https://deepai.org/machine-learning-model/text2img (blog cover image)