Fix login not redirecting to a dandiset

When a user that is not logged in views a dandiset, then clicks Log in, the return URL does not record the dandiset they were viewing. Logging in will bounce them back to a blank dandiset page.

Already done in https://github.com/dandi/dandiarchive/commit/0db3a003625fe9e018ddb300833b4380a3a70f10


Not Testing Solution - Freeze Tab Browser

Challenge Bonfire: Where do I belong has an issue.
User Agent is: Mozilla/5.0 (Windows NT 6.1; Trident/7.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET4.0C; rv:11.0) like Gecko.
Please describe how to reproduce this issue, and include links to screenshots if possible.
When I try to run tests, tab browser not response. After that, if I try to reload page, the issue still persist..
My code:
function where(arr, num) {
  // Find my place in this sorted array.
arr.sort();
var  i  = 0 ;
var position = 0;
var exit = false;

while(!exit || i < arr.length)
{
     if(num <= arr[i])
     {
          position = i;
          exit = true;
     }
     i++;
}
  return position;
}

where([40, 60], 50);

You created yourself a infinite loop,
while where([40, 60], 50); test will pass.
where([3,2,1]) this will fail because
exit = true will never happen when 50 > 3, 2, 1
While(exit === false OR i < arr.length) resulting in the loop allways looping. Even if I > arr.length

Ohh Thank A lot!.
Excuseme for this kind of mistake.
Thanks to show me and teach me, this precaution.
@DDaems

Closing this issue as resolved then, thanks @DDaems and @gonzalorodriguez.


Review exception handling across project

We need better exception handling, particularly when errors occur inside message and interval handlers. These should generally not cause the agent to fail.

I would like to bump this issue since I'm continuously running into problems where agents just starting to act weirdly after being unable to send messages to other agents.
The terminal is also being spammed with error messages and this is even more pressing when scaling the agent communication / using the search&discovery mechanisms and a large portion of agents that support a specific protocol are simply not reachable.

A lot has changed since last year and the overall code quality and resiliency has improved.
So I'll close this issue now as it doesn't have a definition of done and we will tackle upcoming errors individually, i.e. create tickets for errors that come up.


${stacktrace} is sometimes empty in 4.3 RC

${callsite} and ${stacktrace} are both empty.
This was in a parallel.Foreach


Fine-tuning on VCR dataset

Thanks for your great work. are you planing to release the code to fine-tune VCR task? I would appreciate it if you could release the code for data processing and data loading.

I have the same request, Thank you a lot!

I also have the same request. Thanks!

Should be addressed by c83dcc1 but let us know if questions 😄 BTW, you might also want to check out MERLOT Reserve an improved version of the model -- we also have code for finetuning it on VCR.


Sometimes spell sprites do not match the spell in RecentItemsDisplay

This seems to be due to progressive spells being a thing.

This should be fixed with #104


prototype for BigDecimal and BigInteger serializers

A quick demo of BigDecimal and BigInteger serializers, based on a custom publication of a KxS snapshot release.
I hacked together a build&deploy script for the latest KxS version, since Jetbrains don't publish snapshot versions.
KxS 1.5.0 is required for BigDecimal JSON encoding support
ks3 probably shouldn't be published while this dependency exists

Lets use the KxS 1.5-RC now 💯

@aSemy lets keep it in ks3-jdk for now? ks3-json is probably a good idea at some point, but feels premature to do so for just the two serializers.
Wanna review the rest and see if you agree on the naming etc?

I can't click the 'approve' button because I'm the original author, but I would if I could. I've got some minor suggestions, but they're very small. Good work, and thanks for finishing it up :)


DataGrid could not be shown in Avalonia 11.1.0-beta1

Usage Information
3.4.2/11.1.0-beta1/Windows
Description
DataGrid could not be shown, just blank
Reproduction Steps
Just a plain Datagrid
Expected Behavior
Show correctly
Actual Behavior
Not shown
Regression?
No response
Known Workarounds
No response
Anything else?
No response
Could you help with a pull-request?
No
Is there an existing issue for this?

[X] I have searched the existing issues

Seems like Material currently isn't fully compatible for 11.1.0 for now. I'll take a look.

Seems like I can't reproduce it - everything works fine. Did you install Material.Avalonia.DataGrid package?

I am sorry I could not reproduce it either. Maybe I forget to install Material.Avalonia.DataGrid package.


Credentials

car_api has what appear to be credentials hard coded.
I’ve not worked with the API yet so may be wrong.
On mobile browsing so couldn’t do much more than this

read into this. apologies


[Bug] Confused about the new extension permission

Version
v1.9.15
Current Behavior

Isn't the github website necessary to perform its core feature marked as Hypertrons Chromium Extension for GitHub?
Expected Behavior
Current solution to restrict the site access I supposed.

Environment
- OS:
- Browser:

Any additional comments?
No response

The functionality of hyperrx will not be limited to the GitHub platform. The newly launched feature has been extended to other document websites for use.

Then, the new phase should probably be Hypertrons Chromium Extension for GitHub and other document websites to express its clarity to end users reaching the Chrome Web Store.

Then, the new phase should probably be to express its clarity to end users reaching the Chrome Web Store.Hypertrons Chromium Extension for GitHub and other document websites

Thank you for your suggestion. We will make adjustments to this in the next release.


Documentation add timezone and localtime volumes to Docker Guide

This pull request adds timezone and localtime volumes to the Installation with Docker guide.
Passing these volumes to the container enable gitea to use hosts localtime and timezone.
This is a mandatory change when using the Fail2ban setup to block users after failed login attemts Guide, but it is not described in the documentation. If not set up correctly, a user will experience the following fail2ban behaviour:
Testing with fail2ban-regex will report a valid regex filter.
sudo fail2ban-regex ./gitea/log/gitea.log /etc/fail2ban/filter.d/gitea.conf
On failed authentication attempt, in certain time configurations, fail2ban will not report the failed attempt, neither will increment the failure detection count or proceed to ban the offender after n tries.
This issue was reported in the past (6421), it seems the issue was forgotten but the described problems still apply today.

In question of the documentation change being added to the docker guide or the fail2ban guide, like the original reported of the issue, i think that using hosts /etc/timezone and /etc/localtime in the container should be considered, even if not using fail2ban

Codecov Report

Merging #8911 into master will increase coverage by <.01%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##           master    #8911      +/-   ##
==========================================
+ Coverage    41.3%   41.31%   +<.01%
==========================================
  Files         545      545
  Lines       70368    70368
==========================================
+ Hits        29068    29074       +6
+ Misses      37601    37593       -8
- Partials     3699     3701       +2

Impacted Files
Coverage Δ

models/unit.go
62.16% <0%> (-5.41%)
:arrow_down:

modules/migrations/migrate.go
21.22% <0%> (-1.68%)
:arrow_down:

routers/repo/view.go
37.71% <0%> (-0.88%)
:arrow_down:

modules/migrations/gitea.go
8.05% <0%> (-0.64%)
:arrow_down:

models/repo.go
49.07% <0%> (-0.06%)
:arrow_down:

models/pull.go
55.35% <0%> (+0.44%)
:arrow_up:

models/error.go
33.86% <0%> (+1.18%)
:arrow_up:

models/pull_list.go
59.85% <0%> (+2.11%)
:arrow_up:

modules/task/migrate.go
28.94% <0%> (+3.94%)
:arrow_up:

modules/indexer/indexer.go
55.26% <0%> (+10.52%)
:arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 01a4a7c...01e24cd. Read the comment docs.


unable to start react

There is an error when I tries to start the npm blaah blaah blaah! so please help me out.

This is a known error, but I'm having trouble finding the tracking issue. The gist is that you need to have cmd in your path. Read here.


cloud_functions - Error when using useFunctionsEmulator(origin:)

The error is not with the function per se, but it happens when I change the origin of the lib to localhost - so I can actually develop locally. I'm not quite sure what's the purpose of the useFunctionsEmulator(origin:) as, in my perspective, this just changes the _origin variable - which is not enough to be able to call functions locally, given the current implementation.
To structure the test, I create this HttpsCallable:
final HttpsCallable _callableFunc = CloudFunctions.instance.useFunctionsEmulator(origin: "http://localhost:5000").getHttpsCallable(functionName: "callableFunction");

While running this - in cloud functions - using firebase emulators:start:
export const callableFunction = functions.https.onCall((data, context) => {
  console.log("Incoming request...")

  return setTimeout(() => {
    if (context.auth) {
      console.log("Authenticated request")
      return { response: "Authenticated request!" }
    } else {
      console.log("Unauthenticated request")
      return { response: "Unauthenticated request!" }
    }
  }, 1000)
})

Then, in the tests below, I just call: _callableFunc.call().
Quick tests
When testing in the iOS platform, we can see that it throws multiple different errors:

When changing the origin to: http://localhost:5000 or http://{my_local_address}:5000, where my_local_address is just the my localhost address, it throws:

    "LocalDataTask <EBB99248-FD9A-44E1-B851-0A52A37FED22>.<1>"
), _NSURLErrorFailingURLSessionTaskErrorKey=LocalDataTask <EBB99248-FD9A-44E1-B851-0A52A37FED22>.<1>, NSUnderlyingError=0x6000028b14a0 {Error Domain=kCFErrorDomainCFNetwork Code=-1022 "(null)"}} [-1022]
flutter: Exception: Unable to call function callableFunction

The specific kCFErrorDomainCFNetwork with code 1022 means "App Transport Security disallowed a connection because there is no secure network connection" - let's discuss that later.

Now, when changing the origin to: https://localhost:5000 or https://{my_local_address}:5000, where my_local_address is just the my localhost address, it throws:

    "LocalDataTask <9709A701-FB6F-4A7F-AC35-310E9D3A5144>.<1>"
), NSLocalizedDescription=An SSL error has occurred and a secure connection to the server cannot be made., NSErrorFailingURLKey=https://<IP_ADDRESS>:5001/authenticatedcallablefirebase/us-central1/callableFunction, NSUnderlyingError=0x6000028c99e0 {Error Domain=kCFErrorDomainCFNetwork Code=-1200 "(null)" UserInfo={_kCFStreamPropertySSLClientCertificateState=0, _kCFNetworkCFStreamSSLErrorOriginalValu [<decode: missing data>]
flutter: Exception: Unable to call function callableFunction

kCFErrorDomainCFNetwork with code 1200 means "An attempt to establish a secure connection failed for reasons that can’t be expressed more specifically.", which is quite obvious because localhost is not in https.

So, if I understood correctly, the plugin is simply changing the origin string and does not actually changes its behavior to "be able to call unsecure" - here, it means localhost - connections, thus throwing these errors - making me wonder if this function is not actually implemented, just exposed there.
Also, for reference, you can see the lib implementation:
  /// Changes this instance to point to a Cloud Functions emulator running locally.
  ///
  /// @param origin The origin of the local emulator, such as "//<IP_ADDRESS>:5005".
  CloudFunctions useFunctionsEmulator({@required String origin}) {
    _origin = origin;
    return this;
  }

Quick note: I am not assuming anything here, I've just began in the flutter ecosystem and this is just my two cents on what's going on with my problem - given the fact that I've seen the issue here #35125

Emulator use http. iOS rejected any request to http allow only https.
So you need add into ios/runner/Info.plist
<key>NSAppTransportSecurity</key> 	<dict> 		<key>NSExceptionDomains</key> 		<dict> 			<key>localhost</key> 			<dict> 				<key>NSExceptionAllowsInsecureHTTPLoads</key> 				<true/> 			</dict> 		</dict> 	</dict>
and then run flutter run again

That was it - thanks @densa


Clean up options in command references

There's a lot of options that are documented for commands since #185 that are present in the output of forge --help/cast --help but do not actually do anything. This is due to some debt in Foundry, see https://github.com/gakonst/foundry/issues/1274

Most of the stray options were cleaned up, if not all, in https://github.com/gakonst/foundry/issues/1268


Update status badges

Update Status

 Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.You have signed the CLA already but the status is still pending? Let us recheck it.


Dropout argument for recurrent modules & BGRU

Hi,
The latest cuDNN version fixed the non-determinism problem with dropout and the recurrent layers. However, there is not an easy way to use dropout with the current recurrent layers APIs, since the RNN constructor initializes dropout to 0. Thus, one needs to change the dropout prob. after creating the module and reset it.
I thought it would be useful to be able to pass the dropout value to the constructor, and I made the appropriate changes to all the recurrent layers. By default, dropout is 0.
Additionally, I have also added a Bidirectional GRU layer, in the same spirit of the already present BLSTM.
Cheers,
Joan.

This looks awesome! Thanks Joan.


Current Branch Workflow Status Refresh

Is your feature request related to a problem? Please describe.
Using Github Actions extension on VS Code to trigger workflows, however they won't appear under "Current Branch" until I manually refresh the UI.
Describe the solution you'd like
Keen to understand if its possible to provide any option to automatically refresh and any new workflows to show up in the UI without needing to manually refresh.

This would be nice, but its not high priority. Closing, but can be reopened if someone makes a pr for it.

The would be a nice quality of life enhancement. It's a shame to have to refresh the section manually. A refresh at a given interval wouldn't even be necessary, given that the extension has access to the workflow files. It could poll from the push until the workflow is finished.

I’ve have developed such feature (check current branch status for a GitHub workflow continuously) by my own in a vscode extension.
Maybe it’s also helpful for you: https://marketplace.visualstudio.com/items?itemName=DanielChristianSchroeter.git-tag-release-tracker


[SPARK-31052][TEST][CORE] Fix flaky test of SPARK-30388

What changes were proposed in this pull request?

This PR fix the flaky test in #27050.
Why are the changes needed?

SparkListenerStageCompleted is posted by listenerBus asynchronously. So, we should make sure listener has consumed the event before asserting completed stages.
See error message:
sbt.ForkMain$ForkError: org.scalatest.exceptions.TestFailedException: List(0, 1, 1) did not equal List(0, 1, 1, 0)
	at org.scalatest.Assertions.newAssertionFailedException(Assertions.scala:530)
	at org.scalatest.Assertions.newAssertionFailedException$(Assertions.scala:529)
	at org.scalatest.FunSuite.newAssertionFailedException(FunSuite.scala:1560)
	at org.scalatest.Assertions$AssertionsHelper.macroAssert(Assertions.scala:503)
	at org.apache.spark.scheduler.DAGSchedulerSuite.$anonfun$new$88(DAGSchedulerSuite.scala:1976)

Does this PR introduce any user-facing change?

No.
How was this patch tested?

Update test and test locally by no failure after running hundreds of times. Note, the failure is easy to reproduce when loop running the test for hundreds of times(e.g 200)

cc @liangxs @jiangxb1987 @tgravescs

Test build #119389 has started for PR 27809 at commit 9a7e24c.

Merged build finished. Test PASSed.

Test PASSed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder-K8s/24127/
Test PASSed.

Test build #119389 has finished for PR 27809 at commit 9a7e24c.

This patch passes all tests.
This patch merges cleanly.
This patch adds no public classes.

Merged build finished. Test PASSed.

Test PASSed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/119389/
Test PASSed.

Thanks, merged to master/3.0 ！


sui-select don't work patchValue

Hi, I try implement autocomplete. I used sui-select control with LookupFn in reactive form. If I patching value to form I want run LookupFn and set value in this control. I have response  from server and return promise with this response but control don't change value. When i write manually text in select everything works.
Here is my code:
http://wklej.org/id/3252197/?hl=js
and HTML template
<ng-template let-option #memberSelectTemplate>             {{ option.name }} ({{ option.email }})           </ng-template>           <sui-select class="selection"                       formControlName="memberId"                       [optionsLookup]="membersLookup"                       labelField="name"                       valueField="id"                       [isDisabled]="!isEditable"                       [optionTemplate]="memberSelectTemplate"                       [isSearchable]="true"                       #searchSelect>             <sui-select-option *ngFor="let o of searchSelect.filteredOptions" [value]="o"></sui-select-option>           </sui-select>

Please could you add a reproduction in plunkr? You can use the template provided when creating a new issue 😄


Small memory improvement

Opening to see what CI thinks of it.
@jpechane et al, feedback welcome. This removes the column list in TableImpl. The win isn't huge, but it's better than nothing.

That's good to review now from my PoV. @jpechane?

Test failures are unrelated and tracked in Jira.

@gunnarmorling I am not fully convinced about this change. There is LinkedHashMap kept but this is much more memory requiring than the ordinary HashMap.
IMHO the optimization should be other way around, list should be kept but LinkedHashMap should become HashMap.
I tried very very rudinemntary pseudo-benchamrk and it seems to me that the other variant is really better from memory POV>

Interesting; yeah, if we keep the list, we definitely don't need the LHM. Do you have any numbers to share?

For one map, 50000 records
(linked-hashmap only) Memory used 1985 MB
(hashmap with list) Memory used 1963 MB

for 1000 maps, 500 records in each
(linked-hashmap only) Memory used 1961 MB
(hashmap with list) Memory used 1959 MB

Ok, closing this one. Thanks for reporting back, @jpechane.


Add vertex positions argument to cage topologies.

Requested Reviewers: @lukasturcani
This PR will add a vertex_positions argument to cage topology graphs. This allows the users to overwrite the scaling and positioning of any vertex (using a similar dict[int: position] format as the vertex_alignments arguments).
It will not work for OnePlusOne graph currently because of strict edge positioning.
Indeed. some choices in the code changes stem from me trying to avoid editing code outside of the cage namespace.
A few type hints were added too on any file I edited. Although, the tests will currently fail!
I have added tests for a few cage graphs, but fundamentally it is hard to test the success or failure of this except for consistency, which I believe is working.

This PR is ready for review, but there are some mypy errors that I will need assistance to fix.

This PR is now ready, awaiting a fix to the RTD issue.


[Android ListView/ScrollView] Content Padding

Since it lacks the iOS concepts of contentInset/contentOffset, I realized the correct way to do this is with on Android is adding padding in the ListView/ScrollView styles. But there are a couple issues with this.

The scroll bar/scroll indicator padding is not adjusted accordingly
The content size is not accounted for

Therefore, when I try to set paddingTop: 110 on my ListView, the content is correctly scrolled down by 110, but the scroll indicator still starts at 0, and additionally I am unable to scroll down and see the final 110 pixels of content in my list.

Have you looked at the margin attribute?

@AaaChiuuu margin is not the solution because that simply changes the bounds of the entire <ListView>. I want the ListView to take up the full screen, but I want the ListView's content to start 110 pixels from the top (there is a NavigationBar-esque header at the top). The content should be able to scroll all the way to the top. With margin, the content is cut off. The correct solution is padding, it just isn't working correctly at the moment.

I encountered the same problem..

This can be achieved by setting a padding in the contentContainerStyle prop.

@marcshilling using contentContainerStyle fixed the issue for you?

I want to use the interpolate function of Animated in my listview's paddingTop. But setting
contentContainerStyle={{paddingTop: this.height.interpolate({
                            inputRange: [0, 44],
                            outputRange: [44, 88]
                        })
                    }}

gives this error on iOS:

and while it works on android, it throws this warning for every inner view upto RCTView:

I think I encountered the same problem. I am adding margin: 30 to contentContainerStyle, but the list doesn't scroll to the bottom. I think this happens because the margin is not included in scroll height. I can add padding: 30 to contentContainerStyle instead of margin: 30, but then the black border in contentContainerStyle will not be near the white rows.
Is it possible to obtain a listview that looks like in my example with margin: 30, but scrolls to the bottom? Maybe to wrap all the rows in a View somehow?


BUG: Missing Kobold ancestry bonuses from ShadowDarklings import

I recently added support for the Kobold ancestry to https://wwwshadowdarklings.net, but forgot to let the Foundry team know about the new Bonuses that can be included in the exported JSON:
Brand-new bonus Luck Token ability:
{
      "sourceType": "Ancestry",
      "sourceName": "Kobold",
      "sourceCategory": "Ability",
      "gainedAtLevel": 1,
      "name": "Knack",
      "bonusName": "LuckTokenAtStartOfSession",
      "bonusTo": "LuckTokenAtStartOfSession",
      "bonusAmount": 1
}

Kobold-specific spellcasting bonus ability:
{
      "sourceType": "Ancestry",
      "sourceName": "Kobold",
      "sourceCategory": "Ability",
      "gainedAtLevel": 1,
      "name": "Knack",
      "bonusName": "Plus1ToCastingSpells",
      "bonusTo": "Spellcasting",
      "bonusAmount": 1
}

Please add support for these two bonuses when importing the JSON.

Great! Good work guys!


Corrected Error message for 403 response

Change message for HTTP error 403 from Unauthorized to Forbidden
The status code 403 seems to be correct when the inbound API key doesn't match with the one in settings. But the message should be Forbidden and not Unauthorized.

Looks good to me, thanks @sampathBlam!


Integrate coveralls service

It's very convenient to always know the current test coverage and monitor
its changes over the time. The integration has been done by direct call
in .travis.yaml. See https://coveralls.io/r/ikalnitsky/holocron for
details.

Changes Unknown when pulling 82fa61c8ded04df868235c4fa6b6896e07f2d9c9 on coveralls into ** on master**.


Basic string extraction support for Lua and Cpp

I added basic string extraction functionality for both lua and cpp as well as test for that functionality. I did the same for variable extraction inside function calls on Lua.
This should resolve #341.
Also, I have a question but I'm not sure about where I could asked it (?). I think I can implemment #275, but I don't know if it would be better to focus on fixing issues and maybe refactoring the codebase, what would be the best option?

I added the same functionality for golang and while doing it realize something. It seems to be a trend that some treesitter parsers have a node for strings that has as child nodes for the string delimiters, but not for the string content (golang and cpp) while other parsers have nodes for strings that have child nodes for the delimiters as well as the string content (lua).
My current implementation is just checking for both special cases (cpp and goland) ini a hardcoded way but I think it would be better to add a list of special cases to each Tressitter object so each language could specify its own exceptions and pass either the treesitter object of the list of exceptions utils.get_node_text as a parameter


internal/oai-pmh harvesting from LINDAT

done

Solved problems:

missing xalan https://github.com/DSpace/DSpace/issues/8347
DOCKER_OWNER=dataquest property was missing in the /build-scripts/run/envs/.default. DSpace docker-cli was loaded by defalut: https://github.com/dataquest-dev/dspace-angular/blob/dtq-dev/docker/cli.yml#L19


Editng water features fails

issue split from #59
If I attempt to edit a water route address Water Route Name is not populated, RCL_Id is populated. Water Name is populated.The feature layer does contain the water route name.
I get a pop-up error in the UI stating: Please Supply a Water Route Name.

Water Route Name is now consistently populated - This can be retested in 0.8.11

Closed pending testing

Original error remedied. New error recorded on https://github.com/linz/QGIS-AIMS-Plugin/issues/121


WingetUI installs user setup instead of upgrading system installation on upgrade

This bug is quite annoying.
Steps to Reproduce

Install an old version of VSCode in the machine scope: winget install Microsoft.VisualStudioCode --scope machine -v <old version>
Upgrade VSCode via WingetUI
WingetUI installs the user setup of VSCode, leaving with two installations of VSCode (user and machine wide)

Alternatively, upgrading via the commandline (winget upgrade Microsoft.VisualStudioCode) properly upgrades VSCode.

Mhmm... Which version of winget are you running on your local machine?

v1.3.2091

Same for me

I believe this was fixed by https://github.com/marticliment/WingetUI/pull/575

It should. I'll test it further but it should

Tested the latest commit, same thing:

User setup is installed.

@sitiom do you still get two separate vscode installs after using WingetUI to update?

@sitiom do you still get two separate vscode installs after using WingetUI to update?

Yes

@sitiom, which version of winget are you running on your system?

v1.3.2691

Could you please test it now, with the latest commit?

Now it works, thanks.


Cleanup SCT_RECURSIVE_QC variable

The variable SCT_RECURSIVE_QC appears in the code (e.g. sct_label_vertebrae), however it is not documented.
We should either document it (in wiki and SCT course) or get rid of it.

revisiting this issue, I don't find that variable anymore so we can close


Fix CI

Requirements (from template, click to expand):

Filling out the template is required. Any pull request that does not include enough information to be reviewed in a timely manner may be closed at the maintainers' discretion.
All new code requires tests to ensure against regressions

Description of the Change

Some necessary changes to the GitHub Actions workflow file to get CI passing again.

Use 'windows-2019' GitHub Actions base image for Windows

The 'windows-latest' image has Visual Studio 2022, which is too new for our old node-gyp 5.x. 'windows-2016' is no-longer available. 'windows-2019' is currently the only image that will successfully install the dependencies on Windows.

Test on NodeJS 14 and 16 (NodeJS 12 is at End of Life, and incompatible with latest npm that we test with.)
Fix Node 14 Windows jobs. (Upgrading directly from npm 6.x to npm 9.x is broken, upgrade to npm 8.x first.)

(See https://github.com/npm/cli/issues/5856 for confirmation that this is a real bug in npm 6.x, and that this is the recommended workaround, strange as it sounds.)

Alternate Designs

To simplify a bit, I noticed we could stop updating to latest npm in CI, just use what comes bundled with NodeJS. (This is known working over at the ppm fork, and I was able to test that it works on my personal fork of apm as well.) It would remove two steps and 7 lines from the CI.yml file. Might save about 30-100 seconds on the Windows jobs by not upgrading to npm [8 then] 9, but also npm 6/8 are probably a bit slower than npm 9, so, eh.
But I chose to make the most conservative, minimum changes I could to get to passing CI.
Benefits

CI passes again.
Possible Drawbacks

Not testing apm built with Visual Studio 2017 anymore. But the 'windows-2016' GitHub Actions image is no-longer available, and manually installing old Visual Studio is slow, a pain, and error-prone. So I'd rather not.
Verification Process

CI passes.
Applicable Issues

N/A

As a courtesy, I intend to leave this open for at least 24 hours to allow time for someone to review.


Adjacent Elements Product, Python , CP

💥 Proposal
( When given an array of integers, we have to find the pair of adjacent elements that have the largest product and return that product.
Example:
input Array = [3, 6, -2, -5, 7, 3]
Output= 21
for 7 and 3 at position 4 and 5 give largest product. )
Have you read the Contributing Guidelines on Pull Requests?
(YES)

I would like to solve this under GSSOC'21

I would like to implement the same in C language as a part of GSSOC '21

I would like to solve this under GSSOC'21,in c++

I would like to work on it in Java under GSSoC'21

@rohanbabbar04 @maanpatel2492 @tanvi355
Make seperate Issues

@HarshCasper I would like to work on this issue in Kotlin under GSSoC'21. Thanks

@kiruba-r11 Read the above message

I would like to implement the above question in Python, I will write neat and clean  commented code
please assign me this issue under GSSoC 2021

Hey @guruc-134 ! Its great to see your enthusiasm. Keep up with it. However, the issue has already been assigned to me (@chicken-biryani )
I am assuming you are new to open source, so here are a few tips to get you started :

Its always a good practice to read the discussion under an issue (i.e the comments in top to bottom order). By doing so you will understand whether the issue has been assigned or not.

Do not get discouraged, you can always create your own issue or browse through other issues.

Always read the ReadMe file.

All the reading may seem unnecessary, and boring but its a very important step.
And again, do not get discouraged. We all have started out somewhere. It may feel intimidating at first but once you get a hang of things, it will be fun.
All the best. Keep going.


WIP: Added await to setInteractiveState to force write to Firebase [#182039050]

This hopefully will force a write of the answer to Firebase as currently there is sometimes a delay of a few seconds.

Not needed.


Error in building react-js sample application

Describe the issue:
When building the react-js sample application, the below error is noticed in logs.
user:~/Documents/wso2/react-js-app » npm install && npm start

><EMAIL_ADDRESS>install /Users/user/Documents/wso2/react-js-app/node_modules/watchpack-chokidar2/node_modules/fsevents
> node install.js

node:internal/modules/cjs/loader:903
  throw err;
  ^

Error: Cannot find module 'nan'
Require stack:
- /Users/user/Documents/wso2/react-js-app/node_modules/watchpack-chokidar2/node_modules/fsevents/[eval]
    at Function.Module._resolveFilename (node:internal/modules/cjs/loader:900:15)
    at Function.Module._load (node:internal/modules/cjs/loader:745:27)
    at Module.require (node:internal/modules/cjs/loader:972:19)
    at require (node:internal/modules/cjs/helpers:88:18)
    at [eval]:1:1
    at Script.runInThisContext (node:vm:132:18)
    at Object.runInThisContext (node:vm:309:38)
    at node:internal/process/execution:77:19
    at [eval]-wrapper:6:22
    at evalScript (node:internal/process/execution:76:60) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '/Users/user/Documents/wso2/react-js-app/node_modules/watchpack-chokidar2/node_modules/fsevents/[eval]'
  ]
}
gyp: Call to 'node -e "require('nan')"' returned exit status 1 while in binding.gyp. while trying to load binding.gyp
gyp ERR! configure error
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onCpExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:351:16)
gyp ERR! stack     at ChildProcess.emit (node:events:327:20)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (node:internal/child_process:277:12)
gyp ERR! System Darwin 20.1.0
gyp ERR! command "/usr/local/Cellar/node/15.0.1/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/user/Documents/wso2/react-js-app/node_modules/watchpack-chokidar2/node_modules/fsevents
gyp ERR! node -v v15.0.1
gyp ERR! node-gyp -v v5.1.0
gyp ERR! not ok

><EMAIL_ADDRESS>install /Users/user/Documents/wso2/react-js-app/node_modules/webpack-dev-server/node_modules/fsevents
> node install.js

node:internal/modules/cjs/loader:903
  throw err;
  ^

Error: Cannot find module 'nan'
Require stack:
- /Users/user/Documents/wso2/react-js-app/node_modules/webpack-dev-server/node_modules/fsevents/[eval]
    at Function.Module._resolveFilename (node:internal/modules/cjs/loader:900:15)
    at Function.Module._load (node:internal/modules/cjs/loader:745:27)
    at Module.require (node:internal/modules/cjs/loader:972:19)
    at require (node:internal/modules/cjs/helpers:88:18)
    at [eval]:1:1
    at Script.runInThisContext (node:vm:132:18)
    at Object.runInThisContext (node:vm:309:38)
    at node:internal/process/execution:77:19
    at [eval]-wrapper:6:22
    at evalScript (node:internal/process/execution:76:60) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '/Users/user/Documents/wso2/react-js-app/node_modules/webpack-dev-server/node_modules/fsevents/[eval]'
  ]
}
gyp: Call to 'node -e "require('nan')"' returned exit status 1 while in binding.gyp. while trying to load binding.gyp
gyp ERR! configure error
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onCpExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:351:16)
gyp ERR! stack     at ChildProcess.emit (node:events:327:20)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (node:internal/child_process:277:12)
gyp ERR! System Darwin 20.1.0
gyp ERR! command "/usr/local/Cellar/node/15.0.1/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/user/Documents/wso2/react-js-app/node_modules/webpack-dev-server/node_modules/fsevents
gyp ERR! node -v v15.0.1
gyp ERR! node-gyp -v v5.1.0
gyp ERR! not ok

><EMAIL_ADDRESS>postinstall /Users/user/Documents/wso2/react-js-app/node_modules/core-js-pure
> node -e "try{require('./postinstall')}catch(e){}"

Thank you for using core-js ( https://github.com/zloirock/core-js ) for polyfilling JavaScript standard library!

The project needs your help! Please consider supporting of core-js on Open Collective or Patreon:
> https://opencollective.com/core-js
> https://www.patreon.com/zloirock

Also, the author of core-js ( https://github.com/zloirock ) is looking for a good job -)

added 864 packages from 528 contributors and audited 864 packages in 13.928s

49 packages are looking for funding
  run `npm fund` for details

found 2 low severity vulnerabilities
  run `npm audit fix` to fix them, or `npm audit` for details

><EMAIL_ADDRESS>start /Users/user/Documents/wso2/react-js-app
> webpack-dev-server --mode development --inline --hot --open

ℹ ｢wds｣: Generating SSL Certificate
ℹ ｢wds｣: Project is running at https://localhost:5000/
ℹ ｢wds｣: webpack output is served from /
ℹ ｢wds｣: Content not from webpack is served from /Users/user/Documents/wso2/react-js-app/dist
ℹ ｢wds｣: 404s will fallback to /index.html
ℹ ｢wdm｣: Hash: f5942e41ca06ad16ceab
Version: webpack 4.43.0
Time: 3584ms
Built at: 01/28/2021 10:14:24 PM
      Asset      Size  Chunks                   Chunk Names
 index.html   1.2 KiB          [emitted]
    main.js  1.72 MiB    main  [emitted]        main
main.js.map  1.96 MiB    main  [emitted] [dev]  main
Entrypoint main = main.js main.js.map
[1] multi (webpack)-dev-server/client?https://localhost:5000 (webpack)/hot/dev-server.js ./src/app.js 52 bytes {main} [built]
<EMAIL_ADDRESS>146 KiB {main} [built]
[./node_modules/react-dom/index.js] 1.33 KiB {main} [built]
[./node_modules/react-json-view/dist/main.js] 150 KiB {main} [built]
[./node_modules/react/index.js] 190 bytes {main} [built]
[./node_modules/strip-ansi/index.js] 161 bytes {main} [built]
[./node_modules/webpack-dev-server/client/index.js?https://localhost:5000] (webpack)-dev-server/client?https://localhost:5000 4.29 KiB {main} [built]
[./node_modules/webpack-dev-server/client/overlay.js] (webpack)-dev-server/client/overlay.js 3.51 KiB {main} [built]
[./node_modules/webpack-dev-server/client/socket.js] (webpack)-dev-server/client/socket.js 1.53 KiB {main} [built]
[./node_modules/webpack-dev-server/client/utils/createSocketUrl.js] (webpack)-dev-server/client/utils/createSocketUrl.js 2.91 KiB {main} [built]
[./node_modules/webpack-dev-server/client/utils/log.js] (webpack)-dev-server/client/utils/log.js 964 bytes {main} [built]
[./node_modules/webpack-dev-server/client/utils/reloadApp.js] (webpack)-dev-server/client/utils/reloadApp.js 1.59 KiB {main} [built]
[./node_modules/webpack-dev-server/client/utils/sendMessage.js] (webpack)-dev-server/client/utils/sendMessage.js 402 bytes {main} [built]
[./node_modules/webpack/hot/dev-server.js] (webpack)/hot/dev-server.js 1.59 KiB {main} [built]
[./src/app.js] 11.6 KiB {main} [built]
    + 47 hidden modules
Child HtmlWebpackCompiler:
     1 asset
    Entrypoint HtmlWebpackPlugin_0 = __child-HtmlWebpackPlugin_0
    [./node_modules/html-webpack-plugin/lib/loader.js!./src/index.html] 1.31 KiB {HtmlWebpackPlugin_0} [built]
ℹ ｢wdm｣: Compiled successfully.

Environment information:

OS: Mac
Node version: v15.0.1
NPM version: 6.14.8

Optional Fields
Related issues:

Suggested labels:

This is observed in the first time build only.

This issue is being closed due to extended inactivity. Please feel free to reopen it if further attention is needed. Thank you for helping us keep the issue list relevant and focused!


Lint errors: Typescript used in .js files

IDE linter complains because there is no .ts extension.
Also, there is no tslint config.  I'm new to react.  Am I missing something here?

@ginna-baker I think you need typescript-eslint to enable eslint with typescript.


Pre authorize annotations for subresources

References
Add references/links to any related tickets or PRs. These may include:

Link to initial REST implementation

Description
When including a subresource, e.g. via embedding, the permissions of the subresources will now be verified based on the @PreAuthorize setting of the findOne() method.
The default @PreAuthorize on the abstract findOne() method has been set to @PreAuthorize("hasAuthority('ADMIN')").
Instructions for Reviewers
The ConverterService will now use the @PreAuthorize to determine whether a resource can be embedded. It will automatically replace the #id in the annotation with the object's ID (but the syntax should be #id)
The ITs were already included in https://github.com/DSpace/DSpace/pull/2726, they still verify that the permissions are enforced on the subresources.
Some PermissionEvaluatorPlugins which were required for https://github.com/DSpace/DSpace/pull/2726 have been removed again because the permissions can now be retrieved from the findOne() method
Since there was a conflict on the permissions of the AuthorizationFeatureRest (sometimes anonymous and sometimes admin), this has been adjusted here as well
Checklist
This checklist provides a reminder of what we are going to look for when reviewing your PR. You need not complete this checklist prior to creating your PR (draft PRs are always welcome). If you are unsure about an item in the checklist, don't hesitate to ask. We're here to help!

[x] My PR is small in size (e.g. less than 1,000 lines of code, not including comments & integration tests). Exceptions may be made if previously agreed upon.
[x] My PR passes Checkstyle validation based on the Code Style Guide.
[x] My PR includes Javadoc for all new (or modified) public methods and classes. It also includes Javadoc for large or complex private methods.
[x] My PR passes all tests and includes new/updated Unit or Integration Tests based on the Code Testing Guide.
[x] If my PR includes new, third-party dependencies (in any pom.xml), I've made sure their licenses align with the DSpace BSD License based on the Licensing of Contributions documentation.
[x] If my PR modifies the REST API, I've linked to the REST Contract page (or open PR) related to this change.

@benbosman and @Raf-atmire Thank you for work on this PR. It looks good to me.


Bruno Runtime Refactor

A lot of code is currently shared across bruno-cli and bruno-electron
This issue is for consolidating this logic inside a bruno-runtime package

We will do this after our v1 launch.
The current approach has been in development for a long time.
At our current stage stability is more important than the slowness in dev introduced code duplication.
Once we finish v1, then we will have enough time on our hands to first setup a strong test suite and then proceed with the refactoring.
This test suite should give us the confidence to refactor with peace of mind.
cc @mirkogolze

Do you plan on starting this soon ? I could take a look because i want to added feature to the cli but the code is in bruno-app but could be shared.
For exemple i want to add export via the cli without copy pasting the same code

Hi @berlingoqc, Given our current PR and issue backlog, it looks like we won’t be able to tackle this within the next three months at least.

@helloanoop I have time, i want to upgrade the cli tooling and i wish we could refactor it before.
if you want to shared me what your vision on it. I can tackle it


Fulfil and reject instance methods

I was wandering why there are no fulfil or reject instance methods?
It would simplify this:
http://promisekit.org/wrapping-delegation/
It would also be easier to use with NSOperation.
PMKPromise *promise = [PMKPromise new];
You could return promise instance and do some work. When you're done you could just do
[promise fulfil:value];
or
[promise reject:error];

If you can fulfill or reject any promise, then any part of your application could fulfill ore reject any promise, which would break encapsulation.
The usual pattern instead is a deferred which would look something like this:
PMKDeferred *deferred = [PMKPromise deferred];
//…
deferred.fulfill(obj);
return [deferred promise];

I provided a Deferred with Swift PromiseKit but not with the objective C version.

Discussion about this welcome though!


Publishers Occasionally Hang

Hello,
We've encountered anther issue in which we are unable to get any data out of the ifm publishers. This has come up a few times in the field and I created some test code to reproduce it. I just repeatedly initializes the ifm3d-ros node and waits to receive a distance message. Eventually, it'll hang waiting for the message. The test output looks something like this:
...
[ifm_left/ifm_left-41] process has died [pid 890, exit code -9, cmd /opt/shining_software/catkin_ws/devel/lib/ifm3d/ifm3d_node distance:=/ifm_left/depth_with_confidence __name:=ifm_left __log:=/home/brain/.ros/log/744bdbb0-cf05-11e7-9a7f-0010340b6800/ifm_left-ifm_left-41.log].
log file: /home/brain/.ros/log/744bdbb0-cf05-11e7-9a7f-0010340b6800/ifm_left-ifm_left-41*.log
process[ifm_left/ifm_left-42]: started with pid [937]
[ INFO] [1511305225.314623226]: Running dtors...
[ INFO] [1511305225.314707989]: Initializing camera...
[ INFO] [1511305226.327200369]: Initializing framegrabber...
[ INFO] [1511305227.381932637]: Initializing image buffer...
[ INFO] [1511305227.550609292]: Got unit vectors, restarting framegrabber with mask: 15
[ INFO] [1511305227.550649134]: Running dtors...
[ INFO] [1511305227.551026321]: Initializing camera...
[ INFO] [1511305228.563687840]: Initializing framegrabber...
[ INFO] [1511305229.253269551]: Initializing image buffer...
Received depth message. Shape:  0 0
[ifm_left/ifm_left-42] process has died [pid 937, exit code -9, cmd /opt/shining_software/catkin_ws/devel/lib/ifm3d/ifm3d_node distance:=/ifm_left/depth_with_confidence __name:=ifm_left __log:=/home/brain/.ros/log/744bdbb0-cf05-11e7-9a7f-0010340b6800/ifm_left-ifm_left-42.log].
log file: /home/brain/.ros/log/744bdbb0-cf05-11e7-9a7f-0010340b6800/ifm_left-ifm_left-42*.log
process[ifm_left/ifm_left-43]: started with pid [984]
[ INFO] [1511305231.366369760]: Running dtors...
[ INFO] [1511305231.366427715]: Initializing camera...
[ INFO] [1511305232.379364764]: Initializing framegrabber...
[ INFO] [1511305233.429639553]: Initializing image buffer...
[ INFO] [1511305233.586629652]: Got unit vectors, restarting framegrabber with mask: 15
[ INFO] [1511305233.586670046]: Running dtors...
[ INFO] [1511305233.587010254]: Initializing camera...
[ INFO] [1511305234.599095939]: Initializing framegrabber...
[ INFO] [1511305235.301061760]: Initializing image buffer...
Received depth message. Shape:  0 0
[ifm_left/ifm_left-43] process has died [pid 984, exit code -9, cmd /opt/shining_software/catkin_ws/devel/lib/ifm3d/ifm3d_node distance:=/ifm_left/depth_with_confidence __name:=ifm_left __log:=/home/brain/.ros/log/744bdbb0-cf05-11e7-9a7f-0010340b6800/ifm_left-ifm_left-43.log].
log file: /home/brain/.ros/log/744bdbb0-cf05-11e7-9a7f-0010340b6800/ifm_left-ifm_left-43*.log
process[ifm_left/ifm_left-44]: started with pid [1041]
[ INFO] [1511305237.421985366]: Running dtors...
[ INFO] [1511305237.422060482]: Initializing camera...
[ INFO] [1511305238.435424341]: Initializing framegrabber...
[ INFO] [1511305239.444415053]: Initializing image buffer...
Traceback (most recent call last):
  File "ifm_parameter_tests.py", line 120, in <module>
    receive_depth_image_test(base_topic)
  File "ifm_parameter_tests.py", line 115, in receive_depth_image_test
    msg = next(depth_msgs)
  File "ifm_parameter_tests.py", line 61, in gen_msgs
    yield receive_one(topic, msg_class, 10.0)
  File "ifm_parameter_tests.py", line 54, in receive_one
    assert await_pred(container.deref, timeout=timeout), "Never received msg from %s after %s seconds" % (topic, timeout)
AssertionError: Never received msg from ifm_left/depth_with_confidence after 10.0 seconds
[ifm_left/ifm_left-44] killing on exit
[rospy.internal][WARNING][2017-11-21 23:00:47,406] Unknown error initiating TCP/IP socket to localhost.localdomain:58023 (http://localhost.localdomain:46241/): Traceback (most recent call last):
  File "/opt/ros/indigo/lib/python2.7/dist-packages/rospy/impl/tcpros_base.py", line 557, in connect
    self.read_header()
  File "/opt/ros/indigo/lib/python2.7/dist-packages/rospy/impl/tcpros_base.py", line 619, in read_header
    self._validate_header(read_ros_handshake_header(sock, self.read_buff, self.protocol.buff_size))
  File "/opt/ros/indigo/lib/python2.7/dist-packages/rosgraph/network.py", line 363, in read_ros_handshake_header
    d = sock.recv(buff_size)
error: [Errno 104] Connection reset by peer

[ifm_left/ifm_left-44] escalating to SIGTERM

It's pretty infrequent, but it does consistently hang eventually on my machine. The process seems to hang after "Initializing image buffer...". Here's the test code:
#!/usr/bin/env python
import roslaunch
import rospy
import os
import signal
import time
from sensor_msgs.msg import Image
from multiprocessing import Lock

hostname = "<IP_ADDRESS>"
port = 80
base_topic = "ifm_left"

class Atom(object):
    # Don't trust assignment thread safety.
    def __init__(self, v):
        self._lock = Lock()
        self._value = v

    def reset(self, v):
        with self._lock:
            self._value = v

    def deref(self):
        with self._lock:
            return self._value

def kill_nodes(launcher, nodes):
    for node in nodes:
        os.kill(node.pid, signal.SIGKILL)
    time.sleep(2.0)

def await_pred(pred, timeout):
    start_time = time.time()
    while True:
        if pred():
            return True
        dt = time.time() - start_time
        if dt > timeout:
            return False

def receive_one(topic, msg_class, timeout):
    """
    Creates a subscriber, waits to receive a message from the given topic/msg_class,
    then unregisters the subscriber. Returns the received message.
    """
    container = Atom(None)
    sub = rospy.Subscriber(topic, Image, container.reset)
    assert await_pred(container.deref, timeout=timeout), "Never received msg from %s after %s seconds" % (topic, timeout)
    sub.unregister()
    return container.deref()

def gen_msgs(topic, msg_class):
    while True:
        yield receive_one(topic, msg_class, 10.0)

def launch_ifm(launcher, base_topic):

    rospy.set_param(os.path.join(base_topic, base_topic),
                    {"frame_id_base": base_topic,
                     "ip": hostname,
                     "password": "",
                     "publish_viz_images": False,
                     "schema_mask": 15,
                     "timeout_millis": 500,
                     "timoute_tolerance_secs": 5.0,
                     "xmlrpc_port": port,
                     "assume_sw_triggered": False})

    node = roslaunch.core.Node(
        package="ifm3d",
        node_type="ifm3d_node",
        name=base_topic,
        namespace=base_topic,
        output="screen",
        respawn=False,
        required=False,
        remap_args=[['distance', "/%s/depth_with_confidence" % base_topic]]
    )

    return launcher.launch(node)

def receive_depth_image_test(base_topic):
    """
    1. Create a ros launcher instance.
    2. Repeatedly:
         - Launch ifm node.
         - Create subscriber, receive one depth message, then unsubscribe.
         - kill ros node.

    This test will eventually fail with a timeout error waiting for the
    depth message on my machine.
    """
    launcher = roslaunch.scriptapi.ROSLaunch()
    launcher.start()
    # Launch the ros node.
    node = launch_ifm(launcher, base_topic)
    topic = os.path.join(base_topic, "depth_with_confidence")
    depth_msgs = gen_msgs(topic, Image)
    msg = next(depth_msgs)
    while True:
        # Note: the first couple depth messages received after registering a
        # subscriber are empty. This is another, probably separate, issue.
        print "Received depth message. Shape: ", msg.height, msg.width
        kill_nodes(launcher, [node])
        node = launch_ifm(launcher, base_topic)
        msg = next(depth_msgs)

if __name__ == "__main__":
    rospy.init_node("UnitVectorsTest")
    receive_depth_image_test(base_topic)

This issue hasn't come up when testing the ifm3d module from cpp, so my guess is it's at the ros node level, but idk. Finally, you may also notice the first couple depth messages received after registering a subscriber are empty, but I believe that is a separate issue.
Thanks,
John

@cartesian-theatrics Due to the fact I am a ROS noob, could you please be so kind and give me some instructions how I have to run your example from above. So I can check if it's an issue with the camera or with the upper layer.
Thanks,
Christian

Hi Graugans,
No problem. Do you have ROS installed and a ROS workspace created with the ifm3d-ros module in it, i.e. are you able to launch the ifm3d-ros module? If not, you'll want to install ROS (we're running ros indigo) and go through this tutorial to create a catkin workspace:
http://wiki.ros.org/action/fullsearch/catkin/Tutorials/create_a_workspace?action=fullsearch&context=180&value=linkto%3A"catkin%2FTutorials%2Fcreate_a_workspace"
Assuming you do have ROS installed and are able to launch ifm3d-ros in some capacity, you should be able to runn the script above by:

In a separate terminal, start roscore: ./roscore
Set the 'hostname' and 'port' variables at the top of the script to match what you have configured or the ifm3d camera module.
run the script: python hanging_publishers_test.py.

ifm3d-logs.zip
I spent the afternoon looking at this and I believe I know what is causing the issue(s).
The short version is, sometimes, the O3X seems to be returning an image chunk header (the leading 48 bytes) filled with zeros rather than the actual meta-information that we expect when fetching the Unit Vectors over XML-RPC. Because this header data was coming back as all zeros, the image chunk parser in the ifm3d framegrabber entered an infinite loop while trying to advance to the next image chunk and parse the rest of the data. I've pushed a new/debugging branch to ifm3d here which now traps this error - i.e., it will no longer run in an infinite loop; however, when the unit vector image chunk header is all zeros, it will not know how to advance to the next image chunk and ultimately cause a framegrabber timeout. Looking at the diff for the new branch should make it obvious as to where I am trapping this issue.
I've attached two log files with the IFM3D verbosity turned way up that illustrates this problem. In both the "OK" and "FAIL" logs, I have serialized the byte buffer representing the Unit Vectors. You will note on the "FAIL" log, the first 48 bytes (the v2 chunk header) is all zeros. In both logs the serialization of the unit vector buffer follows the message that says: "Unit vectors:" to make your searching easier. I will note that it appears (I did not validate the entire buffer) that except for the header info, the payload of the unit vectors seems to be consistent across the "OK" and "FAIL" logs.
@graugans Can you investigate on the camera side what would cause the Unit Vector image chunk header to come back as all zeros. The test script that @cartesian-theatrics sent triggers this error within a couple of minutes (at most).
@cartesian-theatrics Your test script was helpful to repeatably trigger this error and quickly find where the issue was. Thanks for that. Also, you noted in your message above:

Finally, you may also notice the first couple depth messages received after registering a subscriber are empty, but I believe that is a separate issue.

I think you are correct. It is a separate issue. I believe I have that one resolved in the ROS node on this branch Again, thanks for pointing this out.
Once we get this all sorted out: ifm3d, ifm3d-ros, camera firmware we will come up with the proper fix and merge all the changes in. However for now, you can feel free to clone my dev branch for this issue.

@tpanzarella , glad you were able to get closer to the bottom of this. Thanks for working this. I know you said the unit vectors payload appears to be consistent, but have you had a chance to try reproducing the "Inconsistent Unit Vectors" test code? Still seems plausible that they are related.

I have not looked at the other issue. My comments regarding consistency were limited to the "OK" and "FAIL" logs I attached to my previous note. I was merely pointing out that the data payloads look correct while the headers are different. My intention was to point the firmware team in a direction they could look on the camera-side code (which I do not have access to) for the next level of insights on resolving this.
I agree, it is plausible the two issues are related.

@tpanzarella thanks for investigating this issue. Could you and @cartesian-theatrics tell me which software version are you using on the camera?

$ ifm3d dump | jq .ifm3d._
{
  "Date": "Tue Dec  5 08:27:38 2017",
  "HWInfo": {
    "MACAddress": "00:02:01:40:54:09",
    "Mainboard": "#!03_M100_B01_12345678_008025483",
    "MiraSerial": "Not implemented"
  },
  "SWVersion": {
    "Algorithm_Version": "0.1.5",
    "Calibration_Device": "ff:ff:ff:ff:ff:ff",
    "Calibration_Version": "99.99.99",
    "ELDK": "GOLDENEYE_YOCTO_HARDFP-303-06d9c894636352a6c93711c7284d02b0c794a527",
    "IFM_Software": "0.1.20",
    "Linux": "Linux version 3.14.34-rt31-yocto-standard-00016-g5121435-dirty (jenkins@dettlx152) (gcc version 4.9.2 (GCC) ) #1 SMP PREEMPT RT Tue Mar 14 08:40:14 CET 2017",
    "Main_Application": "0.4.1122"
  },
  "ifm3d_version": 303
}

@graugans FWIW, I do not think ROS is needed to test this. You could probably write a shell script that calls an ifm3d-only piece of test code that will result in the same issue. Basically, create a framegrabber whose schema only grabs the unit vectors, grab the unit vectors, change the schema (to something else), grab an image/point cloud, restart the process. Keep doing this in a loop and eventually the behavior I saw was that I'd get the Unit Vector image chunk header come back as all zeros. The minimal test case is probably even simpler than what I describe above.

@graugans , I produced the issue on both 0.2.0 and 0.3.2 of ifm3d, and 0.2.0/0.4.0 of ifm3d-ros.

@cartesian-theatrics I am more interested in the camera fw version

@graugans , Here's the output of ifm3d dump:
ifm3d_dump.txt
Will that work?

@cartesian-theatrics that's perfect. Thanks

@tpanzarella your o3x is outdated and not supported anymore. You should have received a newer one a couple of month ago. Otherwise @garrettplace may can help

@graugans, this issue has come up on all of the ifm units have received so far, including pre-production units with the old firmware and the newer dual-core units with new firmware. We currently use the default fw included with the device.

Any update on the status of this?

We are working on this. Due to the fact I am not in the office I am not aware of the current status.

Hi, I will try to work this issue out. @tpanzarella could you please shortly describe how I can activate the verbosity in ifm3d? It would be helpful for investigation of the problem on firmware side. I tried to add the env variable IFM3D_VLOG (I've seen it it the code) to my system but it did not help. Should it be set to any particular value? BTW. Is there any default location for generated logs in ifm3d?
As for reproducing of the defect my idea based on your description is to:

call the framegrabber with IMG_UVEC
grab unit vectors
call the framegrabber with default schema
grab the XYZImage

repeat in a simple 10 minutes loop as a test case inside the ifm3d-image-tests.
Do you think I will be able to reproduce the bug is this way?
Thanks,
Marcin

I tried to add the env variable IFM3D_VLOG (I've seen it it the code) to my system but it did not help. Should it be set to any particular value?

You need to set the verbosity sufficiently high. For example:
$ IFM3D_VLOG=30 ./your_exe

Would do the trick.

Is there any default location for generated logs in ifm3d?

Yes. The logs are in /tmp by default.
In terms of your method to reproduce, it looks fine. However, just be sure that you actually kill the process and restart it. So, the best approach would be to write a simple C++ application that does what you say above. Then, write a shell script that wraps it in a loop to call it until you tickle the bug.
Also note, if you want the debugging info I uncovered in this comment you will need to use this branch as it contains the code that will serialize the unit vector byte buffer whereby you can see that the chunk header contains all zeros rather than the expected meta-info.

Hi,
@tpanzarella thanks for your tips. The logger works fine. However I cannot reproduce this defect on my O3X. The header chunk is always filled up with proper bytes in my case in final log file (after 12 minutes of starting and killing the application). I attach my application and shell script so maybe you can have a look if I follow your suggestions. I will appreciate any advice.
Marcin
reproduce_iss12.cpp:
int main(int argc, const char **argv)
{
  std::chrono::time_point<std::chrono::system_clock> end;
  end = std::chrono::system_clock::now() + std::chrono::minutes(5);

  while(std::chrono::system_clock::now() < end)
    {
      auto cam = ifm3d::Camera::MakeShared();
      auto fg = std::make_shared<ifm3d::FrameGrabber>(cam, ifm3d::IMG_UVEC);
      auto im = std::make_shared<ifm3d::ImageBuffer>();

    if (! fg->WaitForFrame(im.get(), 1000))
      {
        std::cerr << "Timeout waiting for camera!" << std::endl;
       // return -1;
      }

      cv::Mat uvec = im->UnitVectors();
      fg = std::make_shared<ifm3d::FrameGrabber>(cam);

    if (! fg->WaitForFrame(im.get(), 1000))
      {
        std::cerr << "Timeout waiting for camera!" << std::endl;
       // return -1;
      }
    auto distImg = im->XYZImage();
    }

    return 0;
}

run_reproduce_iss12.sh:
#!/bin/bash

#remove previously generated logs
if ls /tmp/ifm3d.* 1> /dev/null #silence
then
  rm /tmp/ifm3d.*
else
  echo "No 'ifm3d*' files to remove"
fi

file="/tmp/append_all.log"
if [ -f "$file" ]
then
  rm /tmp/append_all.log
else
  echo "No append_all.log to remove"
fi

#time handling
testTimeS=720 #12m
end=$((SECONDS+$testTimeS))

while [ $SECONDS -lt $end ]
do
  IFM3D_VLOG=30 ./reproduce_iss12&
  sleep 2s #allow fg to capture some frames
  killall -9 reproduce_iss12
done

#kill just in case
killall -9 reproduce_iss12

#append logs into one file
find /tmp -name '*.INFO.*' -exec cat {} + >> /tmp/append_all.log

@markinkajor, I'll also take a look at this tomorrow to see if it reproduces the issue for me. In the meantime, can someone point me to the latest/most stable camera firmware version?

Hi John,
A link to the current LTS O3X FW can be found below:
https://vault.ifmefector.com:443/home/link/browser?ll=AAAAAAAAAFYAAAy0DiXECk_yXJ8RIb8pWcpWgwdMaJk%3D
Best Regards,
Garrett
3D Imaging
484-343-5676
From: John Collins<EMAIL_ADDRESS>Sent: Tuesday, December 12, 2017 5:22 AM
To: lovepark/ifm3d<EMAIL_ADDRESS>Cc: Place, Garrett<EMAIL_ADDRESS>Mention<EMAIL_ADDRESS>Subject: Re: [lovepark/ifm3d] Publishers Occasionally Hang (#12)
@markinkajor, I'll also take a look at this tomorrow to see if it reproduces the issue for me. In the meantime, can someone point me to the latest/most stable camera firmware version?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHubhttps://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_lovepark_ifm3d_issues_12-23issuecomment-2D351008695&d=DwMCaQ&c=riR7jviByh3sGm7GIiSlHkFN0_aSATB6A8x0nHa2EM0&r=uogJrtG10ZTiJwHoOOtNhl4FZ2E8eyhXgMVsv7nWvPY&m=Z5IGTVm7mKf6S_CWGsA5YqXizeweWfsiG2lGmfx9KWE&s=dJdeXaZE9wiG0NAG9lNix4Tf5hpRKoN_5KDDYq_hh0s&e=, or mute the threadhttps://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_notifications_unsubscribe-2Dauth_ALg7t1wiOOfDzJDYW82eanz-5FJjZOPuU6ks5s-5FlPJgaJpZM4QmogC&d=DwMCaQ&c=riR7jviByh3sGm7GIiSlHkFN0_aSATB6A8x0nHa2EM0&r=uogJrtG10ZTiJwHoOOtNhl4FZ2E8eyhXgMVsv7nWvPY&m=Z5IGTVm7mKf6S_CWGsA5YqXizeweWfsiG2lGmfx9KWE&s=pX8R4PQlzN-Bjo-4_tp1F2GfpCk4p7AS945Ujk8ZHEU&e=.

The link above is for O3X_Firmware_1.0.62.swu, which is exactly what is running on the latest (production) O3X units.

Some follow up regarding this analysis. I am continuing to use @cartesian-theatrics ROS launcher test script to drive this work as it seems to tickle the bug quickest. I am also using my outdated firmware and hardware per @graugans comment, however, for now, the behavior is consistent between what @cartesian-theatrics sees and what I see with my unsupported setup. I will move to a supported setup as soon as feasible. For now I wanted to test a theory...
I wanted to validate that the camera is in fact sending back the data I am logging (i.e., there is not a bug in a library we are using or some other data transformation deep in the stack). From my most recent test I can say with high confidence that the data I am seeing is coming back from the camera. Specifcially, I am talking about acquiring the unit vector data over XML-RPC and getting the 48-byte image chunk header sent back as all zeros. To test this, as I said above, I am using @cartesian-theatrics ROS script. I have turned logging up to "30" using the IFM3D_VLOG environment variable. Additionally, I captured output from tcpdump to validate the data using external instrumentation. Here are my findings from an exemplary test run...
In the ifm3d log, I am logging the raw byte buffer coming back from the camera which represents the Unit Vector packet (obtained over XML-RPC). Here is a snippet from my log file showing these data. Recall, these are the raw bytes and for our purposes here I am only pasting in the first 63 bytes of the payload data. As can be seen below, the first 48 bytes, the chunk header is all zeros followed by what appears to be meaningful pixel data (i.e., the actual unit vectors).
I1212 12:10:14.406785 31899 frame_grabber_impl.hpp:332] Caching unit vectors from xmlrpc...
I1212 12:10:14.693455 31899 frame_grabber_impl.hpp:351] Unit vectors:
[00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,4e,be,f5,be,a3,70,bc,be,2a,de,4b,3f,b7,0a,f4

Correlating this back to the tcpdump wire capture I grabbed, here are some data showing the unit vector request and the beginnings of the response:
(NOTE: for reference, in this set up, my computer is <IP_ADDRESS> and the camera is <IP_ADDRESS>)
12:10:14.406881 IP (tos 0x0, ttl 64, id 4877, offset 0, flags [DF], proto TCP (6), length 349)
    <IP_ADDRESS>.58712 > <IP_ADDRESS>.80: Flags [P.], cksum 0x8341 (incorrect -> 0x9d70), seq 3595:3892, ack 2364, win 304, options [nop,nop,TS val 1795938 ecr 713320], length 297: HTTP, length: 297
	POST /api/rpc/v1/com.ifm.efector/ HTTP/1.1
	Host: <IP_ADDRESS>
	Accept: */*
	Content-Type: text/xml
	User-Agent: Xmlrpc-c/1.33.14 Curl/7.47.0
	Content-Length: 131

	<?xml version="1.0" encoding="UTF-8"?>
	<methodCall>
	<methodName>getUnitVectors</methodName>
	<params>
	</params>
	</methodCall>
E..]<EMAIL_ADDRESS>..gb.
.hPOST /api/rpc/v1/com.ifm.efector/ HTTP/1.1
Host: <IP_ADDRESS>
Accept: */*
Content-Type: text/xml
User-Agent: Xmlrpc-c/1.33.14 Curl/7.47.0
Content-Length: 131

<?xml version="1.0" encoding="UTF-8"?>
<methodCall>
<methodName>getUnitVectors</methodName>
<params>
</params>
</methodCall>

12:10:14.407173 IP (tos 0x0, ttl 64, id 12807, offset 0, flags [DF], proto TCP (6), length 52)
    <IP_ADDRESS>.80 > <IP_ADDRESS>.58712: Flags [.], cksum 0x9fe3 (correct), ack 3892, win 620, options [nop,nop,TS val 713320 ecr 1795938], length 0
E..42<EMAIL_ADDRESS>.
.h..gb
12:10:14.568172 IP (tos 0x0, ttl 64, id 12808, offset 0, flags [DF], proto TCP (6), length 1500)
    <IP_ADDRESS>.80 > <IP_ADDRESS>.58712: Flags [.], cksum 0x177b (correct), seq 2364:3812, ack 3892, win 620, options [nop,nop,TS val 713336 ecr 1795938], length 1448: HTTP, length: 1448
	HTTP/1.1 200 OK
	Status: 200 OK
	Content-Length: 616648
	Content-Type: text/xml
	Date: Wed, 24 May 2017 10:18:17 GMT
	Server: lighttpd/1.4.35

	<?xml version="1.0" encoding="UTF-8"?><methodResponse><params><param><value><base64>AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAATr71vqNwvL4q3ks/twr0vivUvL7XSUw/bVTyvmc3vb4ztUw/dJvwvlqavb5AIE0/xd/uvv38vb72ik0/YSHtvk5fvr5V9U0/SmDrvkvBvr5YX04/f5zpvvQiv77+yE4/+9Xnvj+Ev75BMk8/xgzmvjHlv74im08/2kDkvsJFwL6dA1A/N3LivvKlwL6sa1A/36DgvrsFwb5N01A/0czevh5lwb5+OlE/EPbcvhbEwb49oVE/mhzbvqAiwr6EB1I/bkDZvriAwr5RbVI/kGHXvlzewr6g0lI//n/Vvos7w75vN1M/vJvTvkGYw768m1M/yLTRvnj0w76A/1M/JcvPvjBQxL67YlQ/1d7NvmWrxL5oxVQ/2O/LvhYGxb6FJ1U/L/7Jvjxgxb4MiVU/3gnIvti5xb7+6VU/4BLGvuASxr5QSlY/QBnEvllrxr4IqlY//BzCvjzDxr4dCVc/FR7AvoUax76MZ1c/kBy+vjRxx75TxVc/bRi8vkPHx75tIlg/rxG6vq8cyL7Xflg/XAi4vndxyL6R2lg/dPy1vpbFyL6TNVk/+u2zvgkZyb7bj1k/8tyxvs1ryb5m6Vk/XMmvvty9yb4sQlo/RLOtvjwPyr41mlo/pJqrvt1fyr5x8Vo/hX+pvsOvyr7iR1s/7GGnvu3+yr6HnVs/2EGlvlJNy75X8ls/Uh+jvvKay75SRlw/XPqgvsrny750mVw/+9KevtYzzL6761w/NKmcvhJ/zL4fPV0/DH2avnvJzL6gjV0/iE6YvhATzb473V0/rR2Wvstbzb7rK14/gOqTvqyjzb6ueV4/B7WRvq7qzb5/xl4/SH2Pvs0wzr5dEl8/SEONvgd2zr5CXV8/DQeLvlm6zr4sp18/nsiIvsD9zr4X8F8/AIiGvjdAz74AOGA/OkWEvr2Bz77jfmA/VACCvlHCz77AxGA/pHJ/vuwB0L6PCWE/euB6voxA0L5RTWE/NUp2vjB+0L4BkGE/569xvtO60L6b0WE/nRFtvnT20L4dEmI/ZW9ovg4x0b6EUWI/T8ljvp9q0b7Lj2I/bB9fviaj0b7zzGI/ynFavp3a0b71CGM/ecBVvgQR0r7RQ2M/jQtRvllG0r6CfWM/ElNMvpZ60r4GtmM/HZdHvrut0r5b7WM/vdd[!http]
E...2<EMAIL_ADDRESS>.

OK, so now, we know that the "binary data" (the packet encoding the unit vectors) come back base64 encoded over the wire. So, to correlate this payload response back to the 63 bytes (chunk header + beginning of unit vector payload) that were logged to the ifm3d log and shown above we need to grab the first 84 base64 encoded characters and decode those back to raw bytes -- NOTE:  the chunk header (the leading 48 bytes) will be encoded by the first 64 base64 encoded characters coming back from the camera.  Here we decode the relevant base64 characters:
$ echo AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAATr71vqNwvL4q3ks/twr0 | base64 -d | hexdump -v -e '/1 "%02x "'
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 4e be f5 be a3 70 bc be 2a de 4b 3f b7 0a f4

which looks just like what we logged above in ifm3d (pasted in again for convenience):
I1212 12:10:14.406785 31899 frame_grabber_impl.hpp:332] Caching unit vectors from xmlrpc...
I1212 12:10:14.693455 31899 frame_grabber_impl.hpp:351] Unit vectors:
[00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,4e,be,f5,be,a3,70,bc,be,2a,de,4b,3f,b7,0a,f4

What does this all mean? I think it means that @cartesian-theatrics provides a nice script that drives the ifm3d-ros code to call into the camera in such a way whereby the camera will ultimately return an "all zeros" chunk header for the Unit Vectors when retrieved over XML-RPC. So, it also makes me think that we need to do some additional debugging on the camera/firmware side to get better insights as to why this is the case. I do not have access to the firmware and cannot really help in that department. If I can find the time, I will try to get a supported h/w and s/w stack up to see if this can all be duplicated with the latest stuff.
My full logs are attached for deeper analysis by interested/invested parties.
1.zip

Apparently we have a mixture of firmwares. We will make sure to update all units to 1.0.62 and re-evaluate the problem. Thanks

Okay, the new fw version seems to fix this issue for me as well. Thanks @tpanzarella  and @marcinkajor for your work on this.
However, the "Inconsistent Unit Vectors" issue is still present (see https://github.com/lovepark/ifm3d/issues/10).


Pin the mongodb version to 3.2 in run-tests-docker.sh

Integration tests were failing due to aggregation framework changes in mongo 3.6 (which is what docker pulled down by default on my system)
Review Checklist

Tests were added to cover all code changes
Documentation was added / updated
Code and tests follow standards in CONTRIBUTING.md

Codecov Report

Merging #1036 into master will increase coverage by 59.32%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##           master   #1036       +/-   ##
==========================================
+ Coverage   31.38%   90.7%   +59.32%
==========================================
  Files          50      50
  Lines        6813    6813
==========================================
+ Hits         2138    6180     +4042
+ Misses       4675     633     -4042