teleren/devto huggingface dataset:
How to Use Excel YEAR Function in Office 365? -[with Examples]
Tags: excelfunctions, excel, exceltutorials, yearfunctioninexcel
Published: 2020-12-15 09:20:39

---
title: How to Use Excel YEAR Function in Office 365? -[with Examples]
published: true
date: 2020-12-12 14:23:13 UTC
tags: ExcelFunctions,Excel,ExcelTutorials,YEARFunctioninExcel
canonical_url: https://geekexcel.com/how-to-use-year-function-in-excel-365/
---

## **YEAR Function:**

A year is a **period of twelve months** or **365** or **366** days, beginning on the first of January and ending on the thirty-first of December. Excel provides YEAR Function to extract the year from the given date and returns the year as a 4-digit number.

In this short tutorial, we will show you the steps to use the **Excel YEAR Function in Office 365**. Get the official version of  **MS Excel**  from the following link: [https://www.microsoft.com/en-in/microsoft-365/excel](https://www.microsoft.com/en-in/microsoft-365/excel)
## YEAR Function Syntax:

```
**=YEAR(Date)**
```

- **Date:** You must enter a valid date format. The default Date format is  **“month/day/year”. **

### Note:

- If the date is not in the valid Excel format then the YEAR Function will return the **#value error. **

## YEAR Function with Related Examples:

Let us assume an accepted date format **19 Oct 2014 or 19-oct-2014.**

### Example 1:

![YEAR Function Example 1](https://eadn-wc04-371788.nxedge.io/cdn/wp-content/uploads/2020/03/Screenshot_3.png)<figcaption id="caption-attachment-4209">YEAR Function Example 1</figcaption>

- In the above example, the YEAR Function **=YEAR(C6)** extracts the year from the given date and returns the year as **2014.**

### Example 2:

- You can directly enter the date inside the YEAR Function.

![YEAR Function Example 2](https://eadn-wc04-371788.nxedge.io/cdn/wp-content/uploads/2020/03/Screenshot_1.png)<figcaption id="caption-attachment-4210">YEAR Function Example 2</figcaption>

- Let us assume the date 23 Dec 2016, the **YEAR Function =YEAR(“12/23/2016”)**  returns the year as **2016**.

## A Short Summary:

In this article, we have discussed the basic syntax, definition, and usage of **YEAR Function** in **Excel Office 365** also we have demonstrated the YEAR Function with related examples. Please share your Queries in the comment section you get solutions instantly. Share your suggestion as well so that we can improve our services. Thank you for visiting our website **[GeekExcel](https://geekexcel.com/)**

### Related Articles:

- [**AND Function in Excel**](https://geekexcel.com/how-to-use-logical-function-and-in-excel-365/)
- **[Custom ADD Function in Excel](https://geekexcel.com/how-to-create-custom-add-function-in-excel-365/)**
- **[MONTH Function in Excel](https://geekexcel.com/how-to-use-month-function-in-microsoft-excel-365/)**
- **[DATE Function in Excel](https://geekexcel.com/how-to-use-date-function-in-microsoft-excel-365/)**
- **[EDATE Function in Excel](https://geekexcel.com/how-to-use-edate-function-in-excel-365/)**
- **[DATEVALUE Function in Excel](https://geekexcel.com/how-to-use-datevalue-function-in-excel-365/)**
💡TensorFlow Tip, use .prefetch
Tags: tensorflowtip, machinelearning, tensorflow, deeplearning
Published: 2020-12-12 13:36:33

:bulb: #TensorFlowTip
Use `.prefetch` to reduce your step time of training and extracting data

- overlap the preprocessing and model execution
- while the model executes training step `n` the input pipeline is reading the data for `n+1` step
- reduces the idle time for the GPU and CPU

See the speedup with `.prefetch` in this image.

![](https://pbs.twimg.com/media/EpBaGTaVEAErATO?format=png&name=large)

Try it for yourself: 
{% gist https://gist.github.com/Rishit-dagli/27aa9fe80d467920d2d0faaabb8bbdc3 %}
SearchDown | The first Markdown search-engine
Tags: markdown, laravel, php, webdev
Published: 2020-12-12 13:35:32

This project is really simple but useful for me because every day I have to save useful articles and projects.

This is a sub-project of [LaraVista](https://github.com/rognoni/laravista) (**Laravel** on AlterVista) and the best name I found is [#SearchDown](https://twitter.com/search?q=%23SearchDown&src=typed_query&f=live)

In my mind I have many features to add:
- the web-spider (in Python?)
- a federation protocol (more simple than ActivityPub?)
- comments
- other? (any suggestion is welcome)
Bookmarklet for hashtags insertion on social networks
Tags: bookmarklets, socialnetworks, productivity
Published: 2020-12-12 13:33:14

1) Put this code in place of URL of your bookmark:
```
javascript:document.execCommand('insertText', false /*no UI*/, "#education #science #popularization");
```
2) When you typing text into an editable (social networks etc.) array click on the created bookmark
3) Javascript put hashtags
You can change hashtags as you like and create other bookmarks with different hashtags.

## Notes
Twitter - you have to start typing text (or an error occures).

## Tested on
Google Chrome

## Inspired by
https://kubyshkin.name/posts/insert-text-into-textarea-at-cursor-position/
How to Build a Web Crawler that crawls an entire Website – A Guide for Beginners
Published: 2020-12-12 11:02:49

Scrapy is one of the most accessible tools that you can use to crawl and also scrape a website with effortless ease.

So let's see how we can crawl Wikipedia data for any topic.

Here is the URL we are going to scrape https://en.wikipedia.org/wiki/Lists_of_animals, which provides a list of lists of different types of animals. We are going to try and spider through this by first downloading this page and then further downloading all further links that point to a subsequent list. We dont want to download any other link. Also, we will avoid any pages that link to pages that talk about bears. We dont want bears.
First, we need to install scrapy if you haven't already.
Then create a file called fullspider.py and paste the following.
This loads scrapy and the Spider library. We will also need the LinkExtractor module so we can ask scrapy to follow links that follow specific patterns for us.

The allowed_domains variable makes sure that our spider doesn't go off on a tangent and download stuff that's not on the Wikipedia domain. We also just provide the start_url

Now, lets set up the rules.

If you right-click and copy the link address of any of the links that point to other lists, they always seem to follow this pattern.
This loads scrapy and the Spider library. We will also need the LinkExtractor module so we can ask scrapy to follow links that follow specific patterns for us.

The allowed_domains variable makes sure that our spider doesn't go off on a tangent and download stuff that's not on the Wikipedia domain. We also just provide the start_url

Now, lets set up the rules.

If you right-click and copy the link address of any of the links that point to other lists, they always seem to follow this pattern.
You can see that the deny array contains the word bear so we can stay away from anything bear-related!

This tells scrapy to download all links inside the starting URLs that obey these rules and then call the function parse_item

so in parse item, we are just going to print the URL that has been downloaded.
Now lets put the whole thing together
And run it with.
It should output all the links that point to the Lists of animals.
Pretty simple so far. But there is a catch. If you want to scale a web crawler like this to thousands of downloads and if you do it frequently, you will find that you will eventually run into rate limits, CAPTCHA challenges, and even IP blocks pretty soon.

So if you want to scale reliably to thousands of requests, you can consider using a professional Rotating Proxy Service like Proxies API to route requests through millions of anonymous proxies and prevent all the blocking problems.

Proxies API also handles automatic retries, automatic User-Agent-String rotation, solves CAPTCHAs behind the scenes using a simple one-line API call.
How to sort an array of strings with non-latin letters?
Tags: javascript, programming
Published: 2020-12-12 13:28:36

JavaScript has a native sort method, you can do it with array.sort(), it will sort the array alphabetically. Also, you can provide your custom sorting functionality.

{% gist https://gist.github.com/maciejtrzcinski/912de2f781b4a86c502c9fd3aaf340a9 %}

But if you want to order an array of non-ASCII character like [‘ą’, ‘ę’, ‘ó’, ‘ż’, ‘ź’, ‘e’], you will receive a [“e”, “ó”, “ą”, “ę”, “ź”, “ż”]. That happened because sort function works only with the English alphabet.

{% gist https://gist.github.com/maciejtrzcinski/e667e85b3da27d563d467904216ba576 %}

Fortunately, there are two ways to overcome this behavior [localeCompare](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator) and Intl.Collator provided by ECMAScript Internationalization API.

#### Using `localeCompare()`

{% gist https://gist.github.com/maciejtrzcinski/ffc3b3c08ed274962c4c25cb2a2b5599 %}

#### Using `Intl.Collator()`

{% gist https://gist.github.com/maciejtrzcinski/587195f4f28cbc4d2f44373306e91074 %}

So when you are working with arrays of strings in a language different from English, remember to use these methods to avoid unexpected sorting.

Thank you for your time!
Why Object.is() is better than ‘==’ and ‘===’ ?
Tags: javascript, objectis, programming
Published: 2020-12-12 13:22:47

Everybody who used JavaScript knows that JS is loosely typed and comparing with ‘==’ gives unexpected results.
 
{% gist https://gist.github.com/maciejtrzcinski/60a4c91dd2548714d7a4ac8c7682bd83 %}

So if we use triple equals operator ‘===’, we got a more strict result, but it is also not yet perfect:

{% gist https://gist.github.com/maciejtrzcinski/a1f440c80a39496eb4b061651955f1ca %}

For help us in this case we use ES6 ‘Object.is()’, it is more precision than ‘===’ and moreover it behaves well in some special cases:

{% gist https://gist.github.com/maciejtrzcinski/47752286d6178aa0fc6d9ef93abd5842 %}

#### Compare table:

![Table](https://dev-to-uploads.s3.amazonaws.com/i/2ve2gf8hs62te46ror6v.jpeg)

#### Polyfill:

{% gist https://gist.github.com/maciejtrzcinski/1fc7971b8db29287f84a82f311c3bb9f %}

If you like this article, follow me on Twitter [@MaciejDEV](https://twitter.com/MaciejDEV)
Why you should motivate your Pull Request?
Tags: github, pullrequest, pr, git
Published: 2020-12-12 13:14:08

![PR Description](https://dev-to-uploads.s3.amazonaws.com/i/zc08f9jiaz3yws3vfty7.png)

Every programmer uses GitHub or another Git repository, If you didn’t use Git repository, read about it. A good PR description is a clue in communication. You don’t want to spend a couple of hours at PR for only understanding your colleague code. Another good example is when you back to the issue after a few days or weeks, this description will let you back to your work in a few minutes, not hours.
Here it’s my recommendation for the PR description.
```
## Description
This PR will resolve nested lists compiled from markdown. Solution description
## Solution description
In the HtmlRender component I imported a new component `List` where I implemented methods and CSS for the nested list, in the past, we did not have any implementation for List. I discussed with our Designer [here it’s the link for this conversation] and we added square dots for the list, and small numbers for the ordered list. In the List component, I created two methods: one for unordered lists named unorderedList and orderedList for ordered lists.
## Jira ticket
https://[team].atlassian.net/jira/software/projects/[project]/boards/selectedIssue=[issue]
## Did you test this issue on all browsers?
[x] Chrome
[x] FireFox
[x] Edge
[x] Safari
[x] Mobile Safari/Chrome
[x] Tablet Safari/Chrome
```
## Description
At this place, the author of Pull Request should describe in a few words problem, what an author wants to resolve in this PR. You should type max 2/3 paragraphs. It must be short but valuable. It’s no place for essays, reviewers, another colleague or you must easily understand what did you want to resolve here.
For example:
```
This PR will resolve nested lists compiled from markdown.Solution description
```
## Solution description
This is a place where you should describe your steps, what you added, changed, or removed. Solution description is like a journal where you will describe your steps or explain your idea.
Example:
```
In the HtmlRender component I imported a new component `List` where I implemented methods and CSS for the nested list. In the past, we did not have any implementation for List. I discussed with our Designer [here it’s the link for this conversation] and we added square dots for the list, and small numbers for the ordered list. In the List component, I created two methods: one for unordered lists named unorderedList and orderedList for ordered lists.
```
## Jira ticket

Here add a link to the ticket, if you don’t have Jira add to another one service.

## Did you test this issue on all browsers?

This is a place for a checklist. If you don’t test on the web, add another list.

Thank you for your attention! I’ll appreciate your feedback.
Daily Developer Jokes - Saturday, Dec 12, 2020
Tags: jokes, dailydeveloperjokes
Published: 2020-12-12 13:00:13

---
title: "Daily Developer Jokes - Saturday, Dec 12, 2020"
description: "Check out today's daily developer joke! (a project by Fred Adams at xtrp.io)"
series: "Daily Developer Jokes"
cover_image: "https://private.xtrp.io/projects/DailyDeveloperJokes/thumbnail_generator/?date=Saturday%2C%20Dec%2012%2C%202020"
published: true
tags: #jokes, #dailydeveloperjokes
---

Generated by Daily Developer Jokes, a project by [Fred Adams](https://xtrp.io/) ([@xtrp](https://dev.to/xtrp) on DEV)

___Read about Daily Developer Jokes on [this blog post](https://xtrp.io/blog/2020/01/12/daily-jokes-bot-release/), and check out the [Daily Developer Jokes Website](https://dailydeveloperjokes.github.io/).___
### Today's Joke is...
![Joke Image](https://private.xtrp.io/projects/DailyDeveloperJokes/public_image_server/images/5e12595564d36.png)

---
*Have a joke idea for a future post? Email ___[xtrp@xtrp.io](mailto:xtrp@xtrp.io)___ with your suggestions!*

*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 shouldn't you trust Matlab developers?

___A:___ Because they're always plotting something.
 -->
Redux: Switching to other case within the same reducer
Tags: help, redux, react
Published: 2020-12-12 12:55:46

I am new to Redux. I am building a game with it. I know that reducers are there to react to actions thrown at them, by changing the state. In my reducer, I have 2 cases:
1) a switch case that needs to change the protagonist's state according to the data entry.
2) an error switch case, that sets the state's error attribute.

`export const movementReducer = (state=initial_state, action) => {

    switch(action.type) {
        case "moveObject": {
             const new_position = ChangePosition(action.payload);
             return {
                 ...state,
                 position: new_position
             };
        }
        case "moveObjectError": {
             return {
                 ...state,
                 error: action.payload
             };
        }
    }
}`

What I want:-
When the control comes to "moveObject" case, it must first verify if this state change is feasible. If it is feasible, it must update. If it is not feasible, it must switch to the second case and set the Error.

What I tried:-
1) I believe this is a hack, makes the code not look good:-
If state change is not feasible for given input, I implicitly set the error and return it from the same case. The code looks like this:-

`
export const movementReducer = (state=initial_state, action) => {

    switch(action.type) {
        case "moveObject": {
             if( !isMovementFeasible(state, action.payload)) {
                  return {
                     ...state,
                     error: "This movement is not possible."
                 };
             else {
                 const new_position= ChangePosition(action.payload);
                 return {
                     ...state,
                     position: new_position
                 };
             }
        }
        case "moveObjectError": {
             return {
                 ...state,
                 error: action.payload
             };
        }
    }
}
`

This will work fine. But this did not actually trigger the "moveObjectError" action, which will be bad for tracking redux in future.

2) I can create an action creator, in it I can check for feasibility of movement. But then, I would have to access the state in action creator. I think this is not advised.

I want a way to trigger the "moveObjectError" case when movement is not feasible.
Banker's Algorithm Question | Operating System - M04 P06
Tags: linux, devops, tutorial, beginners
Published: 2020-12-12 12:53:41

**This is a multipart blog article series, and in this series I am going to explain you the concepts of operating system. This article series is divided into multiple modules and this is the forth module which consists of 8 articles.**

_In this article we will see a question on banker’s algorithm, to get better understanding of the concept._

***Question:*** Check for the deadlock, if deadlock is not present then find the safe sequence.

Process No. | Allocation of E | Allocation of F | Allocation of G | Max need of E | Max need of F | Max need of G | Current availability of E | Current availability of F | Current availability of G | Remaining need of E | Remaining need of F | Remaining need of G | 
--- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
P1 | 1 | 0 | 1 | 4 | 3 | 1 | 3 | 3	| 0 | 3 | 3 | 0 |
P2 | 1 | 1 | 2 | 2 | 1 | 4 | 4 | 3 | 1 | 1 | 0 | 2
P3 | 1 | 0 | 3 | 1 | 3 | 3 | 5 | 3 | 4 | 0 | 3 | 0
P4 | 2	| 0	| 0	| 5	| 4	| 1	| 6	| 4	| 6	| 3	| 4	| 1

***Answer:***
- Current availability: _(3,3,0)_
- With the current availability we can fulfill the request of `P0`
- Current availability: _(4,3,1)_
- With current availability we can fulfill the request of `P2`
- Current availability: _(5,3,4)_
- With current availability we can fulfill the request of `P1`
- Current availability: _(6,4,6)_
- With current availability we can fulfill the request of `P3`
- `Safe sequence = P0 -> P2 -> P1 -> P3`
- No deadlock will occur. Therefore it is safe.

_So this was a question on banker’s algorithm. Hope you liked it and learned something new from it._

If you have any doubt, question, queries related to this topic or just want to share something with me, than please feel free to contact me.

### 📱 Contact Me

[Twitter](https://twitter.com/r_mishra10)
[LinkedIn](https://www.linkedin.com/in/rahul-mishra-66210b185)
[Telegram](https://t.me/rahul_mishra10)
[Instagram](https://www.instagram.com/rahul_mishra10/?hl=en)

### 📧 Write a mail
<rahulmishra102000@gmail.com>

#### 🚀 Other links

[GitHub](https://github.com/rahulMishra05)
[HackerRank](https://www.hackerrank.com/rahulmishra10201)
Creating accordions with native HTML

Tags: html, beginners, webdev, frontend
Published: 2020-12-12 12:43:24

Accordions are one of the most commonly used UI components for any website. For example FAQs section of the website, where only the question is shown, and when clicked the answer just opens up.
Generally, we handle this by creating 2 `divs` and adding some javascript to handle the open and close of the accordion. But recently I stumbled upon this hidden gem in HTML that eliminates the need of all this - [`<details>`](https://developer.mozilla.org/docs/Web/HTML/Element/details)

We can simply design a simple FAQ or summary section with `<details>` HTML tag without using Javascript!!! 🤯🤯🤯.
And the best part... it is supported by all the modern browsers (obviously except IE :( ) - [browser compatibility](https://caniuse.com/?search=details).  

### Using `<details>` tag

There are two elements here: `<details>` and `<summary>`. `<details>` is the wrapper for all the content you want to show and hide, and <summary> contains the — well, the summary and title of the section. `<summary>` is optional, if you do not add it, the browser will use some default text. For example, in Firefox and Chrome, it is `Details`. Below is a sample HTML markup:

```html
<details>
  <summary>Details</summary>
  <p>Something small enough to escape casual notice.</p>
</details>
```

And it will render like:

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/vgjgg43x944mbadpks72.gif)

This markup can be designed with CSS as any other HTML element. Now for creating beautiful accordions all you need is just HTML and CSS (and a will to let go of IE).

Demo: [https://itsopensource.com/demos/details/](https://bit.ly/htmldetails)


### References
* [MDN: details](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/details)

Cheers.
How to Merge or Combine Cells in Excel Office 365?
Tags: excelbasics, excel, excel365tutorials, exceltutorials
Published: 2020-12-15 09:20:28

---
title: How to Merge or Combine Cells in Excel Office 365?
published: true
date: 2020-12-12 12:42:08 UTC
tags: ExcelBasics,Excel,Excel365Tutorials,ExcelTutorials
canonical_url: https://geekexcel.com/how-to-merge-or-combine-cells-in-microsoft-excel-365/
---

## **Merge Cells:**

In some cases, you want to combine the data or information from two or more cells in Excel. To do that, you can go with the merging options given in Excel. Merging cells is the process of combining two or more adjacent cells and makes it a single larger cell. **Merge Cell** option is mostly used to center the title text in Excel.

In this article, we will clearly show you the step-by-step instructions to **Merge or Combine Cells in Excel Office 365**. Get the official version of  **MS Excel**  from the following link: [https://www.microsoft.com/en-in/microsoft-365/excel](https://www.microsoft.com/en-in/microsoft-365/excel)
## Merging Cells in Excel:

- Open a New Excel Workbook.
- Type any text in the cell.
- In the **Home Menu** , you can find the **Merge and Center** option.

![Merge Cells Option](https://eadn-wc04-371788.nxedge.io/cdn/wp-content/uploads/2020/03/Screenshot_6-10.png)<figcaption id="caption-attachment-4690">Merge Cells Option</figcaption>

- Now, select the adjacent cells that you want to merge.

![Before merging cells](https://eadn-wc04-371788.nxedge.io/cdn/wp-content/uploads/2020/03/Screenshot_8-5.png)<figcaption id="caption-attachment-4701">Before merging cells</figcaption>

- In the above screenshot, you can see that the text has been entered in cell **F6**. Now, we are going to merge the **F6** cell with the adjacent cells ** G6, H6.**
- Click on the **Merge Cells Option** to Merge the cells **F6, G6 & H6.**

![After Cells Merged](https://eadn-wc04-371788.nxedge.io/cdn/wp-content/uploads/2020/03/Screenshot_4-26.png)<figcaption id="caption-attachment-4685">After Cells Merged</figcaption>

- Finally, we have merged the cells  **F6, G6, H6** and makes it as a single larger cell using the **Merge and Center** option in Excel 365.

## Verdict:

We hope that this short tutorial gave you information about the **Merge Cells Option** in **Excel Office 365.** We have explained through the screenshots and related examples which will let you a better understanding of **Merge Cells**  **concepts in Excel 365**. Mention your **queries/ suggestions** in the comment section. Thank you for visiting our website [**GeekExcel**](https://geekexcel.com/).

## Related Articles:

- **[How to Enable Wrap Text Feature in Microsoft Excel 365?](https://geekexcel.com/how-to-enable-wrap-text-feature-in-microsoft-excel-365/)**
- **[Change Font Style in Microsoft Excel 365](https://geekexcel.com/how-to-change-font-style-in-microsoft-excel-365/)**
- **[Enable Wrap Text Feature in Microsoft Excel 365](https://geekexcel.com/how-to-enable-wrap-text-feature-in-microsoft-excel-365/)**
- [**How to Change Font Color in Microsoft Excel 365?**](https://geekexcel.com/how-to-change-font-color-in-microsoft-excel-365/)