teleren/devto huggingface dataset:
Pascal’s Triangle
Tags: beginners, codenewbie, 100daysofcode, java
Published: 2022-01-31 13:42:38

Deduction made from how the Pascal's triangle is constructed:

The boxes at the start and end of the list are always set to '1'

![Pascal Triangle](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/rel86za2i9n4lnql3vy5.png)
 
Initially the first 2 levels do not have any adding up of elements and the process of adding starts from the 3rd level 

![Pascal Triangle](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5v1ydgaawnr42siceh8d.png)
 
Adding up the previous level answer leads to the new numbers at the center of the triangle

![Pascal Triangle](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xv6xi8tr8fpdfxkznlkn.png)
 


How to approach this problem? 
- We can keep a pointer to here 'i' for each level of the 
  triangle
- Also if we notice there are center boxes that grow in triangular pattern. 
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/rya4in9bq2oku2ukjq4m.jpg) 

Notice when level is '1' we have '0' elements to be added from previous levels. 
At level 1 --> 0 elements are formed by adding
At level 2 --> 1 elements are formed by adding
At level 3 --> 2 elements are formed by adding
and so on...


- we can have a 'j' variable that we initialize when we are at 1st level of 'i'.
- Here we are initializing 'j' to be 'zero' and less than 'i'. 


'i' and 'j' values Serve multiple purposes in this problem

1. 'i' indicates each level and 'j' indicates the elements formed by adding up previous elements.
2. 'j' runs at a 1 less than 'i' as it starts from '0' and creates boxes at each level.
3. As the answer is stored in List<List> i.e (List of Lists). We can to retrieve the previous level data and add this to form the current value.

Code:
```
   for(int i=1; i<=numRows; i++){
            for(int j=0; j<i; j++){
```


- For the first and the last box we want to add '1'
```
for(int i=1;i<=numRows;i++){      
    for(int j=0; j<i; j++){
      if(j==0 || j==i-1){  // add '1' to first box and last box
          curr.add(1);  // Add to list curr
               }
```
-For boxes at the center ranging  from (1:i-1)

```
for(int i=1;i<=numRows;i++){
           List<Integer> curr = new ArrayList<>();       
           for(int j=0;j<i;j++){
               if(j==0 || j==i-1){
                   curr.add(1);
               }
               else{
curr.add(levels.get(i-1).get(j)+ levels.get(i-1).get(j-1)); // to form new elements by  adding values from previous levels
           }
        }
```

Dry Run:
![Pascal Triangle](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/h7aueemxx3yu59lt6mrs.png)
 
![Pascal Triangle](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/e6amfv1pn8od3tp9hs74.PNG)
 
![Pascal Triangle](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1qvzva04qucjjrtdg5mz.png)
  

![Pascal Triangle](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jpmw50mjw3kb9n6jyzp2.png)
 

Do like if you found this helpful. This would help me learn and create new articles like this.
Thanks!
How to create Admin Panel in LARAVEL 8 in 10 min?
Tags: laravel, tutorial, programming, php
Published: 2022-01-31 13:42:00

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/53d53unbwjsvz2t0npan.png)

## Tech-Admin - Laravel 8 Admin Starter Kit

Today I am going to explain about installing LARAVEL 8 admin starter kit.

## Features

- Mobile Responsive Bootstrap 4 Design
- User Management with Roles
- Role Management
- Permissions Management
- Access Control List (ACL)
- Laravel 8 + Bootstrap 4

I have Explained every step in this video you can watch and try this out, 

{% youtube AQeWj89c6FE %}

The Final Implementation [Github Repository](https://github.com/TechTool-India/techtool-laravel-admin) you can download this and can use it for any project.

Some Final Output Screens are here

![App Screenshot](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/53d53unbwjsvz2t0npan.png)

![App Screenshot](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/pp9vfllktg4gyarwqq84.png)

![App Screenshot](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ijs2pn14sroqt37n6nq9.png)

![App Screenshot](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5w9yy33y0fspnnl68t0m.png)

![App Screenshot](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/v5p71gck63r039mk6jix.png)

Thank You for Reading

Reach Out To me.
[Twitter](https://twitter.com/techtoolindia)
[Instagram](https://www.instagram.com/techtoolindia/)
[TechToolIndia](https://youtube.com/techtoolindia)
Lambda Function as a Kedro Node
Tags: python, kedro
Published: 2022-01-31 13:41:17

---
canonical_url: https://waylonwalker.com/til/kedro-lambda-node/
cover_image: https://images.waylonwalker.com/til/kedro-lambda-node.png
published: true
tags:
- python
- kedro
series: til
title: Lambda Function as a Kedro Node
---

I keep my nodes short and sweet.  They do one thing and do it well. I turn almost every DataFrame transformation into its own node.  It makes it must easier to pull catalog entries, than firing up the pipeline, running it, and starting a debugger.  For this reason many of my nodes can be built from inline lambdas.

## Examples

Here are two examples, the first one `lambda x: x` is sometimes referred to as an identity function.  This is super common to use in the early phases of a project.  It lets you follow standard layering conventions, without skipping a layer, overthinking if you should have the layer or not, and leaves a good placholder to fill in later when you need it.

> Many times I just want to get the data in as fast as possible, learn
> about it, then go back and tidy it up.

``` python
from kedro.pipeline import node

my_first_node = node(
   func=lambda x: x,
   inputs='raw_cars',
   output='int_cars',
   tags=['int',]
   )

my_first_node = node(
   func=lambda cars: cars[['mpg', 'cyl', 'disp',]].query('disp>200'),
   inputs='raw_cars',
   output='int_cars',
   tags=['pri',]
   )
```

> Note: try not to take the idea of a one liner too far.  If your
> one line function wraps several lines down it probably deserves to be
> a real function for readability and a good docstring.
From enterprise product, through open-core to OpenAPI validator: Our journey
Tags: rust, opensource, api, startup
Published: 2022-01-31 13:39:35

#### **Hi everyone!**

[Cherrybomb](https://github.com/blst-security/cherrybomb) is a new CLI app(written in Rust) that can help you **detect half-done API specifications**, map your APIs, and scan them for business logic vulnerabilities.
🤔 We've seen the problem of incomplete **API flow and parameter specifications**, which then translates to a lack of input control formerly in our own APIs and in the APIs of many of our developer friends and acquaintances.

## We decided to do something about it

let me tell you a bit about our journey: 

* First, we thought this kind of thing will only interest enterprises, and we couldn't be more wrong, apparently, even an indie developer with one API out there loses sleep over its security... So, we chose to go with the bottom-up approach.
* The second stop in our journey came in the form of user accessibility. How can we make our solution accessible for as many users as possible? We thought that going with a SAAS only product was the answer, but developing it for both users and enterprises while raising capital took quite a lot of us as developers.
* The third stop is our first CLI release. We released our first open sourced product as a CLI named Firecracker (and yes, I know there is a repo already named Firecracker that is maintained by AWS...) and due to some name overlaps, lack of tenacity in publicizing it, and a lot of user friction to get the first value (you had to put in HTTP logs for the first map), it got stuck on 100 stars (until today hopefully).

That brings us to today, after this quite long journey we have made some changes, to use **Cherrybomb**(we changed the name) we only require the **swagger file**(OAS specification) of the API, and we run a series of quick passive test to alert regarding some **_specification issues, non best practices_** and so on...

## What's next?
We are planning to implement even more and more interesting passive tests, start to run some active tests, create logs with the swagger, connect it to our currently existing mapper module, and more.
**For that, we need your help**. Dear community, if you know Rust, swaggers, APIs, security testing, or just want to have some fun contributing to a cool open source product, join our [discord server](https://discord.gg/ZcAZzhuX). Please let us know your thought about our journey and about our CLI, comment here or on our github page:
[https://github.com/blst-security/cherrybomb](https://github.com/blst-security/cherrybomb)
💿Você ainda vende CDs!
Tags: braziliandevs, concept, productivity, dotnet
Published: 2022-01-31 13:38:57

Sim os disco compacto, disco compacto a laser, disco a laser, compacto laser ou simplesmente disco laser (popularmente conhecido por CD, sigla para a designação inglesa, Compact Disc) criado em 1982 no Japão.
![Loja vendendo cd (Compact Disc) de cantores](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/y4ntn5zsjpt46tmqazg3.png)

Eles ainda não morreram e sabe porquê? porque vivemos em diferentes mundos as vezes estaremos parados na tecnologia porque nossos clientes estão e isso é muito ruim porque vc não está no estado da arte (DVD -> HD DVD, Disco Blu-ray -> [Archival Disc](https://pt.wikipedia.org/wiki/Archival_Disc))
Mas isso sai da "linha física" e passa para os Streamming (Spotify (2008), Deezer, Tidal, etc...) com mais de [70 milhões de musicas](https://newsroom.spotify.com/company-info/).

O ponto que quero chegar é se você está no mundo dotnet e ainda dá manutenção em sistema com .NET Framework, você já está atrasado para o bravo mundo novo .NET (que teve início em 2016) onde temos mais desempenho, possibilidade de rodar no Windows, MacOs ou GNU/Linux, Docker.

Se você ainda ficar vendendo CD é porque seus clientes não buscam crescimento, evolução e melhoramento contínuo, porque a tecnologia impacta em todas as áreas com disrupção, cuidado com os clientes que você tem pois seu atual/futuro comcorente concorrente pode estar se preparando para o bravo mundo novo para fazer de maneira disruptiva como (Uber, Nubank, Ifood, etc... ).
Acra. Features: Authentication
Tags: cryptography, security, encryption, database
Published: 2022-01-31 13:37:49

The main Acra purpose is to provide confidentiality and integrity of protected data. As Acra works inside of large infrastructures, it provides additional ways to make sure that no one can access data unauthenticated.

> *[Use Acra Community Edition for free] (https://github.com/cossacklabs/acra). Check out [Acra Enterprise Edition] (https://www.cossacklabs.com/acra/#pricing) tailored for solutions with high security requirements.*

##5️⃣ Authentication

Whether Acra is deployed as [AcraServer] (https://docs.cossacklabs.com/acra/acra-in-depth/architecture/acraserver/) (transparent SQL proxy) or [AcraTranslator] (https://docs.cossacklabs.com/acra/acra-in-depth/architecture/acratranslator/) (API service), it [authenticates each application’s connection.] (https://docs.cossacklabs.com/acra/acra-in-depth/authentication/) 

💡 Each trusted application has a unique clientID linked with application keys. If the app sends the wrong clientID, the **data won’t be decrypted as keys don’t match**.

For infrastructures that rely on the newest TLS (v1.2 and v1.3), Acra requires mutual authentication—certificate pinning for Acra, application and the database. mTLS makes MitM attacks more complicated. 

Also, Acra provides a list of security controls **to ensure that CA is trusted and that all certificates are valid.**

![Acra by Cossack Labs](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/q1yyy21homt9oggieav2.png)

For [infrastructures that lack TLS] (https://docs.cossacklabs.com/acra/security-controls/transport-security/) or can’t rely on certificate pinning, Acra provides a separate daemon AcraConnector that enables a mutually authenticated secure connection between the app and Acra. It uses Themis Secure Session protocol under the hood, which is based on ECDH & AES.

🔥 Acra provides multi-layered defenses for sensitive data that your system operates on.
Implement strStr() — Leetcode Python Solution
Tags: strstr, leetcodestrstr, leetcodesolutions, algorithmleetcode
Published: 2022-01-31 13:32:06

LeetCode has a Easy coding Problem in Its’ Algorithm Section “Implement strStr()”. Today We are going to solve this problem. 

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

Question
Implement strStr().
Return the index of the first occurrence of needle in haystack, or -1 if needle is not part of haystack.
Clarification:
What should we return when needle is an empty string? This is a great question to ask during an interview.
For the purpose of this problem, we will return 0 when needle is an empty string. This is consistent to C’s strstr() and Java’s indexOf().
Examples
Input: haystack = "hello", needle = "ll"
Output: 2
Input: haystack = "aaaaa", needle = "bba"
Output: -1
Input: haystack = "", needle = ""
Output: 0
Constraints:
0 <= haystack.length, needle.length <= 5 * 104
haystack and needle consist of only lower-case English characters.
Solution to Implement strStr()
The Solution to the problem is here: https://hecodesit.com/implement-strstr-leetcode-python-solution/
Stuck Trying to Migrate from CentOS Linux to Rocky Linux after EOL?
Tags: linux
Published: 2022-01-31 13:23:01

So CentOS Linux is [already passed their End of Life](https://blog.centos.org/2020/12/future-is-centos-stream/) and I forgot to migrate my system to [Rocky Linux](https://rockylinux.org/). What could be worse?

I run [the migration script today](https://github.com/rocky-linux/rocky-tools/tree/main/migrate2rocky) and I encountered this pellicular error:

```txt
Error: Error downloading packages:  No URLs in mirrorlist
``` 


![Error screenshot](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0nbkoyi6tlogys5x6tmz.png)

I thought it was just a random network error, well it also failed with `dnf update`. Things go dark from here.

After a few hours of trial and error debugging the network. I successfully fixed it by changing the CentOS' YUM repo server to one of the mirror servers. What this is means is that the canonical  CentOS YUM repo server list (`mirrorlist.centos.org`) is simply no longer be usable anymore and we need to change it to one of the usable mirrors left in the world.
 
One of the mirrors that worked for me when I wrote this is `http://repo.uk.bigstepcloud.com/centos-vault/`. There are lots of other mirrors to choose from [listed here](https://mirror-status.centos.org/).

To change the CentOS YUM repo server used, you need to modify these files using `vim` or `nano` (your list may be more or less, you need to check which yum repos enabled in your machine using `yum repolist --enabled`) :

```
/etc/yum.repos.d/CentOS-Linux-AppStream.repo
/etc/yum.repos.d/CentOS-Linux-BaseOS.repo
/etc/yum.repos.d/CentOS-Linux-Extras.repo
```

You need to comment out the `mirrorlist` and uncomment the `baseurl` with changing the mirror base URL. The changes are done like this:
```patch
[baseos]
name=CentOS Linux $releasever - BaseOS
- mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=BaseOS&infra=$infra
+ #mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=BaseOS&infra=$infra
- #baseurl=http://mirrorlist.centos.org/$contentdir/$releasever/BaseOS/$basearch/os/
+ baseurl=http://repo.uk.bigstepcloud.com/centos-vault/$contentdir/$releasever/BaseOS/$basearch/os/
gpgcheck=1
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial
```

I run the migration system again and things work so well. guess I need to share this small tip so I can save someone else's hours haha. Hope it is useful!

---

Blog Changes 2022-02-02: Prepended path `/centos-vault/` to the mirror URL.
10 websites to find a Web3 Job
Tags: jobs, web3
Published: 2022-01-31 13:13:13

Whether you like it or not, Web3 is a thing.
A lot of friends of mine, start to ask me "How can I find my next job in the Web3 context?"
This is why I created this list on my Notion and now I would like to share it here.

# 1. web3.carreer
This is my favorite, but it's only my opinion.
You can decide if you want to receive a daily report with all new jobs

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

https://web3.career/

# 2. cryptocurrencyjobs.co
This is more about crypto currencies.

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

https://cryptocurrencyjobs.co/

# 3. crypto.jobs

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9qqnxlou69p7k9azbvwp.png)

https://crypto.jobs/

# 4. buildspace.so

🦄🦄🦄

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

https://buildspace.so/

# 5. web-3.pallet.xyz/jobs

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/902cdoqparh62o2or662.png)
 
https://web-3.pallet.xyz/jobs

# 6. useweb3.xyz/jobs

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/59cg4ekghx15fbwsihbd.png) 

https://www.useweb3.xyz/jobs

# 7. web3board.io

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

https://web3board.io/

# 8. pompcryptojobs.com

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

https://pompcryptojobs.com/

# 9. defi.jobs

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

https://www.defi.jobs/

# 10 . remote3.co
This one is one my favorite, as well.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5y67ia05jqto4rmsluz6.png)

https://remote3.co/


### Happy searching your next job :)
CODE PUZZLE for Python and other languages
Tags: code, python, parsons, puzzle
Published: 2022-01-31 13:10:26

---
title: CODE PUZZLE for Python and other languages
published: true
description: "PARSONS PUZZLES" GENERATOR AND MANAGER
tags: code, python, parsons, puzzle
cover_image: https://www.codepuzzle.io/img/open-graph.png
---

[Code Puzzle](https://www.codepuzzl.io/en) is a "Parsons puzzles" generator and manager.

With [Code Puzzle](https://www.codepuzzl.io/en) you can create, save, modify and share Parsons puzzles (or Parsons problems).

According to [Wikipedia](https://en.wikipedia.org/wiki/Parsons_problems) : "Parsons problems are a form of an objective assessment in which respondents are asked to select from a selection of code fragments, some subset of which comprise the problem solution. The Parsons problem format is used in the learning and teaching of computer programming. Parson's programming puzzles became known as Parsons puzzles and then Parsons problems. Parsons problems have become popular as they are easier to grade than written code while capturing the students problem solving ability shown in a code creation process."

![example](https://www.codepuzzle.io/img/demo.gif)
Variable Declarations and Scoping in JavaScript
Tags: javascript, webdev, programming
Published: 2022-01-31 13:07:24

There are only three types of variable declaration inside JavaScript. These are 
let, const and var declarations

Before we understand these declarations we need to know about scoping.Scoping simply answers the basic question, "Where is this variable name valid?". This can also be thought of where can I, access this variable from.

There are 2 types of scoping 

### Block Scoping
In this type of scoping, the variables are valid only to the nearest enclosing block and not outside it. They are essentially valid only from "{" to the "}". So we simply look for the innermost "{" in which the identifier is present. It is now valid until it's corresponding "}" is not encountered.

```
{
// Block Scope of a variable 
}

1{
   // Variables declared here are valid from 1  to 1' and even valid inside 2 to 2' as its enclosing block is 1'
    2{
        // Variables declared here valid only from 2 to 2'
    2'}
1'}
```

### Lexical Scoping
Lexical scoping allows variables to be valid inside the whole function inside which they are declared and ignore all block level scoping. Here the variable once declared inside the function can be accessed inside any level of the function

```
function dev() 1{
// Lexically scoped variables, are valid from 1-1' 
1'}

function dev1() 1{
    2{
        // Lexically declared variable x
    2'}
    // x is valid here as it is lexically valid from 1-1' 
1'}
```

Now we understand scoping so we can discuss let, const and var in detail.

let and const are block level scoped and var is lexically scoped.

### Difference between let and const
let is used to refer to variables that may change in the future.

const is used to declare a read-only reference to the value. A const statement does not allow re declaration or re-assignment of variables

### Common confusion

Using const in objects makes a constant reference to the object, not the object constant. The object is still mutable

```
// This is valid JS as we are mutating the object, not the reference
const obj = {}
obj.key = "value"

// This is invalid JS, as we are mutating the reference itself
const obj1 = {}
obj1 = {"key": "value"}
``` 
  
Another common confusion is that var creates global variables, which is not entirely true.
var is used to create variables with lexical/functional scope, so var becomes a global variable only when it is declared outside any function

```
// variables declared here are globally scoped

function dev() {
// variables declared here are not globally scoped, and are restricted to the dev
}
```

To get a video tutorial on this concept,
https://www.youtube.com/watch?v=wtBbanu-kUY 

References:
https://developer.mozilla.org/en-US/docs/Glossary/Scope 
https://javascript.info/closure
DNS- Terminology
Published: 2022-01-31 12:41:40

Domain Name System which translates the human friendly hostnames 
into the machine IP addresses

• www.google.com => 172.217.18.36

**DNS uses hierarchical naming structure**

.com
example.com
api.example.com
www.example.com

DNS Terminologies


• **Domain Registrar:** 
Amazon Route 53, GoDaddy, etc..
• **DNS Records:** 
A, AAAA, CNAME, NS, etc..
• **Zone File:** 
contains DNS records
• **Name Server:** 
resolves DNS queries 
• **Top Level Domain (TLD):**
 .com, .us, .in, .gov, .org, etc...
• **Second Level Domain (SLD): **
amazon.com, google.com, etc..

Let's take an example below...


![Fully qualified domain name](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ikx9v9gauci2h8xsvvuf.png)

**Domain Registar vs. DNS Service**

You buy or register your domain name with a Domain Registrar typically by paying annual charges (e.g., GoDaddy)

The Domain Registrar usually provides you with a DNS service to manage your DNS records But you can use another DNS service to manage your DNS records.

• Example: purchase the domain from GoDaddy and use Route 53 to manage your DNS records


![Register and manage domain](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/se33zynl1j9i315s5k9u.png)

![Manage domain in route53](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/aclske6sceckxphfjxzc.png)

**Route 53 – Record Types**

- NS-Record
Name Servers for the Hosted Zone which Control how traffic is routed for a domain

- A-Record 
maps a hostname to IPv4

- CNAME 
maps a hostname to another hostname