text:
Duration is out of dual 32-bit range

不具合の概要

首や腰を動かすサンプルを実行した際、下記のエラーが表示され、ノードが終了することがあります。
# 腰カメラのサンプルを実行
$ rosrun sciurus17_examples chest_camera_tracking.py

# bringupを実行したサンプルでエラーが発生する
[ INFO] [1647245992.760408925]: Ready to take commands for planning group two_arm_group.
terminate called after throwing an instance of 'std::runtime_error'
  what():  Duration is out of dual 32-bit range
[sciurus17/controller3/joints-8] process has died [pid 110776, exit code -6, cmd /home/shotaak/catkin_ws/devel/lib/sciurus17_control/sciurus17_control __name:=joints __log:=/home/shotaak/.ros/log/7f6c1198-a36f-11ec-9cae-f58a8e1952ad/sciurus17-controller3-joints-8.log].
log file: /home/shotaak/.ros/log/7f6c1198-a36f-11ec-9cae-f58a8e1952ad/sciurus17-controller3-joints-8*.log

実行環境

OS: ubuntu20.04, ROS noetic
ソフトのバージョン:a71ca5801fad7bca229142f8ade1852c7b98b9ed

エラーを確認したサンプル

head_camera_tracking.py
chest_camera_tracking.py

下記の問題が関連していると思われます。
https://github.com/ros-controls/ros_controllers/pull/577

関連Issueがクローズされたため、本Issueもクローズします


text:
Make profile pictures/avatars round

All avatars/profile pictures across the site should be round with grey rims. At the moment it seems imports are square: https://eahub.azurewebsites.net/profile/13013
If it's slow, do this after the launch.

Done
(not visible at time of comment, will deploy later)

Wonderful!

source: gharchive/issue

authors: Richenda sebgrebe

repo: rtcharity/hubreboot

license: MIT

license_type: permissive

license_source: github-api


text:
Link errors when running rtic-monotonics example

Hi,
I'm trying to run this example code from the book on my STM32L052C8Tx board.
For this, I have configured the required crates as follow:
$ cat Cargo.toml  | grep rtic-mono
rtic = { version = "2.0.1", features = ["cortex-m", "thumbv6-backend", "rtic-monotonics"] }
rtic-monotonics = { version = "1.2.0", features = ["stm32l052c8", "cortex-m-systick"] }

This is the complete code from the example with minimal modifications, essentially just replacing semihosting with rtt:
#![no_main]
#![no_std]
#![feature(type_alias_impl_trait)]

use panic_rtt_target as _;

#[rtic::app(device = stm32l0xx_hal::pac, dispatchers = [SPI1])]
mod app {
    use rtic_monotonics::systick::*;
    use rtt_target::{rprintln, rtt_init_print};

    #[shared]
    struct Shared {}

    #[local]
    struct Local {}

    #[init]
    fn init(cx: init::Context) -> (Shared, Local) {
        rtt_init_print!();
        rprintln!("init");

        let systick_token = rtic_monotonics::create_systick_token!();
        Systick::start(cx.core.SYST, 12_000_000, systick_token);

        foo::spawn().ok();
        bar::spawn().ok();
        baz::spawn().ok();

        (Shared {}, Local {})
    }

    #[task]
    async fn foo(_cx: foo::Context) {
        rprintln!("hello from foo");
        Systick::delay(100.millis()).await;
        rprintln!("bye from foo");
    }

    #[task]
    async fn bar(_cx: bar::Context) {
        rprintln!("hello from bar");
        Systick::delay(200.millis()).await;
        rprintln!("bye from bar");
    }

    #[task]
    async fn baz(_cx: baz::Context) {
        rprintln!("hello from baz");
        Systick::delay(300.millis()).await;
        rprintln!("bye from baz");
    }
}

The code compiles but fails to link due to undefined symbols, which are interrupt names.
  = note: rust-lld: error: undefined symbol: RCC
          >>> referenced by rtic_playground.9c29a361ea81e178-cgu.0
          >>>               /home/javier/dev/rtic-playground/target/thumbv6m-none-eabi/release/deps/rtic_playground-00b34e20d939bb11.rtic_playground.9c29a361ea81e178-cgu.0.rcgu.o:(__INTERRUPTS)
          >>> did you mean: RTC

          rust-lld: error: undefined symbol: DMA1_CHANNEL4_7
          >>> referenced by rtic_playground.9c29a361ea81e178-cgu.0
          >>>               /home/javier/dev/rtic-playground/target/thumbv6m-none-eabi/release/deps/rtic_playground-00b34e20d939bb11.rtic_playground.9c29a361ea81e178-cgu.0.rcgu.o:(__INTERRUPTS)

          rust-lld: error: undefined symbol: ADC_COMP
          >>> referenced by rtic_playground.9c29a361ea81e178-cgu.0
          >>>               /home/javier/dev/rtic-playground/target/thumbv6m-none-eabi/release/deps/rtic_playground-00b34e20d939bb11.rtic_playground.9c29a361ea81e178-cgu.0.rcgu.o:(__INTERRUPTS)

          rust-lld: error: undefined symbol: USART4_USART5
          >>> referenced by rtic_playground.9c29a361ea81e178-cgu.0
          >>>               /home/javier/dev/rtic-playground/target/thumbv6m-none-eabi/release/deps/rtic_playground-00b34e20d939bb11.rtic_playground.9c29a361ea81e178-cgu.0.rcgu.o:(__INTERRUPTS)

          rust-lld: error: undefined symbol: TIM3
          >>> referenced by rtic_playground.9c29a361ea81e178-cgu.0
          >>>               /home/javier/dev/rtic-playground/target/thumbv6m-none-eabi/release/deps/rtic_playground-00b34e20d939bb11.rtic_playground.9c29a361ea81e178-cgu.0.rcgu.o:(__INTERRUPTS)

          rust-lld: error: undefined symbol: TIM7
          >>> referenced by rtic_playground.9c29a361ea81e178-cgu.0
          >>>               /home/javier/dev/rtic-playground/target/thumbv6m-none-eabi/release/deps/rtic_playground-00b34e20d939bb11.rtic_playground.9c29a361ea81e178-cgu.0.rcgu.o:(__INTERRUPTS)

          rust-lld: error: undefined symbol: I2C3
          >>> referenced by rtic_playground.9c29a361ea81e178-cgu.0
          >>>               /home/javier/dev/rtic-playground/target/thumbv6m-none-eabi/release/deps/rtic_playground-00b34e20d939bb11.rtic_playground.9c29a361ea81e178-cgu.0.rcgu.o:(__INTERRUPTS)

          rust-lld: error: undefined symbol: AES_RNG_LPUART1
          >>> referenced by rtic_playground.9c29a361ea81e178-cgu.0
          >>>               /home/javier/dev/rtic-playground/target/thumbv6m-none-eabi/release/deps/rtic_playground-00b34e20d939bb11.rtic_playground.9c29a361ea81e178-cgu.0.rcgu.o:(__INTERRUPTS)

This looks like a possible misconfiguration, but so far I have not been able to track it down.  All other examples from the book that don't use rtic-monotonics compile and run successfully.
Can anyone point me to any documentation explaining how to configure the rtic-monotonics trait?  I enabled stm32l052c8,cortex-m-systick because they made sense to me, but could not find them documented anywhere.

Hi, we did a large rework of the STM32 monotonics to fix a lot of issues. Could you try with rtic-monotonics v1.3.0 and check if the issue persists?
If it does can you put the project on GH?

Oh, nice.  Yes v1.3.0 solves this problem and I can run the book example.
Thank you very much for your good work!  :hugs:

repo: rtic-rs/rtic


text:
Suggestion

Thanks for the great component, but I wish I could hide the "go to page".

+1

authors: ChemaBautista MonrealRyan


text:
the first item cannot snap to center

When I try to set the gravity as Center and set the startPadding as the mid of the phone screen in horizontal, I found I cannot snap the first and the last view in some phone, such as Pixel, and it seems the second item is nearest than the first item to centre, but I don't know what I can change if I want to snap the first view in this situation, plz help me, thank you.
the decoration code
80dp
recyclerView.addItemDecoration(
LinearEdgeDecoration(
startPadding = screenWidth() / 2
- resources.getDimension(R.dimen.circle_width).toInt() / 2,
orientation = RecyclerView.HORIZONTAL
)
)

@jizhe7550
For me it helped adding padding to the RecyclerView
        android:clipToPadding="false"
        android:paddingLeft="100dp"
        android:paddingRight="100dp"

You need to have enough decoration or padding set for that to work. The sample app has a "Center with decoration" example

authors: fupduck jizhe7550 rubensousa

repo: rubensousa/GravitySnapHelper


text:
Fix an error for Rails/ReflectionClassName when using class_name: to_s

This PR fixes bug introduced in https://github.com/rubocop/rubocop-rails/pull/471.

[x] Wrote good commit messages.
[ ] Commit message starts with [Fix #issue-number] (if the related issue exists).
[x] Feature branch is up-to-date with master (if not - rebase it).
[x] Squashed related commits together.
[x] Added tests.
[ ] Added an entry (file) to the changelog folder named {change_type}_{change_description}.md if the new code introduces user-observable changes. See changelog entry format for details.
[x] The PR relates to only one subject with a clear title
and description in grammatically correct, complete sentences.
[x] Run bundle exec rake default. It executes all tests and RuboCop for itself, and generates the documentation.
[ ] If this is a new cop, consider making a corresponding update to the Rails Style Guide.

Thanks!

source: gharchive/pull-request

authors: koic skryukov

repo: rubocop/rubocop-rails


text:
New cop to detect unnecessary merge when passing keyword arguments

# bad
some_method(foo, **options.merge(bar: 1))

# good
some_method(foo, **options, bar: 1)

I found (grep by \*\*\w+\.merge regexp) 12 such offences in the rails/rails codebase and 14 in my own gem (https://github.com/fatkodima/online_migrations).

Hm. Whether to use merge with a single argument or separate it may come down to personal preference, so it seems reasonable to propose this to the style guide first. Since it may involve a trade-off in expressiveness, I’m not sure yet if it’s best to enforce one way or the other.

The merge option is a lot slower on my machine, especially when building new hashes. This could be a candidate for rubocop-performance as well
require 'benchmark/ips'

data = {}

Benchmark.ips do |x|
  x.report('merge') { { **data.merge(foo: 42) } }
  x.report('**')    { { **data, foo: 42 } }

  x.compare!
end

ruby 3.3.2 (2024-05-30 revision e5a195edf6) [x86_64-darwin21]
Warming up --------------------------------------
               merge   256.750k i/100ms
                  **   585.002k i/100ms
Calculating -------------------------------------
               merge      2.490M (± 5.8%) i/s -     12.581M in   5.069580s
                  **      6.010M (± 8.6%) i/s -     29.835M in   5.005139s

Comparison:
                  **:  6009715.4 i/s
               merge:  2489574.5 i/s - 2.41x  slower

It is slower and I wonder why people might prefer to use merge after knowing that it is really not needed.

I see. In any case, it would be worth documenting this in the style guide.

I opened https://github.com/rubocop/ruby-style-guide/pull/948 for this.

authors: dvandersluis fatkodima koic vlad-pisanov

repo: rubocop/rubocop


text:
Fix an error for Style/InvertibleUnlessCondition when using empty parenthesis as condition

As it happens when you type something like return unless (foo = bar)

Before submitting the PR make sure the following are checked:

[x] The PR relates to only one subject with a clear title and description in grammatically correct, complete sentences.
[x] Wrote good commit messages.
[ ] Commit message starts with [Fix #issue-number] (if the related issue exists).
[x] Feature branch is up-to-date with master (if not - rebase it).
[ ] Squashed related commits together.
[x] Added tests.
[x] Ran bundle exec rake default. It executes all tests and runs RuboCop on its own code.
[x] Added an entry (file) to the changelog folder named {change_type}_{change_description}.md if the new code introduces user-observable changes. See changelog entry format for details.

Thanks!

authors: Earlopain koic


text:
Regression from 1.4.0 to 1.5.0 performing 'next' command with multiple waiting threads

Your environment

ruby -v:
ruby 3.1.2p20 (2022-04-12 revision 4491bb740a) [x86_64-linux]

rdbg -v:
rdbg 1.5.0

Describe the bug
I am experiencing a regression from 1.4.0 to 1.5.0, where when I'm in debugging my Rails app, debug 1.4.0 can perform the 'next' command correctly, ie stepping to the next line, but debug 1.5.0 performs a 'mini-continue', ie it stops many lines later.
I think the cause of the regression is the code change in session.rb#restart_all_threads in the line "request_tc :continue":
      waiting_thread_clients.each{|tc|
        next if @tc == tc
        request_tc :continue
      }

request_tc adds the :continue command to @tc, whereas in 1.4 it added it to the local tc variable. This is significant in my case because there are three waiting threads.
So I think the code should be the same as in 1.4.0:
      waiting_thread_clients.each{|tc|
        next if @tc == tc
        tc << :continue
      }

This change fixes the issue in my Rails app.
To Reproduce
I can reproduce this in my Rails app but I can't post any code, sorry.

Yeah that's a mistake on my part, sorry. I'll push a PR shortly.

I assume you're using the master branch though? Because that change wasn't in the 1.5.0 release.

I assume you're using the master branch though? Because that change wasn't in the 1.5.0 release.

Yes, I'm on master. Sorry, I could have made that clearer! I cloned master because I ran into the extremely slow bt command problem when safe inspecting very large variables and wanted to patch the gem locally.

I can confirm that 1.5.0 doesn't have the problem, I must have had a cached version running. It's only in master.

repo: ruby/debug


text:
Display organizational logo

When you log in, your dashboard looks something like this:

After you attach a logo, the dashboard updates to include the new diaperbank logo in the navbar and on the page. As seen below:

We need to update the navbar keep the diaperbase logo when an organization uploads a logo.

Fixed by #114

authors: armahillo seanmarcia

repo: rubyforgood/diaper

license: mit

license_source: bigquery


text:
[#4504] Add step-wise partner profile edit form

Resolves #4504
Description
This splits up the very long partner profile edit form into multiple collapsible sections, using the Bootstrap Accordion component. This project already uses Bootstrap so this does not introduce a new dependency.
The first attempt had a "Save and Next" button on each collapsible section, i.e. each one was a separate form that could be submitted individually. The original idea was to save one section and have the user returned to the edit view with the next section automatically opened for a kind of "guided" experience. It was also automatically saving work in progress edits as user collapsed/expanded sections. But this proved to be unworkable for a number of reasons. See #4504 comments for details.
So this solution simplifies things by only having a single form outside of the accordion section. User can click Save Progress which submits the entire form, or Submit for Approval. These action buttons appear both at the top and bottom of the accordion. If any validation errors occur, the user is returned to the edit view with all the sections that have error(s) expanded.
Type of change
New feature (non-breaking change which adds functionality)
How Has This Been Tested?
To exercise this feature, start by launching a Rails console bin/rails c and enable the new feature flag:
Flipper.enable(:partner_step_form)

Then with the Rails server running bin/start, navigate to http://localhost:3000, login as an Org admin, create a new Partner Agency (eg: testpartner@example.com) and invite them. Then logout.
A new browser tab should open with the invitation email sent to the new partner. Click on the accept invitation button in this email, and create a password for the new partner. Once logged in, click "Edit my Profile" from the left navigation. You should now see the new step-wise form.
Expand and collapse as many sections as you'd like, and click Save Progress as often as you'd like.
Notice that the bootstrap open/close caret icons change to the word "Saving..." when the form is being submitted. This is to prevent the user from opening further sections and trying to edit in the middle of an update.
To see what the form looks like with multiple validation errors, fill it out as follows, then click Save Progress.

Media Information: Make all the social media links blank, and uncheck "No social media"
Pick up Person: Enter 4 comma separated emails for pick up email, eg: aa@test.com, bb@test.com, cc@test.com, dd@test.com
Area served: Add some area(s) that don't add up to 100%
Partner Settings: Uncheck all the request settings

If the form renders with validation errors, then the Submit for Approval button should be disabled. Otherwise if partner is in Invited or Recertification status, then the Approval button is enabled. Otherwise the Approval button doesn't appear at all.
Also see system test for automated test: spec/system/partners/profile_edit_system_spec.rb
Optionally, disable the feature flag in Rails console Flipper.disable(:partner_step_form) and run through the invitation flow again (or use the same partner you already created). In this case, it should behave exactly as it does currently with the very large form.
Screenshots
Default rendering of step-wise edit form - all sections closed:

Multiple sections can be open/closed at once for editing:

Multiple sections open on validation errors:

It's pretty nice!  I need to think a bit about two things regarding a smooth passage through the process for the partners
1/  we might want to only check the social media when submitting for approval.
2/  It feels a bit off to make them save progress again when they have an error before they can try submitting for approval -- I know that in the current version, they have to have a clean save before submitting, but this is a different world.

@dorner Technical feedback has been addressed.
@cielf Let me know if it should have further changes to the workflow.

Hey @danielabar -- I was only giving notice that I was thinking about the changes in the comment above -- did you already make them?   I ask because the pattern seems to have changed -- on submit for approval with error, it's going to the view rather than back into the edit.        Or did I miss how it was working originally?

Tech review passed. @cielf are there functional changes that have to happen?

@cielf To date, I've only made the technical changes on this PR, not any workflow changes, since earlier comment mentioned it requires further thought.
The reason the Submit for Approval button is disabled on error state is from an earlier discussion on the issue. Don't recall which comment it was, but the idea was user shouldn't be able to Submit for Approval while form is in error. I could remove this logic if its no longer needed.
When form initially loads, it is considered valid because the social media validation runs only on edit, and the profile is created in an invalid state. That's why you can initially Submit for Approval, even though its guaranteed to generate the social media error.
Yes I see now that it goes to view rather than edit in this case, I'll look into that.
To confirm, I'll make the following changes:

Submit for Approval button is always enabled
Submit for Approval + error -> return to edit

Yes, please.

@cielf Forgot to mention - for Submit for Approval, there is additional logic to only display it if parter is Invited or Recertification Required, otherwise it doesn't render at all. Is that still needed or should the button be displayed at all times?
Also fyi for this part "Submit for Approval + error -> return to edit", could be surprisingly thorny, requires modifications to the existing Approval Service which currently only seems to validate edit rules (i.e. only social media validation). I tried to change it (but should only change if step feature enabled), but strange things are happening. I still have to sort through it all but it will take more time.

An overall thought/possible future issue (don't want to scope creep this one):
It seems like the complexity around social media validation and profile being invalid from the start is due to the existing PartnerCreateService which creates the profile in an invalid state:
Partners::Profile.create!({
                                    partner_id: @partner.id,
                                    name: @partner.name,
                                    enable_child_based_requests: organization.enable_child_based_requests,
                                    enable_individual_requests: organization.enable_individual_requests,
                                    enable_quantity_based_requests: organization.enable_quantity_based_requests
                                  })

If the above was modified to add:
no_social_media_presence: true

Then the profile would be valid right from the start, and it wouldn't require validate :check_social_media, on: :edit in the Profile model (could get rid of the on: :edit and other places like in Approval service where it needs to maintain awareness of edit state.
If the intention of creating a profile invalid from the beginning was to remind the user that they should fill in at least one social media field, perhaps this could be handled as a gentle reminder with some JS in the edit form, rather than creating a validation error right from the start.

"Then the profile would be valid right from the start, and it wouldn't require validate :check_social_media, on: :edit in the Profile model (could get rid of the on: :edit and other places like in Approval service where it needs to maintain awareness of edit state."
We'd still need it because they could uncheck it, or am I missing something?
I expect, though, that the intent was to make the partner think about it.  Defaulting to none makes it easy to skip.   Let me see if I can find the original ask. (or at least the issue for it)

@cielf To clarify about the Submit for Approval. Currently it only validates the current state of the profile, but it's not a form submission, so if user made any other edits, they're not considered.
Should it also be doing a save in case user made further edits, then clicked the Submit for Approval without first clicking Save Progress?
i.e. it's really Save + Submit for Approval?

(Thinking) We have two ways we could go here.   1/  Save and submit for approval.  2/  Save and Review - taking them to the view screen,  where they would then submit for approval (matching the current flow).
Let me check in with one of our clients -- I believe we have a certain amount of partners  not actually submitting for approval with the current model, but I want to confirm that.

@danielabar  Ok -- I've had a conversation with one of our main banks -- here's what we settled on:
1/   Change "Submit for Approval"  to a "Save and Review", which will go to the Partner's profile view.
2/  On the partner profile view,  twin the "Update Information"  and "Submit for Approval"  buttons to also be at the top
That gives the partners a final change to confirm that everything is right before submitting, but should also mitigate the problem of partners not actually submitting for approval.    I can break out step 2 to be a separate issue if you want to keep it tight.
Is that workable?

@cielf I've changed:

"Submit for Approval" to "Save and Review". This new button performs the same logic as "Save Progress", but if the save is successful, then it redirects user to Profile view. I'm using the same flash success message "Details were successfully updated." for this case, let me know if it should be a different message?
Removed the conditional logic around displaying "Save and Review". Before it was only rendering for Invited and Recertification, but now that it simply saves and redirects user, I figure it can be run from any status, let me know if that's not the case?
Just like a previous discussion, the "Save and Review" button remains enabled, even when form is in an error state. User can always click it and if there are errors, they're taken back to edit view with error sections opened (just as if they had clicked "Save Progress"
Realized the Bootstrap primary color wasn't being applied to the "Save Progress" button, that's been fixed so it now looks like this:

I can look into the second part of the new requirement re: buttons at top and bottom of Partner Profile view.

Observation, not sure if this is a bug or expected:
I can only save one Additional Documents attachment. i.e. if I return to the edit view after adding a document and add another one, the new one replaces the old one.
It seems to behave this way even with the feature flag disabled:
Flipper.enable(:partner_step_form)
# OR
Flipper.disable(:partner_step_form)

The Partner::Profile model does in theory support multiple attached documents:
has_many_attached :documents

But when I attach a new one, there's an ActiveStorage::PurgeJob running that removes the old one.
There may be an additional related bug that for the very first attachment, it doesn't get saved because the PurgeJob also runs. May require further investigation.

@danielabar    That is a bug (otherwise we'd label it Additional Document).   I know there are some problems around Additional Documents in the current incarnation.   it's out of scope for this PR.    I'll see if I can find the appropriate issue -- the PurgeJob information may be new to it.

@danielabar FYI,  I'm probably not reviewing this today (severely underslept, and it needs a better brain than I have atm)

I'm pretty happy with this.   Do I think we might want a tweak or two once we see how it flies?  Yes.  Do I think it's good to go public?  Also yes -- though we'll probably hold off enabling it until we have the equivalent page for the bank.
@dorner  Can you  give a last tech look-over, since there have been a few additional changes, please?

@cielf is this good to merge?

@dorner Let me take a quick pass through with the flags off to make sure nothing broke.

authors: cielf danielabar dorner

repo: rubyforgood/human-essentials


text:
Add Travis badge to README

Badges are nice because they give a quick look into the status of a project! This task is to add a Travis badge to the the README (maybe under the header?)
Here's a link to our Travis profile: https://travis-ci.org/rubyforgood/playtime/
Let us know if you have any questions!

Can i try it?

@ramyaa Definitely! Let me know if you have any questions.

Yay! My first PR! <3 Thank you! :)

Awesome, congratulations! :tada: Now you're a project contributor!

authors: leesharma ramyaa

repo: rubyforgood/playtime


text:
Change swatch size

Thanks for creating this directive!
Can you give some guidance on how to cleanly change the size of the color swatch? that remains on the page?

Just in case anyone is looking for a workaround, I managed to change the size with the following. Adjust width and height as you need.
        .color-picker-swatch-only,
        .color-picker-swatch {
            height:20px;
            width: 20px;
            margin:0;
            padding:0;
            display:inline-block;
        }

I am attempting to change the height of the swatch, but seem unable to do so with the workaround you posted @saaqibz . Any ideas? Plnkr

@ashthespy - Try adding !imporant to the height rule.

authors: ashthespy ruhley saaqibz

repo: ruhley/angular-color-picker


text:
failed to parse function return function pointers

void (*f(int *p))(void) {
	return (void *)0;
}

$ 8cc -c t2.c
[ERROR] 8cc.h:426: t.c:1:25: ';' or ',' are expected, but got {

Looks like is_funcdef() in parse.c makes some incorrect assumptions so it tries to parse this as a decl.

That's right. is_funcdef returns a wrong result for the input. Maybe we should stop making a guess before calling the parser but instead call the parser directly, because making a good guess is as hard as parsing input.

The look ahead is good for readability. If we don't have the ability to save and reset the parser at choice points on an error,  decl and function parsing may need to be combined into an ugly mess.

It actually might not be too bad, I think it comes down to a check in read_decl like:
decl = read_decl()
if ( peek == '{' && ! first decl in list  )
  error("function cannot appear in decl list");
if (peek == '{') {
  if (sclass == typdef)
    error()
  parse_body()
}

I think the type struct already parses the vector of param names.

authors: andrewchambers minux rui314


text:
feat: Added the user-defined sheet function

新增功能：支持用户自定义sheet。
比luck-sheet更美观实用。

LGTM

LGTM

repo: ruilisi/fortune-sheet


text:
Error in IE

An error in the function "create" in IE
as is:
var hasCrypto = typeof (window.crypto) != 'undefined',
hasRandomValues = typeof (window.crypto.getRandomValues) != 'undefined';
must be:
var crypto = window.crypto || window.msCrypto;
var hasCrypto = typeof (crypto) != 'undefined';
var hasRandomValues = hasCrypto && typeof (crypto.getRandomValues) != 'undefined';

Hi @SheinEA I'm super busy at the moment but I'm glad to accept your pull request.

Got the same error.

authors: Odonno SheinEA ruionwriting

repo: ruionwriting/ngGuid


text:
[Question]: How to enable hybrid search in using llama-index elasticsearch?

Question Validation

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

Question
Using llama-index-vector-stores-elasticsearch, with index, how to enable hybrid search?
We are using elastic search locally, which is running successfully, we just need to enable hybrid search, for which there was no documentation or was information provided anywhere. Below is how we are initializing the vectorstore.
from llama_index.vector_stores.elasticsearch import ElasticsearchStore
vector_store = ElasticsearchStore(
index_name=table_name,
es_url="http://localhost:9200"
)

To perform hybrid search, you need to define the retrieval_strategy parameter in the ElasticsearchStore class and create the index and query engine .
from llama_index.vector_stores.elasticsearch import ElasticsearchStore

class RetrieverStrategyEnum(str, Enum):
    DENSE = "dense"
    SPARSE = "sparse"
    BM25 = "bm25"
    HYBRID = "hybrid"

strategy_instances = {
    RetrieverStrategyEnum.DENSE: AsyncDenseVectorStrategy(),  # default, K-nearest-neighbors, cosine similarity
    RetrieverStrategyEnum.SPARSE: AsyncSparseVectorStrategy(),
    RetrieverStrategyEnum.BM25: AsyncBM25Strategy(),
    RetrieverStrategyEnum.HYBRID: AsyncDenseVectorStrategy(hybrid=True)
}

vector_store = ElasticsearchStore(
    index_name=index_name,
    es_cloud_id=os.getenv("es_cloud_id"),
    es_user=os.getenv("es_user"),
    es_password=os.getenv("es_password"),
    retrieval_strategy=strategy_instances[RetrieverStrategyEnum.HYBRID]
)

query_engine = vector_store.index.as_query_engine()
result = query_engine.query(query)


text:
Extracted sub-images as different file instead of single image it supposed to be

Describe the bug
Image in PDF was extracted as different sub-image files instead of single figure it should be
Files
mattergen.pdf
Job ID
72f9de41-28a4-4957-85e6-decfea552889
Screenshots

Client:
Please remove untested options:

Python Library

Options
from llama_parse import LlamaParse
from llama_index.core import StorageContext
from llama_index.core import VectorStoreIndex
from llama_index.core.node_parser import MarkdownElementNodeParser
from llama_index.llms.openai import OpenAI
from llama_index.embeddings.openai import OpenAIEmbedding
from llama_index.core.schema import ImageDocument
from typing import List
from llama_index.core.node_parser import LlamaParseJsonNodeParser
from llama_index.core.schema import BaseNode, TextNode, Document
from llama_index.core.tools import QueryEngineTool, ToolMetadata
from llama_index.core.query_engine import SubQuestionQueryEngine
import glob
ins = """
Extract images and caption as accurate as possible.
"""

class llama_document_parser(object):
    def __init__(self,parsing_ins):
        self.parser = LlamaParse(
            parsing_instruction=ins,
            verbose=True,
            ignore_errors=False,
            do_not_cache=True,
        )

    def get_image_text_nodes(self,download_path: str,json_objs: List[dict]):
        """Extract out text from images using a multimodal model."""
        image_dicts = self.parser.get_images(json_objs, download_path=download_path)
        image_documents = []
        img_text_nodes = []
        for image_dict in image_dicts:
            image_doc = ImageDocument(image_path=image_dict["path"])
            img_text_nodes.append(image_doc)
        return img_text_nodes

    def document_processing_llamaparse(self,file_name: str ,image_output_folder:str):
        """Parse document in using llamaparse and return extracted elements in json format"""
        json_objs = self.parser.get_json_result(file_name)
        json_list = json_objs[0]["pages"]
        print(json_list)
        if not os.path.exists(image_output_folder):
            os.mkdir(image_output_folder)

        image_text_nodes = self.get_image_text_nodes(image_output_folder,json_objs)
        return json_list

paper_dict = [
                {"image_folder":"docs/mattergen/",\
              "doc_folder":"docs/example_documents/",\
              "fname":"mattergen.pdf",}]

image_folder = paper_dict[0]["image_folder"]
doc_folder = paper_dict[0]["doc_folder"]
fname = paper_dict[0]["fname"]
llama_parser = llama_document_parser(parsing_ins=ins)
# llamaparse to extract documents
json_list = llama_parser.document_processing_llamaparse(file_name=f"{doc_folder}{fname}",image_output_folder=image_folder)

Additional context
Add any additional context about the problem here.

Hi @hexapode , is this bug replicable and is there any plan to improve this? Since Image extraction is one of the crucial feature LlamaParse provides that I consider as a deal breaker.

Would also like to know if there some workaround

authors: TonySimonovsky tkcoding


text:
Create Spring-Garden

This plugin highlights the tiles that are used to walk through the Sorceress's Garden/Spring either green when it is safe to walk to them or red when it is not safe. It uses the Spring Elemental NPCs' positions to determine if it is safe to move to the next tile. The README.md file has more details on what it does.
README.md

Just in case you didn't know, there is a plugin for summer garden already: https://github.com/LlemonDuck/one-click-summer-garden

repo: runelite/plugin-hub


text:
Grand Exchange Buying limit reached (Notification and 4 hour timer)

When an Item from the grand exchange has successfully been bought we get a notification in the chat.
Is it possible to get a similar notification when the 4-hour buying limit has been reset?
Can we also have a real-time 4-hour timer that is shown under the offer section of the Grand Exchange plugin? So we can see in real time how many hours, minutes, seconds is left till we can buy that item again.
This will be extremely useful.

I agree! I feel this would be an extremely useful addition.

I think the flipping utilities plugin on the plugin hub tracks this

It does appear to do so. I would recommend using that plugin for these features.

authors: Nightfirecat SammiIvan abextm nlruk

repo: runelite/runelite


text:
Timers Plugin - Group Iron Man Teleport

Currently the Home teleport timer icon only shows when triggered via the spell book teleport, can the teleport timer be shown/track when the helmet teleport is used? They share the same cooldown.

Fixed in #14842

authors: Nightfirecat the-fifth


text:
Special Attack Counter doesn't always register BGS special attacks

Type
Incorrect behavior
Operating System
Windows
OS Version
Windows 10
Bug description
When in a party, BGS specs don't always register. This happens both locally and for party members. I haven't found any correlation to explain why it happens. Doesn't seem to happen with DWH specs.
Screenshots or videos
Filesize is too big for GH but here's a Streamable clip:
https://streamable.com/g81mcu
Apologies for the weird client layout, but you can tell the 4 clients in the bottom right clearly get an exp drop on BGS specs but the BGS counter doesn't go up.
RuneLite version
RuneLite version: 1.8.26
Launcher version: 2.1.5
Logs
client.log
launcher.log

I can get more clips or record with a different layout to make it more clear if needed, let me know.

This probably is caused by one ticking the specs

This probably is caused by one ticking the specs

Yep, that'll do it. Would it be possible to check what weapon is being equipped and update special counter accordingly?

1 ticking specs should be supported, do you have a video of it happening?

1 ticking specs should be supported, do you have a video of it happening?

https://streamable.com/g81mcu
Pay attention to the 4 clients in the bottom right corner.

@Nope1252 Is this still an issue since #16605 was merged?

authors: Alexsuperfly Nightfirecat Nope1252 hex-agon


text:
Outer map areas are clipping and other locations are rendered in within 117 HD Plugin

Type
Incorrect behavior
Operating System
Windows
OS Version
Windows 10
Bug description
Issue within the OSRS Runelite 117 HD Plugin

Other areas or locations in most cases are appearing in the distance when they should not.
Some parts of the map are clipping or not being rendered, creating an unfinished puzzle look.
Turning off 117 HD Plugin resolves the issue, which leads me to believe the issue resides in the 117 HD plugin itself.
Attachments with examples of both issues are included.

Screenshots or videos

RuneLite version
RuneLite version: 1.10.14.2
Oldschool revision: Rev 217
Launcher version: 2.6.8
Logs
No response

report your issue here: https://github.com/RS117/RLHD

authors: Felanbird PopePK


text:
60 FPS Option Like Runeloader

If you know Runeloader, it's a client that it's pretty much garbage but it had an option for 60 fps, when you toggle it your fps would fly to the roof.
It was the only way I could play but now Runeloader is closed, can you guys add this, I know there is already a low detail option on RL but it doesn't do anything, for me at least.

Was this ever added?


text:
Bandos boss timer off

it's off by around 7 seconds, I don't know if it's the same for the other bosses

Duplicate of #439

7 seconds seems like a lot for this to just be a ticks vs timers issue


text:
Added food hover overlay for Thin and Fat Snail meat

Added range of 5-7 hp for Thin Snail Meat.
Added range of 7-9 hp for Fat Snail Meat.
Issue:
https://github.com/runelite/runelite/issues/6332

Put Closes #6332 in the original post and GitHub will automatically close it if this gets merged. You also don't need to comment in an issue linking to this PR, as GitHub will make a reference link when you mention the # code.


text:
feat: rootfs - build/upload action and Dockerfile

Issue #, if available:
https://github.com/runfinch/finch/issues/492
Description of changes:
In order to facilitate Finch on Windows, we need a root filesystem. We will use this Dockerfile as a basis for that root filesystem - using docker export to turn a built container into an archived rootfs. For the scope of these changes, create the Dockerfile and an action that runs on changes to the file to build and push to ECR repo.
The Dockerfile will be used to create a container such that we can export that container's fs as a tarball and compress it for use with WSL2. For now, we are including cloud-init (at least for the WSL2 rootfs) but need further investigation to determine if we can remove the package to further slim the rootfs..
In order to create the container used as an intermediate step to export
its rootfs, we need to tell buildkit to load the image into Docker. See
This exposes a limitation of buildkit to load multiplatform images:
buildx failed with: ERROR: docker exporter does not currently support exporting manifest lists
thus why the action runs two build-rootfs-image jobs - one for each arch.
See https://github.com/docker/buildx/issues/59 and https://github.com/docker/roadmap/issues/371
Additionally, network performance of the arm64 build is quite slow -
downloads of packages via dnf are on the scale of kb/s (but this has not
been observed on Ubuntu or Alpine images)
Testing done:
Local copy in a private repo, act

[X] I've reviewed the guidance in CONTRIBUTING.md

License Acceptance
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

GitHub secrets are not evaluated on PRs from forks (so as not to allow for bad actors to expose secrets). I've updated the PR to be ready for review, but it the action won't run until merge.

CI failing for known reason described in https://github.com/runfinch/finch/pull/461#issuecomment-1634743783

Missing auth in https://github.com/runfinch/finch-core/actions/runs/5684511073/job/15407368457:
no basic auth credentials
Need to ecr-login - working on a follow up.

repo: runfinch/finch-core


text:
building a docker image of a worker => ERROR [build_final_image 12/17] :(

Hi :) I tried to use your worker and build it with Docker. Unfortunately there are some dependencies issues. Script failed on:
=> ERROR [build_final_image 12/17] RUN --mount=type=cache,target=/root/.cache/pip     pip install --upgrade pip &&     pip install --upgrade -r /requirements.txt --no-cache-dir &&     rm /requirements.txt                           37.8s
with an ERROR:
37.11 Requested torchsde==0.2.5 from https://files.pythonhosted.org/packages/73/8d/efd3e7b31ea854d0bd6886aa3cf44914adce113a6d460850af41ac1dd4dd/torchsde-0.2.5-py3-none-any.whl (from -r /requirements.txt (line 25)) has invalid metadata: .* suffix can only be used with `==` or `!=` operators
37.11     numpy (>=1.19.*) ; python_version >= "3.7"
37.11            ~~~~~~~^
37.11 Please use pip<24.1 if you need to use this version.
37.11 ERROR: Could not find a version that satisfies the requirement torchsde==0.2.5 (from versions: 0.2.5, 0.2.6)
37.30 ERROR: No matching distribution found for torchsde==0.2.5
------

 2 warnings found (use docker --debug to expand):
 - FromAsCasing: 'as' and 'FROM' keywords' casing do not match (line 4)
 - FromAsCasing: 'as' and 'FROM' keywords' casing do not match (line 32)
Dockerfile:69
--------------------
  68 |     COPY builder/requirements.txt /requirements.txt
  69 | >>> RUN --mount=type=cache,target=/root/.cache/pip \
  70 | >>>     pip install --upgrade pip && \
  71 | >>>     pip install --upgrade -r /requirements.txt --no-cache-dir && \
  72 | >>>     rm /requirements.txt
  73 |
--------------------
ERROR: failed to solve: process "/bin/bash -o pipefail -c pip install --upgrade pip &&     pip install --upgrade -r /requirements.txt --no-cache-dir &&     rm /requirements.txt" did not complete successfully: exit code: 1

Any idea how to approach fixing it?
Thank you for any suggestions :)

Same issue... Could you resolve it?

same issue


text:
fix bug: search query overlaps search result

Fixes Issue #1218

Changes proposed
Removed TopBar component as it was impractical.
Files deleted

components/TopBar/CategoryDescriptions.ts
components/TopBar/TopBar.tsx
components/TopBar/index.ts

Files modified

components/Header/Header.tsx
pages/[subcategory]/index.tsx
pages/search.tsx

Screenshots

Before this PR

After this PR
LinksHub.webm
Checklist:

[x] My code follows the guidelines of this project.
[x] I have performed a self-review of my own code.
[ ] I have commented my code, particularly wherever it was hard to understand.
[ ] I have made corresponding changes to the documentation.

Note to reviewers
Hey @rupali-codes, @CBID2, @ujjawaltyagii  please review this PR.
Thanks.

Thanks for merging the PR.
Please add gssoc23 label and level to the PR, otherwise my PR won't count.

Ohh sorry. You didn't check the GSOC box in the issue form. That's why I didn't pick it @harmeetsingh11

@CBID2 & @k-deepak04 you guys should be a little careful, they have removed the entier section of topbar

I'm reverting this PR because of the glitched have been made, @harmeetsingh11 please make a sperate PR and be careful

@rupali-codes I'm sorry for the inconvenience caused by the glitches in the PR.
I have made a fresh PR, please review it.
Thanks

@CBID2 & @k-deepak04 you guys should be a little careful while merging the PRs, they have removed the entier section of topbar

I'm reverting this PR because of the glitched have been made, @harmeetsingh11 please make a sperate PR and be careful

i noticed that he removed the thing query ="typed in the search box", but i thought it was okay to remove that as user knows what he typed and not that relevant.
i'll make sure to ask you before making decesion myself, soory for the inconvinence :(
won't happen again

@k-deepak04 its fine, you don't have to be sorry, just be a little careful :)

repo: rupali-codes/LinksHub


text:
add mobile legends [skip ci]

the game is similar with mobile legends from play store the different is just package name

Thank you for your contribution

authors: SonzaiEkkusu rushiranpise

repo: rushiranpise/Game-Unlocker


text:
Gets clunky version of list_objects working.

The results from list_objects isn't real ergonomic but the data is there.  Parts from @knutin 's branch at https://github.com/knutin/rusoto .

Going to assume no news is good news. 😄

Feedback addressed, I think it's good to go.

LGTM, merging.

repo: rusoto/rusoto


text:
Miscellanous 2018 edition changes

Applies on top of #120.

bors r=notriddle

In retrospect, yeah, that does seem like a good idea.

authors: lnicola notriddle

repo: rust-ammonia/ammonia


text:
Migrate &PathBuf -> &Path

Doesn't &PathBuf make sense just loke &String or &Vec?

WIP

Done, it compiles

yes, &Path is better than &PathBuf

bors r+

@matklad Idk how to fix that...

let's retry
bors r+
On Sun, 15 Mar 2020 at 21:49, Veetaha notifications@github.com wrote:

@matklad https://github.com/matklad Idk how to fix that...
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/rust-analyzer/ra_vfs/pull/21#issuecomment-599262788,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AANB3M5WXAVGPCGQ73YSD3TRHU5M7ANCNFSM4LKWL3KQ
.

authors: Veetaha matklad


text:
Add assist to turn while loop into loop loop

Before:
while cond {
    foo();
}

After:
loop {
    if !cond {
        break;
    }

    foo();
}

This is useful when editing code to add more complex conditions or control flow.

This seems to be a rather simple addition, right? Could I take it as my first contribution to rust-analyzer? :)

It's all yours

authors: Veykril agluszak arzg

repo: rust-analyzer/rust-analyzer


text:
Single-package mode

Today rust-analyzer unconditionally operates on the whole workspace, even if you open a subfolder of the workspace with a single package. It might be reasonable to scope the work to a single package in such cases.
The tradeoff here is:

when you open a single package, refactors don't work across the workspace
but ra needs to cargo check  a single package only, which is especially helpful if the overall build is broken

I haven't thought too deeply how this all should work exactly.
related user request: https://github.com/rust-analyzer/rust-analyzer/issues/10730
Relevant code:
https://github.com/rust-analyzer/rust-analyzer/blob/1ba9a924d7b161c52e605e157ee16d582e4a8684/crates/project_model/src/workspace.rs#L139-L145
https://github.com/rust-analyzer/rust-analyzer/blob/1ba9a924d7b161c52e605e157ee16d582e4a8684/crates/project_model/src/lib.rs#L84

It would also be nice to allow a subset of a workspace. For example in https://github.com/bytecodealliance/wasmtime I often only work on Cranelift which has all crates in the cranelift directory.


text:
In a match / if-let-some the variable isn't shown

rust-analyzer version: rust-analyzer version: bc08b8eff 2022-03-28 stable
rustc version: rustc 1.59.0
relevant settings: VSCode vanilla install.

Issue:
In a match / if-let-some the variable isn't shown, see screenshot.
Test repo: https://github.com/kristof-mattei/let-some.git

Rust analyzer does not provide any debugging capability. I think you are probably using CodeLLDB?

@jhgg that's right. I'll report the bug there!

authors: jhgg kristof-mattei


text:
proc_macro_derive panics, even though it compiles with cargo run

I have a proc_macro crate inside a binary crate, and the proc_macro crate has a proc_macro_derive. With coc-rust-analyzer for coc.nvim this gives the following error on the derive for struct T:
proc macro returned error: proc-macro panicked: called `Result::unwrap()` on an `Err` value: "failed to parse derive input: \"structT{}\""
[rust-analyzer: macro-error]

This is an issue with the parsing in the first line of the function in lib.rs, it seems syn can't parse the token stream.
Cargo run does not give any errors, so it should be valid, and I therefore made it panic with the token stream's debug print, and here is what rust-analyzer's invocation receives:
TokenStream [
    Ident {
        ident: "struct",
        span: 4294967295,
    },
    Ident {
        ident: "T",
        span: 4294967295,
    },
    Group {
        delimiter: Brace,
        stream: TokenStream [],
        span: 7,
    },
]

And here is what cargo run prints:
TokenStream [
  Ident {
      ident: "struct",
      span: #0 bytes(60..66),
  },
  Ident {
      ident: "T",
      span: #0 bytes(67..68),
  },
  Group {
      delimiter: Brace,
      stream: TokenStream [],
      span: #0 bytes(69..73),
  },
]

Here is the code that reproduces this, the toml files are standard for the given dependencies:
src/main.rs:
#[macro_use] extern crate min_derive;

#[derive(MinDerive)]
struct T {

}

fn main() {
    println!("Hello, world!");
}

min_derive/src/lib.rs:
#![recursion_limit = "128"]

extern crate proc_macro;
extern crate syn;
#[macro_use]
extern crate quote;

#[proc_macro_derive(MinDerive, attributes(att))]
pub fn vertex_attrib_pointers_derive(input: proc_macro::TokenStream) -> proc_macro::TokenStream {
    //    panic!("text = {:#?}", input.to_string());
    let _ast = syn::parse_derive_input(&input.to_string()).unwrap();

    (quote! {
        impl T {}
    })
    .parse()
    .unwrap()
}

I just remembered I should add the version of the programs I'm using, so here goes:
rustc: 1.48.0 (stable)
cargo: 1.48.0
nvim: v0.4.4
coc.nvim: 0.0.80-7642d233d6
coc-rust-analyzer: 0.25.0 (Which is the 28-12-20 version of rust-analyzer)

In an attempt to find the cause of this problem I pulled the latest version of rust-analyzer and pointed coc at the new executable, and the issue was gone. It seems that coc-rust-analyzer is just behind whatever commit fixed this issue.
Closing this since the issue is already fixed.

Never mind. The debug build was just too slow to respond, so I didn't get the error until a while later. This issue still exists on the latest commit.

@OleStrohm  What syn crate and quote crate version you are using ?

Okay, I found that it is because we didn't handle well about the spacing between token in proc-macro. #7101 should fix it.

Same error,

It happens when using serde::{Serialize, Deserialize} macros on any struct.

That is not the same error message. Can you open a new issue?


text:
internal: Make CompletionItem label and lookup fields SmolStrs

This replaces a bunch of String clones with SmolStr clones, though also makes a few parts a bit more expensive(mainly things involving format!ted strings as labels).

bors r+

Just wondering, did this end up having a measurable effect?

Not really no, but I imagine that is because some of the code paths require an extra clone of the data again now that should be possible to be removed as well though.
Merged it now neverthless as I don't think this added any real complexity after all.

authors: Veykril lnicola


text:
fix: parse the range pat inside the tuple pat

fixes #10784

bors r+

authors: XFFXFF lnicola


text:
Use a vector of bytes in the PSBT Input type

Done in preparation for briging #1606 back to life.
The first patch creates a new local var, separate because rustfmt goes berserk on this change. Patch 2 does the sig to vector change.

concept ACK. Will actually ACK shortly. We may want to hold off until after the release on this, unless we are planning to get the ECDSA separation into this upcoming release. Otherwise it's a reduction in type safety without a ton of benefit.

We may want to hold off until after the release on this, unless we are planning to get the ECDSA separation into this upcoming release. Otherwise it's a reduction in type safety without a ton of benefit.

Good point. I'll do the ecdas separation shortly as a separate PR and we can wait for that to get some traction before thinking about merging this one. I don't think its super important to get it in next release.

Do yo want some other visual marker on this PR so you remember not to merge it?

Conceptually, this seems like a step backward. Going from strongly typed to weakly typed API. If anything I think we should make this an enum of SegwitSig and LegacySig

If anything I think we should make this an enum of SegwitSig and LegacySig

If we want that then I can close this and do it as part of the ECDSA separation work, @apoelstra what do you think?

Thanks for the review @sanket1729!

I agree with @sanket1729, let's close this one.

Done!

authors: apoelstra sanket1729 tcharding

repo: rust-bitcoin/rust-bitcoin


text:
Introduce primitives, psbt-v0, and bip32

This is not a merge candidate, it is experimental work to try to prove the state we would like to get to with these three new crates.
By depending on this branch we hope to be able to invert the dependency relationship between rust-bitcoin and rust-miniscript.
This is the demo work for epic #2882.

Just so you know what we are getting ourselves into @apoelstra this took me a good chunk of yesterday and a couple hours this morning.

I think this is in a state now that we can start to discuss crate smashing with some concrete code to talk about instead of hypotheticals.
My first question is please:

What is the benefit/purpose of splitting address out into a separate crate?

What is the benefit/purpose of splitting address out into a separate crate?

address has dependencies on base58, bech32 and possibly crypto (for Taproot tweaking and then definitely for silent payments) while the rest of the primitives only need hashes (I think). Addresses are also conceptually outside of primitives because they don't exist on-chain and are basically a social convention for communicating scriptpubkeys.
Having said all that I don't feel too strongly about it.

Best saturday hacking session ever - this branch now makes rust-bitcoin depend on miniscript - BOOM!
Uses https://github.com/rust-bitcoin/rust-miniscript/pull/699

Lol, 25 thousand line diff - we can just merge this, right :)

What is the benefit/purpose of splitting address out into a separate crate?

address has dependencies on base58, bech32 and possibly crypto (for Taproot tweaking and then definitely for silent payments) while the rest of the primitives only need hashes (I think).

Thanks, I thought this might be the assumption. We also have:

crypto::key depending on base58 because if WIF stuff.
witness_version depending on bech32 to do fe32 conversion.

Addresses are also conceptually outside of primitives because they don't exist on-chain and are basically a social convention for communicating scriptpubkeys.
Excellent, I did not think of this.

Having said all that I don't feel too strongly about it.

On that note, I'm going to leave it for now. As you suggested before.

What is the benefit/purpose of splitting address out into a separate crate?

What @apoelstra said plus I've recently realized that the more we split the crate the easier code review becomes for applications that don't need certain parts of the library. For instance Firefish signers don't need addresses at all - they only operate on transactions/scripts/keys. Having more easily reviewable dependencies is a huge win for security-critical stuff.
As another non-security-critical example, electrs doesn't use addresses (it uses script hashes), so we could make it faster to compile by removing the whole address code.
Thus I strongly believe that address should be separated.

crypto::key depending on base58 because of WIF stuff.

witness_version depending on bech32 to do fe32 conversion.

I believe it's reasonable to make both optional dependencies. It's easy and niche.

Now includes:

Optional dependencies in primitives on bech32 and base58.
A separate address crate.

FTR the bitcoin-address name is taken on crates.io by another, to me until today, unknown developer: https://crates.io/crates/bitcoin-address/0.1.5

Lol, he also has his own hex crate. Gotta love Rust.
And ok, hmm. bitcoin-address is hard to rename. The existing crate is super small, hasn't been maintained in a few years, and has lots of "learning Rust"isms like functions taking &String. We could try asking for it but it looks like Kix did this a year ago https://github.com/joegesualdo/bitcoin-address/issues/1 and got no reply.
At the very least the existing bitcoin-address crate is totally safe but has a nearly-useless API. I worry that one day the name will be stolen by somebody malicious and replaced with a bad copy of our crate, whatever it's called. So we shouldn't pick a name too close to bitcoin-address.
Maybe we could take bitcoin-scriptpubkey or bitcoin-receive or bitcoin-address-encoding (maybe dangerous).

We could try asking for it but it looks like Kix did this a year ago https://github.com/joegesualdo/bitcoin-address/issues/1 and got no reply.

Crates.io policies page mentions that if the current owner is not reachable that the crates.io team can help mediate.

I worry that one day the name will be stolen by somebody malicious and replaced with a bad copy of our crate, whatever it's called.

Sounds like that would be in violation of the usage policy and could probably be contested.
For better or worse crates.io is centralized.  I guess it's also an option to just host crates outside of crates.io and then use any name.

The name bitcoin-scriptpubkey is available. If we use that name I'm concerned that the abstraction might become muddied if/when we introduced script tagging. Presumably there will be some sort of "scriptPubkey" abstraction then in rust-bitcoin. Perhaps bitcoin-receive is a good name because its a bit more fuzzy - "stuff that allows you to receive bitcoin" seems like a good description for the crate that includes Address, AddressType, NetworkChecked, NetworkUnchecked, KnownHrp, AddressData.

Optional dependencies in primitives on bech32 and base58.

That's not what I meant.

Optional dependencies in primitives on bech32 and base58.

That's not what I meant.

I'm lost, by this comment and what you mean by the original comment then?

I'm lost, by this comment and what you mean by the original comment then?

Sorry, I had a huge brain fart, I was tired. You were correct. Though I suspect the fe32 conversion will cause stabilization issues so maybe we'll have to remove it temporarily.

We should remove the Fe32 conversion if it's causing any problems. Users can convert to a u8 and then to a Fe32 if they need to do this ... but I'm struggling to think when, outside of implementing the rust-bech32 crate (which owns Fe32 and can do whatever conversions it wants), they would ever need to do so.

authors: Kixunil apoelstra tcharding yancyribbens


text:
Add doc comment detailing fee calculation

Update doc comment to make clear that the ceiling is computed instead of the default behavior for integer division.

Pull Request Test Coverage Report for Build 10896900441
Details

0 of 0   changed or added relevant lines in 0 files are covered.
No unchanged relevant lines lost coverage.
Overall coverage remained the same at 82.765%

Totals

Change from base Build 10871993775:
0.0%

Covered Lines:
18930

Relevant Lines:
22872

💛  - Coveralls

I think we should be more explicit:
When the resulting fee would be a non-integer amount, we round up, to ensure that transactions have at least the required fee.

I think we should be more explicit:

I dig it.  Used your suggestion and doctored it to match the rest of the comments and be more explicit.

In 83520e00692eb1c0fb197f6a1cbaa595f337589d there is trailing whitespace.

Damn, one more reason to never review using GitHub interface, even for simple patches.

In https://github.com/rust-bitcoin/rust-bitcoin/commit/83520e00692eb1c0fb197f6a1cbaa595f337589d there is trailing whitespace.

Thanks, fixed.

authors: apoelstra coveralls tcharding yancyribbens


text:
*-sys crate design

FFI crate separation, e.g. cuda-sys, cudart-sys, and cublas-sys has benefit

to separately link to libcuda.so, libcudart.so, libcublas.so
to better support cargo feature gates disccused in https://github.com/rust-cuda/cuda-sys/pull/5

How to split?

cuda-sys

FFI for CUDA Driver API (libcuda.so)

cudart-sys

FFI for CUDA Runtime API (libcudart.so)

cublas-sys

FFI for cuBLAS

cufft-sys

FFI for cuFFT

and so on.

Moved: https://github.com/rust-cuda/cuda-sys/issues/9

repo: rust-cuda/wg


text:
code to use lsm303agr in chapter LED compass

What this implement/fix?
This add the code link to use lsm303agr package instead of lsm303dlhc for newer boards.
This will help people to get a temporary solution until some real fix happens.

r? @jamesmunns
(rust-highfive has picked a reviewer for you, use r? to override)

It would be better to include the code directly here, rather than linking to an external repository.
Looking through the linked code, it also be better if the whole thing was just one file, rather than splitting initialization and so on up, since that would be friendlier to newcomers.

authors: NitinSaxenait eldruin rust-highfive

repo: rust-embedded/discovery


text:
Add Deque::{swap, swap_unchecked, swap_remove_front, swap_remove_back}

These methods are equivalent to their std counterparts (except swap_unchecked(), which is a natural extension).

I fixed the Miri error in CI, there remain some errors from Clippy, which are however not caused by this PR: it seems that a new version of Clippy flags new errors.

The clippy warnings have been fixed in the mean time (#512).
Could you rebase your PR?

We discussed this in today's matrix meeting and the response was positive. So @honzasp, if you rebase this, I'm sure it will be approved soon.

@jannic Rebased and all checks passed :tada:

authors: honzasp jannic

repo: rust-embedded/heapless


text:
Clarify the relationship between a Task and a Stream

I've just started having a poke around after coming from an Akka Streams world. I'm just trying to clarify whether the Stream::poll_next(cx) can be called by different tasks/contexts/executors. The docs only reference the task in passing.

Attempt to pull out the next value of this stream, registering the current task for wakeup if the value is not yet available, and returning None if the stream is exhausted.

And many of the stream combinators only have 1 slot for cx.waker instead of a queue.
Sorry if the relationship is obvious to others, I've only just started having a look wasn't sure if fan-in/out topologies are OK with just locking/thread-safety, or if the upstream Streams need to be polled by a stable task.

I'm just trying to clarify whether the Stream::poll_next(cx) can be called by different tasks/contexts/executors

Yes, streams and futures have to call wake() on the waker that the received last. Calling them with a new context that contains a different waker is fine.
However, the exchange is not synchronized. This means that until poll returns you cannot be sure that the stream/future exclusively calls the new waker. It can happen that it also calls the old waker. It's unlikely, but not guaranteed.

@cramertj Does that sound right?

Sounds about right. Just to clarify this bit:

However, the exchange is not synchronized. This means that until poll returns you cannot be sure that the stream/future exclusively calls the new waker. It can happen that it also calls the old waker. It's unlikely, but not guaranteed.

If Stream::poll_next is called and returns Pending, it is guaranteed that it already has or will call wake() on the waker in the context passed to the latest invocation of Stream::poll_next. Spurious wakeups are always allowed, so it may at any point call wake() on an old waker that was previously passed to poll_next, but it is guaranteed that the latest waker passed to poll_next will receive a wakeup when the stream is ready to make progress.

Thanks, that clarifies things a bit. I guess in the situation where the stream is partitioning itself into multiple substreams, it needs to guarantee that is calls the latest waker for a substream when that substream is ready.

authors: MajorBreakfast bharrisau cramertj

repo: rust-lang-nursery/futures-rs


text:
Don't drop AsyncWrite in IntoAsyncRead

This implements AsyncWrite for IntoAsyncRead when the inner stream implements it,
forwarding all method calls.
This allows working on Types that keep both impls, and allows framing
them with codecs where those require both traits (like tokio codec).
r? @cramertj

This seems like a fine change to me, but did you mean to have a different commit message? The commit message and PR name seem to suggest a different thing than what is implemented here.

@cramertj We can change the commit message to whatever you like. From the user perspective it's like you have a Type which implements AsyncWrite and when you call into_async_read, you lose the AsyncWrite functionality. That's why I called it like this. This doesn't actually provide any new functionality, just makes the inner AsyncWrite available on the wrapper to avoid losing the functionality, and to be able to work with API's that require both. Especially since IntoAsyncRead will consume the inner stream.
Which part does not correspond to the code? I'm a bit  confused. It looks like the first paragraph describes the implementation exactly.

"Add AsyncWrite implementation for IntoAsyncRead" or "impl AsyncWrite for IntoAsyncRead" seems good commit message to me. (refs: #1575, #1503)

I changed the pull request title and the commit message.

I changed the pull request title and the commit message.

authors: cramertj najamelan taiki-e


text:
Add colon to MySuperSliceable too

Added colon to MySuperSliceable like the other struct in exotic-sizes.
struct MySuperSlice {
    info: u32,
    data: [u8],
}

struct MySuperSliceable<T: ?Sized> {
    info: u32,
    data: T    <- probably needed in here too?
}

May I ask if by colon you mean comma?

@harrysarson Ah, sorry. Yes

authors: chansuke harrysarson

repo: rust-lang-nursery/nomicon


text:
Weird indentation for method call

The following:
           new_style = context.stylist.style_for_anonymous::<E>(
                &context.guards,
                pseudo,
                &new_style,
            );

gets formatted as:
           new_style =
                context
                    .stylist
                    .style_for_anonymous::<E>(&context.guards, pseudo, &new_style);

which turns out to be longer horizontally than the original.

On master, I get
    new_style = context
        .stylist
        .style_for_anonymous::<E>(&context.guards, pseudo, &new_style);

We don't try and give the shortest (in any dimension) formatting, rustfmt just sticks to rules which are defined to give a clear, fairly succinct formatting. In this case we prefer keeping the short function call on one line rather than the chain, which reflects precedence.

authors: jdm nrc

repo: rust-lang-nursery/rustfmt


text:
make all error 101 on Ubuntu 14.04

https://github.com/rust-lang/rust-by-example/issues/693#event-511355523
make all
./setup-stage.sh
取出版本 134。
cargo run
Downloading regex v0.1.41
unable to get packages from source
To learn more, run the command again with --verbose.
make: *** [all] 错误 101

Can you run with the --verbose flag? It would be useful to see some more error information here.

where to add this --verbose flag?
I tried to add it in Makefile: cargo --verbose run
I got the following with make all:
make all
./setup-stage.sh
取出版本 134。
cargo --verbose run
Invalid arguments.
Usage:
cargo  [...]
cargo [options]
make: *** [all] error 1

You'll want to do cargo run --verbose

Thanks and done.
make all
./setup-stage.sh
取出版本 134。
cargo run --verbose
Downloading memchr v0.1.6
Downloading rustc-serialize v0.3.16
unable to get packages from source
Caused by:
Failed to download package rustc-serialize v0.3.16 from https://crates.io/api/v1/crates/rustc-serialize/0.3.16/download
Caused by:
Timeout was reached
make: *** [all] error 101
I think I have to use VPN to cross the GFW.

Ah yes, in this case if a timeout is reached it may just mean that the timeout needs to be increased

authors: alexcrichton tiansiyuan

repo: rust-lang/cargo


text:
Suggestion for cargo book Continuous Integration section to include GitHub Actions

Describe the problem you are trying to solve
It would be helpful to have an official example of using cargo with GitHub actions for CI/CD.
Describe the solution you'd like
A "GitHub Actions" section in https://doc.rust-lang.org/cargo/guide/continuous-integration.html.
Notes
Might be related to https://github.com/rust-lang-nursery/cli-wg/issues/161.

Thanks for the suggestion!  There's a tracking issue (#5656) for updating that chapter in the documentation.  I copied your suggestion over there, and I'm going to close this in favor of that issue.

authors: ehuss trevordmiller


text:
Default values for readme if not specified

If the a value for readme is not specified in Cargo.toml, we will now check for the existence of files named README.md, README.txt or README. If one does exist, the name of that file will be defaulted in to the manifest for the project.
This behavior can be suppressed if readme is set to false.
Closes #8133

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @Eh2406 (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.

@rfcbot fcp merge

@bors: r+
Thanks again!

:pushpin: Commit 58ee013f177c9a9ec1b51633831761e14cd23010 has been approved by alexcrichton

:hourglass: Testing commit 58ee013f177c9a9ec1b51633831761e14cd23010 with merge ec1460a230ec7ef95fc1eea22b60e773c31cf8af...

:boom: Test timed out

@bors: retry

:hourglass: Testing commit 58ee013f177c9a9ec1b51633831761e14cd23010 with merge 1ec223effbbbf9fddd3453cdcae3a96a967608eb...

:sunny: Test successful - checks-azure
Approved by: alexcrichton
Pushing 1ec223effbbbf9fddd3453cdcae3a96a967608eb to master...

authors: alexcrichton bors joshtriplett rust-highfive tverghis


text:
Distinguish lockfile version req from normal dep in resolver error message

Resolves #9840
This PR adds a new variant OptVersionReq::Locked as #9840 described.
The new variant represents as a locked version requirement that contains
an exact locked version and the original version requirement.
Previously we use exact version req to synthesize locked version req.
Now we make those need a truly locked to be OptVersionReq::Locked,
including:

[patch]: previous used exact version req to emulate locked version,
and it only need to lock dep version but not source ID, so we make
an extra method Dependency::lock_version for it.
Dependencies from lock files: No need to change the call site.

FWIW to me this seems like a great idea. I agree though that it'd be best to reduce the dependence on is_exact if we can, since that was previously muddied between = and locked dependencies, but ideally we don't treat = dependencies any different than anything else.

I am sorry. I dropped the ball on this. It looks like Alex like the approach. @weihanglo did you have more clean ups in mind? Do you think this is ready to merge?

Yep, @Eh2406. I think after 4ecb543 and 725420e, it should be ready to merge.
One thing I am not sure is how to create a test case for the "(locked to a.b.c)" message? There is one already but do we need a dedicated one?

Tests for the resolver error messages are woefully lacking. So, having one test that can see the change in behavior feels adequate. If you feel like adding more tests (in another PR) I would not object!
Thank you for working on this!
@bors r+

:pushpin: Commit 725420e8d788e003ee82c15f66d50272aab493d1 has been approved by Eh2406

:hourglass: Testing commit 725420e8d788e003ee82c15f66d50272aab493d1 with merge 4a166de89ffb78c8206da22e50f4b5b4ce53fb6a...

:sunny: Test successful - checks-actions
Approved by: Eh2406
Pushing 4a166de89ffb78c8206da22e50f4b5b4ce53fb6a to master...

authors: Eh2406 alexcrichton bors weihanglo


text:
upgrade dashmap

https://github.com/xacrimon/dashmap/releases
$ cargo upgrade dashmap
docs-rs:
    Upgrading dashmap v4.0.2 -> v5.1.0

( 5.0 release was yanked, 5.1 includes the security update)

r? @Nemo157


text:
msghdr.msg_iovlen is inconsistently declared in gnu and musl

While using socket API in cloud-hypervisor project, I noticed an inconsistency with msghdr struct between gnu and musl targets.
In gnu
msghdr.msg_iovlen is declared as size_t
https://github.com/rust-lang/libc/blob/0488a83dc9aba7ec0643ea45d85cc722891e8cc2/src/unix/linux_like/linux/gnu/mod.rs#L95
In musl
msghdr.msg_iovlen is declared as c_int
https://github.com/rust-lang/libc/blob/0488a83dc9aba7ec0643ea45d85cc722891e8cc2/src/unix/linux_like/linux/musl/b64/mod.rs#L98
https://github.com/cloud-hypervisor/cloud-hypervisor/pull/4642#issuecomment-1285949226 describes the error I encountered due to this inconsistency.
Is this expected? If not, could you please fix it?

Hm, glibc seems to declare it as an integer too, see the glibc header source.
(The musl one is correct, see the musl header source.)
But changing it would be a breaking change I guess...

The glibc type should be corrected to match the glibc definition, we can consider this for 0.3

The current declaration seems to be correct, the linux-specific socket.h header in glibc declares it as size_t: https://github.com/bminor/glibc/blob/b6e3898194bbae78910bbe9cd086937014961e45/sysdeps/unix/sysv/linux/bits/socket.h#L269

My bad, I looked at the generic source :disappointed:

So I suppose this issue can be closed then?

See this musl commit for the background. Essentially, the glibc version matches the one used in the kernel. Musl uses a POSIX-ly correct variant, but then zero-fills the padding in the syscall wrapper before passing it on to the kernel.
It is hard to say what the correct approach is here.

authors: Amanieu git-bruh niluxv praveen-pk workingjubilee

repo: rust-lang/libc


text:
Add sys/personality.h constants for Linux

These consts are used for the personality(2) syscall and can be found in /usr/include/sys/personality.h

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

It seems musl and emscripten don't have UNAME26 and FDPIC_FUNCPTRS.
https://github.com/bminor/musl/blob/b4b1e10364c8737a632be61582e05a8d3acf5690/include/sys/personality.h#L8-L16
https://github.com/emscripten-core/emscripten/blob/2bca083cbbd5a4133db61fbd74d04f7feecfa907/system/include/libc/sys/personality.h#L8-L16
You can move them to the platforms that you want to use.

You can move them to the platforms that you want to use.

Thanks! Will do

Hmm. CI fails at the StyleAndDocs step with the following error:
+ cargo doc --target aarch64-unknown-cloudabi --no-default-features --features extra_traits
   Compiling libc v0.2.74 (/home/vsts/work/1/s)
 Documenting libc v0.2.74 (/home/vsts/work/1/s)
error[E0463]: can't find crate for `core`
  |
  = note: the `aarch64-unknown-cloudabi` target may not be installed

Any ideas why this might happen?

The problem here is that rust-src for that target is missing in today's nightly. I'll fix it soon, one sec.

Well, I noticed today's nightly is missing rust-src for a lot of targets, testing in #1850, it's... painful :/ Could you wait for fixing this issue on upstream?

Sure, thanks for your help!

So, it turned out the cargo failure, not component's. I missed this...:
+ cargo doc --target aarch64-unknown-cloudabi -Z build-std=core,alloc --no-default-features --features extra_traits
error: failed to read `/usr/share/rust/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/src/libstd/Cargo.toml`

Caused by:
  No such file or directory (os error 2)

This should be fixed by https://github.com/rust-lang/cargo/pull/8558 and I confirmed the things work well in today's nightly.
Let's re-trigger CI to make it green.

Awesome, thanks :)

authors: JohnTitor nbaksalyar rust-highfive


text:
Signal controlling constants for windows

This is replacement of #1626, because I have lost the repository with that branch in the meantime. The content is the same (unless I've made some mistake copying it over), just rebased onto current master.

r? @m-ou-se
(rust-highfive has picked a reviewer for you, use r? to override)

Thanks!
r? @JohnTitor @bors r+

:pushpin: Commit ef79747c198983d573f494527dba9738411d4d95 has been approved by JohnTitor

Oh wait, we should add them to the semver list: https://github.com/rust-lang/libc/blob/master/libc-test/semver/windows.txt
@bors r-

@bors r-

@bors r+

:pushpin: Commit 707294d2b678d9cdea975d4e7f9d94b03cccdab5 has been approved by JohnTitor

:hourglass: Testing commit 707294d2b678d9cdea975d4e7f9d94b03cccdab5 with merge 6b0224e39bdb2fe80efcb173e59cfebf37d5871d...

:boom: Test timed out

@bors retry

:hourglass: Testing commit 707294d2b678d9cdea975d4e7f9d94b03cccdab5 with merge 4952853f4e3418c237aab3c1b58d22baa069e97d...

authors: JohnTitor bors rust-highfive vorner


text:
Use more convenient and UNIX-agnostic shebang

Pure sh scripts should use /bin/sh as it's available on every platform.
When using bash-specific features, use env to find it, as bash can
be installed in different places according the OS.

Thanks!
@bors r+

:pushpin: Commit 97a81d7 has been approved by malbarbo

:hourglass: Testing commit 97a81d792076b9135a3eeccbbf3a154e83d48627 with merge ccdbf12a81120bc5214cb2e9b0f835b3a9271e75...

:broken_heart: Test failed - status-travis

@bors retry

:hourglass: Testing commit 97a81d792076b9135a3eeccbbf3a154e83d48627 with merge 55c03cd25a69ebe2d5d1f18042117b7b9716e9b7...

:sunny: Test successful - status-appveyor, status-travis
Approved by: malbarbo
Pushing 55c03cd25a69ebe2d5d1f18042117b7b9716e9b7 to master...

authors: bors dereckson malbarbo


text:
Need to fix 'miri' bash script for Windows powershell users

While trying to work on Issue #707 locally, I got stuck with 'Testing the Miri driver' step. I used Powershell to confront the above error. The current issue is that $MIRI_SYSROOT fed to the miri executable is stripped off of its backslashes, resulting in an error "can't find crate for std"
Maybe the 'miri' bash script should be fixed to escape backslashes for windows users?
Or it could also be an issue with cargo

Unfortunately I have no experience with bash scripts on Windows, nor with power shell. But I'd happily review a PR trying to fix this. :)
I am surprised the bash script does anything on Windows. I didn't even know PowerShell can run bash...

@JOE1994 so now that this works, do you think we could somehow use the miri script for our AppVeyor CI (configured at https://github.com/rust-lang/miri/blob/master/.appveyor.yml ) ?

@RalfJung I currently have zero knowledge of AppVeyor CI. I'll need some time to learn about it before I can say something about it 😢
https://github.com/rust-lang/miri/blob/0d01c306fe032de4f2c4722ae235caa021ad37db/.appveyor.yml#L1-L6
Is the AppVeyor script solely for Windows ??
(I assume not, but don't see any TARGETs in the script other than Windows)

Yes AppVeyor is for Windows only. So really the main question is: how do I get bash onto Windows? Is that a normal thing for Rust devs to do on Windows?

In either Powershell or the Batch shell (2 shells that come with Windows), it is possible to run bash scripts or enter bash shell by using the sh command.

how do I get bash onto Windows? Is that a normal thing for Rust devs to do on Windows?

Maybe I should ask this question to the Rust language forum or the Rust subreddit to find out..
Personally, I try to use bash on Windows when projects only provide bash scripts for building it.
https://users.rust-lang.org/t/is-it-normal-to-use-bash-on-windows-to-build-rust-projects/33628

Hm, but sh is not shipped with Windows, right? Don't we need to install it?

It is shipped with Windows by default.

Oh.. I just realized that it is not shipped with Windows by default.
One needs to have WSL(Windows Subsystem for Linux) installed and enabled in order to use bash shell in Windows.

That still seems to be rather experimental on the AppVeyor side: https://github.com/appveyor/ci/issues/1295.
So, probably best to stick to our current scheme for now. Thanks for testing the script on WSL though, good to know it works now!

Git for Windows ships with bash (bash and sh executables) so anybody who have git will have sh available.

repo: rust-lang/miri


text:
Compile Error: unresolved import crate::arch::x86_64::_mm_movemask_pi8

When trying to compile a hello world program with packed_simd-0.3.3 as a dependency, I'm getting the following compile error:
error[E0432]: unresolved import `crate::arch::x86_64::_mm_movemask_pi8`
  --> C:\Users\me\.cargo\registry\src\github.com-1ecc6299db9ec823\packed_simd-0.3.3\src\codegen\reductions\mask\x86\sse.rs:47:21
   |
47 |                 use crate::arch::x86_64::_mm_movemask_pi8;
   |                     ^^^^^^^^^^^^^^^^^^^^^----------------
   |                     |                    |
   |                     |                    help: a similar name exists in the module: `_mm_movemask_epi8`
   |                     no `_mm_movemask_pi8` in `arch::x86_64`
   |
  ::: C:\Users\me\.cargo\registry\src\github.com-1ecc6299db9ec823\packed_simd-0.3.3\src\codegen\reductions\mask.rs:41:1
   |
41 | impl_mask_reductions!(m8x8);
   | ---------------------------- in this macro invocation
   |
   = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0432]: unresolved import `crate::arch::x86_64::_mm_movemask_pi8`
  --> C:\Users\me\.cargo\registry\src\github.com-1ecc6299db9ec823\packed_simd-0.3.3\src\codegen\reductions\mask\x86\sse.rs:62:21
   |
62 |                 use crate::arch::x86_64::_mm_movemask_pi8;
   |                     ^^^^^^^^^^^^^^^^^^^^^----------------
   |                     |                    |
   |                     |                    help: a similar name exists in the module: `_mm_movemask_epi8`
   |                     no `_mm_movemask_pi8` in `arch::x86_64`
   |
  ::: C:\Users\me\.cargo\registry\src\github.com-1ecc6299db9ec823\packed_simd-0.3.3\src\codegen\reductions\mask.rs:41:1
   |
41 | impl_mask_reductions!(m8x8);
   | ---------------------------- in this macro invocation
   |
   = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0432]: unresolved import `crate::arch::x86_64::_mm_movemask_pi8`
  --> C:\Users\me\.cargo\registry\src\github.com-1ecc6299db9ec823\packed_simd-0.3.3\src\codegen\reductions\mask\x86\sse.rs:47:21
   |
47 |                 use crate::arch::x86_64::_mm_movemask_pi8;
   |                     ^^^^^^^^^^^^^^^^^^^^^----------------
   |                     |                    |
   |                     |                    help: a similar name exists in the module: `_mm_movemask_epi8`
   |                     no `_mm_movemask_pi8` in `arch::x86_64`
   |
  ::: C:\Users\me\.cargo\registry\src\github.com-1ecc6299db9ec823\packed_simd-0.3.3\src\codegen\reductions\mask.rs:47:1
   |
47 | impl_mask_reductions!(m16x4);
   | ----------------------------- in this macro invocation
   |
   = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0432]: unresolved import `crate::arch::x86_64::_mm_movemask_pi8`
  --> C:\Users\me\.cargo\registry\src\github.com-1ecc6299db9ec823\packed_simd-0.3.3\src\codegen\reductions\mask\x86\sse.rs:62:21
   |
62 |                 use crate::arch::x86_64::_mm_movemask_pi8;
   |                     ^^^^^^^^^^^^^^^^^^^^^----------------
   |                     |                    |
   |                     |                    help: a similar name exists in the module: `_mm_movemask_epi8`
   |                     no `_mm_movemask_pi8` in `arch::x86_64`
   |
  ::: C:\Users\me\.cargo\registry\src\github.com-1ecc6299db9ec823\packed_simd-0.3.3\src\codegen\reductions\mask.rs:47:1
   |
47 | impl_mask_reductions!(m16x4);
   | ----------------------------- in this macro invocation
   |
   = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0432]: unresolved import `crate::arch::x86_64::_mm_movemask_pi8`
  --> C:\Users\me\.cargo\registry\src\github.com-1ecc6299db9ec823\packed_simd-0.3.3\src\codegen\reductions\mask\x86\sse.rs:47:21
   |
47 |                 use crate::arch::x86_64::_mm_movemask_pi8;
   |                     ^^^^^^^^^^^^^^^^^^^^^----------------
   |                     |                    |
   |                     |                    help: a similar name exists in the module: `_mm_movemask_epi8`
   |                     no `_mm_movemask_pi8` in `arch::x86_64`
   |
  ::: C:\Users\me\.cargo\registry\src\github.com-1ecc6299db9ec823\packed_simd-0.3.3\src\codegen\reductions\mask.rs:52:1
   |
52 | impl_mask_reductions!(m32x2);
   | ----------------------------- in this macro invocation
   |
   = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0432]: unresolved import `crate::arch::x86_64::_mm_movemask_pi8`
  --> C:\Users\me\.cargo\registry\src\github.com-1ecc6299db9ec823\packed_simd-0.3.3\src\codegen\reductions\mask\x86\sse.rs:62:21
   |
62 |                 use crate::arch::x86_64::_mm_movemask_pi8;
   |                     ^^^^^^^^^^^^^^^^^^^^^----------------
   |                     |                    |
   |                     |                    help: a similar name exists in the module: `_mm_movemask_epi8`
   |                     no `_mm_movemask_pi8` in `arch::x86_64`
   |
  ::: C:\Users\me\.cargo\registry\src\github.com-1ecc6299db9ec823\packed_simd-0.3.3\src\codegen\reductions\mask.rs:52:1
   |
52 | impl_mask_reductions!(m32x2);
   | ----------------------------- in this macro invocation
   |
   = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)

error: aborting due to 6 previous errors

For more information about this error, try `rustc --explain E0432`.
error: could not compile `packed_simd`

To learn more, run the command again with --verbose.

I'm using rustc 1.50.0-nightly (f76ecd066 2020-12-15) on Windows.
Edit:
I just tried compiling the same program on Linux (same rustc version) and it gave me the same error

Ok guys I'm just dumb and didn't read the docs, I just imported the old broken version of packed_simd. Sorry guys

No worries, it's a bit confusing!

@Sp00ph can you tell me what you did to remove this error?
I am getting the same error while using nightly to build my code.

You need to use packed_simd_2 as a dependency, packed_simd on crates.io is unmaintained

Can you guide me how to make those changes?
I tried adding: packed_simd = { version = "0.3.4", package = "packed_simd_2" } to the dependencies.
Still, I couldn't resolve the error.

You need to use packed_simd_2 as a dependency, packed_simd on crates.io is unmaintained

Can you guide me how to make those changes?
I tried adding: packed_simd = { version = "0.3.4", package = "packed_simd_2" } to the dependencies.
Still, I couldn't resolve the error.

Maybe try cargo clean and then  cargo build? I think cargo sometimes messes up when you change dependencies

I tried this but still it isn't resolved. You can check this link:
I finally managed to resolve it. Thanks for your help.

authors: Sp00ph calebzulawski vikilleaks


text:
Consider removing splatting from operator overrides

Removing splatting from operator overloads would make simd more consistent with the rest of Rust where explicit type conversions are basically always needed, it would also greatly simplify our docs.
Because splatting is so common, we could add a global splat function (wouldn't necessarily replace Simd::splat, but would be otherwise identical) and/or a Splat trait such that you could write my_scalar.splat().
Zulip: https://rust-lang.zulipchat.com/#narrow/stream/257879-project-portable-simd/topic/remove.20splatting.20on.20operators.3F
Related: https://github.com/rust-lang/portable-simd/pull/195#issuecomment-974357869
and: https://github.com/rust-lang/portable-simd/pull/10#issuecomment-701658659

It is not a great amount of simplification, and having to manually splat everywhere makes reading the resulting code more complicated. Comparing it to the absence of numeric promotion is a false analogy.

It is not a great amount of simplification, and having to manually splat everywhere makes reading the resulting code more complicated.

while it may be a little more complex (mitigated by splat fn/trait being short to write, imho consistency and explicitness is waay more important.

Comparing it to the absence of numeric promotion is a false analogy, as the lanewise behavior does not vary, whereas numeric promotion does change lanewise behavior.

That's just cuz your selectively glossing over aspects of the types. imho scalar/vector is a sufficiently important distinction that it should probably not be hidden.

From Zulip:
@thomcc:

if we lose autosplatting, i suspect most of the inference errors related to simd in non-simd code will go away too

Fixing inference in non-simd code may be the most significant reason to remove splatting, as @workingjubilee mentioned on Zulip

Type inference also "hides" details, and yet we have it, because it's not actually hiding anything if you evaluate something in context, So the ship that Rust should never """hide""" anything on a line-by-line basis has long since sailed. There are other languages which treat their users as if they cannot read anything if it is not written out in triplicate, and I purposefully avoid them.

Yeah, not having splatting makes specifically literals a pain in the ass to work with. And we should make them easier to use not worse to use.

Yeah, not having splatting makes specifically literals a pain in the ass to work with. And we should make them easier to use not worse to use.

I recognize that, so I think adding splatted literals might be a good idea: 3.5_f32x4 or 3.5_f32x_

You would have had me on board if you said something like "let float literals infer into being compiled as a splatted simd value". But if you have to type it all the way out that's very bad. I want core::simd to be so good I throw out the wide crate.

hmm, that's an idea i had kinda rejected due to type inference...if you think it'll work i think that'd be a good idea

That would be like a whole T-lang MCP->RFC cycle to get done. I don't think we have the bandwidth for that right now honestly.

That would be like a whole T-lang MCP->RFC cycle to get done. I don't think we have the bandwidth for that right now honestly.

so, we could use splat as a fallback till then, kinda like try! was

authors: Lokathor programmerjake workingjubilee

repo: rust-lang/portable-simd


text:
Use intrinsics for Mask::{to,from}_array

This significantly simplifies codegen and should improve mask perf.
Thanks to @programmerjake for the example for from_array!
This fixes #184.

This version should work except that I believe it requires simd_cast to not vomit on Simd<isize, _>.

Now that https://github.com/rust-lang/rust/pull/92425 is merged, that should allow this to land. Just have to wait for nightly to roll over.


text:
regex-syntax Hir should merge alternation of Class & Literal into Class

What version of regex are you using?
0.7.2
Describe the bug at a high level.
When you have a HirKind::Class and a HirKind::Literal and you join the two, I expect it to be a Class to reduce the syntax tree layers.
What are the steps to reproduce the behavior?
  #[test]
    fn test_merge() {
        let let_dig = regex_syntax::parse("[a-zA-Z0-9]").unwrap();
        let hyp = regex_syntax::parse("-").unwrap();
        let let_dig_hyp = Hir::alternation(vec![let_dig, hyp]);

        // Expected: (?:[0-9A-Za-z-])
        // Got: (?:[0-9A-Za-z]|\-)
        println!("{}", let_dig_hyp.to_string());
    }

What is the actual behavior?
It's added into a whole new HirKind::Alternation.
What is the expected behavior?
We already have the optimization of simplifying a|b|c into [abc], but I would like to see (?:(?:a|b)|c) to also be simplified to [abc].
Context
I am writing a "composable regex" library to allow users to combine pieces of regexes with |, +, *, ? to make regexes more maintainable. When I write test cases I realized the output Hir's are not optimal.

When I write test cases I realized the output Hir's are not optimal.

They never will be. What you're asking for here is an optimization. As long as it can be done cheaply, I'm open to PRs.
Note that it can't be done for every literal and class combination. The literal needs to be at most a single codepoint.

authors: BurntSushi rynewang

repo: rust-lang/regex


text:
clarify license wording

This text historically was copied verbatim from rust-lang/rust's own
README 1 with the intention of licensing projects the same as rustc's
own license, namely a dual MIT/Apache-2.0 license. The clause about
"various BSD-like licenses" isn't actually correct for almost all
projects other than rust-lang/rust and the wording around "both" was
slightly ambiguous.
This commit updates the wording to match more precisely what's in the
standard library 2, namely clarifying that there aren't any BSD-like
licenses in this repository and that the source is licensable under
either license, at your own discretion.3
Fixes #411

cc @carllerche @alexcrichton


text:
both the RFC file name and link in the file should be updated

At least I assume this is the intention? It seems strange to update the file but not the link in said file.

One annoying aspect of this renaming business is that the "Rendered" link that rfcbot adds will then be dangling. Should the README say to update the link?

repo: rust-lang/rfcs


text:
Redirect static.rust-lang.org HTTP -> HTTPS

In particular, someone pointed at http://static.rust-lang.org/dist/ for checksums on IRC.
CC @edunham; not sure if this is the right issue tracker.

I am not sure how do do this. Hopefully it's an option in cloudfront.

See http://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/SecureConnections.html.
Namely:

To require HTTPS between CloudFront and viewers: Configure the Viewer Protocol Policy for some or all of your CloudFront cache behaviors either to redirect HTTP requests to HTTPS requests or to require that viewers use only the HTTPS protocol to access your objects in the CloudFront cache. You can also configure one or more cache behaviors in the same distribution to allow both HTTP and HTTPS, so you can require HTTPS for some objects but not for others.

I've changed the setting in cloudfront, but so far I don't see it redirecting.

It's redirecting.

authors: Ms2ger brson nagisa

repo: rust-lang/rust-www