teleren/devto huggingface dataset:
Multiline Text in HTML Canvas
Tags: html, webdev, javascript, beginners
Published: 2023-07-14 17:53:42

I've recently given a facelift to Canvas-Txt, a project that I initially launched some moons ago. For those not in the know, Canvas-Txt is a teensy-weensy library that does one job, and one job only - render multiline text on your HTML5 Canvas, without hanging on the coattails of any dependencies.

Now, let me show you

https://github.com/geongeorge/Canvas-Txt

## Demo

To give you an idea, let me walk you through a simple use-case scenario:

First, install Canvas Txt either via yarn or npm:

```sh
yarn add canvas-txt

or

npm i canvas-txt
```


```html
<canvas id="myCanvas" width="500" height="500"></canvas>
```

```js
import { drawText } from 'canvas-txt'

const c = document.getElementById('myCanvas')
const ctx = c.getContext('2d')

ctx.clearRect(0, 0, 500, 500)

const txt = 'Lorem ipsum dolor sit amet'

const { height } = drawText(ctx, txt, {
  x: 100,
  y: 200,
  width: 200,
  height: 200,
  fontSize: 24,
})

console.log(`Total height = ${height}`)
```

{% embed https://jsfiddle.net/geongeorgek/n5xw3ufj/2/ %}

And there you have it. Your multiline text, neatly rendered on an HTML canvas.

What's even cooler is that you can do this in Node too! Just have a look at the Node js demo here https://github.com/geongeorge/Canvas-Txt/blob/master/src/node-test.ts

## Summing Up

That's pretty much it. With Canvas Txt v4, I've aimed to simplify your journey of handling multiline text in HTML canvas.

Whether you're just dabbling in canvas or are an experienced pro, I hope you'll find Canvas Txt useful.

As always, if you have any suggestions, comments, or just want to give a shout out, hit me up on my Twitter!
11. Container With Most Water
Tags: leetcode
Published: 2023-07-14 17:46:57


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

### Question
[Find two lines that together with the x-axis form a container, such that the container contains the most water. Return the maximum amount of water a container can store.](https://leetcode.com/problems/container-with-most-water/description/)

### Steps
0. Two pointers: start and end
1. Choose the shorter height for area
2. Move the pointer with shorter height

### Python
```python
class Solution:
    def maxArea(self, height: List[int]) -> int:

        start = 0
        end = len(height) - 1

        maxArea = 0

        while start < end:
            minHeight = min(height[start], height[end])
            length = end - start
            maxArea = max(maxArea, length * minHeight)

            if height[start] > height[end]:
                end -= 1
            else:
                start += 1
        
        return maxArea
```

```
height =
[3,5,2,6,5,2]

Output = 15
```

### Java
```java
class Solution {
    public int maxArea(int[] height) {
        int maxArea = 0;
        int left = 0;
        int right = height.length - 1;

        while (left < right) {
            int minHeight = Math.min(height[left], height[right]);
            int length = right - left;
            maxArea = Math.max(maxArea, length * minHeight);

            if (height[left] < height[right]) {
                left += 1;
            } else {
                right -= 1;
            }
        }

        return maxArea;
    }
}
```
How to choose best business in Tech Industry?
Published: 2023-07-14 17:34:21

Choosing the [best business in the tech industry](https://marxcommunications.com/) requires careful consideration of various factors. Here are some steps to help you make an informed decision:

Identify your interests and skills: Consider your passion, knowledge, and skills within the tech industry. Look for areas where you have expertise or a genuine interest, as this will increase your chances of success and satisfaction.

Research market trends: Stay up to date with current trends and emerging technologies in the tech industry. Identify areas that are experiencing growth and have a promising future. Look for market gaps or unmet needs that your [business could address](https://newumedspaorlando.com/prp-treatment/).

Assess competition: Evaluate the competitive landscape in the tech industry. Identify the key players, their offerings, and market share. Consider if you can offer something unique or differentiate yourself from the existing competition.

Conduct market research: Understand your target market and customer needs. Conduct surveys, interviews, or gather data to gain insights into the problems or challenges your potential customers face. This will help you tailor your [business idea](https://bobbeactive.com/products/step-up-skort-white-activewear-skirt) to meet those needs effectively.

Evaluate scalability and profitability: Consider the scalability and profit potential of your chosen business idea. Determine if it can grow and adapt to changing market conditions. Assess the revenue streams, potential margins, and the long-term viability of your business model.

Consider your resources: Evaluate the resources you have available, such as capital, skills, and network. Determine if you have the necessary resources to start and sustain the business. If not, explore options like partnerships, seeking investment, or acquiring necessary skills through training or hiring.

Seek expert advice: Consult with industry experts, mentors, or business consultants who have experience in the tech industry. They can provide valuable insights, guidance, and help you validate your business idea.

Develop a business plan: Create a comprehensive business plan that outlines your vision, goals, target market, marketing strategies, financial projections, and operational details. A well-defined plan will help you stay focused and guide your business's growth.

Remember, starting a business in the tech industry requires adaptability, continuous learning, and keeping up with rapidly evolving technologies. Be prepared to embrace change, take calculated risks, and constantly innovate to stay competitive in the dynamic tech market.
We got your secrets
Tags: secrets, secretdetection, opensource, sourcecode
Published: 2023-07-14 17:31:35

**We got your secrets. Do you want ours?**

Source code contains tons of sensitive information, like _personable identifiable information_ in test data, _usernames and passwords_ that someone forgot to parameterize, _private keys, personal access tokens_ etc. You name it, you can find it.

But what if you could scan Github repos, Azure DevOps repos, Bitbucket repos? And if the secrets are neatly organized, easy to triage, sorted and transformed into usable metrics?

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

With **Repository Scanner** (licensed under MIT) you can do it all. Repository Scanner is an Enterprise Grade open source project, running in isolation as a continuous monitoring agent or running in pipelines as a CI stage, which captures secrets and presents the data in an easy to consume manner to Red Teams, Security Consultants, Test teams, Developers, CICD maintenance, Management (metrics) and every other interested stakeholder.

Try it out (again, fully licensed under MIT) via https://github.com/abnamro/repository-scanner and leave a ⭐️ star if you like what you see.
Understanding Cost Estimation in Single-Table Queries in PostgreSQL
Tags: apacheage, postgres
Published: 2023-07-14 16:57:55

In PostgreSQL, query optimisation plays a vital role in achieving optimal query performance. This article explores how PostgreSQL estimates costs in single-table queries and provides insights into the different types of costs and their significance in query optimisation.
Estimating Costs: Functions and Dimensions:
Cost estimation in PostgreSQL is based on relative performance indicators rather than absolute values. The functions defined in costsize.c are responsible for estimating costs for different operations executed by the executor. For instance, the cost_seqscan() and cost_index() functions estimate the costs of sequential scans and index scans, respectively.
Types of Costs: Start-up, Run, and Total:
PostgreSQL distinguishes three types of costs: start-up, run, and total. The start-up cost represents the cost incurred before the first tuple is fetched, such as reading index pages. The run cost, on the other hand, reflects the cost of fetching all tuples. The total cost is the sum of the start-up and run costs. It is important to note that the start-up and run costs are estimated independently, and the total cost is derived from their combination.
Understanding EXPLAIN and Cost Display:
The EXPLAIN command in PostgreSQL provides insights into the cost estimation process. It displays both the start-up and total costs for each operation in a query plan. For instance, when executing a simple single-table query, the EXPLAIN output includes information about the sequential scan operation, with the cost section displaying the start-up and total costs.
Exploring Specific Operations: Sequential Scan, Index Scan, and Sort:
In this article, we delve into the estimation process for three specific operations: sequential scan, index scan, and sort. By examining these operations in detail, we gain a deeper understanding of how PostgreSQL estimates their costs during query optimization.
Practical Example:
To illustrate the cost estimation process, we use a specific table and index. We create a table called tbl with columns id and data, and an index called tbl_data_idx on the data column. We then populate the table with data and analyze it to generate statistics for accurate cost estimation. The article presents a practical example using the created table and index to showcase the cost estimation process in action.
Cost estimation is a crucial aspect of query optimization in PostgreSQL. By estimating costs for various operations, PostgreSQL's optimizer can make informed decisions about the most efficient execution plan for a query. Understanding the different types of costs and their estimation methods empowers developers and database administrators to optimize query performance and ensure efficient utilization of resources in single-table queries within PostgreSQL.
Understanding the Planner and Executor in PostgreSQL: Optimizing Query Performance
Tags: postgres, apacheage
Published: 2023-07-14 16:56:09

## The Planner: Generating the Optimal Query Plan
The planner acts as the brain behind query optimization in PostgreSQL. It receives a query tree from the rewriter, which represents the parsed and normalized query, and its primary objective is to generate a query plan tree that can be executed most efficiently by the executor. Unlike rule-based optimization or hints, PostgreSQL's planner relies solely on cost-based optimization strategies.

## Composing the Plan Tree: Plan Nodes and Structure
The plan tree is the result of the planner's work and consists of plan nodes, which are elements defining various operations and steps involved in query execution. These plan nodes hold information required by the executor for processing. The plan tree, connected to the PlannedStmt structure, is represented as a list of plan nodes defined in plannodes.h. For a more detailed understanding of the plan nodes, we refer to Section 3.3.3 and Section 3.5.4.2 of the PostgreSQL documentation.

## Executor: Bringing the Plan to Life
The executor is responsible for executing the query plan generated by the planner. It operates on the plan tree, starting from the end and working its way up to the root. In the case of a single-table query, the executor processes the plan nodes accordingly, leveraging the information provided by each node. For instance, if the plan tree includes a sort node followed by a sequential scan node, the executor will first perform a sequential scan on the table and then sort the obtained result.

## Interacting with the Database Cluster: Reading, Writing, and Memory Management
To fulfill its tasks, the executor interacts with the database cluster, reading and writing tables and indexes via the buffer manager, as described in Chapter 8 of the PostgreSQL documentation. During query processing, the executor utilizes allocated memory areas such as temp_buffers and work_mem, which are pre-allocated for efficient memory management. Additionally, the executor may create temporary files if necessary to handle intermediate results during execution.

The planner and executor are fundamental components of PostgreSQL's query processing system. While the planner generates the optimal query plan based on cost-based optimization, the executor brings that plan to life, executing the operations defined by the plan nodes. By understanding the intricacies of these components and their interactions, developers and database administrators can fine-tune query performance, optimize resource usage, and ultimately improve the efficiency of their PostgreSQL databases.
Las mascaras que usamos
Tags: writing, spanish
Published: 2023-07-14 16:55:25

De vez en cuanto me gusta escribir sobre cosas que no son técnicas pero que pienso que ayudan a fortalecer las habilidades blandas. A continuación un articulo sobre porque es importante la diplomacia.

La idea de ser siempre la misma persona con todos es una falacia, una mentira. No te engañes a ti mismo. No puedes ser siempre 100% genuino con todos, todo el tiempo. Si fuera así, no te comportarías de manera diferente en la oficina, en una reunión con tu jefe o en la intimidad de tu hogar con tu esposa.

Todos nos adaptamos a las circunstancias y escenarios que se nos presentan. Es necesario reconocer que usamos máscaras dependiendo de la situación en la que nos encontramos. No es hipocresía, sino simplemente un mecanismo arraigado en nuestro cerebro. En la gran mayoría de las ocasiones, es posible que debas usar una máscara que vaya en contra de tus creencias. Sin embargo, es necesario hacerlo para superar miedos internos, conectar con personas que admiras o cerrar tratos importantes que has estado esperando.

Tener la capacidad de adaptarse a las circunstancias y salir victorioso no es sencillo. Requiere un esfuerzo mental considerable y, sobre todo, la voluntad de hacerlo por tu propio bien, el de tu empresa y las personas cercanas a ti.

Una ventaja injusta es ser consciente de esto y utilizarlo a tu favor. Yo lo consideraría como diplomacia. Considero que es una de las habilidades más difíciles de desarrollar, ya que muchas veces tu mente te traicionará. Hay que tener en cuenta que así funciona el juego, y aquellos que están varios peldaños por encima de ti, tanto en lo económico como en lo emocional, lo saben. Una vez más, así es el juego. 

Si ahora sabes esto y no lo aplicas, está bien, pero por favor, no pases toda la vida quejándote de por qué no obtuviste un mejor empleo, por qué no conectaste con la chica que te gusta o por qué no tienes los ingresos que siempre quisiste. Es tu responsabilidad y nadie vendrá a solucionar tus problemas. Lo sé, es doloroso, pero creo firmemente que debes cambiar esos paradigmas mentales que no te llevan a ninguna parte. Simplemente obstaculizan tu crecimiento como persona profesional y con metas claras.
Webservices - REST x SOAP
Published: 2023-07-14 16:44:34

**Firstly, what is a webservice?**

Webservices are hosted and accessible applications via HTTP that enable communication and data exchange between different systems. There are different approaches to implementing webservices, with the most common ones being REST (Representational State Transfer) and SOAP (Simple Object Access Protocol). In summary, it is an application hosted and accessible via HTTP.

**SOAP and REST**

REST is a communication approach based on the HTTP protocol, using methods such as GET, POST, PUT, and DELETE to manipulate resources. It is considered lighter, more efficient, and scalable, utilizing simple message formats like JSON or XML. Additionally, REST is widely supported across various platforms and programming languages.

On the other hand, SOAP is an older and more complex protocol. It can be executed on different transport protocols, such as HTTP and SMTP, and it utilizes XML as the message format. SOAP has a more intricate interface, described in the Web Services Description Language (WSDL), with messages sent and received through specific method calls. Although SOAP is heavier in terms of processing, it offers advanced security and transactional features.

**_HTTP_**

GET: Requests a specific resource from the server.
POST: Sends data to the server, usually used to create new resources.
PUT: Updates an existing resource on the server.
DELETE: Removes a resource from the server.
PATCH: Partially updates an existing resource on the server.

Key HTTP Status Codes:
1xx (Informational):

2xx (Success):
200: OK

3xx (Redirection):

4xx (Client Error):
400: Bad Request
401: Unauthorized
404: Not Found
405: Method Not Allowed

5xx (Server Error):
502: Bad Gateway
503: Service Unavailable

**In conclusion**, webservices are a means of communication between systems that allows for standardized data exchange over the internet. REST and SOAP are different approaches to implementing webservices, with REST being lighter, more efficient, and widely supported, while SOAP is more complex and offers advanced features. The choice between REST and SOAP depends on the specific project requirements. HTTP status codes are used to indicate the outcome of HTTP requests, providing information about the success or failure of the request.
CrowdSec Academy
Published: 2023-07-14 16:40:08


_**O que é CrowdSec Academy**_ : 

_Esta é a nossa nova plataforma de aprendizagem online, onde você pode aprender os fundamentos de uma abordagem colaborativa para a cibersegurança, além de aprender todos os detalhes do CrowdSec Security Engine_.


_Estamos oferecendo certificados de conclusão para todos os alunos que concluírem um curso, então, mesmo se você já estiver usando o CrowdSec há algum tempo, conclua os cursos e mostre sua experiência!_





_**CrowdSec Fundamentals**_

> Este curso é voltado para profissionais de segurança, administradores de sistemas e gerentes de TI que desejam entender como o CrowdSec pode ajudar a proteger seus sistemas e redes contra ameaças cibernéticas, além de estudantes que desejam ter uma introdução à maior rede de inteligência de ameaças cibernéticas do mundo.

**_Community Driven Cybersecurity_**

> Este curso é voltado para organizações e estudantes que estão iniciando no mundo da segurança cibernética e desejam compreender os princípios e tecnologias que moldam e definem a segurança cibernética, o papel fundamental dos profissionais de segurança cibernética e o surgimento de abordagens colaborativas.


- **_Escrevendo Parsers e Cenários_**.

> O objetivo deste curso é capacitar os usuários do CrowdSec que desejam desenvolver seus próprios Parsers do CrowdSec, além de cenários personalizados de Detecção de Comportamento, visando uma proteção aprimorada de suas redes e aplicativos. Durante o curso, os participantes terão uma visão geral abrangente sobre a criação de parsers e cenários, seguida por um laboratório prático que demonstrará passo a passo como iniciar o desenvolvimento de suas próprias soluções. Com isso, os alunos serão capacitados a personalizar e adaptar o CrowdSec de acordo com suas necessidades específicas, aumentando a eficiência e eficácia das medidas de segurança implementadas.



**_Conclusão_**

_Isso será um grande recurso para a comunidade, tanto para os membros antigos quanto para os novos._

_Se você tiver algum curso específico em mente, me avise! Em breve, lançaremos um curso que mostrará como criar seus próprios analisadores e cenários._

Feliz aprendizado!

- Site da [CrowdSec](https://www.crowdsec.net/)
- Academy [CrowdSec](https://academy.crowdsec.net/)
yesmovies org unblocked
Tags: entertainment
Published: 2023-07-14 16:38:49

[yesmovies org unblocked ](https://www.webtechpulse.com/yesmovies-yes-movies-free-movies-online-yesmovie/)   There has been a massive growth in the population who are watching movies online nowadays. Most of the sites require registration or subscription fees to stream you the movies. But Yesmovies has been a site that never asked for any kind of subscription fee from the users. Even, the users need not to register also. This site has been combining movies from different sites to gather content for regular users.But since many lawmakers have thrown a copyright case against this site, there has been a blockade and this site is blocked for now. It is not like it will be blocked forever, but meanwhile, you can go through the mirrors and yesmovies proxy to get the best movies online.These are the main yesmovies proxy. You just need to enter into these websites and start watching your movie or series by giving the name in the search box. As you need not any registration, you can binge-watch your favorite show here.
Learn JavaScript (creative coding and game development)
Published: 2023-07-14 16:20:42

Dear coding enthusiasts,

I've build a 24 lesson coding course to teach JavaScript from 0 to hero (almost)! 

I'm using a pragmatic method with tons of examples and creative coding projects and even mini-games.

The course is based on the free codeguppy.com coding platform that incorporates modified versions of popular libraries such as p5.js, p5play and p5.SceneManager.

## Coding Lessons

Use this coding playlist if you want to learn JavaScript in a fun way!

[https://www.youtube.com/playlist?list=PLZld0zbNGbZRfjut6JI7ZLx8ZbTDa5zn-](https://www.youtube.com/playlist?list=PLZld0zbNGbZRfjut6JI7ZLx8ZbTDa5zn-)

## Coding Projects

While on the channel, please checkout also the list of coding projects:

[https://www.youtube.com/playlist?list=PLZld0zbNGbZSLmJhOam5QRKn7xGHgK0c0](https://www.youtube.com/playlist?list=PLZld0zbNGbZSLmJhOam5QRKn7xGHgK0c0)

Happy Coding!
Navigating Streamlined Docker container Deployment on AWS
Tags: docker, aws, container, developer
Published: 2023-07-14 16:14:43

As the retirement of [Docker Compose integration for ECS](https://docs.docker.com/cloud/ecs-integration/) (Amazon Elastic Container Service) and ACI (Azure Container Instances) approaches in November 2023, there arises a concern about finding suitable alternatives to enable Docker in ECS
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/tijlqsotbv4bsw0u3iti.png)

## So any alternative? 

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

Fortunately, a viable alternative called [Compose-ECS](https://github.com/docker/compose-ecs) has emerged, providing an open-source solution for deploying containerised applications in ECS

## Compose ECS ( `compose-ecs`)

`compose-ecs` is CLI tool to deploy your application using docker container in AWS ECS service with just few commands. 

Example, you can deploy any application or tool like Jenkins, WordPress, Angular, React and many more with just help of `docker-compose.yaml` file. You just have o select your image from https://hub.docker.com/. Create a file like below 
```
services:
  jenkins:
    image: jenkins/jenkins:lts
    ports:
      - 8080:8080
```

If you're curious to know how it works and what the difference is between the earlier option and this, then watch this live session.

{% embed https://www.youtube.com/watch?v=z8WSQblxTvo %}

## Connect with us:-
Slack: https://launchpass.com/collabnix
Aris Zagaris express-api
Tags: programming, api
Published: 2023-07-14 16:13:48

Howdy! I am not a programmer although I know some Perl. I got lost trying to follow Aris's guide on setting up express-api.

This is the error message:

> C:\Users\David McMurrey\Desktop\express-api\src\server.js:134
> const app = require('./app');
>       ^
> SyntaxError: Identifier 'app' has already been declared
Can any one help? 

David
Business, Government & Technical Communications
Austin Community College
 https://mcmassociates.io/dmz_index.html