teleren/devto huggingface dataset:
Lazy and Eager Loading in Asp.net core Web API
Tags: webdev, programming, opensource, aspdotnet
Published: 2023-05-22 21:04:13

When using an object-relational mapper (ORM) like Entity Framework Core, the ASP.NET Core Web API supports both lazy loading and eager loading as two distinct methods for loading related entities in an object graph. Examining each strategy in turn.
### 1. Lazy Loading:
Related entities are not explicitly accessed before being loaded from the database using the method known as lazy loading. With less data being downloaded from the database, efficiency is improved since you may access the primary entity without loading any of its dependent entities. The ORM will automatically send a query to the database to retrieve the pertinent data whenever you access a navigation property of an entity.
To enable lazy loading in Entity Framework Core, you need to install the `Microsoft.EntityFrameworkCore.Proxies` package and configure your context to use lazy loading proxies. Here's an example:
```csharp
public class YourDbContext : DbContext
{
    protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
    {
        optionsBuilder.UseLazyLoadingProxies(); // Enable lazy loading
    }

    // ...
}
```
By default, lazy loading is disabled in Entity Framework Core to promote explicit loading and prevent potential performance issues caused by unintentional lazy loading.
### 2. Eager Loading:
A single query is used for eager loading, which involves loading the main entity as well as all linked entities. The quantity of database roundtrips is decreased because you can get all the necessary data upfront. When you anticipate needing the corresponding data and wish to avoid the performance overhead of lazy loading, eager loading is advantageous.

You can define related entities to be eagerly loaded in Entity Framework Core by using the 'Include' function. As an illustration, consider the following.
```csharp
// Fetch a list of customers with their orders
var customers = context.Customers
    .Include(c => c.Orders)
    .ToList();
```
In this example, the `Orders` navigation property of the `Customer` entity is eagerly loaded along with the customers themselves.
Eager loading can be further customized using the `ThenInclude` method to load multiple levels of related entities.
```csharp
// Fetch customers with orders and order items
var customers = context.Customers
    .Include(c => c.Orders)
        .ThenInclude(o => o.OrderItems)
    .ToList();
```
In this example, both the `Orders` and `OrderItems` navigation properties are eagerly loaded.
Both lazy loading and eager loading have their pros and cons, and the choice depends on your specific requirements and performance considerations.
PR Labeler: Simplify Repo Maintenance with Automated Labels and More
Tags: githubhack23, opensource, github, community
Published: 2023-05-22 21:03:39

## What I built 

Hey there! I've built a super handy GitHub Action that's all about making the lives of repo maintainers a breeze.

## ✨ Features

- Add labels for the current and required number of reviews
- Pop in a "Work in Progress" label for draft PRs
- Keep an eye on a target branch (like staging) to make sure all the current PR commits are there

### Category Submission: 

Maintainer Must-Haves

### App Link

You can find the action right here: [GitHub Repository](https://github.com/2KAbhishek/gh-pr-labeler)

### Description

So, here's the deal: my GitHub Action is all about helping repo maintainers tackle their daily tasks with ease. It offers some nifty features, like automatically adding labels based on review counts, throwing in that "Work in Progress" label for those draft PRs, and even letting you track if all the PR commits exist on a specific target branch. It's all about making your life simpler!

### Link to Source Code 

Feel free to check out the source code over at: [GitHub Repository](https://github.com/2KAbhishek/gh-pr-labeler)

### Permissive License 

MIT

## Background

Alright, so let me share a little story with you. I've had my fair share of struggles when it comes to finding PRs that desperately need some reviews. On top of that, I often found myself wondering if all the changes in my current PR actually made it to the staging/test branch. It was a real headache! That's why I built this action—to help me out (and hopefully you too!) by solving these pesky problems once and for all.

### How I built it

I hopped on the GitHub Actions train and made great use of the Actions Toolkit provided by GitHub. Along the way, I learned some cool stuff about the updated API and YAML syntax. Now, if I could offer some feedback, I'd love to see better ways to debug and test GitHub Actions. And boy, a faster feedback loop would be a game-changer, trust me! Making those improvements would make the whole development experience a whole lot smoother.

That's it! Hope you find my GitHub Action as useful as I do. Happy maintaining!
Ace the "What was your greatest professional achievement" question in your next interview.
Tags: career, careerdevelopment, interview
Published: 2023-05-22 21:00:00

As a job seeker, one of the most challenging interview questions to answer is, "What was your greatest professional achievement?" It's easy to freeze up and struggle to come up with a response that showcases your skills and accomplishments in the best light. However, with the right preparation and mindset, you can ace this question and impress your interviewer.

First and foremost, it's essential to understand the purpose of this question. The interviewer isn't just looking for a list of your accomplishments - they want to know how you define success and how you've achieved it in your career. In addition, they want to understand your approach to problem-solving, your work ethic, and your ability to set and reach goals. So, before you even step into the interview, take some time to reflect on your career and identify your proudest achievements.

Once you've identified your top achievements, it's time to craft a compelling answer to the question. Start by providing some context around the situation or challenge you faced. This could be anything from leading a successful project to overcoming a major obstacle in your job. Again, be specific and paint a vivid picture for the interviewer.

Next, you should focus on the actions you took to achieve your success. This is where you can really showcase your skills and strengths. Were you able to think outside the box to find a creative solution? Did you lead and inspire a team to reach a common goal? Did you take on a difficult task and succeed against all odds? Highlight the skills and qualities you used to overcome the challenge and achieve your goal.

Finally, don't forget to talk about the results of your achievement. What impact did your success have on the company or organization? Did it result in increased revenue, improved efficiency, or a better customer experience? Quantify your achievements with specific numbers or metrics. This will give the interviewer a clear understanding of the value you bring to the table.

Remember, your greatest professional achievement doesn't have to be a huge, earth-shattering accomplishment. It could be something as simple as solving a difficult problem for a customer or going above and beyond to meet a tight deadline. What's really important is your ability to articulate the situation, actions, and results clearly and compellingly.

In summary, when answering the question "What was your greatest professional achievement?" in an interview, take the time to reflect on your career and identify your proudest accomplishments. Then, craft a compelling answer by providing context, highlighting the actions you took, and quantifying the results. With a little preparation and confidence, you can ace this question and showcase your skills and accomplishments to your potential employer.
Perks, grants and discounts for startups
Tags: startup
Published: 2023-05-22 20:41:06

Here is a curated list of grants and perks for early-stage companies. If you have something to add to this list - please let me know.

- **Amazon AWS** https://aws.amazon.com/activate/ - up to $100k in AWS credits to cover your AWS service usage
- **DigitalOcean Hatch Program** https://www.digitalocean.com/hatch - 12 months of infrastructure credit
- **Google for Startups Cloud Program** https://cloud.google.com/startup/apply - up to $200,000 in cloud credits over 2 years
- **Intercom** https://www.intercom.com/early-stage - 10 Seats of Support Pro, 5 Seats (1,000 People Reached) of Engage Pro and Product Tours add-on for 1,000 Guided People for $65/month
- **JetBrains** https://www.jetbrains.com/shop/eform/startup - 50% off all JetBrains Tools
- **Microsoft** https://startups.microsoft.com/ - $150,000 in free Azure credits, free access to GitHub Enterprise, Azure OpenAI Service, VS Code, Microsoft 365 including Office and Teams, LinkedIn, and more
- **Miro** https://miro.com/startups/ - $1000 credit and 20% discount
- **Retool** https://retool.com/startups - up to $25K in Retool credits for a year
- **Twilio Segment** https://segment.com/industry/startups/ - $25,000 in Segment credits
- **Zendesk** https://www.zendesk.com/startups/ - free for six months
Javascript 101: Generating a Random Number
Tags: javascript, programming, beginners, webdev
Published: 2023-05-22 20:19:22

Hey there, fellow coders and tech enthusiasts! Today, we’re diving into the wonderful world of coding snippets. 🚀

If you’ve spent any time in the vast realm of programming, you’ve likely come across those bite-sized chunks of code that very quickly solve common problems or add nifty functionalities to your projects. We’re talking about those trusty companions that make our coding journey smoother and more efficient.

Here we’ll be exploring some of the most commonly used coding snippets, that you might require one day, whether you’re a seasoned pro or just starting your coding adventure. These snippets will surely come in handy and save you precious time and effort.

**Generating a Random Number**:

```
function getRandomNumber(min, max) {
  return Math.floor(Math.random() * (max - min + 1)) + min;
}

// Usage example
const randomNumber = getRandomNumber(1, 100);
console.log(randomNumber); // Output: Random number between 1 and 100
```

Here I have used a built-in function called `Math.random()` that generates a pseudo-random decimal number between 0 (inclusive) and 1 (exclusive)

```
Math.Random()
// 0.6252474231132967

Math.Random()
// 0.03772396106405407
```

And when we multiply it with an integer N, it scales the range of the generated random number to be between 0 (inclusive) and N(exclusive).

```
Math.random()*8
// 2.27924218449437

Math.random()*80
// 13.722102542882197
```

`(max - min + 1)`, calculates the range of possible values by subtracting the minimum value (`min`) from the maximum value (`max`) and adding 1(to include the upper bound). You can drop the 1 if you want to exclude the upper bound.

```
(5 - 0 + 1)
// 6 ==> Math.random()*6 will generate in range (0-5)

/* Without the 1 */
(5 - 0)
// 5 ==> Math.random()*5 will be in range (0-4)
```

The `Math.floor()` function is used to round down the decimal number obtained in the previous step to the nearest integer. This ensures that the final result will be an integer.

```
Math.random()*5
// Will look like - 1.359376633672147

/* We need to drop the decimal part*/
Math.floor(Math.random()*5)
// 1 
```

`Math.floor(Math.random() * (max - min + 1)) + min`: Lastly, by adding the minimum value (`min`) to the randomly generated integer, we shift the range to start from the minimum value and end at the maximum value. This results in a random integer within the desired range, inclusive of both the minimum and maximum values.

```
/* min=0, max=5 */
Math.floor(Math.random()*5)
// 2 || 3 || 0

/* To generate in a range (5-10) */
Math.floor(Math.random()*(10 - 5 + 1)) + 5
// 6 || 8 || 10
```

In this post, we covered generating random numbers. Remember to adapt and customize the code to suit your specific requirements. JavaScript’s versatility and these code snippets will undoubtedly elevate your coding prowess and productivity.
Music Monday — What are you listening to? (Blues Edition)
Tags: watercooler, discuss, music
Published: 2023-05-22 20:09:32

_cover image source: [PBS Digital Studios](https://giphy.com/gifs/pbsdigitalstudios-blues-music-mississippi-delta-Ixd08lMa0DdpIh4v4K)_

**So, last week we covered [Jazz](https://dev.to/devteam/music-monday-what-are-you-listening-to-jazz-edition-519k) and this week we're turning our heads to another great old genre that we have Black Americans to thank for, the Blues! The Blues are in the roots of rock'n'roll and well, pretty much all modern music. I can't compete with Wikipedia, so if you wanna read up on the history and influence of the Blues, check out the entry [here](https://en.wikipedia.org/wiki/Blues). One reason I chose this genre for this week is that over the weekend I went up to the Appalachian Mountains to meet up with my cousins and jam. My cousin Scott has been deep into the blues and slide guitar... he showed us tunes by [Junior Kimbrough](https://en.wikipedia.org/wiki/Junior_Kimbrough), [Skip James](https://en.wikipedia.org/wiki/Skip_James), and [R.L Burnside](https://en.wikipedia.org/wiki/R._L._Burnside) and I was absolutely blown away. I'm now digging through the virtual crates to feed my rekindled interest in Blues music.**

![Pictures of Blues legends: Muddy Waters, Robert Johnson, and Son House](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4jwao4tg8gqyyni8y1ah.gif)

***

## How we do 

In this weekly series, folks can chime in and drop links to whatever it is they've been listening to recently + browse others suggestions. You can follow the suggested genre if you'd like, but don't feel confined to it; you're free to suggest whatever you wanna. 🙌  

If you're interested in having other discussions about music, consider following the aptly named [#music discussions](https://dev.to/music-discussions) organization.

{% embed https://dev.to/music-discussions %}  

***

Take me up to Chicago, down into the Delta, or anywhere else where they're making Blues music! _Note: you can embed a link to your song using the following syntax `{% embed https://... %}`. This should work for most common platforms!_

Looking forward to listening to y'all's suggestions! 🎶
AWS Config Service
Tags: aws, cloud, security, iam
Published: 2023-05-22 19:50:43

![Day05](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3g7ee940dqxmgig34izn.png)

[5/30] #30DaysOfAWS Today, AWS Config & Hands-On.

**AWS Config** is a service provided by Amazon Web Services (AWS) that helps you assess, audit, and evaluate the configuration of your AWS resources. It enables you to maintain a record of configuration changes over time, monitor resource configurations for compliance with desired policies, and detect potential security and operational issues.

AWS Config continuously tracks changes made to your AWS resources and captures detailed configuration information. This information is stored in a configuration history, allowing you to view the state of your resources at any point in time and understand how they have changed over time. AWS Config can capture configuration details for a wide range of AWS resources, including EC2 instances, S3 buckets, IAM roles, RDS databases, and many others.

By using AWS Config, you can gain visibility into the configurations of your resources, track changes, and identify any non-compliant configurations. It provides a centralized view of your AWS environment and helps you ensure that your resources are properly configured according to your organization's requirements, security standards, and best practices.

Additionally, AWS Config integrates with other AWS services, such as AWS CloudTrail, AWS Lambda, and Amazon Simple Notification Service (SNS), allowing you to automate actions based on configuration changes, trigger notifications, and remediate any configuration drift or non-compliant settings.

Overall, AWS Config provides you with the means to maintain better governance and compliance of your AWS resources by giving you insights into the configuration state of your infrastructure and enabling you to respond effectively to any configuration changes or compliance issues.

**Step-by-step tutorial** for how to use AWS Config. AWS config is **not part of the free tier**. If you do this hands-on you want to pay. You can download it using this [URL](https://lasantha-fileshare-s3-932747549174-v1.s3.us-east-2.amazonaws.com/AWSConfigHandsOn.pdf).

Thanks for reading the Article.
Advantages and the disadvantages of serverless computing
Tags: webdev, programming, javascript, tutorial
Published: 2023-05-22 19:34:09

**What is serverless computing**

Serverless computing is a concept whereby businesses or  developers focus more on building the front-end aspect of their application and other aspect of their business without worrying about the servers or the back-end infrastructure.

It allows developers to write front-end codes and package it in a container which are managed by cloud service providers like Azure, AWS, IBM, Google Cloud.

Many people are confuse about this concept, they think that "serverless computing" means that an  application does not use servers, but it simply means that the server or the back-end infrastructure is not being handled by developers but by cloud service providers.

Serverless computing is a very good concept but it has it`s own pros and cons, we will explore some of the advantages and the disadvantages of serverless computing.


**Advantages of serverless computing**

1.**It saves time**: Building an application takes time, it involves some many processes, from the front-end to the back-end and other aspects. Serverless computing will save you a lot of time by not handling your back-end infrastructure by yourself.

2.**It`s cost effective**: Serverless computing allows you to only pay for what you use, you do not have to pay for  idle resources.

3.**Flexibility**: Cloud service providers scales up your application automatically based on the workload without your intervention.


**Disadvantages of Serverless computing**

1.**Security**: Serverless computing might make you to give some of your private information to another company that might not protect it.

2.**Complexity**: When their is an issue with serverless computing, it is much difficult to easily find the problem.

3.**Unfair contracts**: Some cloud service providers might urge you to sign some crazy contracts that might hurt you in future.

**Conclusion**
Serverless computing allows you to focus more on the front-end aspect of your application while cloud service providers handles your back-end infrastructure. It has some many advantages like: cost effective, flexibility and it saves time. It also have it`s own disadvantages like privacy issues, unfair contracts and complexity. Serverless computing can help you focus more on building your applications, while will be very helpful to the growth of your application.
Understanding Lexical Environment in JavaScript
Tags: webdev, javascript, programming
Published: 2023-05-22 19:31:27

Lexical Environment is a fundamental concept in JavaScript that plays a crucial role in variable scope and execution context. Let's dive into this concept and understand its significance in JavaScript development.

In JavaScript, a Lexical Environment consists of two main components: the Environment Record and the outer environment reference. **The Environment Record is a record of all variables and functions defined within a particular scope, while the outer environment reference points to the Lexical Environment of the parent scope**.

Lexical Environment allows JavaScript to determine variable scope at the time of compilation. When a function is defined, a new Lexical Environment is created, capturing the variables and functions within its scope. This environment is stored in memory and used when the function is invoked, ensuring access to the variables defined in its original scope.

The concept of Lexical Environment is particularly important when it comes to closures. Closures are created when a nested function references variables from its outer scope. The Lexical Environment ensures that the nested function maintains access to those variables even after the outer function has completed execution.

Understanding Lexical Environment helps developers write clean and efficient JavaScript code. It enables precise variable scoping, prevents naming conflicts, and allows for the creation of powerful closures.

When working with Lexical Environment, it's essential to be mindful of variable hoisting and the scope chain. Variables declared with `var` are hoisted to the top of their scope, while variables declared with `let` and `const` follow block-level scoping rules.

In conclusion, **Lexical Environment is a fundamental concept in JavaScript that determines variable scope and enables the creation of closures**. By understanding how Lexical Environment works, developers can write better code and leverage the full power of JavaScript's scoping mechanisms.

So, the next time you're working with JavaScript, take a moment to appreciate the role of Lexical Environment and how it contributes to the language's flexibility and functionality.

Feel free to share your thoughts and experiences with Lexical Environment in the comments below. Happy coding!

(Note: This post is an introduction to Lexical Environment and doesn't cover all aspects and intricacies. Further exploration and study are encouraged for a more in-depth understanding.)
BSU International Journal of Humanities and Social Sciences
Published: 2023-05-22 19:29:13

BSU International Journal of Humanities and Social Sciences BSU. hum. SOC (BIJHSS) is an open-access journal‏ ‏Published semi-annually; all published ‎articles are available immediately online at no ‎charge from authors or readers. All articles of  BSU International Journal of Humanities and Social Sciences BSU. hum. SOC (BIJHSS) are published ‎under the open license  CC BY-NC ((Creative Commons Attribution-NonCommercial 4.0 International)) which allows immediate free access to ‎the work and permits any user to read, download, ‎copy, distribute, print, search, or link to the full texts ‎of articles, crawl them for indexing, pass them as data ‎to software, or use them for any other lawful purpose.‎

It aspires to publish high-quality original ‎research ‎articles, review articles, short ‎communications, and ‎case reports, which ‎focus on at least one of the social ‎sciences and ‎humanities topics, and have not ‎been ‎published or considered for publication ‎elsewhere.‎

Providing authentic distinctive ‎research ‎and ‎producing knowledge that serves ‎society and ‎supports ‎intellectual creativity in ‎the field of social ‎sciences and humanities. In ‎particular, social studies, ‎arts, and humanities, ‎as well as historical and ‎geographical studies

The editorial board of the journal follows the ‎rules of ‎scientific refereeing followed by ‎scientific journals to ‎determine the validity of ‎the articles and papers ‎submitted to it. Each ‎paper is published after  ‎written approval by ‎at least two referees. ‎
Postman Tests
Tags: postman, testing
Published: 2023-05-22 19:23:00

From my Udemy course: [https://www.udemy.com/course/postman-the-complete-guide/]

Learned how to test my HTTP Requests and Collections.
Enjoyed putting my rudimentary JavaScript skills to work while building my tests.

`//Constant Defined
const response = pm.response.json();
//Tests
pm.collectionVariables.set('productId', response.id);
console.log(pm.collectionVariables.get('productId'));

pm.test("Status code is 200", () => {
    pm.response.to.have.status(200);
});`