teleren/devto huggingface dataset:
What’s your alternative solution? Challenge #42
Tags: challenge, javascript, codenewbie, learntocode
Published: 2020-05-12 21:19:35

# About this series

This is series of daily JavaScript coding challenges... for both beginners and advanced users.

Each day I’m gone present you a very simple coding challenge, together with the solution. The solution is intentionally written in a didactic way using classic JavaScript syntax in order to be accessible to coders of all levels.

Solutions are designed with increase level of complexity.

## Today’s coding challenge

```
Create a function that will convert a string in an array containing the ASCII codes of each character

```

(scroll down for solution)

## Code newbies

If you are a code newbie, try to work on the solution on your own. After you finish it, or if you need help, please consult the provided solution.

## Advanced developers

Please provide alternative solutions in the comments below. 

You can solve it using functional concepts or solve it using a different algorithm... or just solve it using the latest ES innovations.

By providing a new solution you can show code newbies different ways to solve the same problem.

## Solution

```javascript
// Solution for challenge37

println(getCharCodes("I like JavaScript"));

function getCharCodes(s)
{
    var ar = [];
    
    for(var i = 0; i < s.length; i++)
    {
        var code = s.charCodeAt(i);
        ar.push(code);
    }
    
    return ar;
}

```


To quickly verify this solution, copy the code above in this coding [editor](https://codeguppy.com/code.html) and press "Run".

> Note: The solution was originally designed for [codeguppy.com](https://codeguppy.com) environment, and therefore is making use of `println`. This is the almost equivalent of `console.log` in other environments. Please feel free to use your preferred coding playground / environment when implementing your solution.
What is a Python Virtual Environment?
Tags: python, beginners
Published: 2020-05-12 21:15:26

Many programming languages have a rich set of libraries and frameworks. Python is no exception. To speed up the development process and effective reuse, projects typically make use of a handful of libraries. 

Python libraries are stored in a public repository called PyPI (stands for Python Package Index). A Utility called **pip** is used to install new libraries and  frameworks into the target machine. Packages can be installed using below command:
```python 
$ pip install <package_name>
```
With the above command, a newly requested library is downloaded from the public repository and globally installed in the system directory of the Python installation directory. This means a newly installed library will be available to all of the Python applications of the installed machine.

Imagine this scenario - If I have three Python projects that require three different versions of a Python framework called Flask and if I install a newer version of Flask on top of the older version globally using the pip command, I might accidentally overwrite the older version of the Flask framework. My application that requires the older version of the library might not function properly.

Here is an illustration of 3 Python applications within the developer’s machine with the requirement of different versions of same framework:

![Apps with different library versions](https://dev-to-uploads.s3.amazonaws.com/i/pyxasslkg3ev1a8a91ql.png)

Python’s **virtual environment** addresses this issue. With the Python virtual environment, specific versions of libraries are installed and maintained within the project. This helps in effective version conflict management among applications. Now same machine could successfully run applications with different versions of libraries. 

<h4>How to set up virtual environment?</h4>

Run below command in the project folder to create a virtual environment in Python 3:
```python
$ python3 -m venv venv
```
The above command invokes Python 3's venv command to create a virtual environment in a folder called venv. After successful execution above command project folder would a new subfolder called venv. 

Virtual environment could be activated in the project by running below command in the terminal window:
`$ source venv/bin/activate`

Run below command to activate virtual environment in Windows:
`$ venv\Scripts\activate` 

With the activation of virtual environment, **pip** install command installs different versions of libraries within the newly created `venv` folder within the project resulting in effective conflict management of different versions of library among projects.
Tips for learning SCSS/ sass (as a beginner)
Tags: sass, beginners, codenewbie, tutorial
Published: 2020-05-12 21:13:35

![Sass Logo](https://images.iambacon.co.uk/blog/sass.png)

I've been learning and working with SCSS/ sass for about 3 months in personal and professional projects. If you're not familiar, SCSS and sass are CSS pre-processors; at a basic level these are languages that get compiled and formatted into regular CSS that can be read by a web browser. 

The advent of this technology took the very tedious task of writing CSS and made it a more modern and far more efficient process. Pre-processors allow things like variables, partials, nesting and mixins to be used in writing CSS styles. Not only does this cut down on code, it also enhances the developer experience a great deal (IMHO).

As someone who is relatively new to this technology, I thought I'd share some things that I wish I would have known before I started. If you'd like a run down on all of the features of sass, look [here](https://sass-lang.com/guide). 

##Learn how to stay organized
Before you even begin learning any CSS pre-processor, I recommend learning how to best structure and organize your CSS. With the module system that's built into sass, you're eventually going to be splitting your styles into different files all together. If you don't have organization conventions, I find it very easy to get lost in your file system. 

##Remember how the compiler works & break it down
If I had to give you one piece of advice to help you learn sass, it would be this: remember that the sass compiler will not only compile sass; it also compiles regular css. When I was first looking through the documentation for sass, I was overwhelmed to say the least. The thing I found most helpful was to try and gain a good understand of one sass feature and then move onto the next one. I started with variables (IMHO the best place to start for beginners); then I wanted a way to store all of my variables in a separate file so I dove into partials, and so on...

##Practice IRL
As with anything code related, the best way to learn is to practice (duh); however I hate coding exercises. This is why I've found it far more helpful to throw sass into my projects. If you use the above approach, implementing sass into any of your current projects should be a breeze. Some other things I did to start off my initial learning was finding code pens I liked and attempting to convert parts of it to use sass. Most importantly, remember to practice on actual projects in the context you would normally be working in.
[AWS EKS] Setup Worker Nodes with EC2
Tags: aws, ec2, eks
Published: 2020-05-12 21:10:35

### install eksctl

https://docs.aws.amazon.com/eks/latest/userguide/getting-started-eksctl.html

### install kubectl

https://kubernetes.io/docs/tasks/tools/install-kubectl/

eksctl-cluster-ec2.yaml

{% gist https://gist.github.com/PanupongDeve/1d2d3bf473ecea9ce6c193eee8a0dd1c file=eksctl-cluster-ec2.yaml %}

<code>time eksctl create cluster -f eksctl-cluster-ec2.yaml</code>

### basic eksctl

<code> eksctl get cluster </code>

<code> eksctl get nodegroup --cluster my-cluster-ec2 </code>

<code> eksctl scale nodegroup --cluster=my-cluster-ec2 --nodes=5 --name=ng-1 </code>

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/1fvysalvkjbf7867jlb7.png)

### update nodegroups


{% gist https://gist.github.com/PanupongDeve/1d2d3bf473ecea9ce6c193eee8a0dd1c file=eksctl-cluster-ec2-add-nodegroup.yaml %}

<code> eksctl create nodegroup --config-file=cluster-ec2.yaml --include='ng-mixed' </code>

### delete nodegroups

<code> eksctl delete nodegroup --config-file=cluster-ec2.yaml --include='ng-mixed' --approve </code>
The power of containers
Tags: docker, node, traefik
Published: 2020-05-12 20:56:50

---
title: The power of containers
published: true
description: Notes for my future me - Look how exited you are to learn new technologies please don't forget that this is what you love about this field.
tags: docker,node,traefik
cover_image: https://dev-to-uploads.s3.amazonaws.com/i/qc2tetmtaht3lwraz8kf.png
---
 > Note to the future Me: Look how exited you are to learn new technologies please don't forget that this is what you love about this field.

#### When I discover the power of containers it was a game changer.

No need to install XAMPP or node or Python in  my machine 
To get something up and ready for development.

 

If you work whit microservices for the backend or front end  in your projects or need to manage  your clusters k9s  is a really nice and easy to use, terminal UI  to interact whit your clusters 

I have small WordPress site in google cloud ,Whit the free  micro-vm running in a docker container,i have Traefik  as my reverse proxy and load balancer.

The most awesome part is that is really easy to configure to add as many containers that I need or want.
* Free ssl certificated from Let's Encrypt auto renewable  
* For each service that I spin up.


I was thinking  about making a couple video tutorial and teach anyone that wants to get a small blog or small WordPress, Django or node site up.
For free and is really easy.

***IF YOU ARE INTERESTED IN IT***
====
 let me know and I will teach you how.

Here is my small WordPress site 
https://daytonadevsolutions.leamsigc.com/
and here is the documentation from traefik.
https://docs.traefik.io/

K9s - Kubernetes CLI To Manage Your Clusters In Style!
https://github.com/derailed/k9s

Please if you have any question or want to say hi! 
Leave a comment or just say hi.

Thank you for reading.
=====


> Note for the future me: I hope that you are smiling and proud of me.
Versioning with Bump
Published: 2020-05-12 20:49:15

Hello everyone!

Just wanted to tell about Bump - a CLI tool written in Ruby that I am using to control the versioning of the project via simple commands and single json file.

Bump is lightweight and easy to use. It provides an ability to control major, minor, patch and build numbers.

Check it out - https://github.com/ljonesfl/bump

Thanks!
How to save data's in react native
Tags: reactnative, database, schema, pleex
Published: 2020-05-12 20:46:10

### Hi
I want to introduce you the simplest and schematic storage for react native with cool documentation

### Pleex
- Whats pleex?
Schematic Storage for React native

yes. Pleex

### How to use?
just see pleex documents here [Docs](https://pleex.gitbook.io/docs)
Olá Coleguinha! Vamos começar contando quem sou eu... 
Tags: pessoal, programacao
Published: 2020-05-12 20:32:56

Me Chamo Matheus e sou do interior de Santa Catarina para ser mais exato de Chapecó.

Terminei minha graduação em 2016 onde me graduei em **Tecnologia em Análise e Desenvolvimento de Sistemas** pela UNOESC e acabei de terminar uma pós-graduação em **Desenvolvimento Web, Cloud e Dispositivos Móveis** também pela UNOESC.

Trabalho como **Programador** na Vision System a 3 anos e 6 meses, onde contribuo auxiliando no desenvolvimento de softwares desktop, mobile ou Web. 

Sou entusiasta em participar de eventos de inovação seja eles SW, Workshops, Maratonas da Inovação ou qualquer coisa que seja meio fora da casinha. Também contribuo com comunidades e projetos para que de alguma forma eu consiga mudar a vida de alguma pessoa. 

Vou ser sincero e creio que **estou longe de saber tudo ou saber muita coisa, porém eu sei que todo mundo tem algo para ensinar ou algo para a aprender** e por isso vou começar a escrever no dev.to, se de alguma forma algum post meu conseguir ajudar uma pessoa que seja já vai valido apena. 

Segue alguns links caso queiram conhecer um pouco mais sobre mim/meus projetos: 
[LinkedIn](https://www.linkedin.com/in/matheusribak)
[GitHub](https://github.com/MatheusRibak)

Creio que por enquanto seja isto, até a próxima coleguinha :P
About Ruby Hash#filter and Hash#filter!
Tags: ruby, hash, documentation
Published: 2020-05-12 20:31:05

---
title: About Ruby Hash#filter and Hash#filter!
published: true
description: 
tags: ruby, hash, documentation
---

Get more information and more examples at my AboutRuby project:
* [AboutRuby project](https://github.com/BurdetteLamar/AboutRuby/blob/master/core/Hash/api/markdown.md#filter)

Here's the write-up over at the Ruby project:
* [Ruby project](https://ruby-doc.org/core-2.7.0/Hash.html#method-i-filter)
The Testing Pyramid
Tags: testing
Published: 2020-05-12 20:26:26

---
title: The Testing Pyramid
published: true
description: The Testing Pyramid is a guide to help you cover your software with automated tests.
tags: testing
---
*This post was published in my personal [blog](www.ramonlence.com)*

The first time I heard about the Testing Pyramid was two years ago and, at that moment, I didn't know how important it was going to be in my day by day development.

Testing Pyramid can be considered a framework where all your automated testing should fit. You can think about something like the food pyramid. For testing, in this case.
![](https://upload.wikimedia.org/wikipedia/commons/6/64/Testing_Pyramid.svg)

This pyramid can have variations depending on if you are testing frontend or backend system, but conceptually it is common for all of them.

The idea is simple, in the base of the pyramid you should have the fastest tests to run: unit tests. **You should test with unit tests as much as you can**. 
For instance, in a Java class, you can test all methods trying to have full coverage (or the maximum you can get). It is important that you mock your dependencies for them to be really unit.

The next layer, integration, is for testing how things work together. This is where exercise isolated subsystems, like doing endpoint calls and check the application is returning expected results. With these tests, we can cover things like configurations or annotations that can't be tested from a unit test perspective. We should create as many integration tests as needed to cover all paths that are not covered trying not to overtest. For instance, if we have an endpoint, we need to check it provides a correct response but, in the same flow, we don't have to test all the logic because it is tested in the unit test layer. Avoid overtesting is one of the most important things to take into account. So, again, **don't test what's tested in the previous layer**. These tests are much slower than unit tests, so we have to test all we need, but no more.

The last layer, e2e, is for checking all subsystems, already tested in the integration layer, are working together. This is the slowest kind of test, so **we have to wisely select flows we want to test**. At this level, what we want to discover is a system that is disconnected from others, like a database or a microservice so when you have the minimum amount of scenarios affecting all your systems, you should be done.

As a rule of thumb, if you change the behaviour of your code, some test should be broken. If it doesn't happen, you need to catch that error in a stage as low as possible (unit, integration, e2e).

So, when you plan your development, you should think in this pyramid, ore someone similar, for having you covered and don't make your build take longer that it needs.

This is how I understand this pyramid, but I recommend you to also read [Martin Fowler's post](https://martinfowler.com/bliki/TestPyramid.html) about this.

I feel this is now natural for me. My current target is to follow this Testing Pyramid in a TDD way.
How I store Screenshot data in my Linux work environment
Tags: linux, bash
Published: 2020-05-12 20:26:07

In my work environment, Screen capture and taking screenshots is a common thing to share the completed status. Ubuntu has the feature of screen capture in three ways:

1. PrtScr will capture the entire screen and will save it to Pictures

1. Shift + PrtScn will capture part of the screen my making the cursor to a plus sign (same as cmd + shift + 4 in mac) and will the screen capture to Pictures.

1. Ctrl + Shift + PrtScr will save the screen selection to clipboard.

### The Problem

The first two options save captured images to the local Pictures folder. which is good, but image name will be like this Screenshot from 2019-10-30 06-45-37.png , after a while you lose track of dates and Pictures folder will just be a mess of Screenshot from lying around without any info.

### Solution

Simple bash scripting and automating it with crontab for a particular time everyday solved this. First of all, I wanted to organise all the screenshots based on date, like every screenshot will be placed in a folder based on the date it was taken.

![screenshot seperator](https://cdn-images-1.medium.com/max/3704/1*kFx9ttGlN_t-roQB9D_j1A.png)*screenshot seperator*

I’ve placed this in crontab to run every 12 hours.

![](https://cdn-images-1.medium.com/max/2238/1*4fhF05WI5yO4YkORrPv7nA.png)

Screenshots taken everyday will be a new folder and all the images of the particular date will be transferred to the respective folder. This leads to large number of folders every month. For minimalism, we can just organise these folders further to that *particular* month, compress them to a tar file and store them.

![compress old screenshots](https://cdn-images-1.medium.com/max/4096/1*RX2djJzjZMrRh02PuJRl_g.png)*compress old screenshots*

This small snippets searches for Screenshots according to month, creates a folder, compresses the folder after moving all the dates of the month to that particular folder.

![](https://cdn-images-1.medium.com/max/2000/1*pYDSlLpRSfFHmaefGgpNWw.png)
[**vinaybommana/bashNotes**
github.com](https://github.com/vinaybommana/bashNotes)
I am Going To Break for 5 days
Published: 2020-05-12 19:52:33

> EDIT - I might be returning sooner than 5 days as I am finally calmed from the infinite comments, especially after turning off comments for those articles. I am looking for what to write about, and I might have a couple topics to look into.

The two articles I wrote about why Linux was successful, pushing me from maybe 500 views to over 100,000 in just a couple days. That said - a little overwhelming. I love those articles but I think the point of them being biased is just terrible. I am leaving not to work on my writing style - y'all can tell me what I suck at better than me - but rather to just think on what next. To be frank, I wasn't expecting the massive influx of viewers and comments and it got to the point where I just skipped comment after comment, and so I want to sit back and try to see what I can write about that would be more worthwhile than just what equates to me just typing out of my buttox with flimsy logic. 

I found the response both heartbreaking yet amazing, and I will not be answering comments until I am back with a fresh mindset, read to take on the universe.
Software Development Company | Bespoke Software Developers London, UK
Tags: software, bespoke
Published: 2020-05-12 20:18:55

UK's leading bespoke software development company serving clients worldwide since 2005. We develop custom business software, mobile apps, web applications and more.

GoodCore provides software development services to startups and established businesses alike. Our team works in an agile manner and provides exceptional value for money. Innovative feature-rich apps, bespoke operational software, and much more.

We offer a collaborative fixed-cost and time-bound discovery phase to help you refine your ideas and requirements from a design and technology perspective.

Our Services

MVP Development
iOS App Development Company
Mobile App Development Services
Web Applications
Dedicated Development Team
Testing & Quality Assurance 
UI/UX Design

Our team analyses your needs, aided by visual prototypes, to deliver a quality working software. We have an agile process that has been refined and time-tested to deliver our software projects quickly and efficiently; on time and on budget.

Highlights
UK-based company with in-house access to absolute top tech talent via its multiple offices
110+ successful Project Deliveries
Developing Since 2005

Why Choose Us?
Expert needs analysis
Visual Prototyping
Protection of Intellectual Property rights
Application Support
Cost-effective

Engagement Models

We offer multiple engagement models based on our client's specific needs:

Engagement specifically for MVP development
Fixed-scope fixed-price project
Flexible time & materials (T&M) options 
Dedicated team on monthly retainer

Visit Our site For more Details: https://www.goodcore.co.uk/
My traineeship
Tags: SliceOfLife, Organisation
Published: 2020-05-12 20:10:36

At the start of my second year in Epitech. I needed to do a traineeship, The company named LF Techonologie offer me the possibilty to do my formation during 6 months. This entreprise create hydraulic and mechanic benchmarks. What's more, in this company you can order special machinery.

For my traineeship, my work was to developpe an ERP(Enterprise Ressource Planning). You maybe wondering what an ERP is ? This is a software that can help a company's organisation. They let me worked on this project because the data acumulated in the past years needed to be sort. Thoses data was informations about the clients, providers, orders and the entreprise.

I was in charge to create from scratch a software and a Database(where the data is stock). I programmed the software with a language that I never used, so it took 2 weeks to learn all the basics of this computer language. And you won't beleive it but... It was my first time using Database too. Just like for the software, it took me few week to understand how is it working, and what I'll need to know in order to use it in my project.

After this two formations, I started the project. Each weeks, I planned goals before the following ones. For progressing in the project, I asked employee for some features that they wanted me to add in the software. At some point, I got some help from another trainee, who had already done some blueprint of Database. I reused and modified it to suit with the software.

At the end, I transfered each pieces of information from the old Database, to sort them in the one freshly create. My software worked perfectly with the Database. However, it was not a really big software because of my lake of skills and of time, but anway... I did what the company want me to do.

In conclusion, I've got some improvement in my tree of skills(like if i was in video games), my points were set among the computer language, Database, organisation and mostly in sociable skills.
That was my traineeship during my second year in Epitech.

And you ? What was your most important professional project ?

Léo Ménard