teleren/devto huggingface dataset:
How to debug your Go application in VSCode
Tags: go, vscode, dlv
Published: 2022-03-23 02:04:07

I am using VScode as my primary editor of coding, and I feel very excited by the VScode ecosystem. However, when I first used it to debug go application, as the debug settings is not that straightforward, I spent one hour to learn how to setup the debug process with VScode. 

Before you start, it'd better to install the dlv, the go debugger, manually. 

```
brew install dlv
```

Validate your dlv installation. 

```
dlv version
Delve Debugger
Version: 1.8.2
Build: $Id: dbb493ec14d1e7753504d016b1e1ef1665b75b16 
```

Then open VSCode in your root directory of your go project. Usually, in the root directory, you can find your main.go, go.mod, and go.sum files. 

Open your debug settings, which is a launch.json file saved in your code directory of ".vscode". 

Add the following contents:

```
    "version": "0.2.0",
    "configurations": [
        {
            "name": "Launch file",
            "type": "go",
            "request": "launch",
            "mode": "debug",
            "program": "main.go",
            "args": ["arg1", "arg2"]
        }

    ]
}
```

Then you can start your debugging by press "F5" now.
Métodos Virtuais
Tags: poo, oop
Published: 2022-03-23 01:13:34

**O método virtual é um método que tem a opção de ser sobrescrito em uma classe que herda o mesmo de outra classe.**

Por exemplo:

Temos a classe Animal com o método virtual Som

```c#
public class Animal
{
  public virtual void Som() 
  {
    Console.WriteLine("...");
  }
}
```

Ao criarmos uma classe Gato que herda a classe Animal, podemos sobrescrever o método Som() e mudá-la de acordo com a necessidade da classe Gato:

```c#
public class Gato : Animal
{
  public override void Som()
  {
    Console.WriteLine("miau!");
  }
}
```
Classe selada
Tags: poo, oop
Published: 2022-03-23 01:12:10

**Sealed class são usadas quando não queremos que nossa classe seja derivada.**

Por exemplo:

Eu criei a classe Gato e não quero que alguma outra classe seja filha dela, então eu uso o modificador de acesso sealed.

```c#
sealed class Gato 
{
  public virtual void Som()
  {
    Console.WriteLine("miau!");
  }
}
```

Ao tentar fazer como o exemplo abaixo e tentar compilar o código, uma exceção será lançada dizendo que não é possível derivar do tipo sealed.

```c#
class Gatinho : Gato 
{
  public override void Som()
  {
    Console.WriteLine("miauzinho!");
  }
}
```
publish react app to github pages
Tags: javascript, react, github, frontend
Published: 2022-03-23 01:02:11

How to deploy a React app to GitHub pages ? , React pages is a free static website hosting by github

**1- Create New Repo** : Create new github repo , Choose a **username** & add .github.io 

example : **yourname.github.io**

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

**2 - Install github pages dependency** : Install **gh-pages **using the following command

```
npm install gh-pages — save-dev
```
 
**3 - Add Deploy & Homepage scripts** : Add these two lines of code in your **package.json** file 

```
"predeploy": "npm run build",
"deploy": "gh-pages -d build"
```

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

Add Home Page Prop To The Same File : 

```
"homepage": "https://yourname.github.io",
```

**Note replace your name with your git repo name**


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

**4- Deploy Your Static Website** : run npm deploy to deploy your website 

```
npm run deploy
```
Using an Array of strings in a query with Oracle PL/SQL
Tags: sql, plsql, java, springboot
Published: 2022-03-23 00:35:37


![oracle-database](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/fp4g22f6sh1w0w51inai.jpg)

##Oracle Function
In this case we will use a function created in Oracle PL/SQL that receives a string value and return as an array to your query:

```
CREATE OR REPLACE FUNCTION string_to_list (stringParameter IN VARCHAR2,separator IN VARCHAR2 DEFAULT ',')
   RETURN ARRAY_TABLE
AS
   stringValue   	LONG DEFAULT stringParameter || separator;
   dataToReturn 	ARRAY_TABLE := ARRAY_TABLE ();
   n          		NUMBER;
BEGIN
   LOOP
      EXIT WHEN stringValue IS NULL;
      n                       			:= INSTR (stringValue, separator);
      dataToReturn.EXTEND;
      dataToReturn (dataToReturn.COUNT) := LTRIM (RTRIM (SUBSTR (stringValue, 1, n - 1)));
      stringValue                		:= SUBSTR (stringValue, n + 1);
   EN
```
You can see that the return is a type of _ARRAY TABLE_, this type can be created in this way:

```
CREATE TYPE "ARRAY_TABLE" as table
     of varchar2 (4210)
```
So with this _type_ and _function_ created, you can use your query like this:

```
SELECT * FROM TABLE_TO_SEARCH
WHERE (upper(column_to_search) in (SELECT * FROM TABLE(IN_LIST(upper(:stringParameter)))))
```
Where the _stringParameter_ it's a value like: 
- "Value 1, Value 2, Value 3". 

> The _stringParameter_ is written with ":" because in this case i used the _Dbeaver_ tool.

Sorry for the Queries shown above for not being indented and with the usual colors.
I hope that this can help you like it helped me.

Thanks for reading.
WORKING WITH FILES IN CENTOS8
Published: 2022-03-23 00:15:19


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gtgv8gje0xokzt8b5dt4.jpg)Let's assume you are a junior sysadmin in a company and as part of your on board process, you have been asked to perform some basic tasks in order to check your knowledge of the operating system. You have been asked to perform the following tasks:

1. Find out how many CPU's are in the system and what type.
2. Gather the logs
3. Find out how many users are on the system.

At first, this might look quite challenging, but knowing what commands to use at the right time makes it easier! We are going to walk through each steps together and arrive at the right end!

__Find out how many CPU's are in the system and what type.__

1. Log into the server using the credentials given. You can temporary assume root privilege using the __sudo i__ command. 

2.To know how many cpu's are on the system, use the _cat_ command to print out the content of /proc/cpuinfo. This directory is where you can find all informations related to the CPU. 

3. In order to get the relevant information, use the _head -5_ command. This command shows you the first five lines of the /proc/cpuinfo. 

Alternatively, if there are more than 1 CPU, you can use the _grep_ command like this _grep A 4 processor /proc/cpuinfo_. Adding 'A', tells grep to print four lines after it matches the word 'Processor'.

__Summary of task__

cat /proc/cpuinfo
head -5 > /tmp/cpu
    OR
grep A processor /proc/cpuinfo > /tmp/cpu
'>' tells the system to redirect the result into the file stated instead of printing it out.

__Gather the logs containing today's information__

Let's assume we want information on today's date, we can use the _tail_ command to print out the recent logs from /var/log/messages. Run the following command:
__tail  /var/log/messages__
__grep "Mar 3 " /var/log/messages > /tmp/logs

__Find out how many users are on the system__

To do this, we can use the __wc__ command. This command is use to the lines in a line. To know how many users are on the system, run the following command:
__wc -l /etc/passwd > /tmp/usernum__

Now you see it is not as challenging as it seems from the beginning!

Suggestions on other ways this can be done will be highly welcomed
Arm Gravition Versus X86 on Fibonaci and FFT Running Time
Published: 2022-03-23 00:12:42

### Summary

According to [AWS Graviton2](https://aws.amazon.com/blogs/compute/migrating-aws-lambda-functions-to-arm-based-aws-graviton2-processors/) the Arm Graviton provides 34% better price performance than X86. In some sense, it runs faster 34% compared with X86. So I do a small experiment to check this. AWS CDK and CodeBuild with Arm based instance makes it easy to setup. **So the Graviton does run about 30% faster than X86**. [GitHub](https://github.com/entest-hai/graviton-x86-lambda/blob/master/README.md)

- Runtime Python 3.8
- Numpy 1.22.1
- Lambda memory 2048MB
- Lambda timeout 10 seconds


### CDK Pipeline
CDK make it very friendly to build this pipeline, feeling like pure programming infrastructure. 
![156108554-8f6f728f-cf18-4a08-b0df-2d9773e860aa](https://user-images.githubusercontent.com/20411077/159539715-aabce252-113c-4a07-babf-ae7a0d8b948c.png)

### Running time for Fibonaci
```
def recur_fibo(n):
    if n <= 1:
        return n
    else:
        return(recur_fibo(n-1) + recur_fibo(n-2))
```
n = 30 used for testing. 
![123456](https://user-images.githubusercontent.com/20411077/159539282-5b9b3574-03ea-4f5f-82b2-7a7e302bc0ce.png)

### Running time for FFT single thread
```
data = np.random.rand(8192, 8192)
np.fft.fft(data, axis=0)
```
![single_thread_fft](https://user-images.githubusercontent.com/20411077/159596938-37fb8b83-b98b-4b21-9007-b4b4b97fcc82.png)

### Running time for FFT multi-thread (Lambda memory 10240MB)
```
data = [np.random.rand(8192, 2048) for k in range(4)]
with ThreadPoolExecutor(max_worker=4) as executor:
  for x in data:
    executor.submit(np.fft.fft, x, axis=0)
```
![multi_thread_fft_1](https://user-images.githubusercontent.com/20411077/159552054-3b5b84e7-6b35-4c2a-9332-7801f92d5de4.png)
My Github Android Template
Tags: android, kotlin, github, template
Published: 2022-03-22 23:58:46

---
title: My Github Android Template
published: true
description: Get rid of headaches starting everytime a new project, use a template!
tags: android, kotlin, github, template
//cover_image: https://direct_url_to_image.jpg
---

Starting a new project is always exhausting as you have always to create a lot of boilerplate code, check all the dependencies, etc... It takes time that can be reduced using a github template.

#The idea

This happened to me all the time when I wanted to create a new project on my own and it's something that should have a solution to improve the development speed. That's why I researched on the internet and found some examples about it like [this](https://github.com/cortinico/kotlin-android-template). There were plenty of it but no one fit for me since most of them were oriented to use MVP and I'm more into MVVM. That's why I decided to create [my own template on github](https://github.com/AlvaroFalcon/android-kotlin-template)

#The template

I needed something that would cover all my needs with the latests technologies that I've been using, that's why this starting project is implementing these dependencies:

- Retrofit
- Dagger2/Hilt
- Timber
- Picasso
- Mockito
- JUnit

#The TODO's

Of course this is not complete, it's just a start point where I'd like to expand and mantan, also keeping dependencies up to date. Some of the next points I've planned to address are:

- CI with [Github actions](https://github.com/features/actions)
- A basic [MVVM](https://developer.android.com/jetpack/guide?gclid=Cj0KCQjw5-WRBhCKARIsAAId9FnytlLaZ8ZwZktgudbj-SSj9QYrqBOGZmnAgDDlrpDpU6bdCGnHaJ0aAgIcEALw_wcB&gclsrc=aw.ds) implementation example
- Basic test examples

#The conclusion

I am happy with the results, now I can easily start new projects with my crazy ideas whenever I want in a easy way. There is still a long way to make this template perfect covering all the needs, you're welcome to contribute if you feel something is missing or could be improved!

Hopefully this template will be able to help someone or make it's life easier :)

Also is good to mention that this is my first post and kind of new to blogging so I'd appreciate some feedback.
Difference between Iteration and Epoch in Neural Networks
Tags: python, ai, beginners, datascience
Published: 2022-03-22 23:46:43

**_Epoch_** describes the number of times the algorithm sees the entire dataset whereas an **_Iteration_** tells the number of times a batch of data passed through the algorithm.

For example, consider the input dataset consists of 100,000 records and if we train the model for 10 epochs, let the batch size = 1 i.e loading each data point every time and performing forward, backward propagation for every data point [Optimiser would be the Stochastic Gradient Descent]. Hence, the number of iterations per epoch for the above example would be 100,000 and the total number of epochs would be 10.
Why Invest in Web3 In 2022?
Tags: blockchain, web3
Published: 2022-03-22 23:29:19

Ever ask yourself why you should invest in web3?

## Why Invest?

Getting involved in crypto is more than just buying and holding Bitcoin. 

There are currently more than 11,000 active cryptocurrencies! These currencies and tokens perform a huge number of unique functions for their respective networks. 

Now let's recap the previous versions of the web, so we can understand what Web3.0 should look like.

## Generations of the Web

- Web1: just reading instead of writing content
- Web2: interactivity, creating content on platforms owned by companies
- Web3: interacting on platforms defined by protocols, not owned by a single entity

## Decentralization

A big factor of Web3 is decentralization.
This, combined with the ability to transfer value between accounts, is key to understanding Web3.

Finally, networks that create and hold value are a big part of Web3 as well.
Let's look at some of those projects now

## Some Projects In The Space

- Filecoin: decentralized protocol which enables anyone to rent out spare storage space on their computer.
- Golem: distributed computing platform, providing shared computing power that users can access for a fee.
- BAT: utility token, designed by Brave initially as part of a whole new digital advertising platform, this protocol allows users to commodity their attention and earn directly.

## So why invest in Web3?

Web3 is creating new ways for us to quantify the value of 

- our time
- our attention
- our computers
- our hard drives

Responsible and considerate investing will help support these projects as they realize a new digital future.

## Closing

Thanks for following along! Hopefully, this thread got you interested in learning more about Web3. If that's the case remember to follow me.

This thread is my personal notes summarizing this article: https://decrypt.co/resources/how-to-invest-in-cryptocurrencies-investing-in-web3
SwiftUI Desde Abajo
Tags: espanol, ios, swiftui
Published: 2022-03-22 22:38:19

Estaré publicando sobre la nueva forma de controlar la interfaz de usuario en IOS, para la creación de usuarios de forma declarativa.

Según la documentación SwiftUi, nos ayudara a crear vistas fantásticas para nuestras apps, en sus diferentes plataformas con un poco de código. Mejorando la experiencia a todos nuestros usuarios, solamente consumiendo un par de herramientas y APIs.

Intentare construir una guía a travez de las distintas fuentes, que estado utilizando, como la documentación oficial y el curso de Platzi que me encuentro cursando con el profesor :  [Juan Villalvazo
](https://platzi.com/profes/juanvillalvazo/)

De apoco ire aperturando los siguientes temas 

** Backlog **

* MVVM
* Creando y combinando vistas 
* Entrada de usuarios 

** Escribiendo y investigando **

** LISTO PARA LEER **
Resumo da 3º semana, Jornada DEV 3/52
Tags: javascript, css, beginners, html
Published: 2022-03-22 22:31:05

Essa ultima semana, dei uma pausa logo no começo dos estudos de JavaScript. Segui algumas recomendações e iniciei os estudos de Algoritmo do curso em vídeo, assim como os outros cursos que tenho feito.
Finalizei o curso 2º modulo de HTML5 e CSS3 - [Repositório](https://github.com/bysunshinearts/html-css)
[TIL] Fix: TOO_MANY_REQUESTS/12/disk usage exceeded flood-stage watermark, index has read-only-allow-delete block
Tags: elasticsearch, docker, laravel, mysql
Published: 2022-03-22 21:20:20

> This will be a series of issues that I faced and found a solution for, which could help someone or my future self

I have been facing this issue when I was trying to index data on ElasticSearch 7.* on Docker

Env:
Laravel + laravel scout + El

The error was:
`{"error":{"root_cause":[{"type":"cluster_block_exception","reason":"index [{tableName}] blocked by: [TOO_MANY_REQUESTS/12/disk usage exceeded flood-stage watermark, index has read-only-allow-delete block];"}],"type":"cluster_block_exception","reason":"index [{tableName}] blocked by: [TOO_MANY_REQUESTS/12/disk usage exceeded flood-stage watermark, index has read-only-allow-delete block];"},"status":429}
`

Solution that worked for me:
`curl -XPUT -H "Content-Type: application/json" http://localhost:9200/_cluster/settings -d '{ "transient": { "cluster.routing.allocation.disk.threshold_enabled": false } }'
curl -XPUT -H "Content-Type: application/json" http://localhost:9200/_all/_settings -d '{"index.blocks.read_only_allow_delete": null}'
`

Reference:
https://discuss.elastic.co/t/elasticsearch-docker-flood-stage-disk-watermark-95-exceeded/248479
How to convert a Bootstrap theme to a client-editable Hugo site
Tags: hugo, jamstack, webdev, tutorial
Published: 2022-03-22 21:09:03

---
canonical_url: https://cloudcannon.com/blog/how-to-convert-a-bootstrap-theme-to-a-client-editable-hugo-site/
--- 

Do you want to bring something fresh to your Hugo clients? Or perhaps you want to bring the speed and flexibility of Hugo to non-technical users? Look no further. We’ve launched a new in-depth tutorial over on the [CloudCannon Learn](https://cloudcannon.com/community/learn/) pages!

{% embed https://vimeo.com/689852104 %}

(Yes, that ☝️ is a Hugo site with live editing. It's pretty magical, and it's all thanks to our open-source tool [Bookshop](https://github.com/CloudCannon/bookshop).)

In this tutorial, you’ll learn how to take an existing, MIT-licensed Bootstrap template, convert it into a Hugo theme, and then set it up for client editing and rich page-building with CloudCannon and Bookshop. You’ll also learn the basics of Hugo navigation, data files, and components, as well as some best practices to ensure that non-technical content editors will be able to make the changes they need, without worrying about breaking the site.

The tutorial uses the Megakit template ([see demo here](https://demo.themefisher.com/megakit/)) by the talented team at [Themefisher](https://themefisher.com/). It’s a business-style template with drop-down navigation, blog, a wide range of components and best of all, a clean design that can be adjusted to suit your needs.

[What are we waiting for? Let's start the tutorial.](https://cloudcannon.com/community/learn/bootstrap-to-a-client-editable-hugo-site/)

Once you’ve successfully completed the tutorial for Megakit, you’ll be well placed to take any Bootstrap template and convert it to a Hugo theme. Configuring the template for CloudCannon and Bookshop adds a huge amount of extra functionality for non-technical content editors, including the ability to browse through a component library for page-building, and live rendering for instantly intuitive visual editing.

Plus, with CloudCannon all of your site files are stored in your Git repository, with data, Markdown and HTML files editable by content editors, and developer-defined staging and publishing workflows for specific client needs.

Find more [Bootstrap themes from Themefisher](https://themefisher.com/free-bootstrap-templates/), and bring them to Hugo today!
Needs Opinion in Selling My Website
Published: 2022-03-22 21:05:54

Today, I am writing this post because i need some thoughts from the peoples like you friends.

Actually, I am a fullstack developer and loves to do coding and writing posts and tutorials in my free time. I also likes to do some researches related to website development, app development etc. I loves to do coding in PHP, MySQL, ReactJS, Angular, Ionic, Laravel, Wordpress, Web Services, Servers etc.

I am running my website [readymadecode.com](https://www.readymadecode.com/) from Sep 2020. I loves my website because i have gave most of my time to this website and still i am giving my time to this website. I have did everything in this website. And you can check the results of this website by visiting this website.

But my friends i am doing my full time development job and now i am unable to give time to my this website. So, i am thinking that i should sell my this website to someone, who takes interest to this website. I can tell you if you takes this website this will really help you alots in future.

You can contact me [here ](https://www.readymadecode.com/send-query/) if you wants this amazing website.

Most important friends what are your opinions about this. Please tell me i will definitely follow your precious opinions.

**Thanks:)
Happy Coding:)**
Kafka Architecture : Synchronous to Asynchronous [3]
Tags: kafka, architecture
Published: 2022-03-22 20:46:18

Today, in this last part we will see the best solution about how you can use Kafka to have communication between synchronous applications and asynchronous applications!

---

## Solution 3 : Modify your architecture to full asynchronous

> *Wait? What?! You are talking about the best solution to make communicate a synchronous application with an asynchronous one, then you talk to change everything?!*

Exactly! As we saw in the two last examples, there's no optimal situation to let communicate a synchronous app with an asynchronous service using kafka.

So a solution to be sure to avoid all these issues is to have a complete asynchronous architecture. By using callbacks for example.

---

### Example
![Callback schema](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/a47a38yjiyq3ud4n6khh.png)

Your consumer must give you a callback URL and then when an instance of the API receive the response, it can answer!

---

### Pros & cons

|Pros|Cons|
|---|---|
|Avoid issues Syncho <-> Asynchro|Your consumer must support the asynchronous architecture|

So it's definitively the solution which will need the most work. But depending your context, it can be the best solution for you.

---

I hope you like this mini-serie and it helps you. 🍺

---

<center><h3>You want to support me?</h3></center>
<a href="https://www.buymeacoffee.com/mxguilbert7" target="_blank"><img src="https://cdn.buymeacoffee.com/buttons/default-orange.png" alt="Buy Me A Coffee" height="41" width="174"></a>
Hindi OCR in C# and .NET
Published: 2022-03-14 04:19:38

---
canonical_url: https://ironsoftware.com/csharp/ocr/languages/hindi/
---

_Other versions of this document:_

- [हिंदी में](https://ironsoftware.com/csharp/ocr/languages/hindi-hi)
- [125+ More OCR Languages](https://ironsoftware.com/csharp/ocr/languages/)

IronOCR is a C# software component allowing .NET coders to read text from images and PDF documents in 126 language, including Hindi.

It is an advanced fork of Tesseract, built exclusively for the .NET developers and regularly outperforms other Tesseract engines for both speed and accuracy.

## Contents of IronOcr.Languages.Hindi

This package contains 40 OCR languages for .NET

- Hindi
- HindiBest
- HindiFast

## Download

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

## Installation

The first thing we have to do is install our **Hindi** OCR package to your .NET project.

`PM> Install-Package IronOCR.Languages.Hindi`

## Code Example

This C# code example reads Hindi text from an Image or PDF document.

**C#:**
```cs
//PM> Install-Package IronOcr.Languages.Hindi
using IronOcr;
var Ocr = new IronTesseract();
Ocr.Language = OcrLanguage.Hindi;
using (var Input = new OcrInput(@"images\Hindi.png"))
{
    var Result = Ocr.Read(Input);
    Var AllText =  Result.Text
}
```

**VB:**
```
'PM> Install-Package IronOcr.Languages.Hindi
Imports IronOcr
Private Ocr = New IronTesseract()
Ocr.Language = OcrLanguage.Hindi
Using Input = New OcrInput("images\Hindi.png")
	Dim Result = Ocr.Read(Input)
	Dim AllText As Var = Result.Text
End Using
```
Hello K8s folks! Check out this easy way to see mTLS traffic in a K8s cluster that also uses Istio!
Tags: programming, kubernetes, microservices, webdev
Published: 2022-03-22 20:06:22

Here is a blog post by UP9 addressing the topic. https://up9.com/gain-visibility-into-istio-mtls-traffic-with-mizu

or visit the open source page on (www.getmizu.io)