teleren/devto huggingface dataset:
Creating a Target (Pogo Pt: 2)
Tags: python, go, compiler, transpiler
Published: 2024-01-17 21:50:56

## Intro
If you didn't read [part one](https://dev.to/chigbeef_77/compiling-python-to-go-pogo-pt1-3lah) I am creating a Python to Golang transpiler called Pogo. From part one we used type annotations to construct the basis of the Go type system within Python.

## Current Work
Now that we have our source better described, we can now move on to our target. We will be doing this by creating some Python code, and creating the result we would like.

To do this we will have to create our input to compile. A great test I like to use for compilers is searching for prime numbers, here is the code in Python.
```python
from GoType import *

# Code
for i in range(2, 100):
    prime: bool = True

    for j in range(2, i):
        if i%j == 0:
            prime = False

    if prime:
        print(i)
```
If you remember from the last post `GoType` is a Python file that defines each GoType we need, so that they come up for inference. This includes types such as `uint8` that aren't in Python.
Next, we have a comment, which is very important because we _don't_ want to get rid of these, we want to keep them for the final output.
For loops in Python and Go look very different, which may make them hard to work with in the long run.
You can see in the creation of `prime` we are using type annotations, which will be useful for Go to figure out which type `prime` should be.

Here is the equivalent Go code.
```go
package main

import (
    "fmt"
)

func main() {
    // Code
    for i := 2; i < 100; i++ {
        var prime bool = true
        
        for j := 2; j < i; j++ {
            if i%j == 0 {
                prime = false
            }
        }

        if prime {
            fmt.Println(i)
        }
    }
}
```
This is probably the simplest way to find prime numbers, and is no way optimized, but it already shows some interesting things we will have to do in compilation.
Firstly, we can see that whenever we print we will inevitably need to import `fmt`. Furthermore, everything that was run in a global scope is set into the main function. Something useful, however, is that neither language uses type annotations on variables used in loops, such as `i`. This could make that compilation easier, or end up making it harder.

## Next
In the next job we will start with the compiler, specifically defining what a token is and what can be a token, which will lead to the lexing process.
Stylish Registration Form
Published: 2024-01-09 10:23:58

{% embed https://www.youtube.com/shorts/yZo8k_b6gCs %}
```
<!DOCTYPE html>
<html>
  <head>
    <title>Registration Form</title>
    <link rel="stylesheet" href="log.css" />
    Stylish Sign up/log in form
  </head>
  <body>
    <h1>Registration Form</h1>
    <p>Please fill out this form with the required information</p>
    <form action='https://register-demo.freecodecamp.org'>
      <fieldset>
        <label>First Name: <input type="text" name="first-name" required /></label>
        <label>Last Name: <input type="text" name="last-name" required /></label>
        <label>Email: <input type="email" name="email" required /></label>
        <label>Create a New Password: <input type="password" name="password" pattern="[a-z0-5]{8,}" required /></label>
      </fieldset>
      <fieldset>
        <label><input type="radio" name="account-type" class="inline" /> Personal Account</label>
        <label><input type="radio" name="account-type" class="inline" /> Business Account</label>
      </fieldset>
      <fieldset>
        <label>Upload a profile picture: <input type="file" name="file" /></label>
        <label>Input your age (years): <input type="number" name="age" min="13" max="120" />
        </label>
        <label>How did you hear about us?
          <select name="referrer">
            <option value="">(select one)</option>
            <option value="1">freeCodeCamp News</option>
            <option value="2">freeCodeCamp YouTube Channel</option>
            <option value="3">freeCodeCamp Forum</option>
            <option value="4">Other</option>
          </select>
        </label>
        <label>Provide a bio:
          <textarea name="bio" rows="3" cols="30" placeholder="I like coding on the beach..."></textarea>
        </label>
      </fieldset>
      <input type="submit" value="Submit" />
    </form>
  </body>
</html>
```

```
body {
  width: 100%;
  height: 100vh;
  margin: 0;
  background-color: #1b1b32;
  color: #f5f6f7;
  font-family: Tahoma;
  font-size: 16px;
}

h1, p {
  margin: 1em auto;
  text-align: center;
}

form {
  width: 60vw;
  max-width: 500px;
  min-width: 300px;
  margin: 0 auto;
  padding-bottom: 2em;
}

fieldset {
  border: none;
  padding: 2rem 0;
}

fieldset:not(:last-of-type) {
  border-bottom: 3px solid #3b3b4f;
}

label {
  display: block;
  margin: 0.5rem 0;
}

input,
textarea,
select {
  margin: 10px 0 0 0;
  width: 100%;
  min-height: 2em;
}

input, textarea {
  background-color: #0a0a23;
  border: 1px solid #0a0a23;
  color: #ffffff;
}

.inline {
  width: unset;
  margin: 0 0.5em 0 0;
  vertical-align: middle;
}

input[type="submit"] {
  display: block;
  width: 60%;
  margin: 1em auto;
  height: 2em;
  font-size: 1.1rem;
  background-color: #3b3b4f;
  border-color: white;
  min-width: 300px;
}

input[type="file"] {
  padding: 1px 2px;
}

a {
  color: #dfdfe2;
}
```

![Registration Form with HTML & CSS ](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/400k17ki0tghnuznnp8l.png)
Learning CSS Part 2
Published: 2024-01-17 21:31:14

- If you want to change a section like a header, you must include the tag in front the bracket. Ex= h1{color:ex}

- Using * tag selects all and makes it universal

- To select an HTML element by its class using CSS, a period (.) must be prepended to the class’s name. In the example above, the class is brand, so the CSS selector for it is .brand.

- If there are multiple classes, you can create different rule sets or include both using space in html.

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


The ID attribute has only one value compared to the class. To select an ID , you must use a hashtag #

The attribute selector targets elements that already contain attributes. You use [ ] to select them.
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1itx6ffxq7mr47d7tg5t.png)
 

- Psuedo class: ex focus, visited, disabled, active that creates user interaction.

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

-  different ways of selecting an element. By type, class and ID.

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

- Chaining combines multiple sectors.
- ex: h1.special the (.) connects two different elements.
- A descendant combinator selects all elements within a list. 

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

You can add more styles to multiple selectors. Separate the CSS selectors with a comma.
Taking exam AZ-204
Tags: azure, career, certification
Published: 2024-01-17 21:29:09

Azure is a widely used cloud platform, and having certification in Azure development can open up new career opportunities. Many organizations are actively seeking professionals with cloud development skills to work on Azure projects.

The certification provides an opportunity to acquire new skills related to cloud development on the Microsoft Azure platform. This includes understanding various Azure services, development methodologies, security considerations, and optimization techniques.

[Azure Developer Associate certification (Az-204)](https://learn.microsoft.com/en-us/credentials/certifications/exams/az-204/) is part of Microsoft's role-based certification model. After achieving this associate-level certification, you can consider pursuing higher-level certifications, such as the **Microsoft Certified: Azure Solutions Architect Expert** or **Microsoft Certified: DevOps Engineer Expert**.

The **Microsoft AZ-204 certification** is  a valuable resource for developers who want to bridge the gap between their existing .NET development skills and the capabilities of Microsoft Azure. It combines theoretical knowledge with practical application, preparing developers to design, build, and optimize solutions on the Azure platform.

Based on the weightings provided for each topic of the exam, here are more detailed subtopics that you may want to focus on within each broader category

- Develop Azure compute solutions (25–30%)
- Develop for Azure storage (15–20%)
- Implement Azure security (20–25%)
- Monitor, troubleshoot, and optimize Azure solutions (15–20%)
- Connect to and consume Azure services and third-party services (15–20%)

More detailed information here: [Study guide for Exam AZ-204: Developing Solutions for Microsoft Azure | Microsoft Learn](https://learn.microsoft.com/en-us/credentials/certifications/resources/study-guides/az-204).

Remember to review the official Microsoft documentation and exam resources for the most up-to-date information on each of these topics. Additionally, hands-on practice and real-world scenarios can significantly enhance your understanding of these concepts. Remember that effective exam preparation often involves a combination of theoretical understanding and practical application. Best of luck with your preparation for the AZ-204 exam!
Exploring HTMX Integration with Go Backend
Tags: htmx, webdev, go
Published: 2024-01-17 21:01:38

Hello developers,

Let's dive into the practicalities of combining HTMX with a Go backend for web development. This approach aims to provide a practical, balanced enhancement to web applications.

## Getting Started

HTMX introduces simplicity and effectiveness to web development. Integrating it with a Go backend can offer a responsive user experience. We'll go through the setup, exploring how these technologies can be employed together.

## Example Demo on GitHub

For those eager to experiment, there's a simple demo available on [GitHub](https://github.com/andi1984/htmx-go). The repository contains code snippets and configurations, offering a hands-on experience to understand the integration process.

## YouTube Overview

Additionally, there's a brief overview on [YouTube](https://youtu.be/UwxLOFvwBI0), providing insights into HTMX. While it's not a tutorial, it serves as an introductory glimpse into what HTMX brings to the table.

## Why HTMX with Go?

1. **Streamlined AJAX Integration**: HTMX simplifies AJAX integration directly into HTML, reducing reliance on complex JavaScript.
2. **Leveraging Go's Concurrency Model**: Utilize Go's concurrency model to efficiently handle multiple connections, ensuring a responsive user experience.
3. **Maintainability and Readability**: Combining HTMX with Go results in clean, readable code, facilitating collaboration and scalability.

## Conclusion

In summary, the combination of HTMX with a Go backend shows promise for web development. The GitHub repository provides a simple demo for practical exploration, and the YouTube overview offers a glimpse into HTMX's capabilities. Feel free to adapt and integrate these technologies as needed for your projects. Happy coding!
𝗪𝗵𝗮𝘁 𝗮𝗿𝗲 𝘁𝗵𝗲 𝗥𝗲𝗴𝗘𝘅 𝗣𝗮𝘁𝘁𝗲𝗿𝗻𝘀?
Tags: regex, patterns
Published: 2024-01-17 19:48:47

Regular expressions (regex or RegExp) consist of a combination of characters and special symbols that define a search pattern.

Here are some common patterns and symbols used in regex:
1. 𝙇𝙞𝙩𝙚𝙧𝙖𝙡 𝘾𝙝𝙖𝙧𝙖𝙘𝙩𝙚𝙧𝙨:
◦ Regular characters, such as letters and digits, match themselves. For example, the pattern abc matches the string "abc" in the input.

2. 𝙈𝙚𝙩𝙖𝙘𝙝𝙖𝙧𝙖𝙘𝙩𝙚𝙧𝙨:
◦ Special characters that have a specific meaning in regex. Examples include:
▪ . (dot): Matches any single character except a newline.
▪ ^: Anchors the regex at the start of the string.
▪ $: Anchors the regex at the end of the string.

3. 𝘾𝙝𝙖𝙧𝙖𝙘𝙩𝙚𝙧 𝘾𝙡𝙖𝙨𝙨𝙚𝙨:
◦ Enclosed in square brackets [] and match any single character within the brackets. For example, [aeiou] matches any vowel.

4. 𝙌𝙪𝙖𝙣𝙩𝙞𝙛𝙞𝙚𝙧𝙨:
◦ Specify the number of occurrences of the preceding character or group. Examples include:
▪ *: Matches 0 or more occurrences.
▪ +: Matches 1 or more occurrences.
▪ ?: Matches 0 or 1 occurrence.
▪ {n}: Matches exactly n occurrences.
▪ {n,}: Matches n or more occurrences.
▪ {n,m}: Matches between n and m occurrences.

5. 𝙀𝙨𝙘𝙖𝙥𝙚 𝘾𝙝𝙖𝙧𝙖𝙘𝙩𝙚𝙧𝙨:
◦ The backslash \ is used to escape a metacharacter, allowing it to be treated as a literal character. For example, \. matches a literal dot.

6. 𝙂𝙧𝙤𝙪𝙥𝙞𝙣𝙜 𝙖𝙣𝙙 𝘾𝙖𝙥𝙩𝙪𝙧𝙞𝙣𝙜:
◦ Parentheses () are used to group characters and capture the matched content. For example, (\d{2})/(\d{2})/(\d{4}) captures day, month, and year in a date pattern.

7. 𝘼𝙡𝙩𝙚𝙧𝙣𝙖𝙩𝙞𝙤𝙣:
◦ The pipe | symbol is used for alternation, allowing the regex to match either of the patterns. For example, cat|dog matches either "cat" or "dog".

8. 𝘾𝙝𝙖𝙧𝙖𝙘𝙩𝙚𝙧 𝙀𝙨𝙘𝙖𝙥𝙚𝙨:
◦ Backslashes followed by certain characters represent special sequences. For example, \d matches any digit, and \s matches any whitespace character.

9. 𝘼𝙣𝙘𝙝𝙤𝙧𝙨:
◦ Anchors assert a position in the string. Examples include ^ for the start of the string and $ for the end of the string.

10. 𝙒𝙤𝙧𝙙 𝘽𝙤𝙪𝙣𝙙𝙖𝙧𝙞𝙚𝙨:
◦ \b is a word boundary anchor that matches the position between a word character (as defined by \w) and a non-word character.
HIRE ADWARE RECOVERY SPECIALIST FOR ANY SCAMMED CRYPTO RECOVERY
Published: 2024-01-17 21:08:22

ADWARE RECOVERY SPECIALIST stands out as a trustworthy companion for people looking to recover lost Bitcoin and restore access to their digital assets. Their extensive knowledge of cryptocurrency systems, quick response times, and history of successful recovery establish them as a reliable option in the sector. ADWARE RECOVERY SPECIALIST  has demonstrated their capacity to recover lost or stolen Bitcoin by using their specialized techniques and experience, providing relief to people who have suffered from such losses. Never give up hope if you find yourself in a similar circumstance.
After losing my bitcoin in what felt like a never-ending nightmare, I stumbled upon ADWARE RECOVERY SPECIALIST. Their professionalism, expertise, and ability to recover my funds have not only restored my faith in humanity but also in the power of ADWARE. They are truly a trusted choice for recovering lost bitcoin. I never thought I would see my lost bitcoin again, but thanks to ADWARE RECOVERY SPECIALIST , I was proven wrong. Their team went above and beyond to help me regain access to my wallet and retrieve my funds. I couldn't be happier with the outcome. If you're in a similar situation, don't hesitate to reach out to them. ADWARE RECOVERY SPECIALIST  is the name you can trust when it comes to getting misplaced bitcoin back. They have demonstrated that they are the go-to group for recovering lost money with their knowledge, actual success stories, and happy clients. But before you get in touch, you should evaluate your chances of recovery and be aware of the costs involved. Give ADWARE RECOVERY SPECIALIST  a call if you need help recovering bitcoin; they might be able to use their magic to revive your lost cryptocurrency. ADWARE RECOVERY SPECIALIST  has experience dealing with a variety of Bitcoin theft or loss situations, such as lost or compromised passwords, malware infections, and hacking occurrences. However, a number of variables, including the specifics of the loss and the accessibility of pertinent information, affect the likelihood of a successful recovery. In order to ascertain whether recovery is feasible in your specific situation, it is advised that you speak with  ADWARE RECOVERY SPECIALIST  and give them all pertinent information. Contact the information below: 

Email: Adwarerecoveryspecialist@auctioneer.net

Visit their Website: adwarerecoveryspecialist.expert

Regards.
🆓 Local & Open Source AI: a kind ollama & LlamaIndex intro
Tags: opensource, ai, tutorial, beginners
Published: 2024-01-17 21:08:11

## ❔ About

Sometimes, you may need a **convenient yet powerful way** to run many `LLMs` locally with:

- **Only `CPU`** ( `i5` like)
- **Little `RAM`** (eg `<= 8Go`)
- Being able to plug **third party frameworks** ([`Langchain`](https://github.com/langchain-ai/langchain), [`LlamaIndex`](https://github.com/run-llama/llama_index)) so you can build complex projects
- **Ease of use** (few lines of code, powerful results)

👉 This is all what this post is about.

## 🎯 What you'll learn

In this short demo, you'll see how to:

- Run on Kaggle (CPU)
- Use [`ollama`](https://ollama.ai/) to run open source models
- Play with a first `LlamaIndex` example

## 💡 Benefits & opportunities

Get rid of [weekly GPU ](https://www.kaggle.com/discussions/general/108481) usage limits on free plan:

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

With this `CPU` approach, you are then **able to schedule AI based workflow for free** (as long as it does not exceed the 12h window limit).

- [Scheduling notebook execution with `cron` and Kaggle API](https://www.kaggle.com/discussions/product-feedback/371090)

## 🍿 Demo

Enough teasing, let's jump in the demo:

{% youtube MroeN4aTjF4 %}

## 📜 Notebook


[![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/kkjhg1scmd81wtm0ajx5.png)](https://www.kaggle.com/code/adriensales/ollama-running-local-models-w-llamaindex-cpu/notebook)


## 🔭 Further, stronger

To go further (48GB of RAM required, as well as GPU ), a full example around [`mixtral`](https://ollama.ai/library/mixtral), see [Running Mixtral 8x7 locally with LlamaIndex](https://blog.llamaindex.ai/running-mixtral-8x7-locally-with-llamaindex-e6cebeabe0ab).
4 Reasons Why I Think Every Aspiring Frontend Developer Should Read "You Don't Know JS" book series✨📚
Published: 2024-01-17 21:01:01

The [_You Don't Know JS_](https://github.com/getify/You-Dont-Know-JS) book series by @getifyX is the best book ever written on Vanilla Javascript.

You know exactly what I'm talking about if you've read it.

But if you haven't, here's why:

## Reason #1: This book series contains everything you need to know about JS

Spanning 6 books, the series covers everything you need to know about JS. It's a revelation—reading it made me realize how much I didn't know. Concepts I attributed to React turned out to be fundamental JavaScript features. It's a game-changer for anyone serious about understanding the language.

## Reason #2: They use an unfiltered, concise language

If you want honest, concise language, pick this book. No fluff. Packed with examples, quizzes, and summaries, it distills complex concepts into digestible bits, accelerating your understanding of JavaScript.

## Reason #4: They are laser-focused on Javascript

Unlike many online resources that skim the surface of various topics, this series dives deep into JavaScript and JavaScript only. It's fantastic for building solid fundamentals.

## Reason #3: They are free to read online

These invaluable resources are available online for free on GitHub. Yes, free! You can also purchase the paper version if you want.

I can't recommend this book enough.

---

Thank you for reading this post 🙏.

Leave a comment 📩 if you have favorite Vanilla JS books!

And Don't forget to Drop a "💖🦄🔥".

If you like articles like this, join my **FREE** newsletter, **[FrontendJoy](https://frontendjoy.substack.com/)**, or find me on [X/Twitter](https://twitter.com/_ndeyefatoudiop).
La resiliencia como habilidad de vida
Tags: learning, personalgrowth, resilience, notes
Published: 2024-01-17 20:41:17

No todo resulta como pensamos. A veces, nada nos sale bien. Cuando surgen cambios inesperados, muchos colapsamos con el estrés y la preocupación. Pero hay personas que logran salir de estas situaciones, con calma y una actitud diferente. Gracias a habilidades de vida que se van desarrollando a partir de las experiencias.

---

## ¿Qué es la resiliencia?

La resiliencia es la habilidad de adaptarse a situaciones adversas, y no fracasar cuando hay presión. Es mantener una buena energía y recuperase con una actitud diferente. Es recuperarse de un momento difícil y tomar lo mejor para seguir adelante con un nuevo aprendizaje.

Cuando se habla de resiliencia, no se trata de insistencia sino de recuperación. No es una habilidad ni cualidad innata, puede aprenderse y mejorarse como si fuera una capacidad técnica. Para desarrollarla, es necesario tener las siguientes cualidades:

- Actitud positiva: Visualizar la situación de una forma positiva y tener confianza en sí mismo.
- Empatía: Establecer relaciones personales fuertes y tener destrezas en la comunicación.
- Control emocional: Manejar los pensamientos y sentimientos fuertes.
- Autoeficacia: Analizar y realizar planes realistas para la recuperación.

La resiliencia es ordinaria, no extraordinaria. Sin embargo no sólo se desarrolla, también se construye de las siguientes formas:

- Establecer relaciones sociales.
- Evitar ver las crisis como obstáculos insuperables.
- Aceptar que el cambio es parte de la vida.
- Mover hacia las metas.
- Mover a cabo acciones decisivas.
- Buscar oportunidades para descubrirse a si mismo.
- Cultivar una visión positiva de sí mismo.
- Mantener la perspectiva.
- Nunca perder la esperanza.
- Cuidar de sí mismo.

## Caso personal

En mi caso, estuve buen tiempo desempleado. Participé en varios procesos de selección pero desafortunadamente, llegaban correos electrónicos con el asunto "agradecimiento proceso de selección". Durante ese tiempo llegó la pandemia que afectó a la economía y el empleo. Sin embargo, mantuve una actitud positiva y pensé en proyectos personales para recuperarme, como este blog.

Falta trabajar mucho para desarrollar las cualidades para ser resiliente. Lo importante es pensar con una perspectiva diferente, y la resiliencia hace parte de las habilidades blandas requeridas en tiempos difíciles. Invito a aprender sobre nuevas habilidades más que técnicas, personales como la resiliencia.

Publicado en: [The Bucket of Notes](https://thebucketofnotes.hashnode.dev/la-resiliencia-como-habilidad-de-vida)