teleren/devto huggingface dataset:
Flatiron School
Tags: rails, ruby, react, javascript
Published: 2021-06-07 18:18:56

My time at the flatiron school has been meaningful and rewarding. All the hard work I put in finally is showing as I finished up my last project review. I remember starting in Phase 1 learning the command line and core ruby. My first project acted as a gateway into the world of programming. Learning how to produce returns on the command line was no easy task for someone who never coded before. Phase 2 is where the fun began. I started to see that the OO code that I was writing was finally showing up in a web browser. I was hooked. Seeing your code turn into a real operational master piece leaves you wanting more. My favorite part was combining the cli scraper logic into my second project, acting as an api that fetched data for my views. In Phase 3 came Ruby on Rails. The framework that I have been so eager to learn since I first heard the name. Rails lives up to its name and learning it is quite the ride. This framework has it all! I'm a huge fan of convention over configuration. This framework allowed me to separate out routing, controller actions, models and so much more. Once I finished with rails I realized quickly that I had to switch gears into JavaScript. Phase 4 is where I learned the most about how web development works, it wasn't easy. With hard work, long nights and dedication I was able to overcome such a difficult challenge. Lesson after lesson I plugged away all to figure out how to 'wire up' a backend to a front end and vice versa. I can't forget how lucky I was to have Flatiron as support system. I was able to ask questions and get answers that left me inspired after much frustration and debugging. In the last phase I learned to develop a React frontend. It feels more natural and the way you're able to separate out containers, components and routing felt similar to rails almost as if they were made to work together. My journey was long but I'm happy to say I passed my final review and can look forward to the projects ahead. Flatirons job ready curriculum has me prepared to take on any challenge. Most importantly I learned how to learn. 

Image by <a href="https://pixabay.com/photos/?utm_source=link-attribution&amp;utm_medium=referral&amp;utm_campaign=image&amp;utm_content=768783">Free-Photos</a> from <a href="https://pixabay.com/?utm_source=link-attribution&amp;utm_medium=referral&amp;utm_campaign=image&amp;utm_content=768783">Pixabay</a>
what is the difference between an arguments and parameters
Published: 2021-06-07 18:11:18

In this blog, we will look at the difference between arguments and parameters. This is irrespective of the programming language.

In any programming language, If we need to do something, again and again, we create a method for it. Thus the method has 3 important parts:

Method declaration.
Method definition
Method calling.
When we define any method the variable in the parenthesis are nothing but the parameters and When the method is called, the data we pass into the method is Arguments.
 
Consider an Example
```
package com.abc;
public class Example {
    public static void main(String[] args) {

        int argument1 = 2;
        int argument2 = 3;
        methodName(argument1,argument2);
    }

    private static void methodName(int parameter1, int parameter2) {
        //Do the Logic
    }
} 
```
Here, During calling the method, the data we passed is called Argument and in Method Definition the value which we get in a variable is called Parameters.

Note: Parameters are Variables and Arguments are values passed to variables.

Thank you for reading this article!!
Azure API Management Policy for operation filter at API level policy
Published: 2022-07-05 10:51:07

---
title: Azure API Management Policy for operation filter at API level policy
published: true
date: 2021-06-07 18:11:16 UTC
tags: 
canonical_url: https://lkgforit.com/azure-api-management-policy-for-operation-filter-at-api-level-policy
---

If you want to apply policy at method level in Azure API Management, we can apply using Azure portal on selecting the method and editing the policy.

But if you want to use API level policy to apply only for some operations (methods) then we can achieve that with when condition.

```
<choose>
            <when condition="@(context.Operation.Name.Equals("myOperationName"))">

                -----Your policy here-------

            </when>
</choose>

```

Above policy is used at API level and I use the 'myOperationName' value with the operation for which i need to apply a policy.

We can also apply for multiple operations (methods) with OR condition like below:

```
<choose>
            <when condition="@(context.Operation.Name.Equals("myOperationName") || context.Operation.Name.Equals("myOperation2Name"))">

                -----Your policy here-------

            </when>
</choose>

```
C++ what is char*
Published: 2021-06-07 18:04:21

The identifier varies in its address value for some variables. As with any other variation or continuation, you must announce the index before working with it in C ++. Points to identify the same type of data (such as an int or thread) of the same type, and are created with the help of a * operator. A dynamic address address is provided for the identifier. The most common type of dynamic detection is approx
type * var-name;
Here, type the default type of cursor and Must be a valid type of C ++, the word var is different from the cursor. The asterisk you used to declare the index is the same star used for duplication. The asterisk operator (*) helps us to retrieve the amount stored in the memory address. However, in this statement the asterisk is used to build solid as a reference. The following is the declaration of valid identifier -

```char * ch1;
chart ch2 = 'a';
ch1 = & ch2;```

If we have a variation named ch1, which is kept at 0x234 and retains the value 'a'. Active operator (&) will return 0x234. An unused user (*) will return the 'a'. Here, the ch2 address is given the ch1 index. To find the value stored in that address, use * ch1.
The actual data type of the total value of all references, whether whole, float, character, or otherwise, is the same, long hexadecimal number representing the memory address. The only difference between the different types of data indicators is the type of data that is variable or regularly displayed on the identifier.
ERROR: Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock
Tags: docker
Published: 2021-06-07 17:28:35

After install docker maybe need using docker without **sudo** for home users.


> Fact : for security don't bypass **sudo** request in docker.


**Step 1**
Create docker group if not exist : `sudo groupadd docker`

**Step 2**
Add user to docker group : `sudo usermod -aG docker ${USER}`

**Step 3**
Change docker.sock to new permission : `sudo chmod 666 /var/run/docker.sock`

**Step 4**
Finally restart docker daemon service : `sudo systemctl restart docker`

Enjoy!!!
Day 85 of 100 Days of SwiftUI
Published: 2021-06-07 16:40:37

I just completed day 85 of 100 days of SwiftUI. Today I worked on solving the challanges in the Hot Prospect app. I added icon that indicates whether the propect has been contacted or not. I also added sorting by name or by most recent.

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ydrfc1tth8819kyfbp0m.png)
Angular 12 & Cypress: Install to Testing in 2 Minutes
Tags: angular, testing, cypress, e2e
Published: 2021-06-07 16:32:45

Thanks to the Angular CLI and the [Cypress Schematic](https://www.npmjs.com/package/@cypress/schematic), spinning up a new Angular 12 project with Cypress is incredibly easy.

### Installation :rocket:

Here's how to do it in less than 2 minutes:

1. Install the [Angular CLI](https://angular.io/cli) if you haven't and create a new project:

```
ng new angular-cypress-demo
```

2. Navigate to the newly created project directory and install the [Cypress Angular Schematic](https://www.npmjs.com/package/@cypress/schematic) via the CLI:

```
ng add @cypress/schematic
```

Once you've completed these steps, Cypress will be set up with a default config, and basic files and folders will be installed within your project in the `cypress` folder - including an initial test.  

### Additional Information :memo:

For more information regarding schematic configuration [click here](https://on.cypress.io/protractor-to-cypress#Angular-Schematic-Configuration?fromDevto=true).
Playing with rhythm in Tone.js
Tags: javascript, music, tutorial, webdev
Published: 2021-06-07 16:28:18

In the previous article, we learned how to add and play notes in Tone.js. In this example, we are doing scheduling in Tone.js. This allows us to add multiple parts to the arrangement. 

## Synths
As always, we create the synth. This time, we are using 3 synths for triple the fun. As a side note, toMaster is deprecated and  toDestination connects the output to the context's destination node.

```
const synthA = new Tone.PolySynth().toDestination();
const synthB = new Tone.FMSynth().toDestination();
const synthC = new Tone.AMSynth().toDestination();
```
## Loops and Callbacks 
To create loops and callbacks at a specfic interval use Tone.Loop. Below we have three loops for each of the synths above.  

```
//play a note every sixteenth-note
const loopA = new Tone.Loop(time => {
	synthA.triggerAttackRelease("C2", "8n", time);
}, "16n").start(0);

//play another note every off quarter-note, starting it "2n"
const loopB = new Tone.Loop(time => {
	synthB.triggerAttackRelease("D2", "8n", time);
}, "4n").start("2n");

//play another note every off half-note,by starting it "2n"
const loopC = new Tone.Loop(time => {
	synthC.triggerAttackRelease("E2", "8n", time);
}, "2n").start("2n");
 ```
Don't forget to start the sound.
 
```
Tone.Transport.start()
``` 
## Bpm 
For the bpm , we are ramping it up to 135 over 10 seconds.

```
Tone.Transport.bpm.rampTo(135, 10);
```

The end result is that the audio plays the synths and their respective loops. Also its a quick way to create a bassline. 

### Resources
[Tone.js](https://tonejs.github.io/)
Set different email address for multiple git repositories
Tags: git
Published: 2021-06-07 16:26:28

#Problem

I use my own laptop to code for both personal and work projects. However, I want to use my work email address only for my work projects. But I am lazy to set it for each repository.

Here is my folder structure. All work projects are under the same folder `~/src/work`. Other projects are personal projects.

```
~/src/work/project-i        # work project
~/src/work/project-j        # work project
~/src/playground/project-a  # personal project
~/src/bots/project-b        # personal project
~/src/devops/project-c      # personal project
```

#Solution

Step 1. Add an `includeIf` section to global git config file `~/.gitconfig`. (Create this file if it does not exist)

```
[user]
    name = Franz
    # personal email address
    email = franz@whatever.com

[includeIf "gitdir:~/src/work/"]
    path = ~/src/work/.gitconfig
```

Step 2. Add the work email address to our work git config file `~/src/work/.gitconfig`. (Create this file if it does not exist)

```
[user]
    # work email address
    email = franz@serious.com
```

After you have done these steps, when you commit code to your work projects, the email used in commit will be your work email address.
Cascade deleting in Prisma (v2)
Tags: javascript, orm, prisma, mysql
Published: 2021-06-07 16:22:25


[Prisma](https://www.prisma.io/) (v2) is one of the hottest ORM's right now (you can see some of the reason I think so [here](https://twitter.com/pmartinsdev/status/1390028038046457862)). 

It still has some important holes, though. Cascade delete is one of the most prominent ones, and even though the developers have been aware of this issue, there is no expectation of when it will be solved (see more [here](https://github.com/prisma/prisma/issues/2810) and the discussion on the proposal [here](https://github.com/prisma/prisma/issues/6996)).


## What is cascade delete?

Cascading delete allows you to automatically delete related records, which is important specially in one-to-many relations. 

For example, if you delete an Author, you would expect all its Posts to be deleted as well (and any other records related to this author).  

The cascade delete is usually configured at the database level and one would expect that it would be available to be expressed in the prisma schema.

## Prisma behavior right now

Right now, if you have a *required* relation (such as Posts need to have an Author) and try to delete an Author with Posts, prisma will return: 

```
The change you are trying to make would violate the required relation 'PostToAuthor' between the `Post` and `Author` models.
```

## Workarounds

### 1. Configure your database

The most basic option would be to configure your database to perform the cascading delete. 

*Prisma* has a good documentation on how to do this on the most famous RDBMS [here](https://www.prisma.io/docs/guides/database/advanced-database-tasks/cascading-deletes) 


### 2. Add Cascade Delete to schema (using Pal.js)

[Pal.js](https://paljs.com/) is a library with a series of helper packages to use with *Prisma*. One of those, the *On Delete* plugin allows you to use comments on your schema do define on delete behaviors. 

You can check more of it [here](https://paljs.com/plugins/delete#introduction).

### 3. Use $transactions to run deletions on a given order

This is what is recommended on *Prisma* docs (right [here](https://www.prisma.io/docs/concepts/components/prisma-client/crud#delete)). In this solution, you would need to hard code all the deletions, which might be impracticable in some cases.

There is a package that can take care of that, creating all the deletions necessary to cascade delete and perform them on the right order. Check more [here](https://www.npmjs.com/package/prisma-cascade-delete);


## Conclusions

I hope *Prisma* team will soon tackle this issue so we can create cascade deletes out of the box. On the meantime, I tend for the option 3 and the [prisma-cascade-delete](https://www.npmjs.com/package/prisma-cascade-delete) package.

Feel free to ask questions or reach me out on [Twitter](https://twitter.com/pmartinsdev)
Karma Chromium Driver
Published: 2021-06-07 16:05:54

The problem: `karma "ChromeHeadless have not captured"`

As a solution try to:

`brew install --cask chromium`

```
==> Installing Cask chromium
==> Moving App 'Chromium.app' to '/Applications/Chromium.app'
==> Linking Binary 'chromium.wrapper.sh' to '/opt/homebrew/bin/chromium'
🍺  chromium was successfully installed!
```

Remember to allow Chromium at `Security & Privacy`.
Microsoft Build 2021: Build Cloud-native Applications That Run Anywhere
Tags: microsoft, azure, build, programming
Published: 2021-06-07 16:04:59

ICYMI (In case you missed it); last week was Microsoft’s Build event! The yearly event is a chance for developers to learn new things that are going on in technology. The reason I love listening to these types of events is because it gets you excited about the happenings in the industry. 

One of the talks that stood out to me was on the challenges that modern developers face like needing to move from concept, to code, to cloud seamlessly. Needing this type of agility, reliability, and security is critical when trying to solve problems at scale. Cloud native is the ability to package application code and dependencies into a container, to deploy as a microservice and manage using DevOps. 
&lt; Insert typically CI/CD pitch here &gt;

![image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/kn2n7dkfpcbaqsom8b0z.png)
> Source: Microsoft

Part of this talk sounds like a marketing pitch for Azure, but I think that the underlying technology is actually really exciting. Jeff Hollan gives a good demo (around 8:25) about attacking a real world problem. The dashboard that he builds utilized Github’s App Templates. It lets you launch a sample and launch a code space that automates a lot of the initial setup of the project. 

> “Rather than me spending the next 30 minutes installing tools and configuring my machine, instead everything I need is ready to go right here in this codespace.” - Jeff Hollan

Azure Arc allows you to deploy anywhere without the need to have to learn Kubernetes and have a bunch of overhead. The integration with [Github Actions](https://github.com/features/actions) and other workflows is going to be a time saver forsure!

I highly recommend watching this session if you have the time!

[Click Here to Watch the Video](https://mybuild.microsoft.com/sessions/2debfc2e-f0b3-4adf-bcec-d126930f806f?source=sessions)

<video src="https://mediusdownload.event.microsoft.com/video-38404/842267d406/TS03.mp4?sv=2018-03-28&sr=c&sig=2h2nqH%2FZs5wp8%2F%2Bggz6j0wLyqctIAIGmnJKGKDB1csk%3D&se=2026-05-25T17%3A23%3A24Z&sp=r" controls></video>
___
Let me know what your favorite session of Microsoft Build was!
Regarding cross platform offline data transfer between 2 mobile devices 
Tags: reactnative, android, ios, offline
Published: 2021-06-07 15:50:58

Hi , I am a Java developer new for mobile technologies .

Got below requirement which is needed to be addressed prefably using react native library but not neccsary can use any lenguage)

"My goal is to transfer msg between 2 mobile devices in offline mode cross platform (android to iOS and iOS to android) ".
I tried some Bluetooth react native libraries but they does not work cross platform . while they are ok android to android and ios to ios .
Is it even possble to transfer data between 2 mobile devices cross platform using it ?

If you do have any suggestions or if you know any libraries which can work cross platform in offline mode(Either using WIFI , wifi direct , wifi aware or hotspot or Bluetooth or any other technology) it would be really great help to me ?
How To Make A Website Using HTML CSS Bootstrap | Complete Website Design Tutorial
Tags: html, css, beginners, webdev
Published: 2021-06-07 15:30:48

This **Bootstrap tutorial** shows you how to **create a website using Bootstrap** step by step. From setup over basics to advanced features.

Hi there 👋,

Checkout my recently made bootstrap responsive blog website.

In this responsive website i have added Home section, feature blog, main blog section, side bar, ads bar, contact form & footer. 

For this project I have used these libraries,
▶️ HTML
▶️ CSS
▶️ JavaScript
▶️ Bootstrap

Here is the tutorial for this bootstrap blog website!
{% youtube QdavXfltTeY %}


You can use this to learn or for your portfolio.

**Feel free to visit my YouTube channel:
[@Tech2etc](www.youtube.com/tech2etc)**

**Follow me on Instagram where I'm sharing lots of useful resources!
[@fahimulkabir.chowdhury](https://www.instagram.com/fahimulkabir.chowdhury/) 😉**
30 Days of Code Using Java
Tags: java, devops, codenewbie, challenge
Published: 2021-06-07 15:12:55

**Introduction to HackerRank**

30 days of code is a challenge for programmers by <a href="https://www.hackerrank.com/dashboard">HackerRank</a> Website, we have to solve daily one programming problem up to 30 days, in any programming language, HackerRank supports multiple languages, for example, C, C++, C#, F#, Go, Java, Python, Ruby, Swift &amp; TypeScript.

I am going to solve these problems in Java You have to practice a problem day by day.

###All Code Here.
<ul>
<li><a href="https://dev.to/scotty252/30-days-of-code-using-java-3ni7">Day 0: Hello, World</a></li>
</ul>
Why I like Markdown
Tags: markdown, watercooler
Published: 2021-06-07 15:09:23

If you are reading this, chances are you know about markdown. It is a markup language used for making articles, documentation and sometimes even websites.

One of the more notable appearances of markdown in the coding world is in the DEV community! For those of you who don't know, yes dev.to articles are written in markdown.

### So JavaCode7, when did you first find out about markdown?
Good question. I first found out about markup languages (excluding HTML) last year. I was on my computer watching a youtube video on making a simulation in pygame when the youtuber in question then wrote the docs for the simulation. Those docs were in RST (ReStructured Text). I quickly picked up the basic syntax and used it for the docs of my projects to come. That was, of course until I found out about markdown.

I don't remember exactly when I found out about markdown. I think it was when I joined GitHub 🤔. I think I was writing the documentation/README of one of my early projects. I realised that RST syntax wasn't working! I then went to GitHub's learn markdown page to get the basics down. Even after this however, I still didn't really like markdown.

### Wait, if you didn't like markdown before, why write this article?
As I gradually started using markdown more (and RST less), I grew to like it more and more. The syntax is simple 😂 (and just makes plain *sense* somewhat unlike RST), it is by far one of the more commonly used markdown languages and probably the *most* used in writing documentation. It also supports some embedded HTML as well as giving more direct ways to do simple things that would take a few lines in HTML e.g. code blocks.

I would say markdown is easy for beginners to learn. It allows small things to be done in small ways, and *that* is one thing I like to see in a project.

This concludes my article! Thank you for reading and if you would like to see content other than esolangs and/or more emojis in my articles, please just comment!
Object Destructuring In JavaScript
Tags: javascript, beginners, codenewbie, productivity
Published: 2021-06-07 14:42:16

##Object Destructure :


Object destructuring is a very useful feature of JavaScript to extract properties from objects and bind them to variables.

The Object destructure is extracts multiple properties at only writing a single line. you can access properties from the nested objects and set a default value if that property doesn't exist. 

####Basic Object destructuring :

This is a basic object identifier that can name property access and expression should evaluate to an object.

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

####Assigning to new variable names :

A property can be unpacked from an object and assigned to a variable with a different name than the object property.

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

####Object Default values :

A variable can be assigned as a default value, in if object is undefined that time we can be give a default value.  

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

####Nested Object Destructuring :

In a nested object destructuring you will be defined as an identifier in nesting you can extract properties from is unlimited.

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

####Rest object :

The rest syntax is useful to collect the remaining properties after the destructuring also you will get the rest of the values only with the spread operator.

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

If you find this useful in a post like and save this post also comments about your thoughts.

For more content follow me on Instagram  [@developer_nikhil27](https://www.instagram.com/developer_nikhil27/).

Thank you!
authentication solutions
Tags: devjournal, ruby, authentication
Published: 2021-06-07 14:56:16

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

There are doors that open to reveal another world — one where the end of a wardrobe is a place where a loving lion fights a sinister witch. One where the occupant is a little person obsessed with a magical ring. One where (once penetrated) uncovers platform nine and three-quarters. But, there are doors that just close with no rhyme or reason. One thing I think they have in common — they offer some kind of hope on the other end, should we dare take a step closer. Oh! and, they have some sort of authentication. Ok, maybe not just one thing.

---

Further reading: centimentalcomics.com

---