teleren/devto huggingface dataset:
Day 1 of Hack Reactor
Tags: devjournal
Published: 2021-06-15 04:54:35

Alright, day one of HR is in the books. It was a long day, and perhaps a taste of what's to come: marathon learning, fun (and challenging) pair programming, new tools, and more.

##Things I liked
####Staff support.
I'm tired. Three weeks from now, at this point in the night, that might turn into 'I'm exhausted'. Burnout, stress, anxiety. I can see how the pace of the course can lead to negativity.
But the staff for my group of 40 or so students seems large enough, engaged enough, and adept enough to help us navigate the obstacles we'll encounter and to help steady the emotional seas. We'll see.

####Pair Programming
My partner was great. Communicative, sharing, and a good coder. I have a lot of room to grow in the pair programming department, but today was a strong start and an encouraging first taste of an important part of this experience.

##Things I didn't like
####Catch-up work.
I had left a pre-course item unattended and I was asked to complete the 45 minute (timed) assignment tonight. At the end of a long day first day, I thought it was a big ask. I would prefer to have been alerted - if I was alerted at all - before the end of last week, or even over the weekend.

Better yet, in the deluge of emails and resources that were sent our way, perhaps the program should send automated feedback/progress/alerts to students based on submitted work.

####Technical Lectures that under-deliver
Our final 1.5 hours of the day was spent in a lecture that I think could've been distilled to five slides in a presentation. The program emphasizes learning by doing, so to sit through content that has more words than action was disappointing. My main takeaways from the lecture were that
1. variables are labels for values. 
  * all variable assignments pass through to a value.

2. a value is a 'parcel of information that represents a distinct idea'.

While these were presented almost as mystical axioms in a lecture that was promised to blow our minds, I left feeling underwhelmed.

To bring these ideas into reality - you know, to make them practical and usable - I'd have liked to know:
*How are these terms commonly misunderstood. What are the pitfalls of that misunderstanding?*
And then perhaps see those questions answered with examples in code.
Let's use Optional to fix our method contract.
Tags: java, method, optional
Published: 2021-07-03 07:35:54

---
title: Let's use Optional to fix our method contract.
published: true
date: 2021-06-15 04:52:10 UTC
tags: java, method, optional 
canonical_url: http://bazlur.com/2021/06/lets-use-optional-to-fix-our-method-contract./
---

![100DaysOfProgramming_Day008](http://bazlur.com/img/Day009.png "100DaysOfJava")

A method is a contract; when we define one, we put our thoughts into it. We specify the parameters with their type and also a return type. When we invoke a method, we expect it to behave according to the contract. If it doesn’t, it’s a violation of the contract.

We have been dealing with such a violation all the time. We invoke a method with its proper arguments, and we get a return. However, sometimes we end up getting a null, which is, in fact, a clear violation. We shouldn’t accept such a violation. If a method cannot return the value of the specified type, it should mention that in the method signature, the method may or may not be returning the value you are expecting. If we know it from the method signature, we then write our code accordingly.

Now the question is, how do we define such a contract in a method signature? Well, that’s where Optional comes into play. Set your return type as Optional. Optional is a mystery box, a wrapping paper; it may or may not contain the value. When we specify that in a method signature, we assume that the box might be empty. Let’s see an example-

```
public static Optional<Book> findBookByName(String name) {
  return books.stream()
          .filter(book -> book.title().equalsIgnoreCase(name))
          .findAny();
}

```

The method above specified Optional as a return type. It may return the book that I’m looking for or may not. I’m aware of this, and I can deal with it when I invoke it. For example-

```
    var bookOpt = findBookByName("Java Programming");
    if (bookOpt.isPresent()) {
        var book = bookOpt.get();
        var releasedYear = book.releasedYear();
        System.out.println("Java Programming was published in " + releasedYear);
    } else {
        System.out.println("Book was not found");
    }

```

Or we can do the same thing with the functional construct, e.g.

```

findBookByName("Java Programming")
.map(Book::releasedYear)
.ifPresentOrElse((releasedYear) 
        -> System.out.println("Java Programming was published in " + releasedYear),
() -> System.out.println("Book was not found"));

```

The bottom line is, we should fix our method contract and use optional rather than returning null.

for **copy/paste** pleasure: [https://github.com/rokon12/100DaysOfJava/blob/main/src/main/java/com/bazlur/Day009.java](https://github.com/rokon12/100DaysOfJava/blob/main/src/main/java/com/bazlur/Day009.java)
Gatsby cli commands
Tags: gatsby, javascript, react, netlify
Published: 2021-06-15 04:33:39

---
title: Gatsby cli commands
series: [Gatsby]
tags: gatsby, javascript, react, netlify, 
---

1. `gatsby develop`
2. `gatsby build`
3. `gatsby serve`
4. `gatsby info`
5. `gatsby clean`
6. `gatsby repl`
7. `gatsby new [rootPath] [starter]`

### gatsby develop
Starts development server. If something changes in the project it will rebuilds the server and perform hot reload.

### gatsby build
Generates build from the source code.

### gatsby serve
Serve previously built Gatsby site.

### gatsby info
It gives gatsby environment information and packages information

### gatsby clean
Clears the `cache`, `assets` and build

### gatsby repl
It is node repl with context of Gatsby environment
Binding Data to Blazor ListView Using Entity Framework - Syncfusion
Tags: blazor, listview, component, webdev
Published: 2021-06-15 04:33:22

**Blazor ListView - High-Performance Component**
The Syncfusion [Blazor ListView Component](https://www.syncfusion.com/blazor-components/blazor-listview) is a list-like interface that allows you to select an item or multiple items. It represents data in an interactive hierarchical structure across different layouts or views.

-Built-in support for flexible data binding, sorting, grouping, nested navigation, multiple selection, templating, and more.

-This high-performance Component can load a huge amount of data on demand while being scrolled.

-Data can be elegantly visualized with cards, images, icons, avatars, and badge representation for better understanding.

Learn how to bind data easily in the Blazor ListView control using Entity Framework. 

Download an example from GitHub:
https://bit.ly/3nt6U0I

Learn how to configure the Entity Framework in a Blazor WebAssembly app:
https://bit.ly/34G1Q0y

{% youtube iEM_W4HP9pk %}
AWS Announces General Availability For ECS
Published: 2021-06-15 04:24:07

As per recent updates aws announces the general availablity for ECS. Leverage of this recent update by aws helps customer to quickly run and manage container-based applications on-premises, including virtual machines (EC2),servers, and other customer-managed infrastructure.

Prior aws provide  customers with options to run tasks on the compute services outside of an AWS region.However, due to regulatory, latency, and data residency requirements, there is also a need to run workloads on-premise. With Amazon ECS Anywhere, customers now have that option. The fully-managed container orchestration service allows customers to run, scale, and secure Docker container applications on any customer-managed infrastructure in addition to all AWS Regions, AWS Local Zones, and AWS hybrid infrastructure deployments (e.g., AWS Outposts and AWS Wavelength).
Regex to match any pattern copyright statements in a file
Tags: regex, copyright, traverse, match
Published: 2021-06-15 04:23:25

Hi i am new to regex, tried to write regex to match copyright statement in a file. There are many patterns of copyright statements which should be matched and whatever gets matched should also be validated for correctness. Please check the below one:
https://regex101.com/r/ROWq73/1
(?:©(?:\s*Copyright)?|Copyright(?:\s*©)|\(C\)(?:\s*Copyright)|Copyright(?:\s*\(C\))?)|\s*\d+(?:\s*-\s*\d+)?\s*(.*?(?:\W*All\s+rights\s+reserved)|[^.\n]*(?=\.)|.*)|([a-zA-Z0-9-_.]+@[a-zA-Z0-9-_.]+)
I just need everything to be identified whatever way the copyright statement is along with mail id or company URL.
LeetCode 27. Remove Element (javascript solution)

Tags: algorithms, javascript
Published: 2021-06-15 04:21:48

###Description:
Given an integer array nums and an integer val, remove all occurrences of val in nums in-place. The relative order of the elements may be changed.

Since it is impossible to change the length of the array in some languages, you must instead have the result be placed in the first part of the array nums. More formally, if there are k elements after removing the duplicates, then the first k elements of nums should hold the final result. It does not matter what you leave beyond the first k elements.

Return k after placing the final result in the first k slots of nums.

Do not allocate extra space for another array. You must do this by modifying the input array in-place with O(1) extra memory.

###Solution:
Time Complexity : O(n)
Space Complexity: O(1)

```javascript
var removeElement = function(nums, val) {
    let i = 0;
    for (let j = 0; j < nums.length; j++) {
        // Swap numbers if current number is not equal to val
        if (nums[j] !== val) {
            nums[i] = nums[j];
            // Index where numbers that are equal to val begin in the array
            i++;
        }
    }
    return i;
};
```
Getting Started with the Blazor DataGrid Component
Tags: blazor, datagrid, grid, webdev
Published: 2021-06-15 04:21:35

**Blazor DataGrid - Fast & Powerful Grid Component**
-Load millions of records in just a second.
-Mobile-first design that adapts to any resolution.
-Flexible editing and intuitive record selection modes.
-Countless column customizations and data summaries.
-Seamless data exporting options like PDF, CSV, and Excel.

Learn how easily you can create and configure the Blazor Data Grid of [Syncfusion](https://www.syncfusion.com) using Visual Studio 2019.

In this video, I’ll create a new Blazor server-side application using Visual Studio 2019 and then integrate a [Blazor Data Grid](https://www.syncfusion.com/blazor-components/blazor-datagrid) component by adding the Syncfusion.Blazor package from Nuget. I’ll also explain simple customizations that can be done to the data grid columns, as well as how to enable some important features such as paging, sorting, filtering, and grouping.

{% youtube ClAlwPUv0_s %}
Roads quality in Asia 2006-2019
Tags: logistics
Published: 2021-06-15 04:16:40

In south asia, we could see the top one is Singapore>>Malaysia>>Thailand>>Indonesia>>Laos>>Cambodia>>VietNam

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

Source: https://www.theglobaleconomy.com/rankings/roads_quality/Asia/
Getting started with gatsby
Tags: gatsby, javascript, react, beginners
Published: 2021-06-15 04:13:46

---
title: Getting started with gatsby
series: [Gatsby]
tags: gatsby, javascript, react, beginners, 
---

### Requirements
- Nodejs (download it from here https://nodejs.org/en/download/)

### Installing gatsby cli
```bash
npm i -g gatsby-cli
```

Before creating a site you should know about gatsby starters. Starters are nothing but boilerplates there are hundred's of boilerplates (starters) available from gatsby official site.

[Here you can choose Gatsby starter](https://www.gatsbyjs.com/starters/?)

### Creating new gatsby site from starter
```bash
gatsby new {name_of_your_site} {starter-repo-link}
```

Once `gatsby new` is successful then run the following commands

```bash
cd {name_of_your_site}
gatsby develop
``` 

Project structure will be like this
```
/
|-- /.cache
|-- /plugins
|-- /public
|-- /src
    |-- /pages
|-- /static
|-- gatsby-config.js
|-- gatsby-node.js
|-- gatsby-browser.js
```

Now you can check your site at [localhost:8000](http://localhost:8000)
Object destructuring in JavaScript
Tags: javascript, objectdesctructuring, webtechpie
Published: 2021-06-15 04:12:55

![Object destructuring in JavaScript](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/26e0bi64mcr5k0n0bsvh.png)

Object destructuring is a useful JavaScript feature to extract properties from objects and bind them to variables. What’s better, object destructuring can extract multiple properties in one statement, can access properties from nested objects, and can set a default value if the property doesn’t exist.

Normally, we access objects with the key. Nothing new :)

```
object.key
```

Let’s have quick look at the example below:

```
// object (Literal)
var user = {
    name: "Hidayt",
    city: "Delhi",
    type: "Admin"
}
console.log(user.name); // Hidayt
```

We have a user object which contains user info (name, city, type). We will be using this example for object destructuring.

## Object destructuring

Let’s use object destructuring and Destructuring the object into our variables.

```
// object destructuring
var {name, city, type} = user;
// access as a normal variable
console.log(name); // Hidayt
console.log(city); // Delhi
console.log(type); // Admin
```

You can access name directly instead of user.name

Now it can be accessible as a normal variable.

*Destructuring makes code tidy and easy to access.*

<Happy Code />
How to set Authentication for Supervisor (monitoring tool)
Tags: monitoring, backend, deployment, supervisor
Published: 2021-06-15 03:54:27

By default, `Supervisor` shows your processes to everyone, but if you want to set Username and Password for that, continue reading the post.

1. Open the config file
```
sudo nano /etc/supervisord.conf
```

2. Find the lines including `username` and `password` and set your username and password there:
```
username = user
password = 123
```

3. Save the file and exit.

Tadaaaa, there you go.

it's gonna look like this:
![a login dialog](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/nxbvh67i5r34xkrumm6b.png)

___
If you liked this post, please consider following me on [Twitter](https://twitter.com/kianashnad/)
Making API call bypassing Interceptor if one is configured in Angular
Tags: angular
Published: 2021-06-15 03:35:49

Hi All, if you have worked on some Angular project and used backend communication with API in which want to add some auth header to every outgoing request you must have used Interceptor to achieve that.
But suppose you have a call to be made without passing through Interceptor so what approach you will use? We are going to discuss one approach for that and if you have some other way also, please be free to share that in the comments.

####Setting up the project

After initial setup of Angular project lets add the below HTML code in HTML template file
```html
<button (click)="callWitInterceptor()" >Call using interceptor</button>
<br>
<hr>
<button (click)="callWithoutInterceptor()" >Call without interceptor</button>
```
And below in typescript file for our first function `callWitInterceptor`, for the other one we will add later in the article.
```javascript
constructor(private http: HttpClient) {}
callWitInterceptor() {
    this.http.get('https://dog.ceo/api/breeds/image/random').subscribe();
  }
```
And interceptor function looks like below and it is to be added to NgModule under providers array.
```javascript
intercept(request: HttpRequest<unknown>, next: HttpHandler): Observable<HttpEvent<unknown>> {
    console.log('Through interceptor')
    return next.handle(request);
  }
```
You can also refer `StackBlitz` project from below for a working example.
So now if we click on Button Call using interceptor we will be able to see console output we have in interceptor like below.
![image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0tdsf7dpdkel67y8v24v.png)
So now to bypass the interceptor we can use HttpBackend. For more details about it, please refer to [this](https://angular.io/api/common/http/HttpBackend). When injected, HttpBackend dispatches requests directly to the backend, without going through the interceptor chain. So as per the definition, we can surely use it for our current use case.
Now lets add the function for Button Call without interceptor in typescript file and don't forget to inject HttpBackend in constructor.
```javascript
constructor(private http: HttpClient, private httpBackend: HttpBackend) {}
  callWithoutInterceptor() {
    this.httpBackend
      .handle(new HttpRequest('GET', 'https://dog.ceo/api/breeds/image/random'))
      .subscribe();
  }
```
Now when we click on the Button we will notice that the console is not printed but in the network tab, we can see the API call made.

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

Hereby using HttpBackend we were able to bypass the application-wide interceptor. Hope you found this interesting and learned something new. If you liked it please share it with your friends or if any suggestions reach me out on [Twitter](https://twitter.com/nikhild64) or comment below. Till next time Happy Learning!

{% stackblitz github-r4tzdn file=intertesting.component.ts view=preview %}
Volevamo che il giorno del nostro matrimonio fosse così tanto
Published: 2021-06-15 02:51:45




Volevamo che il giorno del nostro matrimonio fosse tanto per i nostri ospiti quanto lo era per noi. Abbiamo pensato che la cerimonia fosse un momento intimo condiviso tra noi e loro. Avevamo un caro amico di famiglia che celebrava la nostra cerimonia, e invece di scambiarci il tradizionale "io" vestito da sera, ci siamo scambiati "noi cosa". Il ricevimento è stato una festa per i nostri amici e la nostra famiglia per celebrare questo nuovo capitolo della nostra vita, con ottimo cibo, ottimi drink e tanti passi di danza discutibili!
http://www.gillne.it

I giorni / ore che precedevano il matrimonio a volte erano stressanti, ma quando ci siamo incontrati per la prima volta nient'altro sembrava avere più importanza. Ci siamo presi questo tempo privato prima della cerimonia per scambiarci i voti che avevamo scritto e goderci la reciproca compagnia sapendo che le nostre vite insieme erano appena all'inizio.

Viviamo entrambi a Nashville da un po 'di tempo, ma non eravamo sicuri se il Tennessee fosse il posto in cui volevamo sposarci. Abbiamo iniziato a guardarci intorno e ci siamo imbattuti in La Cordelle. Il posto in sé era bellissimo e ben posizionato nel centro di Nashville. Dopo aver appreso di più sull'edificio e su come è stato costruito alla fine del 1800 e restaurato dopo essere stato quasi distrutto da un incendio abito lungo da sera, siamo stati venduti. È stato speciale per noi sposarci nella città che abbiamo incontrato e in un luogo che fa parte della storia di Nashville.
How to fix SparkFun Qwiic SHIM for Raspberry Pi
Tags: qwiic, raspberrypi, gpio, i2c
Published: 2021-06-15 00:58:59


I love Raspberry Pi with the [Qwiic connect system](https://www.sparkfun.com/qwiic) for playing with I2C devices. I've been using [SparkFun Qwiic HAT for Raspberry Pi](https://www.sparkfun.com/products/14459) in a while and I have no issue. It is nice and easy. So this time I wanted to try [SparkFun Qwiic SHIM for Raspberry Pi](https://www.sparkfun.com/products/15794), but it was disappointedly unusable. I will talk about how I fixed it.

## Excitement

More than the low price (US$1), I was very curious about how the catalog described the product.

- a small
- easily removable
- allows you to plug directly to the Pi's I2C bus with no soldering required
- uses a unique friction-based connector that wedges itself onto the GPIO header for a secure, solderless connection

Particularly the word "friction-based" intriegued me and I was excited about using it. 

## Disappointment

But as soon as it arrived, I was disappointed.
There is no friction at all. The connection is so flaky that it is almost unusable.

## Fix

So I decided to fix it. I wanted to make the Qwiic SHIM as reliable as the Qwiic HAT. Thankfully it worked out. Here is what I did.

**Extras**

- [GPIO Header for Raspberry Pi HAT - 2x20 Short Female Header](https://www.adafruit.com/product/2243)

**Tools**

- Solder iron
- Solder wire
- STANLEY 10-499 Gray,Carbon Steel Utility Knife
- Sandpaper or nail file

**How-to**

- Cut the GPIO Header in a way one end has 6 pins.
- Clean the edge with a knife and a sandpaper
- Solder

![20210614_171626](https://user-images.githubusercontent.com/7563926/121975641-16e33980-cd50-11eb-8400-43c10d3da188.jpg)

![20210614_181447](https://user-images.githubusercontent.com/7563926/121975627-0fbc2b80-cd50-11eb-86ea-25de26a312cb.jpg)

![20210614_181458](https://user-images.githubusercontent.com/7563926/121978115-8576c600-cd55-11eb-9033-0e001d6f64d3.jpg)

Now the connection is just as tight as Qwiic HAT!

## Final thoughts

It is pretty disappointing that the catalog description is misleading. If one really does not want to solder, s/he should get a Qwiic HAT in the first place. I am hoping this informs somebody.
Creating Azure Function in Csharp
Tags: azure, beginners, csharp, dotnet
Published: 2021-06-19 08:21:17

---
title: Creating Azure Function in Csharp
published: true
date: 2021-06-15 00:00:00 UTC
tags: azure,beginners,csharp,dotnet
canonical_url: https://www.rupeshtiwari.com/creating-azure-function-in-csharp/
---

## Creating Your First Azure Function in Csharp

Let’s Create Azure Function that triggers on HTTP post payload.

Run below script to start azure function.

```
func start

```

![](https://imgur.com/9TdBMvV.png)

* * *

_Thanks for reading my article till end. I hope you learned something special today. If you enjoyed this article then please share to your friends and if you have suggestions or thoughts to share with me then please write in the comment box._

## Become full stack developer 💻

I teach at [Fullstack Master](https://www.fullstackmaster.net). If you want to become **Software Developer** and grow your carrier as new **Software Engineer** or **Lead Developer/Architect**. Consider subscribing to our full stack development training programs. You will learn **Angular, RxJS, JavaScript, System Architecture** and much more with lots of **hands on coding**. We have All-Access Monthly membership plans and you will get unlimited access to all of our **video** courses, **slides** , **download source code** & **Monthly video calls**.

- Please subscribe to **[All-Access Membership PRO plan](https://www.fullstackmaster.net/pro)** to access _current_ and _future_ **angular, node.js** and related courses.
- Please subscribe to **[All-Access Membership ELITE plan](https://www.fullstackmaster.net/elite)** to get everything from PRO plan. Additionally, you will get access to a monthly **live Q&A video call** with `Rupesh` and you can ask **_doubts/questions_** and get more help, tips and tricks.

> Your bright future is awaiting for you so visit today [FullstackMaster](www.fullstackmaster.net) and allow me to help you to board on your dream software company as a new **Software Developer, Architect or Lead Engineer** role.

**💖 Say 👋 to me!**  
Rupesh Tiwari  
Founder of [Fullstack Master](https://www.fullstackmaster.net)  
Email: [rupesh.tiwari.info@gmail.com](mailto:rupesh.tiwari.info@gmail.com?subject=Hi)  
Website: [www.rupeshtiwari.com](https://www.rupeshtiwari.com) | [www.fullstackmaster.net](https://www.fullstackmaster.net)