teleren/devto huggingface dataset:
Awesome Blog Post2!
Published: 2022-01-06 07:11:21

# This is my first post!

Hello **world**!!

<!-- <img src="https://images.unsplash.com/photo-1526470608268-f674ce90ebd4" alt="world"> -->

![intro](https://urbanisierung-blogs.s3.filebase.com/0.jpg)

## Again...

hello! world!
Awesome Blog Post!
Published: 2022-01-06 07:07:29

# This is my first post!

Hello **world**!!

<!-- <img src="https://images.unsplash.com/photo-1526470608268-f674ce90ebd4" alt="world"> -->

![intro](https://urbanisierung-blogs.s3.filebase.com/0.jpg)

## Again...

hello! world!
Add Swagger to a Blazor 6 project
Published: 2022-01-06 07:02:59

If you create a new Blazor project with Visual Studio 2022 and .NET 6, you can have the option to host the webassembly part into an ASP.NET Core application.
Behind the scenes, it creates a solution with three projects: Client, Server and a Shared class with the models.
Among many things, in the server part, you have an API controller to serve data to the webassembly application.
If you start to add other REST API endpoints, after a while you need a documentation for your colleagues and for you as well.
And here, Swagger come to save your life.

## Create the project
Open Visual Studio 2022 and create a new Blazor WebAssembly project.
Choose a name and a directory.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ulmb8y4q4nktfy25gmlf.png)
 
During the wizard, remember to check "ASP.NET Core hosted". By default is unchecked.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/i4jg8q15zgb2dcagneav.png)

## Add Swagger

Add the NuGet package called "Swashbuckle.AspNetCore" and confirm all the messages.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/dxcdabmxem5l447szee1.png)

And now a few little steps to add the minimal version of Swagger in your Blazor Server project.
Open the file called "Program.cs" and add the code below after the line 9:

```csharp
builder.Services.AddSwaggerGen();
```
And the code below after the line 32:
```csharp
app.UseSwagger();
app.UseSwaggerUI(c =>
{
    c.SwaggerEndpoint("/swagger/v1/swagger.json", "Blazor API V1");
});
```
Now you can launch the project and see the result.
Try to add the url segment "/swagger" in the address and you should see an image like this:

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/azx8q05897i45uisc88r.png)
 
## Customize Swagger for your needs

And now you are ready to add other options to customize Swagger for your project.
You can find additional information at this link: https://docs.microsoft.com/en-us/aspnet/core/tutorials/getting-started-with-swashbuckle
I received a letter from myself
Tags: watercooler, webdev
Published: 2022-01-06 06:58:20


And to be precise, from my past self.

I [wrote this letter precisely a year ago](https://daily-dev-tips.com/posts/a-letter-to-my-future-self/), as a gift to myself.
And boy, oh boy, it defiantly put a smile on my face.

![Receiving a letter from myself](https://cdn.hashnode.com/res/hashnode/image/upload/v1609505787908/Br5ZrHPI-.png)

There were some things I could not have envisioned and some things I was absolutely right about.

## Reflection time

Let's go through this together, shall we?

... reading my letter ...

It's funny. I start with wanting to spend more time in nature, and I hope my past self is glad to hear we actually did spend a lot more time in nature and offline.

The big thing about the time when writing this letter was the travel bans, and one year later, we still have a lot of travel bans in place.

But needless to say, I'm writing this today from a tropical island, on which ironically enough, we got stuck 😂.

My wedding was the most beautiful day. It was exactly as I would have envisioned it, heck, even better.
I did not only take 3 days off but a whole 10 days, and it was worth it.

I am happy to inform you that besides those 10 days, I did not miss a day in blogging.

I'm super happy that I wrote this letter to myself. It was super fun to read my predictions and reflect on the past year.

## Keeping the tradition in honor

That being said, let's write a letter to Chris from the future, to be precise, 2023, Chris.

Hey Chris,

This is you, but the one a year younger.
You might even remember us reading a letter, deciding to write one, and re-reading this one now.

Another crazy year has gone by. Traveling is still a pain, but hopefully, you and your beautiful wife have finally been able to visit Europe and your family.

I know everyone was eagerly waiting to finally host you in The Netherlands.

And perhaps you even found the perfect place to stay for a longer period.

As for work, the job is still treating you well. I see you've grown so much in a year though, impressive to see where you are now and how confident you are about it.

I'm also delighted to see you've really been keeping up the exercise and outdoor adventures.
It must really mean we love the outdoors, right.

Let's take about the blog for a second. This is like your baby at this point. It's been almost 3 years since you started it, and you did a full unbroken year of blogging.

Most people would say that that's nuts but just look at the number of people you have inspired, helped, and guided in those 3 years.

Definitely worth it!
Keep doing what you love.

I hope this letter put yet another smile on your face, and you will keep this tradition in honor.

Cheers,

Chris 💖

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

Thank you for reading my blog. Feel free to subscribe to my email newsletter and connect on [Facebook](https://www.facebook.com/DailyDevTipsBlog) or [Twitter](https://twitter.com/DailyDevTips1)
Magento 2 HTML & XML SEO Sitemap Generator
Tags: html, web3, webdev, management
Published: 2022-01-06 06:47:35

The [Magento 2 sitemap generator](https://marketplace.magento.com/fme-advanced-sitemap-generator.html) extension makes it easy for you to meet the demands of search engines by automatically generating your XML sitemaps. Indexing new pages faster will reduce the time it takes for your new products to appear on Google. Operating costs than you would expect.

**Your web store should be optimized for search engines
**
They have an online store full of high demand products and their descriptions are great too. But when it comes to SEO, you have to worry about search engine bots and visitors. Google in the most appropriate way.

**The necessary pages will be found by Google's robots
**
Search engine robots need your advice to crawl your website. You use a sitemap that contains all the necessary link groups. Robots use it to index pages. With the Magento 2 sitemap extension, search engine robots can find new pages faster and more efficiently.

**Here are some of the key features
**
1. Sitemaps in XML can be generated in a variety of formats
2. Multiple sitemaps (separate sitemaps for each view of the store)
3. As needed, create and configure HTML sitemaps
4. The sitemap can be modified by adding and removing products, categories, and pages
5. Sitemap URLs are automatically updated in Robot.txt
6. Support for multiple languages and stores
Javascript- call(), apply(), bind()
Published: 2022-01-06 06:26:34

This: 
In javascript one of the most important and confusing topics is ‘this’. It's a reserved keyword, we do not use it as variable or function name. 
This means that “this” can only be used in a function, or globally. When used in either of these cases, “this” refers to the window object. When the function is a method of an object, then “this” refers to the object that the method is a member of. When the function is a constructor, then “this” refers to the instance object. There is much more to talk about with regards to what “this” means in varying scenarios, but these are the most common situations.

Call, Bind, Apply: 
	We use call, bind and apply methods to set ‘this’ keyword independent of how the function is called. This is especially useful for the callbacks.

These Three methods take the value of this or centext of this as a first argument. But call() and bind() can take unlimited arguments. On the other hand apply() can take only two arguments. First one is the value or context and the second one is an array. 

In which function we use call() and apply() method that function will be called instant. On the other hand, the bind() method did not call it instant, it returned a function definition so that we can call it later as we want.

Examples: 
const normalPerson = {
    firstName: 'shuvro',
    lastName: 'baset',
    salary: 15000,
    getFullName: function() {
        console.log(this.firstName, this.lastName);
    },
    chargeBill: function(amount, tips, tax) {
        console.log(this)
        this.salary = this.salary - amount -tips - tax;
        return this.salary;
    }
}

normalPerson.chargeBill(100);
console.log(normalPerson.salary)

const zeroPerson = {
    firstName: 'zero',
    lastName: 'person',
    salary: 5000,
}


const heroPerson = {
    firstName: 'hero',
    lastName: 'person',
    salary: 25000,
}

// i will bind chargeBill function to heroPerson
const heroChargeBill = normalPerson.chargeBill.bind(heroPerson);
heroChargeBill(2000);
heroChargeBill(1000);
console.log(heroPerson.salary)
console.log(normalPerson.salary)

// call function
normalPerson.chargeBill.call(heroPerson, 900,100,10);
console.log(heroPerson.salary)
normalPerson.chargeBill.call(zeroPerson, 2000, 200, 20);
console.log(zeroPerson.salary)


// apply
normalPerson.chargeBill.apply(heroPerson, [1000, 200, 20]);
console.log(heroPerson.salary);
normalPerson.chargeBill.apply(zeroPerson, [500, 501, 501]);
console.log(zeroPerson.salary);
Workshift - The all-in-one application for organisations
Tags: atlashackathon, mongodb, webdev, javascript
Published: 2022-01-06 06:18:35

---
title: Workshift - The all-in-one application for organisations
published: true
cover_image: https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8ggfx1zac9vuo0qn1cjj.png
description: MongoDB hackathon submission on DEV
tags: atlashackathon, mongodb, webdev, javascript
---

![Screenshot of workshift.gq](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8ggfx1zac9vuo0qn1cjj.png)

### Overview of My Submission

Workshift is an [open source](https://github.com/arnu515/workshift) application for organisations that allows organisation members to collaborate with each other. It is a realtime chat platform built on MongoDB Atlas and utilises many features provided by MongoDB Atlas and MongoDB Realm.

Link to hosted demo (might be slow because the backend is hosted on a $1 [DigitalOcean droplet](https://m.do.co/c/371591aa3027): <https://workshift.gq>

Link to source code: <https://github.com/arnu515/workshift>

### Submission Category: 

Choose your own adventure

### Link to Code

{% github https://github.com/arnu515/workshift %}

### Additional Resources / Info

![Workshift screenshot](https://workshift.gq/img/workshift.png)

Workshift uses these MongoDB Realm features:

- MongoDB Atlas for data storage
- Atlas Search for searching for users to invite
- Realm functions and triggers for sending events to Pusher when something has changed in the database
- Realm HTTPS endpoints to implement Atlas Search in the frontend without exposing secrets
- Realm hosting for storing common assets (<https://assets.workshift.gq>)

Workshift uses these additional providers:

- [Vercel](https://vercel.com) for hosting the [frontend](https://app.workshift.gq) and [landing page](https://workshift.gq)
- [DigitalOcean](https://m.do.co/c/371591aa3027) for hosting the [backend](https://api.workshift.gq)
- [Pusher](https://pusher.com) for realtime services
- [Backblaze B2](https://www.backblaze.com/b2/cloud-storage.html) for S3-compatible storage
- [Github](https://github.com) Actions for automated deployments

For information about the tech-stack and instructions on local hosting, checkout the [README](https://github.com/arnu515/workshift#readme)
I designed an iphone back with HTML and CSS. Have a look!!!!
Tags: css, html
Published: 2022-01-06 05:22:03

## So I started css recently and get to know that we can create art from css. I'm really into css art may be because I'd a past with sketching and stuff.

So here's a link!!!!
[iphone](https://codepen.io/himanshu-pal/pen/vYejNZW?editors=0100)
Self-Taught Developer Journal, Day 32: TOP Project, Rock Paper Scissors
Tags: webdev, beginners, codenewbie, devjournal
Published: 2022-01-06 05:21:37

Today I am starting on The Odin Project Rock Paper Scissors assignment.

## Understand the Problem
The game will be played between the user and the computer. The computer will be represented by the function computerPlay that will randomly return 'Rock', 'Paper', or 'Scissors'. The first function to write plays a single round of Rock Paper Scissors. The function should take two parameters, **playerSelection** and **computerSelection**, and then return a string that declares the winner of the round. The playerSelection parameter should be case-insensitive allowing the user to enter any variation, rock, RoCK, etc.

After testing the function, create a function called **game()**. The **game()** function utilizes the single round function to play a 5 round game that will keep score and return the final winner or loser at the end. The function will use console.log to return the winner or loser of each round. The prompt() will be used to get the input from the user.

## Plan
This implementation of Rock Paper Scissors does not require a graphical interface so I don't have to worry about creating any additional HTML or CSS. The game will be played and results displayed in the console. The input will be entered from the user through the prompt for each round until the end of the 5 round game. The output will display the winner or loser of each round and lastly the final winner of the game. Each output will be using console.log().

## Resources
[The Odin Project](https://www.theodinproject.com/paths/foundations/courses/foundations)
https://github.com/jennifertieuu/top-rock-paper-scissors
Vim Save Changes With Sudo
Tags: vim, linux, beginners
Published: 2022-01-06 06:07:31

---
title: Vim Save Changes With Sudo
published: true
date: 2022-01-06 05:19:48 UTC
tags: vim,linux,beginners
canonical_url: https://clavinjune.dev/en/blogs/vim-save-changes-with-sudo/
---

![Photo by @6heinz3r on Unsplash](https://images.unsplash.com/photo-1629654297299-c8506221ca97?q=50&w=1920 "Photo by @6heinz3r on Unsplash")

## Introduction

Sometimes, when you need to modify a file that needs root permission, you forgot to use sudo before open it using vim. This is quite annoying when you have changed a lot of lines, but you can't save the modification.

Even though Vim has already warned us before editing using this line:

> "W10: Warning: Changing a readonly file" -- Vim

That doesn't sounds like a warning, more like a `not-so-threatening statement`.

To avoid this problem, there are 2 ways that I know that may save your works too.

## You Don't Have Root Access Way

```
:w /tmp/my-modifications
```

You can save it to another file using `:w <accessible-path>`. Vim will write the current buffer to any path that you define there.

## You Have Root Access Way

```
:w !sudo tee %
```

Then you will be prompted to type your password and the modification will be saved. `:w !sudo tee %` will pass the current buffer to `sudo tee %` command, where `%` is your current filename.

## Conclusion

I believe this problem is annoying to you as well, I hope this article will find you.

Thank you for reading!
Selection Sort - Typescript
Tags: typescript, javascript, datastructure, programming
Published: 2022-01-06 05:09:10

Selection sort is simple and easy to implement. But it is also very inefficient in terms of time complexity.

## Time Complexity

- Best: **Ω(n^2)**
- Average: **Ω(n^2)**
- Worst: **Ω(n^2)**

In selection sort, we loop through the array by selecting the smallest value and then swapping it to the left side of the array till it is sorted in ascending order.


![Selection Sort](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gglrh4swclc6chmdoi00.gif) 

## Code
```
const selectionSort = (arr: number[]): number[] => {
    const len: number = arr.length;
    let minInd: number = -1;
    for (let i = 0; i < (len - 1); i++) {
        minInd = i

        for (let j = (i + 1); j < len; j++) {
            if (arr[j] < arr[minInd]) {
                minInd = j
            }
        }

        if (minInd !== i) {
            [arr[i], arr[minInd]] = [arr[minInd], arr[i]];
        }
    }
    return arr;
}

const result = selectionSort([64, 25, 12, 22, 11]);
```

## Output
```
Output: [11, 12, 22, 25, 64]
```

Here how the code is working
- The function takes the unsorted array [64, 25, 12, 22, 11].
- Iteration 1: [<u>11</u>, 25, 12, 22, <u>64</u>] → i = 0,  minInd = 4 and min value is 11.
- Iteration 2: [11, <u>12</u>, <u>25</u>, 22, 64] → i = 1,  minInd = 2 and min value is 12.
- Iteration 3: [11, 12, <u>22</u>, <u>25</u>, 64] → i = 2,  minInd = 3 and min value is 22.
- Iteration 4: [11, 12, 22, <u>25</u>, 64] → i = 3,  minInd = 3 and min value is 25.
- For iteration 4 it won't swap the value as the minInd and i are the same so there are no unnecessary swap.



That’s all for the selection sort, thanks for reading!
NTC Air Freight
Tags: beginners
Published: 2022-01-06 05:03:59

As an international freight forwarder, NTC has profound experience in the domain and provides multimodal door-to-door transit. We can handle all kinds of project shipment from the staging area to stow-on-board to worldwide on-site delivery.

With a network of over 750 registered partners with more than 15,000 vehicles (FTL/LTL, Primary/secondary transport), we ensure safe and on-time delivery to any destination. With our real-time tracking features, we offer options for within-a-day transit with an optional customs clearance service. With an excellent network of round-the-clock operators, we promise timely and cost-effective transportation of goods to the desired destination.[https://www.ntclogistics.in/service/international-freight-forwarding]
Fancy Progress Bar On Page Scroll
Tags: html, javascript, css, tutorial
Published: 2022-01-06 04:56:49

In this video, we will create a simple yet fancy scroll progress bar for your website using HTML, CSS and JavaScript.

{% youtube jpa7cinvS-Y%}

Easily add this scroll bar into your HTML Website and let users know how much they have scrolled on the page and how much is left to be scrolled.

This is also a fun and cool way to let users know how much an article is left or a blog post is pending to be read. 

Using the same principles this scroll progress bar could be extended for any number of purposes and designs.

#HTML #CSS #Javascript #Tutorial


https://youtu.be/jpa7cinvS-Y
Magic Numbers (in programming)
Tags: beginners, programming, webdev, java
Published: 2022-01-06 04:55:21

Today, I got feedback from a code review and learned something new. It was about ["magic numbers"](https://en.wikipedia.org/wiki/Magic_number_(programming)), which are unique values with unexplained meaning or multiple occurrences which could (preferably) be replaced with named constants.

I've known about the concept of using constants rather than hard-coding values, but I didn't think of that for "magic number" situations. It's a pretty simple concept but I just wanted to share what I learned.

## Magic Numbers are Bad

Magic numbers are language agnostic, but below, you'll see a code snippet in Java WITH magic numbers (the bad way).

```
class MagicNumber {

    String pipeDelimitedString = "This|is|an|example|of|Magic|Numbers|123 Parker Road|cityline@gmail.com";
    String [] splitString = pipeDelimitedString.split("\\|");

    obj.doSomething(splitString[7]);
    obj.doSomething(splitString[8]);           
}
```

As you can see, I am simply splitting a pipe delimited string that contains some useful data (Home Address and Email Address).

`splitString[7]` refers to the 8th element, or 123 Parker Road, which is a Home Address

`splitString[8]` refers to the 9th element, or cityline@gmail.com, which is an Email Address

## Why is that bad? We’ll it’s not easy to read.

`splitString[n]`, where n is a number, may not mean anything from an outsider looking at your code. The numbers 7 & 8 have no meaning!

Now, you’ll see a code snippet in Java WITHOUT magic numbers (the good way).

```
class MagicNumber {
  
  String pipeDelimitedString = "This|is|an|example|of|Magic|Numbers|123 Parker Road|cityline@gmail.com";
  String [] splitString = pipeDelimitedString.split("\\|");
  
  obj.doSomething(splitString[Constants.HOME_ADDRESS]);
  obj.doSomething(splitString[Constants.EMAIL_ADDRESS]);           
}

class Constants {
  
  public static final int HOME_ADDRESS = 7;
  public static final int EMAIL_ADDRESS = 8;
}
```

I’ve created a constants class, with some constants `(HOME_ADDRESS = 7 and EMAIL_ADDRESS = 8)`.

`Constants.HOME_ADDRESS` & `Constants.EMAIL_ADDRESS` are much easier to understand and now have meaning!

**If you aren’t convinced, what’s easier to read:
`splitString[Constants.HOME_ADDRESS]` or `splitString[7]`?**

Again, this is just ONE example of magic numbers but there are many more. Thanks for reading!

Thanks for reading! Check out my blog for more articles like this @ [www.anthonydellavecchia.com](https://www.anthonydellavecchia.com)
Data Recovery Mumbai - Life Guard Data Recovery
Tags: datarecovery
Published: 2022-01-06 04:42:23


Data Recovery Services in Mumbai have been working with issue hard drives for a long time and ensure a positive outcome in 90% of cases. 
https://lifeguarddatarecovery.in/data-recovery-mumbai/
Contact No: 040-66386333 | +91 8977544544
Data Recovery Bangalore - Life Guard Data Recovery
Published: 2022-01-06 04:41:18


Data Recovery Services in Bangalore have been working with issue hard drives for a long time and ensure a positive outcome in 90% of cases. 
https://lifeguarddatarecovery.in/data-recovery-bangalore/
ismail@lifeguarddatarecovery.in 
Contact No: 040-66386333 | +91 8977544544
Customize the Appearance of Blazor Pivot Table Using Templates and Conditional Formatting
Tags: blazor, webdev, dotnet, csharp
Published: 2022-01-06 04:28:34

Learn how to customize a Syncfusion [Blazor Pivot Table](https://www.syncfusion.com/blazor-components/blazor-pivot-table) easily using templates and conditional formatting in a Blazor WebAssembly app. 

This video explains how to customize the appearance of Pivot Table cells using a cell template and apply conditional formatting to value fields programmatically. 

Tutorial video: https://www.syncfusion.com/tutorial-videos

{% youtube C2w2KWKc0f8 %}
Kazakhstan and BTC: What would happen to BTC if its hash rate suddenly drops?
Tags: crypto, discuss
Published: 2022-01-06 03:48:44



On the 5th of January 2022, Kazahstan answered this question. On this day, the Kazakhstan government has increased prices on gas 2x, leading to protests which caused the government [to shutdown Kazakh internet for 7 hours](https://blog.cloudflare.com/internet-shut-down-in-kazakhstan-amid-unrest/). 

18.10% of the world hash rate is in Kazakhstan, according to https://ccaf.io/cbeci/mining_map. In other words, 18.10% of the hash rate has vanished from the BTC network.

VP of Research at [The Block](https://www.theblockresearch.com/) also found that the drop in hash rate was 12%.

{% twitter 1478764142957846531 %}



So we predict that the same number of BTC transactions will go through a smaller number of nodes; thus, BTC transaction fees will go up.

Let's double-check it with [Glassnode data](https://studio.glassnode.com/metrics?a=BTC&category=Miners&chartStyle=column&ema=0&m=fees.VolumeSum&mAvg=0&mMedian=0&s=1635724800&u=1638748799&zoom=) and indeed the fees have went up.


## How does it affect the BTC price? 
Unfortunately, I don't know. BTC prices went down today, but the stock market also fell. It seems unlikely to be related to Kazahstan events and BTC fees. Some say that the fall in BTC and the stock market is related to the US government's announcement of interest rate hikes.

TLDR: If hashrate disappears, fees go up :shrug: