teleren/devto huggingface dataset:
JavaScript Fundamentals: Parameters, Arguments and Operators
Tags: javascript, webdev, tutorial, 100daysofcode
Published: 2022-12-18 17:22:44

Today is the 3rd day of my **#100DaysOfCode** journey with JavaScript.

I write about my learnings in an explained way through my [blogs](https://astrodevil.hashnode.dev/) and socials. If you want to join me on the learning journey, make sure to follow my blogs and social and share yours too. **Let's learn together!🫱🏼‍🫲🏼**

This Article is a part of the [JavaScript Fundamentals](https://astrodevil.hashnode.dev/series/js-fundamentals) series**.**

I studied functions yesterday, check the previous [article](https://astrodevil.hashnode.dev/javascript-fundamentals-mutable-letcomments-functions). Today it's time to know more about functions and the use of operators.

### **Parameters and Arguments**

Both the terms **parameter** and **argument** refer to the inputs supplied to a function.

Here's a function with two inputs:

```javascript
function addNumbers(a, b) {
    return a + b;
}
```

In the above code, there are two **parameters**: `a` and `b`. These are the variables that are defined in the function declaration.

If we were to call this function with two values: `2` and `4`

```javascript
addNumbers(2, 4);
```

The values `2` and `4` would be considered **arguments**. Arguments are the data supplied to the function to get filled into parameters.

### Operators

JavaScript operators are symbols that are used to perform operations on operands. These are `+`, `-`, `*`, `/` .

`+` **Operator**

The `+` is referred to as an addition operator.

Complete the `addTwo` function to take an input and add `5` to it.

```javascript
function addTwo(input) {
    const output = input + 5;

    return output;
}
```

`*` **Operator**

The `*` is referred to as a multiplication operator.

```javascript
const a = 3;
const b = a * 4;
```

In the above code, `b` will have the value `12`! We are using the multiplication operator to multiply `3` and `4`.

Let's see with multiple inputs👇🏼by putting multiple inputs under `()` separated with `comma`!

```javascript
function product(2,3) {
    return 2*3;
}
```

`/` **Operator**

The `/` is referred to as a division operator.

Find the average of some numbers:

```javascript
const sum = 2 + 7 + 6;
const average = sum / 3;
```

Or we can use parenthesis `()`:

```javascript
const average = (2 + 7 + 6) / 3;
```

In the above code, the sum of `2`, `7`, and `6` is `15`. Then we divide `15` by `3` (`15 / 3`) to get `5`.

The parenthesis will always be evaluated first before any other part of the expression.

### Conclusion

Ending with an extra bit of information about JavaScript functions...

Priority is given to division and multiplication above addition and subtraction. Expressions are evaluated from left to right if the precedence of the operators is the same, as it is when division and multiplication are used.

**Today I learned about Parameters, Arguments and Operators in JavaScript.**

#### If You ❤️ My Content! Connect Me on [Twitter](https://mobile.twitter.com/Astrodevil_) or Supports Me By [Buying Me A Coffee☕](https://www.buymeacoffee.com/Astrodevil)
AZ-400: Integrate a repository with Azure Boards
Published: 2022-12-18 17:19:00

[Connect Azure Boards to GitHub](https://learn.microsoft.com/en-us/azure/devops/boards/github/connect-to-github?view=azure-devops)

- Requirements:
     - An Azure Boards or Azure DevOps project
     - Must be a member of the Project Administrators group
     - Must be an administrator or owner of the GitHub repository
- Authentication options:
     - GitHub.com
          - GitHub.com user account (recommended)
          - Personal access token (PAT)
     - GitHub Enterprise Server
          - OAuth (preferred, registration required)
          - PAT
          - Username and password
AZ-400: Implement traceability policies decided by development
Published: 2022-12-18 17:18:47

[End-to-end traceability](https://learn.microsoft.com/en-us/azure/devops/cross-service/end-to-end-traceability?view=azure-devops)

- Supported tasks to facilitate traceability:
     - Create a branch from a requirement
     - Create a pull request of updated branch
     - Validate the pull request using a build pipeline
     - Create and run inline tests on requirements
     - Merge the pull request into the main, default branch
     - Deploy changes into production with deployment status to Azure Boards
     - Monitor and report on requirements traceability
- Link types used to construct links for Git repositories:
     - Build
     - Found in build
     - Integrated in build
     - Branch
     - Commit
     - Pull request
     - Integrated in release stage
- Requirements Traceability Matrix
     - Document that links requirements throughout the validation process
     - Ensures that all requirements defined for a system are tested in the test protocols
AZ-400: Integrate pipelines with work item tracking tools
Published: 2022-12-18 17:03:04

[Cross-service integration overview](https://learn.microsoft.com/en-us/azure/devops/cross-service/cross-service-overview?view=azure-devops)

- Azure DevOps supports multiple integration points across each of the major services—Azure Boards, Azure Repos, Azure Pipelines, and Azure Test Plans
- Azure DevOps Collaboration Features:
     - mentions: mention a team member or a whole team within a work item
     - ID (link to work item): link work items from commits, PRs, and changesets ([more info](https://learn.microsoft.com/en-us/azure/devops/organizations/notifications/add-links-to-work-items?view=azure-devops))
     - Teams: separate the customization and configuration of tools by team
     - Alerts: team, project, or organization-level alerts when changes occur to work items, code reviews, PRs, builds, and more
     - Summaries by email
     - Wiki: embed Azure Boards query results in a wiki
- Azure Repos Features:
     - Git development from within work items
     - Automatically link and transition work items with Git commits
     - Check for linked work items in a Git branch
     - Auto complete work items with PRs
     - View list of code objects a single work item is linked to
- Azure Pipelines Features:
     - Manually link work items to builds
     - automatically create Integrated in build links to work items linked to a branch, commit, or pull request associated with a pipeline (classic or YAML)
     - automatically create Integrated in release stage links to work items linked to a branch, commit, or pull request associated with a release
     - View and open list of work items linked to a Classic or YAML pipeline
     - View list of build or release objects a single work item is linked to a release
     - Create a work item on failure
     - Report deployment status
Querying for Data in MySQL is Slow
Tags: mysql, indexing
Published: 2022-12-18 17:00:00

Trying to query the MySQL database is slow (millions of records in table)

Example query:
```sql
SELECT * FROM my_table WHERE code='X87L9D82NB';
```

Just add an index to the column that is frequently used to query for data

Query to add index:
```sql
CREATE INDEX index_name ON table_name (column_name);
```
Top 10 Tech Careers for 2023
Tags: career, programming
Published: 2022-12-18 16:51:14

It's difficult to predict exactly which tech careers will be in high demand in 2023, as the field is constantly evolving and new technologies are being developed all the time. However, based on current trends and the expected growth of certain industries, the following tech careers may be in high demand in the near future:

Artificial Intelligence (AI) and Machine Learning (ML) Engineer: AI and ML are expected to play a significant role in many industries in the coming years, and there will likely be a high demand for professionals with expertise in these areas.

Data Scientist: With the increasing amount of data being generated by businesses and organizations, the demand for skilled data scientists is expected to continue to grow.

Full-Stack Developer: Full-stack developers, who are proficient in both front-end and back-end development, are in high demand as companies look to build and maintain complex web applications.

Cloud Computing Specialist: As more businesses adopt cloud-based systems, the demand for professionals with expertise in cloud computing is expected to increase.

Cybersecurity Expert: Cybersecurity is becoming an increasingly important concern for businesses and organizations, and there is likely to be a high demand for professionals with expertise in this field.

DevOps Engineer: DevOps engineers, who are responsible for the integration and deployment of software, are in high demand as companies look to improve their development and delivery processes.

Mobile App Developer: With the increasing use of mobile devices, the demand for mobile app developers is expected to continue to grow.

Internet of Things (IoT) Engineer: As the number of connected devices continues to increase, there will be a need for professionals with expertise in IoT to design and maintain these systems.

Blockchain Developer: Blockchain technology is expected to have a significant impact on a variety of industries, and there will likely be a high demand for professionals with expertise in this field.

Virtual Reality (VR) and Augmented Reality (AR) Developer: As VR and AR technology becomes more widely adopted, there will be a need for professionals with expertise in these areas to design and develop immersive experiences.
Async Await v/s Promises?
Tags: javascript, discuss, help
Published: 2022-12-18 16:45:01

Both async/await and promises are ways to handle asynchronous code in JavaScript. They are not mutually exclusive and can be used together or independently, depending on your needs and preferences.

## Async Await
Async/await is a more modern and concise syntax for working with promises. It allows you to write asynchronous code that looks and behaves like synchronous code, using the async and await keywords.

For example, with async/await, you can write code like this:

```
async function getData() {
  const response = await fetch('https://example.com/data');
  const data = await response.json();
  return data;
}

```

## Promises
Promises are a pattern for handling asynchronous operations in JavaScript. They represent the result of an asynchronous operation that may not be available yet. You can use the .then() method to specify what should happen when the promise resolves (i.e., when the asynchronous operation is completed).

For example, with promises, you can write code like this:

```
async function getData() {
  const response = await fetch('https://example.com/data');
  const data = await response.json();
  return data;
}

```

In general, async/await can make your code easier to read and understand, especially for longer or more complex asynchronous operations. However, it's important to note that async/await is built on top of promises, so you will still need to understand how promises work in order to use async/await effectively.
Commenting code
Tags: webdev
Published: 2022-12-18 11:25:18

---
title: Commenting code
published: true
date: 2022-12-18 11:19:49 UTC
tags: webdev
canonical_url: https://blog.nicm42.co.uk/commenting-code
---

There's a lot of stuff out there that tells you that too many comments are bad and too few comments are bad. So how do you find that sweet spot?

## Comment for your future self

Imagine you're coming back to this code in six months. You just need to make one quick change, but you look at it and think "why did I do that?". You then spend some time experimenting and discover the reason. Or don't and replace that one weird bit of code. Wouldn't it have saved some time if you'd written a comment? For example:

```javascript
// Usually this would be XYZ but that doesn't work because of [something in another function]

```

or

```css
/* Not using XYZ here because it conflicts with [something else] */

```

## Comment to make things easier to find

If you're writing CSS and it's all in one big file, it can be hard to find things. You can search, but what if you're looking for something hard to search for like an a tag? You can use comments to separate the code out a bit so when you're scrolling through you can easily see where a new section is. For example:

```css
/**********************Header**********************/
header {
  /* Some code here */
}

/**********************Footer**********************/
footer {
  /* Some code here */
}

```

Obviously you'd have a lot more code between those commented section headers, but you can easily see the difference in colour.

## Noting where you got something from

You've implemented some clever thing that you got from StackOverflow. It can be useful to note the link, so you can go back to it in the future. Maybe because it's not working as well as it did before and you need another explanation to understand what the code is doing. Or maybe because something changed in the language and someone has offered a way to do the same thing that works with the change.
Top 5 Posts tagged(#openai) last week
Tags: openai, c4r4x35
Published: 2022-12-18 16:36:54

##Automatically Transcribe YouTube Videos with OpenAI Whisper
OpenAI is on everyone's lips, but this is not about their recent Chatbot but about a language model for transcribing audio they released back in September. This post will show how to apply it on...
{% link https://dev.to/zirkelc/automatically-transcribe-youtube-videos-with-openai-whisper-1856 %}
##Should people use AI to develop Websites?
Artificial intelligence (AI) has the potential to revolutionize the way we build websites. With AI, it would be possible for websites to be built quickly and efficiently, with little human input...
{% link https://dev.to/meritonaliu/should-people-use-ai-to-develop-websites-o1a %}
##Automated Moderation using OpenAI
To get started, you need to sign up at OpenAI and generate a key. Next we'll setup a simple Nuxt project. Just use the following command to scaffold out a starter project and adding the openai package...
{% link https://dev.to/jquinten/automated-moderation-using-openai-b9a %}
##Introducing ChatGPT: The Revolutionary Chatbot Powered by OpenAI's GPT-3
,
Hey fellow developers!

A Revolutionary chatbot powered by OpenAI's GPT-3 language model. ChatGPT is capable of understanding and generating human-like responses to any conversation, making it an...
{% link https://dev.to/c4r4x35/introducing-chatgpt-the-revolutionary-chatbot-powered-by-openais-gpt-3-1303 %}
##Top 4 Open Ai Project For Developers.
Introduction

OpenAI is a research group that concentrates on creating and promoting cutting-edge artificial intelligence methods and technology. As a result, OpenAI has released numerous research...
{% link https://dev.to/codewithkevin/top-4-open-ai-project-for-developers-91f %}
Git Rebase: The Power Tool for Clean Git Histories
Tags: git, beginners, abotwrotethis
Published: 2022-12-18 16:13:50

Here is an example of using git rebase to incorporate the latest changes from the master branch into a feature branch:

``` bash
$ git checkout feature
# switch to the feature branch

$ git rebase master
# apply the commits from the feature branch on top of the latest commits in the master branch

# If there are conflicts during the rebase, you will need to resolve them
# and then use `git add` to mark the resolved files, and then use
# `git rebase --continue` to continue the rebase.

$ git push -f origin feature
# push the feature branch to the remote repository, using the -f flag to force the push
# (necessary because the commit history of the feature branch has been modified by the rebase)
```

Here is an example of using git rebase to "squash" multiple commits into a single commit:
``` zsh
$ git checkout feature
# switch to the feature branch

$ git rebase -i HEAD~3
# interactively rebase the last 3 commits

# This will open a text editor, showing the list of commits that will be modified by the rebase.
# You can use the `squash` command to merge commits together. For example:
#
# pick abcdefg Some commit message
# squash hijklmn Another commit message
# squash opqrstu Yet another commit message

# Save and close the editor. Git will then apply the changes and open another editor
# for you to modify the commit message of the combined commit.

$ git push -f origin feature
# push the feature branch to the remote repository, using the -f flag to force the push
# (necessary because the commit history of the feature branch has been modified by the rebase)
```

It's important to note that `git rebase` should be used with caution, as it modifies the existing commit history of a branch. This can make the commit history more difficult to understand and can cause problems if other people are working on the same branch. 

> Therefore, it's usually a good idea to use `git merge` instead of `git rebase` when working with other people.

Surprise, this article was generated by ChatGPT!
#45Days of Leetcode - Running sum of 1d array - Day 2.2
Tags: tutorial, python, career
Published: 2022-12-18 15:34:20

Hey dev! In case you don't know, I've started #45daysofleetcode and in these 45 days i'll be writing about two problems every day.

> The problem, how I solved it and a bit of detailed explanation.

I'm sharing this progress with you so that you too can learn a bit of different perspective and have new solutions so hit like to join this journey.

I've chosen the best list of problems from medium to hard. That made lots of developers crack the interview.

Are you excited?

**Today's Problem**

**Name**
Running sum of 1d array

**Description**
Given an array nums. We define a running sum of an array as runningSum[i] = sum(nums[0]…nums[i]).

Return the running sum of nums.


## Example

```
Input: nums = [1,2,3,4]
Output: [1,3,6,10]
Explanation: Running sum is obtained as follows: [1, 1+2, 1+2+3, 1+2+3+4].

```


## My Approach
Simply add first value of original array to running array, and then start a loop from 1.

With each iteration, append (last element + current element) to the running array. then return it.

## Code

```
class Solution:
    def runningSum(self, nums: List[int]) -> List[int]:
        runningArray = [nums[0]]
        for i in range(1, len(nums)):
            runningArray.append(runningArray[i-1]+nums[i])
        return runningArray

```


Let me know if you've any questions or suggestions!.

If you want full list of solutions, [here's the list.](https://github.com/Anas-Dew/dsa-coding-solutions) Make sure you star the repository.

Follow to join this #45daysofleetcode
Bye!
Advent of Code Day 18 Follow-Up
Tags: miniscript, adventofcode, programming
Published: 2022-12-18 15:33:37

In today's post, I came to the realization that I should have a little library to dealing with 3D coordinates and arrays easier.

I've now [created](https://github.com/JoeStrout/AoC-2022/blob/main/lib/vector3.ms) such a library, and redid last night's challenge using it.

In the first challenge, just checking for exposed faces:

```
import "vector3"

if 0 then fname = "input.txt" else fname = "example.txt"
lines = file.readLines(fname)
if not lines[-1] then lines.pop

cubes = []
volume = list.init3d(21, 21, 21, 0)

for line in lines
	pos = line.split(",")
	pos.apply @val
	cubes.push pos
	volume.set pos, 1
end for

count = 0
for cube in cubes.values
	for n in vector3.neighbors6
		npos = cube.plus(n)
		if not volume.get(npos) then count = count + 1
	end for
end for
print "Faces: " + count
```

We now create a `volume` (3D array), initialized to 0, changed to 1 wherever we have a cube; we also keep `cubes` now as a list (not map) of 3D coordinates.  Then we can just iterate over those cubes, checking the neighbors (using our handy new `neighbors6` list), and add up how many faces are exposed.

**Part 2** is really no harder.  We just initialize our volume to value 2, meaning "interior space," and then after loading the cubes, do a `floodFill` from the origin to change all the outside space to 0.  Then we don't need to change the counting loop at all.

```
import "vector3"

if 1 then fname = "input.txt" else fname = "example.txt"
lines = file.readLines(fname)
if not lines[-1] then lines.pop

cubes = []
// init volume to value 2, meaning "interior space"
volume = list.init3d(21, 21, 21, 2)

// load cubes
for line in lines
	pos = line.split(",")
	pos.apply @val
	cubes.push pos
	volume.set pos, 1
end for

// then flood-fill with 0, meaning "outside air"
volume.floodFill [0,0,0], 0

count = 0
for cube in cubes.values
	for n in vector3.neighbors6
		npos = cube.plus(n)
		if not volume.get(npos) then count = count + 1
	end for
end for
print "Faces: " + count
```

I'm quite happy with the new library; it really does make working with 3D coordinates and arrays a breeze.  Here's hoping a need for that will come up again!
Next Js Npm run build failed
Tags: nextjs
Published: 2022-12-18 15:28:15

This issue I am facing while running npm run build. Please help how can it be fixed.
> Build error occurred
Error: Failed to collect page data for /forms/form-validation
    at /node_modules/next/dist/build/utils.js:916:15
    at processTicksAndRejections (node:internal/process/task_queues:94:5) {
  type: 'Error'
}
CodePen Designs - 4 : 3D Room - Pure CSS
Tags: codepen, codependesigns, css, design
Published: 2022-12-18 15:17:36

### We are excited to introduce our new series that will explore the best design ideas from the Codepen community. 

We will be publishing these each day and hope you find them insightful and inspiring as we showcase some of the most talented designers in this space.

---


#### Codepen Design - 4

{% codepen https://codepen.io/ricardoolivaalonso/pen/mdPzrpe %}


---
## For more information

1. Check my GitHub profile
[https://github.com/amitSharma7741](https://github.com/amitSharma7741)

2. Check out my Fiver profile if you need any freelancing work
[https://www.fiverr.com/amit_sharma77](https://www.fiverr.com/amit_sharma77)

3. Check out my Instagram
[https://www.instagram.com/fromgoodthings/](https://www.instagram.com/fromgoodthings/)

4. Linktree
[https://linktr.ee/jonSnow77](https://linktr.ee/jonSnow77)

5. Check my project

- EVSTART: Electric Vehicle is the Future
[https://evstart.netlify.app/](https://evstart.netlify.app/)
-  News Website in react
 [https://newsmon.netlify.app/](https://newsmon.netlify.app/)
-  Hindi jokes API
 [https://hindi-jokes-api.onrender.com/](https://hindi-jokes-api.onrender.com/)


---
---