teleren/devto huggingface dataset:
Configurando o AWS CLI
Tags: aws, tutorial
Published: 2023-07-17 23:43:52


**1- Gerando credencial programática**

- Acesso o console AWS e navegue ate a aba IAM. 
- Crie um novo usuário ou selecione o usuário o qual deseja gerar a credencial programática.
- Caso seja um usuário já existente vá ate a aba **Security credentials**, caso seja um novo usuário, após vá ate o usuário e navegue ate a aba **Security credentials**.
- Navegue ate a opção **Create access key**. 
- Selecione o Use Case e de um _next_.
- De uma descrição para sua Key e em seguia clique em **Create access key**. 

_Pronto, sua credencial esta criada, salve esses dados com bastante cuidado e não compartilhe  os mesmos._

**2.1- Configurando a credencial no Linux.**

- Acesse o seu terminal e execute o comando:

`apt-get install awscli`

- Após instalar execute os comandos de configuração:

`aws configure --profile <COLOQUE O NOME QUE VOCE QUER PARA SEU PROFILE>`

- Em seguida será solicitado que responda os dados da sua credencial.
 
`AWS Access Key ID [None]:<COLOQUE O ID DA SUA KEY>
AWS Secret Access Key [None]: <COLOQUE SUA SECRET ACCES KEY>
Default region name [None]: <COLOQUE A REGIÃO A QUAL IRA TRABALHAR>
Default output format [None]: <PODE DEIXAR EM BRANCO>`

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

- Para usar a credencial configurada basta executar o comando.

`export AWS_PROFILE=<NOME DO PROFILE QUE FOI DEFINIDO NAS CONFIGURAÇÕES>`

_Pronto, sua credencial já esta configurada no seu Linux._

**2.2- Configurando a credencial no Windows.**

- Abra o cmd e execute o comando:
`msiexec.exe /i https://awscli.amazonaws.com/AWSCLIV2.msi`

- Será aberto o laucher de instalação, apenas clique em Next e aceite os termos, next novamente e install. 
 
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/fejw19nkhzdqj7dwugcv.png)

- Após a instalação, feche o cmd e abra-o novamente, e execute o comando:

`aws configure --profile <COLOQUE O NOME QUE VOCE QUER PARA SEU PROFILE>`

- Em seguida será solicitado que responda os dados da sua credencial.

`AWS Access Key ID [None]:<COLOQUE O ID DA SUA KEY>
AWS Secret Access Key [None]: <COLOQUE SUA SECRET ACCES KEY>
Default region name [None]: <COLOQUE A REGIÃO A QUAL IRA TRABALHAR>
Default output format [None]: <PODE DEIXAR EM BRANCO>`

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

- Para usar a credencial configurada basta executar o comando.

`setx AWS_PROFILE <NOME DO PROFILE QUE FOI DEFINIDO NAS CONFIGURAÇÕES>`

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

_Pronto, sua credencial já esta configurada no seu Windows._
Alexei Wells Photography: London Wedding Photographer
Published: 2023-07-17 23:29:04

A wedding is the day when the most romantic fantasies of lovers come true. Nearby are the closest, those whom you trust to share happiness. I want to remember every moment, tears and smiles, gentle touches and passionate hugs. It's so precious to carry the memories through the years. [Alexei Wells Photography: London Wedding Photographer](https://alexeiwellsphotography.com/) with his work, he destroys the power of time and preserves unique impressions.

It doesn’t matter what kind of wedding you have - a big or just a few guests, glamorous or modest, in the vicinity of London or very far away - if it is important for you to keep the memories of this day in a beautiful reportage, please contact us!
Manage Your Files with a New UPDATE 1.1
Tags: tooling, programming, news
Published: 2023-07-17 23:27:23

Some **Updates** about the **1.1 alpha** of myFile:

![sreenchot](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/nms1ts3zkcejeo0a67a4.png)
- First, you can now **select multiple files by pressing "left shift"**, the file will be selected. Unfortunately you can't unselect a file right now. Sorry... ( ╥ω╥ )
- Second, you can now **listen to ".wav" and ".mp3" files** :p but the wave in the content frame is not finished. (＞﹏＜)
- And finally, **I added more icons to icons.png**.

**Download link** https://blueberry077.itch.io/myfiles

PS: I wanted you to know that the project is not abandoned (◕‿◕)
Funções e Variáveis do JS
Tags: javascript, variable, development, function
Published: 2023-07-17 23:02:46

Vamos falar um pouco sobre variáveis e funções do JavaScript, dois assuntos que são de extrema importância para o nosso mundo. Vamos lá:

_**Variáveis em JavaScript:**_

1. Variáveis são usadas para armazenar dados em um programa JavaScript. Elas agem como caixas que contêm valores.

2. Para criar uma variável, usamos a palavra-chave **var**, **let** ou **const** (a partir do ES6).

- **var**: Era a forma tradicional de declarar variáveis, mas tem algumas peculiaridades no escopo que podem causar problemas. Não é muito recomendado o uso atualmente.

- **let**: Introduzida no ES6, é preferível ao var, pois possui escopo de bloco e não cria problemas de "hoisting" (içamento).

- **const**: Também introduzida no ES6, é usada para declarar constantes que não podem ser alteradas após a atribuição.
Exemplos de declaração de variáveis:

```
// Variável usando 'let'
let idade = 30;

// Constante usando 'const'
const idade = 30;
```

_**Funções em JavaScript:**_

1. Funções são blocos de código que podem ser chamados para executar uma tarefa específica.

2. Elas permitem que você agrupe instruções e as reutilize sempre que necessário.

3. Para declarar uma função, usamos a palavra-chave function seguida do nome da função e dos parâmetros entre parênteses.

4. Exemplos de declaração de função:

```
// Função sem parâmetros
function padrao() {
  console.log("Hello world");
}

// Função com parâmetros
function somar(a, b) {
  return a + b;
}
```

**_Chamando funções e usando variáveis:_**

1. Para chamar uma função, usamos o nome da função seguido por parênteses.

2. Se a função tiver parâmetros, passamos os valores que desejamos usar dentro dos parênteses.

3. Podemos armazenar o resultado de uma função em uma variável para reutilizá-la posteriormente.

4. Exemplos de uso de funções e variáveis:

```
// Chamando a função 'saudacao'
padrao(); // Saída: "Hello world"

// Chamando a função 'somar' e armazenando o resultado em uma variável
let resultado = somar(5, 3);
console.log(resultado); // Saída: 8
```

Espero que esse resumo ajude você a saber um pouco sobre variáveis e funções em JavaScript de forma simples. Lembre-se de que praticar e criar pequenos projetos para aplicar esses conceitos ajudará no aprendizado. Vou deixar abaixo lugares que você pode estudar sobre JavaScript, bons estudos.


- [Codewars (https://www.codewars.com/)](url)

- [freeCodeCamp (https://www.freecodecamp.org/)](url)

- [Codecademy (https://www.codecademy.com/)](url)
用 LangChain 構建基於資料庫的問答機器人（二）：從資料源中提取文本信息
Published: 2023-07-17 23:00:00

大家好，我是學生大使 Jambo。這個系列的目標是做出一個根據資料回答問題的機器人，那麼從資料源中提取文本信息就是一件必要的事。但我們的資料源格式是多樣的，比如 PDF、Word、HTML、PPT 等等，甚至有的資料源來自於網絡，這些格式都不能直接提取出文本，但好在 Python 有很多第三方庫可以幫助我們提取文本信息，並且 LangChain 也幫我們整合到了一起，我們只需要調用 LangChain 的接口就可以了。

我在公開網絡上找到了一份 PDF 格式的合同，我們就以這份合同為例，介紹一下如何提取文本信息。

# 文本提取


LangChain 針對 PDF 包含了許多第三方庫，比如 `PyPDF2`、`PyPDFium2`、`PDFMiner` 等等，這裡我們以 `PyPDF2` 為例，介紹一下如何提取文本信息。

```bash
pip install pypdf
```

我們使用 `PyPDFLoader` 來加載 PDF 文件，然後調用 `load` 方法就可以得到文本信息了。 PDF 的讀取器會將 PDF 文件中的每一頁轉換成一段文本，然後將這些文本段組成一個列表返回。

```python
from langchain.document_loaders import PyPDFLoader
loader = PyPDFLoader("./contract.pdf")
documents = loader.load()
```

# 文本分割

但僅僅是按頁進行分割，仍然是不夠的，因為一頁中仍然包含了太多的字數，如果將來將這些文本放在 prompt 的上下文中，會佔據大量的 token，而這些文本對於當下所問的問題不一定都是有用的，所以我們需要將這些文本再進行分割。

LangChain 提供了幾種分割器，可以分割代碼、段落、Markdown 標題。這裡我們使用 `RecursiveCharacterTextSplitter` ，他會把文本按照字符進行分割，直到每個文本段的長度足夠小。它默認的分割列表是 `["\n\n", "\n", " ", ""]`，這樣它可以盡可能把段落、句子或單詞放在一起。

其中 `chunk_size` 限制了每段文本的最大長度。 `chunk_overlap` 則是兩個文本段之間的重疊長度，如果一個段落實在太長而被強制分割成了兩段，那麼這兩段之間就會有一段重疊的文本，這樣可以保證上下文的連貫性。

它還有個參數 `length_function`，用來計算文本的長度，默認是 `len`。如果你想按照 token 的數量來分割，那麼可以結合 `tiktoken` 庫來使用。

```python
from langchain.text_splitter import RecursiveCharacterTextSplitter

text_splitter = RecursiveCharacterTextSplitter(chunk_size=500, chunk_overlap=50)
docs = text_splitter.split_documents(documents)
```

這樣我們就很容易的得到了一個文本列表，而不用考慮具體的分割細節了。

當然，這裡只是簡單的帶大家了解一下 LangChain 的文本提取功能，還有其他很多格式和對應的細節沒有介紹到，比如 Word、HTML、PPT 等等，如果你想了解更多，還是要自己去看看[官方的文檔](https://python.langchain.com/docs/modules/data_connection/document_loaders/)。
smigle
Published: 2023-09-09 19:04:35

---
title: smigle
published: true
date: 2023-07-17 21:51:08 UTC
tags: 
canonical_url: https://themes.gohugo.io/themes/smigle-hugo-theme/
---

smigle-hugo-theme A minimalist theme for the static site generator Hugo. This theme is shared on Hugo’s official collection of themes. Features No JavaScript No Google spyware or tracking of any kind No other external dependencies or comment sections Only one local font (Iosevka) Demo https://smigle-hugo-theme.netlify.app/ Screenshots Installation From the root of your site: git submodule add https://gitlab.com/ian-s-mcb/smigle-hugo-theme.git themes/smigle Updating From the root of your site: git submodule foreach git pull origin main Run example site hugo new site mysite -f yaml cd mysite git init git submodule add https://gitlab.
Difference between Arrow Functions and Regular Functions
Published: 2023-07-17 21:48:28

The first and most obvious difference is the Syntactical difference.
Arrow functions have a type of shorthand that can lead to less lines of code. The use of parenthesis can be ommited. Digging deeper into Arrow functions you will find other differences that can have an effect on the way the code is executed. The execution context is dynamic in a regular function. The execution context in an Arrow function is lexically. This difference has a direct effect on the way the value of "this" is assigned. The value of "this" in a regular function is based on how the funcition was invoked. An Arrow function does not define its execution context resulting in "this being defined in the scope of the function. This difference would make a regurlar function a better choice for methods. The difference in execution context also has an effect when using functions as constructors you can not use an Arrow fucntion as a constructor. This will result in a TypeEror.
Day 784 : Endless
Tags: hiphop, code, coding, lifelongdev
Published: 2023-07-17 21:10:10

_liner notes_:
- Saturday : What a day! Got ready to head to the station and my van wouldn't start. It looks like it could be my battery. I don't drive around much during the week and I think that's draining the battery somehow. The only time I drive is when I go to the station. I'm looking into ways to keep the battery charged during the week. So, I took another car and ran some errands before heading to the station to do the show. It was a good thing that I went to the station, because my co-host sent me a message that they wouldn't be able to make it. That means that we could have not had a show broadcasting on the radio waves and only online. Had a good time. The recording of this week's show is at https://kNOwBETTERHIPHOP.com

![Radio show episode image of the front of the Brooklyn Public Library with Jay-Z lyrics on it and a large blue banner with white text that says The Book of HOV with the words July 15th 2023 Nope. Dope? Yep!](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ewgts3iacaw7qfwttt23.jpg)

- Sunday : Did my study sessions. I was pretty tired from everything that happened on Saturday but still got some stuff done. Got saving and loading data working on my side project. Finished the night watching the new Rurouni Kenshin and Bleach anime episodes.

- Professional : Started off today with a couple of meetings. Spoke with folks about what I've been working on and got some answers that I had at the end of last week. Spent the rest of the day finishing up updating stuff. I think I actually finished everything. It definitely felt like an endless task! haha I'm going to get some folks to look it over to make sure I didn't miss anything. Pretty happy to have this over, possibly.

- Personal : Got loading and saving data from my "backend" working. Next up is to get editing and then updating working. Once I get all the admin functionality worked out, I'll start on the front end. There's a couple of challenges that I can see on the horizon that I will need to tackle. Keeping them in the back of my mind right now.

![View from the shore of a lake with some drift wood close to the shore surrounded by tall pine trees with mountains in the distance in Joffre Lakes, BC, Canada](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5vbeq0q7ph4wdk8skkt9.jpg)

Going to go through some tracks for the radio show. Getting editing and updating working on my side project will be my focus for the rest of the night. Maybe watch some anime before I go to sleep.

Have a great night!

peace piece
Dwane / conshus
https://dwane.io / https://HIPHOPandCODE.com
{% youtube UP0-lWrT_l4 %}
cat coaching in pune
Tags: aiexpertsedge
Published: 2023-07-03 07:29:48

Diverse Levels of Complexity: In order to recreate the atmosphere of the CAT examination, a range of questions with varying levels of difficulty has been carefully chosen. Stcat arting with fundamental concepts, the questions progressively advance to present more challenging and intricate scenarios. By engaging with this assortment of questions, you can cultivate a comprehensive skill set and effectively approach queries of different complexities.

Step-by-Step Solutions and Elucidations: The significance of comprehending solutions goes hand in hand with solving the questions themselves. To facilitate the process of learning, each question in the compilation is accompanied by comprehensive step-by-step solutions and explanations. These elucidations assist in grasping the underlying concepts, techniques, and strategies necessary to efficiently solve the questions. By studying these solutions, you not only gain insights into the specific questions but also develop problem-solving methods that can be applied to similar questions in the examination.

Time Management Suggestions: Proficient time management plays a vital role in the CAT examination. In addition to the questions, [aiexpertsedge](https://www.aiexpertsedge.com/) offer valuable tips on managing your time effectively to optimize your performance. These suggestions guide you in allocating time for each question, prioritizing tasks efficiently, and avoiding common pitfalls that can consume valuable time during the exam.

Monitor Your Progress: Keeping track of your progress is crucial for effective exam preparation. With the top 50 questions tailored for CAT exams, you can assess your performance and measure your advancement over time. Utilize this compilation as a benchmark to evaluate your strengths and weaknesses, pinpoint areas that require additional focus, and monitor your progress as you advance on your journey of preparation
From Graphic Design to FullStack Developer
Tags: javascript, developer, coding, webdev
Published: 2023-07-17 21:04:12

My name is Luis Linares a graphic designer who loves to create and design, but in recent years I realized that I don't want to spend my life just being a graphic designer, I want it more, so I start searching and I encounter this amazing BootCamp about coding, the BootCamp is called 
4Geeks Academy
 and I was not sure in the beginning, always the afraid of starting something in the wrong place, and not being able to finish what I started, after many hours searching information about the BootCamp I made my mind and started my BootCamp at 
4Geeks Academy
, in the beginning, it was all so new, that I felt overwhelmed with all this new information, all this new world about coding, Javascript, HTML, CSS3 ( The Devil) what the hell is a <div> and how to center that goddamn thing, and after many tries and failures I felt so good, that I just not only design something, I just coded from zero, a literal creation from nothing. That was like a spark inside of me that me realized that this is what I want to do for the rest of my life and now I just making a blog about it.

Hope you like this silly story about me.

See you on the next one.
Magna ex Lorem nisi eiusmod fugiat id sunt nisi irure anim amet non
Published: 2023-07-17 20:30:47

Qui velit voluptate in ut deserunt duis labore. Do esse dolore reprehenderit do excepteur qui eiusmod laboris cillum Lorem. Nulla dolore sit labore cillum occaecat nostrud velit mollit exercitation ullamco reprehenderit ea.

Laborum proident fugiat adipisicing nulla quis magna ex cupidatat fugiat exercitation ut eu. Amet non velit elit aliquip exercitation irure proident duis Lorem deserunt laborum veniam. Laboris dolore ad elit officia est magna quis nostrud sint laboris culpa esse. Laboris laboris et duis sunt minim elit voluptate aute amet ad.


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


Photo by S'well on Unsplash
Lorem esse laboris labore elit enim. In do veniam anim Lorem sint consectetur officia id et ad. Non quis incididunt incididunt officia anim proident aute incididunt mollit elit aute laboris esse. Aliqua consequat irure et mollit do occaecat ex sit quis aute elit dolore nostrud mollit. Sunt deserunt do deserunt laboris aute aliquip cillum do amet.

Fugiat ipsum voluptate proident eiusmod nulla velit proident adipisicing et aliquip qui magna sint et. Labore tempor quis commodo veniam do elit aliqua non. Ipsum ullamco duis voluptate consequat ad tempor id ad mollit sit.

Nisi excepteur aute excepteur ullamco id qui aliquip deserunt et ad dolore. Anim deserunt eiusmod exercitation exercitation velit ea dolore aliquip ullamco. Nulla ex mollit adipisicing officia qui dolore amet officia irure officia sit sunt in velit. Cillum dolor fugiat eu dolor ut.

Magna ex Lorem nisi eiusmod fugiat id sunt nisi irure anim amet non. Veniam duis est id veniam. Anim non culpa magna velit pariatur officia voluptate aliqua. Cupidatat nostrud consequat pariatur proident. Id ad Lorem quis incididunt cupidatat aliqua sit cillum voluptate qui occaecat aliqua tempor reprehenderit. Fugiat duis nisi voluptate deserunt dolor adipisicing ullamco. Dolor sint irure est voluptate enim ex ut esse tempor.

Dolor ex veniam sit minim minim. Ut laboris incididunt aute commodo enim dolore occaecat ex exercitation amet magna in. Sint sunt ipsum laboris sint culpa.

Quis labore veniam sit dolore elit velit laborum ea nostrud officia pariatur quis consectetur. Sit officia amet cillum elit. Adipisicing Lorem ad voluptate nulla quis dolor laborum. Pariatur ad dolor elit dolore veniam labore minim non est do. Cupidatat consectetur incididunt laborum adipisicing proident labore laborum labore cupidatat minim sint velit consequat. Ea aute deserunt fugiat dolore enim ad est enim duis nulla.
Leetcode Explained - Adds company tags, video solutions, and GPT code analysis into each problem
Tags: leetcode, computerscience, programming, algorithms
Published: 2023-07-17 19:49:57

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

Available for Google Chrome. Download [here](https://chrome.google.com/webstore/detail/leetcode-explained/cofoinjfjcpgcjiinjhcpomcjoalijbe)

Completely free and [open source](github.com/zubyj/leetcode-explained)
Simple Web Based Code Editor: PenEditor (React, JavaScript, HTML, and CSS)
Tags: programming, webdev, beginners, code
Published: 2023-07-17 19:46:42


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

Edit and run HTML, JavaScript, React, and CSS in the browser and directly download it to your PC when finished. [Open the editor](https://appcode.app/editor)


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

Edit code in the panel.


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

Preview the changes!


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

Format, Save to PC, or run the code...


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/99bijgx4a7ph19czw235.PNG)

Create output errors and notifications using the console!

## PenEditor

[Open the editor](https://appcode.app/editor)
Here are 20 CSS tricks...
Tags: webdev, tutorial, css, beginners
Published: 2023-07-17 19:35:04

Here are 20 CSS tricks that you can use to enhance your web development projects:

1. **Centering Elements Horizontally:** Use `margin: 0 auto;` on a block-level element to center it horizontally.

2. **Centering Elements Vertically:** Utilize `display: flex;` and `align-items: center;` on the parent container to center its child vertically.

3. **Creating Responsive Layouts:** Apply media queries with `@media` to adjust the layout based on different screen sizes.

4. **Creating Equal-Height Columns:** Use the CSS `display: flex;` and `flex-grow: 1;` properties on column containers to make them equal in height.

5. **Creating a Sticky Footer:** Set the `min-height` of the content container to `100vh` and give the footer a fixed position at the bottom using `position: fixed;`.

6. **Creating Animated Hover Effects:** Utilize the `transition` property to add smooth transitions on hover.

7. **Creating a Gradient Background:** Use the `background-image` property with the `linear-gradient` function to create gradient backgrounds.

8. **Styling Links:** Apply `text-decoration: none;` to remove the default underline on links and use `:hover` and `:visited` pseudo-classes to style link states.

9. **Creating a Drop Cap Effect:** Use the `::first-letter` pseudo-element to style the first letter of a block of text.

10. **Creating Responsive Images:** Use the `max-width: 100%;` property on images to ensure they scale down properly on smaller screens.

11. **Creating a Modal Box:** Use the `display: none;` property along with the `:target` pseudo-class to create a modal box that opens when a specific anchor link is clicked.

12. **Creating a Responsive Navigation Menu:** Utilize the CSS `flexbox` or `grid` layout to create a responsive navigation menu.

13. **Creating a Slideshow:** Use the `animation` property and `@keyframes` to create a slideshow with CSS animations.

14. **Creating a Fixed Sidebar:** Set `position: fixed;` on the sidebar container to make it stay fixed while scrolling.

15. **Creating a Custom Checkbox/Radio Button:** Use the `label` element along with the `input[type="checkbox"]` or `input[type="radio"]` and style them with CSS.

16. **Creating Tooltips:** Utilize the `::before` or `::after` pseudo-elements to create tooltips that appear when hovering over an element.

17. **Creating a Scroll Progress Indicator:** Use JavaScript to calculate the scroll position and update the progress indicator's width or height accordingly.

18. **Creating a Parallax Effect:** Apply `background-attachment: fixed;` to a background image to create a parallax scrolling effect.

19. **Creating a Flip Card Effect:** Use CSS `transform` and `transition` properties to create a card that flips on hover.

20. **Creating a Responsive Video Embed:** Wrap the video element in a container and use the `padding-top` property to maintain its aspect ratio.

---

## Want to see more?
[Here are 20 more tricks!](https://typeoverflow.com/typeoverflow/20-more-css-tricks-p62)