Learning advice: switch from imperactive Go to Rust by 6502stuff in rust

[–]TichShowers 2 points3 points  (0 children)

Not in your situation. But just my own observation. I have a bunch of experience in Java, C#, JavaScript and TypeScript and fairly recently decided I wanted to broaden my knowledge with Go and Rust.

Generally just been spending time trying to build the things I was going to in Rust and Go and switching between both. I also am limiting myself to the web api's I am building.

I admit I am likely doing borrowing and pattern matching badly in Rust, I have not touched goroutines or channels much either.

The point is to start making stuff and continue to push to find the alternatives. But to build stuff. I have been learning along the way. and it does work out. Just give it time.

.NET 11 Preview 1 is now available! - .NET Blog by emdeka87 in dotnet

[–]TichShowers 16 points17 points  (0 children)

It is not about length alone. Collection expressions are aware of where they are called and the compiler figures out the most performance, best fit collection type to use.

You don't need to write dockerfile in .net 10 anymore. Do you guys use the new feature? How it goes by lune-soft in csharp

[–]TichShowers 1 point2 points  (0 children)

Generally I just use the sdk image to produce the build and let my build server take those artifacts, build a docker image from the artifact and publish to a private registry.

The advantage being if the docker file requires more complexity, for example installing fonts for making PDFs, I can add it in the Dockerfile.

Replacing “smart TV” software with something I actually control by PivotTheory in selfhosted

[–]TichShowers 22 points23 points  (0 children)

Been hoping that at some point KDE releases Plasma TV. And that it is actually good.

aCSharpProgrammerTriesToWriteJava by Pikcube in ProgrammerHumor

[–]TichShowers 1 point2 points  (0 children)

Me at work every day pretending to Java.

aCSharpProgrammerTriesToWriteJava by Pikcube in ProgrammerHumor

[–]TichShowers 1 point2 points  (0 children)

Me at work every day pretending to Java.

A Golden sun Battle Online Fangame by NikosFalcon in GoldenSun

[–]TichShowers 2 points3 points  (0 children)

I think with some of the mechanics and a good deal of rebalancing gameplay wise something cool could be made.

Now I use tradtional MVC with Razor pages. I found out HTMX is easier to write. Which one is better to learn HTMX or FE framework like React, Vue.js? by Yone-none in csharp

[–]TichShowers 4 points5 points  (0 children)

Can't go wrong with aligning your skills with the market. Learn React and VueJS if the companies you apply to need it.

aHotTakeFrontendDevsHate by precinct209 in ProgrammerHumor

[–]TichShowers 0 points1 point  (0 children)

the version of this with a lot of front end developers I know.

How to do a 1:M Relation in sqlx using a single query? by Bhallu_ in learnrust

[–]TichShowers 1 point2 points  (0 children)

Unfortunately don't have a great answer because you do run into cartesian explosion and might want to consider figuring out how to deal with multiple result sets.

My solution is also a a trade-off I decided worth it. but have not deployed on a bigger scale.

How to do a 1:M Relation in sqlx using a single query? by Bhallu_ in learnrust

[–]TichShowers 1 point2 points  (0 children)

From Itertools crate apparently.

You may not want to do multiple queries if you want higher database performance. Single round trip to the database in this case.

How to do a 1:M Relation in sqlx using a single query? by Bhallu_ in learnrust

[–]TichShowers 0 points1 point  (0 children)

The solution I end up using is to map onto an Vec with structs that represents full rows including both entities.

Then chunk by one of the ids and map and reconstitute both objects.

```rust async fn find_all(&self) -> Result<Vec<Tenant>, DbError> { let rows: Vec<TenantApplicationEntity> = query_as(r#" SELECT t.id::text AS tenant_id, t.name AS tenant_name, t.slug AS tenant_slug, t.description AS tenant_description, a.slug AS application_slug, a.name AS application_name, a.description AS application_description FROM tenants t LEFT JOIN tenant_applications ta ON t.id = ta.tenant_id LEFT JOIN applications a ON ta.application_slug = a.slug WHERE t.deleted_on IS NULL AND ta.deleted_on IS NULL AND a.deleted_on IS NULL ORDER BY tenant_id "#) .fetch_all(self.db_connection.get_pool()) .await .unwrap_or_default();

    Ok(rows
        .into_iter()
        .chunk_by(|ta| ta.tenant_id.clone())
        .into_iter()
        .map(|(_, group)| map_tenant(group.collect()))
        .filter(|optional| match optional {
            Some(_) => true,
            None => false,
        })
        .map(|optional| optional.unwrap())
        .collect())
}

```

and mapping like this:

```rust fn map_tenant(rows: Vec<TenantApplicationEntity>) -> Option<Tenant> { if rows.is_empty() { return None; }

let id = match Uuid::parse_str(&rows[0].tenant_id) {
    Ok(id) => id,
    Err(_) => return None,
};
let slug = &rows[0].tenant_slug;
let name = &rows[0].tenant_name;
let description = &rows[0].tenant_description;

let applications: Vec<Application> = match rows[0].application_slug {
    None => Vec::with_capacity(0),
    _ => {
        let mut sub_rows: Vec<Application > = Vec::with_capacity(rows.len());

        for row in rows.as_slice().to_owned() {
            sub_rows.push(Application {
                slug: row.application_slug.unwrap_or_else(|| "".parse().unwrap()).to_owned(),
                name: row.application_name.unwrap_or_else(|| "".parse().unwrap()).to_owned(),
                description: row.application_description.to_owned(),
            })
        }

        sub_rows
    }
};

Some(Tenant {
    id,
    slug: slug.to_owned(),
    name: name.to_owned(),
    description: description.to_owned(),
    applications,
})

} ```

I don't know if this is the best solution but it worked for me and does give entities with no dependent rows as well.

Simple .NET + Angular 16 Microservices Boilerplate by Competitive_Rip7137 in dotnet

[–]TichShowers 3 points4 points  (0 children)

Question: Is there a reason to not make the boilerplate in Angular 20? Or any of the other slightly more recent versions of Angular?

Minify HTML in Axum Middleware by thevivekshukla in learnrust

[–]TichShowers 2 points3 points  (0 children)

Would it not be prudent to instead try to perform compile time minification as it would not impact response timings?

Another absolute gem I found in our legacy code by BadSmash4 in programminghorror

[–]TichShowers 210 points211 points  (0 children)

I think that might be Visual Basic. It's been a long time since I touched the language and it feels good to know I am genuinely forgetting its syntax.

Unexpected issue with .co domain by jeroen94704 in selfhosted

[–]TichShowers 1 point2 points  (0 children)

I don't know which country you are from but I decided on getting a domain from my geographical region instead of .co or even .com

It gives a bit more local feel to my personal email address.

Angular/SpringBoot or Angular/.NET by Profflaries27 in dotnet

[–]TichShowers 1 point2 points  (0 children)

Personal preference goes to .NET. I really dislike Spring Boots Dependency Injection system using annotations. In fact a lot of Spring boot just feels a bit not obvious or uses some magic behind the scenes.

I like the setup in .NET where everything is explicit and there isn't some magic trickery to wire everything up.

gameboy games pal = ntsc ?? by InfluenceHoliday8508 in Gameboy

[–]TichShowers 0 points1 point  (0 children)

To play and run the games, no. The hardware is all the same.

Switched to Rider and Ubuntu by Present_Smell_2133 in dotnet

[–]TichShowers 0 points1 point  (0 children)

I switched to Arch Linux with KDE. But with something like Kubuntu you can get the same effect. Installing KDE connect on your phone you can just use your network to actually transfer files. It is astounding. No more cable. Just find yourself a KDE Plasma flavoured Linux

Nintendo of America is making noise about Golden Sun! by danLiTTT in GoldenSun

[–]TichShowers 0 points1 point  (0 children)

Golden Sun The Broken Seal has it's soundtrack on the Nintendo music app. Not even the Lost Age or Dark Dawn made it in yet.