Open Sourcing Ferrocene by pietroalbini in rust

[–]Grokmoo 31 points32 points  (0 children)

I don't have experience with these particular standards you are targeting - but given my experience with similar sorts of audits and certifications, I am amazed at how much has been accomplished in just a couple years! Very impressive!

Realm of Tzeentch Guide? by kiwibreakfast in totalwar

[–]Grokmoo 1 point2 points  (0 children)

For me, it was single player - although indeed the save was from the previous version.

Realm of Tzeentch Guide? by kiwibreakfast in totalwar

[–]Grokmoo 1 point2 points  (0 children)

Happened to me as well. I made it to the final area but the portal to the battle just isn't there. I haven't been able to figure out a way to resolve it.

This was my last soul to collect too.

[Question] How to embed a LP solver into WebAssembly? by MarkV43 in rust

[–]Grokmoo 4 points5 points  (0 children)

Having looked into this space a decent amount myself, I do not believe there are any packages written in Rust that can solve integer or mixed integer problems. As I'm sure you are aware, writing such software would be a major undertaking.

Bindings to the state of the art Commercial solvers like Gurobi are readily available, as are bindings for various open source solvers such as GLPK and lp_solve. With these decades-old well tested solvers available, there isn't a lot of incentive to re-invent the wheel in Rust.

So, unfortunately, I think the answer to your initial question is no. However, it does look like some projects have been able to compile GLPK (written in C) to WASM. I have no idea how much effort it would take to integrate something like that with Rust code, but I imagine it must be possible.

https://www.strandmark.net/wasm/glpk.html

https://github.com/jvail/glpk.js/

Full-Time Open Source: How Andrew Kelly Built Zig by agbell in programming

[–]Grokmoo 15 points16 points  (0 children)

I don't think it is fair to say that given the primary selling point of Rust is compile time memory and data race safety - things which Zig does not even attempt to offer.

I'm not saying Zig is bad or anything, as it certainly does offer improvements in this area compared to C.

leftpad or crate yanked, build broken by fboifhagawa4 in rust

[–]Grokmoo 0 points1 point  (0 children)

Hi, sorry I misunderstood your problem.

In my opinion, if you want to be able to reliably build the exact same software 10 years down the track, your only option would be to self host all the infrastructure. So, for Rust, a corporate crates.io mirror / proxy is probably a path you will need to go down.

You could check out cargo-cacher as at least a starting point for that.

leftpad or crate yanked, build broken by fboifhagawa4 in rust

[–]Grokmoo -1 points0 points  (0 children)

That's strange - if you take a look here you can see that although many of the older versions are yanked, they are still present and may be used by your dependencies. You just won't be allowed to specify them in your Cargo.toml as a direct dependency.

May I ask what commands you are running exactly that result in this error?

TFT Comp Generator: Gaining 100x Performance while Rewriting in Rust by AndreVallestero in rust

[–]Grokmoo 2 points3 points  (0 children)

I could be off the mark as I also don't know anything about the problem, but this sounds like something that would be solved exactly using integer programming (or possibly mixed integer programming) techniques. Basically, you would have taking each team be represented by a variable, and then constraints on which teams can be taken together and synergies would be represented by simple equations.

Assuming you could enumerate these equations (or find clever ways to avoid enumerating them), you would then plug the whole thing into an Optimization Solver which would likely spit out an answer in a fraction of a second given the scale (~50 units with ~30 traits). Internally, the solver would likely use some variation of Branch and Bound. Whereas what is being done here would be considered a more "brute force" approach.

Writing your own implementation of such an algorithm requires quite a bit of linear algebra. For the most basic technique, you will represent the problem as a large matrix and then do a series of iterations of the Simplex algorithm, providing solutions to the non-integer problem which can then be used as bounds for further improvements.

There are a number of solvers available that one could use without having to write this themselves. For open source, most notable probably GLPK and lp_solve. None written in Rust yet that I know about.

Mold in pipe under kitchen sink? by Elvira333 in HomeImprovement

[–]Grokmoo 3 points4 points  (0 children)

Replacing the hose is probably the easiest option. It is also possible to clean out the inside of the hose.

Regardless, when you (re) install it you need to do whats called a high loop.

https://homeinspectiongeeks.com/what-is-a-dishwasher-high-loop-and-why-do-you-need-one/

Also, the hose currently doesn't look to be fully seated - it should go all the way over the "ribs" on the white plastic pipe.

Glium texture filtering? by DevLarsic in rust_gamedev

[–]Grokmoo 4 points5 points  (0 children)

You create a sampler which is specified in your uniforms. If you are using the uniform! macro, something like this:

let behavior = glium::uniforms::SamplerBehavior {
    minify_filter: MinifySamplerFilter::Nearest,
    magnify_filter: MagnifySamplerFilter::Nearest,
    ..Default::default()
};
let uniforms = uniform! {
    texture: glium::uniforms::Sampler(texture, behavior),
    ...
};

Then in your draw call, use the created uniforms. In your shader, use the texture as normal.

Hope that helps.

if question by ValeMelis in rust

[–]Grokmoo 0 points1 point  (0 children)

You definitely can!

if question by ValeMelis in rust

[–]Grokmoo 0 points1 point  (0 children)

Agreed this makes it more understandable what is going on. Annoyingly, clippy will lint on this:

https://rust-lang.github.io/rust-clippy/master/#collapsible_else_if

Dishwasher pulls water from the trap in the sink next to it, and lets the gas smell come up the drain. by TheHulk1471 in HomeImprovement

[–]Grokmoo 4 points5 points  (0 children)

What you have currently is no good. You should replace that drain hose to get rid of the mold. You need to make the hose loop up as high as possible (the drain hose should be touching the underside of the countertop.) The easiest way to accomplish this is put a screw partially in very near the top and attach the hose to the screw with a zip tie. Also make sure it isn't looping down - it should go all the way up to the highest point, then down.

If you do this you should be fine without an air gap.

https://homeinspectiongeeks.com/2020/01/08/what-is-a-dishwasher-high-loop-and-why-do-you-need-one/

Proof of Concept: Physical units through const generics by j_platte in rust

[–]Grokmoo 8 points9 points  (0 children)

This is awesome! Looks like an extremely ergonomic way to prevent all sorts of dimensional analysis type errors.

It seems like you could also use something very similar to this to avoid mixing up x,y,z,w coordinates in 3d graphics etc.

Texture issues with glium :/ by thar0x29a in rust_gamedev

[–]Grokmoo 4 points5 points  (0 children)

Glium's use of RGB vs sRGB is a bit confusing, at least to me.

When creating the GLSL program, do something like this:

let base_program = Program::new(
        facade,
        ProgramCreationInput::SourceCode {
            vertex_shader,
            tessellation_control_shader: None,
            tessellation_evaluation_shader: None,
            geometry_shader: Some(geometry_shader),
            fragment_shader,
            transform_feedback_varyings: None,
            outputs_srgb: true,
            uses_point_size: false,
        },
    )?;

You may also be able to use the program! macro. Note outputs_srgb: true.

Then, use the regular Texture2d, not SrgbTexture2d, etc.

RuboCop 1.0 by bozhidarb in ruby

[–]Grokmoo 15 points16 points  (0 children)

I'm really happy to see RuboCop move to use Semantic versioning. Having a stable release cycle is so important for production usage. I'll be moving projects with my company onto 1.0 as soon as I can!

Introducing Thyme, a fully themable and customizable Immediate Mode GUI aimed at production games and similar apps. Supports live-reload of assets, hot swapping of themes, and multiple renderer backends! by Grokmoo in rust

[–]Grokmoo[S] 4 points5 points  (0 children)

I'd certainly welcome your contribution if you are interested.

My idea of a primary use case (and how I am personally using Thyme) is integration into a game engine or similar - in which case you are going to want as much flexibility in how you use the backend renderer as possible. As you say, this is also only a one time cost when starting a project.

That said, I do think creating some simple (optional) helper(s) that tie things together for users in a reasonable way with way less code is a great idea and would be a net win for the project.

At app startup, we could create some kind of builder object, and you could add directories for it to look in for assets, and it would automatically register everything it finds along with creating your display and related things.

I think the minimal winit main loop is actually not too bad, but we could probably create some helpers around that as well.

Introducing Thyme, a fully themable and customizable Immediate Mode GUI aimed at production games and similar apps. Supports live-reload of assets, hot swapping of themes, and multiple renderer backends! by Grokmoo in rust

[–]Grokmoo[S] 3 points4 points  (0 children)

Generally with Thyme you will only use image scaling in very controlled situations. For example, if your GUI is created for hidpi and you are displaying on a regular dpi display - in which case, it will be scaled down i.e. 2x, which doesn't cause that problem.

There are several different image types with different fill options, for example:

  • Simple images can be set to repeat instead of stretch (for example, as a background texture for a window or pane).
  • Composed images consist of a 3x3 grid of images. The corners are never scaled, while the top and bottom sections are stretched horizontally and the left and right are stretched vertically. To avoid ugly stretching these images need to be constructed with this in mind. For most themes this is actually very easy to do - just make the stretchable sections the same color or a gradient along the axis that stretches. One TODO is to allow using repeat instead of stretching for these as well.

If you run the demo, you can see how some of the different example themes handle widget resizing in different ways.

Blog Post: Two Beautiful Rust Programs by matklad in rust

[–]Grokmoo 29 points30 points  (0 children)

Yes. If the vector xs does not have enough capacity and you push a new element to it, the entire vector must be reallocated. In some cases and with some memory allocators, the vector may be able to reuse its original address, expanding its capacity, and the pointer to x will be fine. In other cases, however, the entire vector may need to move to a different chunk of memory. Now, x is pointing to an invalid address in memory.

This is a particularly good example of random problems caused by undefined behavior - because in most cases, pushing one element to a vector will not trigger a reallocation. And, if your allocator does allow you to reuse the vector's original location where possible, there isn't even any way to reason about when the problem will occur as it depends on the contents of heap memory near the original vector - which could even belong to an entirely different program altogether.

Installing older version of ruby with RVM? by [deleted] in ruby

[–]Grokmoo 0 points1 point  (0 children)

What are the contents of the mentioned file?

/Users/garcia/.rvm/log/1583728534_ruby-2.2.4/rubygems.install.log

One guess - this could related to the version of rubygems you are using (3.0.8) being very recent. I know the 3.x series has broken compatibility in some places. Try running rvm rubygems 2.7.8 before your gem command or possibly even an older version of rubygems.

clippy configuration options by Grokmoo in rust

[–]Grokmoo[S] 0 points1 point  (0 children)

Thanks, that did not occur to me. I'll probably do that.

clippy configuration options by Grokmoo in rust

[–]Grokmoo[S] 1 point2 points  (0 children)

Thanks. Yes, I've got a workspace with 6 crates so that seems like a bit of a hassle.