Newline is missing in "write_env_script" emitted shell scripts

brew config output
HOMEBREW_VERSION: 3.5.2-156-gf1d04b4
ORIGIN: https://github.com/Homebrew/brew
HEAD: f1d04b4c3dd194265d59751b90f815714058d19b
Last commit: 21 hours ago
Core tap ORIGIN: https://github.com/Homebrew/homebrew-core
Core tap HEAD: 752c412a771cdfcdb2ff2f57f94f83660cf3af67
Core tap last commit: 51 minutes ago
Core tap branch: master
HOMEBREW_PREFIX: /opt/homebrew
HOMEBREW_CASK_OPTS: []
HOMEBREW_MAKE_JOBS: 10
Homebrew Ruby: 2.6.8 => /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/bin/ruby
CPU: 10-core 64-bit arm_firestorm_icestorm
Clang: 13.1.6 build 1316
Git: 2.36.1 => /opt/homebrew/bin/git
Curl: 7.79.1 => /usr/bin/curl
macOS: 12.4-arm64
CLT: <IP_ADDRESS>.1.1651278267
Xcode: 13.4.1
Rosetta 2: false

brew doctor output
homebrew$ brew doctor
Please note that these warnings are just used to help the Homebrew maintainers
with debugging if you file an issue. If everything you use Homebrew for is
working fine: please don't worry or file an issue; just ignore this. Thanks!

Warning: Some installed kegs have no formulae!
This means they were either deleted or installed manually.
You should find replacements for the following formulae:
  xdk

Verification

[X] I ran brew update and am still able to reproduce my issue.
[X] I have resolved all warnings from brew doctor and that did not fix my problem.

What were you trying to do (and why)?
I was trying to use write_env_script with Language::Java.overridable_java_home_env to produce a script that would be able to invoke Java. The Java executable is located at $JAVA_HOME/bin/java. The write_env_script method creates a script that (correctly) hard-codes a default location for $JAVA_HOME, so I used that $JAVA_HOME variable in the command that I asked write_env_script to use in the script it created.
What happened (include all command output)?
I run brew test on a formula, and it creates a shell script, and that shell script fails -- but only in brew test, where there is no $JAVA_HOME variable!
homebrew$ brew test xdk
==> Testing xdk
==> /opt/homebrew/Cellar/xdk/0.4.2/bin/xec -help
Last 15 lines from /Users/cameron/Library/Logs/Homebrew/xdk/test.01.xec:
2022-06-25 14:49:37 -0400

/opt/homebrew/Cellar/xdk/0.4.2/bin/xec
-help

/opt/homebrew/Cellar/xdk/0.4.2/bin/xec: line 2: /bin/java: No such file or directory
/opt/homebrew/Cellar/xdk/0.4.2/bin/xec: line 2: exec: /bin/java: cannot execute: No such file or directory
Error: xdk: failed
An exception occurred within a child process:
  BuildError: Failed executing: /opt/homebrew/Cellar/xdk/0.4.2/bin/xec -help
/opt/homebrew/Library/Homebrew/formula.rb:2296:in `block in system'
/opt/homebrew/Library/Homebrew/formula.rb:2232:in `open'
/opt/homebrew/Library/Homebrew/formula.rb:2232:in `system'
/opt/homebrew/opt/xdk/.brew/xdk.rb:21:in `block in <class:Xdk>'
/opt/homebrew/Library/Homebrew/formula.rb:2096:in `block (3 levels) in run_test'
/opt/homebrew/Library/Homebrew/utils.rb:601:in `with_env'
/opt/homebrew/Library/Homebrew/formula.rb:2095:in `block (2 levels) in run_test'
/opt/homebrew/Library/Homebrew/formula.rb:938:in `with_logging'
/opt/homebrew/Library/Homebrew/formula.rb:2094:in `block in run_test'
/opt/homebrew/Library/Homebrew/mktemp.rb:63:in `block in run'
/opt/homebrew/Library/Homebrew/mktemp.rb:63:in `chdir'
/opt/homebrew/Library/Homebrew/mktemp.rb:63:in `run'
/opt/homebrew/Library/Homebrew/formula.rb:2347:in `mktemp'
/opt/homebrew/Library/Homebrew/formula.rb:2088:in `run_test'
/opt/homebrew/Library/Homebrew/test.rb:43:in `block in <main>'
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/timeout.rb:93:in `block in timeout'
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/timeout.rb:33:in `block in catch'
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/timeout.rb:33:in `catch'
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/timeout.rb:33:in `catch'
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/timeout.rb:108:in `timeout'
/opt/homebrew/Library/Homebrew/test.rb:48:in `<main>'

What did you expect to happen?
I expected brew test to work. The shell script emitted by write_env_script appears at first glance to be correct, in that it could not possibly allow $JAVA_HOME to be blank:
#!/bin/bash
JAVA_HOME="${JAVA_HOME:-/opt/homebrew/opt/openjdk/libexec/openjdk.jdk/Contents/Home}" exec "${JAVA_HOME}/bin/java" ... "$@"

(I replaced the args with ...)
-- details --
(Note that the brew doctor result only lists the one formula that I am explicitly building locally from source, in order to show this one issue.)
I have been testing and refining an Homebrew Formula for the past several weeks. At the suggestion of a Homebrew contributor @SMillerDev (thanks for the help 😊), I altered my Formula to use the method write_env_script, with Language::Java.overridable_java_home_env for the environment.
On my Mac M1, and in the Homebrew CI environment, this produces a 100% reproducible bug. Specifically, the script that is emitted by path.write_env_script cmd, args, Language::Java.overridable_java_home_env is:
#!/bin/bash
JAVA_HOME="${JAVA_HOME:-/opt/homebrew/opt/openjdk/libexec/openjdk.jdk/Contents/Home}" exec "cmd" args "$@"

(Note: The /opt path is obviously specific to my machine, and cmd and args are replaced with the values thereof.)
The code that produces this script is very simple:
write <<~SH
  #!/bin/bash
  #{env_export}exec "#{target}" #{args} "$@"
SH

Trying to find a solution to the error that occurs when I brew test with this script, I discovered that one tiny manual edit to my local script will fix it:
#!/bin/bash
JAVA_HOME="${JAVA_HOME:-/opt/homebrew/opt/openjdk/libexec/openjdk.jdk/Contents/Home}"
exec "cmd" args "$@"

That's it. A newline before the "exec" command. When there is no newline, the exec does not "see" the $JAVA_HOME value that was set immediately to its "left". When there is a newline, the exec does pick up the $JAVA_HOME value that was set immediately above it.
I am not yet integrated well enough into this project to know how to successfully change, build, and do a pull request to fix this. My biggest concern is that I would fix it for my own machine and for the various M1 CI instances that are used by the Homebrew project, but I might accidentally break some other environment. After all, it seems like this was quite purposefully munged into a single line, but for what reason I am at a loss to explain.
I think that this is the fix, but I don't know the Ruby SH DSL being used here:
write <<~SH
  #!/bin/bash
  #{env_export}
  #exec "#{target}" #{args} "$@"
SH

I wanted to capture what I had found, in hopes that it would save someone else from the tremendous frustration that I have been working through. Please do let me know if there's anything else that I can do to help resolve this.
Step-by-step reproduction instructions (by running brew commands)
#write a formula:
#  1) that uses write_env_script with Language::Java.overridable_java_home_env
#  2) that invokes the $JAVA_HOME/bin/java command in the script

# BEGIN EXAMPLE FORMULA xdk.rb
class Xdk < Formula
  desc "Ecstasy Development Kit (XDK)"
  homepage "https://github.com/xtclang/xvm/"
  url "https://github.com/xtclang/xvm/releases/download/v0.4.2/xdk-0.4.2.tar.gz"
  sha256 "b0b5217abf05de986e6211a7c8665b304fa89df1726749e4f1dd7eff1cbbe1fe"
  license "Apache-2.0"

  depends_on "openjdk"

  def install
    libexec.install buildpath.children
    %w[xec xtc xam].each do |cmd|
      java = "${JAVA_HOME}/bin/java"
      #hack fix: java = "${JAVA_HOME:+$JAVA_HOME/bin/}java"
      args = "-Xms256m -Xmx1024m -ea -jar #{libexec}/javatools/javatools.jar" \
             " #{cmd} -L #{libexec}/lib -L #{libexec}/javatools"
      (bin/cmd).write_env_script java, args, Language::Java.overridable_java_home_env
    end
  end

  test do
    system "#{bin}/xec", "-help"
  end
end
# END EXAMPLE FORMULA

#install the formula
$ brew install --build-from-source ~/Development/homebrew-core/Formula/xdk.rb
==> Auto-updated Homebrew!
Updated 1 tap (homebrew/core).

You have 3 outdated formulae installed.
You can upgrade them with brew upgrade
or list them with brew outdated.

Error: Failed to load cask: /Users/cameron/Development/homebrew-core/Formula/xdk.rb
Cask 'xdk' is unreadable: wrong constant name #<Class:0x0000000154a935f8>
Warning: Treating /Users/cameron/Development/homebrew-core/Formula/xdk.rb as a formula.
==> Downloading https://github.com/xtclang/xvm/releases/download/v0.4.2/xdk-0.4.2.tar.gz
Already downloaded: /Users/cameron/Library/Caches/Homebrew/downloads/babd7df05adec94deecb91a3de900860451be0dba2738519c2be5d205d55554a--xdk-0.4.2.tar.gz
🍺  /opt/homebrew/Cellar/xdk/0.4.2: 32 files, 5.6MB, built in 1 second
==> Running `brew cleanup xdk`...
Disable this behaviour by setting HOMEBREW_NO_INSTALL_CLEANUP.
Hide these hints with HOMEBREW_NO_ENV_HINTS (see `man brew`).

#check obvious stuff (no problems)
$ brew test xdk
==> Testing xdk
==> /opt/homebrew/Cellar/xdk/0.4.2/bin/xec -help
$ brew audit --strict --online xdk

#use the script (no problems)
$ xec
Error: Module file required

#test the formula (fails)
$ brew test xdk
==> Testing xdk
==> /opt/homebrew/Cellar/xdk/0.4.2/bin/xec -help
Last 15 lines from /Users/cameron/Library/Logs/Homebrew/xdk/test.01.xec:
2022-06-25 14:49:37 -0400

/opt/homebrew/Cellar/xdk/0.4.2/bin/xec
-help

/opt/homebrew/Cellar/xdk/0.4.2/bin/xec: line 2: /bin/java: No such file or directory
/opt/homebrew/Cellar/xdk/0.4.2/bin/xec: line 2: exec: /bin/java: cannot execute: No such file or directory
Error: xdk: failed
An exception occurred within a child process:
  BuildError: Failed executing: /opt/homebrew/Cellar/xdk/0.4.2/bin/xec -help
/opt/homebrew/Library/Homebrew/formula.rb:2296:in `block in system'
/opt/homebrew/Library/Homebrew/formula.rb:2232:in `open'
/opt/homebrew/Library/Homebrew/formula.rb:2232:in `system'
/opt/homebrew/opt/xdk/.brew/xdk.rb:21:in `block in <class:Xdk>'
/opt/homebrew/Library/Homebrew/formula.rb:2096:in `block (3 levels) in run_test'
/opt/homebrew/Library/Homebrew/utils.rb:601:in `with_env'
/opt/homebrew/Library/Homebrew/formula.rb:2095:in `block (2 levels) in run_test'
/opt/homebrew/Library/Homebrew/formula.rb:938:in `with_logging'
/opt/homebrew/Library/Homebrew/formula.rb:2094:in `block in run_test'
/opt/homebrew/Library/Homebrew/mktemp.rb:63:in `block in run'
/opt/homebrew/Library/Homebrew/mktemp.rb:63:in `chdir'
/opt/homebrew/Library/Homebrew/mktemp.rb:63:in `run'
/opt/homebrew/Library/Homebrew/formula.rb:2347:in `mktemp'
/opt/homebrew/Library/Homebrew/formula.rb:2088:in `run_test'
/opt/homebrew/Library/Homebrew/test.rb:43:in `block in <main>'
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/timeout.rb:93:in `block in timeout'
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/timeout.rb:33:in `block in catch'
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/timeout.rb:33:in `catch'
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/timeout.rb:33:in `catch'
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/timeout.rb:108:in `timeout'
/opt/homebrew/Library/Homebrew/test.rb:48:in `<main>'

#edit the script generated by "write_env_script"
#(just adding a new line before the word "exec")
$ vi /opt/homebrew/Cellar/xdk/0.4.2/bin/xec
#!/bin/bash
JAVA_HOME="${JAVA_HOME:-/opt/homebrew/opt/openjdk/libexec/openjdk.jdk/Contents/Home}"
exec "${JAVA_HOME}/bin/java" -Xms256m -Xmx1024m -ea -jar /opt/homebrew/Cellar/xdk/0.4.2/libexec/javatools/javatools.jar xec -L /opt/homebrew/Cellar/xdk/0.4.2/libexec/lib -L /opt/homebrew/Cellar/xdk/0.4.2/libexec/javatools "$@"

#use the script again to make sure we didn't break it (no problems)
$ xec
Error: Module file required

#brew test the script again to make sure we fixed it (no problems)
$ brew test xdk
==> Testing xdk
==> /opt/homebrew/Cellar/xdk/0.4.2/bin/xec -help

You might want to take a look at write_jar_script instead of write_env_script.
You can also see this post for why the newline is necessary in certain cases.

That's it. A newline before the "exec" command. When there is no newline, the exec does not "see" the $JAVA_HOME value that was set immediately to its "left". When there is a newline, the exec does pick up the $JAVA_HOME value that was set immediately above it.

If you are referencing it within the same line, that correct. It is however works the opposite way round if the variable is being referenced within whatever is being execed. If you want it to work for both, you'd also need to export the ENV.
Though if you are doing this to invoke a jar, I recommend using write_jar_script instead anyway.

@Rylan12 thank you for the advice; that seems likely to be what I need for this, and based on your advice, that is the path that I am working on.

If you are referencing it within the same line, that correct. It however works the opposite way round if the variable is being referenced within the separate executable that is being execed. If you want it to work for both, you'd also need to export the ENV.

@Bo98 Wow! Talks about "I was this many years old when I learned ..."! I guess am no longer surprised when I learn these little corner cases. Based on your comment, write_env_script is supposed to work this way? If that is the case, then this issue is not a bug, but I will take the time (once I get everything working) to come back and add some documentation for the next person who hits this same thing.

write_env_script is supposed to work this way?

Yes.

this issue is not a bug

I believe so.

I will take the time (once I get everything working) to come back and add some documentation for the next person who hits this same thing.

Improvements to documentation are much appreciated.

It sounds like the issue here is resolved so I'm going to close it, but we'd certainly love any documentation improvements you think would be helpful!


Support iPad multitasking in iOS 9

SVProgressHUD uses UIScreen.mainScreen.bounds in some places to layout views on the screen. It should use [UIApplication sharedApplication].keyWindow.bounds instead so that the HUD always displays in the center of the application frame, not the center of the screen. This is particularly important to adapt for iPad multitasking in iOS 9.

Could you please provide a pull request, very good and valid idea.

Note that UIAlertView has the same problem and is deprecated in iOS 9. The alert can be shown offscreen when the app runs in split-screen. UIAlertController doesn't have this problem. Maybe SVProgressHUD should be a presentation UIViewController too. Then it could react to trait collection changes appropriately.

Hello, Did the pull request was created? I came across the same issue plus one more. I replace it with (and the other places)
CGRect frame = [[UIApplication sharedApplication] keyWindow].bounds;
frame = frame.size.width==0?[[UIScreen mainScreen] bounds] : frame;
sharedView = [[self alloc] initWithFrame:frame];
Sometimes if the keyWindow is not in screen yet or is in process of being show, keywindow will return a frame with 0 width and height so it is good idea to check it.

The PR was created and merged.


Dutch in Membership renewal mail

At the English version of the membership renewal mail, all the Preferences are still stated in Dutch

This was fixed back in 2018 already: Inter-Actief/amelie-private@9ac66ba9835435907372a8891ba6b5d43866e010


Issue 137

Summary

Related Issue: https://github.com/bcnmy/scw-contracts/issues/137
Change Type

[ ] Bug Fix
[ ] Refactor
[ ] New Feature
[ ] Breaking Change
[ ] Documentation Update
[ ] Performance Improvement
[ ] Other

Checklist

[ ] My code follows this project's style guidelines
[ ] I've reviewed my own code
[ ] I've added comments for any hard-to-understand areas
[ ] I've updated the documentation if necessary
[ ] My changes generate no new warnings
[ ] I've added tests that prove my fix is effective or my feature works
[ ] All unit tests pass locally with my changes
[ ] Any dependent changes have been merged and published

Additional Information

Branch Naming

Please change the branch name to features/SMA-252-issue-137 or something similar

done. opened another PR https://github.com/bcnmy/scw-contracts/pull/155


Extending this code to other apis

Hi,
I want to extend this codebase to cover other APIs. Though I get the logic to write additional hooks in inject.js, I do not understand the addBreakPoints function in sele-hook.py as it has hardcoded line numbers. What does that mean?
Also, I don't find any hooks for Touch API.

So we first run sele.py to identify the functions we want to place hooks. As paper mentions we only intereseted in api calls made by  functions present in " tracking or non-tracking request call stack". sele.py captures these request call stacks in the request.json file. In sele-hook.py we just put breakpoints for the request call stack functions r.f https://github.com/hadiamjad/Not.js/blob/88969a0ce216c941efdd71de0bea7e2e6e3a945e/sele-hook.py#L75. Harded coded are to make sure extension does not crash, so you can ignore but eventually arr is set in the breakpoints.json file for extension to read. Moreover, Touch.force uses addEventListener function https://developer.mozilla.org/en-US/docs/Web/API/Touch/force  which is already overriden in inject.js. Feel free to reach out on<EMAIL_ADDRESS>and we can schedule a call to help you with this and explain it better.

Feel free to reach out on<EMAIL_ADDRESS>and we can schedule a call to help you with this and explain it better.


[v2 Beta] Bug in Pdo.write when the pdo is linked to a subentry

I think entry = entry[pdo.subIndex]; in pdo.js:138 should be entry = entry[pdo.dataObjects[i].subIndex]; instead.

I'll fix it today, thanks!


Bokeh 0.7.1 release

@samuelcolvin we are planning to have a 0.7.1 release Monday. This is a point release and will not have a huge announcement (no blog, for instance) but certainly some social media pushes. Would you like bokeh.jl to be featured in any of these materials?

thanks for the offer, I'd prefer to wait until I'm ready to release the updated Bokeh.jl as package and then push or wait until the next release of Bokeh after that.
Make sense?

Perfect, I was just checking in. FYI the next release Bokeh 0.8 is tentatively scheduled for mid February. We can certainly mention Bokeh.jl then, but just so you know that release is also expected to have the R bindings announcement.

Sounds good, I should have time before then to get Bokeh.jl polished and ready for a proper release.
Be warned though; Julia's bindings will embarrass anything available in less elegant languages. :smile:

I look forward to it! :D


fix: finished distributed pk feature

ref: https://github.com/cectc/dbpack/issues/42
Ⅰ. Describe what this PR did
Ⅱ. Does this pull request fix one issue?
fix #42
Ⅲ. Why don't you add test cases (unit test/integration test)?
Ⅳ. Describe how to verify it
docker-compose run it on sharding mode, execute go test  test/shd/shardng_test.go
there is a test case to verify insert without PK, and it is set to use "snowflake" uuid generator by default
Ⅴ. Special notes for reviews

Snowflake generator implement follows this, which is the same as xid or bid dose.

Segment method is inspired by Leaf,  but use channel as Cache. we can fetch

1000 or much more IDs to a INT64 channel,  dbpack just take it from channel. It's more simple but also did a good job.

@bohehe @zackzhangkai @wybrobin @zhu733756 PTAL

pls run make fmt to format the code

Codecov Report

Merging #276 (eb81364) into dev (1c353ea) will increase coverage by 0.04%.
The diff coverage is 15.00%.

:exclamation: Current head eb81364 differs from pull request most recent head 5c0e422. Consider uploading reports for the commit 5c0e422 to get more accurate results

@@            Coverage Diff             @@
##              dev     #276      +/-   ##
==========================================
+ Coverage   42.53%   42.57%   +0.04%
==========================================
  Files          90       90
  Lines       10349    10350       +1
==========================================
+ Hits         4402     4407       +5
+ Misses       5472     5466       -6
- Partials      475      477       +2

Impacted Files
Coverage Δ

pkg/cond/algo_number_mod.go
19.53% <0.00%> (-0.47%)
:arrow_down:

pkg/cond/algo_number_range.go
44.24% <0.00%> (-0.82%)
:arrow_down:

pkg/cond/sharding_algorithm.go
0.00% <0.00%> (ø)

pkg/misc/uuid/segment.go
0.00% <0.00%> (ø)

pkg/misc/uuid/snowflake.go
0.00% <0.00%> (ø)

pkg/executor/sharding.go
36.68% <42.85%> (-0.48%)
:arrow_down:

pkg/optimize/optimize_insert.go
64.00% <50.00%> (-0.79%)
:arrow_down:

:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more


Compatibility with Laravel 5.4

Hey there!
I'm trying to set this up with a fresh Laravel 5.4 (latest dev as of today) project, but unfortunately it seems to be creating a Fatal Error after adding the package to my service provider:
  Call to undefined method Illuminate\Foundation\Application::share()

Detailed stacktrace:
https://cl.ly/2U2D1s2O2v1A
Any ideas?
Cheers! :)

Hi,
I've just tagged a version that should be compatible with Laravel 5.4
Run composer update to fix the problem.

Amazing, thanks for the super quick turnaround @freekmurze! 👍
Unfortunately even with 1.1.4 I am getting a different error now:
[ErrorException]
  Illegal offset type in unset

Detailed stacktrace: https://cl.ly/0109383S0X0e

Damn, sucks :)
I'll take a look at this tomorrow.
On Fri, 20 Jan 2017 at 00:09, Joey Kudish<EMAIL_ADDRESS>wrote:

Amazing, thanks for the super quick turnaround @freekmurze
https://github.com/freekmurze! 👍
Unfortunately even with 1.1.4 I am getting a different error now:
[ErrorException]
Illegal offset type in unset
Detailed stacktrace: https://cl.ly/0109383S0X0e
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/spatie/laravel-tail/issues/7#issuecomment-273927903,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAdiDQh4tHh1iTTJNQB4Dt1ClHbSNJQ1ks5rT-0egaJpZM4Loqau
.

--
Freek Van der Herten https://spatie.be +32 495 84 27 91

No problem. Cheers!


"can't fetch location" is it because SDK works only with Beacons?

Thank you for the amazing technology.
I am using the 10 stickers dev kit.
I copied and pasted the app id and Token.
Then pasted some of the sticker's identifier in here:
 let fetchLocationRequest = EILRequestFetchLocation(locationIdentifier: "identiferID")
I was prompted by this error message "can't fetch location".
I think it had to do with JOSN location file and location connection.
can't fetch location: Optional(Error Domain=ESTRequestGetJSONErrorDomain Code=2 "You have no access to requested resource or it doesn't exist." UserInfo={NSLocalizedRecoverySuggestion=Verify if requested resource exists and belong to you., NSLocalizedDescription=You have no access to requested resource or it doesn't exist.})
By the way when I browser the cloud.estimote.com under my nearables
All of their locations is set to: unkown.
If that was the issue, then how do I fix it?

#fixed
indoor location only works wirh beacons.
4 has been maped with proximity app I'd and token from cloud.estimote.
I will provide further instructions if required


explorer only shows up with console.log()

Should always be present

seems to be always present in view JavaScript now


Update cloudflare to 1.1.6

Please update my adapter ioBroker.cloudflare to version 1.1.6.
This pull request was created by https://www.iobroker.dev c0726ff.

RE-CHECK!

RE-CHECK!

encreasing node.js, js-controller or other dependencies requires a MINOR version bump at least.
Please bump at least minor version number for this change to go to stable.


net: tcp: Connection does not properly terminate when connection is lost

Describe the bug
When during a connection, there is no packet traffic possible any more a socket receive call is not unblocked. When a previous send call could not transfer its data, eventually the socket should close down. Actually the following receive call is never unblocked.
To Reproduce
A testcase has been added in:
https://github.com/ssharks/zephyr/tree/net/tcp_interface_down
Run using:
./scripts/twister -T tests/net/socket/tcp -p qemu_x86
Expected behavior
When a socket cannot transfer its data, the OS should decide to close down the socket. This means any pending receive calls on that socket will return with an error.
Impact
When a TCP connection has failed, but is not cleaned up, this could lead to a resource leak and an application stalling.
Environment

OS: Ubuntu 20.04
Target: Qemu x86
Toolchain Zephyr SDK 0.13.2
Commit: the branch https://github.com/ssharks/zephyr/tree/net/tcp_interface_down

@ssharks do you plan to send a PR with the test?

During debugging some once in a while issues I noticed when the cellular connection goes down, the TCP connections are not properly terminated. This can result in an application hang.
The testcase simulates this down connection by midway during the connection throwing away all packets between server and client. A send is done, so the socket can observe there is no way any more to reach to other side. A following recv is expected to eventually return with an error code because the connection is being terminated.
@carlescufi Is this what you where looking after

I think we're mixing up client side and server side errors here. Let's start with the client side:

The connection is established with the server, after what we block any traffic at the loopback interface.
send() call is issued - this call suceeds as we sucesfully queue the data for transmission at the TCP level.
The TCP layer however does not receive ACK for the data it sends, which leads to retransmission and eventually the connection is dropped (https://github.com/zephyrproject-rtos/zephyr/blob/main/subsys/net/ip/tcp.c#L1134)
At the test level, we don't detect that the client-side connection is closed as we're blocked at the server side recv() (https://github.com/ssharks/zephyr/blob/net/tcp_interface_down/tests/net/socket/tcp/src/main.c#L436). If we remove the recv() on the server socket, the recv() on the client socket does return, indicating that the connection is closed (returning 0). This might be something to improve though - I think we should return an error code instead here, as the connection did not really close gracefully. ETIMEDOUT would be a better choice here (according to man pages: ETIMEDOUT - The connection timed out during connection establishment, or due to a transmission  time‐out on active connection.)

Now what happens on the server side:

We accept the connection from the client, which ends up in a new socket being allocated (new_sock)
The test blocks on the recv() call on the new_sock. Now from the server side perspective, nothing happens on the connection (as loopback driver drops all the data), no new packets arrive - so it's perfectly normal that the socket remains blocked. I don't see how retransmission issues on the client socket should affect the server socket - while they are both two ends of the same connection, those are two separate TCP contexts, not aware of each other.

Now the above rises a question - should we implement some kind of idle timeout at the TCP level? I read that this is implemented in Linux, but I'm not sure if there actually any RFC covering the topic, perhaps you know @jukkar? Still, such a idle timeout should rather be considered to be counted in minutes rather than seconds, so it's not really something your test would cover. I'd also consider this as an enhancement not a bugfix.

If the connection is already established, and if the TCP keepalive (https://tldp.org/HOWTO/TCP-Keepalive-HOWTO/overview.html) is disabled, then there is no "idle timeout" in TCP. Both ends can idle and not transmit anything without the connection being dropped in this case.

If the connection is already established, and if the TCP keepalive (https://tldp.org/HOWTO/TCP-Keepalive-HOWTO/overview.html) is disabled, then there is no "idle timeout" in TCP. Both ends can idle and not transmit anything without the connection being dropped in this case.

Ok, so if I understand correctly we should rarher focus on a keep alive implementation to detect dead peers. But that's already covered with https://github.com/zephyrproject-rtos/zephyr/issues/34044, AFAIR there was even a PR but got abandoned.

Perhaps #35318 could be fixed and reused instead of starting from scratch.

Thanks for looking into it properly. Find the replies to the different sections below.

It is good news that the socket is indeed closed by the failed send. This is the intended behavior I was trying to test using this test.

The blocking at server level was not intended. The timeout should have been set at the new_sock instead of the client socket, to pass this section properly. I updated the pull request to fix this.

If I read multiple sources correctly like (https://man7.org/linux/man-pages/man2/recv.2.html) you have the shutdown(SHUT_WR), recv sequence, which indeed return a 0 on a blocking call when the other half of the socket is closed. This actually the behavior the function test_eof checks.
This is different from a timed out receive, because that will return with an -1 and error code EAGAIN.
Based on this it looks the current implementation is correct, I had to just modify the test case to correctly validate this behavior. After modifying the test I do see it passing properly.

This is being tracked in #34044


[BEAM-2074,BEAM-2073] Fixed SourceDStream's rate control usage.

Be sure to do all of the following to help us incorporate your contribution
quickly and easily:

[x] Make sure the PR title is formatted like:
[BEAM-<Jira issue #>] Description of pull request
[ ] Make sure tests pass via mvn clean verify. (Even better, enable
Travis-CI on your fork and ensure the whole test matrix passes).
[x] Replace <Jira issue #> in the title with the actual Jira issue
number, if there is one.
[ ] If this contribution is large, please file an Apache
Individual Contributor License Agreement.

Coverage decreased (-0.003%) to 69.83% when pulling c0e1d9816673fc303c7c86b82195bc61c10f38b7 on staslev:BEAM-2074-2073-fix-SourceDStream-rate-control into b82cd2446fa681576f83bae0fc2bdd1f03be5e7e on apache:master.

Run Spark ValidatesRunner

retest this please.

Coverage decreased (-0.2%) to 69.674% when pulling c0e1d9816673fc303c7c86b82195bc61c10f38b7 on staslev:BEAM-2074-2073-fix-SourceDStream-rate-control into b82cd2446fa681576f83bae0fc2bdd1f03be5e7e on apache:master.

Run Spark ValidatesRunner

R: @aviemzur

Prior to submitting this PR I briefly played around with trying to test it, but could not find an easy way to test things at the level of inspecting rates per individual batches and the likes.
I believe this deserves a separate JIRA so please feel free to file one.

Rebased against #2698.

Run Spark ValidatesRunner

Coverage remained the same at 70.147% when pulling 233668b93abb4187fe1e2b3ba1f79dc577ddec14 on staslev:BEAM-2074-2073-fix-SourceDStream-rate-control into 9f2733ac460ce42d6b3bd49f3db1bacb771ef85c on apache:master.

Run Spark ValidatesRunner

Run Spark ValidatesRunner

Coverage increased (+0.007%) to 70.142% when pulling fcb61ae603ba61ed94bbbe75f4d5c8257eaa1c32 on staslev:BEAM-2074-2073-fix-SourceDStream-rate-control into 254470e626edb6a013ba5cb2d3312dc3bfbdcb51 on apache:master.


Mono editor plugins can't cast non-tool C# types

Godot version: 3.2.stable
OS/device including version: Windows 10 Pro
Issue description:
With the following hierarchy

Game (Control) and ToolGame (Node2D) have their own C# classes with the same names. ToolGame is a [Tool], and makes a GetParent<Game>() call, that works in-game, but fails in-editor with the following error:
 modules/mono/mono_gd/gd_mono_utils.cpp:357 - System.InvalidCastException: Specified cast is not valid.

The same message is shown between 3 and 5 times. The exact same structure and code in Gdscript works as intended.
Steps to reproduce:
Create a scene like the one in the screenshot, and add corresponding classes.
ToolGame.cs contains this minimal code:
using Godot;

[Tool]
public class ToolGame : Node2D
{
    public override void _Ready()
    {
    }

    public override void _Draw()
    {
        var control = GetParent<Control>(); // Fine
        var game = GetParent<Game>(); // InvalidCastException
    }
}

Update from someone on the Discord:

If you have a Tool class, and refer to another class (in your case Game), it won't work unless Game is also a Tool class. If it's not, it appears as it's superclass (i.e. Node/Spatial/etc). Basically the editor has no knowledge of your Game class

And indeed, setting my Game class as a [Tool] "solves" the problem.

This is probably the same issue I was having: #36192
Is there any drawback to marking something as [Tool]?

Yes: separation of concerns. I want my [Tool] classes to exclusively contain code related to the editor, and not mix-and-match game logic and editor logic. That's also why, in my example, I have a child node ToolGame on my Game node

I also encountered this inexplicable prompt. It turned out to be [Tool] problem. Maybe it's better to modify the error message of the prompt .

I realized that the key of problem on the other side was that Godot didn't output the error information of C# completely.
what godot output error info in editor, I can't find useful information from it.:

modules/mono/mono_gd/gd_mono_utils.cpp:357 - System.InvalidCastException: Specified cast is not valid.

Here's the message I got using try-catch, so I can locate the problem in GooOrganism.cs:17 at least:

System.InvalidCastException: Specified cast is not valid.
at (wrapper castclass) System.Object.__castclass_with_cache(object,intptr,intptr)
at Godot.Node.GetNode[T] (Godot.NodePath path) [0x00001] in /root/godot/modules/mono/glue/GodotSharp/GodotSharp/Core/Extensions/NodeExtensions.cs:7
at GooOrganism._Ready () [0x0000a] in D:\GameWorkSpace\xx\godot_project\scene_card\GooOrganism.cs:17

I have a minimal test case that helps reproduce the issue.
CSharpCastTest.zip
I wanted to open a new issue because of this test case.
Can we rename the issue so that it may get proper attention?
Something like "Mono editor plugins can't cast non-tool C# types"

As noted in the duplicate #52729, this can trigger in the default constructors called by the Editor. I saw it with GD.Load<CustomResource>(...). I'm pretty sure this error is caused by the classes not being built/available to the editor. When using [Tool] mode, that means you can't use any class that is not in tool mode. Even more tricky, the default constructors called by Godot to build mono's default objects can throw if also using non-tool mode classes.
There's a chance that the tool classes referring to non-tool classes is actually sorta expected behavior. Tool is meant to say "The editor will need this". Could probably use better errors, though.
The one that seems more questionable to me is the case highlighted in #52729, as classes not marked with Tool are still having their default constructors run by the editor before all the classes are available to it. I have only seen it in custom Resources, though. Pretty sure they are meant to all be marked Tool anyway, since Resources are meant to be used in-editor.
I'm still trying to understand this issue, so sorry if some of that was wrong.

Running into this right now trying to add a button to the inspector for a non-tool class.
I don't think adding [Tool] to classes we want to use from a plugin is an acceptable solution, since that tells the Godot to run the node in the editor (executing _Ready(), _Process(), _Draw() and so on), which is not desirable most of the time. In my case, I have hundreds of such custom nodes and sanitizing them in order to not crash the editor would be a monumental task, not to mention it would make the code dirty with constant checks against Engine.EditorHint.
My particular case:
// Code inside an EditorInspectorPlugin
public override bool CanHandle(Godot.Object @object)
{
    if (@object is MyCustomType) // This fails if MyCustomType doesn't have the [Tool] annotation,
                                 // even if MyCustomType derives from a [Tool] class and even if
                                 // MyCustomType was registered by the plugin using AddCustomType()
        return true;
    // Etc...
    return false;
}

There's a proposal (https://github.com/godotengine/godot-proposals/issues/900) that suggests having a secondary annotation for this purpose (perhaps [Plugin]), but I don't think an annotation should be required at all in order for plugins to see custom types (especially if those types were already registered with AddCustomType()).

I have also encountered this issue just after upgrading to 4.0, in my case, I want to assign a Custom Resource (that is not marked with [Tool]) to a inspector slot from a script that is marked with [Tool]. It was working just fine on 3.5.

I have also encountered and have to work around this. Is there any way for this to be noted in the documents or made clear in the editor?

I also encountered the problem and adding [Tool] solved it. Since I don't use methods like "_Read" or "_Process" process to run my game, the drawback of this solution is not an issue for me. Should still not be required though.

[Tool] Should definitely not be required for a node to be referenced in a plugin. Sometimes you just want to visualize a node in the 3D view like for example a grid or box, whatever, and you don't want these classes to run during the editor for a good reason.
A workaround that doesn't include [Tool] is to load the script and test for that instead of the C# type and then get and set the properties using the variants:
`
private static readonly Script ScriptResource = GD.Load


Slim 3: [ask] Request and Response obj is accessible from route?

Hi,
Just notice that Slim route can actualy work like this.
$app = new Slim\App;

$app->get('/', function () {
    return $this->response->write('Hello, world');
});

$app->run();

Somehow I feel odd with this behaviour, and because slim put the request and response instance in container and bound it to route I don't think we could easly access it from any where.
Should we avoid this? or should we use something like this?
// Slim\Container::registerDefaultServices
if (!isset($this[ServerRequestInterface::class])) {
    /**
     * . . .
     */
    $this[ServerRequestInterface::class] = function ($c) {
        return Request::createFromEnvironment($c->get('environment'));
    };
}

if (!isset($this[ResponseInterface::class])) {
    /**
     * comment . . .
     */
    $this[ResponseInterface::class] = function ($c) {
        $headers = new Headers(['Content-Type' => 'text/html; charset=UTF-8']);
        $response = new Response(200, $headers);

        return $response->withProtocolVersion($c->get('settings')['httpVersion']);
    };
}

any thought?
Best :)

It is indeed possible for someone to use Slim in such way, there are also other ways people can use Slim which could give such side effects but we think the documentation is clear enough to guide the user in using Slim correctly.

Hi @silentworks, Thanks for reply

It is indeed possible for someone to use Slim in such way

If so, why do we need to pass them (request and response) as parameter in route callable?
P.S: Sorry for my english :grin:
Best.

I strongly recommend not using the request and response entries in the container. The presence of these container entries is a design flaw, and I assume they'll be removed in the next major version.
Because PSR-7 request/response objects are immutable, if you are using middleware in your app the request and response objects in the container will not be valid. Again, pretend that these container entries do not exist! :)

As @AndrewCarterUK says, they will be removed in the next version.

Great. :+1:


Merge yaws --stats and yaws --status

It looks like these two commands can be merged into one.

They're similar but not the same. Under the covers, they share common code but --status is intended as a quick check while --stats is intended for use with things like munin. We'd have to keep both options regardless to avoid breaking existing scripts, so I'm closing this no change.

thanks for the info.


@function.inner works for PHP, but this is not reflected in the README

Describe the bug
@function.inner works for PHP, but this is not reflected in the README (the table entry is not green).
To Reproduce
Steps to reproduce the behavior:

Add configuration for select @function.inner
Open a PHP file
Execute a @function.inner command (delete around, for example)
It works

Expected behavior
The table cell to be green for @function.inner for the PHP row.

@function.inner does not appear directly in the parsed query https://github.com/nvim-treesitter/nvim-treesitter-textobjects/blob/e581902a35f315b6998d8354d20cc4a0dfc0cf6e/queries/php/textobjects.scm#L13 instead only "function.inner"
https://github.com/nvim-treesitter/nvim-treesitter-textobjects/blob/master/scripts/update-readme.lua would need to be updated for to recognize that.

Fix https://github.com/theHamsta/nvim-treesitter-textobjects/tree/fix-update-readme-script


Erlang LS do not shut down on exit

nvim --version:NVIM v0.5.0
Build type: Release
LuaJIT 2.1.0-beta3
Compilation:
Skompilowany przez hauleth

Features: +acl +iconv +tui
See ":help feature-compile"

       vimrc systemu: "$VIM/sysinit.vim"
   odwet dla $VIM-a: "/nix/store/bphh8y457fqdrgik0w92jhqxb3mlm57n-neovim-unwrapped-master/share/nvim"

Run :checkhealth for more info

nvim-lspconfig version(commit hash): 4f72377143fc0961391fb0e42e751b9f677fca4e
What language server (If the problem is related to a specific language server): ErlangLS
Can you reproduce this behavior on other language server clients (vscode, languageclient-neovim, coc.nvim, etc.): Haven't tried
Can you reproduce this behavior on other language servers offered in the nvim-lspconfig repo? (pyls -> pyright): No, ElixirLS works properly
Is the problem isolated to a particular language server: Maybe?
Operating system/version: Darwin 20.5.0 Darwin Kernel Version 20.5.0: Sat May  8 05:10:33 PDT 2021; root:xnu-7195.121.3~9/RELEASE_X86_64 x86_64

How to reproduce the problem from neovim startup
Enter Erlang file and then exit NeoVim
Actual behaviour
ErlangLS process is still running in the background.
Expected behaviour
Process should shut down.
Minimal init.vim or init.lua and code sample

Health check
health#lspconfig#check
========================================================================
## Checking language server protocol configuration
  - INFO: rust_analyzer: configuration checked.
  - INFO: erlangls: configuration checked.
  - INFO: elixirls: configuration checked.
  - ERROR: solargraph: The given command "solargraph" is not executable.

Wrong repo, this is just the configs for language servers, we don't handle process management. I'm transferring to neovim, but TBH we send the shutdown signal and then sigkill, if the server doesn't respond to the former it's an issue, and if it's the latter I have no idea how that is possible.


Using existing DB connection and extending User

Hello!
I want to use next-auth with an existing DB connection (TypeORM, MySQL) since it handles migrations, handles HMR in dev mode and already configured properly. I’m going to extend User as well.
Do I have to write a custom adapter in this case? Or are there other ways?
I’m going to use next-auth v3.
Thanks!

Hi Yuri!
Going v3 is a good idea, it should be out very soon and I don't think here will be much more changes between the current beta and release (possibly error page handling).
Your question is good but a little tricky to answer, I'll do my best to provide the most useful information so you can decide the best route.
Good

NextAuth.js supports MySQL out of the box (with TypeORM)
You can use custom models with NextAuth.js (either extending or replacing the existing models)
You don't need to write an Adapter (but you can).

Bad

There is no documentation that currently covers how to use custom models with NextAuth.js
There is not much documentation for how to write an Adapter

I would say use the built-in provider and extending the model is ideal if you can, however if you have an existing database and models I appreciate it might not be viable; and it might be easier to write an adapter (though that is also a bit of a pain to do).
Another option is to not specify a database at all for NextAuth.js and instead use the signIn() callback to look up users and either sign them in (if they have accounts already) or create a new account for them in your database before returning the callback.
It is hard to say if that is better or worse idea without knowing your set up (e.g. what combination of authentications services you want to support). If you only intended to support one or two sign in services (or credentials based sign in - e.g. username / password) then it's a great approach, but if you need to support multiple providers then it might be more difficult (and writing an adapter might be easier).

Hi Iain!
Thank you for your answer! I'll try to write here about my solution (for anyone who is facing the same task).
Some thoughts now: the first thing you want to do when you want to reuse the existing connection is passing existing connection object as a database parameter:
import { ensureConnection } from '../core/database';

const nextAuthOptions = {
  // ...
  database: ensureConnection(),
}

This connection, for sure, must already have corresponding entities (User, Account, Session, etc.) registered. And then providing your customised entities can be done, for example, in such way (or something similar):
import { ensureConnection } from '../core/database';
import { User } from '../entities/User';

const nextAuthOptions = {
  // ...
  database: ensureConnection(),
  models: {
    user: User,
  }
}

Don't you want to make NextAuth providing such functionality out-of-the box in a convenient way? I believe extending users, adding new properties to them, is a common enough task and can be highly welcomed, as well as the reusing of an existing connection.
If you think this is worth to be implemented (and maybe not-so-hard) we could think about the details. For example, we should consider HMR in next dev mode, when entity (for example, User), can change due to recompilation (this is not so hard at all).

Ok... I think that when we use custom models, for example, User, in next dev mode they can change because of automatic recompilation under the hood (HMR). I don't think that NextAuth should handle this inside itself. This can be handled outside. So an interface similar to this can be used to handle this (just an example, do not take it strictly):
import { ensureConnection } from '../core/database';
import { User } from '../entities/User';

async function provideDatabase() {
  return {
    connection: await ensureConnection(),
    models: {
      user: User,
    }
  }
}

const nextAuthOptions = {
  database: provideDatabase,
}

Function provideDatabase() should provide always relevant entity classes (if they are customised) and updated TypeORM connection.
(Just ideas, I do not insist in any way :) You really know better what is better for the lib)

RE: Custom Models
As per above, it already possible to use custom models with NextAuth.js but there isn't a tutorial for it yet.
The existing models are exported and can be modified, or you can pass in your own. For anyone curious, it should be possible to work out how to do it if you poke around in the TypeORM adapter code. It would be great to have a tutorial for this.
There is more detail in #283 and other related issues.
RE: Connection Sharing
This is possible with a custom adapter but is not supported by the default adapter, as you note.
There are quite a few issues with supporting connection sharing and limited upsides with serverless.

With serverless, every route is (typically) as separate function that maintains it's own connection to the database - there is no global connection pool as there is in a monolithic application, so there is no performance optimisation from using a shared connection object.

If you pass your own connection, you need to have robust connection state handling. This is tricker with serverless than it is with monolithic applications, as you have to worry about more factors (e.g. functions getting suspended, functions unexpectedly terminating early leading to stale connections, etc.)

If you pass your own connection, you have to make sure you initialize it with the options NextAuth.js expects or it won't work correctly, e.g. else sessions will expire at the wrong time (or sign in won't at all) and email sign in won't work.
We wouldn't want to set these automatically on a shared connection that was being re-used (e.g. in a monolithic application) as it would mess up all the timestamps written by other queries using that same shared connection.

Supporting passing in a shared connection adds complexity and invites people to write their own connection handling logic which I would guess would lead to a greater support overhead for us and more pain for them and I don't think that's a road I want to go down.

RE: Hot Module Reloading

If you think this is worth to be implemented (and maybe not-so-hard) we could think about the details. For example, we should consider HMR in next dev mode, when entity (for example, User), can change due to recompilation (this is not so hard at all).

I think supporting Hot Module Reloading of arbitrary models, with subsequent implications of updating of table schemas on the fly across MySQL, Postgres and MongoDB is not one I'm particularly interested in writing code to support personally (given complexity, value and other things I could be doing).
In the case of NextAuth.js we'd want to consider if / how we support this in a compatible way for all the databases NextAuth.js supports - and how you would handle things like type transforms for custom models in this scenario (as TypeORM is not a complete abstraction; we already have to do some of the work ourselves by transforming models at run time).
We also need to factor in who is going to write this code and stick around to support it (create and maintain tests, TypeScript  definitions, documentation, etc).
A good way to approach tackling this is probably create a custom adapter by forking the existing adapter code and passing that adapter into NextAuth.js. You could even publish it as an NPM module (something we have discussed doing with our own adapters over time, as the list of built-in adapters starts to grow) to share with folks - we'd be very happy to feature it!
I'm inclined to wait until TypeORM actually supports HMR out of the box before looking at adding it to NextAuth.js but I would be very happy to test out a PR or custom adapter that supported it.

Thanks, Iain, for your detailed reply.

A good way to approach tackling this is probably create a custom adapter by forking the existing adapter code and passing that adapter into NextAuth.js. You could even publish it as an NPM module (something we have discussed doing with our own adapters over time, as the list of built-in adapters starts to grow) to share with folks - we'd be very happy to feature it!

I'll try to delve into this soon :)

I was about to create another issue but I think this is directly connected to this.
The setup
I have multiple models setup with typeorm like I already mentioned in issue283.
In my ormconfig file, I declare my entities the following way so HMR works like plashenkov suggested:
import * as entities from "@modules/entities";
const typeOrmConfig = {
  ...
  synchronize: true,
  entities: ['src/api/modules/**/*.entity.ts']
}

My user table is the only one currently overlapping with next-auth models, but anyway I don't reach the point where I could get errors.
The problem
When I either drop all tables, go to one route so tables are regenerated or manually drop and sync tables with yarn, only the tables declared in my ormconfig.ts entities are created.
I tried to export next-auth models as account.entity.ts... so they are loaded by the orm but to no avail.
I think this is due to what you say about connection sharing. I handle the connection to my postgres instance of my graphQL API myself so I guess this problem is normal with the current adapter.
Extending methods
We can now extend models and add fields to schemas which is great.
But, let's say I add a field interests to the user table and during onboarding the user is prompted to select a list of his interests. When he registers, I'd like to set his interests field with the user input, or even do some other stuff.
So I would need to modify/extend createUser. As we can see in typeorm/index.js:
    async function createUser (profile) {
      debugMessage('CREATE_USER', profile)
      try {
        // Create user account
        const user = new User(profile.name, profile.email, profile.image, profile.emailVerified)
        return await getManager().save(user)
      } catch (error) {
        logger.error('CREATE_USER_ERROR', error)
        return Promise.reject(new CreateUserError(error))
      }
    }

The fields declared in the user model are here hardcoded, thus if I extend the model, it won't include my new fields.
Did I miss something or extending methods are currently not possible? Will it be possible in the future?
If I may suggest, having an example with custom adapters and showing how to extend everything would be a great addition.
@plashenkov did you make any progress on your next.js/next-auth integration or ended up creating your own auth system?

@trompx Hmm, adding additional fields at signup specifically isn't something that is currently supported.
The newUser custom page (which new accounts are directed to after signing in for the first time, if specified) and the redirect callback can be used to steer a user to a page to 'complete' a sign up process.
Explicitly requiring fields before an account can be created is not currently part of the flow for OAuth - and is probably not something we would support practically - at least, I don't think any time soon, just given other issues backlog, the amount of work required and that it's possible to work around it (e.g. by adding something to the session object or JWT that redirects the user to a page to complete the sign up process).
You are not the first person to ask about being able to set additional properties on sign in, it's just a little challenging to support in a generic way (e.g. that works with all OAuth providers).
If you would like to capture this as a specific enhancement, please feel free - I can't promise we will do it, but I think it would be helpful to at least shake out ways of supporting this behaviour!
Maybe it's something we could better support if we have more sophisticated callback behaviour - where they could sign in and create an account, but not actually use the account until the sign up process was deemed complete.
In the short term, a tutorial showing how to achieve something like this (and the limitations of what is currently possible) sounds achievable.

Your point about requiring additional data after signup (for oauth compatibility) totally makes sense and made me reconsider my auth design process. Thanks for the answer and detail explanation Iain, really appreciate.
Due to my difficulties to implement next-auth with my current setup, I will roll my own auth system for the time being but will keep an eye on next-auth which looks truly promising. Wish your the best!

@plashenkov did you make any progress on your next.js/next-auth integration or ended up creating your own auth system?

It's hard to understand how to customize next-auth to special needs due to some nuances are not documented. I think I'll go with Passport.js from scratch. So, let's close this issue.
Thanks Iain and trompx for your participation and asnwers!


Benchmarks too bad at the first query.

This is my benchmark during develop: https://gitlab.com/popcorn-vn/gun-linvodb
I inserted 100000 object to a model, and it tool up to 7 seconds to any first document query/insert. Using a persistent datastore, autoIndex at "_id".
datnguyen@datnguyen:~/projects/gun-linvodb$ node gun.js
Total docs: 100092, start searching _id: jo5t6bwlm66ervVrTMMd
Found _id: jo5t6bwlm66ervVrTMMd after: 6236 ms
Found _id: jo5txkeqiRwTP06N4G37 after: 4 ms
Found _id: jo5txkeqiRwTP06N4G37 after: 3 ms
Found _id: jo5txkeqiRwTP06N4G37 after: 3 ms
Found _id: jo5txkeqiRwTP06N4G37 after: 4 ms
Found _id: jo5txkeqiRwTP06N4G37 after: 4 ms

  let movies = new LinvoDB("movies", {})
  let now = Date.now()
  console.log('Total docs: 100092, start searching _id: jo5t6bwlm66ervVrTMMd')
  movies.findOne({_id: 'jo5t6bwlm66ervVrTMMd'}, function (err, doc) {
    console.log(`Found _id: ${doc._id} after: ${Date.now() - now} ms`)
    setInterval(() => {
      let now = Date.now()
      movies.findOne({_id: 'jo5txkeqiRwTP06N4G37'}, function (err, doc) {
        console.log(`Found _id: ${doc._id} after: ${Date.now() - now} ms`)
      });
    }, 1000)
  });

Try with 200000 docs:
Total docs: 200000, start searching _id: jo5t6bwlm66ervVrTMMd
Found _id: jo5t6bwlm66ervVrTMMd after: 11806 ms
Found _id: jo5txkeqiRwTP06N4G37 after: 4 ms
Found _id: jo5txkeqiRwTP06N4G37 after: 4 ms
Found _id: jo5txkeqiRwTP06N4G37 after: 2 ms
Found _id: jo5txkeqiRwTP06N4G37 after: 4 ms
Found _id: jo5txkeqiRwTP06N4G37 after: 4 ms
Found _id: jo5txkeqiRwTP06N4G37 after: 4 ms
Found _id: jo5txkeqiRwTP06N4G37 after: 3 ms
Found _id: jo5txkeqiRwTP06N4G37 after: 4 ms

Insert into a model already have 250000 documents
datnguyen@datnguyen:~/projects/gun-linvodb$ node gun.js | grep "Inserted"
Inserted jo5w4ohvONOuGlRNRhAS: 26026 ms
Inserted jo5w4sd2RkzAzF5A473B: 21022 ms
Inserted jo5w4w804OE7vjtbzEiU: 16023 ms
Inserted jo5w502yJfLmfFsxZn3X: 11025 ms
Inserted jo5w53xv3aDnPAQQi3Wu: 6026 ms
Inserted jo5w57ssDVIk35UN1HgS: 1028 ms
Inserted jo5w5bnrcng0Mjroo2ro: 5 ms
Inserted jo5w5fitSE0QhMZEzm4N: 5 ms
Inserted jo5w5jdsqXwPqVWu5LHE: 4 ms
Inserted jo5w5n8uVglXb87es1iz: 4 ms
Inserted jo5w5r3vgt71r8Qcw9lE: 4 ms

yeah, that's totally normal
the reason for this is that it takes a while to build the index; there's no way around it
I guess if you can build the index in advance (rather than using autoIndex), it will be fast on the first query too

Thank you. Anyways, linvodb3 is the best.


Use ReadWriteLock to split receive and close execution in SafeCloseDatagramSocket.

Use ReadWriteLock instead of several synchronized blocks to split execution of multiple receive and close inside SafeCloseDatagramSocket.
receive is method execution on "hot path" in ice4j so reducing number of acquired locks is good for performance.

Good day, @bbaldino!
Could you please have a look at this small PR, which replaces sort of manually built synchronization primitive with ReadWriteLock  from JDK to achieve same goal?
Thank you very much, Brian!


Deprecated Node.js 16 actions

Context
Node.js 16 actions are deprecated. Please update the following actions to use Node.js 20: actions/checkout@v3, pnpm/action-setup@v2, actions/setup-node@v3. For more information see: https://github.blog/changelog/2023-09-22-github-actions-transitioning-from-node-16-to-node-20/.

pnpm/action-setup@v2, actions/setup-node@v3 use node 16 too.

Already closed by #112.


process.EventEmitter is deprecated in Node.js v6..

process.EventEmitter is deprecated in Node.js v6..
It is causing a deprecated warning when loading node-monitor,
DeprecationWarning: process.EventEmitter is deprecated. Use require('events') instead.
Tested on Node.js v6.1.0, on Windows.

Upon further investigations, found that the issue is not from the monitor classes, but actually from the old version of socket.io used as a dependency (0.9.*).
Using the latest version of socket.io (1.4.6 right now) takes away the deprecated warning, and the basic functionality appears to be working with the new version.
However, more extensive tests would be needed to verify that all the functionality is working with the new socket.io version.
Any thoughts?

This package hasn't been maintained in years. If you're getting value from it and want to upgrade dependencies, issue a pull request. I'll do a quick check and publish to NPM.

@lorenwest Thanks for the quick reply. And yes, we do see value in this package.
I'm testing the updated dependencies now (upgraded socket.io to 1.4.6). Although the basic functionality works (such as the use of ProcessProbe) the unit tests are having issues.
In 2 of the unit tests - RouterTest.js and MonitorTest.js - the test gets 'stuck'  at a certain test case, as if the test.done() isn't getting called:
RouterTest.js
./node_modules/.bin/nodeunit --reporter verbose test/RouterTest.js

RouterTest.js
✔ Router - SetUp
✔ Router - Classes
  ✔ The Router data model is in place
✔ Router - ConnectInternal
  ✔ The error was null
  ✔ The router found the internal probe
✔ Router - InternalSameProbe
  ✔ The error was null
  ✔ Two monitors created with the same initParams are connected to the same probe id: 85aca867-ab08-dbc4-3545-fe1ce6af3f1a
✔ Router - InternalDifferentProbe
  ✔ The error was null
  ✔ Two monitors created with the same initParams are connected to different probes

gets stuck after that.
MonitorTest.js
./node_modules/.bin/nodeunit --reporter verbose test/MonitorTest.js

MonitorTest.js
✔ ModuleLoad - Externals
  ✔ Config package is exported
  ✔ Cron package is exported
  ✔ Underscore package is exported
  ✔ Backbone package is exported
✔ ModuleLoad - Monitor
  ✔ The Monitor data model is in place
  ✔ The Monitor collection is in place
✔ ModuleLoad - Submodules
  ✔ The Probe submodule is in place
  ✔ The Connection submodule is in place
  ✔ The Server submodule is in place
  ✔ The Router submodule is in place
✔ Protected - UUID
  ✔ A uuid was generated
  ✔ It has the correct V.4 length
  ✔ It is unique within the test UUIDs
  ✔ A uuid was generated
  ✔ It has the correct V.4 length
  ✔ It is unique within the test UUIDs
  ................
<more test results here>
  ................
  ✔ A uuid was generated
  ✔ It has the correct V.4 length
  ✔ It is unique within the test UUIDs
  ✔ A uuid was generated
  ✔ It has the correct V.4 length
  ✔ It is unique within the test UUIDs
✔ Protected - Router
  ✔ The default router is available
✔ Writable - CanWrite
  ✔ No errors on Inspect probe connect
  ✔ Inspector connected to the test variable
  ✔ You can set the probe value using monitor.set()
✔ Writable - SetControl
  ✔ No errors on Inspect probe connect
  ✔ Inspector connected to the test variable
  ✔ You can set the probe value using monitor.set()

gets stuck after that.
All other unit tests are passing.
I'm still trying to figure out the cause of this issue.
If you are able to point me in the right direction to check it would be great.
Thanks.

I've encountered the same warning, DeprecationWarning: process.EventEmitter is deprecated. Use require('events') instead., with the following set up:
Environment
socket.io 1.4.6
express 4.13.3
node 6.1.0
npm 3.8.6
Mac OS X El Capitan 10.11.5


Require function in AngularJS templates

I want use require function inside template, there's an example of usage:

After processing of this template by wepback, module with this template will look like this:
function(module, exports) {
    var path = '/some/prefix/path/myApp/templates/directive.html';
    window.angular.module('ng').run(['$templateCache', function(c) {
        c.put(path, "

")
    }]);
    module.exports = path;
}

But require function should be replaced by webpack_require function and the result module should be like this:
function(module, exports) {
    var path = '/some/prefix/path/myApp/templates/directive.html';
    window.angular.module('ng').run(['$templateCache', function(c) {
        c.put(path, "

")
    }]);
    module.exports = path;
}

Additionally, require function can be used not only in ng-include, ng-inline directives, it can be used in other custom attributes also.

As variant You can add special function to rewrite on fly content passed to loader:
function makeRequireFuncWebpackable(string) {
    return string.replace(/\\"require\(([^\\]+)\)\\"/g, '\\"" + require($1) + ")\\"');
}

!18

@ufocoder Sorry for the slow response, I have been migrating countries.
It's a nice idea, but my gut feeling is that it is outside the scope of ngtemplate-loader. Especially as it may break existing usages.
It should however be trivial to write a separate loader, that could be placed in front of the ngtemplate-loader and executes your above code.
Something like 'ngtemplate!inline-requires!foo.html'
If you write this loader I will add a reference to it in the readme :)

Any progress for ng-include ?

same ? as @alexsandro-xpt, anyone ever take a gander at a loader for when ng-include is used?

as far as I can remember, that kind of functionality can be done by html-loader

Turns out one doesn't actually need this feature.  If one preloads the app's templates, they're already in the template cache and thus, one just uses the correct URL, without require.  This is what we do and it works quite well.

yes, but it will need another variable to reference the url (what i'm doning) or write it mannually

@e-cloud, are you using my-include to dynamically select templates?  I'd argue that's not proper, especially if you want to use webpack.  You can simply create a wrapper directive that selects the right template and load them in that directive.  We also do this in some (rare) cases.  It will totally bork upgrading to ng2...

my-include? I guess you're talking about ng-include. Just a few case of that kind of usage

Gah!  Yes, that's what I get for typing on a phone....autocorrect...
I just realized, you're not the original poster of this issue - my comments were geared towards @ufocoder 's original post.

"ngtemplate-loader": "1.3.1",
/**

build templates form angular
*/
{ test: /.html$/, loader: "ngtemplate?relativeTo=" + (path.resolve(__dirname, './src/app')) + "/!html" }

        // WORK!
      // NOT WORK!
       // NOT WORK!
i think you can close this issue

Closing as out of scope.


Image Classification Video Scavenger Hunt example doesn't work when p5.Speech doesn't work

→ Description 📝
I found a bug/issue with the Image Classification Video Scavenger Hunt example:
https://ml5js.github.io/ml5-examples/p5js/ImageClassification/ImageClassification_VideoScavengerHunt/
The expected behavior is for it to repeatedly try to classify what it sees on my webcam and to say out loud what it sees.
This example works fine on my Chromebook with Chrome. It does not work correctly on my Linux machine using Chrome. There is no speech and it does not try to repeatedly classify what it sees.
I debugged the issue and figured out the problem. The core issue is that the p5.Speech() library does not work (for me) on Linux/Chrome and no speech is generated. The speech library also doesn't work using the example code from ability.nyu.edu. The speech library just doesn't work on this machine with Chrome.
I believe the reason why it doesn't work on my Linux machine is because myVoice.voices is an empty list. This is not the case for my Chromebook. This library is dependent on the browser to do the speech synthesis and to have "voices" available. For whatever reason, this machine doesn't supply any.
The speech issue is probably a software issue with my machine and is not the subject of this bug. However, this shortcoming undermines the ml5 example because the onEnd method is never triggered, and that's what this bug is about.
  // speechEnded function will be called when an utterance is finished
  // Read more at p5.speech's onEnd property: http://ability.nyu.edu/p5.js-speech/
  myVoice.onEnd = speechEnded;

Because the p5.speech library doesn't say anything, the onEnd method is never called and the speechEnded function is never called.
function speechEnded() {
  if (isPlaying) classifyVideo();
}

That means classifyVideo() is never called again. Therefore, this example tries to classify what it sees once and then stops. The end result is confusing and makes the example seem broken.
I propose that the example code be modified to check myVoice.voices to see if voices are available. It should only attempt to speak if voices are available. If not, it should display a reasonable message for the user informing them that speech won't work but continue the ML demo by displaying messages to the #message field only.
I'm happy to make this bug fix but wanted feedback from others first.
Version 74.0.3729.169 (Official Build) Built on Ubuntu , running on Ubuntu 19.04 (64-bit)

@hx2A - Wow! Thanks so much for the excellent investigation. It is super helpful that you run this on different operating systems and managed to diagnose this issue.
Perhaps one thing we need to add Browserstack tests for trying to handle these kinds of moments.
I agree that it is a good idea to add an error handling here. If you'd like to make a PR, that would be great. I think @shiffman can also review for levels of "friendliness" and we can go from there. Does that sound ok?
Thanks so much for this detective work! 🙏

You are welcome! I checked using my Chromebook because I was suspected that the problem I was experiencing was specific to this machine. It happens the Chrome screenreader doesn't work either.
I like the idea of using Browserstack tests but think it should be a part of a broader effort to improve the unit tests. Right now some of the tests fail randomly or fail consistently, which is a bad thing. That teaches people to ignore unit test results, which in turn teaches people that unit tests aren't useful and there is no point in writing more of them. One of my goals is to change that. To get the unit tests working correctly, and to teach people that unit tests are useful.
Sure, I'll make a PR for this. I'll take care of it this week.

@hx2A - you're totally right about building trust in the tests and software. I know @brondle also has an interest to get all this up to speed as well, so you're definitely in good company! Thanks for your nice reflections here!


YETUS-896 Use emoji as vote result on github

(!) A patch to the testing environment has been detected.
Re-executing against the patched versions to perform further tests.
The console is at https://builds.apache.org/job/yetus-github-multibranch/job/PR-68/1/console in case of problems.

:broken_heart: -1 overall

Vote
Subsystem
Runtime
Comment

:blue_heart:
reexec
0m  0s
Docker mode activated.

:broken_heart:
docker
13m 49s
Docker failed to build yetus/yetus:de5900d.

Subsystem
Report/Notes

GITHUB PR
https://github.com/apache/yetus/pull/68

Console output
https://builds.apache.org/job/yetus-github-multibranch/job/PR-68/1/console

versions
git=2.7.4

Powered by
Apache Yetus 0.11.0-SNAPSHOT https://yetus.apache.org

This message was automatically generated.

(!) A patch to the testing environment has been detected.
Re-executing against the patched versions to perform further tests.
The console is at https://builds.apache.org/job/yetus-github-multibranch/job/PR-68/2/console in case of problems.

:broken_heart: -1 overall

Vote
Subsystem
Runtime
Comment

:blue_heart:
reexec
0m  0s
Docker mode activated.

:broken_heart:
docker
13m 48s
Docker failed to build yetus/yetus:de5900d.

Subsystem
Report/Notes

GITHUB PR
https://github.com/apache/yetus/pull/68

Console output
https://builds.apache.org/job/yetus-github-multibranch/job/PR-68/2/console

versions
git=2.7.4

Powered by
Apache Yetus 0.11.0-SNAPSHOT https://yetus.apache.org

This message was automatically generated.

(!) A patch to the testing environment has been detected.
Re-executing against the patched versions to perform further tests.
The console is at https://builds.apache.org/job/yetus-github-multibranch/job/PR-68/3/console in case of problems.

:confetti_ball: +1 overall

Vote
Subsystem
Runtime
Comment

:blue_heart:
reexec
0m  9s
Precommit patch detected.

_ Prechecks _

:green_heart:
dupname
0m  0s
No case conflicting files found.

:green_heart:
@author
0m  0s
The patch does not contain any @author tags.

_ master Compile Tests _

:blue_heart:
mvndep
0m 11s
Maven dependency ordering for branch

_ Patch Compile Tests _

:blue_heart:
mvndep
0m  3s
Maven dependency ordering for patch

:green_heart:
shellcheck
0m  2s
There were no new shellcheck issues.

:green_heart:
shelldocs
0m  0s
There were no new shelldocs issues.

:green_heart:
whitespace
0m  0s
The patch has no whitespace issues.

_ Other Tests _

:green_heart:
asflicense
0m  9s
The patch does not generate ASF License warnings.

0m 49s

Subsystem
Report/Notes

GITHUB PR
https://github.com/apache/yetus/pull/68

Optional Tests
dupname asflicense shellcheck shelldocs

uname
Linux asf916.gq1.ygridcore.net 4.4.0-139-generic #165-Ubuntu SMP Wed Oct 24 10:58:50 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux

Build tool
maven

Personality
/home/jenkins/jenkins-slave/workspace/yetus-github-multibranch_PR-68/out/precommit/personality/provided.sh

git revision
master / 6b94d9d

modules
C: . precommit U: .

Console output
https://builds.apache.org/job/yetus-github-multibranch/job/PR-68/3/console

versions
git=2.7.4 maven=2014-02-14T17:37:52+00:00) shellcheck=0.3.7

Powered by
Apache Yetus 0.11.0-SNAPSHOT https://yetus.apache.org

This message was automatically generated.

Ping @busbey

@Apache9 and @infraio could y'all come to consensus between this as #67?

@Apache9 and @infraio could y'all come to consensus between this as #67?

+1 for this. For me, the important thing is the “broken heart” emoji which if very helpful for us to find the -1 problem.

Yes we just discussed offline. @infraio is fine with the approach here. So any other concerns? If no, let's include this and make a new yetus release?
Thanks. @busbey


Should grunt clear not remove dist/portainer so grunt build builds the project again?

when grunt build is issued the project is NOT built as dist/project exists. When grunt clear is issued the project/dist persists and the project is not built again when grunt build is executed.

I think the task is useful for Angular and CSS development, where you don't want to recompile the entire application.
Perhaps adding a new task like grunt.registerTask('clear-all', ['clean:all']) might be a good idea?

I think it would be nice if we can choose what to rebuild
Like :

grunt build-app to rebuild the angular app
grunt build-api to rebuild the go binary
grunt build have to rebuild all

@WTFKr0 Yes that sounds better

IMO the build system and the gruntfile is too complicated / messy. I've opened an issue a while ago https://github.com/portainer/portainer/issues/40 related to a refactor of the gruntfile. Unfortunately I do not have the time to focus on that at the moment.
@adrianfalleiro do you have any experience with grunt? Keen to work on a new version of the gruntfile?

@deviantony Yep I'll take at look at #40.

Awesome ! Join me on Slack at http://portainer.io/slack/ if you need to discuss this.

This was solved as a part of #939


[SuperTextField] Add ability to override tap gestures (Resolves #2447)

[SuperTextField] Add ability to override tap gestures. Resolves #2447
This PR allows apps to register custom handlers, to enable features like changing the mouse cursor when hovering content with specific attributions, like a LinkAttribution and performing custom logic when tapping on it.
The implementation is based on the SuperEditor's ContentTapDelegate.
I noticed we also have a RightClickListener. We could probably deprecate this property and make everything available through the new SuperTextFieldTapHandler.
This PR includes a SuperTextFieldLaunchLinkTapHandler that changes the mouse cursor when hovering a link, and opens the URL when tapping on it.
On SuperEditor, we have the concept of "interaction mode", which is enabled when the users presses CMD. The mouse cursor and tap handling on the link handler only runs if the editor is in interaction mode. This is not yet implemented by this PR, because the original ticket didn't mention it. If it's needed, we can add that.

I noticed we also have a RightClickListener. We could probably deprecate this property and make everything available through the new SuperTextFieldTapHandler.

Ok, let's go ahead and deprecate.
BTW, while we're here on this ticket, can we also offer right-click support?
https://github.com/superlistapp/super_editor/issues/278
https://github.com/superlistapp/super_editor/pull/692

@matthew-carroll Since https://github.com/superlistapp/super_editor/issues/278 mentions tap down vs tap up events, should we provide down/up variations for the all tap handlers (single tap, double tap, triple tap) ?


Allow changing the default/implicit base node

Currently we always use the query root as implicit base node or fail if there are multiple query roots. Especially for entity views it would be interesting to be able to change the default/implicit base node as that would make it easier to scope certain functionality like correlation providers. This would allow to omit the use of the correlation alias as prefix for every expression.

Hello,
I'm trying to create a query with multiple root nodes :
cbf.create(em, SomethingCTE.class, "traitement")
                .with(SomethingCTE.class)
                .from(SomethingEntity.class, "t")
                .innerJoinLateralEntitySubquery("t.other", "si", "sinitial")
                .orderByAsc("date")
                .setMaxResults(1)
                .end()
                .leftJoinLateralOnEntitySubquery("t.other", "sc", "scurrent")
                .orderByDesc("date")
                .setMaxResults(1)
                .end()
                .on("date").leExpression("CURRENT_DATE")
                .end()
                .end()
                .bind(...)
                .end();

And doing so I get java.lang.IllegalArgumentException: An explicit base join node is required when multiple root nodes are used!
I guess this issue explains why, is there a way around it ?

You need to specify qualified paths i.e.
cbf.create(em, SomethingCTE.class, "traitement")
                .with(SomethingCTE.class)
                .from(SomethingEntity.class, "t")
                .innerJoinLateralEntitySubquery("t.other", "si", "sinitial")
                .orderByAsc("sinitial.date")
                .setMaxResults(1)
                .end()
                .leftJoinLateralOnEntitySubquery("t.other", "sc", "scurrent")
                .orderByDesc("scurrent.date")
                .setMaxResults(1)
                .end()
                .on("t.date").leExpression("CURRENT_DATE")
                .end()
                .end()
                .bind(...)
                .end();

Specifying the qualified paths does seem to work for lateral entity subqueries with a correlation path (although I can't go through because of #1756), thanks for that, but the exception is still thrown if I use entity classes
cbf.create(em, SomethingCTE.class, "traitement")
                .with(SomethingCTE.class)
                .from(SomethingEntity.class, "t")
                .innerJoinLateralEntitySubquery(SomeOtherEntity.class, "si", "sinitial")
                .orderByAsc("sinitial.date")
                .setMaxResults(1)
                .end()
                .leftJoinLateralOnEntitySubquery(SomeOtherEntity.class, "sc", "scurrent")
                .where("sc.date").leExpression("CURRENT_DATE")
                .orderByDesc("scurrent.date")
                .setMaxResults(1)
                .end()
                .end()
                .bind(...)
                .end();


Explicit state that windows key is not supported

The documentation is not clear that the Windows key is not a valid modifier for key bindings. I think people are looking for this when they try to customize their terminal - at least I did and it took me a lot of effort to find that this is not ab option yet.
The corresponding Issue for the feature request is #3184

Docs Build status updates of commit 7ad5523:
:white_check_mark: Validation status: passed

File
Status
Preview URL
Details

TerminalDocs/customize-settings/key-bindings.md
:white_check_mark:Succeeded
View

For more details, please refer to the build report.
Note: Broken links written as relative paths are included in the above build report. For broken links written as absolute paths or external URLs, see the broken link report.
For any questions, please:Try searching in the Docs contributor and Admin GuideSee the frequently asked questionsPost your question in the Docs support channel

Docs Build status updates of commit 168c950:
:warning: Validation status: warnings

File
Status
Preview URL
Details

TerminalDocs/customize-settings/key-bindings.md
:warning:Warning
View
Details

TerminalDocs/customize-settings/key-bindings.md

Line 8, Column 13: [Warning-ms-service-subservice-invalid] Invalid value for 'ms.service': 'terminal'.

For more details, please refer to the build report.
If you see build warnings/errors with permission issues, it might be due to single sign-on (SSO) enabled on Microsoft's GitHub organizations. Please follow instructions here to re-authorize your GitHub account to Docs Build.
Note: Broken links written as relative paths are included in the above build report. For broken links written as absolute paths or external URLs, see the broken link report.
Note: Your PR may contain errors or warnings unrelated to the files you changed. This happens when external dependencies like GitHub alias, Microsoft alias, cross repo links are updated. Please use these instructions to resolve them.
For any questions, please:Try searching in the Docs contributor and Admin GuideSee the frequently asked questionsPost your question in the Docs support channel


Octave 3.8 missing libraries

Hi,
I have tried to compile shogun 3.0 with the octave modular  interface but cmake keeps producing the error
FindPackageHandleStandardArgs.cmake:108 (message):
Could NOT find Octave (missing: OCTAVE_LIBRARIES) (found suitable version
"3.8.0", minimum required is "3.6")
I compiled octave 3.8.0 as a shared library with prefix= /usr and the libraries and the headers are all in the usual places (/usr/lib and /usr/include)
OS is Ububtu 13.10 64 bits
Thanks

Shogun 4.0.0 with Octave 3.8.2 works well in Ubuntu 14.04 64 bits. Shall we close this issue?

@iglesias How do you get those working? I installed those, but octave is not finding shogun's libraries.

@carbonox-infernox did you set up the "search path" in Octave so that it knows where its Shogun target is?


Refactoring operations should use var/final/const as appropriate

Original issue: https://github.com/flutter/flutter-intellij/issues/6304
Summary: refactoring operations that create new declarations should use final and const where appropriate. Currently, var is used everywhere.

It seems like the Dart analyzer ought to be able to determine that a declaration should be var if its redefined, final it is isn't, and const if it is a constant (not sure about that last).

I wish it were that simple. The problem, of course, is that the variable didn't exist before the extract operation, so it's guaranteed that it isn't re-assigned yet. What we can't know is whether the user will assign a new value after this operation.
The point about const is interesting. If the original expression is a const expression, then perhaps we should use const for it. (It isn't guaranteed that that's the right thing either, but it is an interesting signal.)
That said, the original point is valid and something we have been discussing. The question is, what signals can we use to determine the user's preferences? One signal that comes to mind is style-based lints that have been enabled. In this case, it seems clear that if the user has enabled prefer_final_locals then they probably want the variable to be declared using final. The question is whether that's sufficient.

Duplicate of #49561, but this has feedback.


1.21?

Will there be an update for 1.21?

Probably not, I've discontinued this mod long ago. But feel free to use the code in any way or update it yourself, if you can.


Responsive breakpoints have side effects

Hi Alex!
I'm very much enjoying your library, but I noticed an issue when adding the responsive code snippet.
Essentially, when I add:
lax.setup({
    breakpoints: { small: 0, large: 501 }
});

All my current animations break.
They then only start working again when I explicitly specify _small or _large on them.
Is there a way to have animations for all screen widths, and only apply the breakpoints to the few that require it? Right now I can't seem to see a way to use this breakpoint system where that behavior happens.
Hope there is a good solution to this :)

Hi! This is meant to work as you desire... I'll have a look when I'm home, around Monday or Tuesday.

Hi @alexfoxy,
So it is working now, and I haven't been able to reproduce the issue. So I'm gonna go ahead and close the issue since it was probably just me who made some mistake.

I can reproduce this.
<template>

      Buy Now

</template>

Also when I scroll the shoe shrinks if I use this piece of markup:

Isn't the shoe supposed to shrink when i resize the browser width? Why would this happen when I'm just scrolling down a page at 1440px width?


Non-deterministic synthesis behavior

We are seeing that the yosys output of logic synthesis is not consistent from run to run. Two designs that are exactly the same can have different logic cell resource consumption from run to run.

It is due to the timestamp built into the LiteX BIOS, which is embedded in the ROM, which does affect Yosys behavior.
To avoid this, use litex option: --no-ident-version
The question is, do we want to always use this option in CFU Playground, or let the user add it to EXTRA_LITEX_ARGS when they want nondeterministic behavior.

Maybe we just add this option permanently to dse_framework in cfu playground so that anyone using the framework gets consistent results at least? Otherwise we can leave it to the user to add it in all other cases, perhaps (and we should include some documentation noting this)?

@ShvetankPrakash can you add --no-ident-version to your DSE stuff so that you can kick off your runs while we think about whether to make the change globally?

Sounds good I will add this for now to kick off the runs @tcal-x


Added location information for test_begin - does not work with UDL

Hi,
After several failed attempts, I've been unable to add location to UDL with the caller location. Maybe it's a good proposal for C++23 :)
Anyway, this pull requests usage is exemplified here: https://godbolt.org/z/5GdE6Q
As shown the UDL limitation:
    test("test0") = []() { expect(true); }; -> this has the caller location

    "test1"_test = []() { expect(true); }; -> this has unknown location

@krzysztof-jusiak is this acceptable? I would add this information to the documentation and let the user decide if he wants syntax sugar or location information. Before I proceed with tests and documentation I wanted to see if you would find this compromise acceptable.

Closing this one as it seems possible with https://github.com/boost-experimental/ut/pull/244 :thinking:
@lp55 Feel free to reopen/comment if you feel like the other MR is not working as expected. Thanks.


Yarn install fails because of dependencies require different "node" versions

Describe the bug
Yarn install fails
To Reproduce
Steps to reproduce the behavior:

Clone repo
Run yarn install
See error, error<EMAIL_ADDRESS>The engine "node" is incompatible with this module. Expected version "^6.9.0 || ^8.9.0 || ^10.6.0". Got "12.14.1"
Swtich to 10
See error, error<EMAIL_ADDRESS>The engine "node" is incompatible with this module. Expected version ">=12". Got "10.24.1"
Swtich to 10, go to step 2

Expected behavior
Yarn install install deps without error.

It happens because of parse-commit-message, for now we can use yarn --ignore-engines


GLES2 support

I recently tried using wlroots on my laptop with an Intel iGPU (i5-520M is the CPU, not really sure what the iGPU name is), and it currently doesn't work.
It turns out this hardware doesn't support GLES 3, and only goes up as high as GLES 2.
While this laptop is getting on a bit in terms of age, it would be nice for wlroots to be able to support older hardware.
So I think we should either downgrade the current renderer to GLES 2 or create a separate GLES 2 fallback when we can't load GLES 3.

Alright, we can go for GLES 2.

When working on this we should also try to expose the GLES2 internals some more.

So it looks like GLES2 doesn't support VBOs. I think we should have both renderers and choose the best supported one.

Decided against maintaining two rendering backends. VBOs are nice but I'm not sure we're really going to gain much from them.


Better guesses at benchmarks turned unit tests cpu cost

This should reduce latency on C++ suites

LGTM.


[in app purchase] Update PlayBilling Library to 6.2

Use case
Creating a feature placeholder to update the PlayBilling Library to 6.2 (or latest version) in the Android part of the plugin. ###
Proposal
Creating a feature placeholder to update the PlayBilling Library to 6.2 (or latest version) in the Android part of the plugin. ###

From triage: @zoeyfan Is the request only to update the version, or to also add the new APIs?

@yaakovschectman both, add new APIs available in the new version of the Play Billing library.

any update?

any update?
Google has sent an email requesting an update:

2 of your apps use a version of Google Play Billing Library that will be deprecated soon. From Aug 31, 2024, all apps must use version 6.0.1 or later.
Update to a newer version by this date to prevent your updates from being rejected.
How to fix
Update all affected apps' APKs, and any third-party SDKs and libraries used for billing on Google Play to version 6.0.1 or later, across all your tracks. We recommend updating to version 7 to make use of the latest monetization features.

I found the below remainder in android docs.
Reminder: By Aug 31, 2024, all new apps and updates to existing apps must use Billing Library version 6 or newer. If you need more time to update your app, you will be able to request an extension until Nov 1, 2024.
So would it be possible to change the priority of this.

The current version of in_app_purchase_android already uses version 6 of the Billing Library. This issue is about upgrading from 6 to 7, which is unrelated.

I’m working on this migration along with providing new features from the Play Billing 7 library and I have a question on the best API design for exposing https://developer.android.com/reference/com/android/billingclient/api/PendingPurchasesParams.Builder#enablePrepaidPlans() to the Dart client.
We have a depracated enablePendingPurchases method on the BillingClient which was made no-op in this commit https://github.com/flutter/packages/commit/bf92be83fad0ee9f4d3de2d2fb7d49ddb2b1fee1 as enabling pending purchases for one time products in mandatory https://developer.android.com/reference/com/android/billingclient/api/PendingPurchasesParams.Builder#enableOneTimeProducts().
Should we:

Add a new paremeter to BillingClient.startConnection? Should it be a simple boolean enablePrepaidPlans or better create a class wrapper PendingPurchaseParams (more futureproof?)
Revert the deprecation on this method and make it take some parameter for this option. Sounds like a weird change though and providing this param has to be done while constructing the client.
Create a new method likeenablePendingPurchasesForPrepaidPlans?
Maybe it’s also time to remove the deprecated method from the package to save confusion? This migration will cause a breaking change in the Android interface anyway with the removal of the ProrationMode enum on the native side. As enablePendingPurchases has been a no-op for a long time already, it would also be a trivial migration for the package users.

@gmackall for input on the above.

I think adding a new class wrapper PendingPurchaseParams and using that as a new parameter to BillingClient.startConnection sounds like a good solution. Its a bit more clunky than just using a simple bool, but if the Android folks end up adding more elements to PendingPurchasesParams we could end up in an awkward spot and require another breaking change to remove the bool and replace with a wrapper for the class.

Maybe it’s also time to remove the deprecated method from the package to save confusion? This migration will cause a breaking change in the Android interface anyway with the removal of the ProrationMode enum on the native side. As enablePendingPurchases has been a no-op for a long time already, it would also be a trivial migration for the package users.

This sounds good to me if we are going to be forced to make a breaking change regardless


Added didDeploy hook, and make activate hook add activatedRevisionKey to context.

The didDeploy hook works with a configurable didDeployMessage which is output when the hook runs.

One thing this allows, is outputting a preview URL, which requires knowledge of server implementation. For example, a potential excerpt from config/deploy.js:
   ENV.redis.didDeployMessage = function(context) {
      if (context.revisionKey && !context.activatedRevisionKey) {
        return "Deployed but did not activate revision " + context.revisionKey + ".\n"
             + "To preview:\n"
             + "https://" + domain + "/apps/?manifest_id=" + context.revisionKey + "\n"
             + "To activate:\n"
             + "ember activate " + context.revisionKey + " --environment=" + process.env.DEPLOY_ENVIRONMENT + "\n";
      }
    }

@lukemelia Could we put the DEPLOY_ENVIRONMENT in the context?  This might be a good use case for the commandLineArgs object that is added to the context by the command?

@lukemelia Are you planning on raising a PR for this change against the master repo?

Will update and reopen against upstream


:bug: Decompile files into a java-project for provider to init correctly

Place decompiled java files in a dummy java project maintaining the directory structure for packages
Walk and decompile all JARs/ WARs within
Update the dependency path to point to the base of exploded app for us to get .jar names only.

also made it a tad bit faster by not decompiling same file again


Use #[non_exhaustive] for types we expect to change

Adding new public fields to a public type can break backwards compatibility. If we exect some of the types to change as the slp spec changes, we should use the #[non-exhaustive] declaration.
I understand peppi currently doesn't make any backwards compatibility guarantees, but it's probably still a good idea.
https://rust-unofficial.github.io/patterns/idioms/priv-extend.html

Hmmm. Maybe this is not a good idea. Idk if this is the recommended use case for the Directive. Closing for now.


Refactor ViT model

Signed-off-by: Jael Gu<EMAIL_ADDRESS>Closes #568

Codecov Report

Merging #570 (282ba50) into main (17000d0) will decrease coverage by 1.13%.
The diff coverage is 92.15%.

@@            Coverage Diff             @@
##             main     #570      +/-   ##
==========================================
- Coverage   72.70%   71.56%   -1.14%
==========================================
  Files         139      142       +3
  Lines        5198     5236      +38
  Branches      778      771       -7
==========================================
- Hits         3779     3747      -32
- Misses       1180     1265      +85
+ Partials      239      224      -15

Impacted Files
Coverage Δ

towhee/models/vit/vit_utils.py
80.00% <80.00%> (ø)

towhee/models/vit/vit.py
89.79% <89.79%> (ø)

towhee/models/layers/multi_head_attention.py
100.00% <100.00%> (ø)

towhee/models/layers/vit_block.py
100.00% <100.00%> (ø)

towhee/__init__.py
79.59% <0.00%> (-15.15%)
:arrow_down:

towhee/engine/operator_loader.py
85.48% <0.00%> (-3.41%)
:arrow_down:

towhee/dag/base_repr.py
100.00% <0.00%> (ø)

towhee/engine/__init__.py
100.00% <0.00%> (ø)

towhee/models/layers/mlp.py
100.00% <0.00%> (ø)

towhee/models/layers/sam.py
40.47% <0.00%> (ø)

... and 60 more

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 17000d0...282ba50. Read the comment docs.

/lgtm

/approve


Access onBlur handler of the calendar icon of Datepicker

A onBlur handler & onKeyDown handler is needed for the Datepicker icon component in order to call a function or change focus.
A onBlur handler and onKeyDown handler for the icon will be a good solution.

You can use InputAdornmentProps  for that purpose


Feature/serve static website

It does work pretty well.
I've added an .env.example. This file might be not complete.

Just found this missing js. 🤔

Just found this missing js. 🤔

Yes, this is probably required by Fusion Chart to export to Excel, not sure if there's a way to disable it. From Fusion Chart the two only exports used are to PNG and PDF.

This looks good to me, only downside is that the Docker image will be a bit bigger because it contains the UI, but should be minimal I suppose. I can compare the resulting size when is built.

Should probably work with the current way the app is deployed on OCI and GH Pages.
Some more details here: https://medium.com/stackademic/building-a-cost-free-always-on-personal-project-stack-3eaa02ac16b6.


Pymoo Compilation Error

Upon running the capacity expansion tutorial, the following message was shown:
"Compiled modules for significant speedup can not be used!
https://pymoo.org/installation.html#installation
To disable this warning:
from pymoo.config import Config
Config.warnings['not_compiled'] = False"
The running time for the algorithm was a minute longer than the tutorial, meaning running larger simulations would take much more time.

looking to the Pymoo Installation website provided. Ran following command in the terminal:
python -c "from pymoo.util.function_loader import is_compiled;print('Compiled Extensions: ', is_compiled())"
But I recieved the following message: Compiled Extensions:  False

This seems like an issue with pymoo rather than osier. I ran the command you listed and received the following output:
samdotson@Sams-MacBook-Pro-3 research % python -c "from pymoo.util.function_loader import is_compiled;print('Compiled Extensions: ', is_compiled())"
Compiled Extensions:  True

Additionally, in order to be more helpful I need to know

what operating system you're using
what version of python you have
what steps you took to produce the error
what you have tried to do to rectify the issue

As of right now, I can't replicate the problem.


[WIP -- DO NOT MERGE] test vesting w/ hard fork

Mosey along, nothing to see here ...

!ci-build-me

!ci-build-me

!ci-build-me

!ci-build-me

!ci-build-me

!ci-build-me

!ci-build-me

!ci-build-me

!ci-build-me

!ci-build-me

!ci-build-me