teleren/devto huggingface dataset:
Notes on Kubernetes Admission Controllers
Tags: kubernetes, docker, devops
Published: 2020-12-19 13:21:47

---
title: Notes on Kubernetes Admission Controllers
published: true
description: 
tags: Kubernetes,Docker,Devops
//cover_image: https://direct_url_to_image.jpg
---

Before a request is sent to the Kube-API server, some sort of client-side validation occurs. During this client-side validation, Kubectl validates requests and ensures that bad requests[ bad resource names, malformed image names, etc] do not go through to the API server. After the client-side validation, requests to the server are then authenticated. The authentication aims to ensure that the user making the request has the right to access that cluster. After the authentication process, Authorization is then carried out to verify if the requestor is allowed to perform the specified action. Once the above actions are completed successfully, the request is allowed to pass through the admission controllers.
   Admission controllers intercept authenticated & authorized requests to the Kubernetes API server just before the appropriate objects are persisted to etcd. Admission controllers ensure that the authenticated requests obey the rules of the of the cluster — Such as resource quotas allocated, and limit ranger. Internally, Admission controllers are stored as plugins in this directory. 
   There are over 30 admission controllers available provided by default along with the Kubernetes binary. When a request is intercepted, All the admission controllers behave like a dependent chain, where if a single admission controller fails, all other controllers fail leading to the entire request failing. The entire list of admission controllers and their functions can be found here. The Admission control process has two phases, The mutating phase which is executed first, and the validating phase. The controllers can act as validating controllers, mutating controllers, or a combination of both mutating and validating.
## In Conclusion
So far, We have talked quite a bit about the Kubernetes admission controller. I hope you enjoyed reading this and learning about admission controllers. If you have any questions, leave them in the comments below! I will attempt to answer them
Enjoyed this tutorial? Give me a Give me a [shoutout on Twitter](https://twitter.com/intent/tweet?url=https%3A%2F%2Fdev.to%2Fghvstcode%2Fnotes-on-kubernetes-admission-controllers-47k4-temp-slug-3280465&text=I%20enjoyed%20reading%20Notes%20on%20Kubernetes%20Admission%20Controllers%20by%20@GhvstCode)! It would make me happy and motivated to keep writing.
How to initialize a vector in C++
Tags: cpp, oop, programming, computerscience
Published: 2020-12-19 13:10:36

Vector is a standard library class template, which is similar to array, but also supports dynamic resizing. Vector provides a data structure with contiguous memory location. This enables efficient, direct access to any element of a vector via the subscript operator [ ], exactly as with a built-in array. Like class template arrays, template vector is most commonly used when the data in the container must be easily accessible via subscript or will be sorted, and when the number of elements may need to grow.

**All of the above was a quick review over vectors, but the original topic of today’s article is how to initialize a vector in C++?**

---
title: originally posted here 👇
canonical_url: https://kodlogs.com/blog/519/how-to-initialize-a-vector-in-c
--- 

##Methods to initialize a vector in C++
We can initialize vectors in many ways but in this article we will discuss only easy and familiar routes to initialize vectors. All the methods are given ahead.

* Specifying size and initializing all values
* Initializing like arrays
* Initializing from array
* Initializing from another vector


###Specifying size and initializing all values
```
// CPP program to create an empty vector 
// and push values one by one. 
#include <bits/stdc++.h> 
using namespace std; 

int main() 
{ 
	int n = 3; 

	// Create a vector of size n with 
	// all values as 10. 
	vector<int> vect(n, 10); 

	for (int x : vect) 
		cout << x << " "; 

	return 0; 
}
``` 
###Initializing like arrays
```
// CPP program to initialize a vector like 
// an array. 
#include <bits/stdc++.h> 
using namespace std; 

int main() 
{ 
	vector<int> vect{ 10, 20, 30 }; 

	for (int x : vect) 
		cout << x << " "; 

	return 0; 
}
``` 
###Initializing from array
```
// CPP program to initialize a vector from 
// an array. 
#include <bits/stdc++.h> 
using namespace std; 

int main() 
{ 
	int arr[] = { 10, 20, 30 }; 
	int n = sizeof(arr) / sizeof(arr[0]); 

	vector<int> vect(arr, arr + n); 

	for (int x : vect) 
		cout << x << " "; 

	return 0; 
}
``` 
###Initializing from another vector
As the name suggests we will be initializing vectors from another vector. And the reason I put this method in the last is because before following this method we must know how to initialize a vector by another method. 
```
// CPP program to initialize a vector from 
// another vector. 
#include <bits/stdc++.h> 
using namespace std; 

int main() 
{ 
	vector<int> vect1{ 10, 20, 30 }; 

	vector<int> vect2(vect1.begin(), vect1.end()); 

	for (int x : vect2) 
		cout << x << " "; 

	return 0; 
} 
```
 

If you have any doubt or queries related to this article feel free to ask in the comment section. I would like to answer you.
How to add to the PYTHONPATH in Windows, so it finds my modules/packages?
Tags: python, programming, computerscience
Published: 2020-12-19 13:06:11

#What is PYTHONPATH?
PYTHONPATH is an environment variable in python which adds additional libraries in the directory that python should add in the directory list. To execute you don’t need these variables because python knows where to find standard libraries. PYTHONPATH is used for assistance in python modules to import the python scripts. PYTHONPATH also check which libraries accommodate imported modules.

---
title: originally posted here 👇
canonical_url: https://kodlogs.com/blog/66/how-to-add-to-the-pythonpath-windows-finds-modules-packages
---

##Procedure to add PYTHONPATH in windows:
* Go to MY Computer icon then click on Properties > Advance system settings> Environment Variables.
* Click on the “new” button in the upper half of the dialog, to create a new variable for the user.
* The variable name is given as PYTHONPATH and the value represents the path to the code directory.
* Click Ok
* Click OK again to save the variables.
###Procedure for confirmation of PYTHONPATH:
* Open the command prompt by applying the given procedure
1. Press window+R.
2. A dialog box will appear. Enter “cmd”.
3. Press Enter
* Command Prompt will open and type the following command
 **echo %PYTHONPATH%**
Now you can see that the environment variable is set correctly

**Note:**
Never confuse this with Python PATH environment variable which is used in an operating system for the assistance to invoke form anywhere. This means if you are just going to type Python the command window, then the system will look the PATH to just find the executable with the name python.
Microsoft Teams | How to create your personal space or Me experience on Teams
Tags: microsoftteams, msteams, office365, microsoft365
Published: 2020-12-19 13:01:30

---
title: Microsoft Teams | How to create your personal space or Me experience on Teams
published: true
description: 
tags: MicrosoftTeams, msteams, Office365, Microsoft365
cover_image: https://dev-to-uploads.s3.amazonaws.com/i/qgtwhkutp86x8q66zcdl.png
---

In this video tutorial, you’ll learn how to create your personal space on #MicrosoftTeams. 
I’ll walk through every step in order to set up the Me experience which gives you an overview from your personal perspective about the upcoming meetings, tasks, emails, followed sites, recent documents, and news to read later. 

{% youtube fffyVKlpIjA %}
Daily Developer Jokes - Saturday, Dec 19, 2020
Tags: jokes, dailydeveloperjokes
Published: 2020-12-19 13:00:22

---
title: "Daily Developer Jokes - Saturday, Dec 19, 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%2019%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/5e12596bcfd66.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:___ What was Grace Hopper's favorite car?

___A:___ VW Bug
 -->
How to get ASCII value of char in java?
Tags: java, oop, programming, computerscience
Published: 2020-12-19 12:56:29

In this article,we will learn about how to get ascii value of char in java.

ASCII is a code for representing English characters as numbers, each letter of the English alphabet is assigned a number ranging from 0 to 127. For example, the ASCII code for uppercase P is 80.

---
title: originally posted here 👇
canonical_url: https://kodlogs.com/blog/2183/how-to-get-ascii-value-of-char-in-java
---

In Java programming, we have two ways to find the ASCII value of the character 1) By assigning characters to int variable 2) With a value of type casting character as an int

Let us write a program to understand how it works:

Example: Program to find the ASCII code of character
```
public class Demo {

    public static void main (String [] args) {

        Char ch = 'P';

        int asciiCode = ch;

        // char type casting int

        asciiValue int = (int) ch;



        System.out.println ( "ASCII value of" + ch + "is:" + asciiCode);

        System.out.println ( "ASCII value of" + ch + "is:" + asciiValue);

    }

}
```
##Output:

ASCII value of P is: 80

ASCII value of P is: 80
Not Just Clean Code
Tags: codequality, programming, architecture, code
Published: 2020-12-19 12:53:15

The quote "Programs must be written for people to read, and only incidentally for machines to execute" By reading the book SICP or at least I believe it has a deeper meaning than readability of the code. 

If we clearly read the actual phrases from SICP. They were talking about creating abstractions that hide details of the complexity of machine instructions which allows actual code looks closer to problem domain. 

***First, we want to establish the idea that a computer language is not just a way of getting a computer to perform operations but rather that it is a novel formal medium for expressing ideas
about methodology***. Thus, programs must be written for people to read, and only incidentally for machines to execute.

A domain-specific language is something that can be understood and can be used as a medium of precise communication between people working in that domain is a higher-level abstraction that can be easily understood without thinking about how the computer manages memory and schedules the time of CPU to execute instructions of multiple programs in an operating system.
How to convert integer to string in c++ (In c++11)
Tags: cpp, oop, programming, computerscience
Published: 2020-12-19 12:51:53

Since the standard C++11, string-to-number conversions and vice versa are built into the standard library. All of the following functions are present in <string> (according to clause 21.5).

---
title: originally posted on 👇
canonical_url: https://kodlogs.com/blog/2288/how-to-convert-integer-to-string-in-c-in-c-11
---

##From line to number:
`
float              stof(const string& str, size_t *idx = 0);
double             stod(const string& str, size_t *idx = 0);
long double        stold(const string& str, size_t *idx = 0);
int                stoi(const string& str, size_t *idx = 0, int base = 10);
long               stol(const string& str, size_t *idx = 0, int base = 10);
unsigned long      stoul(const string& str, size_t *idx = 0, int base = 10);
long long          stoll(const string& str, size_t *idx = 0, int base = 10);
unsigned long long stoull(const string& str, size_t *idx = 0, int base = 10);
`
They each take a string as input and try to convert it to a number. If it was not possible to build a valid number, for example, because there is no numeric data or an out-of-range number for the given type, an exception ( std::invalid_argument or std::out_of_range) is thrown .

If the conversion is successful and is idx not 0, it idx will contain the index of the first character that was not used for decoding. It can be an index after the last character.

Finally, integer types allow you to specify a base; numbers greater than 9 assume the alphabet (from a=10 to z=35). You can find additional information on the exact formatting that can be analyzed here for the numbers with floating point, integer signed numbers and whole numbers without sign.

Finally, for every function, there is also an overload that takes std::wstring as the first parameter.

##From numeric to string:
`
string to_string(int val);
string to_string(unsigned val);
string to_string(long val);
string to_string(unsigned long val);
string to_string(long long val);
string to_string(unsigned long long val);
string to_string(float val);
string to_string(double val);
string to_string(long double val);
`
They are simpler, you pass in the appropriate numeric type and you get the string back. For formatting options, you should go back to the C ++ 03 stringsream option and use stream manipulators as described in another answer here.

As noted in the comments, these functions fall back to the default mantissa precision, which is probably not the maximum precision. If your application requires more precision, it is best to revert to other string formatting procedures as well.

There are also similar functions defined with a name to_wstring, they will return a value std::wstring.
Are you an ideal team player?
Tags: learning, teamwork, leadership
Published: 2020-12-19 12:47:40

---
title: Are you an ideal team player?
published: true
description: Self-evaluation from Patrick Lencioni's Ideal Team Player book
tags: learning,teamwork,leadership
canonical_url: https://kimmosaaskilahti.fi/blog/2020-12-19-ideal-team-player/
cover_image: https://dev-to-uploads.s3.amazonaws.com/i/p9h609n5mghu3x5f0ahg.jpg
---

[_The Five Dysfunctions of a Team_](https://www.goodreads.com/book/show/21343.The_Five_Dysfunctions_of_a_Team) by Patrick Lencioni is a classic in teamwork literature. Recently I've been reading the author's follow-up book [_The Ideal Team Player_](https://www.goodreads.com/book/show/28930640-the-ideal-team-player). I've only started reading the fable, but I couldn't help taking a peek at the end of the book where I found an interesting self-evaluation test for anyone interested in improving their team work skills. I thought it's quite cool so I'll share it here!

Think how **your teammates** would respond to the following claims about you (the original claims were written in the first person but for me, it felt easier to think in third person). 

The response scale is: **Usually=3, Sometimes=2, Rarely=1**. 

#### Humility

1. She compliments or praises her teammates without hesitation.
2. She easily admits to her mistakes.
3. She's willing to take on lower-level work for the good of the team.
4. She gladly shares credit for team accomplishments.
5. She readily acknowledges her weaknesses.
6. She offers and accepts apologies graciously.

#### Hunger

7. She does more than what is required in her own job.
8. She has passion for the "mission" of the team.
9. She feels a sense of personal responsibility for the overall success of the team.
10. She's willing to contribute to and think about work outside of office hours.
11. She's willing to take on tedious or challenging tasks whenever necessary.
12. She looks for opportunities to contribute outside of her area of responsibility.

#### Smart

13. She generally understands what others are feeling during meetings and conversations.
14. She shows empathy to others on the team.
15. She demonstrates an interest in the lives of her teammates.
16. She's an attentive listener.
17. She's aware of how her words and actions impact others on the team.
18. She adjusts her behavior and style to fit the nature of a conversation or relationship.

I tried to evaluate myself as honestly as possible based on my recent actions as part of the team and scored 42 points out of 54. It feels a bit easier to understand where I need to improve and how. A good next step might be to ask teammates to evaluate me directly and try to improve in each of the three areas in turn.

What do you think about the self-evaluation above? How much did you score? What other questions would you add to the list? Thanks for reading!
Fire-UI : A User-Friendly and Reliable CSS Framework
Tags: css, javascript, opensource
Published: 2020-12-19 12:35:20

![Fire-UI Home](https://dev-to-uploads.s3.amazonaws.com/i/bgfpikefm3xleuqzd336.jpg)

Quickly design your website with [Fire-UI](https://fire-ui.github.io/), a **FREE**, **User-Friendly**, and **RELIABLE** CSS Framework. Fire-UI is an open source project aimed to cope with any difficulties usually found by developers on Frontend.

**_"Built by everyone, for everyone._"**

Fire-UI is created under [**MIT LICENSE**](https://github.com/fire-ui/fire-ui/blob/master/LICENSE). For Docs (Documentation), you can visit [https://fire-ui.github.io/index.html](https://fire-ui.github.io/index.html)

![Fire-UI Docs](https://dev-to-uploads.s3.amazonaws.com/i/dof1jv76dup5c96jdrmd.jpg)


Code on GitHub : [https://github.com/fire-ui/fire-ui](https://github.com/fire-ui/fire-ui)
How to Contribute : [https://github.com/fire-ui/fire-ui#contributing-guidelines](https://github.com/fire-ui/fire-ui#contributing-guidelines)
Support us on GitHub By Giving A Star : [https://github.com/fire-ui/fire-ui](https://github.com/fire-ui/fire-ui)

For Complete Guide, you can click the following link : [https://github.com/fire-ui/fire-ui#readme](https://github.com/fire-ui/fire-ui#readme)

I appreciate any comments, contributions, even a star (≧∇≦)ﾉ.
Have a Nice Day (*^▽^*)┛.
Install aws cli on your mac
Published: 2020-12-19 12:34:35

Install aws cli on your Mac using these simple steps


Start on AWS website to get a package for your mac
- https://docs.aws.amazon.com/cli/latest/userguide/install-cliv2-mac.html#cliv2-mac-install-gui

Double click on the downloaded package and follow the instructions.

![apple/mac aws cli package installation screenshot](https://dev-to-uploads.s3.amazonaws.com/i/lum4ajexi9lugn2gww3g.png)


Once the software is successfully installed, you could go to a Terminal and try the following to check if `aws` is ready for you to use.
 

```
~ which aws    
/usr/local/bin/aws
~ aws --version
aws-cli/2.0.30 Python/3.7.4 Darwin/17.7.0 botocore/2.0.0dev34
~ 
```

Related:
- once you install `aws`, then go on to install a very handy tool `aws-shell` (<https://github.com/awslabs/aws-shell>)
How to find LCM in python
Tags: python, programming, computerscience
Published: 2020-12-19 12:33:05

To find the LCM of two numbers, we start by writing an inequality with a on the LHS and b on the RHS. Then, we prime factor both sides. Last, we turn this expression into an equality by adding factors until both sides read the same. The product of all prime factors is the LCM.

The least common multiple (L.C.M.) of two numbers is the smallest positive integer that is perfectly divisible by the two given numbers.

---
title: Originally posted on 👇
canonical_url: https://kodlogs.com/blog/2401/how-to-find-lcm-in-python
---

**For example, the L.C.M. of 12 and 14 is 84.**
```
# Python Program to find the L.C.M. of two input number

def compute_lcm(x, y):

   # choose the greater number
   if x > y:
       greater = x
   else:
       greater = y

   while(True):
       if((greater % x == 0) and (greater % y == 0)):
           lcm = greater
           break
       greater += 1

   return lcm

num1 = 54
num2 = 24

print("The L.C.M. is", compute_lcm(num1, num2))
```
##Output

The L.C.M. is 216
**Note:** To test this program, change the values of num1 and num2.

This program stores two number in num1 and num2 respectively. These numbers are passed to the compute_lcm() function. The function returns the L.C.M of two numbers.

In the function, we first determine the greater of the two numbers since the L.C.M. can only be greater than or equal to the largest number. We then use an infinite while loop to go from that number and beyond.

In each iteration, we check if both the numbers perfectly divide our number. If so, we store the number as L.C.M. and break from the loop. Otherwise, the number is incremented by 1 and the loop continues.

The above program is slower to run. We can make it more efficient by using the fact that the product of two numbers is equal to the product of the least common multiple and greatest common divisor of those two numbers.

Number1 * Number2 = L.C.M. * G.C.D.
Here is a Python program to implement this.
```
# Python program to find the L.C.M. of two input number

# This function computes GCD 
def compute_gcd(x, y):

   while(y):
       x, y = y, x % y
   return x

# This function computes LCM
def compute_lcm(x, y):
   lcm = (x*y)//compute_gcd(x,y)
   return lcm

num1 = 54
num2 = 24 

print("The L.C.M. is", compute_lcm(num1, num2))
```
The output of this program is the same as before. We have two functions compute_gcd() and compute_lcm(). We require G.C.D. of the numbers to calculate its L.C.M.

So, compute_lcm() calls the function compute_gcd() to accomplish this. G.C.D. of two numbers can be calculated efficiently using the Euclidean algorithm.