teleren/devto huggingface dataset:
Role of Primary key in DBMS
Tags: database, management, sql
Published: 2020-12-09 15:03:10

An entity can contain multiple keys but the key which is most suitable from those lists become a primary key.

>In the EMPLOYEE table, id can be primary key since it is unique for each employee.

Main features are-
1-It must contain a unique value.
2-It cannot contain null values.
#dbms #primarykey
Hello World on Netlify Functions, Cloudflare Workers, & Vercel Functions
Tags: jamstack, tips, webdev
Published: 2021-09-08 21:20:54

---
title: Hello World on Netlify Functions, Cloudflare Workers, & Vercel Functions
published: true
date: 2020-12-09 15:00:00 UTC
tags: jamstack,tips,webdevelopment
canonical_url: https://katiekodes.com/hello-world-serverless-function/
---

Here's my code for a quick "hello world" serverless function on Netlify Functions, Cloudflare Workers, and Vercel Functions.  Here, a "serverless function" is a URL on the web that responds to HTTPs requests, doing some computation in the background before deciding exactly what the response should be, but for which I don't have to write a lot of code about how the underlying web server works.

## Netlify Functions

* **Filename:**  `/functions/helloWorld.js`
* **Access URL pattern:**  `https://example.netlify.app/.netlify/functions/helloWorld` or `https://example.netlify.app/.netlify/functions/helloWorld?name=Katie`
* **Setting up the base URL name `example` in Netlify:**  Web-based user interface
* **Deployment to Netlify:**  Deploy the Git-tracked folder structure containing this file to a connected cloud Git repository such as GitHub

```javascript
exports.handler = async (event, context) => {
  const name = event.queryStringParameters.name || "World";

  return {
    statusCode: 200,
    body: `Hello, ${name}`
  };
};
```

## Cloudflare Workers

* **Filename:**  n/a
* **Access URL pattern:**  `https://hello-world.example.workers.dev/` or `https://hello-world.example.workers.dev/?name=Katie`
* **Setting up the base URL name `example` in Cloudflare:**  Web-based user interface
* **Setting up the base URL name `hello-world` in Cloudflare:**  Web-based user interface
* **Deployment to Cloudflare:**  Edit code in the web-based user interface

```javascript
addEventListener('fetch', event => {
  event.respondWith(handleRequest(event.request))
})

async function handleRequest(request) {
  const name = new URL(request.url).searchParams.get('name') || "World";
  return new Response(`Hello, ${name}`, {status: 200})
}
```

_Note:  Harris Geo went into a little more depth about [deploying a serverless function to Cloudflare Workers](https://www.harrisgeo.me/blogs/deploy-your-first-serverless-function-in-5-minutes-with-cloudflare-workers) the way an experienced programmer might prefer to do._

## Vercel Functions

* **Filename:**  `/api/helloWorld.js`
* **Access URL pattern:**  `https://example.vercel.app/api/helloWorld` or `https://example.vercel.app/api/helloWorld?name=Katie`
* **Setting up the base URL name `example` in Vercel:**  Web-based user interface
* **Deployment to Vercel:**  Deploy the Git-tracked folder structure containing this file to a connected cloud Git repository such as GitHub

```javascript
module.exports = (req, res) => {
  const name = req.query.name || "World";
  
  res.status(200).send(`Hello, ${name}`);
};
```

See [Vercel's full list of helper methods on the 2nd _(response)_ parameter](https://vercel.com/docs/runtimes#official-runtimes/node-js/node-js-request-and-response-objects/node-js-helpers) passed to `module.exports` _(here, `res`)_.
Build a Number Guess Application in C# .NET
Published: 2020-12-09 14:59:35

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/pkpe9y62p9rg7res0tsu.JPG)
------
# Simple Game Build to start with C# in VS

## Code
```
using System;

namespace NumberGusser
{
    //Main Class 
    class Program
    {
        //Entry Point Method
        static void Main(string[] args)
        {
            // set app variable
            string m_appName = "Number Guesser";
            string m_appVersion = "1.0.0";
            string m_appAuthor = "@imshubh17";

            //change text color for app info
            Console.ForegroundColor = ConsoleColor.Green;

            //write out app info
            Console.WriteLine("{0}: Version {1}, by {2}", m_appName, m_appVersion, m_appAuthor);

            //change text color to original
            Console.ResetColor();

            //ask user name
            Console.WriteLine("What is your name?");

            // get user name
            string userName = Console.ReadLine();

            Console.WriteLine("Hello {0}, Let's Play a GAME...", userName);
            //set Score
            int i_totalScore = 10;
            int i_initialScore = 11;
            
            //set correct Number
            int i_correctNumber = 7;

            //init guess var
            int i_guess = 0;

            //Ask User to guess number
            Console.WriteLine("Guess a number between 1 to 10");           

            //result 
            while (i_guess != i_correctNumber)
            {
                string userGuessInput = Console.ReadLine();
                i_guess = int.Parse(userGuessInput);
                i_initialScore--;
            }

            //print result
            Console.WriteLine("{0} Your Score: {1}/{2}", userName, i_initialScore, i_totalScore);
        }
    }
}
```
"Repository Not Found" when accessing a GitHub remote
Published: 2020-12-09 14:55:57

Boy was this frustrating! Basically I have several keys in `~/.ssh/` that I use to access various projects. It turned out that one of them was added to GitHub on another account (likely a bot account I had created for another project).

I would try to run a `git pull` but would be greeted with an error:
```
$ git pull
ERROR: Repository not found.
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
```

This would only happen on my org-owned projects, since my personal projects worked just fine. So what was the issue?

We get a hint by following the troubleshooting tips here: https://docs.github.com/en/free-pro-team@latest/github/creating-cloning-and-archiving-repositories/error-repository-not-found

```
$ ssh -T git@github.com
Hi <not my expected username>! You've successfully authenticated, but GitHub does not provide shell access.
```

Basically my SSH agent (gnome-keyring) was presenting a key that belonged to a valid GitHub user (so authentication passed), but not one with access to my project (so GitHub denied access).

In other words, even though I had the correct key in my keychain, the SSH agent presented the wrong one, so I couldn't access the repository.

The solution: add this to my `~/.ssh/config`:

```
Host github.com
    IdentityFile /path/to/the/correct/key
```

Now when I perform a `git pull` it authenticates correctly:

```
$ git pull
Already up to date.
```
DJANGO, Customer Message “TO ADMIN”
Tags: django, python, messages
Published: 2020-12-09 14:53:34

How do you create a model, that will allow a form on the website, to submit a message to the Django Admin? THATS NOT BY EMAIL. I mean as a “inquiry message”, that a customer selects options, leaves a message. Without email. Soooo how do you show input, on the backend?
CSS StyleSheets
Tags: css, codenewbie, webdev, responsivecss
Published: 2020-12-09 14:52:03

The browser has a basic style sheet that gives a default style to any document. These style sheets are named user-agent stylesheets. Some browsers use actual style sheets for this purpose, while others simulate them in code, but the end result is the same.

Some browsers let users modify the user-agent stylesheet. Although some constraints on user-agent stylesheets are set by the HTML specification, browsers still have a lot of latitude: that means that significant differences exist from one browser to another. To simplify the development process, Web developers often use a CSS reset style sheet, forcing common properties values to a known state before beginning to make alterations to suit their specific needs.

Author stylesheets are style sheets that define styles as part of the design of a given web page or site. The author of the page defines the styles for the document using one or more stylesheets, which define the look and feel of the website — its theme

The user (or reader) of the website can choose to override styles in many browsers using a custom **user stylesheet** designed to tailor the experience to the user's wishes.

Learn more from [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/Cascade)
IPFS File Encryption in NodeJS
Tags: architecture, javascript, security, showdev
Published: 2020-12-09 14:49:00

IPFS is the InterPlanetary File System, it's a protocol and peer-to-peer network for storing and sharing data in a distributed file system. IPFS uses content-addressing to uniquely identify each file in a global namespace connecting all computing devices.

Recently I've implemented a sample project that allows us to encrypt/decrypt files for storing them on IPFS. Which is an ideal solution to hosting and securing any sensitive data.

Github project: https://github.com/inevolin/ipfs-file-encryption

On my Github page I explain how to encrypt files prior to uploading them to IPFS. Similarly it can decrypt and download these files. The solution uses both RSA and AES encryption algorithms to achieve maximum security.

## Why IPFS?

IPFS dominates over bittorrent in terms of availability and performance. Due to content-addressing it prevents file duplication.

Individual file(s) can be easily downloaded from some "source";
whereas with Bittorrent one has to create a ".torrent" file, submit it to tracker(s) and seed it.

IPFS on the other hand is much faster on making files available for sharing. IPFS files can be distributed and load-balanced, making it a perfect CDN solution. This isn't possible with BitTorrent at all.

File-streaming works out of the box over HTTP in IPFS.
Whereas streaming in BitTorrent is a paid feature.

Large files are being chunked/sharded in IPFS. So one can download chunks from different nodes and maximize bandwidth usage. This is both done in IPFS and BitTorrent.

BitTorrent has a high barrier to entry for new people trying to share files. Whereas IPFS easily integrates to a drag-and-drop interface.

With IPFS one chooses which files he/she wants to "seed".
While BitTorrent requires you to seed all files within the torrent.
```
    BitTorrent clients did improve over the years,
    it is possible to download file subsets,
    and it may be possile to seed file subsets.
```
    
IPFS works over HTTP REST, whereas torrents only work over the BitTorrent protocol. This makes it harder for the community to build p2p apps/services/solutions.
A small set of three beautiful dark themes for VS Code
Tags: webdev, vscode, programming
Published: 2020-12-09 14:45:24

Today is a beautiful day and a great mood.
It seems like it's time to refresh your workspace. I haven't changed the theme of my editor for a long time, so I happily spent a couple of hours looking for something really fresh. I want to share the results of my searches with you.

### **1. Horizon** 
![](https://habrastorage.org/webt/6q/sj/pz/6qsjpzx1fbt2linbzke4vmgs-g4.png)
<sub><sup>[Horizon in Marketplace](https://marketplace.visualstudio.com/items?itemName=jolaleye.horizon-theme-vscode)</sup></sub>

### **2. Tokyo Night** 
![](https://habrastorage.org/webt/se/p2/8o/sep28ojmk3nxaduhi0xxrwuyeke.png)
<sub><sup>[Tokyo Night in Marketplace](https://marketplace.visualstudio.com/items?itemName=enkia.tokyo-night)</sup></sub>

### **3. Community Material Theme Palenight** 
![](https://habrastorage.org/webt/dy/os/o3/dyoso3nq0hgn82ciwhko7oa9bqq.png)
<sub><sup>[Community Material Theme Palenight in Marketplace](https://marketplace.visualstudio.com/items?itemName=Equinusocio.vsc-community-material-theme)</sup></sub>

Good mood and productive work to all!
Solving day 9 of Advent of Code 2020 in JavaScript
Tags: challenge, adventofcode, javascript, video
Published: 2020-12-09 14:44:00

---
title: Solving day 9 of Advent of Code 2020 in JavaScript
published: true
description: JavaScript walkthrough of Advent of Code 2020 (day 9)
tags: challenge, AdventOfCode, javascript, video
series: Advent of Code 2020 in Javascript
---

{% youtube n_HRFz3gORs %}
How to Use Excel MINUTE Function in Office 365? – Examples
Tags: excelfunctions, exceltutorials, tutorials
Published: 2020-12-11 12:16:20

---
title: How to Use Excel MINUTE Function in Office 365? – Examples
published: true
date: 2020-12-09 14:42:37 UTC
tags: ExcelFunctions,ExcelTutorials,tutorials
canonical_url: https://geekexcel.com/how-to-use-minute-function-in-excel-365/
---

## **Minute Function: **

In this post, we describe the usage of the **MINUTE Function in Excel Office**   **365.** This returns the **Minutes** as a number from 0 to 59 from the given time. Minute Function is a **Built-in Function ** in Excel and categorized as **Date/Time Function.** 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)**

## ** Minute Function Syntax:**

```
 **=Minute(Serial-Number)**
```

- For example =Minute(A1), here the Minute Function will take the minute value from the cell **A1.** 
- **Time Syntax: ** The default syntax for the Time is **Hours: Minutes: Seconds. **

## Minute Function Practical Example:

Kindly, go through the below examples.

### Example 1:

![Minute Function Example 1](https://eadn-wc04-371788.nxedge.io/cdn/wp-content/uploads/2020/02/Screenshot_2-9.png)<figcaption id="caption-attachment-4070">Minute Function Example 1</figcaption>

- In the above example, the **B6 cell** holds the time value of **9hrs 12mins 14sec.** In the **C5 cell** , the Minute Function printed the minute value as **12**.

### Example 2:

![Minute Function Example 2](https://eadn-wc04-371788.nxedge.io/cdn/wp-content/uploads/2020/02/Screenshot_3-8.png)<figcaption id="caption-attachment-4071">Minute Function Example 2</figcaption>

- Here, the **cell B7** holds the time value as **11hrs 0mins 34 sec ** the minute value is **0,** so the Minute Function printed the value as **0.**

## Example 3:

![Minute Function Example 3](https://eadn-wc04-371788.nxedge.io/cdn/wp-content/uploads/2020/02/Screenshot_4-7.png)<figcaption id="caption-attachment-4078">Minute Function Example 3</figcaption>

- In the above-mentioned example, **cell B6** holds the value of  **4/30/2019 21:30 (Date and Time)** and the Minute Function prints the minute value as **30.**

## Verdict:

This article gives you the complete tutorial on **Minute Function in Excel Office 365.** We discussed the usage of **Minute Function** with practical examples. In case of any **queries** please leave a reply and share your valuable **F**** eedback **with us. Thanks for visiting ** [Geek Excel.](https://geekexcel.com/)** Keep Learning!!
Wednesday Links - Edition 2020-12-09 🧦
Tags: java, maven, spring, kubernetes
Published: 2020-12-09 14:34:42

Building Reusable Mock Modules with Spring Boot (10 min read) 🏗️
https://reflectoring.io/spring-boot-modules-mocking

Flight Recorder in Spring Boot 2.4 (30 sec read) 🛫
https://twitter.com/making/status/1334122420177838080

Data Mesh Principles and Logical Architecture (19 min read) 🪆
https://martinfowler.com/articles/data-mesh-principles.html

Finite State Machines: The Developer's Bug Spray (6 min read) 🎰
https://blog.scottlogic.com/2020/12/08/finite-state-machines.html

Branching tests (6 min read) 🎋
https://blog.ploeh.dk/2020/12/07/branching-tests

Sockets In Your Shell (2 min read) 🐚
https://who23.github.io/2020/12/03/sockets-in-your-shell.html

The Mystery of missing date (7 min read) 🕵️
https://dannorth.net/2020/11/26/the-mystery-of-the-missing-date

The Anatomy of Java Vulnerabilities (45 min) 🧑‍⚕️
https://www.youtube.com/watch?v=GhCg_ku0Txc

What's New in Maven 4 (7 min read) 🎉
https://maarten.mulders.it/2020/11/whats-new-in-maven-4

Five Years of Lets Encrypt (3 min read) 🎂
https://www.infoq.com/news/2020/12/five-years-lets-encrypt

Mirantis to take over support of Kubernetes dockershim (3 min read) 🖖
https://www.mirantis.com/blog/mirantis-to-take-over-support-of-kubernetes-dockershim-2

Don't Panic: Kubernetes and Docker (4 min) 😱
https://kubernetes.io/blog/2020/12/02/dont-panic-kubernetes-and-docker
What External Display do you use with your computer?
Tags: discuss, productivity, watercooler, codenewbie
Published: 2020-12-09 14:30:54

There is so much choice when it comes to buying an external display to use with your computer. I currently have an Apple Thunderbolt Display which is cool however the product has been discontinued. And it only works with older Macs that have a MagSafe connector which limits its usage. MagSafe lacked the versatility and convienience of today's USB-C type connections. It was only a dedicated port for power supply and Apple needed something more useful.

What type of external display do you use with your computer?
Clean Install vs Backup
Tags: discuss, productivity, watercooler, codenewbie
Published: 2020-12-09 14:18:05

When it comes to setting up a new computer what is your preference? In my case I much prefer to do a clean install it might take a lot longer but I feel like that's the best way to set up a new system from scratch. So any errors or old files which you might have had but forgotten about are no longer an issue. It's also a great way to get rid of any bugs or problems that you might have had as this is going to be a brand new start. 

I also find it great setting up a new development environment that matches your needs. However on the other side maybe some people just don't have the time and they just want to restore their computer to how it was before and avoid wasting a few days downloading and installing everything over again.
F#'s Stack Overflow community is amazing
Tags: fsharp, dotnet
Published: 2020-12-09 14:15:58

I recently asked a question about F# syntax on Stack Overflow. It seemed like a weird edge case with indentation, and I did not expect many people to have encountered this; if they did, they were unlikely to know the answer as it would be quite technical. Still, I wanted to do due diligence before opening an issue on the F# compiler repo.

```fsharp
// This is just an alias of |>
let inline (|>!) (a: 'T) (f: 'T -> 'U) = f a  
 
Some 5
|> function
| Some b -> 
    b
| None ->
    0
|>! printfn "%d" // FS0001: The type 'int' does not match the type 'unit'

// if you replace |>! with |> it compiles, even though
// it's literally the same operator
// seriously, who's going to know the answer to this
// or so I thought
```

Lo and behold, [it had already been asked](https://stackoverflow.com/questions/65148571/identical-syntax-is-invalid-when-using-a-user-defined-operator), and already had a great, detailed answer by user [Fyodor Soikin](https://stackoverflow.com/users/180286/fyodor-soikin). He pointed me to it literally within minutes of my post. I was amazed. 

For the curious, a short version of it would be this. While a human reads the above as:

```fsharp
Some 5
|> (function
    | Some b -> b
    | None -> 0)
|>! printfn "%d"
```
Because my operator has 3 characters instead of 2, this pushes the `printfn` one space, right under the `0` above, and F# interprets it as:
```fsharp
Some 5
|> function
| Some b -> 
    b // this is an int
| None ->
    0 |>! printfn "%d" // this is unit, so the types mismatch
```
But that's not really the point of this blog post; see the linked question for the juicy technical details.

I've had this experience several times now over my many years of using F#, where I'll ask something simple and then get an answer from someone like e.g. [Tomas Petricek](https://stackoverflow.com/users/33518/tomas-petricek), just to name one, with great thought and care, rigorous detail and technical clarity. The level of passion and knowledge demonstrated by many F# community members never ceases to impress me. Even compared to other great SO communities, F#'s feels more friendly, passionate and technically proficient.

Coming from more mainstream languages, one might think moving to a smaller community would make it harder to find support. I think the F# community demonstrates that's not about quantity but quality.
Man-In-The-Middle (MITM) Attack: Types, Techniques And Prevention 
Tags: cybersecurity, security
Published: 2020-12-09 14:11:57

Viruses, malware, ransomware, trojans, phishing and a lot more make a never-ending list of cyber threats. 

One of the most prevalent cyber threats out there that often gets overlooked is manipulator-in-the-middle (previously referred to as ‘man-in-the-middle’) attack. This cyber-attack questions the integrity and confidentiality of communication between two parties.

Attackers could use the latest MITM attacks and tactics to steal personal or confidential data. 

Some of the techniques used to carry out MITM attacks include:

* Rogue Access Point
* Address Resolution Protocol (ARP) Spoofing
* Domain Name System (DNS) Spoofing
* Email Hijacking
* Internet Control Message Protocol (ICMP) Redirection
* Dynamic Host Configuration Protocol (DHCP) Spoofing
* SSL Stripping

And it is rarely possible to recognize whether a Man-in-the-Middle attack has occurred or not. But, MITM attacks can be avoided by following some best practices.

This blog post covers the types and techniques of manipulator-in-the-middle attacks and offers some suggestions to stay safe from MITM attacks.

Read on to know more. 
https://beaglesecurity.com/blog/article/man-in-the-middle-attack.html
Basics on python
Tags: python, learning
Published: 2020-12-09 14:06:44

## What is Python?

Python is one of the top 10 popular programming languages of 2020. Python is a general-purpose and high-level programming language. You can use Python for developing G.U.I, games, analytics. Also, Python, as a high-level programming language, allows you to focus on the core functionality of the application by taking care of common programming tasks. 

The simple syntax rules of the programming language further make it easier for you to keep the code base readable and application maintainable. There are also a number of reasons why you should prefer Python to other programming languages.

The syntax is simple and easy to implement

## Why should we learn Python?

For a better career and good hands-on all domains

7 Reasons Why You Must Consider Writing Software Applications in
1)Readable and Maintainable Code
2) Multiple Programming Paradigms
3) Compatible with Major Platforms and Systems
4) Robust Standard Library
5) Many Open Source Frameworks and Tools
6) Simplify Complex Software Development
7) Adopt Test Driven Development

join the [python course](https://intellipaat.com/python-certification-training-online/) for better career opportunities.