teleren/devto huggingface dataset:
5. Supplies for School
Tags: csharp, softuni, firststepsincoding, exercise
Published: 2023-01-20 23:07:32

```cs
using System;

namespace SuppliesForSchool
{
    internal class Program
    {
        static void Main(string[] args)
        {
            int penPacketNum = int.Parse(Console.ReadLine());
            int markerPacketNum = int.Parse(Console.ReadLine());
            int detersiveForWood = int.Parse(Console.ReadLine());
            double discount = int.Parse(Console.ReadLine());

            double penPacket = 5.80;
            double markerPacket = 7.20;
            double detersive = 1.20;


            double penPacketPrice = penPacketNum * penPacket;
            double markerPacketPrice = markerPacketNum * markerPacket;
            double detersivePrice = detersiveForWood * detersive;
            
            double totalPrice = penPacketPrice + markerPacketPrice + detersivePrice;

            discount = discount * 0.01;
            double discountedPrice = totalPrice - (totalPrice * discount);

            Console.WriteLine(discountedPrice);
        }
    }
}
```
4. Vacation Book List
Tags: csharp, softuni, firststepsincoding, exercise
Published: 2023-01-20 23:03:42

```cs
using System;

namespace VacationBooksList
{
internal class Program
{
    static void Main(string[] args)
    {
        int pageNum = int.Parse(Console.ReadLine());
        int page = int.Parse(Console.ReadLine());
        int countDays = int.Parse(Console.ReadLine());

        int totalReadingHour = pageNum / page;
        int neededHours = totalReadingHour / countDays;


        Console.WriteLine(neededHours);
    }
}
}
```
OAuth 2.0 basics explanation in pictures
Tags: oauth2, infographics
Published: 2023-01-20 23:03:29

---
title: OAuth 2.0 basics explanation in pictures
published: true
description: OAuth 2.0 very basic principle explained in pictures
tags: oauth2, infographics
# Use a ratio of 100:42 for best results.
published_at: current
---

Greetings everyone. Cheer me up for my first post here. I was bored and decided to make simple infographics to explain basic but essential principle of OAuth 2.0 protocol. Check it out!

![Main actors of OAuth 2.0](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ryv0stjspa5mqg6uzvvg.png)

![The problem OAuth 2.0 is designed to solve](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/dgt9np5s6xj059qrpt80.png)

![A solution OAuth 2.0 protocol provides](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zq5e3okehnhb4svf87mz.png)

![Main flow for the OAuth 2.0 protocol](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/iag9sny286m34lu1k3z3.png)
3. Deposit Calculator
Tags: csharp, softuni, firststepsincoding, exercise
Published: 2023-01-20 23:02:58

```cs
using System;

namespace DepositCalculator
{
internal class Program
{
    static void Main(string[] args)
    {
        double depositSum = double.Parse(Console.ReadLine());
        int depositTerm = int.Parse(Console.ReadLine());
        double yearDivident = double.Parse(Console.ReadLine());


        double sum = depositSum + (depositTerm * 0.010) * ((depositSum * yearDivident) / 12);
        Console.WriteLine(sum);
    }
}
}
```
2. Radians To Degrees
Tags: csharp, softuni, firststepsincoding, exercise
Published: 2023-01-20 23:02:23

```
using System;

namespace RadiansToDegrees
{
internal class Program
{
    static void Main(string[] args)
    {
        double radians = double.Parse(Console.ReadLine());
        double degrees = radians * 180 / Math.PI;
        Console.WriteLine(degrees);
    }
}
}
```
1. USD To BGN
Tags: csharp, softuni, firststepsincoding, exercise
Published: 2023-01-20 23:01:34

```cs
using System;
using System.ComponentModel.Design;

namespace UsdToBgn
{
internal class Program
{
    static void Main(string[] args)
    {
        double Usd = double.Parse(Console.ReadLine());

        double Bgn = Usd * 1.79549;

        Console.WriteLine(Bgn);
    }
}
}
```
9. Yard Greening
Tags: csharp, softuni, firststepsincoding, lab
Published: 2023-01-20 22:59:59

```cs
using System;

namespace YardGreening
{
internal class Program
{
    static void Main(string[] args)
    {
        double squareMeters = double.Parse(Console.ReadLine());

        double yardGreeningPrice = squareMeters * 7.61;
        double discountedPrice = 0.18 * yardGreeningPrice;
        double finalPrice =   yardGreeningPrice - discountedPrice;

        Console.WriteLine($"The final price is: {finalPrice} lv.");
        Console.WriteLine($"The discount is: {discountedPrice} lv.");

    }
}
}
```
8. Pet Shop
Tags: csharp, softuni, firststepsincoding, lab
Published: 2023-01-20 22:59:21

```cs
using System;

namespace PetShop
{
internal class Program
{
    static void Main(string[] args)
    {
        int dogFoodAmount = int.Parse(Console.ReadLine());
        int catFoodAmount = int.Parse(Console.ReadLine());

        double dogFoodPrice = 2.50;
        double catFoodPrice = 4;
        
        double dogPrice = dogFoodAmount * dogFoodPrice;
        double catPrice = catFoodAmount * catFoodPrice;
        double wholePrice = dogPrice + catPrice;


        Console.WriteLine($"{wholePrice} lv.");
    }
}
}
```
Docker-Selenium Video Recorder
Published: 2023-01-20 22:07:09

This post is intended for all those who use docker-selenium.

Since I started using "dockerized" Selenium grid, I was always curious about the possibility of recording the actions we perform within a browser container (chrome, edge, firefox) and when I saw there was a [solution](https://github.com/SeleniumHQ/docker-selenium#video-recording) in place for it, I just jumped into it, it was basically by using [selenium/video:ffmpeg-XXXX](https://hub.docker.com/layers/selenium/video/ffmpeg-4.3.1-20221219/images/sha256-a4bf701ff9c7d2cbce4f0b0b1bbe7ed9eb8043e858f346b054b30e514069b4c1?context=explore) Docker image; starting and stoping containers manually, but it was quite too raw, mainly because of the fact we need to kill the container in order to get the video file.

So I tried to create a logic layer whose main task was going to be handle this situation; avoid start/stop containers every time. As the thing got more complex and wanted to get more control, I ended up creating a service that can be deployed either using docker-compose or Helm Chart.

The service is intended to be exposed in the port 5001 of the machine where Selenium Grid is running, and it will look something similar to this:

### Start recording the screen of a given node:
```shell
$ curl -X POST http://localhost:5001/start -H "Content-Type: application/json" -d '{"videoName":"my_video","targetDisplay":"chrome-display"}'
{"file": "my_video.mp4", "status": "recording"}
```

### Stop recoding
```
$ curl -v -X POST http://localhost:5001/stop
{"file": "my_video.mp4", "status": "stopped"}
```
The file will be saved on the path you have specified in the deployment (keep reading for more details)

It's obviously the first steps for having a robust service that can take advantage of the replicas we might have in the Helm Chart or the Compose deployment, but this is a solution that worked for me and hope it does for you!

All that intro just for sharing this with you [Selenium Grid + Video Recorder](https://github.com/cesar-rayo/docker-selenium#video-recording), Happy testing!!
7. Projects Creation
Tags: csharp, softuni, firststepsincoding, lab
Published: 2023-01-20 22:58:39

```cs
using System;

namespace ProjectsCreation
{
internal class Program
{
    static void Main(string[] args)
    {
        string architectName = Console.ReadLine();
        int ProjectsAmount = int.Parse(Console.ReadLine());
        int neededHours = ProjectsAmount * 3;

        Console.WriteLine($"The architect {architectName} will need {neededHours} hours to complete {ProjectsAmount} project/s.");
    }
}
}
```
6. Concatenate Data
Tags: csharp, softuni, firststepsincoding, lab
Published: 2023-01-20 22:57:54

```cs
using System;

namespace ConcatenateData
{
internal class Program
{
    static void Main(string[] args)
    {
        string firstName = Console.ReadLine();
        string lastName = Console.ReadLine();
        int age = int.Parse(Console.ReadLine());
        string town = Console.ReadLine();

        Console.WriteLine($"You are {firstName} {lastName}, a {age}-years old person from {town}.");
    }
}
}
```
Big O Time Complexities
Published: 2023-01-20 22:57:41

## Big O

A method of expressing an algorithm's complexity, specifically the upper bound of the development of the running time, is known as big O notation. It is frequently used to compare the effectiveness of various algorithms and can be employed to foretell how well a specific algorithm would function with huge inputs.

Using Big O notation, which places a limit on how many operations an algorithm can do, the temporal complexity of an algorithm is frequently discussed. The notation is commonly expressed as O(n), where n is the size of the input. An algorithm that runs in linear time, or O(n), for instance, will have a running time that increases most linearly with the amount of the input.

## Time Complexities

There are several common time complexities that are often used in Big O notation, including:

![O(1)](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8zd8op39sc07qpsp7gdc.png)

O(1), also known as constant time. No matter how large the input is, a constant-time algorithm will always run in the same amount of time.

![O(log n)](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/rhuo47acxonzlucdqpuh.png)

O(log n) denotes time in logarithmic terms. If an algorithm runs in logarithmic time, the execution time will gradually increase as the size of the input grows. For algorithms that split the input in half after each iteration, this is frequently the case.

![O(n)](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gxpd5d6meu8swjoh1n18.png)

O(n), or linear time, is used as a measure. A linearly scalable method will have a running time that scales linearly with input size.

![O(n log n)](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/g30amn41t32lvu48q4ug.png)

Log-linear time is represented as O(n log n). A log-linear algorithm's running time will increase quicker than linear time but more slowly than quadratic time. This is frequently true for algorithms that incorporate both linear and logarithmic operations.

![O(n^2)](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3rwbaemkpjjm69h3v1ip.png)

O(n^2) is a symbol for quadratic time. An algorithm that operates in quadratic time will experience a sharp increase in running time as the size of the input increases. For algorithms that use nested loops, this is frequently the case.

## Finishing up

It is crucial to remember that Big O notation only offers an upper bound on an algorithm's execution time and ignores any lower bounds or worst-case possibilities. Furthermore, Big O notation typically ignores constant factors, which can result in two algorithms with the same time complexity actually operating at vastly different speeds.

In conclusion, Big O notation is a means to define an algorithm's time complexity. This enables us to evaluate the effectiveness of various algorithms and make predictions about how well they will work with huge inputs. O(1), O(log n), O(log n), O(n), O(n log n), and O(n^2) are examples of common time complexity. It's crucial to remember that Big O notation only offers an upper bound and ignores any lower bounds or worst-case possibilities.
5. Greeting By Name
Tags: csharp, softuni, firststepsincoding, lab
Published: 2023-01-20 22:55:10

```cs
using System;

namespace GreetingByName
{
internal class Program
{
    static void Main(string[] args)
    {
        string name = Console.ReadLine();
        Console.WriteLine($"Hello, {name}!");
    }
}
}
```
4. Inches To Centimeters
Tags: csharp, softuni, firststepsincoding, lab
Published: 2023-01-20 22:53:30

```cs
using System;

namespace InchesToCentimeters
{
internal class Program
{
    static void Main(string[] args)
    {
        double inches = double.Parse(Console.ReadLine());
        double centimeters = inches * 2.54;
        Console.WriteLine(centimeters);
    }
}
}
```
3. Rectangle Area
Tags: csharp, softuni, firststepsincoding, lab
Published: 2023-01-20 22:53:00

```cs
using System;

namespace RectangleArea
{
internal class Program
{
    static void Main(string[] args)
    {
        double a = double.Parse(Console.ReadLine());
        double b = double.Parse(Console.ReadLine());

        double area = a * b;
        Console.WriteLine(area);
    }
}
}
```
2. Nums 1...10
Tags: csharp, softuni, firststepsincoding, lab
Published: 2023-01-20 22:52:08

```cs
using System;

namespace Nums_1_10
{
internal class Program
{
    static void Main(string[] args)
    {
        Console.WriteLine(1);
        Console.WriteLine(2);
        Console.WriteLine(3);
        Console.WriteLine(4);
        Console.WriteLine(5);
        Console.WriteLine(6);
        Console.WriteLine(7);
        Console.WriteLine(8);
        Console.WriteLine(9);
        Console.WriteLine(10);
    }
}
}
```
MVP vs PoC. Explaining difference
Tags: mvp, poc, startup, development
Published: 2023-01-20 22:44:39

### Introduction

In the software development world, two terms that are often used to describe early-stage products are Minimum Viable Product (MVP) and Proof of Concept (POC). While both terms refer to early-stage products, they have distinct differences in terms of their purpose, scope, and intended audience.

### MVP

A <a href=https://cloudflex.team/software-development-services/mvp-poc-development/ rel='dofollow'>Minimum Viable Product development</a>, or MVP dev, is development of the product that has the minimum set of features necessary to attract early adopters and validate a product idea. The main goal of an MVP is to test the product's feasibility and market fit by gathering feedback from early adopters and making necessary adjustments before investing further resources into the product. An MVP typically has a small set of features that are essential to the product's core functionality and is often released as soon as possible to gather feedback.

### PoC

Proof of Concept, or POC, is a product that is built to demonstrate the feasibility of a particular idea or technology. The main goal of a POC is to provide evidence that a particular concept or technology can be implemented, and that it works as intended. A POC is typically a small-scale version of the final product that is built to test a specific feature or concept. Unlike an MVP, a POC is not intended to be released to customers and is only used internally to validate a particular technology or concept.

### Scope, Audience

When it comes to their purpose, MVPs are generally designed to be more comprehensive and appeal to a broader audience, while POCs are geared towards a more specific group of people. MVPs are typically developed with the goal of being released to customers, while POCs are created to be used within the company.

Regarding their target audience, MVPs aim to attract early adopters and customers, while POCs are primarily intended for internal teams and stakeholders. The purpose of MVPs is to gather feedback and assess the viability of a product idea, while POCs are created to demonstrate the practicality of a specific technology or concept to those within the organization.

By the way, we have written an interesting article about <a href=https://cloudflex.team/blog/mvp-vs-prototype-or-prototype-vs-mvp/ rel='dofollow'>MVP development vs PoC development article</a>, so you are welcome to read

### Summary

In summary, MVPs and POCs are both early-stage products that are used to validate product ideas and technologies, but they have distinct differences in terms of their purpose, scope, and intended audience. MVPs are built to gather feedback from early adopters and validate product ideas, while POCs are built to demonstrate the feasibility of a particular technology or concept to internal teams and stakeholders.


<a href=https://cloudflex.team/ rel='dofollow'>CloudFlex - Software MVP development</a>
Day 678 : Family
Tags: hiphop, code, coding, lifelongdev
Published: 2023-01-20 22:22:23

_liner notes_:
- Professional : Had the whole day to focus on this Web Component I'm working on. I needed to refactor the demo application so I could test it. Had to go back and forth between the Web Component and demo code to get things to work. Good news is that I was able to get it working. Next week, I'm going to refine the Web Component and publish it.

- Personal : Went through a bunch of tracks for the radio show. Started on a POC for a new side project. Ended the night watching a couple of episodes of "Spy x Family". I watched the 1st episode a while ago and never picked it back up. Pretty good.

![Up close view of a grey jagged mountain top with a little snow on it in Val Gardena, Italy](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/74e2zpcqaj3fyx9d31h0.png)

Going to finish up the prep work for the radio show. If I have time, I may do some work on getting the side project up and running. Definitely want to watch an episode of "Spy x Family" before calling it a night.

Have a great weekend!

peace piece
Dwane / conshus
https://dwane.io / https://HIPHOPandCODE.com
{% youtube wEJLXSqEVg8 %}
Using Fast Components in an Enhance App
Tags: webdev, webcomponents, enhance, fast
Published: 2023-01-20 22:08:10

---
title: Using Fast Components in an Enhance App
published: true
description: Fast is a library of web components and framework for building web components from Microsoft. With a minor amount of configuration you can use Fast components in your Enhance app.
tags: webdev, webcomponents, enhance, fast
cover_image: https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ppb1gbzi64ye3zpavfgy.jpg
canonical_url: https://blog.begin.com/posts/2023-01-20-using-fast-components-in-an-enhance-app
---

[Fast](https://www.fast.design/) is a library of web components and a framework for building web components from Microsoft. With minor configuration, you can use Fast components in your Enhance app.

## Using the Fast component library in your Enhance app

Fast comes with a [suite of pre-built components](https://explore.fast.design/components/fast-button) based on their design language that you can drop into your application. These components are beneficial for [wireframing](https://balsamiq.com/learn/articles/what-are-wireframes/) your application before you replace them with your own components.

Fast Components are a [browser module](https://enhance.dev/docs/learn/starter-project/browser). We’ll need to bundle in the dependency so it is available in the browser at run time.

First, we need to install `@microsoft/fast-components` by executing the command:

```bash
npm install @microsoft/fast-components
```

Then we need to create an entry point for Enhance to roll up the components and their dependencies to be used in the browser. Create a file called `app/browser/fast.mjs` and populate it with:

```javascript
// app/browser/fast.mjs
import {
    allComponents,
    provideFASTDesignSystem
} from "@microsoft/fast-components"

provideFASTDesignSystem().register(allComponents)
```

If you want to make all of the Fast components available.

However, you can reduce the size of your script by specifying which components you will use from Fast. For example, if you only need the button component use:

```javascript
// app/browser/fast.mjs
import {
    fastButton,
    provideFASTDesignSystem
} from "@microsoft/fast-components";

provideFASTDesignSystem()
    .register(
        fastButton()
    );
```

Now, all you need to do to use Fast components in an Enhance page is add a `script` tag to the rolled up code that Enhance creates for you.

```html
<script src="/_public/pages/fast.mjs"></script>
```

## Closing thoughts

What off-the-shelf components are important to you when you are building web applications? Let us know over on [Discord](https://enhance.dev/discord) or [Mastodon](https://fosstodon.org/@enhance_dev).
Planning: Using Satellite features in Starchart
Tags: opensource, typescript, starchart, refactoring
Published: 2023-01-20 22:03:45

## Overview
[Starchart](https://github.com/Seneca-CDOT/starchart) is a new project being put together by developers at Seneca College. The project will help students manage SSL certificates and subdomains without too much hassle and free of cost. 

The project is currently in the planning phase, and being part of the development team, I have been researching ways to add relevant bits of [Satellite](https://github.com/Seneca-CDOT/telescope/tree/master/src/satellite) in the Remix [Blues Stack](https://github.com/remix-run/blues-stack) project, we intend on using for Starchart. 

## The Plan
After studying Satellite and Remix's Blues Stack source code, I compiled a list of features and functionalities we can port from Satellite. It's better to port features from Satellite rather than replace Remix's Blues Stack server with it, as Satellite comes pre-bundled with some dependencies that we do not require in Starchart. 

### Proposed Satellite Features
- Logger
- Middleware
- Hash
- Create Error

### Proposed Dependencies used by Satellite
- pino, pino-http, pino-pretty (to use Logger)
- http-codes (to use Create Error)
- Terminus (for health-check and/or shutdown)
- helmet (for setting http headers)
- express-jwt (for middleware)
- cors

### Proposed File Structure
After generating a Blues Stack project, we could create a directory named "Satellite" where all the files from Satellite would live. The structure will look similar to the Satellite directory within the Telescope, with only files relevant to Starchart. After installing the needed dependencies, we need to refactor the code to use Typescript and ESM (import/export) syntax to ensure it works.  

![sample file structure](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/dkziizj4trj4iysvk9e6.png)

#### Server.ts Changes
Since we are using Pino-based logger, we would import `logger` in `server.ts` and pass that as a middleware instead of passing `morgan`.


#### healthCheck
There's already a `route` setup for `healthCheck` in the `app` directory within Remix Blues Stack project, we could tweak that file to configure `terminus` using `createTerminus` function for `healthCheck` functionality. 

#### Middleware
We could utilize the `isAuthorized` and `isAuthenticated` middleware functions to authorize and authenticate users. Also, we could benefit from the `errorHandler` middleware. 

#### Hash
I am unsure if we need this function, as it's helpful for hashing information that is safe to pass in URLs. We cannot use it for hashing passwords, so if there's no need for hashing information in the URL, we do not need to port this function. 
 
## Conclusion 
Once the team decides what features and functionalities we need from Satellite, we could start by filing an issue for it in the Starchart repository and go from there.