teleren/devto huggingface dataset:
How to add a path to environment variable?
Tags: windows, path, installer
Published: 2020-12-16 06:06:12

Hello, everyone.

# Introduction

How do you add/delete the path to/from `Path` environment variable in your installer?

In fact, I released the version 0.17.0 of [Kinx](https://github.com/Kray-G/kinx) and I implemented an installer.

![Installer](https://github.com/Kray-G/kinx/raw/master/docs/InstallerWelcome.png)

But the path will **NOT** be added to the environment variable.

> After wrote this article, I released v0.17.1 which automatically adds the path to the `Path` environment variable. I did also write a test code for `addpath.exe`, but I will be glad for you to review the source code anyway. Thanks in advance.

I researched how to do it on the web, but I didn't find it as I want. I was searching it with...

* Simple Source Code
* Easy to Use
* Useful License

I wanted to use it in the NSIS script, but there seems to be some problems in NSIS.

# Conclusion

I created a simple program. Look at this.

* https://github.com/Kray-G/addpath

This is...

* Simple Source Code ... **Just one file** there!
* Easy to Use ... **Simple command line interface** to use.
* Useful License ... That is **MIT**! ...did set it by me, although.

# But...

This program will modify the system environment, so I feel a little **scared**. Therefore I want a lot of people to check the source code and I want to fix a problem if there is a problem.

If you are interested in it or you have time, I will be very happy for you to look at the source code.

And also, please let me know if you have any better solution for this problem.

See you!

P.S.
If you feel good to [this](https://github.com/Kray-G/addpath), please push a star!
Creating Postman Scripts
Tags: webdev, testing, tutorial, beginners
Published: 2020-12-16 12:45:12

In this post, we will be creating Postman scripts to get/set variables and make API requests using Postman scripts.

### **Get access to variables**
Postman allows you to get access to the variables that you have created within the scripts. Let’s take a look at an example for that –

```
pm.variables.get("variable_key");
```

You can even access variables that were created outside the request level scope i.e global, environment, collection level, etc.

### **Set variables using Scripts**
Not only you can get access to variables, but you can also set variables within the pre-request or the test script. Let’s take a look at an example for that –

```
pm.collectionVariables.set("variable_key", "variable_value");
```

Depending on the scope set for the variable, you can access it accordingly.

---

### **Making API request in the Pre-request script**
Using the pre-request script, you can make an API request to get the data you need from the response and pass that along to your request dynamically. Let’s take a look at an example for that –
```
pm.sendRequest(`${baseUrl}/users`, function (err, response) {
    pm.variables.set('user_id', response.json()[0].id)
});
```
In the above example, I am making a call to the /users API to fetch all the users and get the id for the first user and set it to the user_id variable. This variable can then be passed to the request instead of hard-coding the user id each time.

---

### **Check out the video below to learn more about Postman Scripts –**
{% youtube jvYP3ODEY00%}

---

#### To learn about API Test Automation using JavaScript, check out my free tutorial series here –
[JavaScript API Test Automation Tutorial Series](https://www.youtube.com/watch?v=ZSVw3TyZur4&list=PL6AdzyjjD5HDR2kNRU2dA1C8ydXRAaaBV)

---

📧 Subscribe to my [mailing list](https://automationbro.com/mailing-list) to get access to more content like this 
👍 Follow @automationbro on Twitter for the latest updates

...

I love coffees! And, if this post helped you out and you would like to support my work, you can do that by clicking on the button below and buying me a cup of coffee -

<a href="https://www.buymeacoffee.com/automationbro">![Buy me a coffee](https://dev-to-uploads.s3.amazonaws.com/i/4aw2ub3f4qkyjk0ivwt4.png)</a>

You can also support me by liking and sharing this content.

Thanks for reading!
Why to learn Golang
Tags: go, language
Published: 2020-12-16 12:44:38

**GO** (Golang) was released by Google in 2009. What makes it unique and different from other well-known languages?

First of all, it’s easy to learn and read, especially for an experienced developer. It’s a minimalistic language which  <a href="https://golang.org/ref/spec">documentation</a>  contains about 50 pages. 
Secondly, there are many successful examples of Google supported web applications such as Uber, Twitch, and SoundCloud. This is not a trend, but a reliable and perspective language. Docker, Kubernetes is written on it. Because of this, knowledge of this language will be beneficial for DevOps specialists.
The next reason is the Go community. It’s open-source, and that can make your work more productive. 
One of the most significant advantages of Golang is its speed and lightweightness.  
Specialists note that Go is safer than Java because of its strong typization.
It has efficient program construction – which provides packages and code separation that are easy to manage.
Go’s built-in frameworks make testing and profiling smoother, almost intuitive.
And finally, Go language is versatile – coders use it to develop all kinds of modern software.

Over the decade, Golang's versatility and user-friendliness increased its popularity, and <a href="https://blog.golang.org/survey2018-results">Stack Overflow's 2018 survey</a>  found it one of the top-5 most popular languages among developers. 

Nowadays, Golang's popularity is still growing. Many developers choose to learn it, and in 2021 there will be more senior and junior specialists.

How to start learning Golang? The most popular <a href="https://tour.golang.org/welcome/1">basic course </a> was made by Go creators.

Learn in <a href="https://exceed-team.com/hire-developers/hire-golang-developers">the original article</a> what a senior Go developer should know and what questions an employer can ask during the interview.
Advent of Code 2020: Python Solution Day 16
Tags: adventofcode, python, challenge, algorithms
Published: 2020-12-16 12:43:54

This is day 16 and again we have to parse tickets. First part was not that hard but second one was challenging and I took a help from [here](https://github.com/jakobsen/advent-of-code-2020/blob/master/16.py).

**Please share your solutions too.**

```python
rules = []
my_ticket = []
nearby_ticket = []
tickets = []

temp = []
for i, line in enumerate(lines):
        
    if line != "\n":
        temp.append(line.rstrip())
    elif line == "\n":
        if len(rules) == 0:
            rules = temp
            rule = {v.split(": ")[0]: v.split(": ")[1].split(" or ") for v in rules}
            rules = {}
            for k,v in rule.items():
                v = [list(range(int(i.split("-")[0]), int(i.split("-")[1])+1)) for i in v]
                v = [i for k in v for i in k]
                rules[k] = v

            temp = []
        if len(my_ticket) == 0:
            my_ticket = temp
            temp = []
if len(nearby_ticket) == 0:
    nearby_ticket = temp
    nt = [v.split(",") for v in nearby_ticket[1:]]
    nt = [int(i) for j in nt for i in j]
    nearby_ticket = nt
    mint = lambda l: [int(i) for i in l.split(",")]
    tickets = [mint(j) for j in temp[1:]]

    
    
error_counts = 0
valid_tickets = []
for values in tickets:
    for v in values:
        valid = False
        for rv in rules.values():
            if v in rv:
                valid = True
                break
        if not valid:
            error_counts += v
            break
    if valid:
        valid_tickets.append(values)

print(f"Error Rate: {error_counts}.")

# a dictionary to hold possible fields for each col
possible_fields = {i: set(rules.keys()) for i in range(len(valid_tickets[0]))}
for ticket in valid_tickets:
    for i, value in enumerate(ticket):
        for field in rules:
            possible = False
            if value in rules[field]:
                possible = True
            if not possible:
                possible_fields[i].discard(field)

# remove repeated fields
for i in sorted(possible_fields, key=lambda k: len(possible_fields[k])):
    this_field = next(iter(possible_fields[i]))
    for j in possible_fields:
        if i != j:
            possible_fields[j].discard(this_field)
            
mt = [int(x) for x in lines[22].split(",")]

ans = 1
for i in possible_fields:
    if possible_fields[i].pop().startswith("departure"):
        ans *= mt[i]

print("Part 1:", error_counts)
print("Part 2:", ans)
```
KVision 3.18.0 is released (with new Progress component and IR backend fixes)
Tags: kvision, kotlin
Published: 2020-12-16 12:34:52

---
title: KVision 3.18.0 is released (with new Progress component and IR backend fixes)
published: true
description: KVision is an open source web framework created for Kotlin/JS.
tags: kvision,kotlin
---

[KVision](https://kvision.io) is an open source web framework created for Kotlin/JS. It allows developers to build modern web applications with the Kotlin language.

I have released KVision 3.18.0, the first release (and I hope not the last!) where external contributions are the most valuable.

The highlights of this release include:
* Upgraded dependencies (Kotlin 1.4.21, Ktor 1.4.3, Spring Boot 2.4.1, Vert.x 4.0.0, Micronaut 2.2.1, Jackson Module Kotlin 2.12.0)
* New `Progress` component
* Simple way to use KVision components as React children
* Fixes for the IR compiler backend

I would like to thank [Yannik Hampe](https://github.com/yankee42), for his fantastic work on `Progress` component and all code-base cleanups and refactorings.

I'm also announcing [KVision Project Wizard](https://github.com/JakubNeukirch/kvision-project-wizard) IDEA plugin, which allows to easily create new KVision projects directly from IntelliJ IDEA, with support for all frontend and fullstack project versions. Many thanks to [Jakub Neukirch](https://github.com/JakubNeukirch) for creating and maintaining the project.

For more details about this release see the [changelog](https://github.com/rjaros/kvision/releases/tag/3.18.0).

Don't forget to ⭐️ my [project](https://github.com/rjaros/kvision) if you like it!

As always, any feedback is appreciated!
NextWind: A free starter-kit for building landing pages + blog
Tags: nextjs, typescript, netlify, tooling
Published: 2020-12-16 12:18:06

I made a starter-kit for building a blog or landing pages quickly with Next.js, Tailwind CSS, and Netlify CMS. 

It allows you to switch between different versions of page sections from within the CMS. To do this, simply change for example `hero_version` from 1 to 2 or 3. The preview is immediately updated to show you the styling of the selected version. 

The sections are mostly brought to you by [Tailblocks](https://mertjf.github.io/tailblocks/), some ready-to-use sections built with Tailwind CSS. 

You can find the repository here: https://github.com/jakeprins/nextwind
Memory Management Techniques | Operating System - M05 P02
Tags: linux, devops, beginners, tutorial
Published: 2020-12-16 12:13:53

**This is a multipart blog article series, and in this series I am going to explain you the concepts of operating system. This article series is divided into multiple modules and this is the fifth module which consists of 26 articles.**

_In this article you will get a basic understanding about memory management techniques and why memory management techniques are required in an operating system._

### Memory management technique
- The main motive of memory management technique is to place maximum number of process in RAM _(ready state)_.
- By that the degree of multiprogramming will increase.
- We try to keep degree of multiprogramming high, because whenever CPU tends to become idle then we have a lot of process available in ready state to get executed.
- By this we try to maximize the utilization of the CPU.

<!-- Image will come here -->

![Untitled Diagram.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1608120623042/udY3l8cF4.png)

- In contiguous allocation the processes are allocated in memory in contiguous manner.
- In non contiguous allocation the processes are allocated in memory in non-contiguous manner.

_So this was a brief explanation about memory management techniques, we will see about each topic in dep't in next few articles. Hope you liked it and learned something new form it._

If you have any doubt, question, quires related to this topic or just want to share something with me, than please feel free to contact me.

### 📱 Contact Me

[Twitter](https://twitter.com/r_mishra10)
[LinkedIn](https://www.linkedin.com/in/rahul-mishra-66210b185)
[Telegram](https://t.me/rahul_mishra10)
[Instagram](https://www.instagram.com/rahul_mishra10/?hl=en)

### 📧 Write a mail
<rahulmishra102000@gmail.com>

#### 🚀 Other links

[GitHub](https://github.com/rahulMishra05)
[HackerRank](https://www.hackerrank.com/rahulmishra10201)
The heavy burden of keep updated
Published: 2020-12-16 11:53:37

Keep updated on news technologies!

I know the benefits... great salary, great rewards, nice car, awesome house!! I'm brazilian, nevermind the awful english

However, is it only me that thinks it painful and almost impracticable? These days ago I was happy because I have learned microservices with more clearancy and when I started to go deeper on this subject, I realized that I had discovered just the iceberg peak... I felt really bad, because it was hard to understand just that peak!

I have 32 years old, married and have 3 children and I don't know if my displeasure is due to my lack of time to dispend on studies because I'll never leave them without their dad's attention.

As far as I know, there are a lot of young blood undergraduates out there that have too much more energy and time than me to spend and this makes me feel vulnerable. They actually know more than me! Haha

I'm really trying to keep myself updated, but I want to believe that my problem-solving ability and experience with different scenarios is as enjoyable as a younger boy's incredible ability to learn new technologies!

G. Rodrigues
What is the best way or software to recover corrupt Doc or Docx files
Published: 2020-12-16 11:53:19

Hi all,
I want to tell you that the best way to recover corrupt DOCX files is through Docx file recovery software.  It helps in removing the errors and makes the data accessible.

Visit-https://www.data-recovery-solutions.com/docx-file-recovery.php

Some features of this tool are-
1. It has 2 recovery modes standard and advanced to deal with different levels of corruption.
2. Previews the recovered data before saving the file.
3.  Maintain the hierarchy and integrity of the data.
Programming Assignment Help
Tags: programminnghomeworkhelp, programmingassignmenthelp
Published: 2020-12-16 11:38:39

Hi, I am looking for a  Programming coursework  help tutor to do assignments for my lazy son. He has not completed his assignment and he doesn’t seem to care. He is always playing FIFA with his friends. He already failed his first semester exams and I don’t want the same trend to continue. If you have a programming assignment help expert who can be available for at least one hour a day to tutor him as well I would be very happy. I  need a Java Assignment help tutor because he has been under performing in this unit. I also need a Python Assignment help tutor since he keeps saying that it is a technical programming language to learn. In addition to that i need a C++ Assignment help tutor since he can't differentiate between C++ and C languages. To make his understanding even clearer he would need a C Assignment help tutor as well.visit:https://www.programminghomeworkhelp.com/
How to trigger Gitlab pipelines using REST API
Tags: gitlab, ci, cd
Published: 2020-12-16 11:15:40

Gitlab pipelines are the CI(Continuous Integration) build job(s), that are usually triggered when a new commit is pushed to a git repository. Pipelines can be used to test, compile and deploy the code or to automate certain tasks. In addition to changes in git repositories, pipelines can also be triggered through other mechanisms as well. For instance:

1. Manually through the GitLab UI
1. Based on a schedule
1. Using GitLab's REST API

In this article, I will explain how to trigger a GitLab pipeline using the GitLab's REST API.

## Create pipeline trigger
1. Navigate to `project settings -> CI/CD -> Pipeline triggers`
1. Create a new trigger and make note of the token. Token is used to authenticate the REST calls to trigger the pipeline.
![GitLab pipeline triggers](https://dev-to-uploads.s3.amazonaws.com/i/l57l5z2zjeq0rt6ykfvf.png)
1. Also make note of the URL displayed in the same page that must be used to trigger the pipeline. For e.g. `https://git.xps.lan/api/v4/projects/14/trigger/pipeline`

## Trigger pipeline using `curl`

This curl command can be used to trigger the pipeline for project with id `14` for branch or tag specified as `ref` in the curl command

```bash
curl -X POST \
     -F token=<token-noted-in-previous-step> \
     -F "ref=<ref-name-like-branch-or-tag>" \
     https://git.xps.lan/api/v4/projects/14/trigger/pipeline
```

Sometime it might be required to pass on some variables to the pipeline while triggering the same. The variables passed while triggering the pipeline are available as environment variables at run time and takes precedence over all other variables.

Following command will provide a variable named `RUN_NIGHTLY_BUILD` with value as `true` to the pipeline. Any number of variables can be provided like this.

```bash
curl -X POST \
     -F token=<token-noted-in-previous-step> \
     -F "ref=<ref-name-like-branch-or-tag>" \
     -F "variables[RUN_NIGHTLY_BUILD]=true" \
     https://git.xps.lan/api/v4/projects/14/trigger/pipeline
```

## Using Powershell Invoke-WebRequest 

For the users on Windows, it might be bit easier to use Powershell and Invoke-WebRequest, rather than using `curl` on Windows or WSL.

```powershell
Invoke-WebRequest https://git.xps.lan/api/v4/projects/14/trigger/pipeline `
    -Method POST `
    -Body @{
         "token"="<token-noted-in-previous-step>"
         "ref"="<ref-name-like-branch-or-tag>"
         "variables[RUN_NIGHTLY_BUILD]"="true"
     }
```
Difference between the assignment , equality & identity operator in PHP
Tags: php, beginners, codenewbie
Published: 2020-12-16 11:28:12


There are several operators used in PHP to carry out programming operations.
`=` is the assignment operator, this assigns a value

e.g  `$x = 'hello world`

`==` is the equality operator , it is used to test for equality 

```php
<?php
    $day = "Monday";
        if ($day == "Monday") echo "It is work day" 
?>
```
Since `$day = Monday` and satisfies the condition, we have the output - **It is work day**

`===` is the identity operator that is use to test if they are equal and of the same type

```php
<?php
    $a = "1000";
    $b = 1000;
        if ($a === $b) 
            {
                echo "identical" ;
            } 
        else 
        {
            echo  "not identical"
        }
?>
```
outputs **not identical** because `$a` is a string and `$b` is numerical, in other words they are of different type.
Wednesday Links - Edition 2020-12-16 ☃️
Tags: aws, java, jvm, gradle
Published: 2020-12-16 11:21:57

Gradle Doctor (30 sec read)🩺
https://runningcode.github.io/gradle-doctor

A dirty hack to ease the usage of Log4J2 in Spring Boot (3 min read)🪨
https://blog.frankel.ch/hack-ease-usage-log4j2-spring-boot

Improving DNS Privacy with Oblivious DoH in 1.1.1.1 (12 min read)🔏
https://blog.cloudflare.com/oblivious-dns

Amazon Managed Service for Prometheus (2 min read)🔥
https://aws.amazon.com/blogs/aws/join-the-preview-amazon-managed-service-for-prometheus-amp

Amazon Managed Service for Grafana (3 min read)📈
https://aws.amazon.com/blogs/aws/announcing-amazon-managed-grafana-service-in-preview

Jetty 10 and 11 Have Arrived! (5 min read)🎉
https://webtide.com/jetty-10-and-11-have-arrived

Announcing RESTEasy Reactive (6 min read)🎌
https://quarkus.io/blog/resteasy-reactive

Day Period Support in JDK 16 (5 min read)☀️
http://marxsoftware.blogspot.com/2020/11/day-period-support-in-jdk-16.html

Towards OpenJDK 17 (5 min read)🛣️
https://cl4es.github.io/2020/12/06/Towards-OpenJDK-17.html

Quic in Netty (3 min read)💨
https://netty.io/news/2020/12/09/quic-0-0-1-Final.html

Raft does not Guarantee Liveness in the face of Network Faults (4 min read)🪅
https://decentralizedthoughts.github.io/2020-12-12-raft-liveness-full-omission

HotSpot Intrinsics (8 min read)♨️
https://alidg.me/blog/2020/12/10/hotspot-intrinsics
What If. Dev Edition
Tags: topic, content, suggestion, whatif
Published: 2020-12-16 10:51:43

A lot of topics here in dev are mostly fall on a category of **How to**, **Tips to** and **Learn to**.

But what if there's a category about **What if**? Well, that's a topic for another... What If.

There is an entertaining platform `What if` with 12M followers on [Facebook](https://www.facebook.com/What.If.science) and 4.5M subscribers on [Youtube](https://www.youtube.com/c/WhatIfScienceShow) at the time of this writing. Its more on science and exploration of possibilities. Here are some awesome topics on it.

[What If We Dumped Our Trash into Volcanoes?](https://www.youtube.com/watch?v=Q4Xys-IRMr0)
[What If You Fell From the International Space Station?](https://www.youtube.com/watch?v=30j6WfQMlCw) 
[What If a Black Neutron Star Entered the Solar System?](https://www.youtube.com/watch?v=Ze3DNE3uknI)

The narrator will start with some introduction, then tell what would happen and open another `What If` topic at the end.

How about on tech? These are some of `What If` in my mind:

- What if jQuery was not free to use before?
- What if nodejs never existed?
- What if there is no Open Source projects?
- What if the idea of reconciliation or Virtual Dom implemented on early 2000?

Hope that great minds and content creators write something like this, that would be very interesting to read.

What's your What If? Comment down below! 👇👇