teleren/devto huggingface dataset:
Common Docker Commands
Tags: docker, devops
Published: 2021-06-21 04:22:38

Hey y'all! In this article, I will go over a lot of the main/common docker commands and what they do. 

Let's get started!

`docker images` - This displays all the images installed on your machine. It contains a lot of important information such as `tag`, `size`, `image id`, and the repository installed. 

`docker ps` - This displays all the containers currently running at the moment. This is super helpful if we want to go inside the container and access/configure some data.

`docker pull <image>` - This will pull a docker image from a repository. This could be from DockerHub, Nexus, AWS ECR, etc.

`docker run -d` - This will run the docker image in "detached" mode. This means that it will be running in the background. 

`docker stop <container_id>` - This will stop the container from being executed. 

You should be aware that if the container is running a application with data saved/configured, all the data will be lost when you stop the container. To fix this, use Docker Volumes.  

`docker run <image>` - This will create a new container to run an image and execute the container.

`docker start <container_id>` This will launch the already existing container. 

`docker log <container_id>` - This will retrieve logs of the container running. This is great for debugging! 

`docker exec -it <container_id> bin/bash` - This enables you to go inside the container that is running and run commands, check configs, environment variables, etc.

If `/bin/bash` doesn't work, use `/bin/sh`

`docker run -p <new_port>:<container_port>` - This allows you to run the container on a separate host port. 

`docker build -t <name_of_image>:<tag>` - This will build the image.

`docker push <repository>:<tag>` - This will push your docker image. 

`docker tag <image>:<tag> <new_image>:<new_tag>` - This will allow you to rename your image and create of copy of it. 

`docker volume create --name <name>` - This will allow you to create a volume and give it a custom name.
How my path crossed React.
Tags: react, reactnative, javascript, css
Published: 2021-06-21 03:50:32

This is about my Coding journey, my life changing decision.

Not long ago decided to switch my career into software line, got my first internship for 5 months where I worked as an back-end engineer, At that time I was not aware of JavaScript let alone React. Then how I got into React and JS?

Well after internship I switched company and was trained on React Which was a black-box for me at that time(for some part it is still a black-box maybe because I am a bit ..hmm How should I put it well .I am bit stupid) After struggling through the tutorials I had a basic Idea and was quite confident until I met HTML,CSS. This little not so important part took me more time to understand it than React itself, understanding DOM tree was tricky, but I climbed it(saw what I did).

Let me talk about state management or data management if you may. so it is Same as back-end were we have one source of truth that is DB , here we have Redux AKA global store. Its jobs is to store data which can be accessible to any component.

Above all things are made on top of JavaScript which I learned in the process. Since then I just love it and want to learn more and more, Being said that see you until next time.

PS: This is very first blog and start of a beautiful journey. support will always be appreciated.
Find majority element using Moore's Voting algorithm
Tags: datastructures, algorithms, arrays
Published: 2021-06-21 03:49:50

##Majority Element
A majority element in an array of size n is an element that appears more than n/2 times and hence there is at most one such element. For example, the majority element of the array {1, 2, 1, 1, 3} is 1.

##Moore's voting algorithm
Moore's voting algorithm helps us find the majority element in an array using the following steps,

* Initialize a result variable with value 0 and a count variable with value 1
* Iterate through the array and increment the count variable if the element is same as result else decrement the count variable
* If the count variable becomes 0, then reset the count variable with value 1 and set result variable as the array element.
* Iterate through the array again and find the count of result variable from first iteration
* If result variable count is less than n/2 then return -1 else return the result variable as Majority Element

Let arr = {2, 3, 4, 2, 2, 5}, n = 6

![moores-algorithm](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/tw5giueytnirgk5p9i6u.jpg)

##Code

```
import java.io.*;
import java.util.*;

class Test {
    
    // T(n) = Θ(n)
    // Aux space = Θ(1)

    public static int findMajority(int[] arr, int n) {
        int res=0, count=1;
        for(int i=0; i<n; i++) {
            if(arr[i] == res) {
                count++;
            } else {
                count--;
            }
            
            if(count == 0) {
                count = 1;
                res = arr[i];
            }
        }
        
        count = 0;
        for(int i=0; i<n; i++) {
            if(arr[i] == res) {
                count++;
            }
        }
        
        if(count < n/2) {
            return -1;
        }
        
        return res;
    }
    
	public static void main (String[] args) {
		Scanner in = new Scanner(System.in);
		
		int n = in.nextInt();
		int[] arr = new int[n];
		for(int i=0; i<n; i++) {
		    arr[i] = in.nextInt();
		}
		
		int res = findMajority(arr, n);
		System.out.println(res);
	}
}
```

##Output
```
2
```

##Thanks for reading!
If you have any questions about the post feel free to leave a comment below.

Follow me on twitter: [@soorya_54](https://twitter.com/soorya_54)
A new way to build CSS frameworks with... TailwindCSS?
Tags: css, tailwindcss
Published: 2021-06-21 03:42:36

TailwindCSS has a great color scheme, good default styles, a way to remove unused classes, a way to make custom classes, and lots more. It would be the greatest thing if we could use its styles to make our own CSS frameworks. Guess what, we can!

I haven't done it yet, but the main steps look like so: 

- Use tailwind's `@apply` to create your classes
- Create an HTML file (which will be used for purging unused classes)
- Run Tailwind (using PostCSS or whatever)

That's it! You will get a new CSS file with your framework ready to use. 

There are a few more things you could try:

- Wanna use any of tailwind's built-in classes? Just add the classes to any elements in the HTML file I mentioned before, and they won't be removed from the CSS!
- Dig into the tailwind config files to get more stuff like dark mode, custom color schemes, plugins, and more!
- You got more ideas? Comment them down below!

I think this is the same approach that tailwindui is using.
Self taught guide to cloud computing
Tags: cloud, beginners
Published: 2021-06-21 03:14:13

The other day I tweeted:

{% twitter 1406258053427740672 %}

I decided to put a GitHub repo with a learning path, resources, and projects, I would take to gain a junior cloud engineer skillset in about 6 months. Here it is.

{% github madebygps/self-taught-guide-to-cloud-computing %}

I also created a YouTube video with an overview of the guide.

{% youtube ts9vNsrJypE %}

This is based on my own experience. Your journey is yours. However, I still wanted to share in case anyone finds something useful.
Un amico di famiglia me lo ha detto settimane dopo il matrimonio  gillne.it
Published: 2021-06-21 02:56:56


Un amico di famiglia mi ha detto settimane dopo il matrimonio che non era mai stata a un matrimonio in cui gli sposi sembravano non solo così felici, ma anche così a loro agio. Di conseguenza, ha detto che lei e suo marito hanno notato che tutti sembravano così felici, rilassati e si divertivano totalmente con facilità. Ho pensato che fosse il miglior complimento. Da meridionale, sono cresciuto con i valori tradizionali dell'ospitalità e della cortesia: un calore quasi ineffabile che mette gli altri a proprio agio. Mia nonna respira l'ospitalità del sud senza rendersene conto e mia madre è la persona più calda e generosa che conosca. Quindi sono stato felice di sapere che il nostro matrimonio è stato piacevolmente accogliente,
http://www.gillne.it
Quando ero un organizzatore di eventi e stilista di abiti da sposa abiti da sposa sexy, dicevo sempre ai miei clienti: vuoi sentirti te stesso il giorno del tuo matrimonio - forse il tuo miglior trucco professionale - ma come te stesso. Quindi tutto, dai nostri vestiti all'arredamento alle scelte di menu abiti da sposa online economici, erano cose con cui ci sentivamo assolutamente a nostro agio e niente di cui normalmente non ci circonderemmo nella vita di tutti i giorni (beh, se vivessi la nostra vita quotidiana in un abito di tulle con un conduttore personale straordinario, fantastico band che suona musica dal vivo e decorazioni floreali costanti).
Javascript variables and data types
Tags: beginners, javascript
Published: 2021-06-21 02:54:19

Variable: containers that hold values
var x = 10 ;
var x is variable 
10 is value
variable is loosely typed
Js data types are :
1-undefined
2-number
3-string
4-boolean
5-null
Any variable has undefined data type as initial value until you assign value to it 

You can know the type of the variable by using typeof
console.log(typeof x)
Flutter Tutorial - Delivery App: Export Signature & Create Invoice PDF With Syncfusion Flutter Widget
Tags: flutter, tutorial, pdf, widget
Published: 2021-06-21 02:45:33

Create a Flutter Delivery App that generates an Invoice PDF document with the customer signature included using Syncfusion Flutter Widget.

[Syncfusion Flutter widgets](https://www.syncfusion.com/flutter-widgets "Syncfusion Flutter widgets") are written natively in Dart to help you create rich, high-quality applications
for iOS, Android, Web, Windows, macOS and Linux from a single code base.

Syncfusion Website: https://bit.ly/3c5YvMD
Syncfusion Flutter Components: https://bit.ly/3wLIrHG 

{% youtube fg2aLXNG0Bc %}
https://www.youtube.com/watch?v=fg2aLXNG0Bc
Coding so far.
Tags: html, css, javascript, cloud
Published: 2021-06-21 02:25:03

Greetings all! It has been one heck of a month so far and it isn't even over yet. Study sessions have been in full swing in this neck of the woods. But all of this studying and hard work is paying off. In the month of June alone I was able to complete two separate coding courses, and secure the certifications that come with them. I hope to get a great start on a third course before the month is over. I also hope that all of my fellow coders are also working towards their dreams. In any case, y'all have a great week!

https://courses.edx.org/certificates/ae8690279cf341e1af648ba0dd6251ac

https://courses.edx.org/certificates/71c4f96632004e218c30bcfccbc315b4
What's the difference between a Data Architect, Data Analyst, Data Engineer, and Data Scientist?
Tags: datascience
Published: 2021-06-21 01:42:18

Each stakeholder has a clear role to play for a business problem right from understanding the essentials of the problem, proper planning, implementation of the project, analyzing the various outcomes of the project, solving the bottlenecks visible in the outcomes, and generating reports by drawing inferences about the success of the project.The various key stakeholders in any project include the Data analyst, the Data scientist, the Data engineer, the Database administrator, and the Analytics manager.

A lot of us get a bit confused with the roles and responsibilities of a Data Architect, Data Analyst, Data Engineer, and Data Scientist. So let's try to understand how each role is different from one another.  


Data Engineer : The role of a Data Engineer is not to analyze data but rather to prepare, manage and convert data into a form that can be readily used by a Data analyst or Data scientist.

Data Architect : A Data Architect provides the support of various tools and platforms that are required by Data engineers to carry out various tests with precision. A Data architect should be well equipped with knowledge of data modeling and data warehousing. Other additional skills required by a Data architect are Extraction, Transformation, and Load (ETL), and knowledge of Hive, Pig, and Spark.

Data Analyst : A Data analyst is to extract data and interpret the information obtained from the data for analyzing the outcome of a given problem in business.

Data Scientist : A Data scientist incurs all the skills of a Data analyst with the additional skills of data wrangling, complex machine learning, Big Data tools, and software engineering. It is observed that both Data analysts and Data scientists use the same tools and practices.

Hope this was helpful.
Looking for some Continuous Integration (CI) best practices?
Tags: devops
Published: 2021-06-21 01:33:00

Continuous Integration is the DevOps practice to integrate the new feature implementation or a bug fix in the existing distributed version control systems such as Git that triggers code quality checks, unit test execution, and build. Continuous Integration is easy to implement, and hence for DevOps starters, it works as a solid base on which the rest of DevOps practices can stand.

The following are some of the best practices related to continuous integration:

- Commit code frequently - feature completion/bug fix
- Run builds on the system to verify
- Never commit broken code
- Integrate notifications on failures
- Fix broken builds immediately
- Write automated unit tests (Coverage %)
- Easy access to packages generated after successful build and quality gates verifications
- Configure notifications for failures

Hope this was helpful.
How to get the index of an object from an array of objects in JavaScript?
Tags: javascript
Published: 2021-06-21 00:00:00

---
  title: How to get the index of an object from an array of objects in JavaScript?
  published: true
  tags: JavaScript
  date: Mon Jun 21 2021 05:30:00 GMT+0530 (India Standard Time)
  canonical_url: https://melvingeorge.me/blog/get-index-object-from-array-of-objects-javascript
  cover_image: https://melvingeorge.me/_next/static/images/main-3138a9b023b244b4e9913280e5eefdf0.jpg
  ---
  [Originally posted here!](https://melvingeorge.me/blog/get-index-object-from-array-of-objects-javascript)
  
To get an index of an object from an array of objects, we can use the `findIndex()` array method on the array containing the object elements in JavaScript.

### TL;DR

```js
// Array of objects
const objsArr = [
  { name: "John Doe", age: 23 },
  { name: "Roy Daniel", age: 25 },
];

// Get the index of the object in the array
const indexOfObject = objsArr.findIndex((obj) => {
  // if the current object name key matches the string
  // return boolean value true
  if (obj.name === "Roy Daniel") {
    return true;
  }

  // else return boolean value false
  return false;
});

console.log(indexOfObject); // 1
```

For example let's say we have an array of objects like this,

```js
// Array of objects
const objsArr = [
  { name: "John Doe", age: 23 },
  { name: "Roy Daniel", age: 25 },
];
```

Now, If we want to get the index of the object with the `name` key that matches `Roy Daniel`, we can use the `findIndex()` method.

- the `findIndex()` requires a function as an argument.
- the argument function will be passed the current array element every time an element is looped.
- Inside this function, we can check if the name matches `Roy Daniel` and return the `boolean` value true if it matches and the `boolean` value `false` if not.
- the `findIndex()` method returns the index of the object in the array.

It can be done like this,

```js
// Array of objects
const objsArr = [
  { name: "John Doe", age: 23 },
  { name: "Roy Daniel", age: 25 },
];

// Get the index of the object in the array
const indexOfObject = objsArr.findIndex((obj) => {
  // if the current object name key matches the string
  // return boolean value true
  if (obj.name === "Roy Daniel") {
    return true;
  }

  // else return boolean value false
  return false;
});

console.log(indexOfObject); // 1
```

That's all 😃!

See the above code live in [JSBin](https://jsbin.com/xuwilileja/2/edit?js,console)

### Feel free to share if you found this useful 😃.

---
How to create a Mobile App for your Business with $0 
Tags: mobileapp, business, career, codenewbie
Published: 2021-06-20 23:23:39

Let’s talk about the business owners who want to build an app as an extension of their current brand, business, or website.

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4gv3y93t0t4p9v3egji2.jpg)
**What’s your budget?**
The majority of businesses plan to budget between $250,000 and $500,000 over the next 12 to 18 months.

**Does this sound too high to you?**
It’s not.

Your location is relevant to how much it’s going to cost to develop your app.

If you’re located in North America, expect to pay roughly $150 per hour if you’re planning to hire someone to build your iOS mobile app.
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ogtrk1orji29v0zquu62.jpg)

So unless you’re planning to take a trip to Indonesia, it won’t be inexpensive. On average, an app will take about 7-9 months to build and cost you about $270,000. That’s an unrealistic number for some businesses.

Your company may not even be able to secure a $200,000 line of credit, never mind pay over $250,000 for an app.

**So what’s the solution?**
Follow my guide, and I’ll show you the most cost-effective ways to develop your app if you don’t have the funds to pay someone else to do it.

### Option #1: Just learn how to code everything

There are some great resources online that teach you how to code for free. I’ll show you my favourite ones. Team Treehouse offers a free trial for a week to new users. So you can learn to code from your computer, anywhere with a Wi-Fi connection.

Here’s how their system works. They have thousands of videos to teach users the basics of coding. After you watch the videos, you’ll take quizzes to test your knowledge. 
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2uwfffdmgpsjs9llrrci.jpg)
Then, Team Treehouse gives you the tools needed to practice coding with interactive challenges. The platform is super clean and easy to use, especially for beginners.

Code Academy is another one of my favourites.
Their platform also has interactive tools that will teach you the coding basics for your mobile application.


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

### Option #2: Take advantage of  App Development Support Programs

For small business who are just interested in converting their existing website to a mobile app, they can take advantage of the "Krowser Web Services App Development Support Program" 

You just need to submit your business website link and an android app will be developed and published on the Google Play Store all for free.

The whole process typically takes 7 days.

Submit your website here: https://forms.gle/jExGTmyvv2hgFcfF7

###Conclusion
Creating an android app for your business is much easier than it sounds.

Depending on your situation, you’ve got lots of options to choose from.
Why Headless BI is a perfect fit for DataOps teams
Tags: datascience
Published: 2021-06-20 22:04:37

The headless BI is not a buzzword - same as headless CMS concept, the headless BI is about decoupling the analytical logic from the presentation and self-service layer. The design of headless BI is a robust system based on open and declarative APIs allowing combining the data services to a custom stack. 

The data managed by DataOps teams are often consumed as analytics insights, dashboards, or machine learning models. We  believe that exposing a SQL database and let your consumers analyze the data in the visualization tools of their choice is a way to hell.

Read this article that explains why headless BI is the perfect fit for DataOps teams: https://medium.com/gooddata-developers/dataops-headless-bi-the-perfect-fit-2654a923ac01

Also, you can get started right now by downloading the community edition directly from the dockerhub: https://hub.docker.com/r/gooddata/gooddata-cn-ce.
Day 5 of #100DaysOfCode!

Tags: codenewbie, beginners, 100daysofcode, javascript
Published: 2021-06-20 21:55:13

<h3>Today's progress🧢</h3>
Did some more exercises on constructors from freeCodeCamp.

<h3>What I learned</h3>
*Constructors* are functions that create new objects and they define properties and behaviors that belong to the new object. 

They are to be defined with a capitalized name to distinguish them from other functions that are not `constructors`.

Here is an example of the *Car* constructor capitalized.
```javascript
function Car(){
}
```
Constructors use the keyword `this` to define properties of the object they will create. Referring to the new object they will create.
```javascript
function Car(){
   this.color = "black";
   this.make = "Lexus";
   this.model = "IS 250";
}
```
Why and How I migrated my ThinkPad from Arch to Debian
Tags: thinkpad, linux, archlinux, debian
Published: 2021-06-20 20:59:09

> This article outlines my migration from Arch Linux to Debian. The details about the migration are spanned across a few videos, but below is a reasonably short summary.

## This is basically a continuation

{% link https://dev.to/myterminal/how-i-moved-back-from-macos-to-linux-19f5 %}

Arch gave me a fresh new direction to explore and experience Linux the way I never did before. I created a couple of reusable artifacts and it in a way became a base for [my second YouTube channel](https://www.youtube.com/channel/UCbfg3_hFrOxuEtYMRGsp1ig).

## Arch was great, but...

Things kept breaking, and I found myself spending more time on fixing things than I expected, even with my prior experience with Linux before I spent four years on macOS.

{% youtube Vjue3qFEFrg %}

So I started looking out for alternatives and found the exact thing I was looking for.

## And then I installed Debian in an uncommon way

I couldn't lose the control I had over my Linux setup back with Arch by delegating it to a graphical installer. So I installed Debian in the way we usually do install Arch.

{% youtube unhRffAGE7w %}

All this learning had to be documented somewhere so I created another video talking about the process in a little bit of detail.

## This moved everything, so the gaps "shifted"

Moving to Debian meant re-setting up the entire machine, even deeper than what I had to do back when I moved the factory-installed Windows to a smaller partition to make space for my primary Linux partition.

{% youtube 2vlGNDqYdb8 %}

The new setup took away a few issues I never got fixed, and in exchange, brought with it a few other ones. I talked about the similarities, differences, negatives, and most importantly, the positives of the migration in a separate video, adding another episode to my series [Back to Linux](https://www.youtube.com/playlist?list=PLe6BbPAW-Wxgz5Jly855Aw3qWRiWqTXHO).

## Further

As I did last time, I'll keep my eyes open for ways to improve my setup and workflow, and will keep documenting my learning to be able to share them with the rest of the community.

Needless to say, I'm loving the alternate universe with Debian. Do throw in your ideas and thoughts in the comments and hopefully, we can learn something from each other.