teleren/devto huggingface dataset:
File Transform Variable Substitution using replace token task in Azure Devops
Published: 2022-07-05 10:49:26

---
title: File Transform Variable Substitution using replace token task in Azure Devops
published: true
date: 2021-07-05 10:33:37 UTC
tags: 
canonical_url: https://lkgforit.com/file-transform-variable-substitution-using-replace-token-task-in-azure-devops
---

File transform using replace token Azure Devops extension, below is the link for the extension which we are going to use in this article.

[https://marketplace.visualstudio.com/items?itemName=qetza.replacetokens](https://marketplace.visualstudio.com/items?itemName=qetza.replacetokens)

Another article with default File Transform task is available here.

[https://lkgforit.com/file-transformation-variable-substitution-and-issues-faced-in-azure-devops-yaml-3556a92de0b2](https://lkgforit.com/file-transformation-variable-substitution-and-issues-faced-in-azure-devops-yaml-3556a92de0b2)

Let's go into how we are going to use this replace token extension task in Azure Devops for variable substitution.

Below is the sample code to substitute variables from pipeline into the file where the start of end of tag/token is passed and it takes the middle content as name of pipeline variable to replace in the file with variable value in that place.

Here in this example, we are using "{#" and "#}" as tokenPrefix and tokenSuffix respectively.

In the file wherever a content starts with this prefix and ends with end token suffix then the text is replaced with the value of a variable with same text as name.

```
    - task: replacetokens@3
      inputs:
        targetFiles: "$(Pipeline.Workspace)/codepath/jsonFileName.json"
        encoding: "auto"
        writeBOM: true
        verbosity: "detailed"
        actionOnMissing: "warn"
        keepToken: false
        tokenPrefix: "{#"
        tokenSuffix: "#}"
      displayName: Perform variable substitution in json file

```

if we pass the below json file as input then it will replace pipeline variable values of variable1 and variable2 inside the tag.

```
{
  "headtag": "ens",
  "modelName": {
    "textProp": {
      "language": [
        {
          "property1": "{#Variable1#}",
          "property2": "{#Variable2#}"
        }
      ]
    }

```

For example, consider the below are variables used.

```
variables:
  variable1: "value1"  
  variable2: "value2"

```

then the output json file will be like below:

```
{
  "headtag": "ens",
  "modelName": {
    "textProp": {
      "language": [
        {
          "property1": "value1",
          "property2": "value2"
        }
      ]
    }

```

Thanks.

Refer videos in my channel for live explanations.

[https://youtu.be/\_iPfzH3ENAk](https://youtu.be/_iPfzH3ENAk)

[https://youtu.be/QxJ\_y6pV6No](https://youtu.be/QxJ_y6pV6No)

[https://youtu.be/dGLWBWZavhw](https://youtu.be/dGLWBWZavhw)

[https://youtu.be/C8t4EUV6yok](https://youtu.be/C8t4EUV6yok)

YouTube Channel

[https://www.youtube.com/channel/UCnYzqHl\_und412jN2RTjJVA](https://www.youtube.com/channel/UCnYzqHl_und412jN2RTjJVA)
[Fix] Rails Auto Increment ID Postgres Error
Tags: ruby, rails, postgres
Published: 2021-07-05 10:26:26

## Error

ActiveRecord::RecordNotUnique Exception: PG::UniqueViolation: ERROR:  duplicate key value violates unique constraint "users_pkey"
DETAIL:  Key (id)=(43957) already exists.

## Detail

You normally run into this error when you restore database from another source, for e.g. production or staging server.

This happens because of database sequence for Postgres that is stored in local machine is not the same as what comes from restored database and same id can be assigned twice when auto incrementing by Rails application.

## Solution

We can reset the sequence of the table that is stored in the local machine by Postgres to fix this issue.

1. Go to rails console
   
     `rails c`

2. Reset the Postgres sequence for the table

     You can reset the Postgres sequence with the following command:

     `ActiveRecord::Base.connection.reset_pk_sequence!('table_name')`

     E.g. Assuming the table name is **users**, you can do the following:
    
     `ActiveRecord::Base.connection.reset_pk_sequence!('users')` 

## Conclusion

After resetting the sequence of table stored by Postgres, new records will be created without any issues.

Thanks for reading. Happy Coding!

## References

- <a href="https://stackoverflow.com/a/56863898/9359123" target="_blank" rel="noopener">Rails auto-assigning id that already exists [Stack Overflow]</a> 

## Image Credits

- Cover Image by <a href="https://unsplash.com/@brett_jordan?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText" target="_blank" rel="noopener">Brett Jordan</a> on <a href="https://unsplash.com/s/photos/identity?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText" target="_blank" rel="noopener">Unsplash</a>
My 3 Month Experience in GSSOC '21 
Tags: git, github, webdev, opensource
Published: 2021-07-05 10:11:45

## What is Girl Script Summer of Code ?
GirlScript Summer of Code is the 3 month long Open Source program during summers conducted by GirlScript Foundation, started in 2018, with an aim to help beginners get started with Open Source Development while encouraging diversity.

### Who can Participate ?
If you have basic git skills or are first timers or even veteran developers, GirlScript Summer of Code would give you a taste of contributing in a long open source projects. Continuously for 3 months you will contribute to your assigned projects under guidance of experienced mentors.

#### My Experience at GSSOC '21 :
On the day of 29nd Jan, the mentor/participant registration period began. And I got my selection mail on 18th Feb which looks like this :
![Selection Mail](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/6yztewlmxl1j5s70h0r1.PNG)
After the registration closed, the selected list of projects that covered a wide variety of tech stack was announced on the GSSoC website so that going through those several projects and choosing the project which matched my tech stack became more accessible.

From a huge number of projects I worked mainly on three projects which were :
- Devternship
``` DevTernShip aims to automate a process that is usually beset by difficulties; The recruitment phase is riddled with disorientation and this makes it difficult for the onboarding interns to make heads or tails of the system.```
``` Here's where DevTernShip jumps into the picture - An Internship Onboarding platform with an innovative learning management system and intuitive performance tools, we ensure that all is 'smooth sailing' when it comes to the talent pipeline. Moreover, Augmented efficiency is brought about with a simple and robust UI, thus rendering the experience even more dynamic. ```
![scrum master](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/q74ma1hcbx9siyabw8qt.PNG)![contribution](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/x2qtuptqvxbuz443ovl4.PNG)
- Delhi Tourism
- Awesome JavaScript projects

The 3 months passed in contributing these 3 projects but there were others projects also on which I contributed and merge my pull request.
The felling when your Pull Request merges is of another level and it encourages you to work more hard and contribute to other communities as well.

At the end, I only want to say that this was a great learning experience for me. Throughout this wonderful journey, I learnt some new tech stacks, learnt how a community works, and did open source contributions to many communities. I get the guidance of some really great mentors, and connect with many fellow participants.

Thanks to GirlScript Organisation for giving me such a wonderful opportunity.😊

And ya... that's my journey, all the GSSOCER'S tell your experience down in the comment and let's grow our community for a good cause😋
Till then!

Happy Learning!!
How to create Multiple PR in GitHub
Tags: github, opensource, programming, devops
Published: 2021-07-05 10:09:39

It is the most difficult for _beginner_ to create Multiple **Pull Request** in GitHub they say that the Previous PR commit merge with it. 
## Solution:

Before following the steps given below create a PR

1. <code>git fetch --all</code>

This command will fetch all the data from upstream and origin to your local repository

2. <code>git reset --hard origin/master</code>

This is the most Important step so what happen is that our local repo contain previous commit in it so we have to remove it before new committing so we write the above command which simply reset the local repo as remote repo's master branch. This will set the local repo as the last merge Pull Request...

Watch the [Create Multiple PR to GitHub](https://youtu.be/aDyIjBb8z0w) Tutorial Video 
It will help you the best
Hope that this Post helps you
🙏🙏🙏
Toggle Hide and Show 🔥 
Tags: javascript
Published: 2021-07-05 09:53:22

{% codepen https://codepen.io/Op_Krenil/pen/qBmbOeB %} 
 what is there in my DOM(On the page)
=> some dummy text 
=>a button

what do the button actually does?
=> when ever the user click on the button for the

1. first time it will disappear the above the text
2.second time it will appear the  text back 

and this process will continue and continue 

x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x

if you find this information helpful and follow me and on codepen/instagram/dev.to and dont forget to like this page. 


https://www.instagram.com/krenilll/
Feedback is almost never wrong (100 Bytes Of Wisdom: Day 60)
Tags: career, journey, advice
Published: 2021-07-05 09:50:52

---
title: Feedback is almost never wrong (100 Bytes Of Wisdom: Day 60)
published: true
description: Bytes of Wisdom is a new project by Sam Jarman that brings together snippets of advice for software engineers
tags: career, journey, advice
//cover_image: https://direct_url_to_image.jpg
---

![Feedback is almost never wrong](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/c7m5hfxvm9tshpdgsi5d.png)


This might be a contentious statement to make – but I actually don't think most feedback is wrong. I see it one of two ways. 
First – you genuinely have a behaviour to change. You may verify this with a manager or another colleague to confirm, but the behaviour change is needed for a better team.
Second – you're doing the thing they said you're not - so you have work to do in changing the feedback giver's impression. This may be more communication, more demonstration of that behaviour or something else. But prove to them, over time,that you're doing what they wanted you to.

There are rare cases where its straight up wrong, but usually I go digging in those cases to see where that feedback is coming from and usually find the real action item for both of us underneath a few layers of feelings.

Heads up: As with any terse bit of advice, there will be exceptions of course, and subtleties and nuance that can't possibly be captured in a Byte of Wisdom. This has been what I've experienced, I'd love to hear yours in the comments too!

You can catch up with all the other bytes at http://bytesofwisdom.com/
Something is missing?
Tags: javascript
Published: 2021-07-05 09:46:19

// Write your program here, create suitable objects and put them in the args variable, so that the following code can work normally



let result;
if(args.op=="+"){
	result=args.n1+args.n2;
}else if(args.op=="-"){
	result=args.n1-args.n2;
}else{
	result="Not supported";
}
console.log(result);



Please help me to answer the masters and gods
Radio Tabs Component with Alpine.js & Tailwind
Tags: tailwindcss, uiweekly, webdev, html
Published: 2021-07-05 09:28:10


#Introduction
Radio buttons are pretty common on the web. It's a tiny bit harder to style them and have your custom radios. But if you do, that adds to making your UI just that much more attractive.
In this article, I'll talk about how I built "radio tabs" with Alpine.js. So what are radio tabs? Consider them as radio buttons that look and feel like tabs.
#Source Code & Preview
You can have a look at the source on my GitHub Repo:
https://github.com/zaxwebs/tailwind-alpine/blob/main/radio-tabs.html
To try it out live:
https://tailpine.netlify.app/radio-tabs.html
#An Explanation
I recommend going through the code on the repo as you read ahead.
##Design
Each radio button resides inside it's label. To hide the "radio button" I use `class="hidden"` and is then referenced with a `for` on the label that points to `id` on the button.
The whole group (outer div) of buttons has `.inline-flex` among other classes, this is to stack the radios side by side.
There's also a padding on this div except on the right. Why? The radios have a `padding-right` that's the same.
##Functioning
The radio buttons are built off of an array using Alpine.
```js
function radioTabs(name, radios) {
	return {
		name,
		radios,
	}
}
```
This is then used as x-data for the outer div.
```html
<div x-data="radioTabs('direction', directions)">
```
x-for then loops over a template to generate the labels consisting of radio buttons.
```html
<input
type="radio"
class="hidden"
:id="radio.id"
:value="radio.value"
:name="name"
x-model="selectedDirection"
/>
```
In case you were wondering, this is what the directions array looks like:
```js
const directions = [ { id: "radio-tab-direction-e", value: "East", label: "East" }, { id: "radio-tab-direction-w", value: "West", label: "West" }, { id: "radio-tab-direction-n", value: "North", label: "North" }, { id: "radio-tab-direction-s", value: "South", label: "South" }, ]
```
And that's sort of the general idea of it.
#Use Cases
I recently used this for a comparison table, you can use radio tabs for similar such instances to add to the overall appeal.
Here's how it looks:
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/a4x2v4jo8v3lm42d5x40.png)
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/bwrhwwcslfqzitfffj4c.png)

#That's it!
Thank you for taking the time to read and check out this experiment/project. There's more Alpine and Tailwind related things up on my [Github repo](https://github.com/zaxwebs/tailwind-alpine) & live on [Netlify](https://github.com/zaxwebs/tailwind-alpine).
jQuery and Bootstrap
Tags: jquery, javascript, bootstrap, fail
Published: 2021-07-05 09:25:06

Last weeks I commenced one new project. Actually, not new but to remake an old website. And I wanted to keep some of the functionalities from the old project.  They have been simple AJAX functions build on jQuery.

And in the poject I kept the old jquery.js file. 
`<script src="/js/jquery.js"></script>`
And then the fail appeared.

###The error
Some of the features I needed from Bootstrap started to throw out some errors and didn't work properly:

![alt text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/rqy7yw2cd19h872ppgod.png)
 

###The attempts
Then I started searching on internet. Of course, Stackoverflow was the first source. :)
https://stackoverflow.com/questions/28795036/jquery-javascript-not-working-in-bootstrap
Some of the answers were like this:
![alt text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/cz55pretni6oq8et53qy.png)
or like this:
> use the .text() function instead of the .html()

Other answers here: https://stackoverflow.com/questions/51128079/jquery-doesnt-work-with-bootstrap/51129632

The idea is that some of these answers could fix some problems. But not mine.  

###The solution
First of all, it was a mistake keeping this jQuery.js file on my server. This version of jQuery was too old, I think. Actually, I'm sure about that. The second, this solution  of keeping the jQuery file on my server it is not one of the best practices.
I just wanted to update my version of jQuery first and to see what to do next. So instead of
`<script src="/js/jquery.js"></script>`
I put
`<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>` 
And when I checked the all bootstrap functionalities I needed worked.
What's your major irritation when job hunting
Tags: jobhunting, hiring, recruitment, startup
Published: 2021-07-05 09:21:06

It's hard to tell which is more depressing:
 
The traditional Radio Silence treatment that professionals get from employers.

or 

The short, unfriendly email message containing some variation on the sentiment "Your background does not meet our needs,   but feel free to apply again. (Or drop dead – either way.)." 


We want to hear from you, please feel free to share.
A Quick Guide On Missing Data Imputations Techniques In Python
Tags: python, datascience, machinelearning, computerscience
Published: 2021-07-05 08:49:06

Topic: A Quick Guide On Missing Data Imputations Techniques In Python

https://medium.com/analytics-vidhya/a-quick-guide-on-missing-data-imputation-techniques-in-python-2020-5410f3df1c1e


Missing values in your dataset can be a headache, but do you know there are many techniques python offers to tackle missing data problems.

There are many libraries using which we can impute data in the dataset. Using proper technique at correct problem statement is not a difficult task at all.

Still, if you are not aware of certain data imputations techniques, here is an article I wrote to help you guys. Go through it and do share it with your friends who are struggling with missing data.
The easiest way to get started with AWS regardless of your background
Tags: aws
Published: 2021-07-05 08:05:34

AWS was a life changer for me. I still remember the day I stumbled across it, it was shortly after the first iPhone had been released - I remember talking to a PHP developer who was storing images in something called 's3' object storage.

![I had no idea what he was talking about](https://media.giphy.com/media/3o6Yg4GUVgIUg3bf7W/giphy.gif)

But I was like, 'oh yeah - the s3's of course'. Then, I scuttled home to Google it as fast as I could. Hmmm that's interesting I thought, then I closed my laptop and didn't bother with it again, VDI was the future 🤦🏻‍♂️.

Fast forward 4 years, I was sat in the office at News International in London (the business was on a drive to transition from a paper company to a digital media powerhouse) and our new CTO was introducing AWS and what services we would be migrating over to it, compute was available through EC2, S3, CloudFront, a simple version of RDS amongst others. 

![I had to learn this](https://media.giphy.com/media/5550zJj6nF6pO/giphy.gif)

I had to get involved.

Now, for anyone out there looking to get into tech, enterprise IT, web development, start-up tech etc whatever your background, AWS is a great place to start and the simplest way to experience it today is through AWS LightSail. You can have your own Linux, Windows instance up and running in minutes. Here is how:

First, you need an AWS account.

AWS have a nice how-to article [here](https://aws.amazon.com/premiumsupport/knowledge-center/create-and-activate-aws-account/)

Once you have been through that process then you are ready to get started with AWS LightSail which is a simple flow to get you from zero to online with a Linux or Windows EC2 instance without the steep learning curve of VPC configurations, availability zones, IAM policies, security groups and internet gateways.

![phew that sounds complicated](https://media.giphy.com/media/l4FATJpd4LWgeruTK/giphy.gif)

Let's do it:

Sign in to the AWS console.

Select 'LightSail' from the menu

![Screenshot 2020-12-03 at 15.10.01](https://www.theelastic.guru/remoteimages/i/p6n13hr3ryjcjq0cdgye.png)
 
Hit create instance

![Screenshot 2020-12-03 at 15.10.23](https://www.theelastic.guru/remoteimages/i/rea98wv2x4rmbuyfcq9j.png)
 
Select Windows and then Windows Server 2019

![Screenshot 2020-12-03 at 15.11.34](https://www.theelastic.guru/remoteimages/i/qo5wzzpj4s01zr9ti1ev.png)
 
Choose your plan

![Screenshot 2020-12-03 at 15.11.41](https://www.theelastic.guru/remoteimages/i/k8s1xv6jmnyx57fmgt1z.png)
 
Name your instance

![Screenshot 2020-12-03 at 15.12.18](https://www.theelastic.guru/remoteimages/i/psviz8zu2j84pmocbtgd.png)
 

Hit create instance.

Once created, you'll be presented with a screen that allows you to connect directly to you instance through a browser or via an RDP session.

Job done 🤓 You are now rocking an AWS instance that would have taken days of configuration for experts only back in 2008.
Stack DataStructure in JS
Tags: stack, datastrucutre, javascript
Published: 2021-07-05 07:02:36

##### // hello virtual folks !

####### Lets give a shot to Stack without further ado 

Stack as everybody know what it means Stack is nothing but a vector representing a list of elements  that follows a particular order that is LIFO while they are deleted or removed or printed out .

Here is the code for the Stack implementation 

```javascript
// Stack Is nothing but a vector that follows LIFO order , it has // push , pop and peep as main Functionalities


// defining a class stack first off all 

class Stack {
    // array(vector) is used to implement the stack 

        constructor(){
            this.items = [];
        }

}
```

Now lets add the code for Push and Pop operation and also Peek 

```javascript
  // now lets create a push function
    
        push(element){
            // push element 
            this.items.push(element);    
        }

```
Now we will see how to add code with Pop operation !

```javascript
   pop(){
            if(this.item.length == 0){
                return (" UNDERFLOW");
            }
            return this.items.pop(element);
        }
```

Now here let me take a second of your's and say you why we are checking the condition 

#### if the array is empty the pop function inside the code of stack will be having no values to delete  when we solve the question by pointers we take the pointer condition as top = -1 and then we start pushing the values in it by adding pointer to 1 each time we add values to it 

#### similarly we also need to keep an eye for removing the top element every time in the stack if the stack doesn't contains any value on the vector then it will return us the result of the if part of the code that is Underflow ! and if stack is not empty it will return us the result that we opt for that is the deleted value or element .

 Now we see  here how to write code for the peek 

```javascript
 // peek  return's the top most element but does not delete it 

        peek(){
            return this.items[this.items.length - 1]    ;
        }
```

here is a small additional code for printing the stuff out one by one in Stack datastructure

```javascript

  // printStack 
        printStack(){
        var str = "";
        for (var i = 0; i < this.items.length; i++)
            str += this.items[i] + " ";
        return str;
    }

```

feel free to play around through the code and get your hands dirty on this !

```javascript
// adding element to the stack for purpose of test 

var stack = new Stack();

stack.push(20);
stack.push(30);
stack.push(50);
stack.pop();
stack.peek();


console.log(stack.printStack());
   
```

I hope you can get started with the implementation if you were stucked after learning the concept of Stack data Structure Hope you find it interesting , untill then G00D Bye !
Web Scraping Yelp with Beautiful Soup
Published: 2021-07-05 06:58:12

Today we are going to see how we can scrape Yelp data using Python and BeautifulSoup is a simple and elegant manner.

The aim of this article is to get you started on real-world problem solving while keeping it super simple so you get familiar and get practical results as fast as possible.

https://youtu.be/WZxLHYHXJJw
How to Set Proxy Server Address in Mac
Published: 2021-07-05 06:57:40

This will open Mac's system proxy preferences page. Select Web Proxy (HTTP) or Web Proxy HTTPS or Both based on the type of proxy server you have available. Enter the IP and port of the proxy. Make sure you enter the username and password for the proxy if it needs it.
https://youtu.be/gIagDfnK3jo