teleren/devto huggingface dataset:
In One Minute : AWS Lambda
Tags: aws, awslambda, beginners, oneminute
Published: 2022-10-25 12:46:55

AWS Lambda is a cloud offering from Amazon Web Services (AWS). AWS Lambda is a serverless compute service that runs code in response to events and automatically manages the underlying infrastructure for you.

AWS are effectively disrupting their (own) existing business with Lambda. Instead of forcing us to pay for EC2 instances in fixed increments and have complex application monitoring/scaling, AWS have built a much simpler way of building & running micro-services.

Lambda also disrupts other Platform-as-a-Service ("PaaS") providers such as Heroku, Google App Engine, Azure or Modulus where you pay for a specific amount of compute power & RAM but have a scaling delay and scale in a fixed increment (instances).

## Lambda features
The following key features help you develop Lambda applications that are scalable, secure, and easily extensible:

**Concurrency and scaling controls**
Concurrency and scaling controls such as concurrency limits and provisioned concurrency give you fine-grained control over the scaling and responsiveness of your production applications.

**Functions defined as container images**
Use your preferred container image tooling, workflows, and dependencies to build, test, and deploy your Lambda functions.

**Code signing**
Code signing for Lambda provides trust and integrity controls that let you verify that only unaltered code that approved developers have published is deployed in your Lambda functions.

**Lambda extensions**
You can use Lambda extensions to augment your Lambda functions. For example, use extensions to more easily integrate Lambda with your favorite tools for monitoring, observability, security, and governance.

**Function blueprints**
A function blueprint provides sample code that shows how to use Lambda with other AWS services or third-party applications. Blueprints include sample code and function configuration presets for Node.js and Python runtimes.

**Database access**
A database proxy manages a pool of database connections and relays queries from a function. This enables a function to reach high concurrency levels without exhausting database connections.

**File systems access**
You can configure a function to mount an Amazon Elastic File System (Amazon EFS) file system to a local directory. With Amazon EFS, your function code can access and modify shared resources safely and at high concurrency.

Official website :- https://aws.amazon.com/lambda
Search Videos/Audios Easily
Tags: opensource, showdev, python, streamlit
Published: 2022-10-25 12:44:53

A while back I had the issue of figuring out where a particular thing was said in a video or audio, so I thought "was it possible to search a video/audio ?".


I knew what the steps would look like (Transcribe -> Parse/Search Transcripts), but it was kinda hard to get really good accuracy on transcription, no that wasn't really the problem, the problem was I needed an open source STT model I could easily iterate upon freely and also wrap my head around, I tried some cloud STT/ASR's but I lacked that freedom. Then came OpenAI with Whisper, the accuracy is really good even with the tiny.en model, then another issue I had was deploying the model and creating a UI for interaction, then came Streamlit, it was really fun creating with Streamlit's widgets and then deploying on Streamlit cloud, smooth as butter.


Finally, I came up with this: [**Search Media Web App**](https://searchmedia.streamlitapp.com/), I'm curious what people think about this, I really don't know what to think of it, but I'm glad I was able to solve a problem I had, so send in your feedbacks or just try it out..


[Github Repo](https://github.com/ColeDrain/SearchMedia)
[Whisper Repo](https://github.com/openai/whisper) 

{% youtube K67LzX5GPJE %}
How to stop Localhost server running on multiple ports.
Tags: ubuntu, localhost, ports, wsl2
Published: 2022-10-25 12:40:34

I ran into a situation where I had multiple localhost ports. This is my fault as I failed to clearly close them. 

So what do we do? A very simple way is to run the following command:

`npx kill-port <port>`

replace port with the port you want to close without the bracket.

Note that if you don't have the _kill-port_ package installed, you would be prompted to install it.

There you go. Make sure you close your servers with **Ctrl + C**, unless stated otherwise.
The state of MVU
Tags: javascript, mvu
Published: 2022-10-25 12:16:44

I have created a github repo. to post all futures examples on MVU.

The first ones are listed here : [MVU examples](https://github.com/artydev/mvu/wiki/MVU-in-practice)

For any dicusssions, you can post your messages here : [MVU discussions](https://github.com/artydev/mvu/discussions)


PS : MVU is a NoRAV library :-)
20 pull requests were created in our repo by community members during Hacktoberfest 🚀 🚀 🚀
Tags: javascript, webdev, hacktoberfest, react
Published: 2022-10-25 12:14:51

Huge step forward for the project. 🎉🥳 Thanks for the contributions, and keep them coming! Let's create the most excellent web app building tool together!

For the context -- we’ve developed an open-source language for building full-stack web apps with less code and best practices that works alongside React and Node.js. 


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



If you're still thinking about whether you need to join HacktoberFest or not -- you definitely should while there's still time! 

P.S: And if you'd like to join us as a contributor -- [click here](https://github.com/wasp-lang/wasp/issues/735)! 😄 🐝 

Tech stack: JS, Haskell, no-code contributions are also welcome
Minimum Cost of ropes
Tags: javascript, leetcode
Published: 2022-10-25 12:08:13

There are given N ropes of different lengths, we need to connect these ropes into one rope. The cost to connect two ropes is equal to sum of their lengths. The task is to connect the ropes with minimum cost. Given N size array arr[] contains the lengths of the ropes. 

Example 1:

Input:
n = 4
arr[] = {4, 3, 2, 6}
Output: 
29
Explanation:
We can connect the ropes in following ways.
1) First connect ropes of lengths 2 and 3.
Which makes the array {4, 5, 6}. Cost of
this operation 2+3 = 5. 
2) Now connect ropes of lengths 4 and 5.
Which makes the array {9, 6}. Cost of
this operation 4+5 = 9.
3) Finally connect the two ropes and all
ropes have connected. Cost of this 
operation 9+6 =15
Total cost for connecting all ropes is 5 + 9 + 15 = 29. This is the optimized cost
for connecting ropes. 
Other ways of connecting ropes would always 
have same or more cost. For example, if we 
connect 4 and 6 first (we get three rope of 3,
2 and 10), then connect 10 and 3 (we get
two rope of 13 and 2). Finally we
connect 13 and 2. Total cost in this way
is 10 + 13 + 15 = 38.
Example 2:

Input:
n = 5
arr[] = {4, 2, 7, 6, 9}
Output: 
62 
Explanation:
First, connect ropes 4 and 2, which makes
the array {6,7,6,9}. Cost of
this operation 4+2 = 6. Next, add ropes 
6 and 6, which results in {12,7,9}. 
Cost of this operation 6+6 = 12.
Then, add 7 and 9, which makes the array {12,16}. 
Cost of this operation 7+9 = 16. And
finally, add these two which gives {28}.
Hence, the total cost is 6 + 12 + 16 + 
28 = 62.
Your Task:
You don't need to read input or print anything. Your task isto complete the function minCost() which takes an integer array arr[] and an integer n as arguments and returns the minimum cost.

Expected Time Complexity : O(nlogn)
Expected Auxilliary Space : O(n)

Constraints:
1 ≤ N ≤ 200000
1 ≤ arr[i] ≤ 106

```js
class Heap {
  constructor() {
    this.data = [];
  }

  getParentIndex(i) {
    return Math.floor((i - 1) / 2);
  }

  swap(i1, i2) {
    let temp = this.data[i1];
    this.data[i1] = this.data[i2];
    this.data[i2] = temp;
  }

  add(element) {
    this.data.push(element);
    let currentIndex = this.data.length - 1;

    while (
      this.data[currentIndex] > this.data[this.getParentIndex(currentIndex)]
    ) {
      this.swap(currentIndex, this.getParentIndex(currentIndex));
      currentIndex = this.getParentIndex(currentIndex);
    }
  }
}

function minCost(arr) {
  var heap1 = new Heap();
  let cost = 0;
  for (let i = 0; i < arr.length; i++) {
    heap1.add(arr[i]);
  }

  while (heap1.data.length !== 1) {
    let last = heap1.data.pop();
    let secondlast = heap1.data.pop();
    let temp = last + secondlast;
    cost = cost + temp;
    heap1.add(temp);
  }

  return cost;
}

console.log(minCost([4, 3, 2, 6]));
console.log(minCost([4, 2, 7, 6, 9]));

```
What is Amplication?
Published: 2022-10-25 12:03:39

**Amplication** is an open-source development too which helps developer develop quality Node.js applications real quick i.e. without spending time on repetitive coding tasks.

Applications created with Amplication comprise two main components — the server that runs the API and a database.The generated apps are built with great open-source libraries and technologies such as NestJS, Prisma, React, and PostgreSQL.

The developer easily creates data models, and easily configures role-based access control using an intuitive and beautiful UI, 
and Amplication auto-generates a server-side app based on TypeScript and Node.js and a client app with React.
The apps include REST API, database, Admin UI, authentication, authorization, logging, and more, and are ready for deployment with Docker containers.

When it comes to deployment, you can choose any of the following options:

- Deploying to the Amplication Cloud for testing and development purposes.
- Downloading the generated source code and continuing the process with your favorite IDE and local tools.
- Building a Docker container and deploying it to any cloud, datacenter, or server.


TLDR: Amplication is an open-source project with many more enticing features on its roadmap. Our goal is to make the lives of developers much easier 
when it comes to daily, mundane tasks, so you can focus on the next big thing you want to build — without spending time on repetitive tasks.
Ferris wheel from freecodecamp
Tags: codepen
Published: 2022-10-25 12:01:31

{% codepen https://codepen.io/avwerosuotrust/pen/VwxVppZ %}
Sorry Guys I commented the animation mode that is why it did not show.
Please Don't be angry 🙏🙏 veiw the project again and Comment on how i can improve
What are the Three Primitive JavaScript Data Types?
Tags: javascript, webdev, beginners, programming
Published: 2022-10-25 12:00:02

## Data Types

**What are the Three Primitive JavaScript Data Types?**

In JavaScript, a primitive (primitive value, primitive data type) is data that is not an object and has no methods or properties. The term data type refers to the different types of values that a program can operate with. Variables in JavaScript may hold a variety of data types, including numbers, strings, booleans, and more.

JavaScript, unlike many other programming languages, does not specify multiple types of numbers such as integers, short, long, floating-point, and so on.

In this tutorial, you will learn about the three primitive data types available in JavaScript: numbers, strings of text (known as “strings”), and boolean truth values (known as “booleans”).

## Numbers

Number represents integer and floating numbers (decimals and exponentials). JavaScript numbers can be written with or without decimals.

```javascript
let num = 34; // A number without decimals
```

### Floating-Point Numbers

JavaScript numbers can also have decimals.

```javascript
let price = 29.99;
```

## Strings

JavaScript strings are used for storing and manipulating text.
A string can be any text and must be surrounded by quotes. You can use single or double
quotes.

```javascript
let name = ‘Tom’;
let text = “My name is Tom Adams”;
```

You can use quotes inside a string, as long as they don’t match the quotes surrounding
the string.

```javascript
let text = “My name is ‘Tom’ “;
```

## Booleans

In JavaScript Boolean, you can have one of two values, either true or false.
These are useful when you need a data type that can only have one of two values, such as Yes/No, On/Off, True/False.

```javascript
let isActive = true;
let isAway = false;
```

Boolean values also come as a result of comparisons:

```javascript
let isGreater = 6 > 2;

alert(isGreater); // true (the comparison result is “yes”)
```

### Further reading

Want to learn more about JavaScript Data Types? Then check out this article on [JavaScript Data Types – W3Schools](https://www.w3schools.com/js/js_datatypes.asp)

Thank you for reading and keep on coding.
Oxy Proxy Manager - a Simple Proxy Management App for Android
Tags: beginners, webscraping, app, android
Published: 2022-10-25 11:59:56

![oxy proxy manager](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9mrfg14h6k6vjwd1e2ys.png)



[Oxy Proxy Manager](https://oxy.yt/Mo2N) is a free proxy app that allows you to add, edit, and manage proxies from any proxy provider. All the essential proxy session features are available at hand.

### Why should you use it?
_Simple & quick_
You can manage multiple social media accounts, access websites that would otherwise be blocked, and change your geolocation. With a one-click connection, you can add an unlimited number of proxies and switch between multiple IPs.


![switching multiple ips](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/732lwabk9e0ntanw8on6.png)




_Works with any proxy provider_
Save time by NOT jumping through various settings and menu options on multiple platforms. You can have all of your proxies in one place. Oxy Proxy Manager app works with any proxy provider of your choice.



![works with any proxy provider](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/urkhbg87fh2qmsoo3nu9.png)






_Works on all the latest Android versions_
The app works on all the latest Android versions (Android 5 and up) without the need to root your device.

![proxy manager works with android](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/a6fibp04gsn7x2nwimoe.png)

_Light-Dark mode support_
Nothing major, but still nice to have.

### Try it yourself
Visit Google Play store to install the app, add your proxies, and choose the preferred proxy to connect to the internet. That’s it.


If you don’t want to use the app, you can find the same functions using the Oxy Proxy Extension for Chrome on your PC.
Hacktoberfest with Aviyel 🎉
Tags: javascript, webdev, react, productivity
Published: 2022-10-25 11:57:37


A month-long celebration where participants are prompted to contribute in ways other than writing code during this four-week period. We wanted to provide an avenue for people to connect, compete and collaborate with fellow open source enthusiasts.

[Subscribe to My Youtube Channel](https://www.youtube.com/channel/UCjMse2JYXPbtlzcnkbXmVQQ) ⬇

### Recent Article ⬇
1. [A Complete Guide to Waves](https://dev.to/patilganesh1010/a-complete-guide-to-waves-bmb)
2. [A Practical Guide to Brain.js](https://dev.to/patilganesh1010/a-practical-guide-to-brainjs-nfk)
3. [DevOps Simplified](https://dev.to/patilganesh1010/devops-simplified-j12)
4. [Wavy Backgrounds with CSS & SVG](https://dev.to/patilganesh1010/wavy-backgrounds-with-css-svg-11ef)
5. [Everything you need to know about Markdown](https://dev.to/patilganesh1010/everything-you-need-to-know-about-markdown-1da3)
Refactoring 009 - Protect Public Attributes
Published: 2022-10-25 11:46:44

*Forget about data structures, DTOs, POJOs, and anemic objects.*

> TL;DR: Avoid external manipulation

# Problems Addressed

- Encapsulation Violation

- Anemic Models

# Related Code Smells

{% post https://dev.to/mcsee/code-smell-01-anemic-models-4dg2 %}

{% post https://dev.to/mcsee/code-smell-40-dtos-4426 %}

# Steps

1. Change the visibility of your attributes from public to private.

# Sample Code

## Before

[Gist Url]: # (https://gist.github.com/mcsee/803a3400fe6b241417de5abd17b89606)
```java
public class Song {
   String artistName;
   String AlbumName;
}
```

## After

[Gist Url]: # (https://gist.github.com/mcsee/bfefa85761d0030892bcbdd438ca7f59)
```java
public class Song {
   // 1- Change the visibility of your attributes from public to private
   private String artistName;
   private String AlbumName;
  
  // We cannot access attributes until we add methods
}
```

# Type

[X] Semi-Automatic

We can change the visibility with an IDE or text editor.

# Safety

This is not a safe refactor.

Existing dependencies may break.

# Why code is better?

We can change encapsulated code easily.

The code is not repeated.

# Limitations

Some languages don't have visibility options.

# Tags

- Anemic

# Related Refactorings

{% post https://dev.to/mcsee/refactoring-001-remove-setters-26cg %}

# Credits

Image by [Couleur](https://pixabay.com/users/couleur-1195798/) on [Pixabay](https://pixabay.com/)

* * * 

This article is part of the Refactoring Series.

{% post https://dev.to/mcsee/how-to-improve-your-code-with-easy-refactorings-2ij6 %}
New Update-Amazon Cognito now provides user pool deletion protection
Tags: aws, devops, cloud, operations
Published: 2022-10-25 11:43:06

You can now activate deletion protection for your Amazon Cognito user pools. When you configure a user pool with deletion protection, the pool cannot be deleted by any user. Deletion protection is now active by default for new user pools created through the AWS Console. You can activate or deactivate deletion protection for an existing user pool in the AWS Console, the AWS Command Line Interface, and API. Deletion protection prevents you from requesting the deletion of a user pool unless you first modify the pool and deactivate deletion protection.

## To configure deletion protection

1. Go to the Amazon Cognito console. You might be prompted for your AWS credentials.
2. Choose **User Pools**.
3. Choose an existing user pool from the list, or [create a user pool](https://docs.aws.amazon.com/cognito/latest/developerguide/cognito-user-pool-as-user-directory.html).
4. Choose the **User pool settings** tab. Locate **Deletion Protection** and select **Activate** or **Deactivate**.
5. Confirm your choice in the next dialogue.

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

When you want to delete a user pool with an Amazon Cognito API request, you must first change `DeletionProtection` to `Inactive` in an [UpdateUserPool](https://docs.aws.amazon.com/cognito-user-identity-pools/latest/APIReference/API_UpdateUserPool.html) request. If you don't deactivate deletion protection, Amazon Cognito returns an `InvalidParameterException` error. After you deactivate deletion protection, you can delete the user pool in a [DeleteUserPool](https://docs.aws.amazon.com/cognito-user-identity-pools/latest/APIReference/API_DeleteUserPool.html) request.

Amazon Cognito activates **Deletion protection** by default when you create a new user pool. You can activate or deactivate deletion protection status in the **Deletion protection** container in the **User pool settings** tab in the Amazon Cognito console.



Refer- [Cognito User Pool](https://docs.aws.amazon.com/cognito/latest/developerguide/user-pool-settings-deletion-protection.html)

---
console.log("My First Blog Post")
Published: 2023-06-11 12:55:01

---
title: console.log("My First Blog Post")
published: true
date: 2022-10-25 11:36:51 UTC
tags: 
canonical_url: 
---

\*\*Hey you \*\*👋,  
_Welcome aboard,_

<iframe src="https://giphy.com/embed/FQyQEYd0KlYQ" width="480" height="266"></iframe>

[via GIPHY](https://giphy.com/gifs/ifc-ifc-FQyQEYd0KlYQ)

Quick intro: I'm Segun, an 18 year old web developer who recently started learning how to code, I've been learning about HTML, CSS and JavaScript, and I've built some cool projects along the way, [check out my github](https://github.com/giftade) and [let's connect on twitter](https://twitter.com/segzy0x)

So I've been contemplating doing this for some time now and I guess I've given in to the pressure from tech twitter. Before I ventured into this new journey, I went through the length and breadth of the internet searching for the benefits of writing blog posts

<iframe src="https://giphy.com/embed/ZYX2ZNBPHmlmfc7Fcj" width="480" height="240"></iframe>

[via GIPHY](https://giphy.com/gifs/cakefx-cake-fxx-fx-ZYX2ZNBPHmlmfc7Fcj)

I must say there are a lot of them, but here are a few examples:

- it reinforces your learning,

- it educates others in the tech community,

- it helps you document your learning while keeping you accountable and

- it connects you with more like-minded people.

So come along with me on this journey, I'd be writing about what I've learnt so far and also trying to help other newbies like me in any way I can, see you in my next post .
Code Art — abstract artworks for your creations
Tags: showdev, webdev, webgl2, art
Published: 2022-10-25 11:13:36

Have you ever searched internet to find a cover for your post? I did! Artists created quite a few of beautiful images, but whenever I see a nice pic I may wish slightly different color, or font, or angle, or some other effect...

Is it possible to make a software generating artworks? Yes, and here is it!

https://code-art.pictures/

## Usage
* Just open the app, or click “↻” — and you get new artwork
* Do you need the file? No problem, click “Download” button and you have it
* Do you want tweaking the image? There's a comprehensive menu under “Options” button. You may change size, font, color, angle and much other effects.

## How does it work?
Glad you asked. Here's the [repo](https://github.com/aleksei-berezkin/code-art). The app is powered by WebGL2 which I learned from [WebGL2 Fundamentals](https://webgl2fundamentals.org/). Just like any other WebGL app, much of its work is the scene data preparation which consists of several steps:
* [Rasterize](https://github.com/aleksei-berezkin/code-art/blob/main/src/draw/rasterizeAlphabet.ts) textures
* [Generate](https://github.com/aleksei-berezkin/code-art/blob/main/src/model/generateSceneParams.ts) several sets of scene parameters (font, angle, scroll position etc)
* [Estimate](https://github.com/aleksei-berezkin/code-art/blob/main/src/model/scoreFill.ts) the expected pic fill ratio for each params set. I experimented a lot, and found out the more text visible on pic, the better it looks
* Of generated params set, pick one yielding the greatest fill ratio
* [Compute](https://github.com/aleksei-berezkin/code-art/blob/main/src/draw/createCodeSceneVertices.ts) scene vertices
* [Upload](https://github.com/aleksei-berezkin/code-art/blob/main/src/draw/drawCodeScene.ts) the data to GPU, and render the scene

To render UI I use [Svelte](https://svelte.dev/). To parse JS files I use [Acorn JS](https://github.com/acornjs/acorn) running in [Web Worker](https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API/Using_web_workers).

## Can I use images in my posts?
Of course! Please don't remove watermarks though, or give explicit credit near the image, thank you.

## Have anything to say?
You are welcome. Feel free to write a comment or [file an issue](https://github.com/aleksei-berezkin/code-art/issues).