playground

.
Create

YOUR COMMUNITIES, ONE FEED

Home feed.

What is this website

This is a Reddit clone. This project has a studies and learning only purpose. I want to implement things I only know the theory, and also learn stuff that has been on my TO-DO study list for too long. I'll probaly discover things to learn that I don't even know they exist yet. Not everything I implement here will make sense for the circumstance. It's literally my Playground project. I'm documenting the development of this project in itself via Posts and Communities, and therefore, it's self-documenting (if this term even exists). I've been **using AI with little technical instructi ...
4
1

Making functions easier to unit test

It's very common to hear that automated tests improves an application's reliability and ables the developer to sleep without worry. Then you, as a very proactive programmer searches for how to make those tests and find that very easy... in the perfect scenario of the tutorial. When it comes to writing tests in real world, things can get very messy and that's the scenario that I want to figure out how to deal with. So here's the "mess" that I want to try writing tests: This is a code snippet in the Playground itself ```csharp filename="CommunityController.cs" public async Task<IAct ...
0
0

Annotations in C#

Annotation is a feature present in C# and other languages for a long time, I've learned how to use some of them and what they do, but never actually dived in to understand how they work, so that's the goal here. In the C# ecosystem, Annotations are actually called Attributes. I'll call them Attributes from now on. They can appear in almost any piece of code, such as methods and method's parameters (HttpGet and FromQuery in the example) ```csharp filename="CommunityController.cs" [HttpGet] public IActionResult Index([FromQuery] int id) { return View(id); } ``` Or a class' ...
0
0

Model binding and Razor in C#

to be done... - For Attributes related to razor: C# stores the attribute's metadata, which is used in the page with @model and then when Razor is used, it will replace the raw .cshtml tag <label asp-for="CommunityName"></label> with its result, partially defined in the CommunityName attribute <label for="CommunityName">Name your community</label>
0
0

SQL Server was too expensive, migrated to Postgres

For this project, I had created a SQL Server RDS instance because I'm familiar with this database. But, apparently 1GB of RAM ain't enough for SQL Server, so i was paying a lot for extra processing (at least for me, it's a lot of money). Upgrading to 2GB of RAM wasn't particularly cheap either, so I opted for Postgres and kept 1GB RAM. Let's see how it goes before putting more effort into reducing costs. This project is still small, so the migration was fairly simple with a C# program that would connect to both SQL Server and Postgres, read all tables and transfer all the data. The po ...

Show more
1
0

Fixed Jenkins' pipeline

For quite some time, i had this random occurance of which my CD pipeline would crash, and I had to restart my EC2 server to temporarily fix it. As it turns out, my EC2 t3.micro instance with 1GB of RAM was doing wonders to publish the project, since the pipeline would make it run "git pull" then "dotnet publish". Now the pipeline runs "dotnet publish" on the jenkins server and sends a .zip file to the EC2 machine.

1
0

Harness engineering is a confusing term

The AI hype has introduced a lot of terms pretty quickly, most of them are self-explanatory, but some are not, and Harness Engineering is one of them. So I'm creating this post to understand better this term and some others that came before it. Prompt Engineering - ChatGPT had just came out and studying how to create better prompts was the way to get the most out of the LLM. Context Engineering / Agent Engineering - A step further from prompt engineering, as the context window grew larger, we could start doing something more interesting with it, since it would be left empty for simple ...
0
0

What is RAG

Retrieval-Augmented Generation (RAG) is a technique to improve LLMs answer precision by giving it external sources of data. This data often is documentation, allowing for the User to browse easily among the specific and updated data, and therefore, instead of having to search dozens of pages of documentation, the User just asks the LLM, for example. As a downside, if the source of data is incomplete, outdated, or simply wrong, it will produce bad answers. (but that's quite obvious)

0
0

Remembering AngularJS

When I first started in Web Development, I used AngularJS. It's been a good while since I last used it, so i made this small page just to use some concepts. https://dotnetplayground.williamtsutumi.dev/teste/angularjs It's so much simpler than what I remember. I guess that we don't remember how hard it is to start programming / Web dev. Pretty cool!
0
0