teleren/devto huggingface dataset:
using llama finder and deno to scrape websites
Tags: javascript, typescript, webdev, tutorial
Published: 2023-03-04 08:15:45

**what is llama finder?**
llama finder is [a tool made by me on replit](replit.com/@dwarftee/llama-finder-patched?v=1) and we will be using it to find keywords on websites

**getting started**
first we need to go onto the [llama finder repl](replit.com/@dwarftee/llama-finder-patched?v=1), once you are on it, it should look something likes this:
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/eyj0m0jxeox9hfxwwzqe.png)

if we run this it will say how many times the word llama appears in the website [walkingwithllamas.co.uk](walkingwithllamas.co.uk). We don't want this though!

**changing the code**
at the top right click `fork` this will put the code into your workspace and save it on your profile. Next, open `index.ts` this is where the scraper source code is. In the code you will notice a few comments (the text after //) these are to help you know where everything is.

**searching different websites**
the first line of code contains a url, you can change this to any website you want! HOWEVER, not all websites allow you to do this as a security measure.

**changing the keyword**
on line line there is a long line of code:
```ts
const count = (html.match(/llama/g) || []).length;
```
this searches for the word llama and counts how many times it was there, we can change this by changing the word llama to something else like cat.

**changing the output**
on line 11 it logs how many times it saw your word, however if you run this it will work but instead of saing how may times it saw the word cat it would say "amount of times llama appeared: (the amount of times your word appeared)", we do not want this so change the word llama to you word you are scraping

**goodbye**
i hope you enjoyed the tool i created and have a good day
The Weekend Coder: Watercooler Discussion
Tags: discuss, beginners, codenewbie, motivation
Published: 2023-03-04 08:00:00

Hey, coders! What are you working on this weekend? 

Are you spending time on a personal project? Honing some new skills? Maybe you have a side gig, a collaboration with some other devs or a hackathon you’re excited about. 

Or perhaps you’re getting some much needed R&R, engaging in a favorite hobby, trying out a new recipe, getting ready for a special night out...maybe curling up with a cuddly pet and a book or a movie.

Tell us what you’re up to! We’re always on the search for new ideas, so recommendations welcome, please!
O que é e para o que serve arquitetura serverless?
Published: 2023-03-04 07:42:51

A arquitetura serverless, ou "sem servidor", é uma abordagem de desenvolvimento de aplicativos que permite que os desenvolvedores criem e implantem aplicativos sem se preocupar com a infraestrutura subjacente. Em outras palavras, é uma maneira de criar aplicativos sem precisar gerenciar servidores ou recursos físicos.

Em vez de provisionar servidores ou máquinas virtuais, a arquitetura serverless usa serviços gerenciados na nuvem, como AWS Lambda ou Azure Functions, para executar o código do aplicativo em resposta a eventos. Esses eventos podem ser acionados por uma variedade de fontes, como mensagens de fila, uploads de arquivos ou chamadas de API.

Ao usar a arquitetura serverless, os desenvolvedores podem se concentrar exclusivamente na lógica do aplicativo, em vez de lidar com a infraestrutura. Eles não precisam se preocupar em dimensionar ou gerenciar servidores, e só pagam pelos recursos que usam em vez de pagar por servidores dedicados que podem ficar ociosos quando não estão sendo usados.

Um dos principais benefícios da arquitetura serverless é a escalabilidade automática. Como os serviços gerenciados da nuvem lidam com a escalabilidade, os desenvolvedores não precisam se preocupar com a capacidade do servidor ou com a otimização de recursos. Os serviços gerenciados da nuvem são escaláveis ​​e podem se adaptar automaticamente à carga do aplicativo.

Outra vantagem da arquitetura serverless é a redução de custos. Como os desenvolvedores só pagam pelos recursos que usam, eles podem economizar dinheiro em comparação com a abordagem tradicional de provisionamento de servidores dedicados. Além disso, a arquitetura serverless permite que as empresas reduzam ou eliminem custos de infraestrutura e equipe de operações.

No entanto, a arquitetura serverless não é adequada para todos os aplicativos. Alguns aplicativos podem exigir servidores dedicados para garantir um desempenho consistente ou para atender a requisitos de segurança específicos. Além disso, a arquitetura serverless pode ser mais complicada do que a abordagem tradicional para alguns desenvolvedores.

Em resumo, a arquitetura serverless é uma abordagem de desenvolvimento de aplicativos que permite que os desenvolvedores criem aplicativos sem se preocupar com a infraestrutura subjacente. Ele usa serviços gerenciados na nuvem para executar o código do aplicativo em resposta a eventos e oferece escalabilidade automática e redução de custos. No entanto, nem todos os aplicativos são adequados para a arquitetura serverless, e pode ser mais complicado do que a abordagem tradicional para alguns desenvolvedores.
Deep Dive into JavaScript.
Tags: javascript, webdev, beginners, programming
Published: 2023-03-04 07:15:06

JavaScript is one of the most used programming languages right now. With the technologies becoming more and more superior, the need of learning this language is increasing day by day. As a Computer Science I have basic or intermediate level knowledge of C,C++,Java and Python. But last year I took an interest on JavaScript, and I started loving this language. Now I am an entry level React developer preparing for interviews. So I started relearning JavaScript as part of the process. So I want to share this journey with the likes of me who are trying to get into a development job.
{% embed https://github.com/mrakib007/vanilla-js-practice %}
This is the repository where I am keeping all my codes just to check up on it when I need them. 
Now, practicing JS from scratch making me love this language even deeper. I hope many JS enthusiasts will find this repo helpful.
This week’s newsletter is out! (04-03-2023) - Murderers
Tags: javascript, tech, webdev, discuss
Published: 2023-03-04 05:59:40

---
title: This week’s newsletter is out! (04-03-2023) - Murderers
published: true
description: Another week of great javascript, tech and web development links.
tags: javascript, tech, webdev, discuss
---

Murderers

https://markjgsmith.substack.com/p/mark-smiths-newsletter-04-03-2023

Would love to hear any comments and feedback you have.

[@markjgsmith](https://twitter.com/markjgsmith)
Updated AWS Certified Developer – Associate: Registration now open
Tags: aws, serverless, awsdeveloper, amazonwebservices
Published: 2023-03-04 05:54:25

{% embed https://aws.amazon.com/blogs/training-and-certification/updated-aws-certified-developer-associate-registration-now-open/ %}
I'm excited that the new AWS Certified Developer Associate DVA-C02 exam focuses on developing services, security, and deployment methodologies, which aligns with most business trends from 2021 till now. Mastering how to set up secure API services, serverless lambda functions, coding in various languages, and implementing CI/CD pipelines facilitate git-enabled version-control systems within AWS; this allows organizations to accelerate application development and infrastructure deployments with less risk while being more cost-effective and scalable. For more details, please read this AWS Training and Certification Blog or the AWS Certification Dev associate exam page. If you're thinking, "Where can I receive excellent training, Jason"? My telepathic answer is that for the best AWS training on the market, head to [](https://learn.cantrill.io) and check out his AWS Certified Developer Associate course and many more.
#amazonwebservices #devops  #amazon #awscloud #coding #automation #cicd #programming #javascript #tech #cloudsecurity #informationtechnology #cloudcomputing #awsome #learningbydoing
JavaScript API using Cylon.js to interact with IBM Watson cloud
Published: 2023-03-04 05:46:25

Cylon is a Javascript framework with support for over 43 platforms for robotics, physical computing and internet of things. Cylon can run directly in the browser (through browserify) or any Chrome-connected app, and support http/https, mqtt and socket.io plugins.

Here is an example of how one can write a JavaScript API using Cylon.js to interact with IBM Watson cloud services:

`// Require the cylon module and watson developer cloud module
var Cylon = require('cylon');
var watson = require('watson-developer-cloud');

// Define the Watson speech-to-text service credentials
var speechToText = watson.speech_to_text({
  username: 'your_username_here',
  password: 'your_password_here',
  version: 'v1'
});

// Define the robot
Cylon.robot({
  // Define connections to hardware devices
  connections: {
    watson: { adaptor: 'watson', speech_to_text: speechToText }
  },

  // Define API
  work: function(my) {
    // Define functions to be exposed by the API
    my.apiFunctions = {
      transcribeAudio: function(audioFile, callback) {
        // Use the Watson speech-to-text service to transcribe the audio file
        var params = {
          audio: audioFile,
          content_type: 'audio/wav',
          model: 'en-US_BroadbandModel'
        };
        my.watson.speech_to_text.recognize(params, function(err, res) {
          if (err) {
            console.log(err);
            callback(err, null);
          } else {
            console.log(JSON.stringify(res, null, 2));
            callback(null, res);
          }
        });
      }
    };
  }
}).start();

// Expose API functions
module.exports = function(callback) {
  Cylon.api({
    host: '0.0.0.0',
    port: '3000',
    ssl: false,
    auth: false,
    CORS: false,
    logger: false,
    // Expose the apiFunctions object as the API
    api: Cylon.robots[0].apiFunctions
  });

  // Call the callback function to indicate that the API is ready
  callback();
};`

In this example, we first require the watson-developer-cloud module and create a speechToText object with the credentials for the Watson speech-to-text service.

We then define a robot with a connection to the Watson service using the watson adaptor. Inside the work function, we define an object called apiFunctions that contains a single function called transcribeAudio, which takes an audio file and a callback function as parameters. This function uses the recognize method of the Watson speech-to-text service to transcribe the audio file and calls the callback function with the result or an error.

We then use the Cylon.api function to expose the apiFunctions object as an API on port 3000. Finally, we export a function that takes a callback parameter, which is called when the API is ready. This allows us to start the API server asynchronously.
Starchart: Week 7
Published: 2023-03-04 05:25:10

For week 7, I continued with my work on the [DNS Record creation page](https://github.com/DevelopingSpace/starchart/pull/243). This basically involved resolving all the review comments, and trying to get tests working. However, I ran into another sign in problem in the Playwright test environment:

![Metadata not found](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/eh12fdw0d7ywhycdbbh4.png)

I did not want to resolve this specific issue in the same PR as the one creating the page so I decided to create a [separate issue](https://github.com/DevelopingSpace/starchart/issues/278) for it.

While working on the DNS Record creation page, I rebased my branch with the main branch as it had gotten out of date. After this, I found that I could no longer run the app, and got this error:

```
'SECRETS_OVERRIDE' is not recognized as an internal or external
command, operable program or batch file.
```

I saw that the `dev` script had been modified to override an ENV variable:
```json
"dev": "SECRETS_OVERRIDE=1 run-p dev:*"
```
However, this syntax is not supported on Windows. So, I created a [PR](https://github.com/DevelopingSpace/starchart/pull/267) to use [`cross_env`](https://www.npmjs.com/package/cross-env) so it would also work on windows.

After addressing all the comments on my original PR (to create the new page UI), I helped [Genne23v](https://github.com/Genne23v) resolve CI failure on [this PR](https://github.com/DevelopingSpace/starchart/pull/274). New code had been added that would check for an ENV variable value and crash if the environment was `production` and no value was specified. However, this should not have affected the end to end tests as the environment there was set to `testing`:

```json
"start:e2e": "cross-env NODE_ENV=testing node --require
dotenv/config ./build/server.js",
```
This script starts the app when end to end tests are run. However, after some investigation and through [this discussion](https://github.com/remix-run/remix/issues/2399), I found that there were two problems with this approach:

- `testing` is not a valid value for `NODE_ENV`. Providing `testing` will result in `NODE_ENV` being set to `production`

- During the build process, all calls to `process.env.NODE_ENV` in the code are replaced with the actual value for `NODE_ENV`. Thus, something like `console.log(process.env.NODE_ENV)` would become `console.log("production")`. This was done by the following script. Here, no value for `NODE_ENV` is given, and therefore `production` is assumed by default.
```json
 "pretest:e2e:run": "cross-env SECRETS_OVERRIDE=1 run-s build"
```
Moving the override to this script and changing the value to `test` resulted in the CI passing again:
```json
"pretest:e2e:run": "cross-env NODE_ENV=test SECRETS_OVERRIDE=1
run-s build"
```
More information about this process can be found in [this discussion](https://github.com/DevelopingSpace/starchart/pull/274#discussion_r1117935006).
How To Use cy.intercept() For Handling Network Requests
Tags: testing, qa, api
Published: 2023-03-04 05:14:33

With cy.intercept(), you can intercept HTTP requests and responses in your tests, and perform actions like modifying the response, delaying the response, or returning a custom response.

When a request is intercepted by cy.intercept() the request is prevented from being sent to the server and instead, Cypress will respond with the mock data you provide.This allows you to test different scenarios and responses from a server without actually having to make requests to it.


**I have detail explained about cy.intercept()with example under the [link](https://qaautomationlabs.com/how-to-use-cy-intercept-for-handling-network-requests/) **
7 Black Box Testing Techniques That Every QA Should know ( Explained with demo)
Tags: webdev, beginners, programming, tutorial
Published: 2023-03-04 05:10:52

Become a Automation Rockstar : https://thetestingacademy.com

{% embed https://youtu.be/9sVcvyCaCU8 %}

Black-box testing is a method of software testing that examines the functionality of an application without peering into its internal structures or workings. This method of test can be applied virtually to every level of software testing: unit, integration, system.

Decision table testing.
All-pairs testing.
Equivalence partitioning.
Boundary value analysis.
Cause–effect graph.
Error guessing.
State transition testing.
Use case testing

-------------------------------------------------------

👪 Join our Community - http://bit.ly/learntesting2019


✅ Automation Community - https://thetestingacademy.com


🐦Follow us on Twitter  - https://twitter.com/itstechmode


📖 Like us on Facebook - https://www.facebook.com/scrolltest


🎤  Listen to our Podcast - https://anchor.fm/thetestingacademy


-------------------------------------------------------

#automationtesting #manualtesting #testautomation #thetestingacademy #scrolltest
🚀 Tools and services I recommend:
Some of the courses that I recommend to become better Automation Tester 🙌🙌

✅Selenium Training and Certification -
https://scrolltest.com/go/edureka


✅Learn Jenkins for QA -
https://bit.ly/learnjenkins-p1


✅Programming Java -
https://bit.ly/learnjava2020-p1


✅Test Automation - 
https://bit.ly/learnautomation2020


✅API Testing - 
https://www.learnapitesting.com


✅Cypress Tutorial with LIVE Projects -
http://cypresstutorial.com
As a newbie in the field...
Published: 2023-03-04 04:36:39

**What is confusing about platforms?**
- Platforms can be very difficult to learn at first because as somebody with no experience in web development, I not only had to learn the programming languages themselves such as HTML/JS but also try and wrap my head around the idea of how open-wc works and/or how modular web components work. 

**How could web components and VanillaJS standards be taught in a way that is more approachable?**
- I wish Web components and VanillaJS standards were taught with more real world examples for us to refer to when we get stuck or do not understand something specific. This way it is a lot more approachable to new beginner level developers. 

**What did you find easiest to work with on 1st stab? (You don't have to say web components, this is an honest take, if it was Vue cool, but justify it)**
- If I am being honest, I only found coding on codepen to be very enjoyable but as soon as we began learning frameworks such as React, Vue, etc, I was very lost. I had an extremely difficult time understanding what they even are. I did not really find any of them easier than the other to work with on the 1st tab. However, I really enjoy working with web components now that we have learned a little about them.

**Think back on the tooling. What parts were confusing? What clicked with you immediately?**
- "What is a framework? Is it an application I can download and interact with on a GUI level? Is it code that I cannot see? Is it a code library?" these were questions I asked a million times in the first 2-3 weeks of learning about frameworks and web components. The concept itself is the most confusing in my open. I understood the technical parts pretty well and did not really have much trouble with the coding part.
Converter texto (string) para número em JavaScript e suas diferenças
Tags: javascript, beginners, programming, webdev
Published: 2023-03-04 03:47:38

Pode parecer até trivial esse tipo de procedimento, mas para quem estar iniciando é bom saber as formas e suas particularidades de realizar uma conversão, evitando assim problemas futuros nos resultados esperados.

## Number()
Essa é uma função global de conversão para números. 

```javascript
// Using the Number() function to convert a string to a number
var str1 = "42";
var num1 = Number(str1);  // num1 será 42
```

Importante ressaltar que ela converte apenas strings que contenham valores numéricos, caso a string contenha valores não numéricos, a função retornará **NaN** (not a number).

Por exemplo:
```javascript
var str2 = "hello";
var num2 = Number(str2);  // num2 será NaN
```

Outro detalhe importante é que valores booleanos e vazios serão convertidos também.
```javascript
var str3 = "";
var num3 = Number(str3);
// Valor retornado: 0
```

## Operador unário de adição (+)
A forma mais simples, que conheço, para converter uma string em um inteiro é adicionando o operador unário de adição (+) antes da string (ou variável contendo a string).

```javascript
console.log(+'2');
// Valor retornado: 2

const myNumber = '2';
console.log(+myNumber);
// Valor retornado: 2
```
O operador de subtração também consegue realizar casting
Mas atenção!
O operador unário 

## parseInt() e parseFloat()
O `parserInt()` é a forma mais comumente usada, recebendo uma string e retornando um inteiro, e o `parserFloat()` recendo uma string e retornando um número de ponto flutuante.

```javascript
// Usando parseInt(string, base) para converter uma string para um integer
var str5 = "42";
var num5 = parseInt(str5, 10);  // num5 será 42

// Usando parseFloat(string) para converter uma string para um número de ponto flutuante
var str6 = "3.14159";
var num6 = parseFloat(str6);  // num6 será 3.14159
```
Como viram, no `parseInt(string, base)` pode ser fornecido a base de conversão, um inteiro entre 2 e 36. Passei 10, pois queria a base decimal, o que não é obrigatório uma vez que a base 10 é assumida quando não se especifica, mas é sempre recomendado passar a base para ser o mais explícito possível sobre o que está ocorrendo.
 
Dependendo da sua necessidade, essa forma de conversão tem uma certa diferença: ao passar uma string vazia e valores booleanos o retorno será NaN. Se tiver dúvidas em qual usar, essa é a melhor escolha para você.

Também é possível converter strings que comecem com números e tenham caracteres na sequência, por exemplo:

```javascript
parseInt('1984book');  // o retorno será 1984
```
2444. Leetcode Solution in cpp
Published: 2023-03-04 03:30:07

=================================================================
#Description:
You are given an integer array nums and two integers minK and maxK.

A fixed-bound subarray of nums is a subarray that satisfies the following conditions:

The minimum value in the subarray is equal to minK.
The maximum value in the subarray is equal to maxK.
Return the number of fixed-bound subarrays.

A subarray is a contiguous part of an array.

 

Example 1:

Input: nums = [1,3,5,2,7,5], minK = 1, maxK = 5
Output: 2
Explanation: The fixed-bound subarrays are [1,3,5] and [1,3,5,2].
Example 2:

Input: nums = [1,1,1,1], minK = 1, maxK = 1
Output: 10
Explanation: Every subarray of nums is a fixed-bound subarray. There are 10 possible subarrays.
 

Constraints:

2 <= nums.length <= 105
1 <= nums[i], minK, maxK <= 106

=================================================================
#solution:
```cpp
class Solution {
public:
    long long countSubarrays(vector<int>& nums, int minK, int maxK) {
        long res = 0;
        bool minFound = false, maxFound = false;
        int start = 0, minStart = 0, maxStart = 0;
        for (int i = 0; i < nums.size(); i++) {
            int num = nums[i];
            if (num < minK || num > maxK) {
                minFound = false;
                maxFound = false;
                start = i+1;
            }
            if (num == minK) {
                minFound = true;
                minStart = i;
            }
            if (num == maxK) {
                maxFound = true;
                maxStart = i;
            }
            if (minFound && maxFound) {
                res += (min(minStart, maxStart) - start + 1);
            }
        }
        return res;
    }
};
```
#leetcode
#challenge
Here is the link for the problem:
https://leetcode.com/problems/count-subarrays-with-fixed-bounds/
How to use On Clicked to Add Active Class to Mapped Item
Published: 2023-03-04 01:57:13

On this basis all you have to do is edit your code  based on the snapshot I have provided below .Do bare in mind that I am using tailwind css for the styling  and do not forget to include 
const [active, setActive] = useState(null);
which is very important for it to function 
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7kba0uy7nx5ndu20zq93.png)