text:
The define_negated_matcher is broken for matchers with named parameters in Ruby 3

If you have a matcher that allows for named parameters, and then you use RSpec::Matchers.define_negated_matcher to create a negated version, the negated version has argument errors when used in Ruby 3. (I have confirmed that this works in Ruby 2.7.6.)
Your environment

Ruby version: 3.0.3
rspec-expectations version: 3.12.0

Steps to reproduce
#!/usr/bin/env ruby
# frozen_string_literal: true

begin
  require "bundler/inline"
rescue LoadError => e
  $stderr.puts "Bundler version 1.10 or later is required. Please update your Bundler"
  raise e
end

gemfile(true) do
  source "https://rubygems.org"

  gem "rspec", "3.12.0" # Activate the gem and version you are reporting the issue against.
end

puts "Ruby version is: #{RUBY_VERSION}"
require 'rspec/autorun'

module ComplexMatchers
  class Match
    include RSpec::Matchers::Composable

    attr_accessor :my_reqs, :my_opts, :my_block

    def initialize(required, **options, &block)
      self.my_reqs = required
      self.my_opts = options
      self.my_block = block
    end

    def matches?(val)
      true
    end
  end

  def complex_match(...)
    Match.new(...)
  end
end

RSpec.describe 'additions' do
  include ComplexMatchers
  RSpec::Matchers.define_negated_matcher :complex_missing, :complex_match

  it 'just succeeds' do
    expect(2).to complex_match("foo", bar: 33, baz: 22)
  end

  it 'succeeds because negated' do
    expect(2).not_to complex_missing("foo", bar: 33, baz: 22)
  end
end

Expected behavior
Both tests pass
Actual behavior
Console output:
Ruby version is: 3.0.3

additions
  just succeeds
  succeeds because negated (FAILED - 1)

Failures:

  1) additions succeeds because negated
     Failure/Error:
       def initialize(required, **options, &block)
         self.my_reqs = required
         self.my_opts = options
         self.my_block = block
       end

     ArgumentError:
       wrong number of arguments (given 2, expected 1)
     # bin/repo_rspec.rb:30:in `initialize'
     # bin/repo_rspec.rb:42:in `new'
     # bin/repo_rspec.rb:42:in `complex_match'
     # /path/to/repro/vendor/ruby/3.0.0/gems/rspec-expectations-3.12.0/lib/rspec/matchers/dsl.rb:39:in `block in alias_matcher'
     # bin/repo_rspec.rb:56:in `block (2 levels) in <main>'
     # /path/to/repro/vendor/ruby/3.0.0/gems/rspec-core-3.12.0/lib/rspec/core/example.rb:263:in `instance_exec'
     # /path/to/repro/vendor/ruby/3.0.0/gems/rspec-core-3.12.0/lib/rspec/core/example.rb:263:in `block in run'
     # /path/to/repro/vendor/ruby/3.0.0/gems/rspec-core-3.12.0/lib/rspec/core/example.rb:511:in `block in with_around_and_singleton_context_hooks'
     # /path/to/repro/vendor/ruby/3.0.0/gems/rspec-core-3.12.0/lib/rspec/core/example.rb:468:in `block in with_around_example_hooks'
     # /path/to/repro/vendor/ruby/3.0.0/gems/rspec-core-3.12.0/lib/rspec/core/hooks.rb:486:in `block in run'
     # /path/to/repro/vendor/ruby/3.0.0/gems/rspec-core-3.12.0/lib/rspec/core/hooks.rb:624:in `run_around_example_hooks_for'
     # /path/to/repro/vendor/ruby/3.0.0/gems/rspec-core-3.12.0/lib/rspec/core/hooks.rb:486:in `run'
     # /path/to/repro/vendor/ruby/3.0.0/gems/rspec-core-3.12.0/lib/rspec/core/example.rb:468:in `with_around_example_hooks'
     # /path/to/repro/vendor/ruby/3.0.0/gems/rspec-core-3.12.0/lib/rspec/core/example.rb:511:in `with_around_and_singleton_context_hooks'
     # /path/to/repro/vendor/ruby/3.0.0/gems/rspec-core-3.12.0/lib/rspec/core/example.rb:259:in `run'
     # /path/to/repro/vendor/ruby/3.0.0/gems/rspec-core-3.12.0/lib/rspec/core/example_group.rb:646:in `block in run_examples'
     # /path/to/repro/vendor/ruby/3.0.0/gems/rspec-core-3.12.0/lib/rspec/core/example_group.rb:642:in `map'
     # /path/to/repro/vendor/ruby/3.0.0/gems/rspec-core-3.12.0/lib/rspec/core/example_group.rb:642:in `run_examples'
     # /path/to/repro/vendor/ruby/3.0.0/gems/rspec-core-3.12.0/lib/rspec/core/example_group.rb:607:in `run'
     # /path/to/repro/vendor/ruby/3.0.0/gems/rspec-core-3.12.0/lib/rspec/core/runner.rb:121:in `block (3 levels) in run_specs'
     # /path/to/repro/vendor/ruby/3.0.0/gems/rspec-core-3.12.0/lib/rspec/core/runner.rb:121:in `map'
     # /path/to/repro/vendor/ruby/3.0.0/gems/rspec-core-3.12.0/lib/rspec/core/runner.rb:121:in `block (2 levels) in run_specs'
     # /path/to/repro/vendor/ruby/3.0.0/gems/rspec-core-3.12.0/lib/rspec/core/configuration.rb:2070:in `with_suite_hooks'
     # /path/to/repro/vendor/ruby/3.0.0/gems/rspec-core-3.12.0/lib/rspec/core/runner.rb:116:in `block in run_specs'
     # /path/to/repro/vendor/ruby/3.0.0/gems/rspec-core-3.12.0/lib/rspec/core/reporter.rb:74:in `report'
     # /path/to/repro/vendor/ruby/3.0.0/gems/rspec-core-3.12.0/lib/rspec/core/runner.rb:115:in `run_specs'
     # /path/to/repro/vendor/ruby/3.0.0/gems/rspec-core-3.12.0/lib/rspec/core/runner.rb:89:in `run'
     # /path/to/repro/vendor/ruby/3.0.0/gems/rspec-core-3.12.0/lib/rspec/core/runner.rb:71:in `run'
     # /path/to/repro/vendor/ruby/3.0.0/gems/rspec-core-3.12.0/lib/rspec/core/runner.rb:45:in `invoke'
     # /path/to/repro/vendor/ruby/3.0.0/gems/rspec-core-3.12.0/lib/rspec/core/runner.rb:38:in `perform_at_exit'
     # /path/to/repro/vendor/ruby/3.0.0/gems/rspec-core-3.12.0/lib/rspec/core/runner.rb:24:in `block in autorun'
     #
     #   Showing full backtrace because every line was filtered out.
     #   See docs for RSpec::Configuration#backtrace_exclusion_patterns and
     #   RSpec::Configuration#backtrace_inclusion_patterns for more information.

Finished in 0.00142 seconds (files took 0.05359 seconds to load)
2 examples, 1 failure

Failed examples:

rspec bin/repo_rspec.rb:55 # additions succeeds because negated

A one-line change turns it green:
-    def initialize(required, **options, &block)
+    def initialize(required, *options, &block)

See this blog post for more info on this topic.

The problem is that they are named parameters, not positional parameters, so that change isn't helpful. (Also wouldn't be helpful in the case where you had variable number of positional parameters as well as named parameters.)

Would you still be able to break RSpec with a less minified example? I suppose you do use those my_opts.

I minified my example from a more complex matcher to make the issue clearer. In the actual matcher, we do use the named parameters values.

named parameters

Do you mean keyword arguments, or just an options hash?
There is some lack of understanding going on. May I kindly ask you to provide your matcher code with no simplifications?

named parameters

Do you mean keyword arguments, or just an options hash?

I am talking about keyword arguments.

There is some lack of understanding going on. May I kindly ask you to provide your matcher code with no simplifications?

I don't see how providing my full matcher would provide fuller clarity for this issue. It would explain why I have a matcher that takes variadic keyword arguments, but that doesn't help point out the issue. From my perspective, the issue seems to be that when RSpec defines the negated matcher, it wraps the original matcher in such a way that prevents it from passing the keyword arguments to the original matcher.

:wave: Sorry you are experiencing this problem, RSpec did not originally officially support keyword arguments to its internals due to our supporting Ruby matrix, as people have grown their usage of them in various places they just worked on Ruby 2.x, the Ruby 3.x changes splitting them out has caused numerous errors due to our "ruby 2 keywords" style usage and this is one. We can't yet solve this by using **kwargs but we can try marking our methods as ruby 2 keywords for Ruby 3, in the mean time you can fix this by making your matcher *args and marking it as ruby2_keywords.

I think #1394 solves this, at least based on my quick tests, please check it out to see if it works with your matcher.

authors: JonRowe bfad pirj

repo: rspec/rspec-expectations


text:
added prune distance to pruneGlobalPlan if robot passed via_point

exposes prune_distance as a ROS parameter.
Please let me know if the allocated position in the structs does not suit you.

thanks for the PR! Unfortunately, there are some conflicts due to some other merged changes. Could you resolve those issues (shouldn't be a big deal)? And mabye, we should rename prune_distance to global_plan_prune_distance to comply with the other global plan related parameters.
Let me know if you are busy to update PR

@croesmann, thanks for the feedback.
I'll update the PR as requested, but will only be able to do so in the week after next, as I don't have a ROS machine with me atm.
So I won't feel hurt if you resolve this yourself ;-) But it is not that urgent for me, so feel free to choose what is more suitable for you.

ok, I did this minor change in the last commit by myself to include this in the next release that I am going to push today. Thanks!
Note, I have not included this parameter in dynamic reconfigure in order to keep the number of parameters low ;-). However, we could add this someday when the parameter is subject to be changed frequently.

Cool. Thx so much! Appreciate your work here :+1:

source: gharchive/pull-request

authors: croesmann mgruhler

license_type: permissive

license_source: bigquery


text:
How can i submite dara to server after completed all step ?

Could you help me please, i just started this jquery-steps, it's nice, but i really wonder how can i pass data to server via Ajax after completed all steps ? I need your help

@khanvuthy You could try the onFinished Event. Documented here https://github.com/rstaib/jquery-steps/wiki/Settings

@simono The problem is that data : null, does jquery-steps have a method for storing the data in fields?

source: gharchive/issue

authors: bgvianyc khanvuthy simono

repo: rstaib/jquery-steps

license: mit


text:
Added support for ISS FPMU

Added support for the Floating Potential Measurement Unit (FPMU) on board the International Space Station (ISS) through CDAWeb.  Currently no cleaning routine.

Coverage decreased (-0.4%) to 80.017% when pulling 06466b76065a9009bd9fdc60bc794491853c9817 on jklenzing:iss into 582e208bb10820805172939cb35383dfbd9f51b8 on rstoneback:master.

I need write access to work on this pull request :-(

Ok, I found where the tests are, and it looks like this should be tested (since there's an exclusion list that removes anything that can't be tested using the standard tests and this isn't on it).  However, running python 2.7 and 3.4, I get 8 testing failures that I'm not sure how to approach.  I think your attention is needed on this, @rstoneback

authors: aburrell coveralls jklenzing

repo: rstoneback/pysat


text:
n_distinct does not accept more than one column

In this example, I am using first dplyr on a data frame and the same code on a spark table.
I have the error Error in n_distinct(Petal_Length, Petal_Width) : unused argument (Petal_Width) with the spark version
library(sparklyr)

sc = spark_connect(master = "local")
iris_df = iris
iris_spark = copy_to(sc, iris, "iris_spark")

iris_df %>%
  group_by(Species) %>%
  summarise(count_unique = n_distinct(Petal.Length, Petal.Width))

iris_spark %>%
  group_by(Species) %>%
  summarise(count_unique = n_distinct(Petal_Length, Petal_Width))

Is there any reason that in Spark we can't use more than one variable in n_distinct ?

I think the issue here is simply that n_distinct is not implemented for remote sources -- dplyr provides n_distinct currently only for local data frames. I think it should be possible for us to add this ourselves, however.

authors: kevinushey ssoulier

repo: rstudio/sparklyr


text:
add Python 3.11 tests to CI

With the release of Python 3.11, it is probably time to add it to CI!

added in #199

repo: rstudio/vetiver-python

license: MIT

license_source: github-api


text:
Build stuck in Triggered state

Details

Project URL: simba-os
Build URL (if applicable): https://readthedocs.org/projects/simba-os/builds/4070274/
Read the Docs username (if applicable): eerimoq

Excepted Result
The documentation is generated.
Actual Result
The build is stuck in Triggered state, and has been like that for the last couple of days.
Thanks for a useful site! I appreciate your work.

same as 2256 & 2255

Closing as duplicate

authors: Grummfy agjohnson eerimoq


text:
building project does not generate new pdf with changes in it

Details
so i have set up a test project on github as well as on read the docs. when i make a change e.g index.rst , and i build it in read the docs then click view docs, it shows the changes perfectly however under downloads, when viewing the pdf version it does not show any changes or the updated version. It only shows the first built version.
Any help?

Same. I'm fairly new to Sphinx/RTD so I'm not sure about what's going on.
When I download the latest pdf build it's still the original blank one, 5 pages long.
Nevertheless, in the build output for command pdflatex, it clearly says the recently built one is 7 pages long.
Build number: #5291065

@Yaseenh @dpdani can you provide more details?

project url
rtd url
build url
what you see and what you expected to see in which specific versions

@humitos
This is the project URL: http://tbb.readthedocs.io/en/latest/
Since the day after I posted the comment, though, the PDF builds fine and correctly updates when I push new code into the GitHub repo.

Great! So, I'm closing this issue. Please, feel free to re-open if you consider.

authors: Yaseenh dpdani humitos


text:
Git submodule error

Details

Project URL: https://readthedocs.org/projects/django-fobi/
Build URL (if applicable): https://readthedocs.org/projects/django-fobi/builds/5767588/
Read the Docs username (if applicable): delusionalinsanity

Expected Result
A description of what you wanted to happen
I expected my documentation to be built.
Actual Result
A description of what actually happened
Instead, I got this error:
Build failed
Error
Failed to import project: Failed to get code from 'https://github.com/barseghyanartur/django-fobi' (git clone): 1 git clone error output: Cloning into 'examples/wagtaildemo'... Permission denied (publickey).
fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists. Clone of 'git@github.com:barseghyanartur/wagtaildemo.git' into submodule path 'examples/wagtaildemo' failed

Hi @barseghyanartur! It seems this problem is already solved since I can see some successful builds of your project. I'm closing this issue. Please, feel free to reopen it if you consider.

@humitos:
It's only because I have switched to BitBucket, which I use as alternative to GitHub for all my open source projects. There I use Mercurial (not Git) and I don't have Git sub-modules there. Thus, the problem remains. It's just I have found a work-around for myself (do not use Git sub-modules, in this particular case).
Simply put, if you try to generate docs (with Read the Docs) from this repository, you'll get the error.
I have no objections of you closing the issue, but there's a bug which isn't yet addressed.

@barseghyanartur thanks for your feedback.
I just import the repo you mentioned in my local instance of RTD and I wasn't able to reproduce this issue. The clone worked properly but it fails with another problem that seems to be tied to the repo itself, not RTD:
Exception occurred:
  File "conf.py", line 24, in <module>
    from nine.versions import DJANGO_LTE_1_7, DJANGO_GTE_1_8, DJANGO_GTE_1_7
ImportError: No module named nine.versions

Please, if you have a way to reproduce the issue let me know so I can work on it.

That's really weird. It fails on django-nine for you, which is a part of install_requires in the setup.py.
In any case, I have just created another copy of the docs with GitHub as a source and guess what - it's passing now.

http://django-fobi-github.readthedocs.io/en/latest/

I don't know what was it, but it seems to be fixed. Thanks for checking!

Thanks!

@humitos:
OK, another FYI update on the issue. I switched back from BitBucket to GitHub and it works, but:
I had to set the Programming Language (in Settings) to Only Words (was Python). Without the change it keeps failing.

Oh, that looks very strange.
Would you mine opening a new issue for that so we track this new error?
Thanks for the update! :)

authors: barseghyanartur humitos


text:
Bump readthedocs-sphinx-ext to 0.5.5 to resolve search issues

Addresses #2708 by using a version of our extension that supports more than one
version of Sphinx.
Refs #1895
Refs #1850
Refs #2755

Looks fine.

authors: agjohnson ericholscher


text:
PyPI version

The PyPI version seems to be fairly out of date (2016) and still rely on commonmark <= 0.5.4, while master seems to have been updated already. Would it be possible that you upload a current version to PyPI?

+1.
Are there any release blockers?

Please can a new version be released to PyPI?

authors: edmorley h-hirokawa tdomhan

repo: rtfd/recommonmark


text:
Proposal: Replace mlm-scoring dependency with better-mlm-scoring

Please Describe The Problem To Be Solved
The current dependency on mlm-scoring introduces a challenge due to its mxnet-cu110 dependency. This is causing compatibility issues with Google Colab and prevents us from updating our software stack. Furthermore, there could be potential improvements in scoring quality.
(Optional): Suggest A Solution
I suggest replacing mlm-scoring with better-mlm-scoring. This library doesn't rely on mxnet-cu110, resolving our compatibility issues. It would also allow us to keep our stack current, and is reported to yield better scoring results. The main trade-off will be the time invested in the transition and subsequent testing.

In fact, we might broaden this to outsource our sentence scoring backend entirely to minicons. If scores are preserved or improved, this change should be accepted.

Closed. See #36 .

repo: ruanchaves/hashformers


text:
some problem about running main.py

Your code is very helpful to me !
When I  run the main.py, I met an error line 351 , it display as follow:
Total_parameters:  22015
penalty_m = np.vstack(penalty_m)
File "E:\Program Files (x86)\anaconda3\envs\gym\lib\site-packages\numpy\core\shape_base.py", line 234, in vstack
return _nx.concatenate([atleast_2d(_m) for _m in tup], 0)
ValueError: need at least one array to concatenate.
I guess at the first epoch, the  variable 'penalty_m' is an empty list,it cannot be used 'np.vstack',can you tell me how to solve the problem? Thank you

hoping that i can get your reply

hoping that i can get your reply,thanks!!

hoping that i can get your reply

你找到问题所在了吗？？

Your code is very helpful to me ! When I run the main.py, I met an error line 351 , it display as follow: Total_parameters: 22015 penalty_m = np.vstack(penalty_m) File "E:\Program Files (x86)\anaconda3\envs\gym\lib\site-packages\numpy\core\shape_base.py", line 234, in vstack return _nx.concatenate([atleast_2d(_m) for _m in tup], 0) ValueError: need at least one array to concatenate. I guess at the first epoch, the variable 'penalty_m' is an empty list,it cannot be used 'np.vstack',can you tell me how to solve the problem? Thank you

I suppose It's because the m is set to zero,so we get the problem, we need add model_1,model_2 etcl before,but I don't know how to add a modle_1 too

这个代码你成功运行了嘛

运行不了啊
发自我的iPhone

在 2022年6月22日，17:06，ltclzw @.***> 写道：

这个代码你成功运行了嘛
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you commented.

请问这个问题有运行成功的吗？

你的代码对我非常有帮助！当我运行 main.py 时，我遇到了错误行 351，它显示如下：Total_parameters：22015 penalty_m = np.vstack（penalty_m） 文件 “E：\Program Files （x86）\anaconda3\envs\gym\lib\site-packages\numpy\core\shape_base.py”，第 234 行，在 vstack 中返回 _nx.concatenate（[atleast_2d（_m） for _m in tup]，0） ValueError：至少需要一个数组来连接。我想在第一个纪元，变量“penalty_m”是一个空列表，它不能使用“np.vstack”，你能告诉我如何解决这个问题吗？谢谢

Your code is very helpful to me ! When I run the main.py, I met an error line 351 , it display as follow: Total_parameters: 22015 penalty_m = np.vstack(penalty_m) File "E:\Program Files (x86)\anaconda3\envs\gym\lib\site-packages\numpy\core\shape_base.py", line 234, in vstack return _nx.concatenate([atleast_2d(_m) for _m in tup], 0) ValueError: need at least one array to concatenate. I guess at the first epoch, the variable 'penalty_m' is an empty list,it cannot be used 'np.vstack',can you tell me how to solve the problem? Thank you

Hello, did you solve this problem?


text:
[Fixes #79] NodePattern: Add support for multiple terms unions

This builds on  #109 and adds { multiple term | another multiple term branch }

Merged 🎉 . To be released tomorrow.

repo: rubocop-hq/rubocop-ast


text:
Fix node_pattern documentation path

Follow https://github.com/rubocop-hq/rubocop-ast/commit/2ca9c08b
This PR fixes node_pattern documentation path and recovers dead link on the following document page.
https://docs.rubocop.org/rubocop-ast/1.0/node_pattern_compiler.html

Nice catch!

authors: bbatsov koic


text:
Release 2.0

Prepare for a 2.0 release.
This PR is to track the changes in release-2.0 branch, which is purposed to integrate remaining PRs targeted for 2.0.

I have taken a look at the remaining pull requests before 2.0, and tried to put them in order:

#942: Add mixins folder (Can be done before or after #969)
#956: RSpec aliases runtime matchers – needs to be done before
#1007: Drop RSpec/EmptyExampleGroup customization (Blocked by #956)
#967: Optimize Base#relevant_rubocop_rspec_file? (Blocked by #956)
#1013: Add v2 update docs
#1055: Release 2.0

Awesome!
I can take care of making final touches to #956. I really hope it doesn't interfere with #942 :scream:

Would you like me to take a stab at rebasing #942?

I can take care of making final touches to #956. I really hope it doesn't interfere with #942 😱

It looks like there will only be conflicts in lib/rubocop/rspec/top_level_group.rb and lib/rubocop/rspec/variable.rb. It looks like minor stuff. I think it’s still worth it to work in parallel. You take #956, I take #942.

Sounds good :+1:

@pirj I wish GitHub offered a way of communicating 1:1, synchronously 😄 I’ll try signing onto gitter.im, you can catch me there if you want.

I added a commit to bump the version number to 2.0.0. Are we ready? Are there any easy-peasy bugfix PRs that we want to also merge in?

Should we link to @pirj ’s upgrade document

Great idea!

Are we ready?

YES! 🚀  🙌

I guess this should be fixed first

@Darhazer, green light for the release?

Hey @backus!
Summoning you not only to notify you about an upcoming major version release of a child of yours.
We seem to lack CodeClimate keys, do you mind to invite @bquorning, @Darhazer and myself @pirj there as collaborators?

@Darhazer, green light for the release?

I trust you @pirj and @bquorning on this one. Release at your will and thank you for the hard work to make it happen :tada:

Gem
GH release
Docs

Did I miss anything? Except saying a bit thank you to everyone who helped getting us this far.

Awesome! Congrats with the release, guys!

Closed a dozen tickets, mostly thanks to #956 🎉

authors: Darhazer bquorning pirj

repo: rubocop-hq/rubocop-rspec


text:
Layout/ClosingHeredocIndentation and <<

Expected behavior
def foo
  <<STR
bar
STR
end

No offense should be detected here, since << heredocs must end with an unindented identifier (here STR). Only <<- or <<~ heredocs allow indentation of the closing indentifier.
Actual behavior
One offense is found:
C: Layout/ClosingHeredocIndentation: STR is not aligned with <<STR.
STR
^^^

Steps to reproduce the problem
Run rubocop --only Layout/ClosingHeredocIndentation on a file with the above contents.
RuboCop version
Include the output of rubocop -V. Here's an example:
$ rubocop -V
0.57.1 (using Parser 2.5.1.0, running on ruby 2.5.1 x86_64-darwin15)

I added a PR to have Layout/ClosingHeredocIndentation skip << heredocs.

authors: bquorning dvandersluis

repo: rubocop-hq/rubocop


text:
No way to disable Metrics/LineLength for shebang line

Is your feature request related to a problem? Please describe.
I don't think I can disable the Metrics/LineLength for just the shebang line.
(If it helps, the shebang line in question is #!/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/bin/ruby --disable-gems. The reason I'm doing this is to reference the system Ruby on macOS while bypassing the users gem environment.)
Describe the solution you'd like
I'd like to be able to disable Metrics/LineLength for just the shebang line. Really I think this should be Rubocops default behavior, Metrics/LineLength shouldn't apply to a shebang line because it's not Ruby source code, and it can't reliably be shortened. But if it were a configuration option, I'd say having a syntax for it in disabling cops within source code would be nice.
Thanks!

The Metrics/LineLength cop can be configured to ignore lines that match certain patterns. Maybe that would help you?
Metrics/LineLength:
  IgnoredPatterns:
    - ^#!

@buehmann Thanks Andreas! I tried this approach out and it seems like a good workaround for my situation. I still think ideally the shebang should be ignored by default, so I'll leave the issue open for however the maintainers want to handle it. Thanks and cheers!

@robenkleene You're welcome. And I have good news: I saw this PR this morning: https://github.com/rubocop-hq/rubocop/pull/7232

authors: buehmann robenkleene


text:
error on repo.first.subject in example

…/vendor/cache/ruby/2.3.0/gems/rdf-2.2.11/lib/rdf/model/dataset.rb:67:in each_statement': undefined method each' for nil:NilClass (NoMethodError)     from …/vendor/cache/ruby/2.3.0/gems/rdf-2.2.11/lib/rdf/mixin/queryable.rb:172:in first'
from test-store.rb:24:in <main>'
fwiw repo.first_subject works

This particular error is in RDF.rb, not rdf-do. The error likely results from an issue in rdf-do originally, but it's shown up in other gems, and RDF.rb should provide a more meaningful error.
This gem has languished and does not pass specs, so it needs more attention.
From the original email:

Though imho this info could feature more prominently in the initial README at https://github.com/ruby-rdf/rdf in the tutorial section in between "Using RDF.rb and Spira to process RDF data from the British Ordnance Survey" and "Getting started with RDF and SPARQL using 4store and RDF.rb"?

Specifically the Using code from https://github.com/ruby-rdf/rdf-do:

require 'rdf'
require 'rdf/ntriples'
require 'data_objects'
require 'do_sqlite3'
require 'rdf/do'

repo = RDF::DataObjects::Repository.new uri: 'sqlite3:test.db'
# repo = RDF::DataObjects::Repository.new uri: 'postgres://postgres@server/database'
# heroku_repo = RDF::DataObjects::Repository.new uri: ENV['DATABASE_URL']
repo.load('http://datagraph.org/jhacker/foaf.nt')

# How many statements did we have?
repo.count
#=> 10

# Get the URI of the first subject
jhacker = repo.first.subject
#=> #<RDF::URI(http://datagraph.org/jhacker/foaf)>

# Delete everything to do with it
jhacker_statements = repo.query(subject: jhacker)
repo.delete *jhacker_statements
repo.count
#=> 7

# with Postgres, we could have done this, but SQLite gives us a locking error:
# repo.delete(*repo.query(subject: jhacker))

# Changed our mind--bring it back
repo.insert *jhacker_statements
repo.count
#=> 10

Having said that I'm getting an error on repo.first.subject

  …/vendor/cache/ruby/2.3.0/gems/rdf-2.2.11/lib/rdf/model/dataset.rb:67:in `each_statement': undefined method `each' for nil:NilClass (NoMethodError)
      from …/vendor/cache/ruby/2.3.0/gems/rdf-2.2.11/lib/rdf/mixin/queryable.rb:172:in `first'
      from test-store.rb:24:in `<main>'

Is there anything I can do to help bring rdf-do up to spec Gregg?

As you might have seen, specs are not passing with essentially the same error you reported. Also, we've never configured Postgress on Travis.
The Statement#to_hash deprecation messages are indicative of calls to an interface that automatically invokes that deprecated interface, due to a **options argument and that the statement is the last argument. Probably best for me or @no-reply to track this down, as it's part of a general update.
As you can tell, this gem has languished, due to general lack of use. Generally, for a simple and more performant option, I use rdf-mongo. I also think that a file-backed (or other persistent store) version of the base RDF::Repository (or similar) would provide great performance and satisfy what you're interested.
That said, we do need to get rdf-do working, so whatever you would like to contribute, in terms of a PR, would be helpful.
In the mean time, I'll track down the DEPRECATION issue, which may solve a bunch of problems.

It seems that the problem is because RDF::DataObjects::Repository implements #each, and RDF::Dataset implements #each_statement. The header of RDF::Enumerable says that implementation should implement #each, but when we introduced RDF::Dataset, it implemented #each_statement, instead of #each.
See ruby-rdf/rdf#365.

BTW, fixing this allows all but one spec to pass in Sqlite3, that being repository count:
  1) RDF::DataObjects::Repository The SQLite adapter behaves like an RDF::Repository as dataset behaves like an RDF::Dataset when enumerating statements behaves like an RDF::Enumerable when enumerating terms #each_term has correct number of terms
     Failure/Error: DEFAULT_FAILURE_NOTIFIER = lambda { |failure, _opts| raise failure }

       expected: 98
            got: 101

I've seen these before in other repos (e.g., rdf-aggregate-repo), and should look there to see how the issue was resolved.

Do you want me to have a go at fixing it, or are you on top of it? I know you that

Probably best for me or @no-reply to track this down, as it's part of a general update.

but if you want me to take a look at it I will.
I'd need to know how to run the specs for rdf-do locally, am unsure how to do that. I'll tell you why I like using the Sqlite back-end rather than a simple file or Mongo. The reason is that when I'm using Rails in dev mode Sqlite is already automatically being used. That means I point th triplestore repo at the dev Sqlite db and have the triples table quad in the same db as the resource table that I use for tracking local resources. Makes sense, no?
Anyway, thanks for following so quickly – as has been my experience with Ruby-RDF in the past :+1:

I'm giving @no-reply a bit more time to respond to ruby-rdf/rdf#365 (PR ruby-rdf/rdf#366) before I merge it, as he did the RDF::Dataset work. You could either work against that branch, or wait for the merge and then look at the failing spec. It would also be great to get Postgres support working, particularly on Travis, for which there are probably some existing recipes.
Note that DataObjects hasn't been updated in a while, and you'll get numerous warnings when running on a Ruby 2.4 code base, but it functions okay. Unfortunately, the release hasn't had much attention. It may be that it's time to deprecate rdf-do, and simply use the sqlite3 gem directly; same could be done for other database backends, but I don't see evidence for Postgres use with RDF.rb.

I went ahead and merged #366.
I'm open minded about how to handle bringing this gem up to date and willing to throw some cycles at it if we can get a sense of what would be most valuable to the community.

The update to RDF.rb has been pushed, so this gem should work reasonably, other than deprecation messages issued by data_objects (which is way out of date) and the above mentioned error. @igravious if you'd like to track this down, and potentially see about Postgres going on Travis, that would be great.

authors: gkellogg igravious no-reply

repo: ruby-rdf/rdf-do

license: unlicense


text:
VALUES statements

I just ran into a situation where I unfortunately had to abandon sparql-client for a query because I needed to restrict one of the variables using a VALUES list. Is there any chance of supporting this in a future version?

@no-reply @gkellogg I'm willing to take a stab at this. I'm curious what you think of the proposed syntax in this gist have a few ?'s in there.

Thanks @mcritchlow, I need to consider this a bit more, but it looks promising.
Have you posted a public domain dedication as called for in the README? If not, please do so. Also add yourself to the Contributors list.

@gkellogg thanks, sounds good. I'll sort out the public domain dedication in the meantime.

Closed via f15dec52a4366d94a557282ccbdbb3df76644b79.

authors: ashmoran gkellogg mcritchlow

repo: ruby-rdf/sparql-client


text:
Import prime files from ruby/rbs

from https://github.com/ruby/rbs/pull/1355

Note: We lost test case of test/stdlib/Prime_test.rb from ruby/rbs. I have no idea how import it to this repository.


text:
Split warning and error reporting

This has the side effect of using parser instead of the error list directly making arena allocation easier.
Alternative to make https://github.com/ruby/yarp/pull/1395 easier.

Closing for now due to conflicts. Will reopen later with updated.

repo: ruby/yarp


text:
Refactor internals and improve RSpec support

This PR refactors Stimpack and breaks the initialization step into 2 process: non-Rails and Rails. The non-rails part simply provides packs and pack traversal. When Rails is involved, we inject the packs into Rails (along with Engine support). This helps us extract the RSpec helper so that it works without Rails booting.
Fixes #15
For better RSpec support, you now have to --require stimpack/rspec. You can add this to .rspec or add it to your command line: bundle exec rspec --require stimpack/rspec ...
This allows Stimpack to hook into RSpec before files are resolved. Because of this, we're now able to do some fancy stuff:
(This assumes you've added --require stimpack/rspec to .rspec)
bundle exec rspec #=> Runs _all_ specs in your entire application (packs and all)
bundle exec rspec spec/some/specific_spec.rb #=> Runs just that one test
bundle exec rspec packs/foobar #=> Runs all specs under the foobar pack _and_ all the specs of its nested packs
bundle exec rspec packs/foobar pack/binbaz #=> same as above but also adds the binbaz pack
bundle exec rspec packs/foobar/spec #=> Runs all spec files inside the "packs/foobar/spec" directory
bundle exec rspec packs/foobar/nested_pack #=> Runs all specs under the "packs/foobar/nested_pack" pack

For better RSpec support, you now have to --require stimpack/rspec.

"You now have to" => "You now can" ?
It's unclear to me if this is required for rspec support or if not, under what conditions it's recommended, and what it adds.
bundle exec rspec #=> Runs _all_ specs in your entire application (packs and all)
bundle exec rspec spec/some/specific_spec.rb #=> Runs just that one test
bundle exec rspec packs/foobar #=> Runs all specs under the foobar pack _and_ all the specs of its nested packs
bundle exec rspec packs/foobar pack/binbaz #=> same as above but also adds the binbaz pack
bundle exec rspec packs/foobar/spec #=> Runs all spec files inside the "packs/foobar/spec" directory
bundle exec rspec packs/foobar/nested_pack #=> Runs all specs under the "packs/foobar/nested_pack" pack

I think this would actually be great to add to the README 🤔 Then again, this feels like mostly just rspec API, but we do seem to be adding a bit of behavior on top of this.

If we are requiring the user to add this new flag for rspec support, should we bump the major version? Or are we saying that not adding that flag, it continues to either work or not work as before, but adding that flag makes something new work? If so, it wouldn't be a breaking change.

authors: AlexEvanczuk ngan

repo: rubyatscale/stimpack


text:
Remove firstissue.dev Google Analytics tag

Hello, and thanks for forking first-issue!
Can you please remove my Google Analytics tag from your fork?
https://github.com/rubyforgood/happycommits/blob/bd24cb960c7ccd1873a7ff9f07aa564788f5e4b3/pages/_document.tsx#L37-L49.

Done!

authors: lucavallin seanmarcia

repo: rubyforgood/happycommits


text:
Require partners to have at least one social media, if banks want it

From July 13 2022 partnerbase working group meeting (CL/Rachel(PDx))
Updating the social media section, and making it mandatory if the partners see it at all
Is there a pain point in the app driving this feature request?
Modernization (i.e catching up with social media reality)
Desired Behavior

Add instagram to media section [text field]
Add no social media presence checkbox to media section
If partners are shown media section [see partner forms], at least one field in the media section must be filled in.

Criteria for Completion

[ ] Add instagram to media section [text field]
[ ] Add no social media presence checkbox to media section
[ ]  If and only if partners are shown media section [see partner forms], at least one field in the media section must be filled in.
[ ] Tests showing that it all works.

Anything else?
Code of Conduct

[ ] I've read the Code of Conduct and understand my responsibilities as a member of the Ruby for Good community

Hello, I'll volunteer to take this on.

Criteria for Completion

[x] Add instagram to media section [text field]
[ ] Add no social media presence checkbox to media section
[ ] If and only if partners are shown media section [see partner forms], at least one field in the media section must be filled in.
[ ] Tests showing that it all works.

I can work on this.

Excellent!  Thanks.

This is still being worked on.

authors: Learningstuff98 cielf creaturenex

repo: rubyforgood/human-essentials


text:
do user research

define research questions, e.g. how many languages do already registred speakers speak?
define methods e.g. user survey or qualitative interview, database request, piwik data

Question for organizers concerning search:

Which information about a speaker you want to see at a first glance in the listing of the results?
What are typical research questions?
How do you want to browse speakers?
What do you decide about contacting a speaker?
How much time do you have for your research?

Ame:

As a researcher/organizer you are visiting the site: https://speakerinnen.org/en/categories/10
What kind of profile are you expecting to find?
What do you think of the content of the tag cloud below? Does it meet your expectations?

expect to find topic related profiles (companies/startups)
extremly long list of profiles (should be around 50)
extremly long list of topics inside profiles (can we limit them)?
probably cool to have a breadcrumb to see where we you are
language mixture no problem
probably it would be cool to have an interactive possibility to see other language tags (if we decide to limit the tags to the locale)
show relative size of topics, e.g. through count of usage - social media (22)

As a researcher/organizer you are looking for german or english language speaking people for the topic programmieren / programming.
What kind of autosuggest do you expect?
What kind of search results do you expect?

autosuggest is a little bit slow
if you are on results page: show query somewhere and if possible: show other options you got via autosuggest

As a speaker you are editing your profile. How and where do you expect to add your tags if you have a german and english language account? How do you expect your profile to be displayed in the english locale, how in the german?

it should be possible to use different tags in different languages
if you have already edited profile in one language copy tags to next language (speaker can remove and translate them) --> what does autosuggest suggest then? Only tags with current language?

conference organizer:

As a researcher/organizer you are visiting the site: https://speakerinnen.org/en/categories/10What kind of profile are you expecting to find

I am expecting the name, job description (if relevant), company (if relevant, could help), language/s, topics, level of the talk topics (beginner friendly, intermediate, advanced, keynote), (social) media link (twitter (!!!), github, blog, link to articles)
position in job: senior, junior, trainee, student, researcher, Phd, freelance (if relevant for the topic)
inspirational or technical talks- community "membership"
links to slide(s) / video(s) / stream(s) to the talks (if you click on the profile) What do you think of the content of the tag cloud below? Does it meet your expectations?The tag cloud has still lot's of German tags such as: Achtsamkeit, Frauen in Führungspositionen, Persönlichkeitsentwicklung, etc...
Would be great if German words could be filtered but it doesn't bother- And I didn't really understand why some words are bigger than others: Do you find more talks if the word has bigger letters?
And alphabetical order seems like a good idea

As a organizer you are looking for german or english language speaking people for the topic programmieren / programming.

English / doesn't have to be native
What kind of autosuggest do you expect?
When I am typing Andr...; it's suggested Android and it's exactly what I am expecting. Also when I am typing develop.., it autosuggests software developer. That seems logically to me. What kind of search results do you expect?

When I am clicking enter after typing developer. I would expect more than Countries, Cities, LanguagesI hoped for more tag suggestions such as: Java, frontend, backend, phython, etc...
Or basically I hoped that the systems would have asked me to be more specific

As a speaker you are editing your profile. How and where do you expect to add your tags if you have a german and english language account? How do you expect your profile to be displayed in the english locale, how in the german?  don't have a profile
--


text:
Configure tests for React and complete tests for login page

Description
As the title suggests, we want to be able to write comprehensive tests for our login page and home page.

Survey RTL or similar testing libraries
Implement test cases for login and home page
Add CI for test coverage metric (as stated in #1)

Motivation
Code quality purposes.
Change
A corresponding .test.tsx file will need to be created for every React component. Ensure that the CI passes before merging.

@maany
Please assign this to me, thanks!

repo: rucio/webui


text:
chore: release 0.1.3

:robot: I have created a release beep boop
0.1.3 (2023-09-06)
Bug Fixes

unmarshalling info and config (9776361)

Miscellaneous

improve error logging (2a96bc2)

This PR was generated with Release Please. See documentation.

:robot: Release is at https://github.com/rudderlabs/compose-test/releases/tag/v0.1.3 :sunflower:

repo: rudderlabs/compose-test


text:
Results reproducibility

Hello, @ruinmessi. Thank you for great research and open source implementation of paper. I tried your implementation on COCO and was disappointed by results.
Shortly, I used your code (without any changes) and your weights for validation on COCO 2014 minival and got next results.
For RBF512-E:
alexkirnas@dev:~/Projects/RFBNet$ CUDA_VISIBLE_DEVICES='0' python test_RFB.py -d COCO \
-v RFB_E_vgg -s 512 --trained_model ./weights/RFB512_E_34_4.pth --save_folder=./eval

....
A lot strings
....

~~~~ Summary metrics ~~~~
 Average Precision  (AP) @[ IoU=0.50:0.95 | area=   all | maxDets=100 ] = 0.186
 Average Precision  (AP) @[ IoU=0.50      | area=   all | maxDets=100 ] = 0.273
 Average Precision  (AP) @[ IoU=0.75      | area=   all | maxDets=100 ] = 0.204
 Average Precision  (AP) @[ IoU=0.50:0.95 | area= small | maxDets=100 ] = 0.137
 Average Precision  (AP) @[ IoU=0.50:0.95 | area=medium | maxDets=100 ] = 0.271
 Average Precision  (AP) @[ IoU=0.50:0.95 | area= large | maxDets=100 ] = 0.271
 Average Recall     (AR) @[ IoU=0.50:0.95 | area=   all | maxDets=  1 ] = 0.287
 Average Recall     (AR) @[ IoU=0.50:0.95 | area=   all | maxDets= 10 ] = 0.430
 Average Recall     (AR) @[ IoU=0.50:0.95 | area=   all | maxDets=100 ] = 0.484
 Average Recall     (AR) @[ IoU=0.50:0.95 | area= small | maxDets=100 ] = 0.250
 Average Recall     (AR) @[ IoU=0.50:0.95 | area=medium | maxDets=100 ] = 0.521
 Average Recall     (AR) @[ IoU=0.50:0.95 | area= large | maxDets=100 ] = 0.686

For RBF-Mobile:
alexkirnas@dev:~/Projects/RFBNet$  CUDA_VISIBLE_DEVICES='0' python test_RFB.py -d COCO \
-v RFB_mobile -s 300 --trained_model ./weights/RFB_mobile_20_7.pth --save_folder=./eval
....
A lot strings
....

~~~~ Summary metrics ~~~~
 Average Precision  (AP) @[ IoU=0.50:0.95 | area=   all | maxDets=100 ] = 0.135
 Average Precision  (AP) @[ IoU=0.50      | area=   all | maxDets=100 ] = 0.217
 Average Precision  (AP) @[ IoU=0.75      | area=   all | maxDets=100 ] = 0.144
 Average Precision  (AP) @[ IoU=0.50:0.95 | area= small | maxDets=100 ] = 0.015
 Average Precision  (AP) @[ IoU=0.50:0.95 | area=medium | maxDets=100 ] = 0.159
 Average Precision  (AP) @[ IoU=0.50:0.95 | area= large | maxDets=100 ] = 0.258
 Average Recall     (AR) @[ IoU=0.50:0.95 | area=   all | maxDets=  1 ] = 0.207
 Average Recall     (AR) @[ IoU=0.50:0.95 | area=   all | maxDets= 10 ] = 0.300
 Average Recall     (AR) @[ IoU=0.50:0.95 | area=   all | maxDets=100 ] = 0.311
 Average Recall     (AR) @[ IoU=0.50:0.95 | area= small | maxDets=100 ] = 0.035
 Average Recall     (AR) @[ IoU=0.50:0.95 | area=medium | maxDets=100 ] = 0.328
 Average Recall     (AR) @[ IoU=0.50:0.95 | area= large | maxDets=100 ] = 0.584

Note: I run code on Python 3.6 with newest PyTorch (v 0.3.0, installed via pip) and CUDA8.0.
This results is to much different from reported one in the paper so this is cannot be connected with usage of different data (your report results on trainval35k set). Can you reproduce your results with newest PyTorch?
Thanks,
Alex

@ALEXKIRNAS I reproduced RBF512-E results on 2014minival as follows, and no problem occured.
~~~~ Summary metrics ~~~~
 Average Precision  (AP) @[ IoU=0.50:0.95 | area=   all | maxDets=100 ] = 0.341
 Average Precision  (AP) @[ IoU=0.50      | area=   all | maxDets=100 ] = 0.547
 Average Precision  (AP) @[ IoU=0.75      | area=   all | maxDets=100 ] = 0.361
 Average Precision  (AP) @[ IoU=0.50:0.95 | area= small | maxDets=100 ] = 0.183
 Average Precision  (AP) @[ IoU=0.50:0.95 | area=medium | maxDets=100 ] = 0.375
 Average Precision  (AP) @[ IoU=0.50:0.95 | area= large | maxDets=100 ] = 0.486
 Average Recall     (AR) @[ IoU=0.50:0.95 | area=   all | maxDets=  1 ] = 0.288
 Average Recall     (AR) @[ IoU=0.50:0.95 | area=   all | maxDets= 10 ] = 0.445
 Average Recall     (AR) @[ IoU=0.50:0.95 | area=   all | maxDets=100 ] = 0.476
 Average Recall     (AR) @[ IoU=0.50:0.95 | area= small | maxDets=100 ] = 0.282
 Average Recall     (AR) @[ IoU=0.50:0.95 | area=medium | maxDets=100 ] = 0.509
 Average Recall     (AR) @[ IoU=0.50:0.95 | area= large | maxDets=100 ] = 0.639

I am not sure about what happens in your results. I suggests you choose your dataset annotations first, and then recompile the nms code. Also you can try the "time" branch of this repo.

@ALEXKIRNAS I reproduced RBF512-E results on 2014minival as follows, and no problem occured.
~~~~ Summary metrics ~~~~
 Average Precision  (AP) @[ IoU=0.50:0.95 | area=   all | maxDets=100 ] = 0.341
 Average Precision  (AP) @[ IoU=0.50      | area=   all | maxDets=100 ] = 0.547
 Average Precision  (AP) @[ IoU=0.75      | area=   all | maxDets=100 ] = 0.361
 Average Precision  (AP) @[ IoU=0.50:0.95 | area= small | maxDets=100 ] = 0.183
 Average Precision  (AP) @[ IoU=0.50:0.95 | area=medium | maxDets=100 ] = 0.375
 Average Precision  (AP) @[ IoU=0.50:0.95 | area= large | maxDets=100 ] = 0.486
 Average Recall     (AR) @[ IoU=0.50:0.95 | area=   all | maxDets=  1 ] = 0.288
 Average Recall     (AR) @[ IoU=0.50:0.95 | area=   all | maxDets= 10 ] = 0.445
 Average Recall     (AR) @[ IoU=0.50:0.95 | area=   all | maxDets=100 ] = 0.476
 Average Recall     (AR) @[ IoU=0.50:0.95 | area= small | maxDets=100 ] = 0.282
 Average Recall     (AR) @[ IoU=0.50:0.95 | area=medium | maxDets=100 ] = 0.509
 Average Recall     (AR) @[ IoU=0.50:0.95 | area= large | maxDets=100 ] = 0.639

I am not sure about what happens in your results. I suggest you check your dataset annotations first, and then recompile the nms code. Also you can try the "time" branch of this repo.

@ALEXKIRNAS I reproduced RBF512-E results on 2014minival as follows, and no problem occured.
~~~~ Summary metrics ~~~~
 Average Precision  (AP) @[ IoU=0.50:0.95 | area=   all | maxDets=100 ] = 0.341
 Average Precision  (AP) @[ IoU=0.50      | area=   all | maxDets=100 ] = 0.547
 Average Precision  (AP) @[ IoU=0.75      | area=   all | maxDets=100 ] = 0.361
 Average Precision  (AP) @[ IoU=0.50:0.95 | area= small | maxDets=100 ] = 0.183
 Average Precision  (AP) @[ IoU=0.50:0.95 | area=medium | maxDets=100 ] = 0.375
 Average Precision  (AP) @[ IoU=0.50:0.95 | area= large | maxDets=100 ] = 0.486
 Average Recall     (AR) @[ IoU=0.50:0.95 | area=   all | maxDets=  1 ] = 0.288
 Average Recall     (AR) @[ IoU=0.50:0.95 | area=   all | maxDets= 10 ] = 0.445
 Average Recall     (AR) @[ IoU=0.50:0.95 | area=   all | maxDets=100 ] = 0.476
 Average Recall     (AR) @[ IoU=0.50:0.95 | area= small | maxDets=100 ] = 0.282
 Average Recall     (AR) @[ IoU=0.50:0.95 | area=medium | maxDets=100 ] = 0.509
 Average Recall     (AR) @[ IoU=0.50:0.95 | area= large | maxDets=100 ] = 0.639

I am not sure about what happens in your results. I suggest you check your dataset annotations first, and then recompile the nms code. Also you can try the "time" branch of this repo, which uses a new pytorch gpu nms version.

@ruinmessi,@ALEXKIRNAS ,how about the result of voc2007 AP75?could you share your result?

@gittigxuy I have not test it yet, you can just modify the parameter of evaluation code in voc0712.py for AP75.

authors: ALEXKIRNAS gittigxuy ruinmessi

repo: ruinmessi/RFBNet


text:
Added 6px font for enumeration

This font should look readable on very los-res .png files with patterns and on big ones. I removed top padding since it caused numbers to "leak" from their cells.
Please look at the code carefully, it was stackoverflow-driven developed :skull:

Okay. I'm not sure what to do now since you've already fixed it.

repo: rumkit/PixelPixie


text:
[Question]: Multiple unncesssary requests made

Question Validation

[X] I have searched both the documentation and discord for an answer.

Question
I have a simple streamlit app below. This generally works and uses the SQLAutoVectorQueryEngine to merge a SQL database of stackoverflow answers and a vector index of hacker news posts.
The issue is when i run the query it issues every request upto 8 times. This causes openai to error with 429s.
INFO:llama_index.core.query_engine.sql_join_query_engine:> Querying SQL database: This choice is most relevant because it involves translating a natural language query into a SQL query over a table containing surveys. This could potentially allow us to find out the top 3 web technologies people most want to use.
> Querying SQL database: This choice is most relevant because it involves translating a natural language query into a SQL query over a table containing surveys. This could potentially allow us to find out the top 3 web technologies people most want to use.
> Querying SQL database: This choice is most relevant because it involves translating a natural language query into a SQL query over a table containing surveys. This could potentially allow us to find out the top 3 web technologies people most want to use.
> Querying SQL database: This choice is most relevant because it involves translating a natural language query into a SQL query over a table containing surveys. This could potentially allow us to find out the top 3 web technologies people most want to use.
> Querying SQL database: This choice is most relevant because it involves translating a natural language query into a SQL query over a table containing surveys. This could potentially allow us to find out the top 3 web technologies people most want to use.
> Querying SQL database: This choice is most relevant because it involves translating a natural language query into a SQL query over a table containing surveys. This could potentially allow us to find out the top 3 web technologies people most want to use.
> Querying SQL database: This choice is most relevant because it involves translating a natural language query into a SQL query over a table containing surveys. This could potentially allow us to find out the top 3 web technologies people most want to use.
> Querying SQL database: This choice is most relevant because it involves translating a natural language query into a SQL query over a table containing surveys. This could potentially allow us to find out the top 3 web technologies people most want to use.
> Querying SQL database: This choice is most relevant because it involves translating a natural language query into a SQL query over a table containing surveys. This could potentially allow us to find out the top 3 web technologies people most want to use.
HTTP Request: POST https://api.openai.com/v1/chat/completions "HTTP/1.1 200 OK"
HTTP Request: POST https://api.openai.com/v1/chat/completions "HTTP/1.1 200 OK"
HTTP Request: POST https://api.openai.com/v1/chat/completions "HTTP/1.1 200 OK"
HTTP Request: POST https://api.openai.com/v1/chat/completions "HTTP/1.1 200 OK"
HTTP Request: POST https://api.openai.com/v1/chat/completions "HTTP/1.1 200 OK"
HTTP Request: POST https://api.openai.com/v1/chat/completions "HTTP/1.1 200 OK"
HTTP Request: POST https://api.openai.com/v1/chat/completions "HTTP/1.1 200 OK"
HTTP Request: POST https://api.openai.com/v1/chat/completions "HTTP/1.1 200 OK"

I can't reproduce this outside of Streamlit.
import logging
import sys

import streamlit as st
from clickhouse_connect import common
from llama_index.legacy.embeddings import FastEmbedEmbedding
from llama_index.llms.openai import OpenAI

from llama_index.core import VectorStoreIndex, PromptTemplate
from llama_index.core import Settings
from llama_index.core.indices.struct_store import NLSQLTableQueryEngine
from llama_index.core.indices.vector_store import VectorIndexAutoRetriever
from llama_index.core.prompts import PromptType
from llama_index.core.query_engine import RetrieverQueryEngine, SQLAutoVectorQueryEngine
from llama_index.core.tools import QueryEngineTool
from llama_index.core.vector_stores.types import VectorStoreInfo, MetadataInfo
from llama_index.vector_stores.clickhouse import ClickHouseVectorStore
import clickhouse_connect
import openai
from sqlalchemy import (
    create_engine,
)
from llama_index.core import SQLDatabase

logging.basicConfig(stream=sys.stdout, level=logging.INFO)
logging.getLogger().addHandler(logging.StreamHandler(stream=sys.stdout))

host = "localhost"
password = ""
username = "default"
secure = True
http_port = 8123
native_port = 9000
open_ai_model = "gpt-4"

hackernews_table = "hackernews_llama"
stackoverflow_table = "surveys"
database = "default"

Settings.embed_model = FastEmbedEmbedding(
            model_name="sentence-transformers/all-MiniLM-L6-v2",
            max_length=384,
        )

CLICKHOUSE_TEXT_TO_SQL_TMPL = (
    "Given an input question, first create a syntactically correct ClickHouse SQL "
    "query to run, then look at the results of the query and return the answer. "
    "You can order the results by a relevant column to return the most "
    "interesting examples in the database.\n\n"
    "Never query for all the columns from a specific table, only ask for a "
    "few relevant columns given the question.\n\n"
    "Pay attention to use only the column names that you can see in the schema "
    "description. "
    "Be careful to not query for columns that do not exist. "
    "Pay attention to which column is in which table. "
    "Also, qualify column names with the table name when needed. \n"
    "If needing to group on Array Columns use the ClickHouse function arrayJoin e.g. arrayJoin(columnName) \n"
    "For example, the following query identifies the most popular database:\n"
    "SELECT database_want_to_work_with, count(*) AS count FROM so_surveys GROUP BY "
    "arrayJoin(database_want_to_work_with) AS database_want_to_work_with ORDER BY count DESC LIMIT 1\n"
    "You are required to use the following format, each taking one line:\n\n"
    "Question: Question here\n"
    "SQLQuery: SQL Query to run\n"
    "SQLResult: Result of the SQLQuery\n"
    "Answer: Final answer here\n\n"
    "Only use tables listed below.\n"
    "{schema}\n\n"
    "Question: {query_str}\n"
    "SQLQuery: "
)

CLICKHOUSE_TEXT_TO_SQL_PROMPT = PromptTemplate(
    CLICKHOUSE_TEXT_TO_SQL_TMPL,
    prompt_type=PromptType.TEXT_TO_SQL,
)

st.set_page_config(
    page_title="Get summaries of Hacker News posts enriched with Stackoverflow survey results, powered by LlamaIndex and CLickHouse",
    page_icon="🦙🚀", layout="centered", initial_sidebar_state="auto", menu_items=None)
st.title("💬HackBot powered by LlamaIndex 🦙 and ClickHouse 🚀")
st.info(
    "Check out the full [blog post](https://blog.streamlit.io/build-a-chatbot-with-custom-data-sources-powered-by-llamaindex/) for this app",
    icon="📃")
st.caption("A streamlit chatbot for Hacker News powered by 💬🦙 and ClickHouse 🚀")

# What are people saying about ClickHouse?
@st.cache_resource
def clickhouse():
    common.set_setting('autogenerate_session_id', False)
    return clickhouse_connect.get_client(
        host=host, port=http_port, username=username, password=password,
        secure=secure
    )

@st.cache_resource(show_spinner=False)
def sql_auto_vector_query_engine():
    with st.spinner(text="Preparing indexes. This should take a few seconds. No time to make 🫖"):
        engine = create_engine(
            f'clickhouse+native://{username}:{password}@{host}:' +
            f'{native_port}/{database}?compression=lz4&secure={secure}'
        )
        sql_database = SQLDatabase(engine, include_tables=[stackoverflow_table], view_support=True)
        vector_store = ClickHouseVectorStore(clickhouse_client=clickhouse(), table=hackernews_table)
        vector_index = VectorStoreIndex.from_vector_store(vector_store)
        return sql_database, vector_index

def get_engine():
    sql_database, vector_index = sql_auto_vector_query_engine()

    nl_sql_engine = NLSQLTableQueryEngine(
        sql_database=sql_database,
        tables=[stackoverflow_table],
        text_to_sql_prompt=CLICKHOUSE_TEXT_TO_SQL_PROMPT,
        llm=OpenAI(model=open_ai_model)
    )
    vector_store_info = VectorStoreInfo(
        content_info="Social news posts and comments from users",
        metadata_info=[
            MetadataInfo(
                name="post_score", type="int", description="Score of the comment or post",
            ),
            MetadataInfo(
                name="by", type="str", description="the author or person who posted the comment",
            ),
            MetadataInfo(
                name="time", type="date", description="the time at which the post or comment was made",
            ),
        ]
    )

    vector_auto_retriever = VectorIndexAutoRetriever(
        vector_index, vector_store_info=vector_store_info, similarity_top_k=10,
        # vector_store_kwargs={"where": f"length >= {max_length} AND post_score >= {score} AND time >= '{min_date}'"}
    )

    retriever_query_engine = RetrieverQueryEngine.from_args(vector_auto_retriever, llm=OpenAI(model=open_ai_model))

    sql_tool = QueryEngineTool.from_defaults(
        query_engine=nl_sql_engine,
        description=(
            "Useful for translating a natural language query into a SQL query over"
            f" a table containing: {stackoverflow_table}, containing the survey responses on"
            f" different types of technology users currently use and want to use"
        ),
    )
    vector_tool = QueryEngineTool.from_defaults(
        query_engine=retriever_query_engine,
        description=(
            f"Useful for answering semantic questions abouts users comments and posts"
        ),
    )

    return SQLAutoVectorQueryEngine(
        sql_tool, vector_tool, llm=OpenAI(model=open_ai_model)
    )

@st.cache_data
def query(prompt):
    return str(st.session_state.engine.query(prompt))

if "max_score" not in st.session_state.keys():
    client = clickhouse()
    st.session_state.max_score = int(
        client.query("SELECT max(post_score) FROM default.hackernews_llama").first_row[0])
    st.session_state.max_length = int(
        client.query("SELECT max(length) FROM default.hackernews_llama").first_row[0])
    st.session_state.min_date, st.session_state.max_date = client.query(
        "SELECT min(toDate(time)), max(toDate(time)) FROM default.hackernews_llama WHERE time != '1970-01-01 00:00:00'").first_row

if "messages" not in st.session_state:
    st.session_state.messages = [
        {"role": "assistant", "content": "Ask me a question about opinions on Hacker News and Stackoverflow!"}]

with st.sidebar:
    score = st.slider('Min Score', 0, st.session_state.max_score, value=0)
    max_length = st.slider('Min comment Length (tokens)', 0, st.session_state.max_length, value=20)
    min_date = st.date_input('Min comment date', value=st.session_state.min_date, min_value=st.session_state.min_date,
                             max_value=st.session_state.max_date)
    openai_api_key = st.text_input("Open API Key", key="chatbot_api_key", type="password")
    openai.api_key = openai_api_key
    "[Get an OpenAI API key](https://platform.openai.com/account/api-keys)"
    "[View the source code](https://github.com/clickhouse/examples/blob/main/Chatbot.py)"
    "[![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/ClickHouse/examples?quickstart=1)"

if not openai_api_key:
    st.info("Please add your OpenAI API key to continue.")
    st.stop()

if openai_api_key and "engine" not in st.session_state.keys():
    engine = get_engine()
    st.session_state.engine = get_engine()

if prompt := st.chat_input(placeholder="Your question about Hacker News"):
    st.session_state.messages.append({"role": "user", "content": prompt})

for message in st.session_state.messages:  # Display the prior chat messages
    with st.chat_message(message["role"]):
        st.write(message["content"])

# If last message is not from assistant, generate a new response
if st.session_state.messages[-1]["role"] != "assistant":
    with st.chat_message("assistant"):
        with st.spinner("Thinking..."):
            response = query(prompt)
            st.write(response)
            st.session_state.messages.append({"role": "assistant", "content": response})

@gingerwizard is this maybe streamlit refreshing the page/code, causing the code to rerun? I know streamlit has some weird behaviour sometimes when things change (and maybe explains why you cant reproduce outside of streamlit)

I would suggest simplifying your code a bit, and making the most simple version that reproduces the issue, and then we can solve it from there

Defn related to streamlit. Does llama make any guarantees as to thread safety for certain objects? e.g. indexes or query engines or should we recreate these for every request?

authors: gingerwizard logan-markewich


text:
[Question]: How to create filterable metadata fields that aren't strings?

Question Validation

[X] I have searched both the documentation and discord for an answer.

Question
I am trying to create an index that has documents of different ages. I want to be able to filter my search to only documents created within a range of dates. I am using and Azure AI Search index for storage. Since Llamaindex does not support date types as metadata, I first convert them to integers since an epoch. My code to create the vector store is below:
`
vector_store_kwargs = {
    "language_analyzer":"en.lucene",
    "vector_algorithm_type":"exhaustiveKnn",
}

metadata_fields = {"file_creation_date":("file_creation_date","int")}
if metadata_fields is not None:
    vector_store_kwargs["filterable_metadata_field_keys"] = metadata_fields

vector_store = AzureAISearchVectorStore(
    search_or_index_client=index_client,
    index_name=name,
    embedding_dimensionality=dimensionality,
    index_management=index_management,
    id_field_key="id",
    chunk_field_key="chunk",
    embedding_field_key="embedding",
    metadata_string_field_key="metadata",
    doc_id_field_key="doc_id",
    **vector_store_kwargs
)`

Which gives an error

UnboundLocalError: local variable 'index_field_type' referenced before assignment

How can I implement this functionality in my code?

@dosu you misunderstood my question. My question is how to add a filterable metadata field that is an integer.


text:
Question Validation

[X] I have searched both the documentation and discord for an answer.

Question
if I use "graph = load_graph_from_storage(storage_context, root_id=root_id)" to load the Index form my disk. How to set the "response_mode="tree_summarize"" in the graph. When I load the graph from disk, I don't have the index about "essay_index"(in the picture)

Thank you, your answer is very detailed. I have another similar problem.
If I load a graph index from disk (the upper layer is ListIndex, and the lower layer is several tree indexes), then how should I set the value of "child_branch_factor" of the tree index when querying?


text:
Extracting tables and text information separately using parser

Hi Team,
We have already created rag pipeline using Unstructured io package as pdf parser, with this we can extract the table and text separately based on the extracted information, I have an approach to summarise the tables and text to save in vector db, I would like to continue using the same pipeline with this parser, unfortunately I don't see any option to extract the table data alone to continue using my pipeline. Could you please let me know will there be any option like this in future

We are working on a JSON output that will allow you to filter table easily.

We have released Json output which give you the table in different format: Md, txt, csv and json.

authors: hexapode sarathsurpur


text:
Modify simulate proxy to expose prometheus metrics

The simulate-proxy script pushes metrics to the telemetry service. This PR modifies the script to expose metrics to a prometheus endpoint. This functionality creates a server that randomly generates response_total, request_totals, response_duration_ms and response_latency_ms. The server reads pod information from a k8s cluster and picks a random namespace to use for all exposed metrics.
Tested out these changes with a locally running prometheus server. I also ran the docker-compose.yml to make sure metrics were being recorded by the prometheus docker container.
fixes #498
Signed-off-by: Dennis Adjei-Baah dennis@buoyant.io

I am begin to lean towards having synthentic namespaces an pods over using k8s to get that information. Right now, I have to run a replicaset watcher and a pod watcher and have the replicaset resolve a deployment name for a given pod in order to have a unique namespace and deployment for a simulated proxy. Any objection in implementing that approach?
/cc @klingerf @siggy @adleong

repo: runconduit/conduit


text:
latest version not working

Tested on 3.3.8
Trying to upgrade the plugin 1.2.0 to use remove bucket (rb) step which is not included in bundled version 3.3.8 (plugin 1.0.1)

Installing it via copying the plugin to libext folder. It unpacks but no rb is seen in GUI:

Installing via Upload Plugin page (direct url to plugin):

Installing via Upload Plugin page (select plugin from local filesystem):

Same behaviour as 1

Fixed in #7 and version 1.2.2

@fdevans
Now I see the rb step but when running the job, that step is performing a mb instead.
Also, on installed plugins the rb shows version 1.2.2 but others 1.0.1. should this plugin upgrade all steps versions?

the versions elsewhere will get updated when the release is done for 3.4.0.  They are managed through a manually updated site, not dynamically like the installed plugins.
This should fix the issue: https://github.com/rundeck-plugins/aws-s3-steps/pull/8

authors: dlvcrk fdevans


text:
Snippets get lost in autocomplete

Currently, snippets get quickly drowned in other autocomplete suggestions as the file grows longer. Sometimes, they are not present at all in autocomplete even though I hit tab exactly after the pattern that should trigger a snippet. Snippets should not get lost in this way. Moreover, I whink it would be great to have an option to allow snippets to always take precedence over other autocomplete suggestions, that is, to have snippets always at the top in autocomplete.
Cheers,
Tom

Drowning: I'm just using the hinter plugin shipping with LT. This implements a fuzzy sort i have very little control over. Maybe possible to ovverride the default fuzzy thing, not sure,
Not autocompleting. I've seen this happen in another plugin too, might be an lt hinter problem... or me having missed something in it's usage. I have a feeling it's the text suggestions interfering with the snippet suggestions. The hinter aggressively caches text/words entered in editors... You could always try and turn of the text hinting behavior in Lt and see if that helps :) if not feel free to report back preferably with something reproducable

Cheers M.

If there is a some variable name, string, comment etc in the file with the same name as the snippet key, snippet won't show up in autocomplete resultlist.

If you turn of textual hinting, this shouldn't be a problem
So for whatever edtitors you use snippets and can happily live without textual hints just add something like this to your user behaviors file:

   ; for each editor type add an entry like this
   [:editor.javascript :-lt.plugins.auto-complete/textual-hints] ;

  ; or to turn of textual hinting for all editor types
  ; [:editor :-lt.plugins.auto-complete/textual-hints] ;

authors: Trapets rundis tomak-git

repo: rundis/lt-snippets


text:
Add Better NPC Highlight

A more customizable way to highlight NPCs that includes:

9 Different styles of highlighting
Each highlight style has a name and ID list, color picker, width adjustment, and some offer an option to turn off/on anti-aliasing
Exclusion list of what NPCs highlights you do not want to hide when Ignore Dead NPCs is enabled
Respawn timer in ticks or seconds
Turbo mode for rave enthusiasts

What use cases are there for highlighting NPCs by ID? We've been bitten in the past by other x-by-ID plugins having the ability to do things which don't abide by Jagex's statement, and suspect the same could be done via this plugin.

At this time I'm inclined to agree that it should be fine. Of course if it's discovered there are statement-breaking issues, we will contact you requesting changes as needed.

authors: MoreBuchus Nightfirecat

repo: runelite/plugin-hub


text:
Update the-gauntlet

Add incremental counting to resource infobox counters

This replicates the behavior of https://runelite.net/plugin-hub/show/gauntlet plugin, which is currently broken and seems to no longer be maintained.

This goes against the 3rd party client guidelines and we have removed a core plugin over it before.
https://secure.runescape.com/m=news/third-party-client-guidelines?oldschool=1
Adds  additional visual or audio indicators of a boss mechanic except in cases  where this is a manually triggered external helper.

@raiyni Can you elaborate? I think you've closed the wrong PR. This update has nothing to do with boss mechanics.

Sorry there were two gauntlet pr's next to each other and I got the wrong one from the last time I looked.

authors: raiyni rdutta


text:
Update acoldone-clogging

Tiny Change of Audio Files from 24 bit to 16 bit cause java didn't like 24 bit files

@OmbudRov You'll need to resolve the branch conflict

authors: OmbudRov pajlada


text:
Create object-highlighter

Object Highlighter Plugin: Initial implementation and README
Implemented a new RuneLite plugin for highlighting game objects in OSRS. Features include:

Highlight objects by ID or name
Three highlighting modes: tile, hull, and clickbox
Customizable colors and border widths
Partial name matching support
Added comprehensive README with usage instructions and configuration options.

Reviewing
We will review your plugin to ensure it isn't malicious, doesn't break Jagex's rules, or isn't one of our previously Rejected/Rolledback features.

This plugin would fall under our Rejected feature for any new ID based plugins

Plugins that use player provided IDs for the entirety of their functionality can cause moderation issues and outcomes that break Jagex's plugin rules. Due to this fact we will not be accepting any new ID based plugins. Plugins that use a specific set of IDs but do not allow user input will still be accepted. (e.g. plugins like Vardorvis Projectiles which only allows you to change a specific projectile to a set list of projectiles.)

Reviewing
We will review your plugin to ensure it isn't malicious, doesn't break Jagex's rules, or isn't one of our previously Rejected/Rolledback features.

This plugin would fall under our Rejected feature for any new ID based plugins

Plugins that use player provided IDs for the entirety of their functionality can cause moderation issues and outcomes that break Jagex's plugin rules. Due to this fact we will not be accepting any new ID based plugins. Plugins that use a specific set of IDs but do not allow user input will still be accepted. (e.g. plugins like Vardorvis Projectiles which only allows you to change a specific projectile to a set list of projectiles.)

How is this any different than Object markers, the output is the same just a different way of managing the marked objects? this plugin introduces no new functionality

How is this any different than Object markers, the output is the same just a different way of managing the marked objects? this plugin introduces no new functionality

You have to be able to right-click an object to mark it, if you do it by ID it's possible you could highlight something without a right-click menu, which would make it harder for us to moderate. For example the clearly problematic behavior that suddenly appeared when Duke's vents were implemented, via the existing ID hub plugins.

Closing, relevant above comment on why.

authors: Car-Role Felanbird LlemonDuck


text:
Show countdown timer to prayer drain in Barrows

I am doing a big Barrows grind right now and it would be useful for potting before fighting Dharok when he is in the tunnels and for knowing if I need to not be so afk and get out of the crypt quickly when fighting the other brothers. Anyone else interested in this feature? If so, I might take a stab at coding it!

Well does the prayer drain at a set rate each time as in 10 each time it procs or is it scaling? If the timer is based on entering then you should be able to time from each tick if you are in the crypts as well as underground. You would need to verify both of those in game yourself most likely and then add it to the barrows plugin.

Yeah it should be a simple thing and would be super useful.

It should drain every 18 seconds, at which rate I'm not sure though.

authors: FatalWaffles Reasel rherms

repo: runelite/runelite


text:
Add a side-bar button for drop tables

Is your feature request related to a problem? Please describe.
Alternative to looking at the wiki all the time
Describe the solution you'd like
It would be nice to be able to type in a monster name, or hotkey click an enemy and have their drop table appear in the sidebar. Extremely nice for Ironmen.
Describe alternatives you've considered
Can't totally think of any alternatives, besides of course just opening a tab in my browser, but I don't want to do that.
Additional context
I'm not sure how hard it would be to just pull drop tables from the wiki and implement it into your UI or something, would be handy though.
You could also add a feature to the client where it tracks what drops you've gotten, and adds data to the table or something? Since I know some tables are not finished/extremely overlooked.

We have wiki button, just press it and press on monster, or use wiki searc

authors: Zoiding deathbeam


text:
Integrate feedback

Integrate the feedback as produced from the mutation analysis. Feedback will be provided through an endpoint to be created.

Hello @radumereuta, I think now that the feedback is integrated on the website, it should be good to go for the plugin.

Closing this as no one is working on it.

authors: jinxinglim yfalcone

repo: runtimeverification/ercx-vscode


text:
MessageHandling on ServerSide

current implementation is potentially decoding json twice
handle...() functions should only take Message argument (and endpoint if needed), not a string.

Done with #29


text:
[Reqest] Take screenshot for thumbnail function

The thumbnails are not working properly with the new vrc Builder it seems, perhaps you can make a button that can capture images from the game view? In the attached you can see the game window has the settings set to what I want but I can't capture it with the build menu. What I am doing now is clicking camaras>edit then dragging that image large then doing a screenshot and saving that

I think you need to select the sdk camera instead in the thumbnails section.

From: Donovan @.>
Sent: 09 November 2023 16:55
To: rurre/PumkinsAvatarTools @.>
Cc: Subscribed @.***>
Subject: [rurre/PumkinsAvatarTools] [Reqest] Take screenshot for thumbnail function (Issue #98)
The thumbnails are not working properly with the new vrc Builder it seems, perhaps you can make a button that can capture images from the game view? In the attached you can see the game window has the settings set to what I want but I can't capture it with the build menu. What I am doing now is clicking camaras>edit then dragging that image large then doing a screenshot and saving that
[Screenshot_2023-11-08_062948]https://user-images.githubusercontent.com/40139772/281771887-d7fbc932-9dfe-4b8b-8f15-d67ae4b937e1.png
—
Reply to this email directly, view it on GitHubhttps://github.com/rurre/PumkinsAvatarTools/issues/98, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AD7RGWKGTKJEAT2DTSR3KMLYDTVHLAVCNFSM6AAAAAA7EWLETOVHI2DSMVQWIX3LMV43ASLTON2WKOZRHE4DKOBQGA3TGMA.
You are receiving this because you are subscribed to this thread.Message ID: @.***>

authors: DonovanPhoenix rurre

repo: rurre/PumkinsAvatarTools


text:
Fix issue1112

I did two things.

Add the latest release of the GTest package. It seems that this was forgotten.
Added a fix for #1112 by modifiying the conditional. When using the package in GIT_SUBMODULE mode, its version is the 40 character long hash, which is matched by the regexp. In this case we assume that the version is newer than 1.8.0 and take the lower branch. This can still cause errors when the submodule is set to the old package repository, but I think in most cases the GIT_SUBMODULE option is used when working on the new package.

You are right. The check does not work like this. I added an extra pair of parentheses to fix it. Now i tested it in a script.

I have to rework this, I just saw that cmake does not support {} in regular expressions.

Now I use
if(HUNTER_GTest_VERSION VERSION_LESS 1.8.0 AND NOT A MATCHES "[a-z]+" )

which will fail if the SHA does not contain any letters. However this is very unlikely.
Also it assumes that legal version numbers do not contain letters. I think for the GTest project this is also true, because versions are currently hardcoded in the CMakeLists.txt file and they use numbers and dots.
In order to get the more robust forty-letters-or-numbers regexp I would have to do something like
function( getSHARegexp regexpOut)
    set(regexp "^")
    foreach( index RANGE 39)
        string(APPEND regexp "[a-z0-9]")
    endforeach()
    set( ${regexpOut} "${regexp}$" PARENT_SCOPE)
endfunction()

which I found too ugly to use.

Have you tried to use HUNTER_INSTALL_LICENSE_FILES as suggested here? This regex stuff doesn't seem like a good solution wherever it's ugly or not.

How would you use HUNTER_INSTALL_LICENSE_FILES to solve the problem? Can I set multiple pathes to it and hunter will not complain if one of the files is missing?
The current code in the GTest/hunter.cmake file is.
if(HUNTER_GTest_VERSION VERSION_LESS 1.8.0)
  set(_gtest_license "LICENSE")
else()
  set(_gtest_license "googletest/LICENSE")
endif()

hunter_cmake_args(
    GTest
    CMAKE_ARGS
    HUNTER_INSTALL_LICENSE_FILES=${_gtest_license}
)

Can I change it to

set( _gtest_license LICENSE googletest/LICENSE)
hunter_cmake_args(
    GTest
    CMAKE_ARGS
    HUNTER_INSTALL_LICENSE_FILES=${_gtest_license}
)

and it would work?

How would you use HUNTER_INSTALL_LICENSE_FILES to solve the problem?

User's value from config.cmake overwrite default from hunter.cmake:

https://github.com/ruslo/hunter/wiki/example.custom.config.id#order

You will force the value you need.

Now I get it :-)
It works. But should we leave the hunter.cmake as it is? There is a good chance that somebody else will run into the same problem. The last regular expression "[a-z]+" definitely works and would avoid the problem in most cases.
Alternatively I can mention the problem in the docs of the GTest package.

Now I get it :-)

What you have tried exactly? HUNTER_INSTALL_LICENSE_FILES in local config.cmake?

But should we leave the hunter.cmake as it is?

My suggestion doesn't involve the change of hunter.cmake, we are leaving it as is.

There is a good chance that somebody else will run into the same problem
Alternatively I can mention the problem in the docs of the GTest package

I guess it belongs to GIT_SUBMODULE feature documentation:

https://docs.hunter.sh/en/latest/user-guides/hunter-user/git-submodule.html

Need to note that:

HUNTER_<package>_VERSION set to SHA1 of submodule instead of real version
hunter.cmake can use HUNTER_<package>_VERSION to add extra CMAKE_ARGS or get a build scheme or anything else. So user is responsible for keeping things consistent.

Yes I set HUNTER_INSTALL_LICENSE_FILES in the config.cmakefile:
# config.cmake
...
hunter_config(
    GTest
    GIT_SUBMODULE googletest
    CMAKE_ARGS HUNTER_INSTALL_LICENSE_FILES=googletest/LICENSE
)
...

I think it would be better to add the regexp to the package file because it may prevent users from running into problems, which may frustrate them. But its your call ...
Should I make pull requests for adding the latest version of the GTest package and for changeing the docs?

I think it would be better to add the regexp to the package file because it may prevent users from running into problems, which may frustrate them

I don't see the difference, your approach will not work for users which will try older version (not newer version like you). I'm ready to listen for some robust solution.

Should I make pull requests for adding the latest version of the GTest package and for changeing the docs?

Sure, I guess it's two pull requests actually.

I don't see the difference, your approach will not work for users which will try older version (not newer version like you). I'm ready to listen for some robust solution.

That is true, but my guess is, that more people will use the later versions, so the amount of users who run into problems would be smaller. I do not have the knowledge about what data is available in the config.cmake file to come up with a real solution for the problem. I will keep this problem in the back of my head. Maybe at some point I will have the knowledge to solve it properly.
So I close the request for now.

So I close the request for now.

The 1.8.0-hunter-p8 update part was okay.

I created a separate pull request for that #1122

authors: Knitschi ruslo

repo: ruslo/hunter


text:
central plasma_store as index to track PIDs, namespaces of other stores

I am very uncomfortable using pkill to replace instances - it's not safe at all. Better to have a central index plasma_store and use it to reference values in other plasma_stores, whether they be temporary (for brain.resize() or stable (for new namespaces)

solved by #19 though without forcing another underlying instance.

repo: russellromney/brain-plasma


text:
Renaming test function named test renames macro test

start with:
#[cfg(test)]
mod tests {
   #[test]
   fn test() {}
}

hit F2 or Rename on the test after fn (so, line 3 there, not the proc macro i'm saying), and rename it to anything, such as, wow_test, and end up with:
#[cfg(test)]
mod tests {
   #[wow_test]
   fn wow_test() {}
}

pretty funky! testing on Windows 10, most recent version, VSCode

ONLY happens when the fn is named test just to be clear -- doesn't happen otherwise

Looks like it in general renames attributes that share the same name as the function.
#[foo]
fn foo() {}

becomes
#[bar]
fn bar() {}

on rename with bar for foo.

authors: Veykril sanbox-irl

repo: rust-analyzer/rust-analyzer


text:
Install rust-src when it is not found

Closes https://github.com/rust-analyzer/rust-analyzer/issues/2858
Looks like there's no RUSTUP env variable, so it adds one more thing to solve in https://github.com/rust-analyzer/rust-analyzer/issues/3154

bors r+

bors r-
bors d+
A haiku

Ok, looks a bit better now IMO.
I'll merge it in 20 mins, if no more proposals arise.

bors r+

authors: SomeoneToIgnore matklad


text:
vscode: fix nightlies

I am afraid the users that are on nightly right now, won't get auto-updates, until they switch to stable and back to nightly (that contains this fix).
This is my bad copy-paste from stackoverflow and additional mistake...
@matklad

Closing in favour of #3629


text:
Rename ra_parser -> parser

bors r+
🤖

bors r+


text:
WIP: fix chaindb shutdown

While testing my example android app (bdk-android-app) I've been getting a corrupt hammersbald db after closing and reopening the app. I added this function to allow my app to gracefully shutdown the db. Doing this shutdown has fixed the issue.
I'm open to other approaches if anyone has any suggestions. Once I have some feedback on exposing this for manual shutdown or doing something else I'll try to add some tests but so far I haven't been able to reproduce the issue except on an actual phone.

I changed this to WIP since I think a better approach is to try to recover when reading from the hammersbald returns an error. A possibly solutions is to roll back the bad block data, but I need to do more investigation.

If you get database corruption, then it's a bug in the Hammersbald database. One of the goals of this database is to recover in case of a crash:

Hammersbald recovers gracefully from a crash of the process it is running in: It stores pre-images of the hash table slots and sizes of the append only files in the log before changing the persistent hash table. It checks at start the log file, that might be left over from a crashed process, patches the hash table to its last known consistent state with the pre-images and truncate the append only stores to their last known correct size. In effect the last batch is either committed in its entirety or will be rolled back at startup.
https://medium.com/@tamas.blummer/hammersbald-7c0bda14da1e

Can you reproduce the Hammersbald corruption? If so, can you extract the database files?

Thanks for the link, I have been able to get some bad db files off my Android app that is using hammersbald via murmel. I am now working on a little rust only test client and will see if I can reproduce the issue that way too (where it will be easier to debug).
I have been found in one case the tip header hash is for a header that does not exist. I suspect this is  not a hammersbald issue, but is due to the new tip hash being written but the app dieing before the corresponding header is written to disk during initial header loading.
Once I get some better test cases I'll add them here if they are murmel related. Otherwise will take a look into hammersbald also.

The fix looks good to me. I'm going to merge it.

authors: erasmospunk notmandatory stevenroose

repo: rust-bitcoin/murmel


text:
Rename Transaction.{input, output} to plural?

Using singular sounds weird for naming repeated data. Plural is used in these situations pretty much everywhere I've seen, including this crate (e.g. in PSBT). This API-breaking that would affect multiple dependents but it's trivial to fix and I think it's worth it.

I prefer the current "input[i] refers to the 'i'th input" situation, but googling for this particular holy war shows I am in the minority, and I have no strong feelings about this.

Interesting view. I found things like tx.input.iter()... quite common which is not that appealing to me.

Yeah, that's fair. My view comes from C, and in Rust it's much more common to treat vectors as containers instead of constantly indexing into them.

If we are going to do this should we do it after we move Transaction to primitives?

I think it doesn't matter but I want it done before any primitives release.

I think we should leave the existing names alone. This is a case of #3166.
We could add accessors with plural names and try to encourage people to use those. (If primitives 2.0 gets rid of the public fields that might even make the transition easier.)

Oh, maybe we can do the same trick as cargo_toml did! Because of the Cargo.toml format change they had to change the type of a public field. So to make transition easier they added a method returning the real value in an older version and deprecated the field, then they broke it in the next version keeping the method. The result being one can use ranged version specification. However using it from libraries may be brittle if they expose the type in the API too. But in that case we should be able to trivially semver-trick the leaf types and implement a likely-zero-cost conversions by just moving fields around (if the layouts end up being the same the conversion is zero cost and this is likely to happen).

I think we should leave the existing names alone. This is a case of #3166.

I really, really, really don't like this. for input in self.input looks totally like a bug or bad variable naming unless you are familiar with rust-bitcoin.

We should add self.inputs() then. We could even deprecate the field if you want to discourage direct accesses. But I think we should keep the field (deprecation and all) around even for primitives 1.0 to minimize gratuitous code breaking.

One reason to rename the field is to avoid annoying difference between inputs() and inputs_mut().
So here's the suggestion: add the accessors and deprecate the field ASAP with a message, in addition to suggestion, asking for feedback in a specially prepared GH issue. Then we can decide if we should rename them or not based on the feedback. We will need to give it enough time though. We could also have primitives 2.0 one day but I hope we will not.

Sounds good.

I just had the second attempt at this I've made, it opens such a can of worms. No clue what to do about this.

I think we should add inputs() and inputs_mut() accessors and call it a day. People who have strong feelings about shit like this can just use those.
If you are feeling really ambitious you can try deprecating the fields, but I think that just won't work for people (due to borrowck limitations discussed above) and as a result we'll have to un-deprecate them.

authors: Kixunil apoelstra tcharding

repo: rust-bitcoin/rust-bitcoin


text:
Improve the io crate

Draft because done on top of #2262, this PR is only the last 5 patches.
In preparation for adding the BufRead trait do a few improvements, the first ones are all trivial, the last sets the MSRV to Rust 1.56.1

Thanks for the review, i made this draft because its on top of #2262 and will need rebase before it can be considered for merge.


text:
Vulkan and Dx12 errors

Errors when running Ennona on Windows 19042.1110
Steps to reproduce:
1: cargo run or cargo run --release

Problem comes from Laptop with multiple graphics options. Make sure all drivers are up to date for both integrated and discrete graphics

repo: rust-cv/ennona


text:
OpenOCD not working on mac

I followed all the steps of installing tools required for stm32f3discovery board on Macbook Pro having USB3.0 ports yet when I ran openocd -f interface/stlink-v2.cfg -f target/stm32f3x.cfg I get the following result
Open On-Chip Debugger 0.10.0
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
Info : auto-selecting first available session transport "hla_swd". To override use 'transport select '.
adapter speed: 1000 kHz
adapter_nsrst_delay: 100
Info : The selected transport took over low-level target control. The results might differ compared to plain JTAG/SWD
none separate
Info : Unable to match requested speed 1000 kHz, using 950 kHz
Info : Unable to match requested speed 1000 kHz, using 950 kHz
Info : clock speed 950 kHz
Error: open failed
in procedure 'init'
in procedure 'ocd_bouncer'
To my best knowledge, I think its an issue due to usb 3.0 but since I am a newbie I require assistance from sonsummate professionals

I'm experiencing the exact same issue.

I had a similar issue on Big Sur, but with a Nucleo-F439ZI board. In my case, following the hint in #263 helped and I was able to get it to work with the newer stlink config. Maybe try:
openocd -f interface/stlink-v2-1.cfg -f target/stm32f3x.cfg

I had a similar issue on Big Sur, but with a Nucleo-F439ZI board. In my case, following the hint in #263 helped and I was able to get it to work with the newer stlink config. Maybe try:
openocd -f interface/stlink-v2-1.cfg -f target/stm32f3x.cfg

I am currently experiencing a similar issue, but my error message is a bit different:
Open On-Chip Debugger 0.11.0
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
WARNING: interface/stlink-v2-1.cfg is deprecated, please switch to interface/stlink.cfg
Info : auto-selecting first available session transport "hla_swd". To override use 'transport select '.
Info : The selected transport took over low-level target control. The results might differ compared to plain JTAG/SWD
Info : Listening on port 6666 for tcl connections
Info : Listening on port 4444 for telnet connections
Info : clock speed 1000 kHz
Error: open failed
There is not any information about why the error occurs either.

I am currently experiencing a similar issue, but my error message is a bit different:
Open On-Chip Debugger 0.11.0 Licensed under GNU GPL v2 For bug reports, read http://openocd.org/doc/doxygen/bugs.html WARNING: interface/stlink-v2-1.cfg is deprecated, please switch to interface/stlink.cfg Info : auto-selecting first available session transport "hla_swd". To override use 'transport select '. Info : The selected transport took over low-level target control. The results might differ compared to plain JTAG/SWD Info : Listening on port 6666 for tcl connections Info : Listening on port 4444 for telnet connections Info : clock speed 1000 kHz Error: open failed
There is not any information about why the error occurs either.

I'm getting the same sorta issue - unable to find anything.

someone got the issue solved?

authors: KoSv KusRoman Sl1mb0 jrmoulton scorpasdzx thotsch

repo: rust-embedded/book


text:
writing your first embedded Rust program

cc #4
As I proposed in
https://github.com/rust-embedded/book/issues/4#issuecomment-416191480 this
section starts with the default configuration that targets QEMU to get the
reader familiar with the tools. Then it moves to the reference hardware, the
STM32F3DISCOVERY, to cover device specific configuration.
This PR depends on rust-embedded/cortex-m-quickstart#45
r? @rust-embedded/resources
From here we could cover some of the quickstart examples like debugging a hard
fault and picking a panicking behavior and then do the blinky program.

I tried and failed to follow this tutorial using the current beta. Do you know when you expect it to work on beta / stable, and/or when the quickstart example will be updated to match?

I should add, this is excellent, by the way. I'm very much looking forward to people being able to work through it and do some embedded rust at their desk.

@japaric Left one comment following up on the udev change but other than that the new changes LGTM from my read through.

@thejpster are you happy with the latest changes? I believe we can't send this to bors until you resolve / change your pending "requested changes" review.
The cortex-m-quickstart PR landed so this can land anytime. The beta is not out yet but it should be out sometime this week. In any case, the text tells the reader to use nightly if the beta is not out yet so the beta is not a blocker.

As discussed on IRC, I'm still fundamentally against cargo-generate because it takes too long to compile/install and has annoying dependencies that you don't find out until half-way through. I'd be happy to add it back one once rustup can install the binary.

@thejpster the latest commit explains how to instantiate the template using git, curl or your web browser. It also turns cargo-generate and git into optional dependencies where the recommendation is to not bother installing either. Does that solve your concern?

Pushed a commit to fix a link and that invalidated the approvals. Since this had already 3 approvals and CI I'm going to skip bors and directly merge it.

authors: japaric posborne thejpster


text:
Change examples to reflect usage improvements

Closes #58

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @reitermarkus (or someone else) soon.
If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes.
Please see the contribution instructions for more information.

@therealprof OK, I will make those changes.

@therealprof Is that what you wanted?

repo: rust-embedded/cargo-binutils


text:
Update reference implementation implementation to stm32f1xx-hal and update examples

I think the stm32f1xx-hal is a good candidate for a reference implementation.
I have also updated the examples accordingly and modernized them a bit.
An additional possibility would be to remove the futures examples as well, since async handling will be different.
Closes #156

r? @therealprof
(rust_highfive has picked a reviewer for you, use r? to override)

What do you think about removing the futures-based examples? Those are even stuck on futures 0.1.

Sounds good to me.

authors: eldruin rust-highfive therealprof

repo: rust-embedded/embedded-hal