teleren/devto huggingface dataset:
How to pull the AWS ECR docker image and extract all things in the docker image?
Tags: aws, ecs, docker
Published: 2021-04-21 17:34:37

---
title: How to pull the AWS ECR docker image and extract all things in the docker image?
published: true
description: Useful tips for AWS to pull docker image and, access all content in it.
tags: AWS, ECS, Docker
---

## Intro

Maybe you faced the problem that you have been needed the old docker file in the ECR repository.
I solved this problem with the docker command to pull and extract the docker image and access all I need.

## Pulling Docker image file

You can use the below command to pull the docker image that you push in the ECR repository:

```bash
docker pull YOUR_DOCKER_IMAGE_URL
```

## Run your desire command in docker image

You can run and execute a command in your docker image:

```bash
docker run --rm -it --entrypoint=/bin/bash YOUR_DOCKER_IMAGE_URL
```

For example:

```bash
docker run --rm -it --entrypoint=/bin/bash YOUR_DOCKER_IMAGE_URL ls -la
```

## Extract Docker image and searching in the files

```bash
 docker image save YOUR_DOCKER_IMAGE_URL > img.tar
```

After that, you extract the docker image and find your target files:

```bash
 tar -xvf img.tar
```

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/w48zazzlegjkrg2tsny0.png)
Challenge Record Collection
Tags: javascript, devops, tutorial, beginners
Published: 2021-04-21 17:27:24

#### Record Collection:
You are given a JSON object representing a part of your musical album collection. Each album has a unique id number as its key and several other properties. Not all albums have complete information.

Here we have an updateRecords function that takes an object like collection, an id, a prop (like artist or tracks), and a value. Complete the function using the rules below to modify the object passed to the function.
* The function must always return the entire object.
* If prop isn't tracks and value isn't an empty string, update or set that album's prop to value.
* If prop is tracks but the album doesn't have a tracks property, create an empty array and add value to it.
* If prop is tracks and value isn't an empty string, add value to the end of the album's existing tracks array.
* If value is an empty string, delete the given prop property from the album.
* Solve:
```
var collection = {
  2548: {
    albumTitle: 'Slippery When Wet',
    artist: 'Bon Jovi',
    tracks: ['Let It Rock', 'You Give Love a Bad Name']
  },
  2468: {
    albumTitle: '1999',
    artist: 'Prince',
    tracks: ['1999', 'Little Red Corvette']
  },
  1245: {
    artist: 'Robert Palmer',
    tracks: []
  },
  5439: {
    albumTitle: 'ABBA Gold'
  }
};

// only change below this line.
function updateRecords(object, id, prop, value) {
  return object;
}

updateRecords(collection, 5439, 'artist', 'ABBA');
```
* Answer:
```
var collection = {
  2548: {
    albumTitle: 'Slippery When Wet',
    artist: 'Bon Jovi',
    tracks: ['Let It Rock', 'You Give Love a Bad Name']
  },
  2468: {
    albumTitle: '1999',
    artist: 'Prince',
    tracks: ['1999', 'Little Red Corvette']
  },
  1245: {
    artist: 'Robert Palmer',
    tracks: []
  },
  5439: {
    albumTitle: 'ABBA Gold'
  }
};

var collectionCopy = JSON.parse(JSON.stringify(collection));

// Only change code below this line

function updateRecords(object, id, prop, value) {
  if (prop != "tracks" && value != "") {
    object[id][prop] = value;
  } else if (prop === "tracks" && object[id].hasOwnProperty("tracks") === false) {
    object[id][prop] = [value];
  } else if (prop === "tracks" && value != "") {
    object[id][prop].push(value);
  } else if (value === "") {
    delete object[id][prop];
  }
  return object;
}

console.log(JSON.stringify(updateRecords(collection, 5439, "tracks", "Take a Chance on Me"))); will display
{"1245":{"artist":"Robert Palmer","tracks":[]},"2468":{"albumTitle":"1999","artist":"Prince","tracks":["1999","Little Red Corvette"]},"2548":{"albumTitle":"Slippery When Wet","artist":"Bon Jovi","tracks":["Let It Rock","You Give Love a Bad Name"]},"5439":{"albumTitle":"ABBA Gold","tracks":["Take a Chance on Me"]}}
```
Computing the Mean
Tags: python, mean, histogram
Published: 2021-04-21 17:08:50

Calculating the Mean from Scratch using Python
     In this post, I will explain a Python program that I wrote which calculates the mean without using the analytics libraries (NumPy, SciPy, etc.). The mean is a standard statistical expression used to calculate the average of a set of real numbers. There are two functions in Python used to calculate the mean from scratch. The first function is sum(), which calculates the sum of elements declared in a program. The program I wrote applies the function to add up a list of numbers and divides them by the len()function, which counts the number of elements declared in a list. When you divide sum()by len(), you get the equation for the mean, which you can declare in a program. The following screenshots show the code and a basic histogram of the values displayed in the program:
 
The screenshot shows the program where I declared a list of dummy values. Once I did this, I then built the equation for the mean, stored in the values_mean variable. Then, I printed the result to standard output. Finally, I generated a basic histogram using the matplotlib library and used hist() to output the histogram as we see here:
 
The graph is far from perfect, but it does give a simple visualization of values. In my next post, I will improve the program using the Ames data set, a standard set used in regression modeling. I will also improve upon the graphics to create a more descriptive distribution of values.
Nested Arrays
Tags: javascript, devops, tutorial, beginners
Published: 2021-04-21 17:06:31

#### Accessing Nested Arrays
As we have seen in earlier examples, objects can contain both nested objects and nested arrays. Similar to accessing nested objects, array bracket notation can be chained to access nested arrays.
* Example:
```
var myPlants = [
  {
    type: "flowers",
    list: [
      "rose",
      "tulip",
      "dandelion"
    ]
  },
  {
    type: "trees",
    list: [
      "fir",
      "pine",
      "birch"
    ]
  }
];

var secondTree = myPlants[1].list[1]; // will display pine
```
Using dot and bracket notation, we set a variable called secondTree to the second item in the trees list from the myPlants object.
My Mistake On Converting Slice To Slice Of Ptr In Golang
Tags: beginners, go, pointer, slice
Published: 2021-04-22 04:15:35

---
title: My Mistake On Converting Slice To Slice Of Ptr In Golang
published: true
date: 2021-04-21 17:00:00 UTC
tags: beginners,golang,pointer,slice
canonical_url: https://clavinjune.dev/en/blogs/my-mistake-on-converting-slice-to-slice-of-ptr-in-golang/
---

![Photo by @iavnt on Unsplash](https://images.unsplash.com/photo-1513104890138-7c749659a591?w=1920)

I once made a function to convert a slice to slice of ptr and made a mistake.

## My Function

```go
func Slice2SliceOfPtr(slice []int) []*int {
	n := len(slice)
	r := make([]*int, n, n)

	for i, s := range slice {
		r[i] = &s
	}

	return r
}
```

It seems normal to me until I realize something was wrong.

## My Main Func

```go
func main() {
	x := []int{1, 2, 3}
	y := Slice2SliceOfPtr(x)

	fmt.Println(x)

	for _, yy := range y {
		fmt.Printf("%d ", *yy)
	}
}
```

## Result

```shell
$ go run main.go 
[1 2 3]
3 3 3
```

Why only the last element copied to the result?

Because the `&s` I used is mutated every iteration.

```go
for i, s := range slice {
	r[i] = &s
}
```

`s` never created as a new variable on every iteration, but its value is mutated inside the for loop

So I changed the iteration like this:

## Better One

```go
for i := range slice {
	r[i] = &slice[i]
}
```
Sharingan
Tags: codepen
Published: 2021-04-21 16:47:26

_Look at this cool 3-tomoe sharingan using HTML and CSS_
{% codepen https://codepen.io/a12baghel2/pen/NJKzJp %}

_Uchiha Crest_
{% codepen https://codepen.io/a12baghel2/pen/jOyXKOJ %}
Spring Boot and Weblogic JMS
Tags: springboot, jms, weblogic14c
Published: 2021-04-21 16:44:32

If you love using Spring boot for application development and want to use JMS features offered by Weblogic and want to take quick look on a **_hands on guide_** the you can get a quick peek at my [linkedIn Article](https://www.linkedin.com/pulse/spring-boot-weblogic-jms-part-ii-najeeb-arif/) on it and share your thoughts.

You can find the working example on the github for which the link is provided in the same post as well. If you directly want to take look at the code base [here is the url](https://github.com/NajeebArif/weblogicjms) for it.
Pairing with Community Manager Christina Gorton
Tags: devstream, pairprogramming, testing, javascript
Published: 2021-04-21 16:34:31

On <time datetime="2021-04-14">March 14th</time>, DEV Community manager [Christina](https://dev.to/coffeecraftcode) joined me on the pairing stream to talk about Cypress and how we use it at Forem for end to end (E2E) testing.

{%youtube Xm-nCsTObkE %}

### On this stream, we covered:

* What [Cypress](https://docs.cypress.io/) is
* The different moving parts of Cypress
* The anatomy of an E2E test in Cypress
* [cypress-testing-library](https://testing-library.com/docs/cypress-testing-library/intro/).
* How and why you would want to create a [custom Cypress command](https://docs.cypress.io/api/cypress-api/custom-commands).

<center>

![A message warning that this message is just a test](https://media.giphy.com/media/SQiQu6lbG8bn2/giphy.gif)

</center>

Thanks again for listening to me ramble on about testing, Christina!

### You can also find the both of us all over the web here:

Nick:

* [Twitter](https://twitter.com/nickytonline)
* [Website](https://iamdeveloper.com/)
* [livecoding.ca](https://livecoding.ca)
* [YouTube](https://youtube.iamdeveloper.com)

Christina:

* [Twitter](https://twitter.com/coffeecraftcode)

Christina and I look forward to seeing you on future streams! If you're interested in pairing, fill out [this form](https://iamdeveloper.com/pair). We’d love to tackle an issue with you that the whole community could learn from!.
P.S. [Follow DEV on Twitch](https://twitch.tv/thepracticaldev) to be notified when future streams begin and catch old streams on [YouTube](https://www.youtube.com/c/thepracticaldevteam)
Setting up JMS in Weblogic 14c
Tags: jms, weblogic14c, devops
Published: 2021-04-21 16:30:10

If you are building applications for Java EE Servers like Weblogic and Websphere then JMS becomes your default Messaging solution for creating Message Oriented Middleware(**MOM**). You can follow my [LinkedIn Article](https://www.linkedin.com/pulse/spring-boot-weblogic-jms-part-i-najeeb-arif/) which is a **_hands on guide_** on how to configure JMS in weblogic 14c.

Happy Coding :)
Spring Boot on Weblogic 14c
Tags: springboot, weblogic14c, java
Published: 2021-04-21 16:25:14

Last year I wrote an article on [LinkedIn Article](https://www.linkedin.com/pulse/spring-boot-weblogic-14c-najeeb-arif/) which is **_hands on guide_** on how to build and deploy spring boot apps on Weblogic 14c. 

Please go ahead check it out and share your thoughts.
Kudos to dev.to for having simple terms of service 👍
Published: 2021-04-21 16:11:48

I just joined this site and I wanted to give a thumbs up to dev.to for having short and understandable Terms of use and code of conduct:  https://dev.to/terms https://dev.to/code-of-conduct 👍

Whenever you register or sign-up to something online the term of use feel like you are about to crack open the Bible, the Baghavad Gita or the Iliad. It's long, it's hard and it puts you right to sleep.

Why is that? No seriously, why is that? 
Here is the thing : those terms are an agreement between two parties. I agree to it and the owner of the website on the other side agrees to it. Both parties should be on an even level.
When the terms of use are long and in and with a legalese wording, whoever is on the other side basically says "My rights are more important than yours. Your ability to understand this binding agreement does not matter to me. I crafted this to my advantage. " How rude!

Another question you might have is : who cares? To be honest with you. Nobody cares. It's just an inconvenience. Until there is some disagreement that is. That's the thing with legal agreement : it doesn't matter a lot until it matters... a lot.
It's like prenup agreement. You don't get married expecting divorce. But if it happens the prenup sure becomes important. Just ask Britney Spears. She didn't want a prenuptial agreement when she married Kevin Federline. She loved him after all! Her lawyer insisted. It sure came in handy when she did divorce https://www.standard.co.uk/showbiz/exclusive-every-detail-of-britney-spears-prenup-and-ps65-million-fortune-7278314.html . So I guess the moral of the story is : do get lawyers to craft a very specific written in a legalese way after all? I don't know.

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jc8gd3oyq9eseotqxjmd.jpg)

So yeah, thanks again dev.to.
Just a favor dev.to : when we right-click 'open in a new tab' the terms link it would be nice not to instantly redirect the terms page to the onboarding one (https://dev.to/code-of-conduct redirects to https://dev.to/onboarding?referrer=https://dev.to/terms when we have created an account but have not yet accepted the terms and conditions, woops). Also it is nice to have the terms in a nice big font but could you make the lightbox containing the terms bigger? Thanks!
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/u875ydyushugd0u7zpp0.png)
What are some Real World Projects to learn Angular and React
Tags: discuss, javascript, angular, react
Published: 2021-04-21 15:54:50

Hi folks, :smile:

I would like to know What are some Real World Projects to learn `Angular` and `React` ?

There are  lot of suggestions in the internet. But I would like to build just 3 projects to learn required concepts.

I need unique and advanced app ideas which helps to learn more like `ecommerce app, multistep forms , admin panel with grid , search , crud, dropdowns` etc.

Any advice will be valuable.
#10 of 100DaysOfCode
Tags: 100daysofcode, html, css, beginners
Published: 2021-04-21 15:50:28

On the tenth day,
I just made two simple projects today and called it a day.
No biggie and no React.

It's seriously nothing but still if you wanna check it out. 

##Project 1 - Simple Price Grid
![First Project Image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/576ag1ern85ecscu4sws.png)
[Code](https://github.com/icecoffee-dev/random-projects/tree/main/single-price-grid-my-solution)
[Live view] (https://eloquent-lamport-39c047.netlify.app/)

##Project 2 - Four Card Featured Application
![Second Project Image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/i1p8asc63qildl0baly6.png)
[Code](https://github.com/icecoffee-dev/random-projects/tree/main/four-card-featured-section-my%20solution)
[Live view] (https://friendly-shirley-790a13.netlify.app/) 

It's not enough, I know.
A big apology to myself and any other person who expected more.

If you got any suggestions, please comment down below.
Thanks for joining me.
Have a wonderful day.🌹
Accurately Judge Data Types by Using Regex
Tags: regex, ruby
Published: 2021-04-21 15:43:23

> Time: 2021-04-12 11:56 UTC+8:00

> Author: Me



It's not easy to judge a string's content's type in a normal way. So, it's time for regular expressions.



## Integers

```ruby
isInteger       = /^-?\d+$/								# for integers
isPositiveInt   = /^[0-9]*[1-9][0-9]*$/		# for positive integers
isNegativeInt   = /^-[0-9]*[1-9][0-9]*/		# for negative integers
isNonPosiInt 	= /^((-\d+)|(0+))$/				# for non-positive integers
isNonNegaInt	= /^\d+/									# for non-negative integers
```



## Floats

```ruby
isFloat         = /^(-?\d+)(\.\d+)?/								# for floats
isPositiveFloat = /^(([0-9]+\.[0-9]*[1-9][0-9]*)|([0-9]*[1-9][0-9]*\.[0-9]+)|([0-9]*[1-9][0-9]*))$/																							# for positive floats
isNegativeFloat = /^(-(([0-9]+\.[0-9]*[1-9][0-9]*)|([0-9]*[1-9][0-9]*\.[0-9]+)|([0-9]*[1-9][0-9]*)))$/															 					 # for negative floats
isNonPosiFloat	= /^((-\d+(\.\d+)?)|(0+(\.0+)?))$/	# for non-positive floats
isNonNegaFloat  = /^\d+(\.\d+)?$/										# for non-negative floats
```
WOW 😱 Cette pop-up est magnifique
Tags: showdev, javascript, css, french
Published: 2021-04-21 15:42:52

---
title: WOW 😱 Cette pop-up est magnifique
published: true
description: 
tags: showdev, javascript, css, french
//cover_image: https://direct_url_to_image.jpg
---

Je me suis réveillé ce matin avec l'envie viscérale de partager avec vous cette pop-up que j'ai créé. En espérant que vous l'aimiez autant que j'aime les pizzas🍕.

{% codepen https://codepen.io/JeremyMonatte/pen/oNBBVdd %}

Si vous avez des questions sur comment elle fonctionne, les commentaires sont par ici  ⬇.

_PS : Et oui je sais que le titre est exagérément aguicheur, mais ça ma permis d'apprendre aux anglophones le sens du mot "putaclick". Et rien que pour ça, ça vaut le coup. D'ailleurs pour la version anglaise, c'est ici que ça se passe._
{% post https://dev.to/jeremymonatte/wow-this-pop-up-is-so-nice-2l6a %}
WOW 😱 This pop-up is so nice
Tags: showdev, javascript, css, webdev
Published: 2021-04-21 15:37:37

---
title: WOW 😱 This pop-up is so nice
published: true
description: 
tags: showdev, javascript, css, webdev
//cover_image: https://direct_url_to_image.jpg
---

I woke up this morning and I just wanted to show you that pop-up i created. I hope you will love it as much as I love pizza🍕.

{% codepen https://codepen.io/JeremyMonatte/pen/oNBBVdd %}

If you have any question about how i created it, comments are here ⬇

_PS : Yeah, I know, the title of my post is a overly seductive, but that make me able to tell you than in french we call that kind of title "putaclik". Do not thank me, it's free just for you_
Make a calculator with pure HTML5 CSS3 and JavaScript!
Tags: javascript, webdev, css
Published: 2021-04-21 15:28:09

so, recently i made a calculator with html, css and js ! to add it to my portfolio 

***code for js for operator ***

```
function useOperator(operator) {
    const currentValue = Number(calculatorDisplay.textContent)
        // Prevent multiple operators
    if (operatorValue && awaitingNextValue) {
        operatorValue = operator
        return
    }
    // Assign firstValue if no value
    if (!firstValue) {
        firstValue = currentValue;
    } else {
        const calculation = calculate[operatorValue](firstValue, currentValue)
        calculatorDisplay.textContent = calculation
        firstValue = calculation
    }
    // Ready for next value, store operator
    awaitingNextValue = true;
    operatorValue = operator;
}
```
*** for add event listener ***

```
// Add Event Listeners for numbers, operators, decimal buttons
inputBtns.forEach((inputBtn) => {
    if (inputBtn.classList.length === 0) {
        inputBtn.addEventListener('click', () => sendNumberValue(inputBtn.value))
    } else if (inputBtn.classList.contains('operator')) {
        inputBtn.addEventListener('click', () => useOperator(inputBtn.value))
    } else if (inputBtn.classList.contains('decimal')) {
        inputBtn.addEventListener('click', () => addDecimal())
    }
})

```
Get Your Free Copy Now! The ultimate DevOps checklist for successful app deployment
Tags: devops
Published: 2021-04-21 15:24:54

Developing and deploying an application or software can be an overwhelming and stressful process with the number of complex tasks at hand. But bringing together development and operations - DevOps, you can simplify and speed up your app deployment process.

https://go.softwebsolutions.com/resources/devops-checklist-for-app-deployment.html

As deploying an application in a DevOps culture is not a cakewalk, you need to be prepared with robust deployment-ready goals and DevOps best practices that enable you to deploy applications successfully. Hence, we bring to you a complete [DevOps checklist](https://go.softwebsolutions.com/resources/devops-checklist-for-app-deployment.html) as a starting point to successfully deploy an application.

In this document, we have listed some key points and a step-by-step application deployment checklist to achieve deployment success during these time frames:

* Deployment from the scratch
* Before application goes-live
* After application goes-live
Kubernetes and Java EE 8:                    Cloud Native Java EE apps on k8
Tags: kubernetes, javaee, docker
Published: 2021-04-21 15:23:39

Kubernetes is the favorite container Orchestration tool out there and all of the major cloud providers like AWS, GCP, Azure and OCI have Kubernetes as a managed service. This makes it really important to have an understanding of how can we build vanilla Java EE applications for k8.

I have already written **_hands on guide_** regarding it in one of my [LinkedIn Article](https://www.linkedin.com/pulse/kubernetes-java-ee-8-cloud-native-apps-k8-najeeb-arif/). 

Please feel free check it out and share your thoughts.
How I built my deep learning workstation?
Tags: machinelearning, deeplearning, hardware, computers
Published: 2021-04-21 15:17:58

---
title: How I built my deep learning workstation?
published: true
description: A full story on how I built my GPU-accelerated machine for deep learning experiments
tags: machinelearning, deeplearning, hardware, computers
cover_image: https://dev-to-uploads.s3.amazonaws.com/uploads/articles/br1z1ipguphh1xmy75dj.jpg
---

Recently I have managed to build my little deep learning workstation :tada:
And I wanted to share my experience with you. So I wrote a blog post where tried to cover all aspects of building such a project including:

- reasons why I went for this
- PC parts selection
- hardware installation
- software and CUDA installation
- my current workflow

I feel like this may be helpful for enthusiasts like myself who think about own GPU-accelerated machine:

https://www.romaglushko.com/blog/how-i-built-my-ml-workstation/ :arrow_left:

I hope this will be helpful. Let me know what do you think in the comments!
Simple Splash/Launch/Boot Screen in React Native (iOS and Android)
Tags: reactnative, mobile
Published: 2021-04-21 15:14:39

---
title: Simple Splash/Launch/Boot Screen in React Native (iOS and Android)
published: true
description: In this lesson I walk you through installing and using the react-native-bootsplash library to quickly and easily setup a boot/splash/launch screen in your React Native apps.
tags: reactnative, mobile
cover_image: https://dev-to-uploads.s3.amazonaws.com/uploads/articles/z08w6uvpq8a4n2dw27a7.jpeg
canonical_url: https://www.reactnativeschool.com/simple-splash-launch-boot-screen-in-react-native-ios-and-android
---

{% youtube PlubOKfi46o %}

[React Native Bootsplash](https://github.com/zoontek/react-native-bootsplash)
Generative + Customisable SVG Social Images!
Tags: codepen
Published: 2021-04-21 15:11:54

George Francis :

<p>I think these could be really handy for startups / blogs with limited design resources. Or really anyone that finds creating social/meta images a drag!</p>

<p>I might even make it into a "full" app some day... </p>

<p>A full tutorial for this pen can be found here <a href="https://dev.to/georgedoescode/tutorial-create-generative-social-images-using-svg-2c47" target="_blank">https://dev.to/georgedoescode/tutorial-create-generative-social-images-using-svg-2c47</a> ✨</p>

{% codepen https://codepen.io/georgedoescode/pen/PoGLmmX %}