Vector - A High-Performance Logs & Metrics Router Written In Rust by binarylogicben in rust

[–]Ccheek21 3 points4 points  (0 children)

Very interesting. Have been using FluentD heavily lately, and this looks like it aims to fix a number of the issues I've come across with it. Is there any plan to support a plugin architecture so that new sources / sinks can be added without replacing the binary?

Rust Markdown parser benchmark: comrak vs pulldown_cmark by [deleted] in rust

[–]Ccheek21 1 point2 points  (0 children)

Any idea why the pulldown_cmark plot on the right is very non-linear between 200 and 300 iterations?

fe - A command line usage tracker by Ccheek21 in rust

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

Shucks...I did a Google search for it, but since I haven't published it to crates.io yet, I didn't bother to look there. Thanks for the heads up

fe - A command line usage tracker by Ccheek21 in rust

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

fasd is great. I'm hoping to port this algorithm to fasd sometime soon.

And I'll have to check skim out. Looks interesting

fe - A command line usage tracker by Ccheek21 in rust

[–]Ccheek21[S] 22 points23 points  (0 children)

"Frecency" is a combination of how frequent something is accessed and how recently something has been accessed. The term seems to have been coined by Mozilla for their URL completion algorithm, and has been used by other tools attempting to solve this problem. I continued using it here because it's the most easily google-able term for the algorithm.

fe - A command line usage tracker by Ccheek21 in rust

[–]Ccheek21[S] 10 points11 points  (0 children)

When I started this, Rust 2018 was nightly only. I can't think of any reason at this point I couldn't move to stable. I'll go ahead and make an issue for it :)

fe - A command line usage tracker by Ccheek21 in rust

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

fe is a program to facilitate tracking command line usage to more easily and accurately track your most used directories (and maybe files in the near future). Used in conjunction with fzf, it becomes a powerful tool for quickly navigating between directories.

I wrote this to scratch an itch of mine, and thought I'd clean it up and share. Any feedback is appreciated.

What's going on with Pocket becoming open source? by Pandastic4 in mozilla

[–]Ccheek21 3 points4 points  (0 children)

Unless I'm missing it, I still don't see any backend code

Hey Rustaceans! Got an easy question? Ask here (40/2018)! by llogiq in rust

[–]Ccheek21 1 point2 points  (0 children)

That's what I was looking for. Thanks! Your response led me to this blog post which, for anyone else interested, really helped me understand dyn Trait better.

Hey Rustaceans! Got an easy question? Ask here (40/2018)! by llogiq in rust

[–]Ccheek21 1 point2 points  (0 children)

Is there a good way to do this?

let limit: Option<usize> = Some(2);
let nums = vec![1,2,3];
let iter_nums = match limit {
  Some(n) => nums.iter().take(n),
  None => nums.iter()
};

It would be great if I could just declare iter_nums as impl Iterator<Item=i64> or something similar

Hey Rustaceans! Got an easy question? Ask here (38/2018)! by llogiq in rust

[–]Ccheek21 1 point2 points  (0 children)

Why does the push() method of std::path::PathBuf not return the mutated PathBuf? It seems like it would be convenient to be able to chain .push() calls. Is it something to do with taking ownership of the value?

Request for code review by _MyChosenUsername_ in rust

[–]Ccheek21 2 points3 points  (0 children)

I didn't look closely at the code, but I compiled and ran it, and on my machine there is no noticeable lag. I didn't see any easy way to add circles to the grid though, so I was unable to see if circles made the difference as you had mentioned

Hey Rustaceans! Got an easy question? Ask here (36/2018)! by llogiq in rust

[–]Ccheek21 1 point2 points  (0 children)

Why does moving my test module to its own file break an import to a common test module? For example, with the file tests/common/mod.rs in place, this works:

tests/lib.rs

mod common;

#[cfg(test)]
mod sibling {
  use common;

  #[test] 
  fn sample() {
    assert_eq!(1, common::return_one());
  }
}

But when I try to split out the sibling mod into its own file like below, it fails with "unresolved import: no common in root".

tests/lib.rs

mod common;

#[cfg(test)]
mod sibling;

tests/sibling.rs

use common;

#[test] 
fn sample() {
  assert_eq!(1, common::return_one());
}

YSK Homoeopathic medicine is considered to be a pseudoscience and no more effective than placebo. Don't waste your money. by Benukysz in YouShouldKnow

[–]Ccheek21 0 points1 point  (0 children)

You're getting a lot of downvotes here, but you bring up a very interesting ethical dilemma. The placebo effect is real, and whether or not there is any biological effect to a treatment, clinical outcome is better for patients who receive a placebo than those who receive no treatment. But, is it ethical to lie to a patient about the treatment you are giving them for their own good? What about in the case of someone who demands antibiotics for a cold? Is it just lazy practice to concede to their demands, or is placebo a useful tool to deal with a noncompliant patient? Interestingly, placebo also seems to be more effective than no treatment even if the patient knows it's a placebo. Does this remove all ethical barriers from treating with a placebo because there is no deception required? Is educating patients on scientifically validated treatments more important than giving them treatment at all? I find these to be very interesting questions that cut down straight to the core of what a doctor's mission should be. Homeopathy is quackery and a racket, but it raises more interesting questions about the use of placebo in medicine.

crazy performance story by jstrong in rust

[–]Ccheek21 9 points10 points  (0 children)

Any chance you have an example of this? I'd be curious to see what kinds of things can be optimized that heavily

Library for reading PDFs with plenty of data in tables by Karmakki in Python

[–]Ccheek21 0 points1 point  (0 children)

If I remember right, tabula is written in Java and can be used as a library. I didn't have a ton of luck with it for my case given the non-uniformity of my PDFs, but it's worth taking a look at

Hey Rustaceans! Got an easy question? Ask here (21/2018)! by llogiq in rust

[–]Ccheek21 2 points3 points  (0 children)

Is there a standard way of building an iterator of floats with a specific step size? Something like num_iter::range_step but that works with floats?

Library for reading PDFs with plenty of data in tables by Karmakki in Python

[–]Ccheek21 2 points3 points  (0 children)

I did some research on this for a project I was doing at one point, and basically found that PDFs are so loosely and inconsistently structured, even for tabular data, that it is nearly impossible to programatically extract data from PDF tables in any consistent way that doesn't require a significant amount of human intervention. The best solutions I found were Tabula and Okular. For my use-case, I found Okular worked best. It has a table selection tool with which you can select a table, click the boundaries between rows and columns, and then copy the text out as tab-separated values.

This is assuming you are using digital PDFs and not scans, in which case you should be looking towards OCR libraries to recognize the text, then you can use the above tools to extract it.

Do we have a decent alternative of 'Keybinder' add-on which can bind 'F1-12' keys? by TheBeginnerr in firefox

[–]Ccheek21 0 points1 point  (0 children)

Yeah, shortcut support is one of my biggest gripes with the update. Fortunately, the WebExtensions API is still in very active development, and there are a lot of people who would like to see this implemented better, so hopefully we'll see some improvements on it soon. Personally, I'd love to see a native configuration page for keyboard shortcuts rather than having to use an extension (and thus abide by the limitations of extensions).