teleren/devto huggingface dataset:
Find the runner up score - HackerRank Python Solution
Tags: programming, python, algorithms, beginners
Published: 2023-09-05 16:49:33

In this tutorial, we will guide you through the process of solving the **Find the runner up score** programming problem from HackerRank’s “ **Python** ” domain.

**Disclaimer:** We encourage you to solve this challenge yourself before reading our tutorial. We have provided a detailed explanation of the problem and our solutions to help you check your work.

## Problem Statement

find the runner up score in the given student score list or in simple words find the second maximum number in the array.

## Find the runner up score Solution in Python

{% gist https://gist.github.com/codeperfectplus/111dcc94f83e5db94433a676592ee315.js %}

## Explanation

In the above code, we have created a function named `find_runner_up_score()` that takes a list of numbers as input and returns the second largest number in the list.

- First, we used the set() function to remove duplicate elements from the list.
- then we use the sorted() function to sort the list in ascending order.
- then we use the [-2] index to access the second largest number in the list.

## Time Complexity

The time complexity of the above solution is O(n log n) because we are using the sorted() function to sort the list.


_Problem statement is taken from [Hackerrank](https://www.hackerrank.com/domains/python), and the solutions are implemented by **CodePerfectPlus** team_

## Other Article By Author

- [HackerRank Solve Python Algorithm Series](https://codeperfectplus.com/category/Solve-python)
- [HackerRank Problem Solving Algorithm Series](https://codeperfectplus.com/category/Problem-solving)
- [30 Days of Code HackerRank](https://codeperfectplus.com/category/Hackerank-30-days-of-code)
- [10 Days of JavaScript HackerRank](https://codeperfectplus.com/category/10-days-of-javascript)

### [30 Days of Code SubReddit](https://www.reddit.com/r/30daysofcode)
HackerRank 30 Days of Code Solution Day 5: Loops
Tags: python, programming, beginners, algorithms
Published: 2023-09-05 16:42:15

In this tutorial, we will guide you through the process of solving the **Day 5: Loops** programming problem from HackerRank’s “ **30 Days of Code** ” challenge. In this article, we will understand the use of loops in programming.

**Disclaimer:** We encourage you to solve this challenge yourself before reading our tutorial. We have provided a detailed explanation of the problem and our solutions to help you check your work.

## Hackerrank 30 days of code - Day 5: Loops

It’s part of Hackerank’s 30 days of code. A series of 30-day programming challenges. Where you can learn new programming languages by solving the coding challenges.

## Problem Statement and Explanation

In the problem statement, we will use loops to use some mathematics. Basically, we have to print the multiplication table of a given number in the following format: Suppose the given number is 5 then the output will be:

```
5 x 1 = 5
5 x 2 = 10
5 x 3 = 15
5 x 4 = 20
5 x 5 = 25
5 x 6 = 30
5 x 7 = 35
5 x 8 = 40
5 x 9 = 45
5 x 10 = 50

```

In this problem, we will use loops to print the multiplication table of a given number and use f string to print the output in the above format.

f string is a new feature in Python 3.6. It is used to format the string. We can use f string to print the output in the above format. We will use the following syntax to use the f string:

```
f"{variable_name} {variable_name}"

```

### Operators Hackerrank solution in Python
{% gist https://gist.github.com/codeperfectplus/470a544bd3136fb00e5cac29dd58106a.js %}

### Operators Hackerrank solution in JavaScript

{% gist https://gist.github.com/codeperfectplus/05b7ab8e35f7f3dba3cb5327cf15a77c.js %}

## Test Case of Loops Hackerrank Solution

Tested on the Hackerrank platform for the following test case and passed all the test cases. Enclosed below is the screenshot of the test case.

![Test Case of Loops Hackerrank Solution](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/atck8fbvn1msf1rvms9r.jpg)

_Problem statement is taken from [Hackerrank](https://www.hackerrank.com/domains/tutorials/30-days-of-code), and the solutions are implemented by **CodePerfectPlus** team_
Step by Step Guide to Install Citus: Linux
Tags: linux, citus, database, bitnine
Published: 2023-09-05 16:26:00

This blog is the continuation of [last blog](https://dev.to/muhammadzeeshan03/citus-introduction-304a). Where we explored about citus. In this blog we will look at the two different ways to install citus.

## Method 1 
## Packaging repo

If you already have PostgreSQL installed its better to install the citus using this method.Run the following commands. 
Install packages on ubuntu.

```
curl https://install.citusdata.com/community/deb.sh > add-citus-repo.sh
sudo bash add-citus-repo.sh
sudo apt-get -y install postgresql-15-citus-12.0  
```
This will install the citus and the compatible postgres version. Citus version 12 and Postgres version 15.

add Citus to your local PostgreSQL database, add the following to `postgresql.conf`:

```
shared_preload_libraries = 'citus'
```

## Method 2: Install using source code.

## Step 1

create the required directories. Open the terminal and run the commands.
```
mkdir citus
cd citus
mkdir pg
cd pg
```
## Step 2
Install required dependencies.

```
sudo apt-get install build-essential libreadline-dev zlib1g-dev flex bison
```
## Step 3

Download and install postgres. In method one it automatically installed the postgres but here we need to download and install it manually.

## Download
```
wget https://ftp.postgresql.org/pub/source/v15.3/postgresql-15.3.tar.gz && tar -xvf postgresql-15.3.tar.gz && rm -f postgresql-15.3.tar.gz
```
## Install
```
cd postgresql-15.3

# configure by setting flags
./configure --enable-debug --enable-cassert --prefix=$(pwd) CFLAGS="-ggdb -Og -fno-omit-frame-pointer"

# now install
make install
 
# go back to main citus directory
cd ../../
```
## Step 4
Now after installing postgres we need to install citus. Before that we need to install the required dependencies.
```
sudo apt-get install -y postgresql-server-dev-15 postgresql-15 \
                        autoconf flex git libcurl4-gnutls-dev 
libicu-dev \
                        libkrb5-dev liblz4-dev libpam0g-dev libreadline-dev \
                        libselinux1-dev libssl-dev libxslt1-dev libzstd-dev \
                        make uuid-dev
 
```
## Step 5
Clone citus using the github repo.
```
git clone https://github.com/citusdata/citus.git
cd citus
```
## Step 6 
Install and configure citus
```
PG_CONFIG=/home/username/citus/pg/postgresql-15.3/bin/pg_config ./configure
make
sudo make install
```
After running this config comamnd Here you can have an error that some dependencies are missing. You can run the command with --without flag or can download those dependencies.

You have successfully installed citus and postgres from the source code or using package. To load you again need to add the above `prelaod` command in `postgresql.conf`
Roadmap to become a Front-End developer :
Tags: webdev, beginners, programming, html
Published: 2023-09-05 16:11:45

Embarking on a journey to become a front-end developer? This post lays out a comprehensive roadmap to guide you through the exciting world of web development. From essential skills and practical tips for success, this roadmap will help you chart a clear path towards becoming an entry-level front-end developer.

1) **Learn the fundamentals of web:**
. Difference between Client Side and Server Side
. How websites work?
. Basics of HTTP.

2) **Learn HTML and CSS**
. Working with divs, tables and sections.
. Creating forms with HTML.
. Using Images,Videos and audio files in HTML.
. Basic styling properties in CSS.
. Id,Classes and other selectors in CSS.
. Flexbox and grid.
. Media queries
. BEM (Block Element Modifier) methodology. 

_NOTE : CSS is an extensive field, and when you're just beginning, there's no need to strive for mastery right away. Focus on grasping the fundamentals until you feel confident in creating visually appealing web pages. Mastery of CSS will naturally come with experience. Avoid immediately diving into libraries like Bootstrap, Tailwind, or Material. Instead, start by working on projects using vanilla CSS. Once you've gained proficiency, you can explore the convenience of utilizing these libraries._

3) **Learn Javascript (The fun part).**
. Basic Syntax (Variables, Objects ,arrays, Functions, Data Types, Loops , Conditionals etc.)
. Learn DOM manipulation (Selecting Elements, Dealing with clicks, keyboard events and using the event parameter )
. Animations with JS and CSS.
. Developer tools in browsers (I recommend Firefox)
. Learn about Local and Session Storage
. Learn AJAX and working with JSON data.
. Learn different console methods(Many people don’t do this But I think it helps a lot in debugging.
Fun Fact : There are 20+ console methods.)
. Difference between Reference and object types and how they work behind the scenes
. Learn Es6 Syntax (Arrow functions, Template literals , Promises , Fetch API , Spread operator, Destructuring)
. OOP in JavaScript.
. REST APIs (You can use a fake rest Api such as JSON server for that)
. It is highly recommended that you also do DS and algorithms in JavaScript. It will really sharpen your problem solving skills.
. Optional things : JavaScript Engines (V8, SpiderMonkey etc.)

4) **Finally Learn a JavaScript framework (React,Vue or Angular)**

I will write the roadmaps of these three technologies later and I will make sure to post the link in the comments.
Keep Grinding and Happy Hacking.
Polymorphic Relationships in Laravel
Tags: laravel, php, tutorial, database
Published: 2023-09-05 16:01:52

The concept of a polymorphic relationship in Laravel opens up a world of possibilities when it comes to database design. It allows us to create flexible and reusable connections between different entities, making our applications more versatile.

Laravel achieves this magic by using a single additional table to maintain these relationships. It stores the type of the related model and its corresponding ID, allowing you to seamlessly connect comments to different content types.

Polymorphic relationships make your code more elegant and maintainable. They reduce redundancy in your database schema and promote reusability, saving you time and effort during development. Whether you're building a blog, a content-sharing platform, or a complex e-commerce site, understanding polymorphism in Laravel can greatly enhance your application's capabilities.

To explore polymorphic relationships in Laravel hands-on, check out our [GitHub repository's new branch ](https://github.com/mazimez/laravel-hands-on/tree/polymorphism-part-1)dedicated to this topic. In this branch, we've divided the subject into two parts, making it easier for you to grasp the concept step by step. Happy coding!
Difference Between High-Level Design and Low-Level Design (HLD & LLD)
Tags: hld, lld, infrastructureascode, design
Published: 2023-09-05 15:35:53

In this article, we are going to discuss the difference between HLD and LLD; and see the difference between them.

**What is HLD?**

High-Level Design in short HLD is the general system design means it refers to the overall system design. It describes the overall description/architecture of the application. It includes the description of system architecture, database design, brief description on systems, services, platforms and relationship among modules. It is also known as macro level/system design. It is created by solution architect. It converts the Business/client requirement into High-Level Solution. It is created first, before Low Level Design.

The solution architect develops the High-level design, which is used to specify the complete description or architecture of the application.

The HLD involves system architecture, database design, a brief description of systems, services, platforms, and relationships among modules.

The HLD is also known as macro-level or system design. It changes the business or client requirement into a High-Level Solution.


**What is LLD?**

Low Level Design in short LLD is like detailing HLD. It refers to component-level design process. It describes a detailed description of each and every module means it includes actual logic for every system component and it goes deep into each module's specification. It is also known as micro level/detailed design. It is created by designers and developers. It converts the High-Level Solution into detailed solution. It is created as a second means after High-Level Design.

The LLD stands for Low-Level Design, in which the designer will focus on the components like a User interface (UI).

The Low-level design is created by the developer manager and designers.

It is also known as micro-level or detailed design. The LLD can change the High-Level Solution into a detailed solution.

The Low-level design specifies the detailed description of all modules, which implies that the LLD involves all the system component's actual logic. It goes deep into each module's specification.


**HLD vs LLD**

In the below table, we have discussed some significant comparisons between high-level design and low-level design.


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


**Conclusion**

We can conclude that the high-level design specifies the complete report and planning of the particular software product or application. On the other hand, the low-level design specifies the in-detail report of all the modules.

Finally, we can say that both HLD & LLD are essential parts of the design phase in the SDLC process for any software product.

Check article on [techwebies](https://www.techwebies.com/2023/09/05/difference-between-high-level-design-and-low-level-design-hld-lld/)
Support English and French without replicating code
Tags: angular, multilanguag
Published: 2023-09-05 15:30:18

Hi,

I just started learning Angular CLI version 16 and part of my assignment is to implement a site that supports both English and French without replicating the code.

I installed Angular i18n by following this [Angular i18n](https://lokalise.com/blog/angular-i18n/). article.

Now, I need to know how to add a link on my page that allow user to click and switch the page content between English and French.

I really appreciate your help.
86 berufliches Vorwärtskommen: Bloß nicht über Nörgler nörgeln.
Tags: deutsch, career, motivation, discuss
Published: 2023-09-05 15:27:00

Moin Moin,

ein Problem, welches ich mit Nörglern habe, ist dass sie es einen leicht machen, selbst einer zu sein. Ich bin mir ja schon nicht mehr sicher, ob ich mit [dem letzten Beitrag→](https://dev.to/amustafa16421/85-berufliches-vorwartskommen-der-norgler-3l7e) und mit diesem nicht bereits am Nörgeln bin -.-

Der Ton macht die Musik.
Hätte ich meinen letzten Beitrag anders formuliert, wäre ich ggf. nicht im Zweifel… Die Lehre aus der Redewendung ist stets in der Kommunikation zu beachten. Manchmal ist es auch möglich anzupacken statt zu „schnacken“. Es kann auch hilfreich sein zusätzlich zum Negativen positive Gegebenheiten hervorzuheben. So sehe ich bei Nörglern beispielsweise die Stärke, dass sie Probleme identifizieren können – ggf. sogar mit einer starken Liebe für Einzelheiten. Diese Hingabe nun positiv genutzt kann beispielsweise in Software-Projekten zu wertvollen Beiträgen führen, u.a. im Entwurf von Benutzeroberflächen. Wie sähe das erste iPhone aus, ohne die nötige Portion Unzufriedenheit bezüglich der damals gängigen Handys? Gäbe es dies überhaupt?

Also pflegen wir stets einen konstruktiven Umgang. Seien wir _lösungsorientiert_.

Lass uns mittels Kommentaren austauschen.

Beste Grüße,
Mustafa

Oder auch mittels E-Mail: mustafa.kevin.dwenger@posteo.de
Betreff: Austausch
Why PayPal's Passkey Rollout Makes Sense
Tags: passkeys, authentication, webdev, security
Published: 2023-09-05 15:26:31

## The Evolution of Authentication: Insights into Passkey-Readiness

In today's digital age, the way we authenticate ourselves online is undergoing a significant transformation. Traditional passwords, while familiar, are increasingly seen as a vulnerability. This article delves into the advancements in authentication methods, particularly focusing on the rise of passkeys.

## WebAuthn: The Future of Authentication

WebAuthn is at the forefront of this revolution. It operates by validating an individual's identity, which is then confirmed by the server. This method either replaces or supplements the need for a conventional password. The result? A more secure and user-friendly authentication process. What's more, the universal applicability of WebAuthn, backed by its interoperability across diverse platforms and devices, makes it a game-changer.

## The Rise of Conditional UI in Authentication

While not mandatory in the realm of passkeys, the Conditional UI (commonly known as "passkey autofill") plays a pivotal role in enhancing user experience. It streamlines the authentication process, making it quicker and more intuitive for users.

## A Comparative Analysis: 2022 vs. 2023

When we juxtapose the data from 2022 with that of 2023, a clear trend emerges. There's been a robust growth in the adoption of Conditional UI across all major operating systems. This surge is indicative of the swift adoption of new standards introduced by tech behemoths like Apple, Google, and Microsoft.


![Passkey-Readiness on different Operating Systems](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/w0r69f6l4hhsh7vebkic.png)

## Most Mobile Devices are Passkey-Ready and have synced Passkeys

Mobile devices (e.g. iOS and Android) have shown to be at the forefront of passkey adoption. Their operating systems and browsers are mostly passkey-ready making them an ideal group of devices for a first passkey rollout (like PayPal did).

![Synced vs. Non-Synced Passkeys](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9my1ujb7tid6ft1phvd3.png)

## The Road Ahead: Biometrics and Beyond

The future of authentication looks promising. With the integration of built-in biometric capabilities, there's a reduced need for extensive user education. The next year is anticipated to witness a further surge in platform authentication and the use of Conditional UI.

## In Conclusion

The landscape of online authentication is evolving at a rapid pace. As we transition from traditional passwords to more advanced methods like passkeys, it's crucial to stay updated with the latest trends and technologies. For a deeper dive into the intricacies of passkey readiness and to uncover more insights, Find out more on our [detailed blog post](https://www.corbado.com/blog/september-2023-update-insights-passkey-readiness).
Who's hiring developer advocates? (September 2023)
Tags: opensource, devrel, jobs, career
Published: 2023-09-05 15:10:25

**If you're looking for a new opportunity as a Developer Advocate, this post is for you.**

## 5 open-source companies hiring developer advocates in September

Below are 5 open roles in open-source companies:

### Hanko
- Open source authentication for the passkey era
- [Link to GitHub -->](https://github.com/teamhanko/hanko)
- [Link to job description -->](https://www.hanko.io/jobs/developer-relations-engineer)

### Lago
- Open source metering & usage-based billing
- [Link to GitHub -->](https://github.com/getlago/lago)
- [Link to job description -->](https://www.ycombinator.com/companies/lago/jobs/PxLXQzY-developer-relations-engineer)

### MongoDB
- Developer data platform for developers to do their best work
- [Link to GitHub -->](https://github.com/mongodb)
- [Link to job description -->](https://www.mongodb.com/careers/jobs/5273037)

### Neon
- Open source Serverless Postgres in the Cloud
- [Link to GitHub -->](https://github.com/neondatabase/neon)
- [Link to job description -->](https://boards.greenhouse.io/neondatabase/jobs/4926617004)

### Upstash
- The Serverless Data for Redis and Kafka
- [Link to GitHub -->](https://github.com/upstash)
- [Link to job description -->](https://upstash.com/careers/software-engineer-oss)

## Wrapping up

I hope this selection will help you take a new step in your career. 

Every Friday, I hand-pick open roles in the dev tools space and post them on [Twitter / X](https://x.com/fmerian) and [LinkedIn](https://linkedin.com/in/fmerian).

**And if you want more open roles, go to [ossjobs.dev](https://ossjobs.dev), a job board that helps you find your next career opportunity, specifically in the open-source space.**

## Who else's hiring?

Is your company hiring? Please let me know! Reply here or [send me a DM](https://x.com/fmerian) and I'll make sure to add it to the next edition.

See you next month -- enjoy! 👋
The typeface you didn't know you wanted and were trained to hate
Tags: ui, font, terminal
Published: 2023-09-05 14:59:32

For the last several weeks I've been using [Comic Mono](https://dtinth.github.io/comic-mono-font/) in my terminal. It's a fixed width typeface based on the font that we've all been trained to despise and sneer at for almost 30 years, Comic Sans.

But you know what? Comic Mono works really well at small sizes even with my becoming-elderly failing eyes and my inability to always find my reading glasses. I can see plenty of code in my editor with lots of context. On a 40" screen at arm's length I can comfortably get 100 lines of text - so lots of context for the code I'm working on - in a terminal using 12pt text _and read it easily_.

Give it a go for a few days!
Azmena CLI tool to get total video durations in a folder and sub-folders
Tags: go, cli, automation, ffmpeg
Published: 2023-09-05 14:41:36

So now you want to get the total duration of a course you downloaded? Or a media library you have? Azmena CLI will help you with that.

Azmena is a CLI app built in go to help you get the total duration of video fiels in a folder and it's sub-folders with only on command

```bash
azmena
```
See demo:

![Azmena](https://raw.githubusercontent.com/mdyssr/azmena-cli/main/demo.gif)


You can check the repository [here](https://github.com/mdyssr/azmena-cli)

And you can download your version from the releases page [here](https://github.com/mdyssr/azmena-cli/releases)

BTW, Azmena in Arabic means durations.

Tweet it if you liked it <3
You can reach me on twitter [@mddysr](https://twitter.com/mddysr)