teleren/devto huggingface dataset:
First Blog Post as a newbie
Published: 2022-08-08 16:33:14

This is my first post as a newbie web developer. I start my online courses with Flatirons school at the end of August. I feel kind of anxious about the whole process but am also super excited to be learning something completely new, doing this for myself and my family, and for what it will all look like down the road....

Right now I am a beginner at HTML, CSS, and JavaScript. I feel pretty strong maneuvering HTML and CSS but need a-lot of work with JavaScript. I have been fiddling with HTML and CSS on my wife's Shopify page and that has felt pretty amazing actually understanding what I'm doing- mostly. 

So to future me...I promise to stay dedicated, curious, and excited: for me, my family, my future.
How to secure DNS in the cloud? Understanding Cloud DNS security approaches
Tags: cloud, cloudskills, dns
Published: 2022-08-08 16:32:16

Hi all, I just wrote a short piece on how securing DNS in the Cloud ( such as Azure, but also AWS and GCP ) compares to DIY or rolling your own DNS. It also covers some stats I found on DNS latency https://sysdig.com/blog/dns-security-cloud-protection/

A bit high level, aimed at security architects wanting to learn more about securing DNS in the cloud. Hope you like it!
Why i use Arch other than any Linux distribution and you should NOT as a noob ?
Tags: linux, productivity, programming, discuss
Published: 2022-08-08 16:16:49

## First of all, why even Linux <?>
If you have been using computers enough, you seem to have no reason to switch a whole new operating systems.
There might be some reasons.
- Windows just works, Which is true.
- Linux just seems too much learning!
- I'm comfortable with windows, thanks!

Today i want to share few things with you guys that changed from introduction of Linux in my programming career.

Let's be straight here, Linux is cool. When you see someone using it you already assume he must be a genius. All those terminals open on the screen, text running through it.
But in reality all hes doing is just running update commands or cmatrix[A matrix effect on the terminal].

The thing is, you can also it.

> linux is not hard.

You don't have to star hard. Thats what i have seen people do while moving new to linux.
They want to run Arch linux on the first go because they want the best distro.
No doubt Arch is the distro to go for but its too early for that. Getting an idea on what your going in is important.
Learning how things work is important.
Knowing the new environment is what should be the goal. 

If you want to get in, without having to know anything about linux.
Just get a Ubuntu installed. and use it.
Use for chilling, browsing web. get use to the new environment. And trust me once you get it, you dont wanna look back to windows.

And about the command line.
I'll say once you get the linux environment you'll learn the tools too.
Just be patient and relax. Relax with linux and you will not need to learn it.

Thanks for reading !
Minimum Insertion steps needed to make a string palindrome (Same as LCS)
Tags: java, algorithms, dynamicprogramming
Published: 2022-08-08 16:15:46

**Problem**:
Given a string `s`. In one step you can insert any character at any index of the string.

Return the minimum number of steps to make s palindrome.

A Palindrome String is one that reads the same backward as well as forward.

 

**Example 1**:

```
Input: s = "zzazz"
Output: 0
Explanation: The string "zzazz" is already palindrome we don't need any insertions. 
```
**Solution**:
**Tabulation approach**
Time complexity : O(n*m), space complexity : o(n*m) for `dp` array
```java
class Solution {
    public int minInsertions(String s) {
        //going with the hint given 
        //i.e. finding length of the longest palindromic subsequence x
        //now , s.length()-x = n ,so n insertion are needed to make the entire string as palindromic string
        String r = new StringBuilder(s).reverse().toString();
        int dp[][] = new int[s.length()+1][r.length()+1];// 1 based indexing
        for(int i =0;i<=s.length();i++){
            dp[i][0] =0;
            dp[0][i] =0;
        }
        for(int  i =1;i<=s.length();i++){
            for(int j=1;j<=r.length();j++){
                if(s.charAt(i-1)==r.charAt(j-1)){
                    dp[i][j] = 1 + dp[i-1][j-1];
                }
                else dp[i][j] = Integer.max(dp[i][j-1],dp[i-1][j]);
            }
        }
        return s.length() - dp[s.length()][r.length()];
    }
}
```
Music Monday — What are you listening to? (August 8)
Tags: watercooler, discuss, music
Published: 2022-08-08 16:15:00

_cover image source: [Vidlings & Tapeheads](https://giphy.com/vidlingsandtapeheads/)_

In this weekly series, folks can chime in and drop links to whatever it is they've been listening to recently + browse others suggestions.

If you like talking about music, consider following the org [#music discussions](https://dev.to/music-discussions) for more conversations about music!

{% embed https://dev.to/music-discussions %}

***

So, what have y'all been listening to today? _Note: you can embed a link to your song on most platforms using the following syntax `{% embed https://... %}`._

I look forward to listening to y'all's suggestions! 👂 🎶
CRUD Actions with Turbo Streams and Turbo Frames
Tags: ruby, rails, webdev, beginners
Published: 2022-08-08 16:08:26

Turbo Frames allow predefined parts of a page to be updated on request. Any links and forms inside a frame are captured, and the frame contents automatically updated after receiving a response. Regardless of whether the server provides a full document, or just a fragment containing an updated version of the requested frame, only that particular frame will be extracted from the response to replace the existing content. We will learn how to implement CRUD actions in our rails applications
Github: https://github.com/railsdrill/22-CRUD-Actions-with-Turbo-Streams-and-Turbo-Frames
{% youtube lyHdVajVTGA %}
Iterate over the field of structs and modify the value (Golang)
Published: 2022-08-08 16:01:00

`type CellMetricsEntry struct {
    DRBUEThpDl             interface{}
    DRBUEThpUl             interface{}
    QosFlowPdcpPduVolumeUl interface{}
    QosFlowPdcpPduVolumeDl interface{}
}`

In the above structure there are more than 100 variables, but here I have taken only 4.

in main function I somehow want to iterate over the field and want to modify it, as per my need.

The field values can either be an int32 or float64

How can i iterate over this structure field and modify the value.

I want to achieve something like

`var metric CellMetricsEntry

for (int i=0;i< no_of_elements;i++)//this is pseudo code
{
metric[i]=value//setting  each field of struct in for loop
//the above value I will get from some other application and this may be //either int32 or float64


}`

After setting all the field , I will push it to Time series database (influxdb)
writecellMetrics_db(metric)
Bitovi ESLint Config: Handpicked Rules to Improve Your Code
Tags: opensource, angular, react, eslint
Published: 2022-08-08 16:00:00

Linting is an important step to ensure code quality, and it fits well as an automated process in the development pipeline. Most teams use the default lint configuration provided by their framework, missing opportunities to prevent runtime errors and increase code quality with the extended set of ESLint rules.

Bitovi is happy to announce the [@bitovi/eslint-config](https://github.com/bitovi/eslint-config) and [@bitovi/eslint-plugin](https://github.com/bitovi/eslint-plugin) packages!

In pursuit of greater code quality and better standards for Bitovi's clients and the Community, we carefully handpicked the best ESLint rules and created some of our own to fill existing gaps. We built `@bitovi/eslint-config` upon existing recommended rule sets and selected rules to avoid common pitfalls based on experience with clients and internal projects.

## What’s in Bitovi ESLint Config?

Our ESLint-config package has dedicated Angular and React rule sets, but your project can also benefit from other specific rule sets like RxJS. Here are a few of the Angular set rules included in our ESLint config:

- Keep code clean by removing unused variables - `@typescript-eslint/no-unused-vars`
- Avoid accessibility issues with keyboard navigation - `@angular-eslint/template/no-positive-tabindex`
- Ensure elements with click event bindings are accessible - `@angular-eslint/template/click-events-have-key-events`
- Ensure component classes with click event bindings are accessible - `@bitovi/host-listener-click-events-have-key-events`

Start harnessing the full extent of Bitovi’s recommended ESLint rules by following two short steps.

## 1. Installation

Install the ESLint-config package to get started! Run `npm i -D @bitovi/eslint-config`, which is short for `npm install --save-dev @bitovi/eslint-config`.

## 2. Usage

Once installation is done, you can add any of the [rules provided by @bitovi/eslint-config](https://github.com/bitovi/eslint-config#available-rules) to your project's ESLint config file extends array.

```typescript
  extends: [
    '@bitovi/eslint-config/angular',
  ]
  
  // or, if you only want a specific rule set like RxJS
  extends: [
    '@bitovi/eslint-config/rules/rxjs',
  ]
```

## What’s next?

We plan to add more custom ESLint rules to [@bitovi/eslint-plugin](https://github.com/bitovi/eslint-plugin) package to help your project be more accessible, have a better SEO and Lighthouse Scores, and more!

Interested in learning more? Take a look at our [Roadmap](https://github.com/bitovi/eslint-config/wiki/Roadmap).

Do you have ideas or suggestions? We’d love to hear about them. You can [open an issue at @bitovi/eslint-config repository](https://github.com/bitovi/eslint-config/issues).

If you have any questions, let us know in our [Community Slack](https://www.bitovi.com/community/slack)!
Hick's Law
Tags: ux, tip, tutorial
Published: 2022-08-08 15:52:00

### Hick's Law Origins

> Hick’s Law (or the Hick-Hyman Law) is named after a British and an American psychologist team of William Edmund Hick and Ray Hyman. In 1952, this pair set out to examine the relationship between the number of stimuli present and an individual’s reaction time to any given stimulus. As you would expect, the more stimuli to choose from, the longer it takes the user to make a decision on which one to interact with. Users bombarded with choices have to take time to interpret and decide, giving them work they don’t want.

---

### Hick's Law Definition 

The time it takes to make a decision increases with the number and complexity of choices.


![Law](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zwhio6mbpn1xav9h3fmz.jpg)

---

### Hick's Law Formula

RT = a + b log2 (n)

Where 
"RT" = Reaction Time
"(n)" = Number of Choices
"a" & "b" = arbitrary measurable constants that depend on the task that is to be carried out and the conditions under which it will be carried out.

---

### Summary Points

- Reduce the number of choices to get a faster Decision.
- Minimize choices when response times are critical to increase decision time.
- Break complex tasks into smaller steps in order to decrease cognitive load.
- Avoid overwhelming users by highlighting recommended options.
- Use progressive onboarding to minimize cognitive load for new users.
-  Keep a balance between reducing complexity and oversimplifying.
- Smaller steps makes people more Comfortable.
- Use the highlighting to help users to avoid overloading and to make a choice quicker.

---
v0.9.0 update of the Qdrant engine went live
Published: 2022-08-08 15:49:00


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

Qdrant has released the new version vector similarity search engine - v.0.9.0. It features the dynamic cluster scaling capabilities. Now Qdrant is more flexible with cluster deployment, allowing to move shards between nodes and remove nodes from the cluster.

v.0.9.0 also has various improvements, such as removing temporary snapshot files during the complete snapshot, disabling default mmap threshold, and more.

Read more in the change log by this link https://github.com/qdrant/qdrant/releases/tag/v0.9.0

The next release will include frequently requested functionality. Stay tuned!
Spread dos ativos CPL3 x CPLE6
Tags: python, datascience, beginners
Published: 2022-08-08 15:46:09

Fiz um levantamento do Spread do primeiro semestre de 2022 dos ativos CPLE3 x CPLE6 tanto da abertura quanto do fechamento do pregão.

Com esses dados é possível ver a variação de preço entre os dois ativos, indicando que por muitas vezes pode ser vantajoso fazer a troca do ativo e depois voltar para a posição antiga, tendo uma % de lucro na operação que pode ser revertida em aquisição de mais ações.

Pretendo fazer esse levantamento trimestral e ao final de cada ano, consolidar os dados do ano todo em um único arquivo.

Sempre bom ressaltar que os cálculos quanto a taxa de corretagem e demais taxas da B3 varia de corretora para corretora e do valor negociado, logo esses valores devem ser calculados por cada um antes da tomada de decisão.

https://www.kaggle.com/datasets/joofernando/spread-cple3-x-cple6-1s2022
How to load local fonts in NextJS (Optimal way)
Tags: nextjs
Published: 2022-08-08 15:44:00

This is my solution to load custom local fonts in NextJS.

Add the font on the /public folder. woff2 extension is good enough as you can see on [caniuse](https://caniuse.com/?search=woff2)

PS. If you have a [problem regarding vertical alignment](https://stackoverflow.com/questions/21580059/text-is-not-vertically-centered), make sure to use [this awesome tool](https://transfonter.org) to fix it. Just load the font and select "fix vertical metrics". Then use this new font instead.

Import the font with CSS @font-face like below:
```css
@font-face {
  font-family: 'Bebas Neue';
  src: url('/fonts/BebasNeue/BebasNeue-Regular.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}
```

Optimize the font by preloading it. Add the snippet below on _Document file:
```jsx
<link
  rel="preload"
  href="/fonts/BebasNeue/BebasNeue-Regular.woff2"
  as="font"
  crossOrigin=""
/>
```

PS. It's not needed to add any caching mecanism. Nextjs takes care of it for static assets. More details [here](https://nextjs.org/docs/going-to-production#caching)

Make sure to test it on different browsers (safari, chrome, firefox and edge) with [lambdatest](https://app.lambdatest.com/console/realtime/browser) for example.

References:
https://leerob.io/blog/fonts
https://github.com/vercel/next.js/discussions/25389
Fix a resource locations organisation constraint while deploying Google App Engine with Docker based Application
Tags: gcp, appengine, docker, resourcelocation
Published: 2022-08-08 15:32:00

## The case

You want to deploy a Google App Engine Docker based Application (`gcloud app deploy`) but your organization enabled the resource locations constraint and you've quickly encountered the following message : 

> 'us' violates constraint ‘constraints/gcp.resourceLocations’

or maybe it was _'eu'_ instead of 'us'

For example, my organization wants to target only _low CO2_ :seedling: identified regions.



## Reason

:bulb: This is because neither _'us'_ nor _'eu'_ multi-region groups are present in your `constraints/gcp.resourceLocations` organization policy.
To check the complete list, go to the Google Cloud console, in _IAM an admin_ menu and in _Organisation Policies_, look for the `constraints/gcp.resourceLocations` policy and find what are the allowed ones :white_check_mark:.

Because for a multi-region groups, not all the individual region are _low CO2_ ones, my organization cannot allowed the groups.

## Solution

The solution is to specify in which region our container registry should be. But the service Google Container Registry doesn't provide this option. 
Luckely :four_leaf_clover:, Google provides and recommands another service [Artifact registry](https://cloud.google.com/artifact-registry/). In the meantime, you should also drop the Google Cloud Build step in the App Engine deployment process by giving the `--image-url` argument as described (here)[https://cloud.google.com/artifact-registry/docs/integrate-app-engine]

Your new process to deploy is : 

1. Create an Artifact registry repository : https://cloud.google.com/artifact-registry/docs/repositories/create-repos#create
2. Build and tag the Docker image with the following tag name  `[LOCATION]-docker.pkg.dev/[PROJECT-ID]/[REPOSITORY]/[IMAGE]:[TAG]`
3. Deploy your application with `gcloud app deploy --image-url=[LOCATION]-docker.pkg.dev/[PROJECT-ID]/[REPOSITORY]/[IMAGE]:[TAG]` 

You can always configure the App Engine runtime environment with an `app.yaml` file but the Dockerfile will be ignored in the deployment process

I hope this could help some of you :satisfied:
Ball Catcher: Part 2 | Create a hard real-time system, across multiple electronic boards with Luos
Tags: opensource, microservices, tutorial, luos
Published: 2022-08-08 15:30:41

New video on the ball catcher! Discover episode 2

In this video, we’ll create the drivers for the sensor and solenoid, then we’ll get them to hit the ball, using Python.

{% embed https://www.youtube.com/embed/DPsEWQ1Yol4 %}

We’ll also integrate the project with a mechanical setup.

This video is the second in a series, explaining the real-time aspect of Luos.
Set Up React JS application with React-Bootstrap and React-Router-Dom
Tags: webdev, react, javascript, beginners
Published: 2022-08-08 15:10:25

Hello,
Today we will create a spring boot CRUD application. In, this example, we are using the MySQL database to store data, to view and manage the data we will use react Js library in the frontend part. For API testing we will use Postman.


 
In this article, We will create a react application, Install some packages like react-bootstrap and react-router-dom. Actually, in this example, we will set up the react application.


 
Before initializing the react application, ensure you have installed the node.exe application on your local machine.


 
Go to a folder, then open the CMD and type:

`npx create-react-app employeecrud`

[Complete Article ](https://codesnipeet.com/spring-boot-crud-example-with-mysql-react-js-part-5/)
How to get a job w/o experience: 8 sec tips ✨
Tags: beginners, webdev, tutorial, programming
Published: 2022-08-08 14:41:00

1. Aim for entry-level positions.
2. Tailor your resume. 
3. Highlight your transferable skills.
4. Emphasize your education and extracurriculars.
5. Build experience by interning, volunteering, or doing it yourself. 
6. Build a network. 
7. Take courses to build in-demand skills.
8. Keep at it and evaluate your tactics. 

Follow @keshavgbpecdel if possible.
෴ Enable ingress with TLS for a service in K8s ෴
Tags: kubernetes, helm, ingress, tls
Published: 2022-08-08 14:17:21

[Enable ingress with TLS for a service in K8s](https://anujarosha.medium.com/enable-ingress-with-tls-for-a-service-in-k8s-5482e94c2d27)
What to expect from HTML/CSS Bootcamps !?
Tags: html, css, javascript, webdev
Published: 2022-08-08 14:11:00

## Generally Web Development bootcamps teaches:

- HTML fundamentals: syntax, elements, images, links, lists, forms, buttons.
- CSS: selectors, classes, ids, attributes, fonts, colors, sizing, positioning.
- Accessible and responsive web design: websites for all and on all devices.
- CSS layout tools: positioning elements with CSS Flexbox and CSS grid.

## And the JavaScript bootcamp covers:

- Programming fundamentals: syntax, variables, operations, loops, functions.
- Data structures: arrays, multidimensional arrays, array methods, objects.
- Algorithms: searching, sorting, reversing, merging, splicing, hashing.
- Object-oriented programming: methods, constructors, prototypes, inheritance.
- Functional programming: terminology, constraints, mapping, filtering.

## Whome to connect on Twitter

Connect with [Keshavgbpecdel](https://twitter.com/keshavgbpecdel)
Connect with [TECH_ED](https://twitter.com/techedcs)
Creating a URL Shortener service in Python Django
Tags: webdev, bitly, python, urlshorteners
Published: 2022-08-08 14:02:01

---
title: Creating a URL Shortener service in Python Django
published: true
date: 2022-08-08 13:57:03 UTC
tags: webdevelopment,bitly,python,urlshorteners
canonical_url: https://jimjunior.medium.com/creating-a-url-shortener-service-in-python-django-ace792632396
---

![](https://cdn-images-1.medium.com/max/1024/1*xSLFY9zJvUIZLMgeZL8vng.png)

URL shorteners have become a popular service on the web. Companies like [bitly](https://bitly.com/) are making great fortunes from them. But sometimes when you want a custom URL you get to pay for the service. So in this tutorial I am going to show you how to build a URL shortener service in Django.

In this tutorial I expect you to be familiar with templates and forms because i wont cover them but instead i will just show you how to pragmatically build create the service in python code.

### Setup

To setup the project, we shall need only one package. django-urlshortner. So lets begin by installing the package using pip. This asumes you have already setup a django project.

```
pip install django-urlshortner
```

After you should add the urlshortner app to your INSTALLED\_APPS in settings.py

### Configuration

```py
INSTALLED_APPS = [
    # ....
    "urlshortner"
]
```

Then you migrate the models to your database

```sh
python3 manage.py migrate
```

Lastly add the routes to your URLConf in your urls.py of your project.

```py
url_patterns = [
    # ...
    path("r/", include("urlshortner.urls")),
]
```

Now you are good to go.

### Usage

The library provides a list of utils to create shortened urls.

To create a short version of a url use the shorten\_url function from urlshortner.utils module

```py
# python3 manage.py shell
from urlshortner.utils import shorten_url

url_route = shorten_url(
    "https://github.com/jim-junior/django-urlshortner",
    is_permanent=False
)

print(url_route)
# >>> 0ee3f0
```

You can now navigate to you the route that you assigned to urlshortner.urls in your URLConf add the returned value att the end of the url. In this case it would be http://localhost:8000/r/0ee3f0/ and this would redirect you to the right URL

Sometimes you want to create a custom URL. For example you want to create a short link for a blog about your new product and you want a url that is easy to remember. You can add this easily by adding the value argument to the shorten\_url function

```py
from urlshortner.utils import shorten_url

url_route = shorten_url(
    "https://myblog.com/blog/2022/10/10/..../my-new-product",
    value="NewProduct"
    is_permanent=False
)
```

You can now navigate to https://localhost/r/NewProduct and It will redirect you

Now that you know how to use the package i think you can intergrate it with you project.

Hope this article was helpful. You can git the project a star on [Github](https://github.com/jim-junior/django-urlshortner) or if you have any idea to add on you can contribute to its [repository](https://github.com/jim-junior/django-urlshortner). And bythaway I am the Author of this library.
# Use Vale Linter in LunarVim
Tags: nvim, lint
Published: 2022-08-08 13:43:37

# Use Vale Linter in LunarVim

## What
Vale is a linter for prose, it's fast and customizable.

## Install & Configure Vale

- Dowloand it's binary from https://github.com/errata-ai/vale/releases.
- Put it in your PATH
- Create a conf file

~/.vale.ini
```
StylesPath = styles

MinAlertLevel = suggestion
Vocab = Base

Packages = Google, alex

[*]
BasedOnStyles = Vale, Google, alex
```

Custom configuration: https://vale.sh/generator/

## Configure LunarVim

- Edit your ~/.config/lvim/config.lua
```
-- -- set additional linters
local linters = require "lvim.lsp.null-ls.linters"
linters.setup {
  { command = "vale", filetypes = { "golang", "go" } },
}

```