teleren/devto huggingface dataset:
GeekWeekLocal
Tags: gfglocal
Published: 2021-03-20 08:54:28

Geek Week: Local is a week-long hackathon of creating hacks, solving problems, and building profiles both big and small. Choose between daily and week-long challenges that vary in difficulty, so whether this is your first time coding or you’re a seasoned expert, Geek Week has something for you. The more challenges you conquer, the more points you’ll earn and make your position on the leader-board.

Geek Week: Local taking place from 14/03/21 to 21/03/21.
During this time, you can expect challenges for all skill levels. These challenges can be completed on your own time, and new ones will be released each day on our website! Once the daily challenges are announced, you’ll have 24 hours to complete and submit them in order to earn those points on the leader-board.

If the daily challenges aren’t quite your speed, there will also be plenty of week-long challenges you can complete at any time. These will range from quick technical challenges to task

WHAT WE LEARNED ?

Power of Patience
During coding, we got many obstacles. One of the major obstacles is the error in the code. But after we practiced writing enough codes and learned to find out the errors, we developed a quality of patience to calm our minds and think sensibly because this is a critical factor in finding the fault.

Power of Perspective
Coding or solving questions helps us understand the world from a different perspective. While solving coding questions, many problems require a different perspective. With practice, you gain experience, and with experience, you gain perspective; it’s as simple as that.

Power of Logical Thinking
Coding helps strengthen your thinking capability as many difficult questions need healthy thinking to crack it.
📍Minimize the maximum difference between heights📍
Tags: tutorial, todayilearned, discuss, programming
Published: 2021-03-20 08:52:11

**Question :** 

Given an array **arr[]** denoting heights of **N** towers and a positive integer **K**, you have to modify the height of each tower either by increasing or decreasing them by **K** only once. After modifying, height should be a **non-negative** integer. Find out what could be the possible minimum difference of the height of shortest and longest towers after you have modified each tower.

**Example 1:**

```
Input:
K = 2, N = 4
Arr[] = {1, 5, 8, 10}
Output:
5
Explanation:
The array can be modified as 
{3, 3, 6, 8}. The difference between 
the largest and the smallest is 8-3 = 5.
```

**Logic:**

1. Naive Approach O(n logn): 
    - The idea is to sort all elements increasing order. And for all elements check if subtract(element-k) and add(element+k) makes any changes or not.
    - Below is the implementation of the above approach:
    - Sort the given array
    - after sorting declare 3 variables namely
    - ans = last element - first element
    - small = first element + k
    - big = last element - k
    - place pointer on second element and subtrack  = arr [ i ]  - k and then add = arr [ i ] + k
    - if add < big do nothing
    - if subtrack > small do nothing
    - at last return min ( ans, big-small)

```java
import java.util.*;

public class Solution{
    public static void main(String args[]){
        Scanner sc = new Scanner(System.in);
        int k = sc.nextInt();
        int n = sc.nextInt();
        int arr[] = new int[n];

        for(int i = 0; i < arr.length; i++){
            arr[i] = sc.nextInt();
        }

       if (n == 1)
        return;

        // Sort all elements
        Arrays.sort(arr);

        // Initialize result
        int ans = arr[n-1] - arr[0];

        // Handle corner elements
        int small = arr[0] + k;
        int big = arr[n-1] - k;
        int temp = 0;

        if (small > big)
        {
            temp = small;
            small = big;
            big = temp;
        }

        // Traverse middle elements
        for (int i = 1; i < n-1; i ++)
        {
            int subtract = arr[i] - k;
            int add = arr[i] + k;

            // If both subtraction and addition
            // do not change diff
            if (subtract >= small || add <= big)
                continue;

            // Either subtraction causes a smaller
            // number or addition causes a greater
            // number. Update small or big using
            // greedy approach (If big - subtract
            // causes smaller diff, update small
            // Else update big)
            if (big - subtract <= add - small)
                small = subtract;
            else
                big = add;
        }

        System.out.println("Answer is: " + Math.min(ans, big - small));
    }
}
```
Geek Week :Local
Tags: coding, programming
Published: 2021-03-20 08:49:01

Coding or solving questions helps us understand the world from a different perspective. While solving coding questions, many problems require a different perspective. With practice, you gain experience, and with experience, you gain perspective; it’s as simple as that.
Coding helps strengthen your thinking capability as many difficult questions need healthy thinking to crack it. We also need logical thinking. Before solving a problem, we have to id
geek week local
Tags: geekweeklocal, event, sharing, learnings
Published: 2021-03-20 08:35:01

Today, geek week local event is going to bind up today. This event was very helpful to us. We learnt here many new things such as machine learning , artificial intelligence , data structure and algorithms, many coding websites, android studio , GitHub, lobe, excel, data visualization, and many things. We have made many profiles on many social media platforms.
#GWLexperience 
Published: 2021-03-20 08:30:52

GEEK WEEK : LOCAL was a week long event (14/03/2021 - 21/03/2021) organised by GeeksforGeeks VIT, Bhopal student chapter which was sponsored by numerous sponsors including interview cake, commudle, streamyard, bade log, coding blocks, sashido, repl.it etc. various guilds participated in the event with 100 members each. the top guilds of the event were god speed x munna bhaiya ki fauj, server monks, bug busters and raw bits. for the 7 days, all the participants had to submit the tasks that were assigned to them and based on that, the scores were given and the guilds were ranked. some inter guild tasks included having a meal with guildmates, sharing tea with guild mates and playing games such as skribbl. all of it built a sense of belonging and unity among the guild mates and helped them bond with each other. the event was pretty fun and taught a lot of stuff both technical as well as non technical.
7-days on a tray. 
Tags: geekweeklocal
Published: 2021-03-20 08:29:39

What to start with? This week has been nothing but an exciting adventure at the start of my career in computer science. From writing a simple 'Hello World' program at the start till programming Data-Structures towards the end. It has helped me to learn a lot. 

Let's start with the best thing the organizing team has done for us:
It was giving tasks not only to be a computer geek, but also to become a socially active and cultural geeks too. The tasks were never always to write a code and bore yourself for the whole day, but also to take a break and enjoy yourselves with the music and memes too. The task were not only to learn the specials of computer science, but also to learn how to work as a team. 

The outcomes of this week challenge has been great. I have learnt how to code without stressing yourselves. I have learnt how to enjoy whether by going live on the mini-event or by playing with the teammates. I have learnt that taking a break from daily work and listening to music or doing what you love can never be a distraction, it is always a relaxation. I have learnt that being a complete stranger does not mean you cannot be open and be yourself to your stranger teammates; after all, they too are your friends just that you haven't met them until now. And lastly, I have also learnt, it is fun competing to get on top by putting extra efforts. 

Honestly speaking, this week has been a challenge as well as a perfect learning opportunity I grabbed in my whole life. A disease outbreak can never be a hindrance to what we want to learn. We are united by the internet, and ladies and gentlemen that unity gave us the chance to a very cool learning opportunity.
Allianze BPO International
Published: 2021-03-20 08:29:05

Allianze BPO, is a renowned and one of the globally top-ranked outsourcing service provider, catering to the requirements of numerous clients on a daily basis. 
We have been in the industry with the best team of data entry operators and employees. We strive hard to deliver the accurate, consistent, and 
quality-enriching output with the best utilization of the state-of-the-art technology and the advanced tools and software. The primary services we offer are BPO services, 
EPublishing Services,Data Analytics, Market Research, Scanning and Indexing Services, and Data Management Services, which are delivered within a cost-effective budget.
We are waiting to create a friendly and healthy professional relationship with our clients, on a long-term basis. We believe that our business connections are built on extensive trust and 
respect. 

drop us an email at support@allianzebpo.com 

https://www.allianzebpo.com/
Offshore India Data Entry
Published: 2021-03-20 08:22:21

Offshore India Data Entry is a well-recognized BPO outsourcing company, rendering cost-effective and quality-focused solutions to the clients based in and out of the US. 
Being one of the reputed back-office service providers, we are well-specialized in handling business process management (BPM), data entry & data processing, web research, 
data collection, image editing, scanning & indexing and mortgage & foreclosure services.

Email: support@offshoreindiadataentry.com

https://www.offshoreindiadataentry.com/
Markdown Syntax
Tags: beginners
Published: 2021-03-20 08:11:49

For a main heading us a single #

#This is main heading (h1)

For a sub heading use a double ##

##This is a sub heading (h2)

Just type normally for a paragraph.

This is a paragraph.

For bold use \** at the start and end of the bolded section.

**This is bold** 

For italic use \_ at the start and end of the italicized section. 

_This is italic_

For strikethrough use \~~striked 1~~

For a smile emoji type \:smile: without the space between the colons 

This is an emoji :smile:

Horizontal rule --- doesn't see to work so I used \<hr>\</hr>

<hr></hr>

For a blockquote use "> blockquote"

> blockquote

1. This is an ordered list.
2. This is 2nd item on the list.
3. This is the third item.
Summarizing Namaste 🙏 JavaScript EP04 (How functions work in Js and Variable environment )
Tags: javascript, help, functions, namastejavascript
Published: 2021-03-20 07:58:40

Thank you Akshay Saini for this beautiful series. Just summarizing your lessons for whenever I need a quick recap. Same for others. Hope it helps.

![image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/v4774i6ct4rnv61azmh2.png)

On right side is Js code and on left side is the output.
Now, we will discuss line by line how this Js code is executed.

![image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zgybskiuyl9hnvccrd1r.png)

As we know, execution context goes through two phases.
During memory allocation phase, 
**x: undefined
a: {...function body...}
b: {...function body...}**

During code execution phase, Global execution context is pushed into the Js **Call stack**.
When line 1 is executed,
**x: 1**
Since we know that whenever a function is invoked, a new execution context is created.
When line 2 is executed,

![image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xwc6nc3xtufa6vn1zdjl.png)

We can see in the left bottom that in call stack section, execution context named **a** is pushed into call stack above **anonymous (Global execution context)**
It goes through same phases and logs the value of **x** as 10.

After completion, **a** is popped out of call stack and line 3 is executed.

![image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/a0kb9r2yg5dwglqeu9nw.png)

We can see in the left bottom that in call stack section, execution context named **b** is pushed into call stack above **anonymous (Global execution context)**
It goes through same phases and logs the value of **x** as 100.

After completion, **b** is popped out of call stack and line 4 is executed.

Since at start, the value of **x** is assigned 1 in the local scope of Global execution context, it logs the value of **x** as 1.

This is the reason why it logs result 10, 100 and 1.
Task force week three
Tags: awesomitylab, codeofafrica, teambuilding, educational
Published: 2021-03-20 07:54:38

Greetings,

Third week down at the task force,  the week was fun, interesting and upskilling.

I understood more about project management tools alongside user stories and acceptance criteria. At the task force we are using jira, through the presentation of the task force team I understood that the project features must have a well defined sprint, epics, user stories and  a clear acceptance criteria in order to manage big teams and satisfy our clients both in quantity and quality. 

Speaking of the team I got a chance in this week to know the personality of the task force team as well as mine through the help of 16 personalities test, I know how each member may contribute on our team to become more productive. A productive team always has a team culture and each member must be a fit in that team culture. Thanks to Anja who worked us through team culture and cultural fit. I am looking forward to creating our team culture with my teammates.

It’s crucial for the a successful team to be having a high level of critical thinking, thanks to Olaf who taught us 5 why’s and paddle board which will help us to gather information, analyze them and come up with efficient solutions. Not only a high level of critical thinking but also strong communication between team members. I really enjoyed the Friday session with Anja, I took it as an introduction to remote communication and remote work. We did a number of exercises and used different platforms like wonder which made me feel like I was physically with the team. I am excited to keep learning more about remote workspace.

This week like past weeks was educational and fun. I am really excited for the coming weeks.
Fading images using JavaScript
Tags: javascript
Published: 2021-03-20 07:54:08

The other day, I worked on a pretty simple HTML website and wanted to have some fading images but not bloatware of JavaScript plugins.

Hence I tried how easy this could be with some simple Vanilla JavaScript and CSS.

I'll show you the most straightforward way, which does involve background-images, we could achieve this with actual images, but we'll try that in another article.

You can see the result for this article in the following Codepen.

{% codepen https://codepen.io/rebelchris/pen/dyOrKvL %}

## HTML Structure

Let's first look at the `HTML` structure we need for this.
It comes down to a simple placeholder.

```html
<div id="fadingImage" class="image-styled"></div>
```

As you can see, I added an `ID` to use as a JavaScript selector and a class to add some styling.

That will all for our HTML structure. You can work around this, as a single div will be all we need.

## Styling the image

Now let's add some styling to our image. As you could see in our HTML, I added the `image-styled` class.

This will be the final CSS:

```css
.image-styled {
  background-position: center;
  background-size: cover;
  background-image: url("img.jpg");
  display: flex;
  height: 75vmin;
  width: 75vmin;
  transition: background 0.5s linear;
}
```

The main elements are the background tags, which will style the image nice and centered in our div.
We then use flex and viewport queries to make it appeal nicely.
The last line with the `transition` will make sure it smoothly fades between the images.

You can leave the transition if you want a simple, immediate switch of the images.

## Replacing images with JavaScript

We will be using JavaScript to replace our image.
First, let's define an array of images, starting with the one we used in CSS.

```js
const images = [
  "img.jpg",
  "2.jpg", 
  "3.jpg"
];
```

Then, we'll also need to have a reference to the image element.

```js
const imageEl = document.getElementById("fadingImage");
```

The next part will bring it together. We will be using the setInterval method in JavaScript to execute code every x time.

In our case, 5000 milliseconds, you can alter this in any way you like.

```js
window.setInterval(changePicture, 5000);
```

That piece of code will call a function called `changePicture` every 5000ms. 
Let's create the `changePicture` function now.

```js
let i = 0;
function changePicture() {
  i++;
  if (i > images.length - 1) i = 0;
  imageEl.style.backgroundImage = `url(${images[i]})`;
}
```

What we do here is firstly create a variable counter that is set to the first element.

Then inside, we plus the counter, if it hits the number of images, we defined we reset it to zero.

> We use zero because arrays start at 0

Then we modify the background image of the div.
Because we used the transition in CSS, it will give us a fading effect.

### Thank you for reading, and let's connect!

Thank you for reading my blog. Feel free to subscribe to my email newsletter and connect on [Facebook](https://www.facebook.com/DailyDevTipsBlog) or [Twitter](https://twitter.com/DailyDevTips1)
Introduction to Machine Learning
Tags: machinelearning, ai
Published: 2021-03-20 07:44:53

Let’s say you’re about to face the big boss in a video game. You charge forward … and get flattened. Next time, you might try pausing first… and not getting flattened. You’re learning and improving. Until finally, you can beat the level.

That’s the idea behind machine learning, a form of artificial intelligence. Traditional computers can’t fix problems on their own. But with machine learning, they can learn from past data – past results – and make better decisions in the future. On lots and lots of scenarios at once, to improve at incredible speeds.

Ever get product recommendations when you shop with a retailer online? Notice that the suggestions tend to be pretty accurate. That’s machine learning – the retailer’s AI is always getting better at figuring out what you’re likely to buy, even as your tastes evolve.

Hope you enjoyed this human learning about machine learning.
🚨Cyclically rotate an array by one🚨
Tags: tutorial, discuss, todayilearned, programming
Published: 2021-03-20 07:39:15

**Question :**

Given an array, rotate the array by one position in clock-wise direction.

**Example 1:**

```
Input:
N = 5
A[] = {1, 2, 3, 4, 5}
Output:
5 1 2 3 4
```
**Logic:**
1. Traditional Approach: 
    - take the input as array and t as no of rotations
    - rotate the loop from 0 to t
    - store the last element in temp and run loop in reverse order till 1st location ( arr [ 1 ] )
    - shift arr [ i ] = arr[ i - 1 ]
    - put temp in arr[ 0 ]

```java
import java.util.*;

public class Solution{
    public static void main(String args[]){
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int t = sc.nextInt();
        int arr[] = new int[n];
        for(int i = 0; i < arr.length; i++){
            arr[i] = sc.nextInt();
        }

        for(int i = 1; i <=t ; i++){
            int temp = arr[arr.length-1];
            for(int j = arr.length-1; j > 0 ; j--){
                arr[j] = arr[j-1];
            }
            arr[0] = temp;
        }

        for(int i = 0; i < arr.length; i++){
            System.out.print(arr[i]+" ");
        }
    }
}
```
How to use node_modules path or third party assets in angular files.
Tags: angular, webdev, tooling, fronted
Published: 2021-03-20 07:34:42

Some times we need to use assets from node_modules in our angular project files.

For example, you are using a third party package and you want to import css files from it in your `index.html`

If you try to import like this, it gives error:
```
<link href="./node_modules/some_packge_name/assets/style.css">
```

So how to resolve this issue ??

We can tell angular to copy required files in build.

We can add `glob` in *angular.json* for `assets`:

```
build": {
          .....
           "assets": [
...
              {
                "glob": "**/*",
                "input": "./node_modules/some_packge_name/assets",
                "output": "./custom-assets"
              }
            ],
...
}
```
`input`: Path of your `assets` folder in *node_modules*
`output`: Path you want to use in your application.

now we can use it in our `index.html` as below:

```
<link href="./custom-asssets/style.css">
```

If you want to use images from some package, you can use it as shown below:

```
 <img src="/custom-assets/some-img-file.png" />
```

Hope you guys find these resources hopeful!
⚖️ Segregate negatives and positives ⚖️
Tags: tutorial, programming, todayilearned, discuss
Published: 2021-03-20 07:32:32

**Question:** 

An array contains both positive and negative numbers in random order. Rearrange the array elements so that all negative numbers appear before all positive numbers.

**Examples:**

```
Input: -12, 11, -13, -5, 6, -7, 5, -3, -6
Output: -12 -13 -5 -7 -3 -6 11 6 5
```

**Note:** Order of elements is not important here.

**Logic:**

1. Sorting : 
    - Take the input as the array
    - sort the array. ( Either inbuilt or self implemented )
    - all the negatives will be seperated from the positives

2. 0 Reference : 
    - Take the input as array
    - Declare two pointers i and j
    - i will move from arr [ 0 ]th location to arr [ arr.length - 1 ]th location. in this it will check if arr [ i ] < 0 and i is not equal to j . if yes, then it will swap arr [ i ] and arr [ j ]
    - if no, then it will simply increment j
    - when both i and j will reach the last position, the loop will stop
    - print the array

```java
import java.util.*;

public class Solution{
    public static void main(String args[]){
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int sortArr[] = new int[n];
        int zeroRef[] = new int[n];
        for(int i = 0; i < sortArr.length; i++){
            sortArr[i] = sc.nextInt();
            zeroRef[i] = sortArr[i];
        }

        //This is sorting solution
        Arrays.sort(sortArr);
        System.out.println("Segregation through sorting is: ");
        for(int i = 0; i < sortArr.length; i++){
            System.out.print(sortArr[i]+" ");
        }
        System.out.println();

        //This is 0 reference solution
        int j = 0;
        for(int i = 0; i < zeroRef.length; i++){
            if(zeroRef[i] < 0){
                if(i != j){
                    int temp = zeroRef[i];
                    zeroRef[i] = zeroRef[j];
                    zeroRef[j] = temp;
                }
                j++;
            }
        }

        System.out.println("Segregation through 0 reference method is: ");
        for(int i = 0; i < zeroRef.length; i++){
            System.out.print(zeroRef[i]+" ");
        }
        System.out.println();
    }
}
```