teleren/devto huggingface dataset:
any() and all() in Python
Tags: python, programming, functions
Published: 2021-01-07 17:33:58

In this post, we will be looking into any() and all() functions in Python. 
First, let us discuss the any() function.

### 👉**any()**

The any() function takes an iterable as an argument : **any(iterable)**. 

The iterable can be a list, tuple or dictionary.

The any() function returns 'True' if any element in the iterable is true. 

However, it returns 'False' if the iterable passed to the function is empty.

This function is similar to the code block below 
 
```
def any(iterable):
    for element in iterable:
        if element:
            return True
    return False  
```

Below is an example of using any for returning 'True' for numbers greater than 3. 

Here we have used list comprehension to keep the code simple.

```
list=[2,3,4,5,6,7]
print(any([num>3 for num in list]))
```

> The output is 'True' as 4,5,6 and 7 are greater than 3.

Next, we look into the all() function.

### 👉**all()**

The all() function also takes an iterable as an argument: **all(iterable)**. 
 
all() function returns 'True' only if all the items in the iterable are true.

Even if one item is false, it returns 'False'. However, if the iterable is empty, it returns 'True'.


all() function is similar to the code block below  
```
def all(iterable):
    for element in iterable:
        if not element:
            return False
    return True
```

Below is an example of using any for returning True for numbers greater than 3.

```
list=[1,2,3,3]
print(all([num>3 for num in list]))
```

> The output is False as no number is greater than 3 in the provided list.


* *In dictionaries, both all() and any() functions to check the key for returning True or False and not the values.*
Longest common subsequence in C++
Published: 2021-01-07 17:22:11

The longest common subsequence is a standard dynamic programming problem. In the longest common subsequence problem, two strings are given. The aim is to find out the length of the longest common subsequence.
**Example:**
**INPUT:**
abcde
abxyzd

**OUTPUT:**3

The output of the above input will be 3 because the longest common subsequence is abd.

Other examples:
**INPUT:**
axyz
ghjk
**OUTPUT:**0
There is no common subsequence at all.


**INPUT:**
a
abcdefghijklmno
**OUTPUT:**1
The longest common subsequence is a

Using the dynamic programming concept, we form a two dimensional array 
t[length_of_first_string+1][length_of_second_string+1].
We then initialize the two dimensional array as:If the length of the first string or second string is zero, then the common subsequence length will also be zero.

**CODE:**

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

Hope this helps you! Do follow me on [Github](https://www.github.com/say-droid427)!
EasyFeedback
Tags: micronaut, vue, opensource, feedback
Published: 2021-01-07 16:16:06

Al inicio de las vacaciones de Navidad estuve viendo una charla online en la que el speaker pedía al inicio a los asistentes que comentaran su nivel de experiencia sobre la tecnología que iba a hablar usando el canal de texto asociado. 

Se me ocurrió que podría ser interesante, en esta época de conferencias online, que el speaker pudiera obtener feedback rápido en algún momento de su presentación que le orientará sobre lo que opina su audiencia.

Por ejemplo, al inicio de la charla poder conocer si la audiencia tiene un nivel bajo,medio o alto, o que terminada una parte de la charla pudiera preguntar si se había entendido o lo repetía. O incluso hacer una charla tipo sigue tu aventura. Así que me puse manos a la obra y estoy desarrollando EasyFeedback

La idea pues, es simple: crear una pregunta que se pueda contestar con hasta 4 opciones, compartir la url para que cualquiera pueda votar y ver en tiempo real cómo se va votando. Una vez obtenido el feedback de la audiencia el speaker puede continuar con su charla.

Actualmente tengo una primera versión en la que el backend está más o menos completo al menos para un MVP aunque la parte del front que no es lo mío tengo que trabajarla más.

Para este MVP el backend consiste en un API Rest en Micronaut mientras que el front es una aplicación sencilla en Vue que permite crear un EasyFeedback con unos pocos clicks y compartirla a través de un QRCode o simplemente compartiendo una URL personalizada para la encuesta.

Mi intención es seguir mejorando el UI y que cualquiera pueda usarlo.
KWOC | Kharagpur Winter Of Code Report
Tags: opensource, kwoc, github, iitkgp
Published: 2021-01-07 17:12:24

**About KWOC**:
[KWOC](https://kwoc.kossiitkgp.org/)(Kharagpur Winter of Code) is a 5-week long online program for the students by [KOSS](https://kossiitkgp.org/), who are new to open source software development. The program not only helps students to get involved in open source, but also preps them for many open source summer programs, Google Summer of Code being one of them.

**About Me**:
I'm a second year undergraduate in the department of Computer Science & Engineering at IIT Kharagpur. Initially I don't have much idea about open-source, git, GitHub and all this stuff. Then I thought to improve my knowledge in this area by
participating in KWOC during the winter break.

**Project selection**
I started learning about git and GitHub from resources provided. Then I have selected 2 projects, which are related to algorithms and data structures.
{% github adityabisoi/ds-algo-solutions %}{% github geekquad/AlgoBook %}

**Contribution**
[1.ds-algo-solutions](https://github.com/adityabisoi/ds-algo-solutions)
[First PR](https://github.com/adityabisoi/ds-algo-solutions/pull/461) 
Updated a Read me file of the project.
[Second PR](https://github.com/adityabisoi/ds-algo-solutions/pull/471) 
Written a C++ program for [minimum loss](https://www.hackerrank.com/challenges/minimum-loss/problem) with STL
[Third PR](https://github.com/adityabisoi/ds-algo-solutions/pull/474) 
Updated the Readme file of the project corresponding to previous PR
[Fourth PR](https://github.com/adityabisoi/ds-algo-solutions/pull/516) 
solved [Qheap1](https://www.hackerrank.com/challenges/qheap1/problem) in Python and updated the Readme file of the project


[2.AlgoBook](https://github.com/geekquad/AlgoBook)
[Fifth PR](https://github.com/geekquad/AlgoBook/pull/440) 
solved Knights tour problem and Subset sum problem using [backtracking](https://www.geeksforgeeks.org/backtracking-introduction/#:~:text=Backtracking%20is%20an%20algorithmic%2Dtechnique,reaching%20any%20level%20of%20the) in C++
[Sixth PR](https://github.com/geekquad/AlgoBook/pull/441)
solved m-coloring problem using >backtracking algorithmic- technique in C++

####languages used
    C++
    Python 
    Markdown

I had a total of 10 commits and 6 pull requests. I was a great learning experience. The mentors supported me well during the projects. This program helped me learn what open source projects are and how to contribute to them. The resources helped me a lot. I want to thank KOSS for conducting this. It is a great help to students preparing for GSoC.

**Report by:**
SHASHANK SUROJU
   GitHub handle - [shash-2468](https://github.com/shash-2468)
Hello? It's me. New arrival of RDS PG 13 On Alibaba Cloud
Tags: database, cloudnative, postgres, opensource
Published: 2021-01-07 16:43:12

Hey everyone, this is my first post, I'm not gonna just say hello with a boring introduction about myself which seems silly. I bring you all a Goooooood News, especially for those who r enthusiastic about open source and SQL. R u ready?

Well, I would like to share with you that RDS PostgreSQL 13 is available right now on Alibaba Cloud, as early cloud supplier who supports PG 13, it does have some free trials you can pick up. Take a chance everybody, it's a good opportunity to try something COOL!

-------Adorable Features In the Latest-------
1>.Parallelized vacuuming
2>.Incremental sorting
3>.Enhancement of duplicate data handling in B-tree indexes

Claim RDS For Free:https://www.alibabacloud.com/product/apsaradb-for-rds-postgresql
DigitalOcean Hackathon Submission
Tags: dohackathon
Published: 2021-01-07 16:37:30

## What I built
A personal portfolio

### Category Submission: 
Personal Site/Portfolio

### App Link
https://my-portfolio-4ka9v.ondigitalocean.app/

### Screenshots
![Screenshot (292)](https://dev-to-uploads.s3.amazonaws.com/i/q3259ucpr4hhs4gg4flc.png)
![Screenshot (294)](https://dev-to-uploads.s3.amazonaws.com/i/hf05astwkwie5ypf5z8c.png)
![Screenshot (293)](https://dev-to-uploads.s3.amazonaws.com/i/ir15zn0d284xzsr2v9mq.png)
   
 
### Description
 It is a single page portfolio website showing information about myself and my previous work

### Link to Source Code
https://github.com/Habib-Ahmad/my-portfolio

### Permissive License
MIT

## Background
(What made you decide to build this particular app? What inspired you?)
I got into web development almost two years ago. Since then I have learnt a lot and done a couple of freelance jobs. So I wanted to create this to serve as a resumé and to also tie all I've done so far together and feel proud about what I've done so far.

### How I built it 
(How did you utilize DigitalOcean’s App Platform? Did you learn something new along the way? Pick up a new skill?)
I built it with React. I also used other libraries like bootstrap. Then deployed using the DigitalOcean’s App Platform which was a bit tricky. Setting up the droplet confused me for a bit because I had no clue what a droplet was but it didn't take long to figure it out.


### Additional Resources/Info
3 Basic JavaScript Concepts That Are Important.
Tags: javascript, todayilearned, 100daysofcode
Published: 2021-01-07 16:32:07

Learning javascript is weird. I want to share 3 things that I learnt today in javascript.
 
# **Hoisting**
Hoisting is a mechanism where variable or function declarations are moved to the top of their scope before they're executed. That means, **if we do this**:
```javascript
console.log(greeter);
var greeter = "say Hello!";
```
**It'll be interpreted as this**:
```javascript
var greeter;
console.log(greeter); //undefined
greeter = "say Hello!";
```
<hr>
# **null vs undefined**
`null` is a value, just like 2, 3.5 or true. Setting a variable to `null` means that you have declared a variable and decided to give the value - nothing, to it.
`undefined` on the other hand, means you have declared a variable but not given it any value yet.

Interestingly, `null` loosely equalizes to `undefined` but there are a few gotchas!
```javascript
console.log(null == undefined); //true
console.log(null === undefined); //false
console.log(null >= 0); //true
console.log(null <= 0); //true
console.log(undefined <= 0); //false
console.log(undefined >= 0); //false
```
<hr>

# `==` vs `===`
This is a simple one. `==` means loose equality. It's used when you want to know if two values are equal if they'd have same type. For example:
```javascript
console.log(0 == false); //true
console.log(1 == 1.0); //true
console.log(1 == '1'); //true
```
`===` however, checks for strict equality. It means, it'll only return true IF the two values are absolutely same. For example:
```javascript
console.log(0 === false); //false
console.log(1 === 1.0); //true, it's a bad idea to compare floats anyway.
console.log(1 === '1'); //false
```
<hr>

That's all folks!
A review of 2020
Tags: 2020, programming, beginners, webdev
Published: 2021-01-07 16:21:50

No one can forget this year *2020*  in their whole life thanks to Corona(Covid'19).I gonna share my whole story for this year.
what I learned?
what projects I created?
what I couldn't achived?
I started my coding journey from this year.
I have done the c and c++ programming course from [mysirG](https://www.mysirg.com/) coaching classes. I started their offline classes but due to covid'19 they shifted their classes in online mode.
in the first year of my college I purchased my laptop from flipkart and I started graphic designing.
Due to this skill as I have designed a little bit of posters for social media. my friends who started a website took me with them as a graphic designer for thier social media post designing.
and I have worked so much with them in this pandemic.
I will provide my graphic design portfolio you can visit and rate my work if you like.
at the starting of my 3nd sem I decided to learn web devlopment.
in the month of **August** I have done HTML from [W3S](https://www.w3schools.com/html/)
I also learned CSS from W3S itself.
afer competing both I have created so mamy simple html pages.
some of my work I have uploaded on github you can look my [github portfolio](https://github.com/Mo-hit789).
after css I took a udemy course for JavaScript. but at the end of the year I totally become exhaust and I ruined the whole December month and also some days of November.
that's why I could not achive the goal of completing the frontEnd part of web development before the stating of this year 2021.
but now I am on the way to complete the course and surely I will complete this course before 20 jan 2021.
you can visit my portfolios for programming and graphic designing.
>graphic design- [behance portfolio](https://www.behance.net/mohitvishwakarma)
>programming- [github](https://github.com/Mo-hit789)
E-Waste Admin Panel
Tags: dohackathon, showdev, vue
Published: 2021-01-07 16:02:11

## How it works

Admin panel shows you an overview of how the system works. It provides realtime numbers and charts so you can have an idea of how the system performs at a glance. Also these charts are downloadable so it is easy to make reports with these. I'm using `chart.js` to create these charts. It was easy to integrate and provides a good looking customizable charts. 

## Screenshots
<img src="https://dev-to-uploads.s3.amazonaws.com/i/l1agsja85eyyepemffm2.png">
<img src="https://dev-to-uploads.s3.amazonaws.com/i/fzwj63izg6jjqrprinoy.png">

If you have any concerns or suggestions for improvements, please let us know!
How many engineers work solely on scaling in your team?
Tags: discuss, team
Published: 2021-01-07 15:59:51

I was seeing very product oriented companies struggle with scaling:
- to justify spending `dev time` on something you needed `metrics`
- `metrics` were easier to cook up for `product work` than for `ease-of-development`
- therefore engineers were trying to cope with systematic problems in stolen times between to product features

There is another angle here and that is work for scaling might not be as "linear" as work for a new feature, i.e. maybe 1 or 2 engineers can unlock the ability to serve 100 000 instead of 1000 users, while shipping 100x features would need more devs.

### And the questions are...
- Do you have `engineers` in your team/company that _only works for enabling the scaling_ to more users?
- If so, what is the `ratio` to product devs?
- And is it `enough`? I.e. there is no anxiety about the infrastructure collapsing if you add significantly more users (or devs... think of build automation, internal tools, etc.), or having the ability to do proactive work instead of reactive?
Using Terminal in Linux - a Linux basic tools guide part 2
Tags: linux, programming
Published: 2021-01-07 15:49:28

# What is Linux Terminal

A terminal is a Linux tool used for running command-line apps, scripts, or programs. There can be different types of terminals on different versions of Linux.

![Using Terminal Infographics Tekraze](https://dev-to-uploads.s3.amazonaws.com/i/uum7gqk0nmf1xzq8ucz5.png)

## Ways to open Linux Terminal

- Right-click on Desktop and select terminal
- Using (ctrl + alt + t) key combination
- From apps menu under system tools submenu

##Where to use Terminal in Linux

- To run apps without GUI in command line only mode
- To run apps with secured user privileges
- SSH login to another system from a network
- To run shell scripts (.sh files)
- For software installation or upgrading
- For editing files or scripts
- To run system apps, tools

##Advantages of Linux Terminal

- Faster than GUI software
- Full control over running software/apps
- Secure login over network
- Running tasks as a specific user
- User need to manually enter commands
- No friend/relative can mess up as he may not know commands
- Every time asks for a password for privileged command
- Free of ads that may exist on GUI software/apps

##Example of the terminal in Linux

- Gnome terminal
- Konsole
- Xterm
- Lxterminal
- Xterm
- Tilda
- Terminator

These are various terminals just for example. Each flavor/version of Linux gave different terminals including these or some others. Basic things are the same, just UI functions, styles differ.

> Also read | [Linux Terminology basics you need to know](https://tekraze.com/2018/01/linux-terminology-basics-need-know/)

## Related terms

### SSH

SSH is short for the secure shell which is used for log in to a Linux system over a network. A system may be over a local network or a remote network.

### CMD

CMD or command-line interface is the interface or area in any Linux system where a user interacts over by entering the command.

###GUI

GUI or graphical user interface is an interface where the user interacts with the system using graphical elements like forms buttons and more.

#### Summary

So, this was for now for today. I hope the content will help you. Feel free to share your views in the comments below. Keep checking for more parts in this series.

> Originally published at https://tekraze.com/2020/12/using-terminal-in-linux-infographics/
Day 7 Challenge
Tags: javascript, challenge, 365daysofcoding, webdev
Published: 2021-01-07 15:45:13

Create a function that accepts an array and an item and counts the number of times that item shows up in the array. Do not ignore capitalization, punctuation, or spaces.

Examples:
```javascript
    itemCounter(["hello", [["Hello", "hello"], [["Hello"]], "Hello", "world"]], "hello"); // 2

    itemCounter([["A", "A", "A", "A", "A", "a"],
        ["a", "A", "A", "A", "A", "A"],
        ["A", "a", "A", "A", "A", "A"],
        ["A", "A", "A", "a", "A", "A"]], "a"); // 4

    itemCounter([1, 2, [3], [4, 5], [4, [[6, 7], 4]]], 4); // 3

    itemCounter([1, 2, [3, 11], [4, 5], [4, [[6, 7], 4]]], 10) // 0
```
Execute WayScript Programs Via WayScript API
Published: 2021-01-07 15:39:47

Introduction
------------

One of the biggest benefits of WayScript is its versatility and seamless integration between different programs and platforms. In this tutorial, we’ll learn how to use these to our advantage by executing a program built in WayScript outside of the website. We can do this by writing our own Python code and utilizing the WayScript Python API. Keep reading to learn more!

Building our Script
-------------------

The example script we’ll use simply passes a query parameter using the HTTP Trigger module, formats it using the Python module, and then writes the values to an SQL table with the SQL module. If for some reason the user doesn’t want to visit the URL produced from the HTTP Trigger or run the program through WayScript, they have the ability to execute it using Python on their own computer.  
  
The first step in executing this script through Python is installing the WayScript library using the pip installer. The code for this step is: pip3 install wayscript. Now, it’s time to import WayScript so that the user can gain access to the WayScript clients. The next line of code activates the client, so that Python can execute the specified WayScript program. So far, your code should look something like this.  
  

![tutorial step #1](https://wayscript.com/blog_img/158/1.png)

  
  
In our example script we’ve included the query parameter “sample\_list.” This query parameter can also be passed in the execution of the script through Python. For this line of code, “q” should be set equal to the query parameter and the expected values. Next, the program ID must be specified in the code. This ID can be found at the end of the WayScript URL for the script. Finally, to run the script simply use the wayscript.run and include the ID and parameters in parentheses. If this is a bit confusing, the below image shows the appropriate code for all of these steps.  
  

![tutorial step #1](https://wayscript.com/blog_img/158/2.png)

  
  
This is only one simple function of using WayScript’s Python API, but it demonstrates the versatility of WayScript that can’t always be found with other sites. Our Python API has several other features, including the ability to execute programs with password protections and more. To see these, just visit the link at the end of this article.

Conclusion
----------

Questions about this script or anything else? Join our [discord](https://discord.gg/VWbXSbj). We're always around to help. To see the full API and its features, just find it [here](https://pypi.org/project/wayscript/).
9 Front-end Development skills to Land Your First Job
Tags: html, css, javascript, webdev
Published: 2021-01-07 15:38:55

Piece of advice, **don't get confuse** after reading the description of any Job. 

If you have these **front-end skills and some projects**, you should start creating your resume and applying for jobs right now. 

1. HTML 5
2. CSS3 (with advance and modern concepts)
3. Javascript (clean code with modern/standard approach)
4. CSS framework (Bootstrap or Bulma or Tailwind).
5. JavaScript framework or library (React or Vue)
6. CSS Pre-Processor (SASS or Less)
7. Git Version Control (Github)
8. Basic Knowledge of Design Principles 
9. API handling / Integration with backend (JSON + Postman Tool)

I hope you'll get your job soon. 


We have a YouTube Channel too, where we teach people real-world web development: **[Subscribe Now](https://www.youtube.com/channel/UCMuGiELIVlWYROUw6s4g8rA)**



Best of luck
Sticky Navigation Bar on Scroll using HTML CSS | Fixed Navbar on Scroll
Tags: html, css, codenewbie, codepen
Published: 2021-01-07 15:30:30

Sticky Navigation Bar on Scroll using HTML CSS | Fixed Navbar on Scroll

<img src="https://i.postimg.cc/BQsmpGb9/screenshot-codepen-io-2021-01-07-20-27-27-756.png">