teleren/devto huggingface dataset:
The 28th Day of the 100 Days of Code challenge
Published: 2023-07-07 22:24:26

I'll start by saying that today was more of a rest day, the family was home, there was a show we love to watch and then a stand-up comedy show I went to. So I only made my real-time transcription app configurable which took no time at all and also made a settings pane so that users could adjust the config from the client.

I'm not releasing yet, I've got more things I want to consider before I do so. Not in a rush :)

Funnily enough, I just did my daily reading of Atomic Habits time, and the author says the following line: "Amateurs let life get in the way, Professionals stay on schedule"

I feel like this applies to me, as I sometimes can neglect one thing for another. I feel like I need to show up more even when I don't feel like it and work through nothing-but-focus pomodoro sessions even when my brain doesn't feel like it.

That's something I'm gonna take into account when I make decisions :)

Some other questions have been rising in my mind:

- LLM's are one thing in the field of AI, why is AI getting so much recognition just now? It's not like things like sheep counting or fraud detection with AI is new (to my knowledge), they're built upon concepts that were available long before the release of such LLM's using ML

- How do you teach a model what to do when you have no labeled data? Unsupervised learning is really interesting me now. I did start to learn all these things at the beginning but I swittched over to practical projects for the moment with the available tools like ChatGPT.

Don't even get me started on neural networks, they tackle my brain with how they're different and that's what makes me wanna learn this.

I just keep asking myself, if I wanna make cool AI projects, doesn't it mean I need to generate data and train a model on it? This is what it feels like to me based on what I've seen during the development of this project, especially in speaker embedding extraction, which super interests me in terms of what the model helps with and how the data it's trained on helps it.

I think this arises from my lack of knowledge about how AI really works and how practical applications look.

So this is something I really want to learn as I work on projects! I think it'd be fun and interesting.

However, things like Andrew's course on Coursera go really in-depth, I don't know if that's what I need, but I'm not looking for any shortcuts :)

It's the constant recommendation by ChatGPT, probably means that detail is worth learning.

Theory, practical applications, projects.

That's my goal with this, but I still need to think this through and not act impulsively.

That's it for today,
Happy coding everyone!
Detect errors in views at compile time in asp.net mvc
Tags: webdev, programming, aspdotnet, api
Published: 2023-07-07 22:22:16

In ASP.NET MVC, views are typically composed using Razor syntax, which is a mixture of HTML and C# or VB.NET code. Since Razor views are executed at runtime, it is not possible to detect errors in views at compile time using the standard build process. However, you can perform some static analysis or use additional tools to catch common errors or improve code quality. Here are a few approaches you can consider:

1. Use static analysis tools: Tools like Roslyn analyzers can analyze your codebase and identify potential issues or code smells. Some analyzers specifically target ASP.NET MVC projects and can catch errors or provide suggestions for improving view code. For example, you can use the .NET Compiler Platform ("Roslyn") with analyzers like StyleCop or Microsoft.CodeAnalysis.FxCopAnalyzers.

2. Utilize unit testing: Writing unit tests for your views can help identify errors or inconsistencies at runtime. By creating tests that exercise your views and verify their expected behavior, you can catch errors early in the development process. Tools like NUnit, xUnit, or MSTest can be used for unit testing in ASP.NET MVC.

3. Leverage strongly-typed views: ASP.NET MVC provides the concept of strongly-typed views where you can specify the model type expected by the view. By using strongly-typed views, you can benefit from compile-time checking for the properties and methods of the model, reducing the chances of runtime errors. If there are any discrepancies between the view and the model, the compiler will report them during the build process.

4. Utilize Visual Studio editor features: Visual Studio IDE provides features like IntelliSense and code analysis that can help identify errors or provide suggestions while editing Razor views. These features can catch syntax errors, missing references, or incorrect usage of HTML or C# code within the views.

5. Use code analysis tools: There are third-party tools available, such as ReSharper, that provide advanced code analysis features. ReSharper has specific support for Razor views and can detect errors, refactor code, and suggest improvements.

While these approaches can help improve the quality of your view code and catch certain errors, it's important to note that some errors may still go undetected until runtime. Therefore, it's crucial to thoroughly test your views in various scenarios to ensure they function as expected.
Day 778 : That Life
Tags: hiphop, code, coding, lifelongdev
Published: 2023-07-07 22:10:21

_liner notes_:
- Professional : Whew what a way to end the week. Had a meeting with some folks about a feature coming up. Followed up on some community questions. My laptop decided it wanted to update and I had no more "defers" left so yeah, it updated. That took a while. Then for the rest of the day, I banged my head against some OpenAPI specs. haha. I'm looking through documentation, examples, any resources I can get my hands on and I can not get the spec to render how I think it should. I noticed that another API had something similar and it didn't render how I thought it should. I reached out to someone on the team for a sanity check and together came to the conclusion that there's something up with the renderer. Awesome. That'll be another rabbit hole I'll go down on Monday. Going down rabbit holes, I'm about that life. haha.

- Personal : Last night, I went through some tracks for the radio show. I also made a lot of head way in getting long text to show up in multiple lines on the HTML canvas. And it's responsive! I tried so many different methods to make it work. I think I'm going to make it cut off at 2 lines and add an ellipsis at the end. I'll have to figure that out. Still need to add images also.

![A field of tall grass in North Bend, WA, USA with a stone path in the center with tress on the sides and a mountain in front in the distance with the setting sun shining through a tree on the left side](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/aktc6c71s1yj6s54ohs1.jpg)

Going to put together the radio show for tomorrow. If I have time, I want to add the ellipsis to the title text and images on the HTML canvas based on the data. Still need to watch the latest episode of "Secret Invasion". That's it! Going to get my weekend started.

Have a great night and weekend!

peace piece
Dwane / conshus
https://dwane.io / https://HIPHOPandCODE.com
{% youtube UJXccBGs_IY %}
Revolucionando a legislação: Construindo leis descentralizadas através do GitHub
Tags: git, github, opensource
Published: 2023-07-07 21:53:11

## A Ideia:

Imagine um cenário em que a criação de leis não está mais restrita aos corredores dos órgãos governamentais, mas sim aberta a uma ampla colaboração descentralizada.

Utilizar o Git e Github, como plataforma para permitir que qualquer pessoa possa dar sugestões e essas poderem formar leis, que sejam de fato são escritas por quem sabe das reais necessidades. E não apenas por burocratas distantes.

Quando vi essa possibilidade grandiosa, me deixou extasiado de pura emoção.

A ideia inicial, saiu de desenvolvedores, primeiro de meu colega Alexandre Tolstenko, mas logo com minha chegada e de outros colegas ao time, aprofundamos os conceitos, com o restante dos 10% de inspiração, para mais 90% de transpiração o qual ainda estamos.

A base é que queríamos um sistema que seja transparente e que permitisse que todos pudessem apoiar e sentir-se de verdade parte disso.

Assim, consistiu na escolha em utilizarmos o Git, com a plataforma GitHub, para organizarmos todo o projeto.

## Como funciona:

Simplesmente permite que qualquer pessoa contribua com ideias ou propostas em todo o projeto.

Para isso basta que faça um Fork, escreva um adendo de texto com a parte que deseja modificar e com isso, realiza-se o Pull Request.
Dai entramos em especificidades do projeto. Toda proposta deve ser votada, onde estamos testando modelos buscando o que seja o menos custoso, mas que ao mesmo tempo traga segurança.

Por ora, apenas um grupo de 5 organizadores podem aprovar ao final, onde me incluo. Há também grupo com outras dezenas de outras pessoas, que já estão nos apoiando, em atividades diversas.
Ou seja, estamos no inicio e há muito que aperfeiçoar. E você pode fazer parte disso !

A computação revolucionou o ramo financeiro com as criptos.
Agora queremos revolucionar a política, através do Git !

## Venha conhecer:

Convido a conhecerem o nosso projeto (que ainda está em constante construção e teste), como também, o movimento CoPaJE, que estamos realizando por cima do projeto, para defender o setor de Jogos eletrônicos.

Toda a ajuda é bem vinda, por menor que ela seja.

Você estará no inicio de um grande movimento, em prol da democracia colaborativa !

Acesse nosso projeto no Github: [github.com/CoPaJE/CoPaJE](https://github.com/CoPaJE/CoPaJE)
Custom html helpers in mvc
Tags: webdev, programming, aspdotnet, aspnet
Published: 2023-07-07 21:10:11

In ASP.NET MVC, HTML Helpers are a set of utility methods that generate HTML markup in views. They simplify the process of creating HTML elements by providing methods that generate the necessary markup based on the provided parameters. 

While ASP.NET MVC provides a set of built-in HTML Helpers, you can also create your own custom HTML Helpers to generate custom HTML markup. Custom HTML Helpers can be useful when you have repetitive HTML rendering tasks or when you want to encapsulate complex rendering logic into a reusable component.

To create a custom HTML Helper in ASP.NET MVC, you can follow these steps:

1. Create a new static class to hold your custom HTML Helper methods. Let's say the class is named `CustomHtmlHelpers`. It should be placed in an appropriate namespace.

   ```csharp
   using System.Web.Mvc;

   namespace YourNamespace
   {
       public static class CustomHtmlHelpers
       {
           // Your custom HTML Helper methods will go here
       }
   }
   ```

2. Define a public static method within the `CustomHtmlHelpers` class. This method will generate the desired HTML markup. The method should have the following signature:

   ```csharp
   public static MvcHtmlString YourCustomHelperName(this HtmlHelper htmlHelper, /* parameters */)
   {
       // Generate HTML markup based on the parameters
       // Return the generated markup as an MvcHtmlString
   }
   ```

   The `htmlHelper` parameter represents the current instance of the `HtmlHelper` class, which allows you to access helper methods and properties provided by the ASP.NET MVC framework.

3. Implement the logic inside your custom HTML Helper method to generate the desired HTML markup. You can use the `TagBuilder` class to build HTML elements programmatically or use other techniques based on your requirements. Finally, return the generated HTML markup as an `MvcHtmlString`.

   ```csharp
   public static MvcHtmlString CustomButton(this HtmlHelper htmlHelper, string buttonText, string cssClass)
   {
       var buttonTag = new TagBuilder("button");
       buttonTag.InnerHtml = buttonText;
       buttonTag.AddCssClass(cssClass);

       return MvcHtmlString.Create(buttonTag.ToString());
   }
   ```

4. To use your custom HTML Helper in a view, you need to include the namespace where your custom HTML Helper class is defined. You can do this by adding a `@using` directive at the top of your view file.

   ```csharp
   @using YourNamespace
   ```

5. Now, you can call your custom HTML Helper method within your view by using the `Html` helper property and the method name you defined. Pass any required parameters to the method.

   ```csharp
   @Html.CustomButton("Click me!", "btn btn-primary")
   ```

   This will generate the HTML markup for a button with the specified text and CSS class.

That's it! You have now created a custom HTML Helper in ASP.NET MVC. You can create additional helper methods within the `CustomHtmlHelpers` class as needed, and they will be accessible in your views once you include the namespace and call the respective methods.
Unofficial Python Meta Threads API is Available
Tags: opensource, python, socialmedia, news
Published: 2023-07-07 21:47:21

I started yesterday to develop an unofficial Python Threads-API package for the all new Meta's Threads app. 

My first goal is to quickly add as much functionality as possible before tidying it all up.

It's available here: https://github.com/Danie1/threads-api


![Meta Threads](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wz38hhh5jx9748ho16vh.png)



I'm looking for more hands to help me. Let's connect :)
How to use toast notification with ASP .Net Core
Tags: dotnet, dotnetcore, toast, aspdotnet
Published: 2023-07-07 21:43:27

_**Before start with the tutorial, make shore u already have jQuery installed, cause this library use jQuery, in this case I will use the latest version.**_

```
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.7.0/jquery.js"></script>
```

**Let start!**

We're going to use the toastr library, so go to the repositorie [here](https://github.com/CodeSeven/toastr).

Before make something else, first we create a directory in your project like this.

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

As u can see, we have a folder named toastr where we have 2 files.
Now let's create this 2 files(JS and CSS).

So go to the repository that you opened before, enter the file toast.js in the repository, copy the code, and paste in your file project.


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

Now we'll do the same with the .scss file.


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

After this, put the references in your HTML.

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

**NOTE:** make shore you put the script after the jQuery script.


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

Now, we'll use the toast


```
<input 
  onclick="test()"
  type="button"
/>

 <script type="text/javascript">
        
   const test = () => {        
     toastr.success('Have fun storming the castle!', 'Miracle Max Says')
    }
        
  </script>
```

we'll get this result


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

Very easy right? toastr have a demo where u can personalize with some click and see the result, [here u have](https://codeseven.github.io/toastr/demo.html).

See you soon.
"The Internals of PostgreSQL" chapter #2
Tags: postgres, database
Published: 2023-06-28 11:11:54

 


## **Process Architecture:**

Postgresql is a relational database management system with a multi-process architecture that runs on a single host. A PostgreSQL server consis__ts opf a parent process, backend processes to handle client queries, background processes for database management features, replication processes for streaming replication, and background worker processes for user-defined tasks.

## 

*  **Postgres Server Process:**
When the pg_ctl utility is used with the start option, a postgres server process is started in PostgreSQL. It allocates a shared memory area in memory, starts various background processes, replication associated processes, and background worker processes if needed, and waits for connection requests from clients. Each connection request from a client results in the start of a backend process, which handles all queries issued by the connected client.


##


* **Backend Processes:**
PostgreSQL's backend process handles queries from a single connected client, with the maximum number of clients determined by max_connections (default 100). However, frequent connections and disconnections can negatively impact performance as PostgreSQL lacks a native connection pooling feature. To address this, a pooling middleware like pgbouncer or pgpool-II is often used.


##


* **Background Processes:***
Background processes in PostgreSQL perform various tasks related to database management, running continuously to ensure the system's efficiency and smooth operation. These processes include autovacuum, checkpoint, writer, WAL sender and receiver, and archiver, among others. They are essential for maintaining the stability and reliability of PostgreSQL databases.

## **Memory Architecture:**
Memory architecture in PostgreSQL can be classified into two broad categories: Local memory area and Shared memory area:

* **Local Memory Area:**
In PostgreSQL, each backend process allocates a local memory area for processing queries. This memory area is divided into several sub-areas, with sizes that are either fixed or variable. The backend process uses these sub-areas to perform query processing like work_mem and temp_buffers.
* **A shared memory area** 
is allocated by a PostgreSQL server when it starts up. This area is also divided into several fix sized sub-areas like shared buffer pool and WAL buffer.
Displaying images in asp net MVC
Tags: webdev, programming, aspdotnet, asp
Published: 2023-07-07 21:07:38

To display images in an ASP.NET MVC application, you can follow these steps:

1. First, make sure you have the images stored in a directory within your project, such as the "Images" folder.

2. In your MVC controller, create an action method that will retrieve the image file from the server and return it as a FileResult. The action method could look like this:

```csharp
public ActionResult DisplayImage(string imageName)
{
    string imagePath = Server.MapPath("~/Images/" + imageName);
    return File(imagePath, "image/jpeg"); // Adjust the content type based on the image type
}
```

3. In your view, use the `Url.Action` helper method to generate the URL for the action method and specify the image name as a parameter. You can then use the generated URL as the source for the `<img>` tag:

```html
<img src="@Url.Action("DisplayImage", "YourControllerName", new { imageName = "yourImage.jpg" })" alt="Image" />
```

Replace "YourControllerName" with the name of your controller and "yourImage.jpg" with the actual image file name.

4. When the view is rendered, the generated URL will point to the action method in the controller, which will retrieve the image file and return it to the browser.

Make sure that the image file exists in the specified location and that the correct content type is provided in the `File` method.

Remember to adjust the file paths and names according to your project's structure and naming conventions.
Accessing model metadata from custom templated helpers in asp.net mvc
Tags: webdev, programming, aspdotnet, aspnet
Published: 2023-07-07 21:00:59

In ASP.NET MVC, you can access model metadata from custom templated helpers by using the `ViewDataDictionary` object. The `ViewDataDictionary` contains the model and other data associated with the view, including the model's metadata.

Here's an example of how you can access the model metadata from a custom templated helper in ASP.NET MVC:

1. Create a custom templated helper method in a static class:

```csharp
public static class CustomHelpers
{
    public static MvcHtmlString CustomTemplateFor<TModel, TValue>(this HtmlHelper<TModel> html, Expression<Func<TModel, TValue>> expression)
    {
        ModelMetadata metadata = ModelMetadata.FromLambdaExpression(expression, html.ViewData);
        // Access model metadata properties, e.g. metadata.PropertyName, metadata.DisplayName, etc.
        
        // Generate HTML for the custom template
        // ...

        return MvcHtmlString.Create(/* custom template HTML */);
    }
}
```

2. In your view, import the namespace where the `CustomHelpers` class is located:

```csharp
@using YourNamespace.CustomHelpers
```

3. Use the `CustomTemplateFor` helper method to render the custom template for a specific model property:

```csharp
@Html.CustomTemplateFor(model => model.PropertyName)
```

Inside the `CustomTemplateFor` method, you can use the `ModelMetadata` object to access various properties of the model, such as `PropertyName`, `DisplayName`, `IsRequired`, and so on. These properties allow you to customize the generated HTML based on the model's metadata.

Make sure that your custom templated helper method is located in a namespace that is properly imported in your view. Also, ensure that you have the necessary using directives in your code file, such as `System.Web.Mvc` and any other relevant namespaces.

By accessing the model metadata within your custom templated helpers, you can dynamically generate HTML based on the properties of the model, providing a flexible and customizable rendering mechanism in ASP.NET MVC.
.NET Monthly Roundup - June 2023 - .NET 8 Preview 5, VS News, and more!
Tags: dotnet, visualstudio, aspnetcore
Published: 2023-07-07 20:54:39

{% embed https://www.youtube.com/watch?v=r4UmC8AwhUc %}

Welcome to our June .NET Monthly Roundup with Jon Galloway! In just 3 minutes, Jon breaks down the latest news from the month of June 2023 that .NET developers need to know.

### Top links
📚[All the links](http://aka.ms/dnmr-2306)

⭐.NET 8 Preview 5
➡️[Announcing .NET 8 Preview 5](https://devblogs.microsoft.com/dotnet/announcing-dotnet-8-preview-5/)
➡️[ASP.NET Core updates in .NET 8 Preview 5](https://devblogs.microsoft.com/dotnet/asp-net-core-updates-in-dotnet-8-preview-5/)

💻Visual Studio and Tools
➡️[Visual Studio Toolbox: Accelerate your builds of SDK-style .NET projects](https://devblogs.microsoft.com/visualstudio/vs-toolbox-accelerate-your-builds-of-sdk-style-net-projects/)
➡️[Visual Studio 2022 17.7 Preview 2 is here!](https://devblogs.microsoft.com/visualstudio/visual-studio-2022-17-7-preview-2-is-here/)
➡️[Announcing C# Dev Kit for Visual Studio Code](https://devblogs.microsoft.com/visualstudio/announcing-csharp-dev-kit-for-visual-studio-code/)
➡️[Announcing an update for .NET Upgrade Assistant with a new CLI tool!](https://devblogs.microsoft.com/dotnet/upgrade-assistant-cli/)

❤️Community Links and Events
➡️[Using the new configuration binder source generator](https://andrewlock.net/exploring-the-dotnet-8-preview-using-the-new-configuration-binder-source-generator/)
➡️[fsharpConf - The F# Community Virtual Conference](https://fsharpconf.com/)
➡️[fsharpConf 2023 - YouTube](https://www.youtube.com/playlist?list=PLdo4fOcmZ0oX_35CaKKDex9mNiN-tVaBn)
➡️[.NET Annotated Monthly | July 2023 | The .NET Tools Blog](https://blog.jetbrains.com/dotnet/2023/07/05/net-annotated-monthly-july-2023/)
➡️[.NET Foundation news and updates from June](https://mailchi.mp/dotnetfoundation/june2023)

### What did you think?

With so much new information coming at you each month, we're looking at ways to bring you the highlights. Let us know if this helps, and how we can do it better next month!

Jon