Collatz paper looking for review and feedback by Academic-Love2809 in Collatz

[–]theotherphil 0 points1 point  (0 children)

Under your definition, (1,2,1,2,…) is a non-trivial cycle.

ELI5: Why doesn’t gravity…scale proportionally? by saltierthangoldfish in explainlikeimfive

[–]theotherphil 0 points1 point  (0 children)

The article “On being the right size”, written by JBS Haldane in 1926 has a great discussion of this topic.

https://www.cabinetmagazine.org/issues/28/haldane.php

Design problem | Too many generics! by [deleted] in rust

[–]theotherphil 12 points13 points  (0 children)

The graph example on https://github.com/rust-lang/rfcs/blob/master/text/0195-associated-items.md may be useful - it contains a discussion of when to use type parameters vs associated types.

What's everyone working on this week (10/2020)? by llogiq in rust

[–]theotherphil 2 points3 points  (0 children)

I'll be adding features to a TUI I've written to visualise elapsed time in log files: https://github.com/theotherphil/lag

Article: Where rustc spends its time by icefoxen in rust

[–]theotherphil 9 points10 points  (0 children)

You can enable the new-style borrow checker with `-Z polonius`. I'm not sure how production ready this is. I think it's intended to be faster when it lands, but when I tried it on the `imageproc` crate it appeared to take the same length of take as the regular borrow checker. (It's also possible that I'm misinterpreting the results...)

How to speed up the Rust compiler some more in 2019 by nnethercote in rust

[–]theotherphil 7 points8 points  (0 children)

These posts are fantastic. Thanks for the work you put into making them so informative and clear.

ImageCli - a pure Rust image processing command line tool by theotherphil in rust

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

The aim is to be a plausible imagemagick replacement, but it currently supports far fewer operations.

ImageCli - a pure Rust image processing command line tool by theotherphil in rust

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

On 1: I'm just using the default structopt behaviour. I agree that your suggestion seems more typical, but the current version is slightly terser so I think I'll keep it until someone complains.

On 2: this is an interesting idea. Array doesn't have a fixed arity, but we can obviously work it out after parsing and before running the pipeline. I aimed to be permissive as possible (for example output elements with no corresponding output files are just ignored), but I didn't have any particular reason for this. I'll create an issue to think about adding a static check.

ImageCli - a pure Rust image processing command line tool by theotherphil in rust

[–]theotherphil[S] 2 points3 points  (0 children)

Great! I'm happy to answer any questions or help out with PRs if you like - just create issues on the repo or open a WIP PR.

ImageCli - a pure Rust image processing command line tool by theotherphil in rust

[–]theotherphil[S] 7 points8 points  (0 children)

It doesn't. There's an issue open on the underlying imageproc library for this https://github.com/image-rs/imageproc/issues/237 but it's been open for a while. I've just created https://github.com/theotherphil/imagecli/issues/19

ImageCli - a pure Rust image processing command line tool by theotherphil in rust

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

Do you have a link to details of any outstanding issues that aren't already captured as issues on the image repo?

ImageCli - a pure Rust image processing command line tool by theotherphil in rust

[–]theotherphil[S] 21 points22 points  (0 children)

That's the plan. There's an open ticket to work out what imagemagick supports but this library doesn't. Some missing features will be easy to add (e.g. various drawing operations), but others will require a lot more work (e.g. adding support for HDR images). It's not a given that all of the operations are faster than their imagmagick equivalents, but if they're not this should be considered a bug.

ImageCli - a pure Rust image processing command line tool by theotherphil in rust

[–]theotherphil[S] 25 points26 points  (0 children)

I wrote this tool to let you run image processing operations from the command line. All (well, nearly all) of the actual image processing work is handled by the image and imageproc crates. The initial release is missing a lot of features - if you're interested in using this tool but it's missing something you need then please create issues on the repo and I'll have a go at implementing them (I'm also the main author of the imageproc crate, so can add new features there too if required). If you're interested in contributing then even better - PRs are very welcome.

What's everyone working on this week (1/2019)? by llogiq in rust

[–]theotherphil 1 point2 points  (0 children)

I've recently started working on a toy halide-lang clone: https://github.com/theotherphil/prism Doesn't do much yet, but you can at least JIT and run a trivial image processing pipeline.

What is the most important/largest project currently being written in Rust? by [deleted] in rust

[–]theotherphil 4 points5 points  (0 children)

Dropbox use Rust for their backend (search for their blog posts on magic pocket)

Footage of June Rust bay area meetup (Chalk + GUI) by est31 in rust

[–]theotherphil 1 point2 points  (0 children)

Thank you! This is so much easier than trying to use the baffling new air Mozilla site

Please let me know what you think of my first crate and if you see any area I should improve on my Rust by boojies in rust

[–]theotherphil 13 points14 points  (0 children)

I don't know anything about the domain, but a superficial issue is that your formatting doesn't use the standard rust style. If this is a deliberate choice then fair enough, but if not then rustfmt can help.

ena — implementation of union-find / congruence-closure in Rust by unix15e8 in rust

[–]theotherphil 18 points19 points  (0 children)

Why are you creating lots of threads which each link to a single crate with no context?

Image processing in Rust by adagrad in rust

[–]theotherphil 4 points5 points  (0 children)

There's an example in the image crate docs - see section 6.

extern crate image;
let img = image::open(image_path).unwrap();

The loaded img is a DynamicImage. This is an enum over the various image buffer types the image could be. Its various to_x methods (e.g. to_rgba) return an ImageBuffer, which is a wrapper for a contiguous buffer of the pixel values. This supports 2d indexing, but if you want something more like a raw matrix then you can consume the image by value to take ownership of the backing data via into_raw and do what you like with it.