teleren/devto huggingface dataset:
10 : Algebra and Data Structures
Published: 2020-04-23 01:34:46

Why do I study algebra?
What is the benefit of learning algebra?
How does it relate to data structures?
What is necessary to know Data Structures exactly?
When do I begin to start learning Data Structures?
What are JavaScript Data Structures?

----


A JavaScript Data Structure is a specific technique to organize and store data in a computer so that we can access and modify it efficiently. More accurately, it is a collection of data values, the relationships among them, and the functions or operations that we can apply to the data.
Some of the advantages of using data structures are as follows:
They provide an easy way to manage large datasets.
They simplify the processing of data on a computer.
These are essential for designing efficient program algorithms.

---- 
But, only advanced users can make changes to data structures. So if you run into any problem, you’ll need an expert’s advice. The diagram below illustrates the types of data structures available in every programming language, including JavaScript. You will see some other data structures including trie, but these are advanced topics and it’s not relevant to mention them here.


https://medium.com/siliconwat/data-structures-in-javascript-1b9aed0ea17c

----
How does it necessary to make the data structure by coding?
09 : User Experience and Process
Published: 2020-04-23 01:33:21

The Concept of User Experience is not a buzzword, 
I am the side of supporting the invisible beauty, 
such as user experience, this is a type of design. Not the development, 
The design is undefined, It depends on a person’s perception,


So What I would like to do is applying to Computer Science, The Program, and grow my ability to think by myself, and get more assurance what I like to actualize, I used to think ‘I only like to code, I want to prioritize what the company asked me for.’


That was the traditional way I considered of myself, What I want is growing my creativity, not letting myself in a passive zone, The company has a system, I get paid by them, there is no way to say no, and that is my duty.
I understood, why other developers advised me, I had no opinion inside, I only googled and get the idealistic answers that everyone likes.


Everything got simple after I solved my math anxiety, and now I am facing the new problems, how to self-taught, Which direction should I follow, What is the best way for me

Where is my imagination?
Why do I not value imagination?
Why can I not challenge myself more?


I mean, I gave up perfectionism, and, enough to live every single day in an invisible state, and thought why can I not try more? Can I really satisfy all the companies? I don’t know what to prepare and think the lucks needs…too, where you are born, environment, gender, and anything else.


Learning User Experience can be helpful to apply code, design, marketing, any parts of the business, and for myself. We now need more experts of thinking user experience centered human and technology,


Why do I need the code review? 
to work together, I am not going to be alone, at work, I need to get the right feedback to work productively. Not aim for making my life happier, I have to be more grown-up solving my problems, on my own, the senior engineers have more wisdom to face the problems, This is about patience and confidence.


That is why I want to design my development process by learning User Experience,
* Code Readability, Usability, Style Guide, Flexibility.
08: User Interface and Aesthetics
Published: 2020-04-23 01:32:09

When it comes to design, people might come up with the idea of beauty, we have sense, we see, we smell, we touch, and we feel, we are not only living for surviving, Life is more abundant with art. That is what I like to value in my life forever, and that makes my life valuable.



Why do I write about UI? Because I want to try out designing my user interface, visually. The combination I can color, typography, and what else?
Okay, I am a queer, I am already filled with existential fear, on the other hand, I am filled with love by myself, and lovely rainbows, I am more than proud of myself, anytime, in my life. 🌈



My happiness is my priority and I want to build my happiness with front-end engineering, I thank that I can be surely prioritized myself, and time to act.


CSS is my hope to feel more joy of learning web front-end engineering, and, I don’t feel the necessity of having mentorship or setting the priority to construct the project, I am not going to take any action unless I am convinced.
It was not about the background, voila, I am free. I am going to enjoy googling, make lots of artwork! Yay :)



https://dev.to/frontendmentor/16-front-end-projects-with-designs-to-help-improve-your-coding-skills-5ajl?fbclid=IwAR2Q6yFGUMf6J8xhPPbBedFDYS9gUNn4AtZgbQkatWK8tJedXHh_LZcRTLI
Triggering Jenkins build through MS Teams
Tags: discuss, jenkins, microsoft, trigger
Published: 2020-04-23 01:04:36

Is there any way to trigger a JENKINS build through Microsoft Teams?

I am aware of using incoming webhooks to get notifications from JENKINS, but triggering a build I have no idea.

If anyone is using Outgoing Webhooks (or something else) to trigger JENKINS build, can you please explain how to use that?
(I am having parameterized JENKINS build job, which can be remotely triggered)
A Simple Argument For Typescript
Tags: javascript, typescript, webdev, beginners
Published: 2020-04-23 00:03:27

---
title: A Simple Argument For Typescript
published: true
description: My favorite argument for typescript is that, in many cases, it doesn't even let you do the wrong thing.
tags: javascript, typescript, webdev, beginner
cover_image: https://dev-to-uploads.s3.amazonaws.com/i/4o72dmu566n5v0ykz1l7.png
---

My favorite argument for typescript is that, in many cases, it doesn't even let you do the wrong thing.

Let me show you what I mean.

In this example, I forgot the name of the `complete` property of the todo object. Typescript won't even compile my code and my editor shows linting errors:

```typescript
type Todo = {
  name: string;
  complete: boolean;
}

const newTodo: Todo = {
  name: "Walk the dog",
  finished: false
}
```

And the linting errors showing my type is wrong:

![linting error](https://dev-to-uploads.s3.amazonaws.com/i/xr6ltmqnhrj1y5sm30qo.png)

Any javascripters intrigued?
The one book that made me a better dev and why
Tags: books, productivity, javascript, functional
Published: 2020-04-23 00:36:46

Everyone wants to know the one thing that made you a better dev. Though, I don't usually have an answer, I can for certain say reading this book leveled me up. Its not the **one** reason I am where I am today, but I can definitely say it contributed to making me stronger technically. 

> Story time

I have a mentor, who shall not be named, that told me to buy the book SICP(Structure Interpretation of Computer Programs). So I did.

### Why did I buy it?

It introduced me to CS concepts I wasn't already familiar with and all of the MIT coursework is on youtube so you can follow the lessons chapter by chapter in the book (highly recommended).

### Did I actually do the exercises in Scheme?

100% YES I DID. I know a lot of people will cringe at the thought of learning Scheme(Ive been made fun of more times than I can count) but its a great language to familiarize yourself with and its flexibility is amazing to learn some of these concepts the book goes over. Some popular languages are based on Scheme. Lisp and Clojure to name a few. If you want to do the challenges in Scheme and JS, go ahead its your adventure, choose your path. Whatever you decide, I do recommend actually doing and struggling through the challenges.

### Did I actually finish the book?

Sadly, no I did not. I think I completed almost every challenge up to the last 30% of the book and I still got a lot out of it. Enough to write a blog post about it. One day I hope to restart it and finish it. I think theres value in re-reading books that influence you, this is definitely one of them.

### How should I read it?

**Slowly** 

I would spend days on 1 page, struggling with the challenges and drawing out my solutions on the bus ride home. It's ok to not progress fast, get the most you can out of every page. Put the book down, pick it up again, take breaks for months at a time. Use it as a tool you can continuously reference and go back to when you have the time.

### What should I take away from it?

Patterns patterns patterns. I think the best thing that came from doing the challenges was learning how to apply problem solving patterns you learned. Eventually you'll start applying those patterns to your work.

### What do I mean by pattern

I mean looking at a problem, analyze what youre given and see if you can see a relationship with your input. Look at the list of numbers, do they have anything in common? Can I apply reptitive logic to this problem to get my answer? What problems should use iteration vs recursion, why? What are the tradeoffs?

Happy Reading and Struggling!

Scott
Ambianic.ai Continuous Integration and Deployment
Tags: ambianic, continuousdeployment, opensource
Published: 2020-04-23 00:33:27

[Ambianic.ai](https://github.com/ambianic) is now completely CI and CD enabled across all of its major components running respectively on mobile, cloud and Edge/IoT devices: 

* Progressive Web App ([ui.ambianic.ai](https://ui.ambianic.ai/)): 
  * Built with VueJS, Vuetify, and PeerJS
  * Hosted on Netlify
* Plug-And-Play Signaling Server:
  * Built with Node.js and PeerJS Server
  * Hosted on Heroku
* IoT/Edge image: 
  * Built with Python, Tensorflow, Gstreamer and aiortc
  * Hosted on a user home device: Raspberry Pi, Xbox, laptop or another machine.

Its amazing that across such a wide variety of frameworks and infrastructure, it is completely feasible to implement full cycle Continuous Integration and Deployment using 100% Open Source dependencies and 100% free cloud services generously supporting open source projects.

All three major Ambianic.ai modules follow the same flow, with the respective  tools for each function:

Pull Request -> Continuous Integration -> Code Review -> Commit -> Semantic Release -> Graceful Auto Update & Deploy

Here is the list of Github Apps that make this possible. 

![Ambianic.ai CI/CD tools](https://dev-to-uploads.s3.amazonaws.com/i/jfr67j9ookfd95xo730w.png)
working with Django model ChoiceField
Tags: python, django
Published: 2020-04-23 00:22:04

Today we going to explore how to work with model ChoiceField in Django.
To better understand, let's see the following examples.

```python
#models.py
#Django Models ChoiceField    
class Profile(models.Model):
    # Country Choices
    CHOICES = (
        ('US', 'United States'),
        ('FR', 'France'),
        ('CN', 'China'),
        ('RU', 'Russia'),
        ('IT', 'Italy'),
    )
    username = models.CharField(max_length=300)
    country = models.CharField(max_length=300, choices = CHOICES)
 
    def __str__(self):
        return self.username 

```



Result:

![Alt text of image](https://pytutorial.com/theme/img/articles_image/django/DjangoChoiceField.png)



##Grouped Model ChoiceField

```python
class Profile(models.Model):
    # Country Choices
    CHOICES = [
    ('Europe', (
            ('FR', 'France'),
            ('ES', 'Spain'),
        )
    ),
    ('Africa', (
            ('MA', 'Morocco'),
            ('DZ', 'Algeria'),
        )
    ),
    ]
    username = models.CharField(max_length=300)
    country = models.CharField(max_length=300, choices = CHOICES)
 
    def __str__(self):
        return self.username

```


Result:

![Alt text of image](https://pytutorial.com/theme/img/articles_image/django/GroupedModelChoiceField.png)

Reference:
[Django Model ChoiceField](https://pytutorial.com/django-model-choicefield)

All Done!
Day 122 : Yesterday
Tags: hiphop, code, coding, lifelongdev
Published: 2020-04-23 00:07:00

_liner notes_:
- Professional : Pretty much spent all day working on my project for the internal hackathon. I'm soooo close! Didn't get as much as I wanted to yesterday. Most of my issues had to do with React. So yeah, just a few more things I want to get working.

- Personal : Spent some time working on my hackathon project. It's a project I've been meaning to get done anyway, so it's cool to be able to get time on the job to work on it.

![Mountains of Turin, Italy with lakes](https://dev-to-uploads.s3.amazonaws.com/i/ivvtxra3o190umdv2i78.png)

Getting back to this project!

Have a great night!

peace piece
Dwane / conshus
https://dwane.io / https://HIPHOPandCODE.com
{% youtube PN8UXo9PfkU %}
Azure - Service IPs
Tags: azure
Published: 2020-04-23 06:40:15

---
title: Azure - Service IPs
published: true
date: 2020-04-23 00:00:00 UTC
tags: azure
canonical_url: 
---

One of the requests that often comes up on Azure is that of setting up NSGs or firewalls in order to secure our assets in the Cloud. In recent years, Microsoft has done a remarkable job of providing capabilities such as Service Endpoints and Service Tags which are popularized by everyone. Now not all services have these features.

If you do a search on the internet you will find this page: [Azure IP Range and Service Tags](https://www.microsoft.com/en-us/download/details.aspx?id=56519)

If you download this document you will find a JSON file that you can parse to find the information you need.However, Azure datacenters are acquiring new capacities day after day, and as a result new IPs may appear in this file, it is therefore updated very regularly by Microsoft.

Before there was only this file, and even before it was XML, that we had to recover on a regular basis, then parse it then inject it into our NSG configurations.

Now, this mechanism is much simpler, because there is the command `Get-AzNetworkServiceTag` in Powershell, or `az network list-service-tags` in CLI to help you.

Below in Powershell, here is how to recover the IPs of the Azure Batch management nodes for the West Europe region:

- 1st step \*: Retrieve all the values for our region

```
PS C:\Users\wilfr> $allTags = Get-AzNetworkServiceTag -Location westeurope
PS C:\Users\wilfr> $allTags

Name : Public
Id : /subscriptions/e7bd1bb5-e9af-49c7-b5aa-ac09992fdfeb/providers/Microsoft.Network/serviceTags/Public
Type : Microsoft.Network/serviceTags
Cloud : Public
ChangeNumber : 65
Values : {ApiManagement, ApiManagement.AustraliaCentral, ApiManagement.AustraliaCentral2, ApiManagement.AustraliaEast...}

```

- 2nd step \*: Filter only on the desired service

```
PS C:\Users\wilfr> $serviceName = "BatchNodeManagement.WestEurope"
PS C:\Users\wilfr> $serviceTag = $allTags.Values | Where { $_.Name -eq $serviceName }
PS C:\Users\wilfr> $serviceTag

Name : BatchNodeManagement.WestEurope
System Service : BatchNodeManagement
Region : westeurope
Address Prefixes : {13.69.65.64/26, 13.69.106.128/26, 13.69.125.173/32, 13.73.153.226/32...}
Change Number : 1

```

- 3rd and last step \*: Retrieve our Ips

```
PS C:\Users\wilfr> $serviceTag.Properties.AddressPrefixes
13.69.65.64/26
13.69.106.128/26
13.69.125.173/32
13.73.153.226/32
13.73.157.134/32
13.80.117.88/32
13.81.1.133/32
13.81.59.254/32
13.81.63.6/32
13.81.104.137/32
13.94.214.82/32
13.95.9.27/32
23.97.180.74/32
40.68.100.153/32
40.68.191.54/32
40.68.218.90/32
40.115.50.9/32
52.166.19.45/32
52.174.33.113/32
52.174.34.69/32
52.174.35.218/32
52.174.38.99/32
52.174.176.203/32
52.174.179.66/32
52.174.180.164/32
52.233.157.9/32
52.233.157.78/32
52.233.161.238/32
52.233.172.80/32
52.236.186.128/26
104.40.183.25/32
104.45.13.8/32
104.47.149.96/32
137.116.193.225/32
168.63.5.53/32
191.233.76.85/32

```

And here it remains only to put them in your NSG or in your Firewall configuration according to your network topology.
Either Types extended version
Tags: kotlin, functionalprogrammi, arrow, exceptions
Published: 2020-04-23 21:29:34

---
title: Either Types extended version
published: true
date: 2020-04-23 00:00:00 UTC
tags: Kotlin,Functional Programmi,Arrow,Exceptions
canonical_url: https://www.thoughtworks.com/insights/blog/either-data-type-alternative-throwing-exceptions
---

I have [a lot to say about Either types using Kotlin](https://www.thoughtworks.com/insights/blog/either-data-type-alternative-throwing-exceptions). It just got published in our company blog. I had written about this [here](../kotlin-either-types-instead-of-exceptions/) before. This is a slightly longer version with nicer graphics. Check it out if you hadn’t before!
Showing different fallback content with Web Components
Tags: webcomponents, progressiveenhancement
Published: 2020-04-23 13:54:48

---
title: Showing different fallback content with Web Components
published: true
date: 2020-04-23 00:00:00 UTC
tags: webcomponents,progressiveenhancement
canonical_url: https://lamplightdev.com/blog/2020/04/23/showing-different-fallback-content-with-web-components/
---

With web components there's often a need to render fallback content - both to show content in browsers that **don't have support for web components** (or with JavaScript disabled/broken) and to show content to the user **while the web component is being loaded/initialised**. The trouble is that we probably want to display **different fallback content** in these two scenarios - perhaps alternative static content in the first case and a loading indicator in the latter.

Fallback content is provided by supplying HTML between our custom element tags, but how do we have 2 different version of fallback content?

To achieve this we first build our component as normal:

```js
class WCExample extends HTMLElement {
  constructor() {
    super();

    this.attachShadow({ mode: 'open' });
  }

  connectedCallback() {
    this.render();
  }

  render() {
    this.shadowRoot.innerHTML = `
      <style>
      :host {
        display: block;
        padding: 1rem;
        color: steelblue;
        border: 1px solid steelblue;
      }
      </style>

      <p>Loaded and ready to go!</p>
    `;
  }
}

customElements.define('wc-example', WCExample);
```

Next we provide our two versions of fallback content inside out new element, providing different classes to each:

```html
<wc-example>
  <p class="no-wc">
    A static version of the content
  </p>
  <p class="has-wc">
    Please wait...
  </p>
</wc-example>
```

If we were to load this HTML in the browser we'd see both versions of the fallback content until the component code is loaded. However if we apply a class to the `body` indicating no web component support, `.no-wc`, and immediately remove it just after the `body` tag if web components are supported (before the component code is loaded or the component tag is rendered):

```js
if (window.customElements) {
  document.querySelector('body').classList.remove('no-wc');
}
```

The body will then only have the `.no-wc` class if JavaScript has run and Web Components are supported. We can then control which version is displayed with a couple of global CSS rules:

```css
body.no-wc .has-wc {
  display: none;
}

body:not(.no-wc) .no-wc {
  display: none;
}
```

[See this in action here](https://fallback-content-with-web-components.glitch.me/) (with an artifical delay applied to the loading of the Web Component code). Be sure to test with and without JavaScipt enabled to see the difference.
How to Delete All Files Except Diretories
Tags: linux
Published: 2020-09-01 16:31:10

---
title: How to Delete All Files Except Diretories
published: true
date: 2020-04-23 00:00:00 UTC
tags: linux
canonical_url: https://tech.serhatteker.com/post/2020-04/delete-all-files-except-dirs/
---

## Case

I want to delete all _files_ inside the `$ROOT` of `working directory` except directories themselves.

I faced this challange when I started a new [GoHugo] project and wanted to iterate/play around typical `exampleSite` content.

Example content for a new [GoHugo] project:

```
user@host:~$ ls -la
total 52K
-rw-r--r-- 1 user user 1.3K Jul  9 17:44 .
-rw-r--r-- 1 user user 1.3K Jul  9 17:44 ..
-rw-r--r-- 1 user user 1.3K Jul  9 17:44 config.toml
drwxr-xr-x 3 user user 4.0K Jul  9 17:44 content
drwxr-xr-x 9 user user 4.0K Jul  9 17:44 .git
-rw-r--r-- 1 user user   20 Jul  9 17:44 .gitignore
-rw-r--r-- 1 user user  160 Jul  9 17:44 .gitmodules
drwxr-xr-x 4 user user 4.0K Jul  9 17:44 layouts
-rw-r--r-- 1 user user   79 Jul  9 17:44 Makefile
drwxr-xr-x 3 user user 4.0K Jul  9 17:44 public
-rw-r--r-- 1 user user   20 Jul  9 17:44 README.md
drwxr-xr-x 3 user user 4.0K Jul  9 17:44 resources
-rw-r--r-- 1 user user 2.2K Jul  9 17:44 Session.vim
drwxr-xr-x 3 user user 4.0K Jul  9 17:44 static
drwxr-xr-x 3 user user 4.0K Jul  9 17:44 themes
```

## Solution

Finding files:

```bash
$ find . -type f
```

To make this only for current dir —`$ROOT`, add `-maxdepth` flag:

```bash
$ find . -maxdepth 1 -type f
```

__Final__ solution would be:

```bash
$ find . -maxdepth 1 -type f -delete
```

> __Warning__
>
>Make sure you selected right files before using _-delete_ flag. So check more than one the output of _find_.


## Bonus Tip
To exclude a _dir_ from your `find` use, `-prune` flag. For instance in order to exclude `.git` dir from our searches use one of the below commands:

```bash
$ find . -type d -name .git -prune -o -type f -print
$ find . -path ./.git -prune -o -print
```

All done!

[GoHugo]: https://gohugo.io/
Django validate_unique method already exists message
Tags: django, python
Published: 2020-04-22 23:15:16

As always to write in stack overflow it's something beginners developers like me can't do

I made this post and get answers from people who have not read the question well.

the question is this: How to show admin users which is the instance that already exists so they can edit it if they want? 

> it is not a good practice to overwrite the method validate_unique and I don't know if it would be correct to validate unique fields in the clean() method.

>but imagine:bulb: the following situation: you want to show admin users which is the instance that already exists so they can edit it if they want, I think it would be more intuitive when working with thousands of data.

### This's what I've done:
>the following code is just an example - think about it as a pseudocode although I tried it and it works, I know it could be better

```python
 def clean(self):
        lockup ={}

        unique_togethers = self._meta.unique_together[0]#these could throw an error

        for field in unique_togethers:
            f = self._meta.get_field(field)

            value = getattr(self, f.attname)

            if value is None:
                 continue

            if f.primary_key and not self._state.adding:
                    continue

            lockup[str(field)] = value

        qs = snippet.objects.filter(**lockup)

        if qs.exists and self._state.adding:
            raise ValidationError(
                     format_html('''this object already exist plese edit it on <a href="{}">Edit</a>''', 
                                  reverse('admin:testing_snippet_change', args=(qs[0].pk,))))
```
## Results:
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/obztaac93leps5imxylh.png)
Is this approach correct, how to apply it to the validation_unique method to works in all unique validations?
National Vulnerability Database in Dolt
Tags: security, vulnerability, sql, database
Published: 2020-04-22 22:49:41

Checkout this [dataset](https://www.dolthub.com/repositories/Liquidata/NVD/) I created on Dolthub, and the [blog](https://www.dolthub.com/blog/2020-04-22-national-vulnerability-database/) I wrote about it!