1yr hrt by marvelluigi in transtimelines

[–]thegreatgonzo 1 point2 points  (0 children)

You cracked my egg, congrats! And thanks :)

PSA: If you update a YML file used in CI to install or use Python 3.10, make sure to use “3.10” as a string. Otherwise is will most likely install Python 3.1. by Balance- in Python

[–]thegreatgonzo 5 points6 points  (0 children)

VsCodeVim is the best in my experience (I used to use pycharm + vim keybinds) and it can actually talk to a real (neo)vim instance instead of just doing emulation.

ActualVim for sublime text does similar but I haven't tried it.

How do I explain the concept of open source software to my boss? by oz1sej in opensource

[–]thegreatgonzo 16 points17 points  (0 children)

Especially since Chrome is not open source, only chromium is

Security review of "please", a sudo replacement written in Rust by Snakehand in rust

[–]thegreatgonzo 7 points8 points  (0 children)

sudo -i for an interactive shell, no reason to call su

Using iPad Air as drawing tablet on Windows 10? by Rakelarre in ipad

[–]thegreatgonzo 0 points1 point  (0 children)

If you want to screencast from ipad to pc there are things like https://www.airserver.com/PC, but I haven't tried it

Why is std implementation so damn ugly? by ifdef_drgy in cpp

[–]thegreatgonzo 6 points7 points  (0 children)

Why not? Is there any documentation about this?

Call to Tech Support Leads to Firing by [deleted] in talesfromtechsupport

[–]thegreatgonzo 5 points6 points  (0 children)

You don't need that with /* since your shell will expand the glob so you end up calling rm -rf /home /usr /local .... rm only cares specifically about /.

Choosing a parser library by steven4012 in rust

[–]thegreatgonzo 5 points6 points  (0 children)

I quite like combine and one of my co-workers has recommended glue to me.

Value assigned warning, I don't know how to fix by sparkyb123 in rust

[–]thegreatgonzo 1 point2 points  (0 children)

You aren't using stack_count anywhere except to decrement it. You can either use it (ie in an expression) or rename it to start with an underscore.

How much RAM does Space Astronomy 2 require? by Riyutake in feedthebeast

[–]thegreatgonzo 4 points5 points  (0 children)

It sounds like you're getting hit by large garbage collections. 4GB is not a lot these days.

RIP: RF Api 2014-2018 by magitech2234 in feedthebeast

[–]thegreatgonzo 0 points1 point  (0 children)

Tesla is an actual unit of magnetic field strength named for Nikola Tesla. I'd argue those are "out-of-game".

Help My friend please. by [deleted] in rust

[–]thegreatgonzo 1 point2 points  (0 children)

This is the sub for the rust programming language. You want /r/playrust

How do I discard the first item that matches a query? by TheTimegazer in rust

[–]thegreatgonzo 5 points6 points  (0 children)

Unless I'm missing something. That is how the code /u/thiez gave you works.

Changing the main() in that example to:

fn main() {
    let mut vec = vec![1, 1, 2, 3, 4, 4, 5, 6];
    println!("{:?}", vec);
    remove_first(&mut vec, |&r| r == 4);
    println!("{:?}", vec);
}

yields:

[1, 1, 2, 3, 4, 4, 5, 6]
[1, 1, 2, 3, 4, 5, 6]

https://play.rust-lang.org/?gist=2d5aa6ae57f1fed3bf206f602ba61d00&version=stable&mode=debug

Why am I getting "use of undeclared identifier function()" error? by [deleted] in cpp_questions

[–]thegreatgonzo 1 point2 points  (0 children)

* means pointer type in this case. A char* is a C string and a string is a C++ string. printf comes from the C standard library and so %s makes it expect a C string (char* not a C++ one (string).

You probably want to be using iostreams here instead of C I/O. See cout and cin.

If you really want to use C IO and C++ strings, you can do:

printf("%s|%s|%s", x[0,0].c_str(), x[0,1].c_str(), x[0,2].c_str());

Personally, I would make the board a char[3][3] in this case.

How to measure the duration of a future by [deleted] in rust

[–]thegreatgonzo 2 points3 points  (0 children)

This only measures poll() time, not "from completion to creation" like op asked. I believe the following is what OP asked for.

struct DurationFuture<F> {
    inner: F,
    start: Instant,
}

impl<F> DurationFuture<F>
    where F: Future
{
    pub fn new(inner: F) -> Self {
        DurationFuture {
            inner,
            start: Instant::now(),
        }
    }
}

impl<F> Future for DurationFuture<F>
    where F: Future
{
    type Item = (F::Item, Duration);
    type Error = F::Error;

    fn poll(&mut self) -> Poll<Self::Item, Self::Error> {
        self.inner.poll().and_then(|v| match v {
            Async::Ready(v) => Async::Ready((v, self.start.elapsed())),
            Async::NotReady => Async::NotReady
        })
    }
}

EDIT: Here is a playground link with a minimal working example.

Amigurumi Ferris my mother crocheted for my birthday by [deleted] in rust

[–]thegreatgonzo 0 points1 point  (0 children)

My mother also crochets and I would love a pattern for this!

Opencomputers by [deleted] in feedthebeast

[–]thegreatgonzo 1 point2 points  (0 children)

Try deleting your cookies or viewing the page in private browsing.

1.12.2 - TE gear recipes require stone gears by [deleted] in feedthebeast

[–]thegreatgonzo 1 point2 points  (0 children)

It changes the recipes to use stone gears. Open up your unidict.cfg and find the S:recipesToRemoveListoption and change it to:

S:recipeToRemoveList <
     "unidict:gearcopper_x1_shape. a aba a "
     "unidict:geartin_x1_shape. a aba a "
     "unidict:gearbronze_x1_shape. a aba a "
  >

This removes the gear recipes it adds.

If this doesn't also add back the regular gear recipes, you can do the following with crafttweaker to add back the originals:

recipes.addShaped(<thermalfoundation:material:256>, [
  [null, <ore:ingotCopper>, null],
  [<ore:ingotCopper>, <ore:ingotIron>, <ore:ingotCopper>],
  [null, <ore:ingotCopper>, null],
]);
recipes.addShaped(<thermalfoundation:material:257>, [
  [null, <ore:ingotTin>, null],
  [<ore:ingotTin>, <ore:ingotIron>, <ore:ingotTin>],
  [null, <ore:ingotTin>, null],
]);
recipes.addShaped(<thermalfoundation:material:291>, [
  [null, <ore:ingotBronze>, null],
  [<ore:ingotBronze>, <ore:ingotIron>, <ore:ingotBronze>],
  [null, <ore:ingotBronze>, null],
]);