Non-contiguous multi-selection doesn't work with cmd + click on Mac

Describe the bug
On a Mac, attempting to select multiple nodes while holding down cmd + clicking does not work. It seems that the Windows ctrl key may be mapped to the mac control key rather than the expected cmd key.
Holding down control + click on a Mac performs a right-click on the system level which would overpower the tree's hotkey if it is indeed using control + click.
The only way I can select a non-contiguous set of nodes on Mac is via the keyboard when I do control + space.
To Reproduce
Attempt to cmd + click to perform a non-contiguous multi-select while using a Mac.
Expected behavior
cmd + click should have the same effect as control + space currently does
Screenshots
Here's attempting to do this via mouse. First is holding down cmd while clicking, second is holding control while clicking
https://user-images.githubusercontent.com/43280336/171761705-fec53f3e-a0d5-445f-8337-b496f181258b.mov
Desktop (please complete the following information):

OS: macOS Monterey
Browser: Chromium
Version: 102

Running into the same issue on Catalina.
I think this can be fixed by modifying a handful of spots that look for e.ctrlKey so they also look for e.metaKey. This has the knock-on effect of allowing Windows users to use the Windows key for multi-selection, which doesn't seem like a big deal, but might not be desirable?

Those places can be replaced with a dynamic key that gets set based on the correct OS via something like:
import { BrowserInfo, detect } from 'detect-browser';

export const OS = browser.os;
export const isMacOS = OS === 'Mac OS';

// Handle device differences in keyboard key names
export const CTRL_CMD = isMacOS ? 'cmd' : 'ctrl';

Thank you for your report, and everyone who suggested ideas for fixing this! This is fixed in version 1.1.9.

I think this re-emerged with 1.1.11. I cannot test it out as I am not on Mac, but I received report that issue is there with latest library version.

@selfrefactor hm that is odd. There weren't really any changes between 1.1.10 and 1.1.11 that had anything to do with that. I would be interested if someone with a Mac can reproduce this, unfortunately I also do not have a mac. Can you open a new issue for that?


add typescript.md for maintenance

https://github.com/Azure/sdk-release-request/issues/4342
sdk pr https://github.com/Azure/azure-sdk-for-js/pull/26687

/azp run


Book Can be Removed Using Button

Book Can be Removed Using Button
User Story
AS AN avid reader
I WANT to search for new books to read
SO THAT I can keep a list of books to purchase
Acceptance Criteria
GIVEN a book search engine
WHEN I click on the Remove button on a book
THEN that book is deleted from my saved books list

Books can be removed from a user's saved books array.


Fix: store ts type

Codecov Report

Merging #755 (7783310) into master (ce4246f) will not change coverage.
The diff coverage is n/a.

:exclamation: Current head 7783310 differs from pull request most recent head 74ca8aa. Consider uploading reports for the commit 74ca8aa to get more accurate results

@@           Coverage Diff           @@
##           master     #755   +/-   ##
=======================================
  Coverage   54.88%   54.88%
=======================================
  Files          52       52
  Lines        1301     1301
  Branches      267      267
=======================================
  Hits          714      714
  Misses        587      587

https://github.com/raxjs/rax-app/issues/754


Change low rank Trotter step to use spatial low rank routine

@jarrodmcc , @babbush any comments?

This should definitely work for LiH, right? How about a random Hamiltonian (generated using spatial orbitals, then lifted)?

By "work" I assume you mean "admit some rank truncation". You will not be able to truncate rank for an arbitrary random Hamiltonian. You should be able to truncate at least a couple eigenvectors for LiH though.

Well I'm also wondering if there is any additional structure being assumed on the Hamiltonian, other than spin symmetry.

It doesn't seem to work with a random spin-symmetric Hamiltonian.


A11y_AzureToolsStorageExplorer_UploadFolder_ScreenReader:NVDA announces incorrect name for the "Browse folder(...)" button.

“Check out Accessibility Insights! - Identify accessibility bugs before check-in and make bug fixing faster and easier.”
GitHubTags: #A11y_AzureToolsStorageExplorer; #A11yMAS; #A11YTCS; #DesktopApp; #MAS1.3.1; #MAS4.1.2; #NVDA; #JAWS; #Win32; #Benchmark; #A11ySev2;
Environment Details:
Application Name: Azure Tools Storage Explorer
Application Version: 1.12.0
Windows10
NVDA version: 2019.2.1
Repro Steps:

Launch Storage Explorer
Navigate to "Open Connect dialog" pane and Sign in to Azure.
Go to "Manage Accounts" pane and Select the subscriptions you will use. Once selected, click on "Apply" button.
Navigate to "Blob Containers" of the selected subscription, right click and hit enter on "Create Blob container" to Create a new Blob container.
Once completed, Navigate to "Upload" button and hit enter on  "Upload Folder" control.
Start the NVDA screen reader.
Navigate to the (...) browse folder button.
Observe the NVDA announce.

Actual:
NVDA announces the incorrect name for the "Browse folder(...)" button.Here announces as "Browse files".
Expected:
NVDA should announces the correct name for the "browse folder(...)" button.It should announces link "browse folder"
User Impact:
Screen reader user get incorrect information regarding the control if it announces the incorrect name for the "Browse folder" control.
Recommendation:
https://microsoft.sharepoint.com/teams/msenable/mas/Pages/browse-fixes.aspx
MAS Reference:
MAS1.3.1:
https://microsoft.sharepoint.com/:w:/r/teams/msenable/_layouts/15/WopiFrame.aspx?sourcedoc={54f28d1f-a2d1-4dcd-84e1-5c9b87e8aba4}
MAS4.1.2:
https://microsoft.sharepoint.com/:w:/r/teams/msenable/_layouts/15/WopiFrame.aspx?sourcedoc={248054a6-5e68-4771-9e1e-242fb5025730}

We have uploaded repro video of this bug in OneDrive link with name "2608_A11y_AzureToolsStorageExplorer_UploadFolder_ScreenReader" please refer the Screenshot for reference.
Please let us know if there is any problem in accessing the link

@vinodbk197 Could you please verify and close this issue if it is fixed?

I verified this issue on Version 1.16.0-dev
2608_Closed.zip
and found that it is not reproducing .
Refer attachment


Make doc list-concatenation more clear as for += and extend(). #1

This is a follow up of pull/13962.
Before  commit 1af3563 was accepted. I tried clear the doc for list-concatenation in eval.txt
Then after commit 1af3563 being accepted @chrisbra suggest me create PR here instead of on my fork.
Since the situation changes. (My change didn't cope well with newly added lines to eval.txt)

Should I

Just forget it and accept commit 1af3563 as final.
Create a PR and discuss there (which will revert change to eval.txt in commit 1af3563).
Discuss further here.
Which one should I choose? @chrisbra

P.S., as for reference.
My appoach, 2 line addition to eval.txt
commit 1af3563, More than 10 lines to eval.txt, but IMO still not clear.

In commit 1af3563, below lines added in eval.txt

To add items to a List in-place, you can use the |+=| operator: >
:let listA = [1, 2]
:let listA += [3, 4]
<
When two variables refer to the same List, changing one List in-place will
cause the referenced List to be changed in-place: >
:let listA = [1, 2]
:let listB = listA
:let listB += [3, 4]
:echo listA
[1, 2, 3, 4]
<

Is it too much for new users?
Besides, it didn't mention extend() which is the workhorse of list concatenation.
Also add to list usually mean adding single item, eg add() in vimscript, append() in python etc.
Mixing add() with extend()/concat create more confusions.
As I said in issues/13745

add(lst, 'a') is equivalent to extend(lst, ['a']), but add() is technically unrelated to list concatenation.

Using add here might not be a good idea.
As for attempting to clear identity of listA and listB, the intention is good. But for programmer with other language experience, it's so obvious and just noise. For nor programmer/new user, it probably intimidates rather than enlightens.
So I suggest, revert these lines. Just add two lines.
from old doc

Two lists can be concatenated with the "+" operator: >
:let longlist = mylist + [5, 6]
:let mylist += [7, 8]

To

Two lists can be concatenated with the "+" operator: >
:let longlist = mylist + [5, 6]
A list can be concatenated with another one in place using the "+=" operator or |extend()|: >
:let mylist += [7, 8]
:call extend(mylist, [7, 8])

So what's your ideas? @chrisbra @yegappan @errael

I am fine with adding your example of extend() to the help for |list-concatenation|. But I still think it is important to keep the newly added documenation and mention that += may change referenced lists.

I think in place clearly mean the modification part.

A list can be concatenated with another one in place using the "+=" operator or |extend()|: >

As for the newly added part for list-concatenation. My standpoint is already said at issues/13745

Last, as for doc, since vim doc is already famous for being long & complex, and in this case most user just don't care += will return same list or new list, the rest will assume same list (which is common sense and current implementation behavior). And clarification for this topic involve deep understanding of lvalue & rvalue etc, which will incur great burden to new users. I prefer leave it as is. For those who really need this kind of understanding, just point to this issue instead.

Also these line are about list-identity, which should goto there instead of list-concatenation, or somewhere about general object identity in the doc.
I think in cases like this one, the view of new users (real user of vim doc) is much more relevant than we veteran users' opinion.
Though if the community decides to add those lines, I'm fine with it.
As for my addition, it can be simply merged (there is no conflict).
Or just copy to next commit.


TypeError: (0 , _reactNativePermissions.check) is not a function

Hi,
I imported check results and permissions from react native permissions. But all are undefined in the project scope. I know this is a problem with linking. Although react-native link react-native-permissions gives me this error "ENOENT: no such file or directory, open '../node_modules/react-native-permissions/ios/RNPermissions.xcodeproj/project.pbxproj'". So I manually linked the library as I am not using pods. Can someone please let me know what I missed. Any help will be appreciated.
React Native Environment Info:     System:       OS: macOS 10.15.1       CPU: (8) x64 Intel(R) Core(TM) i7-4980HQ CPU @ 2.80GHz       Memory: 722.38 MB / 16.00 GB       Shell: 3.2.57 - /bin/bash     Binaries:       Node: 13.11.0 - ~/.nvm/versions/node/v13.11.0/bin/node       Yarn: 1.15.2 - /usr/local/bin/yarn       npm: 6.13.7 - ~/.nvm/versions/node/v13.11.0/bin/npm       Watchman: 4.9.0 - /usr/local/bin/watchman     SDKs:       iOS SDK:         Platforms: iOS 13.2, DriverKit 19.0, macOS 10.15, tvOS 13.2, watchOS 6.1       Android SDK:         API Levels: 23, 24, 25, 26, 27, 28         Build Tools: 23.0.1, 25.0.3, 27.0.3, 28.0.2, 28.0.3         System Images: android-27 | Intel x86 Atom_64, android-27 | Google Play Intel x86 Atom, android-28 | Google APIs Intel x86 Atom     IDEs:       Android Studio: 3.5 AI-191.8<IP_ADDRESS>77832       Xcode: 11.2.1/11B500 - /usr/bin/xcodebuild     npmPackages:       react: ^16.8.6 => 16.8.6        react-native: ^0.59.2 => 0.59.10      npmGlobalPackages:       react-native-cli: 2.0.1

👉 If you are using Expo, this package will not work.
👉 Version 1.x is not supported anymore.
This library require CocoaPods to install permission handlers on iOS (by linking just the core, you can't request anything - it's a safety to avoid your app being refused when you submitting it to the App store).
This looks like a bad install. Please check duplicate issues: https://github.com/react-native-community/react-native-permissions/issues?q=is%3Aissue+RNPermissions+null+


Fix bug with ModelViewSet.get_menu_item(order=0) calls

I just ran into a bit of a glitch while working on customising an admin menu where menu items constructed with ModelViewSet.get_menu_item(order=0) were being order by the class-level default of 8999, rather than 0. Turns out that 0 was being ignored because it's falsey, rather than the get_menu_item code checking order is not None.
Currently no tests because I couldn't find any existing tests that deal with menu item ordering and wouldn't be sure where best to put them. Happy to follow a suggestion here, but it's also a very small, safe-ish change... what could possibly go wrong? :sweat_smile:

Merged in 2c6ab32d61c4215607369ff2e3a13d270c467693


[Bug]: Fallback false is ignored

Summary
Netlify triggers a new ODB function instead of returning the expected 404 when using fallback: false.
See: https://github.com/netlify/netlify-plugin-nextjs/blob/6fd7bcc99aacf447559de46f60de6d8cb33e7a59/src/helpers/utils.ts#L80-L88
Context:
We have a top level dynamic route, so that we can create new landing pages directly from our CMS. Because fallback: false was ignored, every request to myWebsite.com/:uid resulted in a new ODB function being triggered. However, these requests were for example also triggered by crawlers requesting robots.txt (which was missing at that time). Another edge case leading to a huge number of function invocations was the usage of the nextjs Link component for a route with a configured redirect (in _redirects). Because Nextjs prefetches routes, it tried to prefetch the JSON of the route (which didn't exist because it's a redirect). This would not have been a problem (only a failed request in the network tab of the browser, and it can be fixed by disabling the prefetching)...However, with Netlify ignoring fallback: false, a new ODB function was spawned for every prefetch request (which could be many per user session).
All in all we accumulated 170k+ function invocations in one weekend. I know that the above described scenario is very specific (and could have been avoided) but I wanted to emphasize, that the i18n fix can result in some unpleasent surprises for Netlify customers that use fallback: false and expect it to work as described in the nextjs docs.
Steps to reproduce
.
A link to a reproduction repository
No response
Plugin version
4.2.1
More information about your build

[ ] I am building using the CLI
[ ] I am building using file-based configuration (netlify.toml)

What OS are you using?
No response
Your netlify.toml file

`netlify.toml`
# Paste content of your `netlify.toml` file here

Your public/_redirects file

`_redirects`
# Paste content of your `_redirects` file here

Your next.config.js file

`next.config.js`
# Paste content of your `next.config.js` file here. Check there is no private info in there.

Builds logs (or link to your logs)

Build logs
# Paste logs here

Function logs

Function logs
# Paste logs here

.next JSON files

generated .next JSON files
# Paste file contents here. Please check there isn't any private info in them
# You can either build locally, or download the deploy from Netlify by clicking the arrow next to the deploy time.

We also have multiple builds that are affected by this bug. We have a dynamic route which creates pages based off the slug provided by our CMS. The defect was noticed in production when visiting any route not available in the CMS, which should return a 404, however we are seeing 500 - internal server error. The appearance of the bug seems to coincide with recent version changes, we were able to confirm that by upgrading a previously unaffected site from v3.9.2 to v4.2.3, which introduced the 500 errors. We confirmed that it is being sent to the netlify-odb-handler. We are investigating further now, please let us know if any additional details are needed.

Below is the function log for the odb-handler. Its worth noting we believe the error is happening upstream of the odb-handler function, possibly here: https://github.com/netlify/netlify-plugin-nextjs/blob/6fd7bcc99aacf447559de46f60de6d8cb33e7a59/src/helpers/redirects.ts#L68
2:08:18 PM 47e5a9cf ERROR  Error: Request failed with status code 404     at createError (/var/task/node_modules/axios/lib/core/createError.js:16:15)     at settle (/var/task/node_modules/axios/lib/core/settle.js:17:12)     at IncomingMessage.handleStreamEnd (/var/task/node_modules/axios/lib/adapters/http.js:293:11)     at IncomingMessage.emit (events.js:412:35)     at endReadableNT (internal/streams/readable.js:1334:12)     at processTicksAndRejections (internal/process/task_queues.js:82:21) {   config: {     transitional: {       silentJSONParsing: true,       forcedJSONParsing: true,       clarifyTimeoutError: false     },     adapter: [Function: httpAdapter],     transformRequest: [ [Function: transformRequest] ],     transformResponse: [ [Function: transformResponse] ],     timeout: 0,     xsrfCookieName: 'XSRF-TOKEN',     xsrfHeaderName: 'X-XSRF-TOKEN',     maxContentLength: -1,     maxBodyLength: -1,     validateStatus: [Function: validateStatus],     headers: {       Accept: 'application/json, text/plain, */*',       'User-Agent': 'axios/0.24.0'     },     baseURL: 'https://api.storyblok.com/v2',     proxy: false,     params: {       version: 'published',       cv:<PHONE_NUMBER>291,       resolve_relations: 'service_package.included_services,featured_testimonials.selected_testimonials,featured_post.selected_post',       token: ''     },     paramsSerializer: [Function: paramsSerializer],     method: 'get',     url: '/cdn/stories/lksadf',     data: undefined   },   request: <ref *1> ClientRequest {     _events: [Object: null prototype] {       abort: [Function (anonymous)],       aborted: [Function (anonymous)],       connect: [Function (anonymous)],       error: [Function (anonymous)],       socket: [Function (anonymous)],       timeout: [Function (anonymous)],       prefinish: [Function: requestOnPrefinish]     },     _eventsCount: 7,     _maxListeners: undefined,     outputData: [],     outputSize: 0,     writable: true,     destroyed: false,     _last: true,     chunkedEncoding: false,     shouldKeepAlive: false,     _defaultKeepAlive: true,     useChunkedEncodingByDefault: false,     sendDate: false,     _removedConnection: false,     _removedContLen: false,     _removedTE: false,     _contentLength: 0,     _hasBody: true,     _trailer: '',     finished: true,     _headerSent: true,     socket: TLSSocket {       _tlsOptions: [Object],       _secureEstablished: true,       _securePending: false,       _newSessionPending: false,       _controlReleased: true,       secureConnecting: false,       _SNICallback: null,       servername: 'api.storyblok.com',       alpnProtocol: false,       authorized: true,       authorizationError: null,       encrypted: true,       _events: [Object: null prototype],       _eventsCount: 10,       connecting: false,       _hadError: false,       _parent: null,       _host: 'api.storyblok.com',       _readableState: [ReadableState],       _maxListeners: undefined,       _writableState: [WritableState],       allowHalfOpen: false,       _sockname: null,       _pendingData: null,       _pendingEncoding: '',       server: undefined,       _server: null,       ssl: [TLSWrap],       _requestCert: true,       _rejectUnauthorized: true,       parser: null,       _httpMessage: [Circular *1],       [Symbol(res)]: [TLSWrap],       [Symbol(verified)]: true,       [Symbol(pendingSession)]: null,       [Symbol(async_id_symbol)]: 62,       [Symbol(kHandle)]: [TLSWrap],       [Symbol(kSetNoDelay)]: false,       [Symbol(lastWriteQueueSize)]: 0,       [Symbol(timeout)]: null,       [Symbol(kBuffer)]: null,       [Symbol(kBufferCb)]: null,       [Symbol(kBufferGen)]: null,       [Symbol(kCapture)]: false,       [Symbol(kBytesRead)]: 0,       [Symbol(kBytesWritten)]: 0,       [Symbol(connect-options)]: [Object],       [Symbol(RequestTimeout)]: undefined     },     _header: 'GET /v2/cdn/stories/lksadf?cv=1644440441&resolve_relations=service_package.included_services%2Cfeatured_testimonials.selected_testimonials%2Cfeatured_post.selected_post&token=''&version=published HTTP/1.1\r\n' +       'Accept: application/json, text/plain, */*\r\n' +       'User-Agent: axios/0.24.0\r\n' +       'Host: api.storyblok.com\r\n' +       'Connection: close\r\n' +       '\r\n',     _keepAliveTimeout: 0,     _onPendingData: [Function: noopPendingOutput],     agent: Agent {       _events: [Object: null prototype],       _eventsCount: 2,       _maxListeners: undefined,       defaultPort: 443,       protocol: 'https:',       options: [Object],       requests: {},       sockets: [Object],       freeSockets: {},       keepAliveMsecs: 1000,       keepAlive: false,       maxSockets: Infinity,       maxFreeSockets: 256,       scheduling: 'lifo',       maxTotalSockets: Infinity,       totalSocketCount: 1,       maxCachedSessions: 100,       _sessionCache: [Object],       [Symbol(kCapture)]: false     },     socketPath: undefined,     method: 'GET',     maxHeaderSize: undefined,     insecureHTTPParser: undefined,     path: '/v2/cdn/stories/lksadf?cv=1644440441&resolve_relations=service_package.included_services%2Cfeatured_testimonials.selected_testimonials%2Cfeatured_post.selected_post&token=''&version=published',     _ended: true,     res: IncomingMessage {       _readableState: [ReadableState],       _events: [Object: null prototype],       _eventsCount: 3,       _maxListeners: undefined,       socket: [TLSSocket],       httpVersionMajor: 1,       httpVersionMinor: 1,       httpVersion: '1.1',       complete: true,       headers: [Object],       rawHeaders: [Array],       trailers: {},       rawTrailers: [],       aborted: false,       upgrade: false,       url: '',       method: null,       statusCode: 404,       statusMessage: 'Not Found',       client: [TLSSocket],       _consuming: false,       _dumped: false,       req: [Circular *1],       responseUrl: 'https://api.storyblok.com/v2/cdn/stories/lksadf?cv=1644440441&resolve_relations=service_package.included_services%2Cfeatured_testimonials.selected_testimonials%2Cfeatured_post.selected_post&token=''&version=published',       redirects: [],       [Symbol(kCapture)]: false,       [Symbol(RequestTimeout)]: undefined     },     aborted: false,     timeoutCb: null,     upgradeOrConnect: false,     parser: null,     maxHeadersCount: null,     reusedSocket: false,     host: 'api.storyblok.com',     protocol: 'https:',     _redirectable: Writable {       _writableState: [WritableState],       _events: [Object: null prototype],       _eventsCount: 2,       _maxListeners: undefined,       _options: [Object],       _ended: true,       _ending: true,       _redirectCount: 1,       _redirects: [],       _requestBodyLength: 0,       _requestBodyBuffers: [],       _onNativeResponse: [Function (anonymous)],       _currentRequest: [Circular *1],       _currentUrl: 'https://api.storyblok.com/v2/cdn/stories/lksadf?cv=1644440441&resolve_relations=service_package.included_services%2Cfeatured_testimonials.selected_testimonials%2Cfeatured_post.selected_post&token=''&version=published',       _isRedirect: true,       [Symbol(kCapture)]: false     },     [Symbol(kCapture)]: false,     [Symbol(kNeedDrain)]: false,     [Symbol(corked)]: 0,     [Symbol(kOutHeaders)]: [Object: null prototype] {       accept: [Array],       'user-agent': [Array],       host: [Array]     }   },   response: {     status: 404,     statusText: 'Not Found',     headers: {       'content-type': 'application/json; charset=utf-8',       'content-length': '34',       connection: 'close',       date: 'Wed, 16 Feb 2022 19:08:18 GMT',       server: 'nginx/1.18.0',       'x-frame-options': 'SAMEORIGIN',       'x-xss-protection': '1; mode=block',       'x-content-type-options': 'nosniff',       'x-download-options': 'noopen',       'x-permitted-cross-domain-policies': 'none',       'referrer-policy': 'strict-origin-when-cross-origin',       'cache-control': 'max-age=0, public, s-maxage=604800',       'x-request-id': '537fedd5-9a79-4e29-b62f-724c03cec51f',       'x-runtime': '0.013636',       vary: 'Origin',       'x-cache': 'Error from cloudfront',       via: '1.1 a929b4bfaa0111e3feb7c4dbffdbd8d8.cloudfront.net (CloudFront)',       'x-amz-cf-pop': 'IAD79-C1',       'x-amz-cf-id': 'NIqRwcGrwgepxunuK9U0YtyYqgPvzU3u-4p6yZ6V-KS6UhWUwQWIvA=='     },     config: {       transitional: [Object],       adapter: [Function: httpAdapter],       transformRequest: [Array],       transformResponse: [Array],       timeout: 0,       xsrfCookieName: 'XSRF-TOKEN',       xsrfHeaderName: 'X-XSRF-TOKEN',       maxContentLength: -1,       maxBodyLength: -1,       validateStatus: [Function: validateStatus],       headers: [Object],       baseURL: 'https://api.storyblok.com/v2',       proxy: false,       params: [Object],       paramsSerializer: [Function: paramsSerializer],       method: 'get',       url: '/cdn/stories/lksadf',       data: undefined     },     request: <ref *1> ClientRequest {       _events: [Object: null prototype],       _eventsCount: 7,       _maxListeners: undefined,       outputData: [],       outputSize: 0,       writable: true,       destroyed: false,       _last: true,       chunkedEncoding: false,       shouldKeepAlive: false,       _defaultKeepAlive: true,       useChunkedEncodingByDefault: false,       sendDate: false,       _removedConnection: false,       _removedContLen: false,       _removedTE: false,       _contentLength: 0,       _hasBody: true,       _trailer: '',       finished: true,       _headerSent: true,       socket: [TLSSocket],       _header: 'GET /v2/cdn/stories/lksadf?cv=1644440441&resolve_relations=service_package.included_services%2Cfeatured_testimonials.selected_testimonials%2Cfeatured_post.selected_post&token=''&version=published HTTP/1.1\r\n' +         'Accept: application/json, text/plain, */*\r\n' +         'User-Agent: axios/0.24.0\r\n' +         'Host: api.storyblok.com\r\n' +         'Connection: close\r\n' +         '\r\n',       _keepAliveTimeout: 0,       _onPendingData: [Function: noopPendingOutput],       agent: [Agent],       socketPath: undefined,       method: 'GET',       maxHeaderSize: undefined,       insecureHTTPParser: undefined,       path: '/v2/cdn/stories/lksadf?cv=1644440441&resolve_relations=service_package.included_services%2Cfeatured_testimonials.selected_testimonials%2Cfeatured_post.selected_post&token=''&version=published',       _ended: true,       res: [IncomingMessage],       aborted: false,       timeoutCb: null,       upgradeOrConnect: false,       parser: null,       maxHeadersCount: null,       reusedSocket: false,       host: 'api.storyblok.com',       protocol: 'https:',       _redirectable: [Writable],       [Symbol(kCapture)]: false,       [Symbol(kNeedDrain)]: false,       [Symbol(corked)]: 0,       [Symbol(kOutHeaders)]: [Object: null prototype]     },     data: [ 'This record could not be found' ]   },   isAxiosError: true,   toJSON: [Function: toJSON] } 2:08:18 PM 47e5a9cf INFO   [GET] /lksadf (ODB) 2:08:18 PM 47e5a9cf Duration: 1674.14 ms	Memory Usage: 100 MB	Init Duration: 212.53 ms

Hey @ascorbic,
I'm having some trouble serving a deploy preview locally or to netlify with the suspected problem line commented out in the build plugin to verify this, but I suspect the problem redirects that are being generated in our case relate to our dynamic route template at /pages/[...slug].js. Here's an example of the generated redirects from the deploy log:
6:20:01 PM:     from: '/_next/data/build/:slug/*',
6:20:01 PM:     to: '/.netlify/builders/___netlify-odb-handler',
6:20:01 PM:     status: 200,
6:20:01 PM:     force: false
6:20:01 PM:   },
6:20:01 PM:   {
6:20:01 PM:     from: '/:slug/*',
6:20:01 PM:     to: '/.netlify/builders/___netlify-odb-handler',
6:20:01 PM:     status: 200,
6:20:01 PM:     force: false
6:20:01 PM:   },

The template in question uses getStaticProps without revalidate and getStaticPaths with fallback: false (doesn't take advantage of ISR/SSR). netlify-plugin-nextjs appears to be generating redirects for any prerendered dynamic routes and their related data routes that don't match middleware at line 201 in the redirects.ts file. I must be missing something, however, because that would mean that all prerendered pages, regardless of their fallback status, are being referred to the odb-handler rather than being served from the deploy build cache in cases where the page has already been rendered. A dynamic route is not necessarily an SSR route or an ISR route, but this appears to treat it as such.

Hi @hu0p
Pages pre-rendered at build time will take priority over those rewrites (hance force= false), so the ODB handler will only be hit for pages that haven't been rendered. Other pages will hit the handler the first time they are visited, but that response will be then cached until the next deploy. As the comment states though, for reasons that aren't entirely clear to me, Next.js doesn't always pre-render static paths for other locales, and instead serves them dynamically. For this reason we need to hit the origin to be certain it's a 404. I will need to look into possible workarounds for this though, as I understand the problem of not wanting to accumulate these invocations.

Pages pre-rendered at build time will take priority over those rewrites (hance force= false), so the ODB handler will only be hit for pages that haven't been rendered.

Ah, got it. I overlooked that force: false bit when I was familiarizing myself with the repo and control flow inside redirects.ts. I totally forgot about that option. Thanks for pointing that out! This makes perfect sense.

I will need to look into possible workarounds for this though, as I understand the problem of not wanting to accumulate these invocations.

Thanks for recognizing our concerns. That's a big part of it, but it also leads to negative SEO consequences. 500 errors are logged in GSC as errors that can cause routes to be prematurely dropped from results before they can be caught and redirected by content managers. The current behavior also really doesn't align with the Next.js API as documented. I apologize if it sounds like I'm beating a dead horse. I promise that's not my intention. Rather, I just wanted to share these thoughts so they can be taken into consideration when working towards coming up with the workaround you mentioned.
Perhaps in the meantime a solution would be to manually force a 404 when page data is unavailable? I don't love it because it this is not the originally intended use case for this functionality and it otherwise wouldn't be necessary in any other environment, but it could at least address the problem for us (and anyone else who stumbles across this) in the meantime. It might make sense to include a note about this somewhere in the docs as well if you're open to it.

As the comment states though, for reasons that aren't entirely clear to me, Next.js doesn't always pre-render static paths for other locales, and instead serves them dynamically. For this reason we need to hit the origin to be certain it's a 404. I will need to look into possible workarounds for this though, as I understand the problem of not wanting to accumulate these invocations.

We're actually working on a large i18n project at the moment, so this is also relevant to us. Just out of curiosity, when you were testing this, were the locales configured in next.config.js and being passed as a property for each individual path that is desired to be prerendered in the paths array in getStaticPaths as shown in the example here? That is a bit of an edge case for the fallback property that sounds like it could apply here.

Thanks for recognizing our concerns. That's a big part of it, but it also leads to negative SEO consequences. 500 errors are logged in GSC as errors that can cause routes to be prematurely dropped from results before they can be caught and redirected by content managers. The current behavior also really doesn't align with the Next.js API as documented. I apologize if it sounds like I'm beating a dead horse. I promise that's not my intention. Rather, I just wanted to share these thoughts so they can be taken into consideration when working towards coming up with the workaround you mentioned.

This is clearly a bug. It should be returning a proper 404 page. Do you have the function log for one of those requests?

Are you sure? The test case here would be visiting a route that doesn't and wouldn't exist, so something like /asdfasdfasdf. This route isn't listed in the paths array returned from getStaticPaths, so it isn't prerendered. However, it does match the [...slug] dynamic route in the manifest, so it gets passed to the ODB handler and hits the origin as you noted, which triggers the following behavior defined in getStaticProps (simplified a bit here):
export async function getStaticProps({ params }) {
  const slug = params.slug?.join("/")

  const { data } = await getPage(slug)

  return {
    props: {
      key: data?.id ?? null,
      content: data?.content ?? null,
    },
  }
}

You can actually see an example of the function logs in Ben's comment above (we represent the same organization). I'm afraid there's not much interesting going on there. It's just a 404 response from the CMS (Storyblok). Axios or the CMS SDK inside the getPage call may be throwing an exception or it could be an error during page generation triggering the client-side error. Either way it shouldn't hit the handler at all and should 404, right? There is another site that doesn't use the SDK that we believe is also affected by this, but it has slightly different behavior. Same plugin version and test route (more or less), but it just generates an empty page (200 status) and doesn't make a json request for the page data. My guess is it's just a difference in rendering (null check on the client). These should 404 too.
The logs for that site are pretty interesting though. Those requests come through without error to the ODB handler, but they also include requests for page data that should be pre-rendered e.g. contact, about, careers:

Feb 17, 10:23:00 AM: 11c2ce94 INFO   [GET] /_next/data/build/contact.json (ODB)
Feb 17, 10:23:02 AM: 11c2ce94 Duration: 1722.69 ms	Memory Usage: 104 MB	Init Duration: 218.51 ms
Feb 17, 12:19:23 PM: dd1a1587 INFO   [GET] /asdfasdfasdf (ODB)
Feb 17, 12:19:26 PM: dd1a1587 Duration: 1695.81 ms	Memory Usage: 104 MB	Init Duration: 219.06 ms
Feb 17, 12:19:30 PM: e3073522 INFO   [GET] /_next/data/build/about.json (ODB)
Feb 17, 12:19:30 PM: 9deb1acf INFO   [GET] /_next/data/build/careers.json (ODB)
Feb 17, 12:19:30 PM: e3073522 Duration: 291.11 ms	Memory Usage: 105 MB
Feb 17, 12:19:32 PM: 9deb1acf Duration: 1720.37 ms	Memory Usage: 103 MB	Init Duration: 213.49 ms
Feb 17, 12:19:32 PM: 7da98e7c Duration: 1873.28 ms	Memory Usage: 104 MB	Init Duration: 189.15 ms
Feb 17, 12:25:51 PM: dae7e1de INFO   [GET] /_next/data/build/contact.json (ODB)
Feb 17, 12:25:53 PM: dae7e1de Duration: 1786.25 ms	Memory Usage: 104 MB	Init Duration: 205.46 ms
Feb 17, 12:29:07 PM: c63ca70a INFO   [GET] /asdfasdfasdf (ODB)
Feb 17, 12:29:08 PM: c63ca70a Duration: 417.19 ms	Memory Usage: 106 MB
Feb 17, 12:29:09 PM: 41c5bfad INFO   [GET] /_next/data/build/about.json (ODB)
Feb 17, 12:29:09 PM: 6d9b87f5 INFO   [GET] /_next/data/build/careers.json (ODB)
Feb 17, 12:29:09 PM: 3485981c INFO   [GET] /_next/data/build/our-brands/wkrq.json (ODB)
Feb 17, 12:29:10 PM: 41c5bfad Duration: 481.97 ms	Memory Usage: 108 MB
Feb 17, 12:29:11 PM: 6d9b87f5 Duration: 1527.12 ms	Memory Usage: 104 MB	Init Duration: 165.48 ms
Feb 17, 12:29:12 PM: 3485981c Duration: 1873.55 ms	Memory Usage: 105 MB	Init Duration: 225.82 ms
Feb 17, 12:29:20 PM: b1d50e4c INFO   [GET] /asdfasdfasdfasdfasdfasdfasdfasdfasdf (ODB)
Feb 17, 12:29:20 PM: b1d50e4c Duration: 212.44 ms	Memory Usage: 107 MB
Feb 17, 01:26:11 PM: a22eea1b INFO   [GET] /404 (ODB)
Feb 17, 01:26:12 PM: a22eea1b Duration: 557.48 ms	Memory Usage: 80 MB	Init Duration: 206.30 ms
Feb 17, 01:26:59 PM: cbc77314 INFO   [GET] /asdfasdfasdfasdfasdfasdfasdf (ODB)
Feb 17, 01:27:00 PM: cbc77314 Duration: 1151.19 ms	Memory Usage: 104 MB

I tried manually returning a 404 inside getStaticProps like I mentioned as a workaround before, and I can confirm that works. However, it still triggers an unnecessary invocation, of course.
Something else I noticed: an empty /_next/data/build folder is generated at the top level of the directory when I use netlify-cli to run ntl dev --live or ntl build locally with the plugin (cloned repo, file based configuration in netlify.toml). Do you have a typical workflow for this plugin? I've cloned it into an existing site, configured it in netlify.toml, and run npm run watch to generate the lib folder, but any time I attempt to do test deploys I experience some odd broken behavior that I don't get in production. Any idea what I could be missing?

Sorry, to be clear I meant it's a bug in the plugin not in your code. I'm going to deal with some other fixes today and then see if I can look into this. Can you confirm whether you're using i18n in this site? If possible, could you share your .next/prerender-manifest.json file?
For CLI deploys, you need to run netlify deploy --build, rather than building and deploying separately.

So good news! The pages I noted above that should be pre-rendered were not due to a bug in the plugin. We overlooked a hidden default per_page count/limit in the CMS API. The only issue we're definitely dealing with here is the improper accumulation of invocations for pages that should 404 which match a given dynamicRoute in the .next/prerender-manifest.json. Sorry for any confusion this may have caused, and let me know if we need to move this to a new issue.

For CLI deploys, you need to run netlify deploy --build, rather than building and deploying separately.

This must be a separate bug. I tried this at one point (and just now) and was able to reproduce the error we're discussing, but I kept getting 500 errors from the _ipx function which caused all of the images to break.

Can you confirm whether you're using i18n in this site?

Neither of the sites I mentioned are using i18n.

If possible, could you share your .next/prerender-manifest.json file?

Yup, see below for the site that matches the ODB logs I shared above. This is the site that was giving us 200 statuses and empty pages in places where it should 404. The page/pageData being erroneously fetched are handled by:
...
  "dynamicRoutes": {
    ...
    "/[...slug]": {
      "routeRegex": "^/(.+?)(?:/)?$",
      "dataRoute": "/_next/data/build/[...slug].json",
      "fallback": false,
      "dataRouteRegex": "^/_next/data/build/(.+?)\\.json$"
    },
    ...
  }
...

Here's the full manifest. Ignore the fact that it doesn't include the real looking pages from the ODB logs above.
When visiting a dynamic route that should return a 404, there is an attempt to render server side.
https://abtest-middleware.netlify.app/dynamic-routes/this-should-go-to-404
I thought this could be something to do with middleware but also appears to happen on non mw pages
https://abtest-middleware.netlify.app/dynamic-routes-no-middleware/this-should-go-to-404
Link to repo
Function log of ___netlify-handler
Mar 7, 04:38:50 PM: 5c6c22dc INFO   [GET] /dynamic-routes-no-middleware/this-should-go-to-404 (SSR)
Mar 7, 04:38:50 PM: 5c6c22dc Duration: 58.96 ms	Memory Usage: 89 MB

Nothing from ODB
v4.2.7
If you need any further info let me know!
Also can we try keep massive logs   inside a <details> tag 😎

Sorry for bumping the thread but just wondering if a fix for this bug is in the pipeline?
Or maybe I have missed something and this isnt a bug at all 🤔

I don't like being a +1 dude, but +1.

I found out that this behaviour throws this server error on non-existing pages when using this
filesystem-based method to pass fetched data from getStaticPaths to getStaticProps:
https://github.com/vercel/examples/tree/main/solutions/reuse-responses
(However, this does not happen locally, which makes it much harder to find the problem.)
Apr 7, 03:04:54 PM: 7e112390 ERROR  Error: ENOENT: no such file or directory, open '/var/task/xyz.db'

I think this happens because the cache file disappears after the build process (at least that's what I thought). But this should be no problem if netlify did not try to run getStaticProps after the build process as expected when fallback: false is set.

@pixelino We've had to result to wrapping our requests in a try/catch that manually returns 404 ({ notFound: true }) when this occurs while we evaluate other options. It's cumbersome and annoying, but it produces the usual expected behavior in the interim.

hey hu0p! could you share how you achieved this? I dont mind doing it manually as long as it works 😄

@JohnGemstone Our solution looked something like this:
async function getStaticProps({ params: { slug } }) {
  let data
  try {
    ;({ data } = await yourSDKFunction(slug, yourSDKConfig))
  } catch (e) {
    console.error(e)
    return {
      notFound: true,
    }
  }

// do stuff with data and/or return data
}

I hope this helps. This may or may not be directly applicable to your use-case, but we have an SDK that makes requests inside getStaticProps which chooses to throw when it encounters an error. This is the desired outcome during the build, but not during production which seems to lead to the pain a lot of us are encountering in this thread. To make matters worse, this is not idiomatic Next.js. As I understand it fallback: false and especially the absence of an arbitrary path in getStaticPaths should mean there is no function hit.

Hey thanks for sharing your solution, I didnt know about that notFound: true property which looks ideal for this!
I use SanityCMS for most my sites so directly querying the database every page view wouldn't be ideal, what I could probably do is create a prebuild script to store all the relevant slugs then compare them against the slug in getStaticProps like you have in your example. Pretty simple!
Got my fingers crossed to see those 404s 😄

Anything new about this bug? I still have this problem. Dynamic routes are returning server error 5xx, instead of a regular 404 page.

@ascorbic any news on this? Would be great to know if we have to find a workaround ourselves, or if a fix from Netlify's side is planned. Thanks!

@orinokai is working on this

Wanted to check in on the status of this. We are running into the same issue and the workaround is and isn't a viable solution without a more expansive refactor.

@inadeqtfuturs Same. I had really hoped this would've been solved by now. The workaround works for small cases like wrapping an SDK but it doesn't scale well for complex logic or some fairly common use-cases. We really began to understand this when we ran into a use-case similar to @pixelino's.
We now have an i18n site that reuses responses from getStaticPaths in getStatpicProps via filesystem-based caching. The ODB handler will attempt to SSR a page that it shouldn't (due to fallback: false config) and subsequently choke because the file path doesn't exist. This of course builds fine locally but doesn't work in production because the files aren't there. Including the files, in public/ or in the function itself, doesn't seem like a viable solution because it would amount to 132 mb of serialized data (far exceeding Netlify's function size limit).
Couple questions for anyone experiencing this bug:

Are you using i18n?
Are you using filesystem-based caching to reuse responses from getStaticPaths later during getStaticProps?

Heck, react to my comment with a heart if yes for 1, a tada/confetti if yes for 2, and a thumbs down if no to both to make it easy 😁. It seems like this problem pops up under a couple different conditions, so my hope is that if we can narrow down the problem set we can figure out the origin of the issue.
@orinokai or @ascorbic I'm willing to volunteer some more of my time to investigate this. Hopefully the existing large site we have could serve as a test-case for this.

As the comment states though, for reasons that aren't entirely clear to me, Next.js doesn't always pre-render static paths for other locales, and instead serves them dynamically. For this reason we need to hit the origin to be certain it's a 404.

Has anything changed on this front? It seems like it could be a big part of the problem.

@inadeqtfuturs Have you had the opportunity to investigate if this affects all users or just you? Something else that may be worth sharing is that, at least in this case, these pages do appear to pre-render. It's only in the function logs for the ODB handler that I see these ENOENT errors (file/path doesn't exist). Is this the same for you?
An interestingly development I came across today is a team member experiencing 500 errors on the route in question while I didn't. Yet the page loaded correctly in incognito for her, and a hard refresh didn't resolve the issue. I just can't figure out why it would cache the handler for her and not me.

Thanks @hu0p for the additional information and use cases, much appreciated. We have been looking into this and have a potential way forward that should ensure non-prerendered dynamic routes will bypass the ODB handler when fallback: false is set. There's a few additional cases in the comments above that I want to make sure we've covered before we push anything, but I will update here with more info soon.

It's only in the function logs for the ODB handler that I see these ENOENT errors (file/path doesn't exist). Is this the same for you?

It's not just me -- it affects all users.
From what I can tell from the build log, the pages we don't want to render are not being built, BUT routes that aren't built seem to fallback to ones that are. So an example would be [param]/page.js, which would build 6 routes. If you hit something like definitely-not-a-built-param/page, it will fall back to one of the built param/pages. I haven't checked the ODB handler though and might get some time to look into it today.

The PR is really useful, thanks @hu0p. We will get it merged in and, as you say, it will be useful for testing. The specific error happens because getStaticProps runs on those pages and there is no write file access in the function environment. The fix is still in progress as the edge cases are proving tricky - we need need ensure that the handler function is completely bypassed for non-prerendered dynamic-routes with fallback: false but we also need to ensure custom 404 pages are respected in all locales and provide support for ISR 404 pages with revalidate. Will keep you posted on progress.

Hi, is there anything that needs to be done to deploy this fix? I only wear my nextjs/netlify hat a day or two every couple months, so I'm bad at this, but we get 500 errors when we should get 404s and it's impacting our SEO. The error we get looks a lot like the ones reported here:
Oct 13, 02:39:09 PM: 74406dd1 ERROR  Error: ENOENT: no such file or directory, open '/var/task/posts/robots.txt.mdx'
    at Object.openSync (node:fs:585:3)
    at Object.readFileSync (node:fs:453:35)
    at getPostData (/var/task/.next/server/chunks/333.js:1893:68)
    at getStaticProps (/var/task/.next/server/pages/[...slug].js:96:57)
    at Object.renderToHTML (/var/task/node_modules/next/dist/server/render.js:465:26)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async doRender (/var/task/node_modules/next/dist/server/base-server.js:879:38)
    at async cacheEntry.responseCache.get.isManualRevalidate.isManualRevalidate (/var/task/node_modules/next/dist/server/base-server.js:979:28)
    at async /var/task/node_modules/next/dist/server/response-cache.js:64:36 {
  errno: -2,
  syscall: 'open',
  path: '/var/task/posts/robots.txt.mdx'
}

This issue is closed and the PR is merged about a month ago. We've deployed since then...is there something else to do?
Here's our site throwing a 500 instead of a 404: https://free.law/robots.txt
Our code is here: https://github.com/freelawproject/free.law/
Thank you!

Hm, well, I thought I'd try to fix this while hoping for a response. So far I:

updated everything in my packages file to the latest version
told netlify to use a newer version of node (the older, default one didn't work anymore)
reinstalled the nextjs plugin for the site via netlify's UI

The good news: I have a build with updated deps, so that's nice.
The bad news: I still get 500 errors instead of 404 errors, and I still see errors like the one above when looking in the logs. Bummer.

Darn, and even the fixes suggested here don't work. I switched all my code from this:
export async function getStaticProps({ params }) {
  const postData = await getPostData(params.slug);
  const allPostsData = await getSortedPostsData();
  return {
    props: {
      postData,
      allPostsData,
    },
  };
}

To this:
export async function getStaticProps({ params }) {
  let postData, allPostsData;
  try {
    postData = await getPostData(params.slug);
    allPostsData = await getSortedPostsData();
  } catch (e) {
    console.error(e);
    return {
      notFound: true,
    };
  }

  return {
    props: {
      postData,
      allPostsData,
    },
  };
}

And still no useful 404 pages. Kind of running out of ideas. Would love any help anybody has time to offer.


oslogin: 2fa MDS entry will not always be present

Considering that non existing 2fa MDS entry is assumed as "non enabled" this patch changes the metadata utils to report a known error for 404 errors, if the entry is not found we assume the flag to be disabled.

/hold

/unhold

/lgtm

/retest


Use non-strict HTML parsing and continue in the face of ambiguity

Initialize lol-html with strict: false

Discussed in https://github.com/CloudCannon/pagefind/discussions/153
Originally posted by dprothero November 23, 2022

Released as v0.10.1 🎉


Add an option for whether to receive a PM when invited users join

This issue description has been updated by @alya  to include a specific design.
At present, when a user's invitation to Zulip is accepted, they receive a PM announcing this. However, some users may not want to receive such a PM, e.g. because they are already following new user notifications in a stream, or they simply don't need to know when new users join.
To address this, we should add a feature to turn off PM notifications when sending an invitation. In particular, the user invite modal should have the following checkbox below the "Users(s) join as" dropdown:

[ ]  Send me a private message when my invitation is accepted.

Notes:

The checkbox should default to the previous state, which in turn defaults to enabled.
The checkbox should only be shown when inviting by email, not when creating an invite link. (We don't send notifications when invite links are used.)
If a user flips back and forth between inviting by email and generating a link, the current state of the checkbox should be preserved.

Original issue:

Allow Muting Notification Bot
I am annoyed that I get double-notified when a new user joins:
Through the channel topic for new users and a PM from the notification bot, as I am personally responsible for invitations.
I checked out Mute a User and https://docs.zulip.com/help/configure-notification-bot, but neither applies to PMs from the Notification Bot...

@xeruf thanks for the report!  I think don't think muting the notification bot is the right solution for this problem; instead I think a personal notification setting for whether you get a PM when a new user joins who you invited makes more sense.
@alya thoughts on that design question?

@zulipbot claim

@zulipbot claim

@alya can you please tell me if this issue is open to work on?

@algo-byte This issue wasn't really ready, as we didn't have a worked out design.
In particular, I think the right approach is to ask the user when they send the invitation, rather than making it a display setting.

I can write up a description soon and mark it as "help wanted" at that point.

Thank you for confirming, will make sure to check out the labels first before working on any issue next time.

@sahil839 thank you so much for helping me on this issue. Learned a lot from you and from this issue.

I've updated the issue, so it's ready to be worked on now.

@alya does that mean that for every invitee, the referrer can decide if he/she wants a PM or not?

Little design annotation:

The checkbox should default to the previous state, which in turn defaults to enabled on by default.

@zulipbot claim

@algo-byte Not for every invitee, but every time the user is sending out a bundle of invites. If you want to get a message when A joins but not B, you'd have to invite them separately.

Little design annotation:

The checkbox should default to the previous state, which in turn defaults to enabled ~on by default~.

Good idea, thanks! Updated accordingly.

@alya does this look good?

@alya @timabbott I am having a little difficulty in preserving the default state of the checkbox. I tried finding the event handler that opens and closes user invite modal but couldn't find it. Also tried finding the #/invite url that gets called when we open the user invite modal but I am unable to find the right files. Any help is greatly appreciated.

The screenshot looks good to me!
For the question above, you should post it in the #backend stream on chat.zulip.org so that more people have a chance to see it an help you out.

@zulipbot claim

I am still working on it

@zulipbot claim


RETURN.DISTINCT() maybe should be RTerminal?

Hi Wolfgang,
I am wondering if RETURN.DISTINCT() shouldn't be actually a RTerminal. The reasons behind such logic are following:

What is there currently kinda suggests that distinction would apply only to one given return value i.e.

RETURN.DISTINCT().value(n.id()).AS(id),
RETURN.value(n.property("name")).AS(name),
RETURN.value(m.labels()).AS(labels)

but in fact it does apply to all records which are returned from neo4j, which are than translated into jcypher collections.

Another case is that in case of building cypher queries dynamically in some cases it could be usefull to do:

clasuses.add(RETURN.DISTINCT());
if(some_condition) {
  clasuses.add(RETURN.value(m.id()).AS(id));
}
clasuses.add(RETURN.value(n.id()).AS(id));

instead of:
if(some_condition) {
  clasuses.add(RETURN.DISTINCT().value(m.id()).AS(id));
  clasuses.add(RETURN.value(n.id()).AS(id));
} else {
  clasuses.add(RETURN.value(n.id()).AS(id));
}

Hi Krzysztof,
if you do the following:
RETURN.DISTINCT().value(n.id()).AS(id),
SEPARATE.nextClause(),
RETURN.value(n.property("name")).AS(name),
RETURN.value(m.labels()).AS(labels)

two returns are created, only the first with distinct like:
RETURN DISTINCT id(n) AS id
RETURN n.name AS name, labels(m) AS labels

Generally, JCypher combines two ore more successive clauses of the same type into one cypher clause. Like two or more successive JCypher RETURN clauses are combined to one cypher RETURN statement.
If you don't want this behaviour, you can use a
SEPARATE.nextClause(),

in between (like shown above).
I hope that helps, best regards,
Wolfgang

Hi Wolfgang,
thanks for reply, my question was a bit more about considering of being able to do:
RETURN.DISTINCT(),
RETURN.value(n.property("name")).AS(name),
RETURN.value(m.labels()).AS(labels)

also using this thread for slight off top:

Generally, JCypher combines two ore more successive clauses of the same type into one cypher clause.

Is there any reason that such approach is not applied to WHERE so i.e. anding following WHERE defined in give clauses list.
cheers,
Krzysztof


Split SolutionImprovementThresholds into two types.

Currently, this type reads:
https://github.com/paritytech/substrate/blob/07d8c9d50cf5b8f92d04e134b8504167313b8d44/frame/election-provider-multi-phase/src/lib.rs#L587-L590
and the problem is in that any phase. For technical reasons beyond the scope of this issue, we want to be able to define SolutionImprovementThresholds, with the exact same semantic, for the different Signed and Unsigned phases. So, we would break this type into two types.
I think the logic change will be trivial. Some tests should be altered or added to demonstrate what the two configs do.
Companion should set the Signed variant to Default::default, and keep the old SolutionImprovementThresholds for unsigned.

@georgesdib interested?

Yes I am, please assign it to me, I will take a look.


Android performance: CPU affinity

System information

Mobile device: Xiaomi A2 (8 core)
TensorFlow installed from (source or binary): source
TensorFlow version (use command below): master at [6cf83ea] (2019/06/17)

Describe the current behavior
The benchmark_model that we run on the device performs very differently when we choose CPU affinity. E.g. average inference time (32 bit, CPU only) for our custom .tflite model is 172ms for taskset=ff, 143ms for taskset=f0, and 281ms taskset=0f. We used num_threads=8, i.e. much more threads that we have cores available. When we increase num_threads=12, inference time further decreases. The change of min times is even more impressive: 125ms for ff, 114ms for f0, and 211ms for 0f. And 105ms for f0 with 12 threads, i.e. 3 threads per CPU. Further increasing num_threads does not deliver visible improvements.
Note that we have no control on the actual number of threads used by interpreter->Invoke(), and their CPU affinity.
Describe the expected behavior
I would expect the interpreter to choose the optimal threading model. The document reads:

Reducing variance between runs on Android.
When running benchmarks on these phones there can be significant variance between different runs of the benchmark.

While benchmarks are nice, our real necessity is to run TFLite optimally in our app. But we cannot control thread CPU affinity or the interpreter?
But even if we could setup the interpreter threading configuration beyond the generic "Set the number of threads available to the interpreter",  across multiple devices, choosing the optimal taskset is beyond the capabilities of most development teams. This cannot be done by analyzing the cpuinfo: on our A2 development phone, all 8 cores are declared equal:
Processor       : AArch64 Processor rev 4 (aarch64)
processor       : 0
BogoMIPS        : 38.40
Features        : fp asimd evtstrm aes pmull sha1 sha2 crc32
CPU implementer : 0x51
CPU architecture: 8
CPU variant     : 0xa
CPU part        : 0x801
CPU revision    : 4

processor       : 1
BogoMIPS        : 38.40
Features        : fp asimd evtstrm aes pmull sha1 sha2 crc32
CPU implementer : 0x51
CPU architecture: 8
CPU variant     : 0xa
CPU part        : 0x801
CPU revision    : 4

processor       : 2
BogoMIPS        : 38.40
Features        : fp asimd evtstrm aes pmull sha1 sha2 crc32
CPU implementer : 0x51
CPU architecture: 8
CPU variant     : 0xa
CPU part        : 0x801
CPU revision    : 4

processor       : 3
BogoMIPS        : 38.40
Features        : fp asimd evtstrm aes pmull sha1 sha2 crc32
CPU implementer : 0x51
CPU architecture: 8
CPU variant     : 0xa
CPU part        : 0x801
CPU revision    : 4

processor       : 4
BogoMIPS        : 38.40
Features        : fp asimd evtstrm aes pmull sha1 sha2 crc32
CPU implementer : 0x51
CPU architecture: 8
CPU variant     : 0xa
CPU part        : 0x800
CPU revision    : 2

processor       : 5
BogoMIPS        : 38.40
Features        : fp asimd evtstrm aes pmull sha1 sha2 crc32
CPU implementer : 0x51
CPU architecture: 8
CPU variant     : 0xa
CPU part        : 0x800
CPU revision    : 2

processor       : 6
BogoMIPS        : 38.40
Features        : fp asimd evtstrm aes pmull sha1 sha2 crc32
CPU implementer : 0x51
CPU architecture: 8
CPU variant     : 0xa
CPU part        : 0x800
CPU revision    : 2

processor       : 7
BogoMIPS        : 38.40
Features        : fp asimd evtstrm aes pmull sha1 sha2 crc32
CPU implementer : 0x51
CPU architecture: 8
CPU variant     : 0xa
CPU part        : 0x800
CPU revision    : 2

Hardware        : Qualcomm Technologies, Inc SDM660

Maybe I am missing something, but I see here no clue that the performance of f0 will be so much different from 0f.
The dynamic optimization should be performed once in a while, because the load on the device may change, either in the same process, or because of other processes/apps running along our app.
It could be useful to persist these findings, so that next time interpreter starts, it could have a reasonable starting point. I am not sure if this info is relevant for specific .tflite model, or for any model. In our experiments, the we only used similar FCNN networks, and their performance was effected by taskset just the same.

If you check cpuinfo carefully, you can find that processors 0-3 and processor 4-7 are different.
For 0-3,
CPU part        : 0x801
CPU revision    : 4

For 4-7,
CPU part        : 0x800
CPU revision    : 2

Modern cell phone SoCs tend to have 2 or more clusters. All processors use the same ISA, but different cluster may have different properties, e.g., one cluster for power-efficiency and the other for computation performance. This is what called big.LITTLE by ARM.

Ok, so without running the benchmark on a specific device, we can know how to choose the performant CPU mask. But what is the recommended way to apply this when it happens in our Android app?

Nope, not all devices are created equal. There can be more than 2 clusters and there are different kinds of big and LITTLE cores. There could be different scheduling and cpufreq policies. It's complicated. I guess there is no general recommended way to choose number of threads that can be applied to all phones.

I guess I didn't ask the right question. Let me try again. Even if I know the optimal settings for this specific device, how can I regulate CPU affinity of inference threads?

in Java? as far as I can remember, there is not such API. In C, the sched_setaffinity(2) system call should work.

So, essentially you suggest to run tflite in a dedicated process. This may be a very cool way to set it up, but IPC overhead may outweigh performance gains.

One thing to note is that is that our legacy, multi-threaded floating point kernels are notoriously sensitive to unpinned execution, and generally work poorly with Android's thread scheduler.
We've been working on a new gemm backend which largely resolves this, and works much better with the native Android scheduler. If you build benchmark_model from head, and build against arm64 (--config=android_arm64), you should see this when running benchmarks both from the command-line as well as in your app (particularly when using multi-threading). We're preparing a blog post about this new backend.


pkg/srv: fix error checks from resolveTCPAddr

So that 'terr' can be returned later.

lgtm thanks

Codecov Report

:exclamation: No coverage uploaded for pull request base (master@386374a). Click here to learn what that means.
The diff coverage is 0%.

@@            Coverage Diff            @@
##             master    #7913   +/-   ##
=========================================
  Coverage          ?   75.62%
=========================================
  Files             ?      336
  Lines             ?    26390
  Branches          ?        0
=========================================
  Hits              ?    19957
  Misses            ?     4996
  Partials          ?     1437

Impacted Files
Coverage Δ

pkg/srv/srv.go
70% <0%> (ø)

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 386374a...3505c25. Read the comment docs.


Feedback page

Adds a feedback tab with embedded feedback Google Form and a Report a Bug form
Fixes #244

Hold on bug form form now. Let's ship with this text in "Report a Bug" section:
If you would like to report a bug you are encountering when using the tool, please email<EMAIL_ADDRESS>or log the issue directly at Github.


[CI]: Nightly csharp verification test fails on mac / arm

Describe the bug, including details regarding any error messages, version, and platform.
This runner is a self hosted runner and the port 5001 is in use already.
Component(s)
C#

Duplicate of https://issues.apache.org/jira/browse/ARROW-16795


[teams voicemail] Is there support of graph API to get Users Voice Email from teams?

Description:
Looking to find out if there is a support for voicemail in graph APIs
To Reproduce
Make sure voicemail is setup for the tenant
Login as Adele Vance, try to call Alex Wilber who should be offline, make sure you hit voicemail.
Login as Alex Wilber and check Calls module, you will notice a voicemail record. The user can plan the voice mail.
Document reference below
https://support.microsoft.com/en-us/office/check-your-voicemail-in-teams-f8d568ce-7329-4fe2-a6a2-325ec2e2b419
Attachments
NA
Desktop (please complete the following information):
OS: [Mac]
Browser [chrome, safari, edge]

We are checking the issue. We will respond back shortly.

@raguravindran - There doesn't seem to be any API available to get user voice email from Teams using Graph API.
To achieve your requirements, we recommend you give your feedback in Teams Feedback Portal.


Drop subclassing support

[x] Document that subclassing isn't supported.
[x] Drop the subclassing testsuite.
[x] Drop the subclassing support.
[x] Rename Vector2 to Vector.
Avoid breaking backwards-compatibility by adding a Vector2 alias.
[x] Rename vector2.py to vector.py.

Closes #144 (this is an alternative proposal)

I will measure the (hopefully positive) performance impact tomorrow  :)

Is there a reason to not just rename vector.py to __init__.py?

@nbraud

@astronouth7303 I have no particular opinion one way or another, I didn't particularly want to add extra changes, but I can easily do that.

@astronouth7303 Done.

bors r+


Unified Call Syntax

You can see it here. I've seen it in some new languages, and I think it fits perfectly into Zig. Also, it allows adding functions that operate on any type after declaring all their members: just put it as the first argument.
glfwSetKeyCallback(window, key_callback);    // Meh
window.glfwSetKeyCallback(key_callback);     // Nice!

struct TwoNumbers {
    x: i32,
    y: i32,

    pub fn add() -> i32 {
        return x + y;
    }
}

// Simple and clean!
pub fn sub(self: TwoNumbers) -> i32 {
    return self.x - self.y;
}

It's not clear how this would fit into Zig.
Zig does not have overloading (and almost certainly won't in the future), so a function named sub would need to be in an appropriate namespace to not clash with other functions with the same name.
In another file, to import this, assuming the file was called "math.zig" you would do:
const math = @import("math.zig");
fn f() {
    const v = TwoNumbers {.x = 1, .y = 2};
    math.sub(v);
}

With your UFCS proposal you could perhaps do:
const math = @import("math.zig");
const sub = math.sub;
fn f() {
    const v = TwoNumbers {.x = 1, .y = 2};
    v.sub();
}

Or maybe using the use keyword as currently exists:
use @import("math.zig");
// now `sub` is in the current namespace

But then you wouldn't be able to import sub from another import:
use @import("vector.zig");
// might cause error because `sub` is defined twice.

Versus if you had this:
struct Vector {
    x: i32,
    y: i32,
    pub fn sub(self: Vector, other: Vector) -> Vector {
        Vector {.x = self.x - other.x, .y = self.y - other.y}
    }
}
struct TwoNumbers {
    x: i32,
    y: i32,
    pub fn sub(tn: TwoNumbers) -> i32 {
        tn.x - tn.y
    }
}

Here we have two implementations of sub and it's fine because they're namespaced to the structs they reside in.
Further, putting the function in the struct works conveniently for generic programming:
struct Vector(T: type) {
    x: T,
    y: T,
    pub fn sub(self: Vector(T), other: Vector(T)) -> Vector(T) {
        Vector(T) {.x = self.x - other.x, .y = self.y - other.y}
    }
}

It's not clear how this would work without being in the scope of the struct.
Side note about the use declaration, I'm considering removing it in favor of having to be explicit about all imported things so that when reading code you can always know where imports came from.

I'm not convinced that extension methods are worthwhile.
There are two main arguments I can find in favor of extension methods: chaining extension methods like a.foo().bar().baz() instead of baz(bar(foo(a))), and IDE dot completion.
I'm not sure how useful chaining extension methods will be in Zig for a number of reasons like: no garbage collector, and no OOP (at least yet). (Remember that Zig already has method syntax for methods declared inside the struct; this proposal allows method syntax for "third-party" methods.) I feel like where extension methods really shine in C# is when you extend IEnumerable<T> or some other interface with functions that naturally follow from the interface's definition, like TakeFirst. Since Zig doesn't have interfaces, there's a big chunk of the benefit lost right there.
Regarding IDE dot completion, I'm generally in favor of catering to IDE's (even if they don't exist yet), but I'm not sure this is really the right approach to that problem. Extension method syntax will enable you to discover a certain class of method, which is cool I guess. But the cost seems pretty high.
I can't get past the idea that UFC would allow you to write u32(60).syscall1(0), which just makes no sense at all. syscall1 is certainly not a method of the type u32, and the ability to write code like this would make Zig a little bit worse of a language.
So is this feature worth this cost? I'm not convinced.

Responding to @thejoshwolfe here instead of #427 since it's more related to UFCS.  For reference I'm providing an example where "chaining extension methods" helps readability:
print(raiseToThePowerOf( plus( filterIfGreaterThan(someList, 3), 10 ), 2), stdout)

With UFCS you could write this as:
someList.filterIfGreaterThan(3).plus(3).raiseToThePowerOf(2).print(stdout)

I'm including the proposed prefix annotation which is another solution to this problem.  Note that this proposal is just a concept, the chosen syntax is just to demonstrate the idea.
// note the "prefix" annotation on the first argument of these function definitions
pub fn filterIfGreaterThan(prefix r : Range, limit : i32) { ... }
pub fn plus               (prefix r : Range, valueToAdd : i32) { ... }
pub fn raiseToThePowerOf  (prefix r : Range, exponent : i32) { ... }
pub fn print              (prefix r : Range) { ... }

// Possible syntax for providing prefix arguments to a function call: prefixArg > func(normalArgs...)
someList > filterIfGreaterThan(3)

Note that when an argument is marked as prefix, it cannot be passed in like a normal parameter, i.e.
filterIfGreaterThan(someList, 3)  // ERROR: filterIfGreaterThan requires a prefix argument

Since this is an error, it means there is only one way to call the function, so josh's example u32(60).syscall1(0) would result in an error.  With this feature chaining methods would look like this:
someList > filterIfGreaterThan(3) > plus(3) raiseToThePowerOf(2)

How would memory management work for the Range class you're proposing? Can you show me an implementation of plus so I can get a better understanding of your example?
Note that therer's no "default allocator" in Zig, so no new or delete operators and no builtin garbage collector. See here for an example of a class that allocates memory: https://github.com/zig-lang/zig/blob/master/std/array_list.zig
I'm raising this point, because your code example that does map/filter operations on lists looks like it depends on a garbage collector, and Zig doesn't have that.
I think it's important to make big design decisions motivated by more concrete than theoretical usecases, so I'm trying to take your code example pretty seriously here.

Ranges have nothing to do with memory allocation, it's just a set of methods you implement that allows code to know how to work together on a set of data.  There are different kinds of ranges but the most basic is the input range which requires the empty, front and popFront methods.  These are the methods you would call in a for loop like this:
for(; !range.empty(); range.popFront())
{
    auto front = range.front();
    // use front
}

You could use memory allocation in your range but typically all the data is computed lazily and kept on the stack.
I think an example implementation will be better than trying to explain.  I don't have a working zig compiler right now so I've included a C++ implementation that makes use of templates, you could also create one that uses virtual functions and pointer casting, but this one is more efficient since it can inline the entire thing and end up behaving as if you wrote for loops for everything.  I've also included the equivalent in D, which showcases what "template type deduction" gives you and also what it would look like with UFCS.
#include <stdio.h>

template<typename Range>
void printNumbers(Range range)
{
    for(; !range.empty(); range.popFront())
    {
        printf("%d\n", range.front());
    }
}

template<typename T>
struct arrayRange
{
    T* next;
    T* limit;
    arrayRange(T* start, int count) : next(start), limit(start + count)
    {
    }
    bool empty()
    {
        return next >= limit;
    }
    T front()
    {
        return *next;
    }
    void popFront()
    {
        next++;
    }
};

template<typename Range>
struct plus
{
    Range inputRange;
    int valueToAdd;
    plus(Range inputRange, int valueToAdd) : inputRange(inputRange), valueToAdd(valueToAdd)
    {
    }
    bool empty()
    {
        return inputRange.empty();
    }
    int front()
    {
        return inputRange.front() + valueToAdd;
    }
    void popFront()
    {
        inputRange.popFront();
    }
};

template<typename Range>
struct filterIfGreaterThan
{
    Range inputRange;
    int limit;
    filterIfGreaterThan(Range inputRange, int limit) : inputRange(inputRange), limit(limit)
    {
    }
    bool empty()
    {
        for(; !inputRange.empty(); inputRange.popFront())
        {
            if(inputRange.front() <= limit)
            {
                return false;
            }
        }
        return true;
    }
    int front()
    {
        return inputRange.front();
    }
    void popFront()
    {
        inputRange.popFront();
    }
};

int main(int argc, char* argv[])
{
    int integerArray[] = {2, 1, 5, 8, 3};

    printf("Print Numbers:\n");
    printNumbers<arrayRange<int>>(
        arrayRange<int>(integerArray, 5));

    printf("Add 10 to each number and print:\n");
    printNumbers<plus<arrayRange<int>>>(
        plus<arrayRange<int>>(
        arrayRange<int>(integerArray, 5), 10));

    printf("Print original numbers to show they haven't changed:\n");
    printNumbers<arrayRange<int>>(
        arrayRange<int>(integerArray, 5));

    printf("Add 10 to each number then filter any that are greater than 13, then print them\n");
    printNumbers<filterIfGreaterThan<plus<arrayRange<int>>>>(
        filterIfGreaterThan<plus<arrayRange<int>>>(
        plus<arrayRange<int>>(
        arrayRange<int>(integerArray, 5), 10), 13));

    return 0;
}

And here's the D version
import std.stdio;

void printNumbers(Range)(Range range)
{
    // Note: D's foreach loop understand ranges
    foreach(value; range)
    {
        writeln(value);
    }
}

// D already has methods that treat arrays like ranges, but I'm including this to make
// it close to the C++ version.
auto arrayRange(T)(T[] array)
{
    struct _
    {
        T* next;
        T* limit;
        this(T* start, T* limit)
        {
            this.next = start;
            this.limit = limit;
        }
        bool empty()
        {
            return next >= limit;
        }
        T front()
        {
            return *next;
        }
        void popFront()
        {
            next++;
        }
    }
    return _(array.ptr, array.ptr + array.length);
};

auto plus(Range)(Range inputRange, int valueToAdd)
{
    struct _
    {
        Range inputRange;
        int valueToAdd;
        this(Range inputRange, int valueToAdd)
        {
            this.inputRange = inputRange;
            this.valueToAdd = valueToAdd;
        }
        bool empty()
        {
            return inputRange.empty();
        }
        int front()
        {
            return inputRange.front() + valueToAdd;
        }
        void popFront()
        {
            inputRange.popFront();
        }
    }
    return _(inputRange, valueToAdd);
};

auto filterIfGreaterThan(Range)(Range inputRange, int limit)
{
    struct _
    {
        Range inputRange;
        int limit;
        this(Range inputRange, int limit)
        {
            this.inputRange = inputRange;
            this.limit = limit;
        }
        bool empty()
        {
            for(; !inputRange.empty(); inputRange.popFront())
            {
                if(inputRange.front() <= limit)
                {
                    return false;
                }
            }
            return true;
        }
        int front()
        {
            return inputRange.front();
        }
        void popFront()
        {
            inputRange.popFront();
        }
    }
    return _(inputRange, limit);
};

int main(string[] args)
{
    auto integerArray = [2, 1, 5, 8, 3];

    //
    // No UFCS, but with template parameter deduction
    //
    writeln("Print Numbers:");
    printNumbers(arrayRange(integerArray));

    writeln("Add 10 to each number and print:");
    printNumbers(
        plus(
        arrayRange(integerArray), 10));

    writeln("Print original numbers to show they haven't changed:");
    printNumbers(
        arrayRange(integerArray));

    writeln("Add 10 to each number then filter any that are greater than 13, then print them");
    printNumbers(
        filterIfGreaterThan(
        plus(
        arrayRange(integerArray), 10), 13));

    //
    // Now use template parameter deduction AND UFCS
    //
    writeln("Print Numbers:");
    integerArray.arrayRange.printNumbers;

    writeln("Add 10 to each number and print:");
    integerArray.arrayRange.plus(10).printNumbers;

    writeln("Print original numbers to show they haven't changed:");
    integerArray.arrayRange.printNumbers;

    writeln("Add 10 to each number then filter any that are greater than 13, then print them");
    integerArray.arrayRange.plus(10).filterIfGreaterThan(13).printNumbers;

    return 0;
}

Great example! I'll convert all that to zig to see how it looks  with status quo. Standby...

This was in the context of the infix function proposal, which is why it is
in terms of Vecs - they are not the best structures to demonstrate the concept.
I will expand on this later, meanwhile, here are my thoughts.
I've been thinking of how I'd pass arbitrarily typed self parameters to a function,
or a way to signal that the implicit passing of a parameter was expected,
or communicate that a function is acting on a value, similar to what you did with your prefix keyword.
They keyword bound was chosen for illustrative purposes
const Vec2 = struct {
    data: [2]f32,

    // Like a for loop, use a * to get a reference.
    // function bound to `this` ?
    bound fn add(other: &const Vec2) | *self | -> &Vec2 {
        self.data = sum(self, other).data;
        return self;
    }

    bound fn plus(other: &const Vec2)  | self | -> Vec2 {
        sum(self, other)
    }

    pub fn sum(self: &const Vec2, other: &const Vec2) -> Vec2 {
        vec2(self.data[0] + other.data[0], self.data[1] + other.data[1])
    }
}

const a = Vec2.init(1, 2);
const b = Vec2.init(4, 8);
// Namespace call
const c = Vec2.sum(Vec2.sum(a, b), a);
// UFCS
const u = a.sum(b).sum(c);
const m = a.add(b).add(c);
const d = a.plus(b).plus(c);

This led to a sort of trait/impl construct idea, that uses the compile-time duck
typing concept to provide a generic way to access an abitrary struct.
If we provide the type of the self variable, we can compose structures at 'bind' time.
This is like explicitly extending the namespace of a struct, and being able to access
the functions like methods on an instance thanks to UFCS
const Additive = bound struct {
    data: []f32, // Make sure struct being bound to has a field with same name?
                 // Struct field must be implicitly castable to this field type.

    fn add(other: &const T) | *self, T | -> &T {
        // Provide implementation
        for (self.data) | d, i | {
            self.data[i] += other.data[i];
        }
        return self;
    }

    fn plus(other: &const T)  | self, T | -> T {
        // Or use existing
        // Duck-typing: works if T namespace has fn sum(&const T, &const T) -> T
        T.sum(self, other)
    }
}

const Vec3 = struct {
    data: [3]f32,

    pub fn sum(self: &const Vec2, other: &const Vec2) -> Vec2 {
        vec3(
            self.data[0] + other.data[0],
            self.data[1] + other.data[1],
            self.data[2] + other.data[2]
        )
    }
}

const a = #Vec3(Additive).init(1, 2, 6);
const b = #Vec3(Additive).init(4, 8, 6);

// Namespace call, a and b are still Vec3's
const c = Vec3.sum(Vec3.sum(a, b), a);

// UFCS with namespace and extension functions.
const d = a.sum(b).sum(c);
const e = a.add(b).add(c);
const f = a.plus(b).plus(c);

And an idea about explicit interfaces, where you basically require that
a struct be extended at bind time with some sort of implementation, but this gets fiddly
const IAdd = struct {
    add: bound fn(other: &const T) | self, T | -> &T,
    plus: bound fn(other: &const T) | self, T | -> T,
}

const Vec4 = struct(IAdd) {
    data: [3]f32,

    pub fn sum(self: &const Vec2, other: &const Vec2) -> Vec2 {
        vec3(
            self.data[0] + other.data[0],
            self.data[1] + other.data[1],
            self.data[2] + other.data[2],
            self.data[3] + other.data[3],
        )
    }
}

// Composed structs
const Vec4T = #Vec4(Additive);

const _ = Vec3.init(1, 2, 6); // Fine
const _ = Vec4.init(1, 2, 6, 8); // Error: must bind an IAdd

const a = Vec4T.init(1, 2, 6, 8); // Works, Additive provides IAdd funcs
const b = #Vec4(Additive).init(1, 3, 5, 7)

// Namespace call, a and b are still Vec4's
const c = Vec4.sum(Vec4.sum(a, b), a);

// UFCS with namespace and extension functions.
const d = a.sum(b).sum(c);
const e = a.add(b).add(c);
const f = a.plus(b).plus(c);

const x = c.plus(a).plus(b); // c has not had Additive bound to it, so does not have plus?
const y = c.sum(a).plus(b); // c.sum(a) makes a @typeOf(c) which doesn't have Additive, so fails?

To follow up my earlier comment, I determined that the Range code example is what I would call filter iterators, which are definitely possible without unified call syntax. Here's an actual real example of me using filter iterators in C++, and UFCS is not an issue.
Can we come up with an actual real example where UFCS would be good? I see lots of discussion about vectors, but that's an example of where you can use status-quo method call syntax, so UFCS is not relevant there.

I was actually under the impression status quo was UFCS. I was using it as an example of how status quo was good. Perhaps I should annotate my comments to make that clear.

I didn't read the entire pdf in the OP, and the poster seems to have lost interest, so I'll state these definitions for the sake of discussion:

Method syntax (status quo): Declare methods in a struct, then you can call them with object.method() or Struct.method(object).
Extension methods: Declare methods outside of a struct definition with special notation that designates them as being usable as extension methods. Example above. Calling it still looks like object.method().
Unified Function Call Syntax: All functions are usable as extension methods. This would enable u32(60).syscall1(0).


Add user customized menu id mid

Users can add a mid to each menu item to identify which menu item is clicked/touched.
For example, in the HelloWorld.vue
menu: [
  { mid: "new_file", name: "New File", iconSlot: "file" },
  { mid: "new_win", name: "New Window", iconSlot: "window" },
  { mid: "open_file", name: "Open File", iconSlot: "folderopen" },
]

When handleSelected event, the mid is included in the return object:
const handleSelected = (item) => {
    console.log(item);
};

When clicking "New File", it will show { pmid: "new_file",  name: "New File", path: ...}.
I hope this can be helpful to address issue #61 and #62

@huanhe4096 thanks for opening the PR. just curious why we need a special mid attribute. which menu item is clicked/touched can be detected even without that

@huanhe4096 thanks for opening the PR. just curious why we need a special mid attribute. which menu item is clicked/touched can be detected even without that

Hello! For most of time, I think the existing attributes are good enough. The need for mid in our case is that our PM often change the menu name and structure ... for example, move "File>Settings" to "Edit>Preferences", or move "Help>About us" to "Icon>About" ... so we want to keep this appearance changing away from the actual function implementation, although it's not a big change.


[Request] Enable support for GPT3.5, 4, and 4 with 32K token limit

As described in the title, it would be great if you could add support for these models as well as they are becoming more widely available!

same here


[BEAM-10937] Tour of Beam use FileSystems for I/O

Use Beam FileSystems for I/O to support multiple file systems instead of plain open.
There's a lot of spam in the diffs, but the changes are mostly:

Change code snippets to use FileSystems.open and FileSystems.create along with converting to/from bytes.
Add a small description of why using them instead of just open.
Ran the whole notebook again to refresh the cell outputs.

R: @aaltay
Staged: https://colab.research.google.com/github/davidcavazos/beam/blob/tour-of-beam-reading-filesystems/examples/notebooks/tour-of-beam/reading-and-writing-data.ipynb

Thank you for your contribution! Follow this checklist to help us incorporate your contribution quickly and easily:

[ ] Choose reviewer(s) and mention them in a comment (R: @username).
[ ] Format the pull request title like [BEAM-XXX] Fixes bug in ApproximateQuantiles, where you replace BEAM-XXX with the appropriate JIRA issue, if applicable. This will automatically link the pull request to the issue.
[ ] Update CHANGES.md with noteworthy changes.
[ ] If this contribution is large, please file an Apache Individual Contributor License Agreement.

See the Contributor Guide for more tips on how to make review process smoother.

GitHub Actions Tests Status (on master branch)

See CI.md for more information about GitHub Actions CI.

Hi @udim, friendly ping on reviewing this :)

@udim friendly ping on this.


Unstable Magnetometer Readings

Hi Brian,
Thank you for the library first of all, it really helps me to speed the things up.
I'm planning to use the MPU-9250 to implement a tilt-compensated compass for my project. Prior to any calibration, I decided to run a quick test on my MPU-9250. Everything appeared to be fine, I can easily read valid data from both gyro and acce, which indicates my circuit connection is correct. However, the magnetometer's  (AK8963) readings looks like a mess. I just kept getting unstable results even I put the module on a flat surface and didn't move it.
I calculated the headings of my device using just the readings from the magnetometer and the error went up to 5 degrees... That is really terrible, under the same test setup, my HMC5883L (calibrated) only gives me 0.8 degrees of error...
heading = atan2(mpu.mag_data[1], mpu.mag_data[0]) * 180 / PI ;
I therefore compared the tri-axis readings between AK8963 and HMC5883L, it seems that the readings from AK8963 fluctuate more wildly than the one from HMC5883L. So I'm wondering if I've missed some critical steps or it is just the limitation of AK8963? And I would really appreciate if you can give me some hints on how I can make these measurements out of sense.
Cheers

Yes the ak8369 is known to be worse than most other magnetometers.
On 18 Jul 2016 6:32 PM, "xmlms"<EMAIL_ADDRESS>wrote:

Hi Brian,
Thank you for the library first of all, it really helps me to speed the
things up.
I'm planning to use the MPU-9250 to implement a tile-compensated compass
for my project. Prior to any calibration, I decided to run a quick test on
my MPU-9250. Everything appeared to be fine, I can easily read data from
both gyro and acce, which indicates my circuit connection is correct.
However, the magnetometer's (AK8369) readings looks like a mess. I just
kept getting unstable results even I put the module on a flat surface and
didn't move it.
I calculated the headings of my device using just the readings from the
magnetometer and the error went up to 5 degrees... That is really terrible,
under the same test setup, my HMC5883L (calibrated) only gives me 0.8
degrees of error...
heading = atan2(mpu.mag_data[1], mpu.mag_data[0]) * 180 / PI ;
I therefore compared the tri-axis readings between AK8369 and HMC5883L, it
seems that the readings from AK8369 fluctuate more wildly than the one from
HMC5883L. So I'm wondering if I've missed some critical steps or it is just
the limitation of AK8369? And I would really appreciate if you can give me
some hints on how I can make these measurements out of sense.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/brianc118/MPU9250/issues/9, or mute the thread
https://github.com/notifications/unsubscribe-auth/AEj69Ks7aj3Fhd4PCovKQiHgpgh3jqBrks5qWzo4gaJpZM4JOgNN
.


RequestError: Error:  getaddrinfo ENOTFOUND

CODE:
const functions = require('firebase-functions');
const admin = require('firebase-admin');
const request = require('request-promise');
admin.initializeApp(functions.config().firebase);
exports.webhook = functions.database.ref('/users/{uid}/status').onWrite(event => {
  const status = event.data.val();

  return request({
    uri: 'http://website.com/page.php',
    method: 'POST',
    json: true,
    body: status,
    resolveWithFullResponse: true
  }).then(response => {
    if (response.statusCode >= 400) {
      throw new Error('HTTP Error: '+response.statusCode);
    }
    console.log('SUCCESS! Posted', response);
  });

});
FIREBASE LOG ERROR
RequestError: Error: getaddrinfo ENOTFOUND website.com website.com:80
at new RequestError (/user_code/node_modules/request-promise/node_modules/request-promise-core/lib/errors.js:14:15)
at Request.plumbing.callback (/user_code/node_modules/request-promise/node_modules/request-promise-core/lib/plumbing.js:87:29)
at Request.RP$callback [as _callback] (/user_code/node_modules/request-promise/node_modules/request-promise-core/lib/plumbing.js:46:31)
at self.callback (/user_code/node_modules/request/request.js:188:22)
at emitOne (events.js:96:13)
at Request.emit (events.js:188:7)
at Request.onRequestError (/user_code/node_modules/request/request.js:884:8)
at emitOne (events.js:96:13)
at ClientRequest.emit (events.js:188:7)
at Socket.socketErrorListener (_http_client.js:310:9)
at emitOne (events.js:96:13)
at Socket.emit (events.js:188:7)
at connectErrorNT (net.js:1020:8)
at _combinedTickCallback (internal/process/next_tick.js:74:11)
at process._tickDomainCallback (internal/process/next_tick.js:122:9)

Come to find out i was getting this error ONLY because i was testing from a non-paid account.  Works on Blaze account.

I just encounter the same problem of you. If you had figured it out? I have no any idea, just see a hint in one example:
TODO: Make sure you create your own Request Bin and change this URL to try this sample


ARM API returns wrong endpoints for Synapse Workspaces when querying Sql Servers

Library name and version
N/A
Describe the bug
When looking up SQL Server resources via a REST call, using the query "where type == microsoft.sql/servers", any Synapse Servers returned have an incorrect endpoint that does not work when trying to connect to it.
linked issue here: https://github.com/microsoft/azuredatastudio/issues/20180
Expected behavior
The entry for the returned Synapse Workspace from the microsoft.sql/servers resource API call should have the endpoint:
.azuresynapse.net or similar (in our case, it is .sql.azuresynapse.net)
Actual behavior
The entry for the returned Synapse Workspace from the API call is instead this:
.database.windows.net
which is correct for general SQL servers, but it is not valid for Synapse Workspaces.
Reproduction Steps
Add arm-resourcegraph node module to a project.
Attempt to make a resources query call using the query posted above.
See the returned server result objects and its fully qualified domain name properties, ones for any Synapse Workspaces will be incorrect.
Environment
No response

Hi @smartguest.  Thank you for reaching out and we regret that you're experiencing difficulties.  Unfortunately, this repository is focused on the Azure SDK for .NET - we're unable to assist with other Azure issues.  Since what you're describing appears to be related to the REST API of the service itself and not one of the SDKs, your best path forward would be to open an Azure support request.
I'm going to close this out; if I've misunderstood what you're describing, please let us know in a comment and we'd be happy to assist as we're able.


Can't test the front-end using testing library

I've been configuring jest-cucumber to set it up in my project (NextJS), however, I realized that jest-cucumber just work if I set up Jest with -> testEnvironment="Node".
It works if I just test mathematical functions, however, in case I try to render some React components, it just crashes.
I'm wondering if jest-cucumber has been developed for server side and not for the front-end.
Here the output and my setup:
Jest config:

jest-cucumber setup file (without it, the test fails as well):

The test example using React Testing Library:

The output of the test:

<> - I installed all the main packages such as ts-jest, etc to transform the main files.
<> - I'm using some testing tools besides jest-cucumber such as Jest and React Testing Library.
Thanks for the help

** Update ** You can use the package called "jsdom-global" so you can render a dom in nodejs You just have to require it in every test since Jest has to be configured to use "Node" as testEnvironment

Do you have an example? I've tried to require it but it's still not working for me