teleren/devto huggingface dataset:
Commit messages done the right way
Tags: git, commit, message
Published: 2022-12-19 08:26:09

We have all seen it. You see something in your source code. You do not know why it was added. And you look at the commit history. And then you see: "fix bug" or "add feature name". How helpful is that message?
In this blog post I will address how you can write commit messages that are helpful. And optimized for the reader.

So, why is this important?
--------------------------

Most agile teams need peer reviews. The most common or well known way is via [pull requests](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/about-pull-requests).  
When you introduce a change. For a feature or fixing a bug.
The question your peer reviewer will have is: Why this change was made. And then continues to look at the changes.
You create a pull request on one or more commit messages. A commit describes the why of a change. When you create a pull request you can use these commit messages when you create your pull request.

Example commit
--------------

> fix input

Or:

> fix: white spaces on input
> 
> Remove the leading and trailing spaces. This will clean the input before we save it to the database.
> 
> Issue: #123

This is the difference between writing a commit message. And writing a useful commit message.  
Useful commit messages explain why the change was made.
When you create a pull request you can use the commit messages as input. And draft a useful pull request description for your reviewer.

Commit format
-------------

I am a big fan of the [conventional commits](https://www.conventionalcommits.org/en/v1.0.0/) format. But the most important thing is that you write down why the change was made.  
Not what the change is.
The changes are already displayed when you do a `diff` between commits/branches. So describing what has changed does not make sense.  
The reason why that is in the authors head. And unless you add it in a commit message that information gets lost.
By doing this you create a better historical overview. And it makes it easier to create pull requests.

Conclusion
----------

When you optimize your commit messages for the reader. The reader does not need to go on a scavenger hunt.  
And it creates a better historical overview of why changes are made in your repository.
C# Initialize a List of Size n
Tags: csharp
Published: 2022-12-19 08:24:03

If you want to initialize a list of fixed size n, how should we do this in C#? 

First, you should consider just use `array`. After all, why bother use List if you already know how much elements are there? I mean, you should use List when you don't yet know how many elements are to be... 

```C#
int[] arr = new int[n];
```

However, if you insist, here is how: 

```C#
// most straightforward way 
List<int> L = new List<int> (new int[n]); 
```

## Side remark
**Be cautious**, `new List<int> (n)` will give a list of `capacity n`, instead of a list of length n! 

```C#
using System;
using System.Collections.Generic; 
					
public class Program
{
	public static void Main()
	{
		int n = 10;
		List<int> L = new List<int> (n);
		Console.WriteLine("Count = " + L.Count); 
		Console.WriteLine("Capacity = " + L.Capacity); 
	}
}
```
This gives: 
```
Count = 0
Capacity = 10
```

## Reference
https://stackoverflow.com/questions/466946/how-to-initialize-a-listt-to-a-given-size-as-opposed-to-capacity
Integration testing in Umbraco 10+: Extending the backoffice
Tags: umbraco, testing, dotnet, webdev
Published: 2022-12-19 08:20:52

This post builds upon what we did in [my previous post where I introduced integration testing in Umbraco](https://dev.to/d_inventor/integration-testing-in-umbraco-10-in-4-easy-steps-38an).
If you've followed along and set up your own integration testing project, you may have been tempted to try it out on a backoffice controller. You'll be disappointed to find out that your requests are rejected by authentication. In this post I'll be explaining how to fix that:

## Authentication in Umbraco
Umbraco authorizes requests to the backoffice with the framework that asp.net provides. You can get more in-depth understanding of how that works in [the microsoft documentation about authentication and authorization](https://learn.microsoft.com/en-us/aspnet/core/security/authentication/?view=aspnetcore-7.0). All you need to know for integration testing is that authorization works with policies, which are collections of requirements, and that we can modify these collections.

To make our integration tests work in the backoffice, we will redefine the requirements for the backoffice so that we will always have access.

## Making the modifications
The first thing that we need is a new requirement:
```csharp
internal class TestRequirement
    : IAuthorizationRequirement
{ }
```

The next thing we need is a handler that can tell the framework that this new requirement is met:
```csharp
internal class TestAuthorizationHandler : AuthorizationHandler<TestRequirement>
{
    protected override Task HandleRequirementAsync(AuthorizationHandlerContext context, TestRequirement requirement)
    {
        context.Succeed(requirement);
        return Task.CompletedTask;
    }
}
```

Finally, we need to change `MyCustomWebApplicationFactory` and replace the original authorization requirements with our new one:

```csharp
protected override void ConfigureWebHost(IWebHostBuilder builder)
{
    // ... Everything that was here before (see previous blog post)

    builder.ConfigureServices(ConfigureServices);
}

private void ConfigureServices(IServiceCollection obj)
{
    // Register our newly created handler so it can be picked up by the authorization framework
    obj.AddSingleton<IAuthorizationHandler, TestAuthorizationHandler>();

    obj.AddAuthorization(options =>
    {
        options.AddPolicy(AuthorizationPolicies.BackOfficeAccess, policy =>
        {
            // Take Umbraco's backoffice policy, remove all requirements and add our new requirement here.
            policy.Requirements.Clear();
            policy.AddRequirements(new TestRequirement());
        });
    });
}
```
And that is all!

## Conclusion
Once again, Umbraco makes our life surprisingly easy. I wasn't expecting this little effort to make integration tests in Umbraco backoffice controllers work.

Leave a comment if you have any questions, remarks or feedback, I would love to hear your opinion!
How much experience do you need for a Kubernetes job?
Tags: kubernetes, devops, career, productivity
Published: 2022-12-19 08:11:13

***78% of the jobs that mention experience specified a senior-level experience!***

How many years of experience equates to senior-level experience? What about junior roles? Do most of the companies mention experience requirements?

Let's try to answer some of the above questions (and perhaps more) with [Kube Careers](https://kube.careers) job listings data for Q3 2022 (July to September).

Before you read further, know that:

- At Kube Careers, we only include job listings with a clear salary range and which have Kubernetes as a requirement and not a nice to have/plus.
- Our dataset is small, with 86 job listings from July to September 2022.

## How much experience do companies seek?

In this quarter, only *27%* of the jobs mentioned an experience requirement such as senior, mid-level or junior. 

![Work experience mentioned in job descriptions](https://user-images.githubusercontent.com/72087695/197865021-2b97858f-eb25-4497-a7a5-c44eb13bc786.png)

_Was this metric any different in Q3 2021?_

**Slightly**.

In the same quarter last year, almost *40%* of the job listings mentioned an explicit experience requirement.

![Work experience mentions in job descriptions (year-on-year)](https://user-images.githubusercontent.com/72087695/197866069-e636659b-43e1-4dd7-849a-4308021937e9.png)

### Of the ones that mention experience, what is the polarity?

From the numbers, it's undeniable what the companies are looking for: **Senior-level** experience.

This quarter, of the job listings that mention experience, *78%* mentioned senior-level (4-6 years) experience.

The mid-level (2-3 years) experience came in at *17%*, and a distant third was the veteran level (7+ years) experience at *4%*.

And sadly, there wasn't a single mention of a junior-level (0-1 years) experience in our listings for this quarter.

![Work experience preference](https://user-images.githubusercontent.com/72087695/197867429-b58a839b-fb37-4071-bc0b-70dbeff93415.png)

### What was the trend in Q3 2021?

*Wasn't very different.*

Commonalities between the two quarters and takeaways for us:

1. Senior-level (4-6 years) experience is the most sought-after.
2. Junior-level roles are very scarce!
3. Veteran-level (7+ years) experience is scarce too! (I guess we all knew that)

Did you like what you read?

Click [here](https://kube.careers/kubernetes-trend-report-2022-q3) if you'd like to read our detailed job trends report for Q3 2022, which includes salary ranges, popular technologies, popular skills listed in job descriptions, and much more.
Today's Fun Joke For Developers - Daily Developer Jokes
Tags: jokes, dailydeveloperjokes
Published: 2022-12-19 08:00:24

---
title: "Today's Fun Joke For Developers - Daily Developer Jokes"
description: "Check out today's daily developer joke! (a project by Fred Adams at xtrp.io)"
series: "Daily Developer Jokes"
published: true
tags: #jokes, #dailydeveloperjokes
---

Hi there! Here's today's Daily Developer Joke. We hope you enjoy it; it's a good one.

![Joke Image](https://private.xtrp.io/projects/DailyDeveloperJokes/public_image_server/images/5e12596739999.png)

---

For more jokes, and to submit your own joke to get featured, check out the [Daily Developer Jokes Website](https://dailydeveloperjokes.github.io/). We're also open sourced, so feel free to view [our GitHub Profile](https://github.com/dailydeveloperjokes).

### Leave this post a ❤️ if you liked today's joke, and stay tuned for tomorrow's joke too!

_This joke comes from [Dad-Jokes GitHub Repo by Wes Bos](https://github.com/wesbos/dad-jokes) (thank you!), whose owner has given me permission to use this joke with credit._

<!--
Joke text:
___Q:___ Why couldn't the React component understand the joke?

___A:___ Because it didn't get the context.
 -->
What is reverse-email-lookup
Published: 2022-12-19 07:55:49

In today's world where email scams can be done to easily and a person can really authenticate it and can be scrammed, Here is a product which can be useful in different aspects. 

this tool can save you from different types of scam's and can be be useful in different ways 

**Scams & Fraud Prevention**
In today's world where there is a proliferation of scams, it's worth worrying about your own security. But luckily, you can use a reverse email lookup to verify the identity of the emails, to further protect yourself from theft and risks.

**Verification of Ecommerce Transactions**
one important use case is to check and verify an online buyer or seller especially when e-commerce shopping is so prominent today

**HR Talent Identification**
Hiring HR recruitment firms gathering all the information available on the candidates and filter them accurately to fast-track the hiring process. Using a simple email search, they can also retrieve relevant information that is not disclosed by the candidates

**Lead Generation**
in sales and lead generation. Using a reverse email lookup, sales team can qualify leads accurately, thus cutting down time wasted to work on leads and instead, focus on getting sales quicker and more efficiently.

**Credit Risks Analysis**
Financial firms, especially those that extend credit and loans to their customers, can identify the risk level of a prospective customer before dealing with them based on the data that they are able to obtain from a reverse email lookup.

**You can read more about it on this link**
[3 Simple Methods To Do Reverse Email Lookup](https://nubela.co/blog/3-simple-methods-to-do-reverse-email-lookup/?utm_campaign=writers%20domain&utm_source=social&utm_medium=review&utm_content=3%20reverse%20email%20lookup)

Follow for more on [YarCoder](https://www.youtube.com/@YarCoder)
Cakephp Upgrade from 2.9 to 4.0
Tags: cakephp
Published: 2022-12-19 07:39:33

I am trying to upgrade cakephp 2.9 to cakephp 4.0. We use the given tool in cakephp website (https://book.cakephp.org/3/en/upgrade-tool.html).

I follow the instruction mention in above url. It just copy files from location to location but not mapped with cakephp 4 MVC version. Please suggest
Godot Docs Simplified: Part 0 Introduction
Tags: godot, gamedev, csharp, webdev
Published: 2022-12-19 07:39:04

## Introduction

This is mostly just a simplified and digestable series for you to understand what Godot is the simplest way possible.

### What is Godot?

Godot is a general purpose game development engine. You can develop 2D and 3D games for Desktop, Smartphone, or for the Web.

You can also create applications that need an interactive GUI.

### Games and Apps made with Godot

**Ex-Zodiac**
![alt Ex-zodiac](https://docs.godotengine.org/en/stable/_images/introduction_ex_zodiac.png)

**Pixelorama: PixelArt tool**
![alt Pixelorama](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7enmgol8ufh5bnsvycrs.png)

**RPG in a Box: RPG Voxel game builder**
![alt RPG in a Box](https://docs.godotengine.org/en/stable/_images/introduction_rpg_in_a_box.png)

### Aspect

Just like your typical game engine: tilemaps, resources, textures, etc.:

![alt Godot](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/f9kncrr0p8yx3xhb9sll.png) 

### Programming Languages

For editing purposes you can use [VSCode](https://code.visualstudio.com/) and [Emacs](https://www.gnu.org/software/emacs/) for GDScrpt or C# development. Also Godot supports animations from 3D [Blender](https://www.blender.org/)

### What do you need to learn Godot
- Fundamental Code Experience (_OOP, DataStructures, Algorithms_)
- These fundamentals can be self-taught on this free [Harvard Course](https://cs50.harvard.edu/x) for Computer Science Fundamentals.
360 Total Security Free Antivirus For PC - Latest Version
Tags: software, softwareinformation
Published: 2022-12-19 07:06:31

360 Total Security Introduction

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

360 Total Security is a top notch antivirus to shield your Windows PC from malware, phishing, and other malignant assaults. With a straightforward and clean point of interaction, the instrument furnishes you with a few elements. The instinctive feel of the UI makes it more straightforward to explore through various settings. Since it's a lightweight program, it doesn't influence framework execution and moves along as planned behind the scenes. Probably the most conspicuous highlights of 360 Absolute Security Premium incorporate security assurance, secure perusing, and sandboxing. There's likewise a 360 Complete Security Premium form, which accompanies progressed highlights.

Free Comprehensive Virus Scans:

360 Complete Security is a free antivirus program. As a feature of the instrument, you get an exhaustive PC upkeep suit and a power-pressed security device. The program safeguards your PC from infections, ransomware, phishing, spyware, and malware assaults. At the center of the sweep motor and computer based intelligence motor, 360 Absolute Security utilizes similar advancements and motors accessible on Bitdefender and Avira.

Furthermore, the antivirus programming offers webcam security, shopping insurance, and keylogger obstructing. While utilizing the program, you can likewise profit from programmed Wi-Fi security checks, while the instrument puts in new fixes for Adobe, Java, Win, and a few other well known applications. As referenced before, 360 Absolute Security accompanies different PC support apparatuses, and thusly, speeds up the working framework.
Keeping the tedious fun with Curl.
Tags: curl, vim, webdev
Published: 2022-12-19 05:27:24

I like to keep the day job fun and productive by semi automating the everyday tediousness of web development.
The main reason I use curl is to search a file to see if a webpage has the desired string or not.
Its nice to be able to stay on the commandline to do this as its quicker then the manual process of

-   open chrome,
-   right click,
-   view source code,
-   command f to find the string
-   bang head against monitor

Running the curl function below allows me to open the returned html in my favourite code editor, Vim.

This way i can easily search the returned source code by simple typing '/string_name'.

## function to add to bash_profile


```bash
#get and open webpage html
#provide url as param
#keep it simple - doesnt work if you make it too complicated
function get_html() {
   cd ~/Downloads
	rm curled_html.html
	curl $1 -H "Cache-Control: no-cache, no-store, must-revalidate" -H "Pragma: no-cache" -H "Expires: 0" > curled_html.html
	vim curled_html.html
}
```

Now run 
```
get_html https://example.com
```
Spring boot vs Java which is better.
Tags: webdev, java
Published: 2022-12-19 06:50:56

Java EE (Enterprise Edition) and Spring Boot are both frameworks for building Java-based enterprise applications. However, there are some key differences between the two:

Java EE is a specification, whereas Spring Boot is a framework: Java EE defines a set of standard APIs and technologies that can be used to build enterprise applications. These APIs include technologies such as JavaServer Faces (JSF) for building user interfaces, Java Persistence API (JPA) for persistence, and Java Message Service (JMS) for messaging. Spring Boot, on the other hand, is a framework that provides a set of convenient tools and libraries for building enterprise applications on top of the Java EE platform.

Java EE is more comprehensive, but Spring Boot is more lightweight: Java EE provides a wide range of APIs and technologies for building enterprise applications, but this can also make it more complex and harder to learn. Spring Boot, on the other hand, is designed to be more lightweight and easier to use, especially for developers who are just starting out.

Java EE is more traditional, while Spring Boot is more modern: Java EE has been around for a long time and is widely used in traditional enterprise applications. Spring Boot, on the other hand, is a more modern framework that takes advantage of newer technologies and approaches, such as dependency injection and annotation-based configuration.

Ultimately, which framework is best for your project will depend on your specific needs and requirements. If you are building a large, complex enterprise application and need a comprehensive set of APIs and technologies, Java EE may be the better choice. If you are looking for a more lightweight and easy-to-use framework, or if you are just starting out with enterprise development, Spring Boot may be a better fit.
ArrayList to Array Conversion in Java
Tags: java, array, coding, datastructures
Published: 2022-12-19 06:38:24

https://codeahoy.com/java/How-To-Convery-ArrayList-To-Array/

Method 1-

```
public static int[] convertIntegers(List<Integer> integers)
{
    int[] ret = new int[integers.size()];
    for (int i=0; i < ret.length; i++)
    {
        ret[i] = integers.get(i).intValue();
    }
    return ret;
}

```

Method 2-
```
List<Integer> ans =  new ArrayList<Integer>();
int[] n = (int[])ans.toArray(int[ans.size()]);
```

Method 3- using Steam
`int[] arr = list.stream().mapToInt(i -> i).toArray();`

([from stackoverflow](https://stackoverflow.com/questions/718554/how-to-convert-an-arraylist-containing-integers-to-primitive-int-array))

If you are using java-8 there's also another way to do this.

int[] arr = list.stream().mapToInt(i -> i).toArray();
What it does is:

getting a Stream<Integer> from the list
obtaining an IntStream by mapping each element to itself (identity function), unboxing the int value hold by each Integer object (done automatically since Java 5)
getting the array of int by calling toArray
You could also explicitly call intValue via a method reference, i.e:

int[] arr = list.stream().mapToInt(Integer::intValue).toArray();
There are several ways to become a skilled software developer:
Tags: career
Published: 2022-12-19 06:25:58


Learn a programming language or two: It's important to have a strong foundation in at least one programming language, and it's helpful to know more than one.

Practice coding: The more you code, the better you'll get. It's helpful to work on small projects on your own or to participate in online coding challenges to get experience and build up your skills.

Learn about software design and architecture: Understanding software design patterns and architecture principles will help you write maintainable and scalable code.

Stay up to date with new technologies and best practices: The field of software development is constantly evolving, so it's important to stay current with new technologies and best practices. This can be done through online courses, attending conferences, or reading technical blogs and articles.

Work on a team: Collaborating with other developers can help you learn from your peers and improve your skills.

Seek out mentorship: Having a mentor or a more experienced developer to guide you and provide feedback can be very beneficial for your growth as a developer.

Ultimately, becoming a skilled software developer requires a combination of learning, practice, and experience. It's also important to have a passion for problem-solving and a willingness to continuously learn and improve.