teleren/devto huggingface dataset:
I don't know, now what? A beginner's mind and the scientific method
Tags: beginners, programming, productivity
Published: 2022-07-31 19:22:51

It’s one thing to have openness, but it’s another to be productive while doing so.

The problems that you encounter in software are as innumerable and random as the placement of the stars in the sky. Many folks will over-emphasize the science of software and become rigid with numbers, proof, and evidence in order to work through the problems. Meanwhile some people resort to the art of software and find themselves using instincts for how they solve problems.

Neither of those is inherently wrong. But they also are not always correct. And it’s this dichotomy that presents itself in software and very few other crafts, that makes it uniquely fitting for the mindset of [“I don’t know, let’s find out together”](https://newsletter.attainable.engineer/p/dont-go-it-alone?r=1grfum&s=w&utm_campaign=post&utm_medium=web). Some may consider this a recasting of the beginner’s mindset. Others may identify this as scientific method, and that is why it is such a perfect tool for us to improve our daily experiences building software.

To read more, signup for the Attainable Newsletter:

{% embed https://newsletter.attainable.engineer/embed %}

To read this article: 

{% embed https://newsletter.attainable.engineer/p/i-dont-know-now-what?r=1grfum&s=w&utm_campaign=post&utm_medium=web %}
Concurrent file compression
Tags: go, showdev
Published: 2022-07-31 19:09:57

Hey folks, I wrote an article exploring the performance implications of compressing data on multiple threads.
{% embed https://medium.com/@cheikhhseck/concurrent-file-compression-c76ebc968446?source=friends_link&sk=a8b82f9ffe8ecae2969856649643927b %}
Tkinter How-To's
Tags: webdev, python, beginners, tkinter
Published: 2022-07-31 19:03:23

# Tkinter Python
### A Python Package
---

# The Story

If your like me, and just started using Python. You will eventually need to use some kind of User Interface. Now there are some really good User Interfaces out there like PyQt, QtDesigner to name a few. But I stumbled onto Tkinter. 

But there's a clause to this, you must know some python for Tkinter. As it can be very intimidating when you first use it. I searched hi and low for Tkinter Tutorials on YT. But felt YT was lacking in that department. 

# Until..

I came across [Tkinter Hub](https://www.youtube.com/channel/UCHCqnq9zF5prz7gcN3SW7lA) Randomly and boy, does this person have it together. And he doesn't talk as much, only as needed. Like they talk ONLY when things do not look right or can pose a problem. I absolutely love this channel because they get straight to the point, no fluff, no got my merch 2min spill, no sponsor junk. This channel doesnt even ask for the "Like or Subscribe". It's almost the norm, to like this great content AND subscribe. Because you would be a real fool NOT to subscribe!

They are doing what they feel is best, and by god I love this simplicity! I feel like everyone working with Tkinter and Python should do the same by looking at his content and subscribing! These tutorials are 100% quality!

Of course I wasn't paid for this post, I did it out of the kindness of my heart. With over 200 subs, I feel they need more love then what they get. 

Thank you [Tkinter Hub](https://www.youtube.com/channel/UCHCqnq9zF5prz7gcN3SW7lA)!!

-J
Length of longest common substring
Published: 2022-07-31 18:57:43

Given two strings. The task is to find the length of the longest common substring.


**Example 1**:

```
Input: S1 = "ABCDGH", S2 = "ACDGHR", n = 6, m = 6
Output: 4
Explanation: The longest common substring
is "CDGH" which has length 4.

```

Usual longest common subsequence will require slight modification
because we are trying to find consecutive sequences that are matching.
so, `dp[i][j] = 1+ dp[i-1][j-1];` if char at index `i` and `j` matches in both the strings.

[For more clarity refer this link](https://www.youtube.com/watch?v=_wP9mWNPL5w&list=PLgUwDviBIf0qUlt5H_kiKYaNSqJ81PMMY&index=28)

```java
//User function Template for Java
class Solution{
    int longestCommonSubstr(String S1, String S2, int n, int m){
         //we will use same approach that we used in longest common subsequence
         //with slight modification
         int dp[][]   = new int[n+1][m+1];// 1 based indexing
         //base cased
         //since its 0 based indexing first row and first column will have 0 values
         //top down approach
         for(int i =0;i<=n;i++){
             dp[i][0] = 0;
         }
         for(int j=0;j<=m;j++){
              dp[0][j] = 0;
         }
         int ans = 0;
         for(int i=1;i<=n;i++){
             for(int j =1;j<=m;j++){
                 if(S1.charAt(i-1)==S2.charAt(j-1)){
                     dp[i][j] = 1 + dp[i-1][j-1];
                     ans = Integer.max(dp[i][j],ans);
                 }
                 else dp[i][j] =0;
                 
             }
         }
         return ans;
    }
   
}
```
AutoScalling and Load Balancers
Tags: aws
Published: 2022-07-31 18:46:22

# Load Balancers

Generally when the load on the server increases and the server get request beyond its capacity then we see server down.
For example earlier when we go to the bank most of the time we see there is the server down, this happens because the server gets much more requests there its capacity.

To solve this problem aws provided a solution of Load Balancer.

- Load Balancers is a device that acts as a reverse proxy and distribution of network or application traffic across no of servers.

- It helps to increase the capacity and reliability of the application.

- It helps to distribute the traffic equally among the servers.
- It uses Round Robin algorithms.

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

Benefits of Load Balancer
- Scalable
- Redundancy
- Flexibility
- Efficiency

# Autoscalling

- It is an AWS computing service that automatically scales up or scales down compute resources as per their actual usage.
- It ensures the availability of ec2 instances to handle the load of an application.
- It can create and terminate an ec2 instance when required.

Scale-out 
- this is a process of launching an ec2 instance via launch configuration or instance template as per your policy

Scale-in
- this is the process of terminating an ec2 instance as per your policy made.
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xc256q5qyhn8w1f8uyx6.png)
Hi guys need small help with svelte kit
Tags: javascript, svelte
Published: 2022-07-31 18:34:31

I am trying to insert a variable in my api to do a detailed search in this url. I understand that to use variables we need to put the dollar sign IN front of the variable but it is not working for me. I am new to sveltekit therefore i am not sure how to work this.
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0m630zyzvlfh7h4sj8cw.png)
What is an invisible character?
Tags: javascript, webdev, programming, beginners
Published: 2022-07-31 18:30:00

An [Invisible character](https://technolife.edublogs.org/2022/07/27/case-study-about-invisible-character/), as the name suggests does not appear on the screen instead a blank space appears in its place. People commonly call it an empty character or blank space, invisible letter and hidden text, etc.

It is usually a blank Unicode character or text type such as U+0020, U+00A0, U+FEFF, etc. Unicode stands for the universal coded character set. It contains more than 10,000 characters including characters of various languages. 

Why use an invisible text generator?
With this tool, you can easily send an empty message, either on a website or a mobile application.

Simply copy the blank space by clicking Copy to Clipboard button and paste invisible text or blank characters.

No Installation
There is no need to download and install any software to generate empty letters. 
Our tool requires no installation or signup process to generate invisible characters.

Copy-Paste Empty Text
This feature helps you to send or show empty characters wherever your browser does not allow it.
It generates invisible text and allows you to copy and paste it anywhere without any hurdle.
Diving into blockchain as a beginner: part 2 extended
Tags: web3, blockchain, beginners
Published: 2022-07-31 18:27:00

[First part here](https://dev.to/rabibsust/diving-into-blockchain-as-a-beginner-4pi2)
[Second part here](https://dev.to/rabibsust/diving-into-blockchain-as-a-beginner-part-2-4h63)

Hello again!

In the last part we were just focusing on what the blockchain is. But now we will focus more on how blockchain really works.

---

As we know from before Blockchain is a decentralized network. So there is no central authority responsible to manage and maintain this data. Instead this data is distributed or we can say copied to the nodes participating in this network.

---
Blockchain is a network of joined or linked blocks. The first block is called the genesis block which is hardcoded and not dependent on any other blocks. Each blocks except the genesis block is dependent on the previous block.

![Blocks](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/99prp8m3a5brgm2jje9p.jpeg)

From the top figure we found that all the blocks are linked and dependent to previous blocks.

![Working Blockchain](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/h927uigxa3rh607hta08.gif)

From the top animation we can see that the 4th block is dependent on 3rd block, 3rd block is dependent on 2nd block. It goes onwards. From this we can understand that the 4th block is dependent on all previous blocks.

In order to add a block, a hash has to generate for the block. Hashing is a cryptographic process that can be used to validate the authenticity and integrity of various types of input. It is widely used in authentication systems to avoid storing plaintext passwords in databases but is also used to validate files, documents, and other types of data.

Let’s assume that we have three blocks with some transactions stored in them. To link these blocks, every block is assigned a unique hash ID that is generated using the data present in that block. So when someone tries to modify a block, the hash ID of that block changes as well.

Now, the hash ID of the first block is stored in the second block. And the hash ID of the second block is stored in the third block. This process is repeated for all the subsequent blocks. Thus, we have a chain of blocks referred to as the “blockchain”.

Now say I want to change the data on the second block, then we have to change the data on 3rd and 4th blocks. Otherwise the later blocks will be invalid. Because they are dependent on this previous block.

Thats why changing the data of any block is very expensive and difficult to acheive. It actually cannot be changed or reversed. Thats why it is called immutable.

The paritipating nodes/blocks manages the blockchain network. So if any block tries to change the data then the modification has to be validated by other blocks. If other blocks find out the modification is incorrect then they will reject it. Sounds simple right?

![Immutable Blockchain](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/li14cgy5si8cioq811go.jpeg)

I will try to get some understanding about solidity and Ethereum in next part. See you there!
TocamelaMadriz
Tags: map, leaflet, petproject, opensource
Published: 2022-07-31 17:56:00

(tengo por delante 6 horas de bus sin parar y sin comida así que voy a ver si puedo hacerlas más llevaderas escribiendo este post con el móvil)

Hace poco he publicado un nuevo petproject. Viendo la playlist de una amiga donde recogía canciones que hablan de Madrid, la capital de España, se nos ocurrió que sería interesante geoposicionarlas y compartirlo. 

Así por ejemplo, hay una canción que menciona a la Puerta de Alcalá, otra a las Cibeles etc y podríamos hacer una aplicación donde se visualizaran en un mapa y así surgió https://tocamelamadriz.netlify.app

Para ello he organizado la idea en dos proyectos separados: uno destinado a que cualquiera pueda sugerir una canción y un sitio, https://github.com/jagedn/madriz-geocancione, y recopilarlas en un csv y otro que crea un mapa con ellas

El primer proyecto es muy simple. Se trata de mantener un solo fichero csv donde ir añadiendo título, autor, latitud, longitud y URL a la canción (Spotify, Deezer, YouTube ...). Lo "interesante" es que usa una plantilla de GitHub para que cualquiera pueda crear una issue como forma de colaborar

El segundo proyecto, aunque código abierto también, es más técnico. Consiste en una aplicación ( https://github.com/jagedn/tocamelamadriz) NuxtJS desplegada en Netlify con una function encargada de hacer de puente entre la aplicación y el CSV de GitHub (ahora explicaré porqué) y un simple componente de Vue que usa Leaflet para el mapa

La razón de la función lambda de Netlify es que el JavaScript que necesita los datos no puede acceder directamente a él por las restricciones CORS de GitHub así que creamos está lambda que simplemente hace de proxy

Una vez que el componente ha descargado el CSV y que tiene un mapa Leaflet creado "simplemente" le queda convertir este CSV en puntos GeoJSON y pasárselos al mapa

GeoJSON es un formato standard donde se pueden definir puntos, líneas, regiones, etc, realmente muy sencillo, así que la conversión no dejan de ser unas pocas líneas de js

Una vez tenemos el mapa con los puntos nos surgió la idea de poder crear áreas, de tal manera que cada área correspondiera a una canción. Esto es realmente fácil con la librería Turf el cual tiene un método que pasándole una lista de puntos te devuelve un geoJSON con las áreas voronoy correspondientes

Por último aprovechando las características de HTML5 de poder conocer la posición de un navegador (si el usuario concede los permisos) podemos buscar el área más cercana a dicha posición y "volar" directamente a ella

En resumen: tocamelamadriz es mi primera aproximación a librerías de mapa y creo que me queda mucho por investigar y aprender pero con proyectos como este es más divertido hacerlo
Difference between Lodash Concat and Javascript Native Concat
Tags: node, javascript, beginners, tutorial
Published: 2022-07-31 16:41:00

Concat function in Lodash will creates a new array that concat the array with any additional arrays and/or values.
It will not change the original array.

It's easy to use and simple.
Same goes to the Javascript native concat method. But what's the difference between this 2 method?
Well obviously, one is using libraries (Lodash), and another one is Javascript original concatenation.

The syntax also different. BUT, the native Javascript concat win. Let me show you.


{% embed https://gist.github.com/harithzainudin/ff97381208ee383adf4504ea0f9dff52 %}

I've run the test 5 times in a row, with about 1-2 seconds of interval and this is the result

Running Native concat first, then lodash concat

| Test | Native Concat | Lodash Concat | Differences |
| :--: | :-----------: | :-----------: | :---------: |
|  1   |    0.318ms    |  0.179ms ✅   |   0.139ms   |
|  2   |  0.097ms ✅   |    0.16ms     |  -0.063ms   |
|  3   |  0.094ms ✅   |    0.159ms    |  -0.065ms   |
|  4   |  0.094ms ✅   |    0.16ms     |  -0.066ms   |
|  5   |   0.09ms ✅   |    0.158ms    |  -0.068ms   |


Running Lodash concat first and then native concat.

| Test | Lodash Concat | Native Concat | Differences |
| :--: | :-----------: | :-----------: | :---------: |
|  1   |    0.525ms    |  0.009ms ✅   |   0.516ms   |
|  2   |    0.237ms    |  0.008ms ✅   |   0.229ms   |
|  3   |    0.247ms    |  0.008ms ✅   |   0.239ms   |
|  4   |    0.259ms    |  0.008ms ✅   |   0.251ms   |
|  5   |    0.25ms     |  0.008ms ✅   |   0.242ms   |

With obvious result, native javascript concat wins. This is only using small dataset. With big dataset, surely it will tak e more time to process. Although the result is sub-milliseconds, the timing is important to make our apps run faster.

I'm not saying do not use Lodash concat, but hey, if we have already concat method in built with javascript, it's better to use it. Unless you have other reason to use lodash concat function and your applications don't really care about response time. 

Some of Lodash function do actually make our life easier. It is useful and it makes the development much easier and faster as we do not have to implement a complex logic to get the result. So, it is up to you!

We will try to cover up more of the differences between lodash and inbuilt function so that we can have a look later on!

---
Thank you for reading :D 
Psstt pstt :p Do consider to love this article ❤️ and follow me! Why not right? It's FREE~ 
I would really appreciate it 👨🏻‍💻 
Will be posting more on things related to AWS, Javascript, Python, Serverless and more!
How to access private s3 files using URI
Tags: javascript, s3, aws, programming
Published: 2022-07-31 16:11:35

In AWS S3 bucket is mainly used to store files.
To access S3 bucket files follow below steps.
Provide access configuration using AWS.config() method as below.

```
AWS.config.update({
region: "us-east-2",
signatureVersion: 'v4',
credentials: new AWS.Credentials(AccessKey, AccesSecreteKey, token)
});
```
Later intitialize s3 variable using new AWS.S3()

```
var s3 = new AWS.S3();
```
To get access URI of the file we use getSignedUrl() method of s3 bucket Here we have three parameters

**Bucket:Name** of the Bucket
**Key**: Path inside the Bucket
**Expires**: No of seconds the required to enable the URI(maximum 1 week)

```
var presignedURI = s3.getSignedUrl('getObject', {
   Bucket: "Bucket_Name",
   Key: "FIle_Path",
   Expires: seconds
});
console.log(presignedURI);
```
Here presignedURI variable provides the URL,we can access the file using this URL
JAWS DAYS 2021登壇体験談
Tags: jawsug, jawsdays2022
Published: 2022-07-31 16:00:00

**はじめに(Introduction)**

はじめまして。JAWS-UG金沢支部に所属しております松田康宏です。
AWS Community Builderとして、dev.toに初めて投稿します。

[イースト株式会社](https://www.est.co.jp/)という会社にて、[DONGRIという辞書検索サービス](https://www.east-education.jp/products/dongri/)のインフラエンジニアをしています。

私のSNSは以下です。
Twitter: [@matyuda](https://twitter.com/matyuda)
LinkedIn: [yasuhiro-matsuda-31945b13a](https://www.linkedin.com/in/yasuhiro-matsuda-31945b13a/)
Facebook: [yasuhiro.matsuda.100](https://www.facebook.com/yasuhiro.matsuda.100)

今日はJAWS DAYS 2022のお知らせと私がなぜJAWS DAYS 2021で初登壇することになったかについてご紹介します。

**JAWS DAYS 2022とは？**

国内AWSユーザーグループ最大のイベントJAWS DAYSで [10/8(土) に開催されます](https://jawsdays2022.jaws-ug.jp/)。
昨年は3,945人もの参加者の申し込みがありました。

JAWS DAYS 2020、JAWS DAYS 2021はオンラインイベントでしたが、
今回はオンライン＋日本全国のサテライト会場を通じたハイブリッド形式となる予定とのことです。

金沢支部もサテライト会場を設ける予定をしています。
私はJAWS-UG 事務局長としてバックアップしていきます。


**私がなぜJAWS DAYS 2021で初登壇することになったか？**

　実はJAWS DAYSに初めて参加したのがJAWS DAYS 2021でした。
JAWS DAYSはとても大きなオフラインイベントということを聞いてはいましたが
その雰囲気を知ることなくオンラインイベントに登壇することになりました。

　登壇するきっかけになったのは、実行委員メンバーだったからです。
実行委員のメンバーになったのは、当時の実行委員長だった[山口さん](https://aws.amazon.com/jp/developer/community/heroes/masanori-yamaguchi/)からお声がけをいただいたからでした。
[re:Invent](https://reinvent.awsevents.com/)というAWSの年１回の一大イベントに2018年に自腹で参加した際に、ラスベガスの現地で山口さんに初めてお会いして以来、一度もオンラインでお会いしたことはありませんでしたが、オンラインでのハンズオンイベントをさせていただいたりしていたことでお声がけいただきました。

　JAWS DAYS 2021のテーマは re:Connect でした。
私は実行委員メンバーとして、人と人とのご縁によって今の自分があり、JAWS-UGのメンバーの一員として何かお役に立てないかと考え、実行委員を引き受けるとともにセッションにも応募することにしました。

　私は金沢支部のコアメンバーとして、同じ支部の加藤さんをはじめ、札幌支部の小倉さん、学生支部の外舘さん、大分支部の平野さんとともに
[「JAWS-UG支部活動活性化のヒントを得る！」](https://jawsdays2021.jaws-ug.jp/timetable/track-a-1540/)と題してオンラインになって支部活動の抱える課題を４０分間語り続けました。

　ちなみに、小倉さんや外舘さん、平野さんとは、実は今まで一度もオフラインでお会いしたことはありません。
私はモデレータとして登壇しましたが、オンラインで視聴している皆さんが見えなかったにもかかわらず、心臓の鼓動が聞こえてしまうのではないかと思うぐらい、非常に緊張しました。

　よくお会いしている仲のように議論ができたのはJAWS-UGというグループが持つ求心力に他ならないと思います。他のセッションとは異なってまったく技術ネタではない内容でしたが、たくさんの方からご意見をいただくことができました。

　技術ネタではなかったので、登壇することに躊躇しましたが、思い切ってアウトプットすることがとても重要だということを改めて感じました。

皆さんもぜひ思い切って登壇してみませんか？
Configure Aplicações React Usando Arquitetura Limpa com Apenas Um Comando
Tags: webdev, braziliandevs, opensource, react
Published: 2022-07-31 15:36:23

Crie aplicações React usando [Arquitetura Limpa](https://dev.to/rubemfsv/clean-architecture-the-concept-behind-the-code-52do) sem precisar configurar nada.

É como usar o comando create-react-app, mas mais eficiente e mais fácil de escalar. O objetivo é ajudar a ganhar tempo durante o desenvolvimento. 

- [Guia do usuário](https://dev.to/rubemfsv/arquitetura-limpa-aplicando-com-react-1eo0) – Como desenvolver aplicativos criados com Clean React App.

Clean React App funciona em macOS, Windows e Linux.<br>
Se algo não funcionar, [registre um problema](https://github.com/rubemfsv/clean-react-app/issues/new) no repositório.<br>

## Visão geral rápida

```sh
npx @rubemfsv/clean-react-app my-app
cd my-app
npm start or npm run dev
```
Feito. Tudo está configurado e pronto para ser executado!

<hr />

**Este boilerplate contém as seguintes configurações:**
- Adapter para o Local storage;
- Axios como cliente HTTP;
- Webpack configurado para ambientes de desenvolvimento e produção;
- Testes end-to-end básicos configurados com Cypress;
- Testes unitários com Jest;
- Husky com pre-push configurado para rodar os testes unitários;
- Autenticação com validações;
- Camada de validação para reuso das validações;
- Alguns hooks para ajudar com as chamadas da API e submissões de formulários;
- Configurações para rotas privadas;
- Três páginas para ajudar a melhorar a produtividade:
  - Página de Login
  - Página de Sign up
  - Página inicial

## É open source. Sintam-se livres para contribuir!

Link: https://www.npmjs.com/package/@rubemfsv/clean-react-app
Weekly Coding Questions - W4
Tags: dsa, coding, interview, leetcode
Published: 2022-07-31 15:29:00

Here are this week's questions :)

**1) [Number of Zero-Filled Subarrays](https://leetcode.com/problems/number-of-zero-filled-subarrays/)**

For a string of length 'n', no. of substrings that can be formed is equal to `n * (n+1)/2`.

**2) [Design a Number Container System](https://leetcode.com/problems/design-a-number-container-system/)**

Map data structure and try to understand how can we map index and number in an efficient way.

**3) [Equal Row and Column Pairs](https://leetcode.com/problems/equal-row-and-column-pairs/)**

Using map to store the rows and then traversing column wise to increment the count if the same column is present as a row in map.

**4) [Longest Word in Dictionary](https://leetcode.com/problems/longest-word-in-dictionary/)**

Idea is to use try to store all the words in it. So, when we want to determine the max length word whose all prefix are present in the dictionary, we just check for every prefix of that whether its present in the trie or not.
[Link to Solution](https://leetcode.com/submissions/detail/760618043/)

**5) [Top K Frequent Words](https://leetcode.com/problems/top-k-frequent-words/)**

Priority queue and map implementation question nothing much.

**6) [Replace Words](https://leetcode.com/problems/replace-words/)**

Trie problem, search word prefix

**7) [Group Anagrams](https://leetcode.com/problems/group-anagrams/)**

Sorting of words and using map.

**8) [Implement Trie (Prefix Tree)
](https://leetcode.com/problems/implement-trie-prefix-tree/)**

Trie implementation [Link to solution](https://leetcode.com/submissions/detail/759246489/)

**9) [Reverse Linked List](https://leetcode.com/problems/reverse-linked-list/)**

Reversing the linked list using three pointers or using recursion.

**10) [Search Insert Position](https://leetcode.com/problems/search-insert-position/)**

Binary search problem

**11) [Add Two Numbers](https://leetcode.com/problems/add-two-numbers/)**

Normal linked list implementation

**12) [Check if Matrix Is X-Matrix](https://leetcode.com/problems/check-if-matrix-is-x-matrix/)**

Normal matrix question