teleren/devto huggingface dataset:
Advent.js🎅🏼| #6: Rematando los examenes finales
Tags: javascript, spanish, webdev, adventjs
Published: 2021-12-06 15:26:31

## [Rematando los examenes finales](https://adventjs.dev/challenges/06)

Antes de poder disfrutar de la navidad... nos toca terminar de rematar los exámenes finales. ¡Y toca un poco de matemáticas! 😱

A una función se le pasan dos parámetros: un Array con números y el resultado que se espera.

La función debe devolver los dos valores del Array que sumen el resultado esperado. Como a veces **pueden haber más de dos valores** que sumen, se devolverá el primero empezando por la izquierda que encuentre otro par, **sin importar lo lejos que esté a la derecha.**

Si no se encuentra, se devuelve null.

Veamos unos ejemplos:

```js
sumPairs([3, 5, 7, 2], 10) // [3, 7]
sumPairs([-3, -2, 7, -5], 10) // null
sumPairs([2, 2, 3, 1], 4) // [2, 2]
sumPairs([6, 7, 1, 2], 8) // [6, 2]
sumPairs([0, 2, 2, 3, -1, 1, 5], 6) // [1, 5]
```

El resultado tiene que ser un **array con dos números.**

Una vez que tengas el resultado... ¿cómo podrías hacer que fuese lo más óptimo posible para **no tener que recorrer las mismas situaciones dos veces 🤔?**

Completa el reto!

--- 

Mi solución:

{% jsitor https://jsitor.com/embed/wcP8zgTzx %}

---
Puedes seguir a @midudev y estar pendiente de los retos de Advent.js 

{% twitter 1466086678507008003 %}
"Sometimes you gotta work a little, so you can ball a lot."
Tags: actionshackathon21, mongodb, ios, devops
Published: 2021-12-06 15:26:10

Tom Haverford once said, "Sometimes you gotta work a little, so you can ball a lot." 
![Tom Haverford says, "Sometimes you gotta work a little, so you can ball a lot"](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/v00svs4zj8q75q95zoqr.gif)

That's just what Diego and I did.  We worked a little (created a CI/CD pipeline using GitHub Actions for a MongoDB Realm mobile app), so that we can ball a lot (our app development can really fly now that we have an automated pipeline).

### My Workflows

We created two workflows for our CI/CD pipeline:
- The [build](https://github.com/mongodb-developer/realm-demos/blob/main/.github/workflows/build.yml) workflow contains all of the automation for building and deploying the mobile app
- The [delete feature branch artifacts upon branch deletion](https://github.com/mongodb-developer/realm-demos/blob/main/.github/workflows/delete-feature-branch-artifacts.yml) workflow contains cleanup automation that deletes the artifacts that were associated with a given branch

For more details on what is happening in each of these workflows, check out [How to Build CI/CD Pipelines for MongoDB Realm Apps Using GitHub Actions](https://www.mongodb.com/developer/how-to/build-ci-cd-pipelines-realm-apps-github-actions).

{% github https://github.com/mongodb-developer/realm-demos no-readme %}

### Submission Category: 

Phone Friendly

### Yaml File or Link to Code

- [build.yml](https://github.com/mongodb-developer/realm-demos/blob/main/.github/workflows/build.yml)
- [delete-feature-branch-artifacts.yml](https://github.com/mongodb-developer/realm-demos/blob/main/.github/workflows/delete-feature-branch-artifacts.yml) 

### Additional Resources / Info

Collaborator: [Diego Freniche](https://dev.to/dfreniche)
[Note]: # (Be sure to include the DEV usernames of your collaborators, if any. )

#### Article About the Workflows

[How to Build CI/CD Pipelines for MongoDB Realm Apps Using GitHub Actions](https://www.mongodb.com/developer/how-to/build-ci-cd-pipelines-realm-apps-github-actions)

#### Video About the Workflows
{% youtube -JcEa1snwVQ %}

#### Slides About the Workflows
{% slideshare B8Qq1Cp9tbLm8k %}
Using "netlify open" to jump directly to your project's admin page
Tags: netlify, cli, tips
Published: 2021-12-06 14:49:48

---
title: Using "netlify open" to jump directly to your project's admin page
published: true
description: How to quickly access the Netlify Admin application for the project you are working on, by using the Netlify CLI.
tags: Netlify, CLI, Tips
cover_image: https://www.netlify.com/img/blog/og-cli-open.png
canonical_url: https://www.netlify.com/blog/2021/12/06/using-netlify-open-to-jump-directly-to-your-projects-admin-page/
series: Netlify - a feature a day 2021
---

> Throughout December we'll be [highlighting a different Netlify feature each day](https://www.netlify.com/blog/2021/12/01/highlighting-a-different-netlify-feature-each-day-in-december/?utm_campaign=featdaily21&utm_source=devto&utm_medium=blog&utm_content=cli-open). It might just be the thing you need to unlock those creative juices, and [dust off that domain](https://www.netlify.com/blog/2021/12/01/dusty-domains-your-forgotten-domains-raise-money-for-charity/?utm_campaign=featdaily21&utm_source=devto&utm_medium=blog&utm_content=cli-open) you registered but never deployed! Keep an eye [on the blog](https://www.netlify.com/blog/2021/12/01/highlighting-a-different-netlify-feature-each-day-in-december/?utm_campaign=featdaily21&utm_source=devto&utm_medium=blog&utm_content=cli-open) and on [Twitter](https://twitter.com/netlify) for each feature!


This one is quick, but is also very handy!

Even though the [Netlify CLI](https://docs.netlify.com/cli/get-started/?utm_campaign=featdaily21&utm_source=devto&utm_medium=blog&utm_content=cli-open) gives you control over so many aspects of your projects, sometimes the most convenient place to dig deeper into configuration, management, logging, and reviewing deploys, is directly in the [Netlify admin application](https://app.netlify.com/?utm_campaign=featdaily21&utm_source=devto&utm_medium=blog&utm_content=cli-open) in your web browser.

But what if you have lots and lots of projects?

Would it be useful to be able to jump directly into the right one? To access the one linked to the local development folder that you are currently working in?

We have good news. There is a command for that!

```shell
netlify open
```

To make the most of this command (and so many others, you'll need first to have installed the Netlify CLI by using the command `npm install -g netlify-cli`, and to have linked your local project to a Netlify site with `netlify link`)

Now all of the detailed admin views and controls for your project are just a few keystrokes away!

{% youtube -Kt0FKTVZVY %}

## More information

- [Docs: Get started with the Netlify CLI](https://docs.netlify.com/cli/get-started/?utm_campaign=featdaily21&utm_source=devto&utm_medium=blog&utm_content=cli-open)
- [Full Netlify CLI command reference](https://cli.netlify.com/?utm_campaign=featdaily21&utm_source=devto&utm_medium=blog&utm_content=cli-open)
Wiki Proficiency | WikiProficiency
Published: 2021-12-06 14:43:02

**Wiki Proficiency-A Ultimate Solution To Strengthen Your Business**
Are you waiting for the remarkable platform that aids you to boost your online existence? Then your wait is over. You can effortlessly create your content in a cost-effective manner. Most businessman thinks page creation and content creation service is an expensive way to advertise their brand services. But Wiki proficiency offers their premium services at an effective and reasonable rate.
For us, our customer matters that’s the reason we have a team of professionals who create trustworthy, reliable, and authentic content to get a high customer retention rate and build brand value. We create innovative and illustrative content to attract readers. We know how captivating content helps to change the readers into regular customers.
We concentrate on our clients’ requirements. That is why our experts arrange a session to determine the needs and wants of our customers. We, at [wiki proficiency](https://www.wikiproficiency.com/) , offer a number of services such as Wikipedia page creation, Wikipedia articles, Wikipedia management, monitoring, and many more.
Here you will read how our platform helps to build your brand image and attract more customers.

**Article Writing Services**
Want to enhance your business credibility and visibility, our experts are ready to give the perfect picture of your idea through the content. We ensure that our services help your clients. Once they understand what services you are offering, it eventually increases the retention rate. We create such content that not only boosts your brand identity but also improves SEO ranking.

**Content Translation**
Do you want to increase your customer base? Then, you just need to create outstanding brand awareness. It is the only reason we help the brand owner by creating unique and translating them into multiple languages. We know brand owners want to attain a high customer retention rate and build a good image in the customer's mind. We, at wiki proficiency, aids brand to create engaging articles and also explaining the services your business offers. Even our content helps to get a higher position on the different search engines.

**Free Consultant** 
We care about our clients so we arrange a session where our customers discuss what they actually want from us. We even communicate important points that boost their brand awareness. This consulting and interactive session gives a proper understanding of the work and also helps to build a good relationship between our impeccable writers and clients
Unit Testing Best Practices: Organization & Test Data
Tags: csharp, beginners, testing, tutorial
Published: 2021-12-06 14:25:50

_I originally posted an extended version of this post [on my blog](https://canro91.github.io/2021/07/05/UnitTestingBestPractices/) a couple of weeks ago. It's part of a series I've been publishing, called [Unit Testing 101](https://canro91.github.io/UnitTesting)_

Do you want to write better unit tests? Do you keep your unit tests organized? And, do you write your tests at the right level of abstraction? These are some best practices on Test Organization and Test Data.

## On Organization

### Make your tests easy to find.

**Put your unit tests in a test project named after the project they test.** Use the suffix "Tests" or "UnitTests". For example, if you have a library called `MyLibrary`, name your test project: `MyLibrary.UnitTests`.

**Put your unit tests separated in files named after the unit of work or entry point of the code you're testing.** Use the suffix "Tests". For a class `MyClass`, name your test file: `MyClassTests`.

## On Test Data

### Keep the amount of details at the right level

**Give enough details to your readers**, but not too many to make your tests noisy.

**Use factory methods** to reduce complex Arrange scenarios.

**Make your scenario under test and test values extremely obvious.** Don't make developers to decode your tests. Create constants for common test data and expected values.

**Use object mothers to create input test values.** Have a factory method or property holding a ready-to-use input object. Then, change what you need to match the scenario under test.

**Prefer Builders to create complex object graphs.** Object mothers are fine if you don't have lots of variations of the object being constructed. If that's the case, use the Builder pattern. Compose builders to create complex objects in your tests.

Voilà! Those are some tips to get our tests organized and without clutter.

Remember, keep your unit tests separated into projects and classes and write your tests at the right level of abstraction using builders and factory methods.

***

_Upgrade your unit testing skills with my course: [Mastering C# Unit Testing with Real-world Examples](https://www.udemy.com/course/mastering-csharp-unit-testing-with-real-world-examples/?referralCode=8456B1B78E2EDE923174) on Udemy. Practice with hands-on exercises and learn best practices by refactoring real-world unit tests._

_Happy testing!_
Crack Infosys Interview Questions
Tags: career, beginners, guide
Published: 2021-12-06 14:24:40

Infosys is an Indian MNC that is among the most prominent IT players in the world. It could be a dream company for many Indian developers and an excellent platform to start your career in IT.

![Infosys Interview Questions](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/e42jihqkbt975o6oc93g.png) 

## List of Infosys Interview Questions

Here I've compiled with top question asked in infosys interview for developers. Know the answers from this blog on [Infosys Interview Questions](https://www.techgeekbuzz.com/infosys-technical-interview-questions/).

1. Name some high-level programming languages.
2. C is sometimes considered a low-level programming language. Why so?
3. What is a preprocessor in C?
4. Name basic OOPs concepts.
5. What is inheritance? Name its types.
6. Please enumerate the various types of inheritance.
7. What are tokens in C++?
8. What is the difference between multi-level and multiple inheritances?
9. Give some differences between C++ and Java.
10. How encapsulation and abstraction are complementary?
11. What are arrays?
12. What is a pointer in C?
13. Give some differences between C and C++.
14. What is a NULL pointer?
15. Give logic to swap two numbers without using a temporary variable.

## Conclusion

In this article, we have provided the top Infosys technical interview questions. After reading all the Infosys technical interview questions, you will notice that most of the questions are from C and C++, which also includes OOPs concept with data structure because these are the basis of programming languages, and a developer should have knowledge of basic technical stuff.
How To Make A Simple Number Comparer In Python
Tags: programming, python, beginners, tutorial
Published: 2021-12-06 14:10:26

In this article I will show you how to make a extremely simple number comparer!

This program will compare two numbers and tell which one is greater.

This is a great project to improve your skills! As they say, practice makes perfect.

### Making Inputs
First, we need to make the inputs so that the user can input their desired values.
#### First Number
```Python
num1 = int(input("❯ Enter A Number: "))
```
#### Second Number
```Python 
num2 = int(input("❯ Enter Another Number: "))
```
### Writing Logic
Lastly, we need to write `if` and `else` statement to and use the comparing operators `<, >, =` to check which number is greater.
```Python 
if num1 > num2:
    print("❯ " + str(num1) + " is greater than " + str(num2))
    
else:
    print("❯ " + str(num2) + " is greater than " + str(num1))
```
---
That's it, congratulations! You have made a number comparer!
Here is a picture of the finished product:
![Final Product](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/rdkvbwbye9s0xi4pgy5u.png)
How to make your first open source contribution
Tags: git, beginners, programming, opensource
Published: 2021-12-06 14:04:38

You've probably heard of what [open source software](https://opensource.org/osd) is and how it works. But do you want know how it's **_REALLY_** made?

## Open source software is not free software

First, you need to differentiate what open source software is. It's not software available for free. It's not software whose code is available. No.

Aseprite, Epic Games and Wexond would fit this definition of "source code available" but not open source.

These are the characteristics of open source software:

- **Open source software is available for everyone**
- **Open source software always have a LICENSE file in their root**
- **Open source software can be freely forked without _ANY_ restrictions**
- **You must keep the same LICENSE if you fork a project**

See [what's the definition of open source software here](https://opensource.org/osd)

OK, now we know what OSS is, but how is it made?

## Ways to contribute to oss software

Even though I'm covering **code contributions**, there are other ways to contribute to OSS software:

- Financiation $$
- Translation and localization
- Community support

## You'll need git, learn it.

Most OSS use [Git](https://git-scm.com/), which is a versioning system. It lets you handle code changes. I'm not covering how to use Git here, if you need to learn it you can visit any tutorial you want.

## Your first contribution and the github flow

You want to contribute to that project you've used for your project. But don't know what do. Here's when tags come in handy. Specially `good-first-issue`. Issues with this tag are easy to do for newcomers to the project.
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8lt32ho0s6xp447kf74q.png)
There's also `Assignee: assigned to nobody` which makes sure that one has already taken the issue.

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

### Take an easy one

You don't want to be writing this contribution for 8 hours. You have a life and maybe a job. So take **easy and feasable issues** when you're a beginner.

### Now what?

OK, I have chosen an issue or maybe I've created one. Now what?

1. **Fork the repository.**
2. **Clone the fork to your PC.**

   `git clone https://github.com/<USERNAME>/<REPO NAME>`
3. **Create a branch and switch to it.**

   `git switch -c my-branch-name`
4. **Make the changes you want in your IDE of preference.** I suggest [VS Code](https://code.visualstudio.com/). Create little commits, and little PRs.
5. Push the branch.

`git push`
6. **Create the PR**

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

7. **OK, what do I do now?** You will get reviews from maintainers that ask you to improve X and Y. Make the changes, ask another review and wait for a merge
8. **Wait,** they have closed my PR ;-;

    Don't worry, it happens. For many reasons. Accept it.
1 line of code: How to count the words in a string
Tags: javascript, webdev, productivity, codequality
Published: 2021-12-06 13:41:44



```javascript
const countWords = str => str.trim().split(/\s+/g).length;
```

## Optimised code
```javascript
const countWords = str => str.trim().split(/\s+/g).map(i => i.replace(/[\[\]?.,\/#!$%\^&\*;:{}=\"\-_~()…–—·'’]/g,"")).filter(i=>i).length;
```

Returns the number of words in a given string.

---

## The repository & npm package

You can find the all the utility functions from this series at [github.com/martinkr/onelinecode](https://github.com/martinkr/onelinecode)
The library is also published to [npm as @onelinecode](https://www.npmjs.com/package/@onelinecode/onelinecode) for your convenience.

The code and the npm package will be updated every time I publish a new article.

---

Follow me on [Twitter: @martinkr](http://twitter.com/_martinkr) and consider to [buy me a coffee](https://www.buymeacoffee.com/martinkr)

Photo by [zoo_monkey](https://unsplash.com/@zoo_monkey) on [Unsplash](https://unsplash.com/s/photos/fuji)

---

[![Subscribe to the weekly modern frontend development newsletter](https://modernfrontend.dev/banner/banner_583-111.png)](https://modernfrontend.dev/)

---
forEach() vs map 
Published: 2021-12-06 13:23:55

**forEach()**

```
  props.comments.forEach(function (cancom, i) {
        commentBlock.push(
          <div key={i}>
            <ul>
              <li style={{ fontSize: "14px" }}>Status: {cancom.status}&nbsp;&nbsp;<u>Comment:</u>&nbsp;&nbsp; {cancom.com}  - by <b>{cancom.by}</b> <span style={{ fontSize: "10px" }}> {new Date(cancom.on).toLocaleDateString()}</span></li>
            </ul>
          </div>
        );
    });
```
We want to reduce the complexity of data analytics.
Tags: analytics, startup, saas
Published: 2021-12-06 13:18:59

I manage several different online projects. And I find myself jumping between multiple analytics dashboards, comparing metrics like SEO clicks, ads CPC, revenue and pageviews to name a few. Then exporting data (especially revenue) to Excel to sum it up and get some insights. All that so my projects can grow in the most efficient way.

The problem is that growth, even when defined as increase in a single metric, requires improvement in lots of secondary ones. These secondary metrics are scattered across multiple dashboards and apps. And I face the same problem regardless of the type of online project I'm working on.

To give you an example.

I go to Google AdSense to see my revenue. It turns out that it's lower than the week before, so I start searching for the cause. The most possible reason is less visits, but I need to make sure. That's why I open Google Analytics. Yes, number of visits has decreased week to week. But visits to my website come from different channels: ads, organic, social media. So, I need to look over each of them. I open Google Ads, Facebook Business and Google Search Console dashboards. It takes about 20 minutes, but I finally know what happened. The average SEO position is lower, and I got less organic traffic than last week. Next, I need to go through all the dimensions. I'm searching for drops in specific pages, countries, and keywords. Now, I know for sure. The page that usually generates most traffic ranks lower for my target keywords. I can begin resolving the issue.

I can name dozens of similar examples from my daily practice. I spent way too much time analyzing data this way over the years. Maybe it's similar in your case?

So, over the last couple of months me and my co-founder have built an MVP of our all-in-one analytics app — [Raport](https://raport.pro). Currently the app allows integrating 5 data sources in one dashboard and delivers email reports containing your most important metrics.

If this message resonates with you, [try our beta for free](https://raport.pro), and let us know what you think. You'll have more time, and fewer spreadsheets. And isn't that what everyone wants?
How to use Class-based Components in React
Tags: react, javascript, webdev, beginners
Published: 2021-12-06 12:50:04

{% youtube HI56D6orlJ0 %}

In this article, I am going to show you how you can use **class-based components** in React JS

 Let's get started 🎉

### What is Class-based components
Class-based components are simple classes which tends as a React components which can be easily used anywhere in your React Project

### How to use them?
```js
class Snowbit extends Component {
  render() {
    return (
      <div className="container">
        <h1>I am SnowBit - Shown using class based Component</h1>
      </div>
    );
  }
}
```
Career change to IT - things you wish you knew
Tags: codenewbie, beginners, discuss, career
Published: 2021-12-06 12:48:53

Hi!

I'm Michał and I'm a self-taught web developer, who started working in IT as a manual QA in December 2019. Before that I worked in biotech industry, including a pharmaceutical company in Poland.

I remember the very beginning of my career change and how much work it required (including some proper motivation). All of the doubt, roadblocks but also the excitement of learning stuff in a completely new (to me) field.

If there are people here switching to IT, or who successfully did that - **what is your experience? What questions did you have at the beggining of the road that you wish were answered back then?**

I want to create an episode of a podcast on the above topic (a live Q&A) where me and a bunch of other people with a similiar experience answer the questions that you would like answered. Is there something you think should be covered in that kind of content? **What confused you the most when switching to IT?**

Thanks in advance and (hopefully) see you soon!