Add staticcheck into github actions

https://github.com/dominikh/go-tools
go run honnef.co/go/tools/cmd/staticcheck -- ./...

I test it locally and find some issues:
$ kubevela git:(master) go run honnef.co/go/tools/cmd/staticcheck -- ./...
apis/standard.oam.dev/v1alpha1/autoscaler_types.go:20:2: package "github.com/crossplane/crossplane-runtime/apis/core/v1alpha1" is being imported more than once (ST1019)
	apis/standard.oam.dev/v1alpha1/autoscaler_types.go:21:2: other import of "github.com/crossplane/crossplane-runtime/apis/core/v1alpha1"
pkg/appfile/api/appfile_test.go:11:2: package "k8s.io/apimachinery/pkg/apis/meta/v1" is being imported more than once (ST1019)
	pkg/appfile/api/appfile_test.go:12:2: other import of "k8s.io/apimachinery/pkg/apis/meta/v1"
pkg/appfile/driver/local.go:113:9: error strings should not be capitalized (ST1005)
pkg/appfile/driver/local_test.go:27:39: should use make(map[string]api.Service) instead (S1019)
pkg/builtin/build/build_test.go:67:13: registry.Run is deprecated: Run is deprecated, you should use DoTasks is builtin package, it will automatically register all internal functions  (SA1019)
pkg/builtin/task.go:19:9: registry.Run is deprecated: Run is deprecated, you should use DoTasks is builtin package, it will automatically register all internal functions  (SA1019)
pkg/commands/comp.go:13:2: package "github.com/oam-dev/kubevela/pkg/commands/util" is being imported more than once (ST1019)
	pkg/commands/comp.go:14:2: other import of "github.com/oam-dev/kubevela/pkg/commands/util"
pkg/commands/exec.go:20:2: package "github.com/oam-dev/kubevela/pkg/commands/util" is being imported more than once (ST1019)
	pkg/commands/exec.go:21:2: other import of "github.com/oam-dev/kubevela/pkg/commands/util"
pkg/commands/logs.go:21:2: package "github.com/oam-dev/kubevela/pkg/commands/util" is being imported more than once (ST1019)
	pkg/commands/logs.go:22:2: other import of "github.com/oam-dev/kubevela/pkg/commands/util"
pkg/commands/portforward.go:29:2: package "github.com/oam-dev/kubevela/pkg/commands/util" is being imported more than once (ST1019)
	pkg/commands/portforward.go:30:2: other import of "github.com/oam-dev/kubevela/pkg/commands/util"
pkg/commands/trait.go:14:2: package "github.com/oam-dev/kubevela/pkg/commands/util" is being imported more than once (ST1019)
	pkg/commands/trait.go:15:2: other import of "github.com/oam-dev/kubevela/pkg/commands/util"
pkg/commands/util/init.go:6:2: package "k8s.io/api/core/v1" is being imported more than once (ST1019)
	pkg/commands/util/init.go:7:2: other import of "k8s.io/api/core/v1"
pkg/controller/core.oam.dev/v1alpha2/application/appfile_parser_test.go:30:2: package "k8s.io/apimachinery/pkg/apis/meta/v1" is being imported more than once (ST1019)
	pkg/controller/core.oam.dev/v1alpha2/application/appfile_parser_test.go:31:2: other import of "k8s.io/apimachinery/pkg/apis/meta/v1"
pkg/controller/core.oam.dev/v1alpha2/applicationconfiguration/applicationconfiguration.go:35:2: package "github.com/crossplane/crossplane-runtime/apis/core/v1alpha1" is being imported more than once (ST1019)
	pkg/controller/core.oam.dev/v1alpha2/applicationconfiguration/applicationconfiguration.go:36:2: other import of "github.com/crossplane/crossplane-runtime/apis/core/v1alpha1"
pkg/controller/core.oam.dev/v1alpha2/applicationconfiguration/component_test.go:12:2: package "k8s.io/api/apps/v1" is being imported more than once (ST1019)
	pkg/controller/core.oam.dev/v1alpha2/applicationconfiguration/component_test.go:13:2: other import of "k8s.io/api/apps/v1"
pkg/controller/core.oam.dev/v1alpha2/applicationconfiguration/render_test.go:24:2: package "github.com/crossplane/crossplane-runtime/apis/core/v1alpha1" is being imported more than once (ST1019)
	pkg/controller/core.oam.dev/v1alpha2/applicationconfiguration/render_test.go:25:2: other import of "github.com/crossplane/crossplane-runtime/apis/core/v1alpha1"
pkg/controller/core.oam.dev/v1alpha2/core/scopes/healthscope/healthscope.go:37:2: package "github.com/oam-dev/kubevela/apis/core.oam.dev/v1alpha2" is being imported more than once (ST1019)
	pkg/controller/core.oam.dev/v1alpha2/core/scopes/healthscope/healthscope.go:38:2: other import of "github.com/oam-dev/kubevela/apis/core.oam.dev/v1alpha2"
pkg/controller/core.oam.dev/v1alpha2/core/scopes/healthscope/healthscope_controller_test.go:27:2: package "github.com/oam-dev/kubevela/apis/core.oam.dev/v1alpha2" is being imported more than once (ST1019)
	pkg/controller/core.oam.dev/v1alpha2/core/scopes/healthscope/healthscope_controller_test.go:28:2: other import of "github.com/oam-dev/kubevela/apis/core.oam.dev/v1alpha2"
pkg/controller/standard.oam.dev/v1alpha1/autoscaler/autoscaler_controller.go:36:2: package "github.com/oam-dev/kubevela/pkg/oam/util" is being imported more than once (ST1019)
	pkg/controller/standard.oam.dev/v1alpha1/autoscaler/autoscaler_controller.go:37:2: other import of "github.com/oam-dev/kubevela/pkg/oam/util"
pkg/controller/standard.oam.dev/v1alpha1/routes/route_controller.go:32:2: package "github.com/crossplane/crossplane-runtime/apis/core/v1alpha1" is being imported more than once (ST1019)
	pkg/controller/standard.oam.dev/v1alpha1/routes/route_controller.go:33:2: other import of "github.com/crossplane/crossplane-runtime/apis/core/v1alpha1"
pkg/plugins/cluster.go:16:2: package "github.com/oam-dev/kubevela/apis/core.oam.dev/v1alpha2" is being imported more than once (ST1019)
	pkg/plugins/cluster.go:17:2: other import of "github.com/oam-dev/kubevela/apis/core.oam.dev/v1alpha2"
pkg/server/appHandlers.go:13:2: package "github.com/oam-dev/kubevela/pkg/utils/env" is being imported more than once (ST1019)
	pkg/server/appHandlers.go:14:2: other import of "github.com/oam-dev/kubevela/pkg/utils/env"
pkg/server/util/errors.go:61:19: error strings should not be capitalized (ST1005)
pkg/serverlib/application.go:22:2: package "github.com/oam-dev/kubevela/apis/core.oam.dev/v1alpha2" is being imported more than once (ST1019)
	pkg/serverlib/application.go:23:2: other import of "github.com/oam-dev/kubevela/apis/core.oam.dev/v1alpha2"
pkg/serverlib/definition_test.go:215:4: this value of err is never used (SA4006)
pkg/serverlib/workload.go:16:2: package "github.com/oam-dev/kubevela/pkg/commands/util" is being imported more than once (ST1019)
	pkg/serverlib/workload.go:17:2: other import of "github.com/oam-dev/kubevela/pkg/commands/util"
pkg/utils/apply/apply_suite_test.go:25:5: var mgrclose is unused (U1000)
pkg/webhook/core.oam.dev/v1alpha2/applicationconfiguration/validating_handler.go:168:31: error strings should not end with punctuation or a newline (ST1005)
pkg/webhook/core.oam.dev/v1alpha2/applicationconfiguration/validating_handler.go:171:31: error strings should not end with punctuation or a newline (ST1005)
test/e2e-test/component_version_test.go:14:2: package "k8s.io/api/apps/v1" is being imported more than once (ST1019)
	test/e2e-test/component_version_test.go:15:2: other import of "k8s.io/api/apps/v1"

The issue should fix these issues and the check add it into github action just like the lint check:
https://github.com/oam-dev/kubevela/blob/master/.github/workflows/go.yml#L117

#958

#958

We need to add that to the make file too so users can check that locally

We need to add that to the make file too so users can check that locally

@ryanzhang-oss  It's added:
make staticcheck

@ryanzhang-oss  It's added:
make staticcheck


About the ctrl&p

When I updated the vim8(version 8.1.150), I found a problem. When I used ctrl&p, it would not search for other files, but now it will search for other files, and then it will be a bit stuck. How can I solve it?

Well, for a starter you could try to be more precise what the problem is. Start with a clear description of what Vim version you are using (and what previous version), what you did and what you expect and what happened. If possible try to reproduce the problem starting from vim --clean -c ....
For now, I don't even know if you are talking about the ctrl-p vim plugin or ctrl-p key press (in what mode)? So please clarify

Oh..sorry
The version I am using is 8.1.150, then ctrl-p I think it should be the native function of vim, I have not installed any modules. I usually use ctrl-p to complete my code, but I just found out that during the process of completing my code, vim will search for the code in my other files.I forgot what the previous version is, maybe 8.0 XD
@chrisbra

I think it should not be a plugin for the completion code called ctrlp. This is to complete the code with ctrl-p while in the input mode. I think scanning in other files is a nice feature, but I wonder if it can be turned off with some kind of switch? Because it will scan other files, it will be slightly stuck (just a little, maybe my computer is not good enough)
Actually, I am a newbie.XD，but I love vim.

Oh..sorry
The version I am using is 8.1.150, then ctrl-p I think it should be the native function of vim, I have not installed any modules. I usually use ctrl-p to complete my code, but I just found out that during the process of completing my code, vim will search for the code in my other files.I forgot what the previous version is, maybe 8.0 XD

You probably run into this issue in the todo list:
Completion mixes results from the current buffer with tags and
other files.  Happens when typing CTRL-N while still search for
results.  E.g., type "b_" in terminal.c and then CTRL-N twice.
Should do current file first and not split it up when more
results are found.  (Also #1890)

It annoys me too.  I'll move it up in the todo list.
--
In Africa some of the native tribes have a custom of beating the ground
with clubs and uttering spine chilling cries.  Anthropologists call
this a form of primitive self-expression.  In America we call it golf.
/// Bram Moolenaar --<EMAIL_ADDRESS>-- http://www.Moolenaar.net   \
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \
\\  an exciting new programming language -- http://www.Zimbu.org        ///
\\            help me help AIDS victims -- http://ICCF-Holland.org    ///


feat/interoperability

This PR adds a new exercise about contract interoperability.
I had to update the compiler version to the last main for it to work.
Time spent: 3 hours

This item belongs to payment request #19A990 on OnlyDust:

from shramee to enitrat
14 items included
$500 for 1 day of work


Documents

If there are a document for YYWebImage, i think it will be better.

Read the online documentation: http://cocoadocs.org/docsets/YYWebImage/
or you can generate the documentation with appledoc.

Thanks


Update sbt-scalafmt to 2.4.6

Updates org.scalameta:sbt-scalafmt from 2.4.4 to 2.4.6.
GitHub Release Notes - Version Diff
I'll automatically update this PR to resolve conflicts as long as you don't change it yourself.
If you'd like to skip this version, you can just close this PR. If you have any feedback, just mention me in the comments below.
Configure Scala Steward for your repository with a .scala-steward.conf file.
Have a fantastic day writing Scala!

Ignore future updates
Add this to your .scala-steward.conf file to ignore future updates of this dependency:
updates.ignore = [ { groupId = "org.scalameta", artifactId = "sbt-scalafmt" } ]

labels: sbt-plugin-update, early-semver-patch, semver-spec-patch, commit-count:1

Codecov Report

Merging #1041 (e45868c) into develop (5a947cb) will decrease coverage by 0.05%.
The diff coverage is n/a.

@@             Coverage Diff             @@
##           develop    #1041      +/-   ##
===========================================
- Coverage    89.65%   89.60%   -0.06%
===========================================
  Files          124      124
  Lines         9912     9912
  Branches       509      509
===========================================
- Hits          8887     8882       -5
- Misses        1025     1030       +5

Impacted Files
Coverage Δ

...src/main/scala/com/twitter/algebird/Interval.scala
76.52% <0.00%> (-6.96%)
:arrow_down:

...a/com/twitter/algebird/immutable/BloomFilter.scala
94.26% <0.00%> (-1.64%)
:arrow_down:

.../scala/com/twitter/algebird/immutable/BitSet.scala
96.78% <0.00%> (+0.21%)
:arrow_up:

.../main/scala/com/twitter/algebird/BloomFilter.scala
95.13% <0.00%> (+0.88%)
:arrow_up:

.../main/scala/com/twitter/algebird/Applicative.scala
55.17% <0.00%> (+3.44%)
:arrow_up:

.../main/scala/com/twitter/algebird/Successible.scala
95.83% <0.00%> (+4.16%)
:arrow_up:

Continue to review full report at Codecov.

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


[AST] Properly recurse when reconstituting sugar

Currently even when reconstituteSugar's Recursive parameter is set to true, we stop rebuilding sugar upon hitting a desugared type. For example Optional<Optional<Int>> will only be re-sugared to Optional<Int>?. This PR changes the behaviour so we continue recursing into the generic argument.
(Noticed by inspection)

cc. @slavapestov

@swift-ci please smoke test and merge


Unable to install

So sorry that this didn't work for you!
I have updated our module's listing and it should now have the correct link to the file.
If that hasn't resolved the problem please reach out again, or install manually from this link:
https://github.com/dddice/dddice-foundry-plugin/releases/download/v0.1.0/module.json

Works! Thanks


Register candidates to a network ID of validator instead of name

This can only be done if we mandate that validator give network id. Which we currently don't - so closing.


added sticky footer version select

@DanKerns the PR was not working well on pages that were not the full height... I've made changes for the layout to play friendly in mobile view as well.
Menu is sticky to top and version is sticky to bottom:


Screenshots on Visual Studio Marketplace are not displayed

Thanks for your report. @daalcant is handling publishing here.

Done as donuts.


Create data table pagination on /dashboard

#183 - Related issue.
/dashboard page contains data table that displays usage logs. The data in the table is dynamic so when user does some filtering, or selects specific area on a chart, data in the table instantly updates.
Since data table is built using dc.js library, there is no pagination attached to the table "out of the box".
Definition of done

[x] Determine if DC uses DataTables.js
[x] Review, if it possible to attach pagination to dc data table

[x] If not, review other solutions how data table can have pagination.

[x] Demonstrate working data table with pagination

@frenchbread Can you please describe this task?

This can be done with Tabular Tables easily. Only issue is that we lose the dynamic functionality of DC.js. The table will show all the available data at the same time.

@JuusoV Here is the working branch where we did some refactoring. Now it can be a bit easier to attach pagination to data table.

I opened a feature request on the DC.js repository for integration with DataTables.js

Awesome. Great stuff guys!

@frenchbread please get some sample data to work with. This way we won't have to wait for a round-trip from the Elastic server. The sample data can be passed in to the parseData function now that the code is refactored.

@brylie Here is the sample data example at gist

@frenchbread doing what he knows the best here. Really amazing job! The task is pretty much done and I will create PR asap after some cleanup.

@JuusoV Ok, no problem. Create a PR whenever it's ready. Probably will need to do some more code refactoring but it is fine for now.

Thumbs up for you, guys! Thanks!


AutoCompleteList fails to display when parent is pre-rendered

As the title states, if the parent containing an AutoComplete component is pre-rendered, the AutoCompleteList never displays...
Here's a reproduction
Workaround: Add isLazy or similar prop to your parent (as shown in the repro)

@anubra266 also as an FYI if you adjust the window size, the current tab will show the list and the other tab's list will be hidden... kinda funky 😕 I don't know enough about React's rendering to know where the problem might lie, but this is obviously super low priority given the super easy workaround!


Update alpine/scratch to 3.16

I've matched the changes in a previous update - I think I've got it right?
I've also update the versions table in the README for missing versions (4.4 and 5.0) and missing alpine/scratch distros (3.13), as well as adding in 3.16.

hoping to see this merged soon, thanks @rhodgkins!

Ah sorry, there's conflict, can you rebase ?
It looks good !


[DEV] How to obtain parameters from showScreenPopup?

I have a command
			this.myCommand = Utils.createCommand(this, function() { 				console.log(this.message()); 			    kn.showScreenPopup(__webpack_require__(/*! View/Popup/myPopUp */ 170),[this.message()]); 			});
the pop-up is displayed but how can I access passed parameters inside my module myPopUp()?

@RainLoop Any info on that matter?

Well, figured on my own.


fix concurrent database access with multiple instances

HashUtils was shared between PalDb instances. This caused errors when using multiple instances concurrently because of simultanious usage of Murmur3A.

Good catch! Thanks!


TensorFlow example on py> operator

This is an experimental workflow. It doesn't work on production environment yet
This example introduces sentiment analysis for movie reviews using TensorFlow and TensorFlow Hub.
Original example is written in the official document.
This workflow will:

Fetch review data from Treasure Data
Build a model with TensorFlow
Store the model on S3
Predict polarities for unknown review data and write back to Treasure Data

[x] Test with CPU image
[ ] Test with GPU image

Not tested on GPU pod. Will try in next week. Or, will revert 4b776eb

@chezou Is still WIP?

I will revert using GPU image and will send another PR for it after evaluation.

@myui I've updated with evaluated code. Ready to merge.


Small exit button in diff review panel

Testing #29496
In themes (incl. High Contrast theme) close button (cross in top right corner) is barely visible.
Maybe it's worth to make the quit-cross bigger if some people use high contrast together with screen reader?

The icon doesn't change with the dark theme, so that needs to be fixed, but the size is the same as the x button in other places, such as in the reference search (where I copied the button from), so I wouldn't mess with the size.


Learn CRDB SQL MovR update

#5040
This PR includes the "Learn CockroachDB SQL" MovR update, originally a part of the #5075 PR. I broke it out into a different feature branch because of the conflicts with MSO...

This change is

Online preview: http://cockroach-docs-review.s3-website-us-east-1.amazonaws.com/03b5f55abdea5d446f1de79881996eb593b7e897/
Edited pages:

v19.2/learn-cockroachdb-sql.md

Online preview: http://cockroach-docs-review.s3-website-us-east-1.amazonaws.com/2dfb9d09b084d62d27998bfedbba1187b4f0eb45/
Edited pages:

v19.2/learn-cockroachdb-sql.md

@jseldess As you can see in the file diff, I crammed in two separate Learn CRDB SQL instructions... One that uses MovR, for the standard 19.2 docs, and one that does not use MovR (it is essentially identical to the 19.1 Learn CRDB SQL page), for managed.

Online preview: http://cockroach-docs-review.s3-website-us-east-1.amazonaws.com/41a0afb84c173ef47df075aeb6a23d192f01f828/
Edited pages:

v19.2/learn-cockroachdb-sql.md


Patch

Checklist

[x] Used a fork of the feedstock to propose changes
[x] Bumped the build number (if the version is unchanged)
[x] Reset the build number to 0 (if the version changed)
[x] Re-rendered with the latest conda-smithy (Use the phrase @conda-forge-admin, please rerender in a comment in this PR for automated rerendering)
[x] Ensured the license file is being packaged.

Hi! This is the friendly automated conda-forge-linting service.
I just wanted to let you know that I linted all conda-recipes in your PR (recipe) and found it was in an excellent condition.

@conda-forge-admin, please rerender

Hi! This is the friendly automated conda-forge-webservice.
I tried to re-render for you, but it looks like I wasn't able to push to the patch-3 branch of jan-janssen/kim-api-feedstock. Did you check the "Allow edits from maintainers" box?


Constraint Syntax Error

All of my constraint equations have syntax errors. For this particular one, I want to all the values in the first row of QH_it to equal all  except the first values in the first row of IH_it.
`N = 8
T = 40
QH_it = Variable((N,T))
IH_it = Variable((N,T))
C1 = [QH_it[0,1:] == IH_it[0,1:]]'

All of my constraint equations have syntax errors. For this particular one, I want to all the values in the first row of QH_it to equal all except the first values in the first row of IH_it.
`N = 8 T = 40
QH_it = Variable((N,T)) IH_it = Variable((N,T))
C1 = [QH_it[0,1:] == IH_it[0,1:]]'

Hi @cfernan7 can you show the precise code which didn't work? I ran the following code, and everything worked fine.
(cvx38) riley@borneophant:~$ python
Python 3.8.5 (default, Aug  5 2020, 08:36:46)
[GCC 7.3.0] :: Anaconda, Inc. on linux
Type "help", "copyright", "credits" or "license" for more information.

>>> from cvxpy import Variable
Using the Community license in this session. If you have a full Xpress license, first set the XPAUTH_PATH environment variable to the full path to your license file, xpauth.xpr, and then restart Python. If you want to use the FICO Community license and no longer want to see this message, set the XPAUTH_PATH environment variable to: /home/riley/anaconda3/envs/cvx38/lib/python3.8/site-packages/xpress/license/community-xpauth.xpr
NB: setting XPAUTH_PATH will also affect any other Xpress products installed on your system.

>>> N = 8
>>> T = 40
>>>
>>> QH_it = Variable((N,T))
>>> IH_it = Variable((N,T))
>>>
>>> C1 = [QH_it[0,1:] == IH_it[0,1:]]
>>>

Hi @rileyjmurray. Here's the whole code and the csv file. All of the constraints give me an invalid syntax error.
`#""" Import given data """
data = pd.read_csv('p2data.csv', header=0, index_col=0)
all units are in TAF
#""" Extract constraint variables """
Reach_cap = data.iloc[:,0].values
U_turnout_cap = data.iloc[:,1].values
A_turnout_cap = data.iloc[:,2].values
U_demand = data.iloc[:,3].values
A_demand = data.iloc[:,4].values
HQ_available = data.iloc[:,5].values
LQ_available = data.iloc[:,6].values
#""" Define decision varibale matrixes """
N = 8   # number of reaches
T = 40  # time steps
Variable_Location,Time
all units in TAF/time-step
QH_it = Variable((N,T))  # HQ outflows
QL_it = Variable((N,T))  # LQ outflows
AH_it = Variable((N,T))  # HQ ag flows
AL_it = Variable((N,T))  # LQ ag flows
UH_it = Variable((N,T))  # HQ urban flows
UL_it = Variable((N,T))  # LQ urban flows
IH_it = Variable((N,T))  # HQ inflows
IL_it = Variable((N,T))  # LQ inflows
S_it  = Variable((N,T))  # water quality mixing
""" Objective function """
P = 1 # $/TAF
obj = Maximize(sum(1sum(UH_it[:,:]) + .5sum(UL_it[:,:])
+ .4sum(AH_it[:,:]) + .25sum(AL_it[:,:])
- P*sum(S_it[:,:]))
($/TAF) * TAF
""" Constraints
variable matrixes: [location, time step]
variable arrays: [location] """
1. MASS BALANCE
need: quantifies how much water is moving in any 'direction' (A, U, Q, I)
at each reach
1st reach - the outflow is equal to the inflows (no A or U flows)
Q[0,1:] = [all of 1st row (reach 1), everything after 1st time step]
C1 = [QH_it[0,1:] == IH_it[0,1:]]
high quality - water available at j,t+1 is the (in-outflow) at i,t + inflow
at j,t+1
Q[:-1,:-1] = Q_it, Q[1:,1:] = Q_j,t+1
C1_H = [QH_it[:-1,:-1] - AH_it[:-1,:-1] - UH_it[:-1,:-1]
+ IH_it[1:,1:] == QH_it[1:,1:]]
low quality - same as above
C1_L = [QL_it[:-1,:-1] - AL_it[:-1,:-1] - UL_it[:-1,:-1]
+ IL_it[:1,:1] == QL_it[:1,:1]]
2. WATER DEMAND
need: HQ/LQ water at A and U consumers cannot exceed respective demand
ag consumers
A[:,:] = A_it, A_demand[:]= A_demand_i
C2_A = [sum(AH_it[:,:] + AL_it[:,:]) <= A_demand[:]]
urban consumers - same as above
C2_U = [sum(UH_it[:,:] + UL_it[:,:]) <= U_demand[:]]
3. WATER AVAILABILITY
need: all inflows at i,t cannot exceed total inflows at i
high quality
I[:,:] = I_it, HQ_avail[:]= HQ_avail_i
C3_H = [sum(IH_it[:,:]) <= HQ_available[:]]
low quality - same as above
C3_L = [sum(IL_it[:,:]) <= LQ_available[:]]
4. TURNOUT CAPACITY
need: at any given time and location, the total amount of water delivered
to consumers cannot exceed channel capacity (from junction to consumer)
ag consumers
A[:,:] = A_it, A_turn_cap[:]= A_turn_cap_i
C4_A = [sum(AH_it[:,:] + AL_it[:,:]) <= A_turnout_cap[:]]
urban consumers - same as above
C4_U = [sum(UH_it[:,:] + UL_it[:,:]) <= U_turnout_cap[:]]
5. REACH CAPACITY
need: at any given time and location, the total amount of water traveling
between reach junctions cannot exceed channel capacity
Q[:,:] = Q_it, Reach_cap[:]= Reach_cap_i
C5 = [sum(QH_it[:,:] + QL_it[:,:]) <= Reach_cap[:]]
6. INITIAL = FINAL CONDITION
need: assuming the intial outflow (t=0) at each location equals
final outflow (t=40)
high quality
Q[:,0] = Q_i,t=0, Q[:,-1] = Q_i,t=40
C6_H = [QH_it[:,0] == QH_it[:,-1]]
low quality
C6_L = [QL_it[:,0] == QL_it[:,-1]]
7. penalty
need: want to discourage the amount of interphase between high and low
quality water (more interphases = more mixing)
#Q[:-1,:] = Q_it, Q[1:,:] = Q_j,t
C7 = [QH_it[1:,:] - QH_it[:-1,:] == S_it[:-1,:]]
CONSTRAINT EQUATION
constraints = C1 + C1_H + C1_L + C2_A + C2_U + C3_H + C3_L + C4_A + C4_U + C5 + C6_H + C6_L + C7
""" *** PART C: define the problem *** """
form and solve problem
prob = Problem(obj, constraints)
prob.solve(solver=SCS,verbose=True) # scs = solver for LP
print('Status: %s' % prob.status) # tells whether soln is optimal or not
gives optimal soln (max benefit)
print('Obj Fun: %f' % `obj.value)``
p2data.csv

@cfernan7 it looks like you're using from cvxpy import *. Can you update your script to import cvxpy as cp and then use functions like cp.sum, cp.Problem, cp.Variable, etc..?

Ping @cfernan7. Let me know about the point above when you get a chance.


set timeout back to 2 hours

increase timeout which was set at 10 minutes for debug and stayed there for a long time 🙃
properly set the run as failed if there is errors or timeout.
Closes #542
Signed-off-by: Chmouel Boudjnah<EMAIL_ADDRESS>
Changes

Submitter Checklist

[ ] ♽  Run make test lint before submitting a PR (ie: via pre-push github hook no need to waste CPU cycle on CI
[ ] 📖 If you are adding a user facing feature or make a change of the behavior, please make sure to document it
[ ] 🧪 100% coverage is not a target but most of the time we would rather have a unit test if you make a code change.
[ ] 🎁 If that's something that is possible to do please make sure to check if we can add a e2e test.
[ ] 🔎 If there is a flakiness in the CI tests then make sure to get the flakyness fixed before merging or if that's not possible there is a good reason to bypass it.

See the developer guide for a bit more details.

we will need 0.5.8 I guess?

@sm43 ah should have done a DNM, it seems there is another issue somewhere.. it should have used the global timeout as set int he config.. no worries, i'll do a fix on top  of it...


Option to disable all stickers / images / GIFs

A so-called Safe for Work mode that disables everything except text, optionally we could also extend this to Display Profile photos and replace those with the default capital letter on a coloured background.
Would this be feasible?

Yep! I think this would be fairly easy to implement.


Generate Invite link is locating go.onelink.me

Report
Plugin Version
6.12.2
On what Platform are you having the issue?
android
ios works fine
What did you do?
I tried to generate a deep link. Here's the code
appsFlyer.setAppInviteOneLinkID('8kih');
appsFlyer.generateInviteLink(
  {
    channel: 'gmail',
    campaign: 'SMS Campaign',
    customerID: '123ref123',
    userParams: {
      referralId: referralId,
    },
  },
  link => {
    console.log('generate link', link);
  },
  err => {
    console.log('generate link error', err);
  },
);

What did you expect to happen?
I am expecting the link to be in this format. https://myappname.onelink.me
What happened instead?
But i got https://go.onelink.me.

Just commenting here as I had the same issue and contacted support for assistance. Not sure if this will fix the issue for everyone, but it did for me.
You need to add the line for setting the template ID before you initialise the SDK. The documentation isn't too clear on this currently, but that was the solution provided by support for me and it worked.
Once the template ID is set, and then you initialise the SDK, you can then call the generateInviteLink anywhere in your app and it will generate using the correct subdomain.

@ViswaDB Please try what @Shiggins95 suggested and let us know if it helped

@ViswaDB Please try what @Shiggins95 suggested and let us know if it helped

I tried it, but I obtain links to go.onelink.me

@ViswaDB Please try what @Shiggins95 suggested and let us know if it helped

Yes after setAppInviteOneLinkID in app js, it's returning correct link in generateInviteLink.

@ViswaDB my link is generated with the correct domain name, but it is not navigating to play store or opening the installed app but my oneLink with the same domain doing both. what could be the reason


Add section about not including sources in Display impl

This PR tries to codify what's being brought up in this forum thread:
https://users.rust-lang.org/t/do-people-not-care-about-printable-error-chains-a-k-a-how-to-nicely-implement-display-for-an-error/35362
These guidelines are still lacking a lot of information about how to design error types well overall. How to make composite errors vs leaf errors etc. This includes when and how to implement Error::source. But a good start is at least to try to stop people from making their errors contain a lot of redundant information.

We can word it differently and maybe skip the example. But I feel it would be good if the guidelines touched on this topic in general. If we agree it's a good guideline that is. Because I see people regularly break this pattern in the wild, and it makes errors look bad when printed.

i.e. if you want context, use any of the error-chain libraries, but keep error messages clean? would you still recommend to add some context, e.g. if opening a file failed, include the path?

By "context" to you mean to have the error return the source error from its "Error::source" implementation? I think errors should return the error that caused them where relevant, yes. But I don't think the official guidelines should recommend any third party library for doing so. It's perfectly fine to store the source error and return it from Error::source manually. The only thing the third party crates help with is to reduce the boilerplate needed to create types that adhere to the best practices anyway.
Yes, an error failing to open a path can indeed include the path in the Display impl if it wants to. That is orthogonal and unrelated to including the source error. See this example:
pub struct OpenSettingsError {
    path: PathBuf,
    source: io::Error,
}

impl fmt::Display for OpenSettingsError {
    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
        write!(f, "failed to open settings at {}", self.path.display()),
    }
}

impl Error for OpenSettingsError {
    fn source(&self) -> Option<&(dyn Error + 'static)> {
        Some(&self.source)
    }
}

I think one of the confusing parts here is how some third party error libraries use the word "context". My understanding is that most of them when "attaching context" to an error means they wrap the original error as a source error of whatever "context" you provide? As an example, something like an_error.context("Failed to garble") returns a new error that prints as "Failed to garble" and then returns an_error if you call .source() on it?

I'm not sure I agree with promoting this to an API guideline at this point in time. Certainly, if we had started with the current definition of the std::error::Error trait, then I would agree with it. The problem is that the Error trait has only recently evolved to a point where this sort of API guideline is actually reasonable. Which means a lot of crates aren't actually doing this correctly.
I'm not quite sure how to handle this. If an implementation is including source errors in its Display impl, then "fixing" that would appear to be a breaking change no matter how you slice it. Namely:

Removing source errors from the Display impl means that all existing uses of println!("{}", some_error) will result in much worse error messages.
Removing source errors from the source method that are used in Display is a breaking change in the sense that the underlying errors can no longer be accessed.

I think that the advice in this PR is probably correct moving forward, so perhaps the wording could be changed to acknowledge the current situation with appropriate context.
This is still quite gnarly though, because if you're doing println!("{}", some_error) and you're not using some error helper crate, then your error messages might end up getting clipped from some crates but not others.

The problem is that the Error trait has only recently evolved to a point where this sort of API guideline is actually reasonable.

I don't think I understand. Error::cause has been around a long time and it has been used by error-chain and manually since basically forever to print errors together with their causes/sources. It has never been a good practice to include your source/cause in your parent error IMO. The only thing that recently changed is the name of the method to get the cause/source and the fact that it now supports downcasting.

If an implementation is including source errors in its Display impl, then "fixing" that would appear to be a breaking change no matter how you slice it.

Depending on the definition of breaking. In my book it's not. The API does not change. Only runtime results. But yes, I agree with your two points about how existing programs could potentially get worse error messages if they start using libraries designed for the current Error trait without updating their error handling code. Regarding point 2 about removing sources breaks programs: Yeah, that's why it sucks that people rely on opaque errors and downcasting them. You can't tell from compile time if you do your error handling correctly or not.

I think that the advice in this PR is probably correct moving forward, so perhaps the wording could be changed to acknowledge the current situation with appropriate context.

We can indeed word it in some way so people understand the difference between new and old Error. I think the guideline should encourage users to write errors according to the latest best practice. And it could in the same place tell them how to best use said errors in applications.

I'm not sure I agree with promoting this to an API guideline at this point in time. Certainly, if we had started with the current definition of the std::error::Error trait, then I would agree with it.

In my opinion the guidelines have to reflect the best practices of the latest version of Rust. I strongly believe this. If we don't encourage new users to the language to use the new stuff, why do we even invent new better stuff? To say "not at this point in time" if the preferred point in time already passed is a strange argument for me. Because it by definition means it should never be done. And then we'll sit with bad errors five years from now as well. If we encourage people to write software according to the latest best practices all the time, then the amount of "old" software will be a shrinking percentage of all Rust software. But if we encourage people to support the old standard then the amount of "old" software will continue grow forever. And the more it grows the argument for supporting it even further grows. Which is why I never opt for backwards compatibility.
If people have existing code bases they also already have experience in Rust and they probably have already established best practices/guidelines for their own code base. For me the guidelines has always been "This is the best possible thing to do if you are on a clean slate and/or are not limited by other stuff". If a new library is published on crates.io I expect it to have the best possible API for the latest Rust at that point in time. And if I write an application and I pull in a new dependency it's my responsibility to check how I should print/handle the errors from said library.
Regarding existing applications using existing libraries that suddenly change how their errors look/behave: This is why I like checked exceptions and structured errors, and not downcasting. If the users of your library are expected to want to destructure your error into exact types and source errors, then the exact error types are part of your public API and changing anything about them is practically breaking. But it's not technically breaking if the error is opaque and people use downcasting.

Alternative solution: Deprecate source and make the guideline be to fully explain an error (including its source) in the Display impl. IMO that's even better. I have never understood the usage of source anyway. If I want to destructure an error I create a structured error that I can pick apart with compile time checks.

My takeaway is that we first need to figure out what the preferred way of using errors is, before we know the best way to design them.

How should applications print errors
How should applications/libraries destructure errors

:)

cc @rust-lang/project-error-handling
This guideline deals with implementations of Display for Errors with respect to their implementation of Error::source.

relevant thread https://github.com/rust-lang/project-error-handling/issues/23

I sense a possible vicious cycle:

Producers of errors are incentivized to include as much context as possible in every error message since they can't rely on end users seeing messages from sources.
Applications that report errors by concatenating source messages find their error reports to be redundant (because of 1). They'd prefer not to write bespoke message-munging code for each error, so default to only printing the message from the topmost error.
The incentive in point 1 is strengthened.

If this is true it makes it unlikely that the ecosystem will ever naturally evolve towards a world where the source chain is useful and structured error reporting is the norm, even if a majority of rustaceans would prefer to live in such a world.
(I'm not sure how accurately this reflects reality—someone who's in tune with a large slice of the crate ecosystem might be able to say.)

I agree with the message of @mkantor above: the lack of consistency makes it harder to predict what will be present in the message or what will be reported.
It's been about 4 years since the issue was open, and I feel that most reporters converged on relying on the source. I feel like it's getting urgent to stabilize the guideline to avoid displaying the source message. Related to this unclear situation, snafu is resorting to manually clean-up the error message to remove the underlying source message.
Lack of guidelines makes it also harder to point to a source when there are discussion around error implementations.

snafu is resorting to manually clean-up the error message to remove the underlying source message

In addition, I'm working on releasing SNAFU 0.8 (sometime this month, 🤞) which will no longer include the source message in the default Display implementation and I've removed the usage of source inside the Display implementation from the documentation / examples.
I'm doing my part!


updating jlab support

updating for latest jupyterlab support. using typescript to avoid silent-incompatibility

tested with 0.29.2, but will update to latest soon

Thanks, I'll try this out and include it in the next release.  I should be able to get to it within the next week or so.

cool lmk if you have questions. I converted it to typescript for safety, and because i'm only familiar with writing jlab extensions in ts.

you may have an issue with "semver: cannot find...", working to fix that with jupyterlab but it basically has to do with 1.0.0b9 vs 1.0.0-beta.9. The version disparity should probably be fixed in a separate PR

I started looking into this today and it seems like there's a new stable plugin API (maybe in juypterlab 0.30? not totally sure when it was introduced) which will allow us to handle jupyterlab support within the main qgrid npm package. This would be a big win, because I wouldn't have to publish a separate npm package for jupyterlab support every time I make a release.  Here's a PR which shows this change, in the bqplot repository, which is a widget that's maintained by on of the ipywidgets developers: https://github.com/bloomberg/bqplot/pull/566/files
I'm going to try making the same changes in the qgrid repo and see if I can get it working with 0.30 today. Just wanted to let you know so you don't spend too much time working on the separate jupyterlab npm package.

@timkpaine I merged a PR (https://github.com/quantopian/qgrid/pull/152) which I think will allow qgrid to work with jupyterlab 0.30.x, and created a new release which includes that fix. I don't think we need this PR anymore so I'm going to close it.  Thanks for opening it though, I wouldn't have known to look into updating jlab support otherwise.  Also feel free to let me know if the fix doesn't work for you for some reason. You can follow the installation steps in the README (https://github.com/quantopian/qgrid#jupyterlab-installation) to try out the fix (they've changed slightly).


[Event Request] codeunit 393 "Reminder-Issue" - OnUpdateCustLedgEntryLastIssuedReminderLevelOnBeforeModify

Can you extend the Event  OnUpdateCustLedgEntryLastIssuedReminderLevelOnBeforeModify with ReminderFinChargeEntry
    procedure UpdateCustLedgEntryLastIssuedReminderLevel(ReminderFinChargeEntry: Record "Reminder/Fin. Charge Entry")
    var
        CustLedgEntry: Record "Cust. Ledger Entry";
    begin
        CustLedgEntry.LockTable();
        CustLedgEntry.Get(ReminderFinChargeEntry."Customer Entry No.");
        CustLedgEntry."Last Issued Reminder Level" := ReminderFinChargeEntry."Reminder Level";
        OnUpdateCustLedgEntryLastIssuedReminderLevelOnBeforeModify(CustLedgEntry, ReminderFinChargeEntry);
        CustLedgEntry.Modify();
    end;

    [IntegrationEvent(false, false)]
    local procedure OnUpdateCustLedgEntryLastIssuedReminderLevelOnBeforeModify(var CustLedgEntry: Record "Cust. Ledger Entry", ReminderFinChargeEntry: Record "Reminder/Fin. Charge Entry"
)
    begin
    end;

Thanks for reporting this. We agree, and we’ll publish a fix asap, either in an update for the current version or in the next major release. Please do not reply to this, as we do not monitor closed issues. If you have follow-up questions or requests, please create a new issue where you reference this one.


how to destroy a stream cleanly

Hi All, here is my issue
many clients will connect and pipe their data into mainStream
net.createServer (socket) ->
    clientStream = h(socket)
    clientStream.fork().pipe mainStream

However, my question is what happens the the socket closes, does highland destroys clientStream and unpipes it from mainStream?
When i disconnect and connect the client 11 times i get this warning:
(node) warning: possible EventEmitter memory leak detected. 11 drain listeners added. Use emitter.setMaxListeners() to increase limit.
Trace
    at Stream.addListener (events.js:239:17)
    at pipeStream (/Users/benjaminhon/Developer/IndoorLocalization/server/localization-server/node_modules/highland/lib/index.js:501:10)
    at Stream.pipe (/Users/benjaminhon/Developer/IndoorLocalization/server/localization-server/node_modules/highland/lib/index.js:1008:12)

it seems some event listeners are not removed? do i need to do this manually and unripe manually?
Thx

Highland should destroy clientStream when the socket ends and remove its drain listener. I had no problems connecting and disconnecting to the server more than 11 times without seeing this message. I simply started and stopped telnet 12 times.
Are you sure there aren't 12 concurrent clients connected to the server when this message appears?
The other possibility is that the socket closed without the stream noticing. This used to happen if the underlying Readable emits close without emitting end, and was very recently fixed in #479. I'm not sure if sockets can behave this way, but can you test against the latest master to see if you still have this problem? I haven't gotten around to releasing the fix to NPM yet.

Hi victor,
yep, its only 1 client. Yea there is no way that i can ensure that END happens before CLOSE, as the device might crash or terminated without closing the socket properly. I've noticed that sometimes CLOSE happens and END does not happen.

You should be able to do socket.on('close', () => clientStream.destroy()).

Hmm it seems the problem seems to be the piping function not disassociating itself properly when the socket ENDS or CLOSES
when socket ENDS of CLOSES, it seems all the forks terminates well and i don't get any leaks
deviceStream = h(socket)
deviceStream.fork().each (x) -> console.log x

however, if i consume it with pipe, then it seems when socket closes, the pipe is not disassociated correctly. I've confirmed that i received the END event though. So perhaps its another problem?
deviceStream = h(socket)
deviceStream.fork().pipe nodeStream

Sorry, a correction,
socket.on('close', () => clientStream.destroy())

does indeed remove the 'drain' listener from. I had a look at the source code for the pipeStream function
dest.on('drain', onConsumerDrain);

src._destructors.push(function () {
    dest.removeListener('drain', onConsumerDrain);
});

so i guess that when the socket CLOSES, its destructor is not called, thus needed us to manually call destroy() the stream

doesn't seem that the unpipe() function from node streams is exposed in the highland api?

Highland streams aren't Node streams. pipe is provided for interop with node streams, but we don't support unpipe.

Mainly that the source highland stream is not destroying itself when the socket closes (even when both END and CLOSE events are present).

If this happens, then it is a bug. I can't reproduce though. Can you give me a test case?

On the client do the following many times, after 11 times there will be a warning for 'drain' listener leaks
nc <IP_ADDRESS> 9900
CTRL+C
nc <IP_ADDRESS> 9900
CTRL+C
nc <IP_ADDRESS> 9900
CTRL+C
nc <IP_ADDRESS> 9900
CTRL+C
...

Here is the Server Code, manually calling deviceStream.destroy(), fixes it
  net.createServer (socket) ->
    console.error "#{socket.remoteAddress}:#{socket.remotePort} connected"

    # combine stream
    clientStream = h(socket)
    clientStream.pipe(mainStream, end: false)

    # disconnected
    socket.on 'close', ->
      console.error "#{socket.remoteAddress}:#{socket.remotePort} disconnected"
      # destroy stream, MUST CALL THIS
      deviceStream.destroy()

  # listen
  .listen env.tcpPort, ->
    console.error "tcp server listening on port #{env.tcpPort}"

I couldn't reproduce when setting mainStream to process.stdout (even when setting mainStream.setMaxListeners(1)). I also couldn't do it with a new stream.Writable({highWaterMark: 1}).
However, I do see the behavior when I send something with nc. After sending something from 11 clients, the one immediately after the 11th client causes the error to appear. I could interleave those 11 clients with ones that don't send anything, and they don't end up counting against the 11 clients.
I think your problem is that mainStream is either slow or paused. A Highland stream will not do the cleanup until after it has emitted all of its data. If mainStream is exerting backpressure because it is slow at consuming data, then clientStream will pause until mainStream is ready for more. This means that clientStream may still be in the process of piping to mainStream even though the client has already disconnected. Hence why it looks like a memory leak.
Calling destroy forcibly destroys the clientStream, which is why it seems to fix things in this case. The problem is that if you destroy while there is data still buffered in the socket, you will lose the buffered data.

Hmm yea my mainStream is always processing data, it is never consumed as i need to continually process data with it.

That makes sense. Can you verify that it's not exerting backpressure on the clientStreams? If new clients stop connecting, does the mainStream eventually drain its sources and result in the handlers removed?
Without having a concrete implementation for mainStream, I can't tell whether or not this is a bug in Highland or just the mainStream being a bit slow at processing data.

Hmm, so far the data seems to be processed in time. However, i use batchWithTimeOrCount. Here is whats done to the mainstream.
mainJSONStream = mainStream
  .split()
  .map(parseJSON)
  .reject (x) -> x is null

infoStream = mainJSONStream.fork()
  .filter (x) -> x.info?
  .each ({info: {node, major, minor, nodeBatt}}) ->
   ...[some processing]...

dataStream = mainJSONStream.fork()
  .filter (x) -> x.data?
  .map ({data}) -> data
  .batchWithTimeOrCount 1000, Infinity
  .through movingWindow(4)
  .map (arr) ->
  .each (raw) ->
    ...[some processing]...

Hmm...nothing jumps out at me. batchWithTimeOrCount doesn't exert backpressure by itself. I don't know how movingWindow is implemented, but I can't imagine a reasonable implementation affecting anything.
I assume mainStream is defined like this?
var mainStream = h();

I tried something like this and couldn't provoke the error.
var mainJSONStream = mainStream.split()
    .map(JSON.parse)
    .reject(x => x == null);

var infoStream = mainJSONStream.fork()
    .filter(x => x.info)
    .each(y => _.log('Y: ' + JSON.stringify(y)));

var dataStream = mainJSONStream.fork()
    .filter(x => x.data)
    .map(x => x.data)
    .batchWithTimeOrCount(5000, Infinity)
    .each(x => _.log('X: ' + JSON.stringify(x)));

If you haven't done so already, can you bind a removeListener handler on mainStream to see if the listeners are actually being removed?
mainStream.on('removeListener', event => {
    if (event === 'drain') {
        console.log('drain listener removed');
    }
});

Then remove the call to destroy and try to force the memory leak message to appear again. Once it does, stop connecting with clients and see if the drain listeners are all removed after a while.
Also, you are using v2.7.3+ right?

Hmm nope i am using v2.7.1
var mainStream = h();

2.7.3 fixes a drain listener memory leak, so upgrading may fix the problem for you.


LCD

Hi there,
Would this be able to be modified to run via HDMI to an LCD screen as I want to build it into a picture frame ?
Many thanks

Hi,
this program is creating a PNG and then using then  SPI interface to sent the PNG to the eInk screens. This is not a X application. You could work a round this by using a picture viewer in a desktop environment to display the PNG and reload is once it got updated. You free to fork or copy this project to adjust it to your needs.
Cheers,
Gabbajoe


InternalError: Equivalent entry already exists in the transparency log

After being able to create several attestations, my workflow using this action has now two times in a row failed due to the following error:
Run actions/attest-build-provenance@v[1](https://github.com/hydephp/cli/actions/runs/9466300050/job/26077668879#step:16:1)
Run actions/attest-build-provenance/predicate@db1dde0f270afe12073070ac7aa802958ae3ec04
Run actions/attest@32795ed9174327efe1734fa[6](https://github.com/hydephp/cli/actions/runs/9466300050/job/26077668879#step:16:7)d09c9223658ef225

Error: InternalError: error creating tlog entry - (409) an equivalent entry already exists in the transparency log with UUID 24296fb24b8ad[7](https://github.com/hydephp/cli/actions/runs/9466300050/job/26077668879#step:16:9)7ad1462c39db32ce379b402445ee1bfb00546e4d127500853b563c821125437692
Error: (409) an equivalent entry already exists in the transparency log with UUID 24296fb24b8ad77ad[14](https://github.com/hydephp/cli/actions/runs/9466300050/job/26077668879#step:16:16)62c39db32ce379b402445ee1bfb00546e4d127500853b563c821125437692

Action run logs: https://github.com/hydephp/cli/actions/runs/9466300050/job/26077668879

I can confirm the same over here: https://github.com/mitmproxy/mitmproxy/actions/runs/9466172695/job/26077600512

I can confirm the same over here: https://github.com/mitmproxy/mitmproxy/actions/runs/9466172695/job/26077600512

Did this also happen within the last hour? My last successful attestation was less than 30 minutes ago.

Yes, this also just started for us.

Thanks for confirming. Should make it easier for the team to trace what went wrong. And good to know it's not on my end either.

@caendesilva / @mhils I was able to confirm that there was an issue with the Rekor transparency log yesterday between 6:15am PDT and 6:20am PDT that resulted in increased API latency. I believe what happened is that the request to add the attestation signature to the transparency log timed-out and was retried -- the initial request likely succeeded at some point and the 409 response was reported on the retry.
I'm working on a fix which should make the attestation action more resilient to this sort of thing in the future.
Thanks for the report.

@bdehamer: Thank you for digging into this and providing a detailed explanation, really appreciate it! 🍰 ❤

Thanks for the information, really appreciate it too! The action seems to be working again, so the outage theory seems very valid!

Thanks for reporting the issue. The latest release of the action should better handle this scenario if it happens again.


[Podbay.fm] Support show pages

Successfully used youtube-dl on podbay.fm to download .mp3s.
example show link: http://podbay.fm/show/507135865
example mp3 link: http://podbay.fm/show/507135865/e/1463976000?autostart=1
[debug] System config: [] [debug] User config: [] [debug] Command-line args: [u'-v'] [debug] Encodings: locale UTF-8, fs UTF-8, out UTF-8, pref UTF-8 [debug] youtube-dl version 2016.02.22 [debug] Python version 2.7.11+ - Linux-4.4.0-22-generic-x86_64-with-Ubuntu-16.04-xenial [debug] exe versions: avconv 2.8.6-1ubuntu2, avprobe 2.8.6-1ubuntu2, ffmpeg 2.8.6-1ubuntu2, ffprobe 2.8.6-1ubuntu2, rtmpdump 2.4 [debug] Proxy map: {}

Are you expecting youtube-dl to download all songs in a show page?

youtube-dl -ci http://podbay.fm/show/371045355 and youtube-dl http://podbay.fm/show/371045355 produced "unsupported url."
youtube-dl works on single  .mp3s
youtube-dl -ci and then dragging the "listen" links into terminal worked for multiple mp3s.

Show pages require extra work in youtube-dl.

What is the status of this issue? Was trying this today and the URL is still unsupported.
What kind of work would have to be done in youtube-dl to support podbay?

What kind of work would have to be done in youtube-dl to support the show site of podbay?

A new extractor would need to be written. You can see a tutorial of that here: https://filippo.io/add-support-for-a-new-video-site-to-youtube-dl/
Alternatively consider posting a bounty here: https://www.bountysource.com/issues/34672815-podbay-fm-support-show-pages
It's probably a few hours of work, so something in the $30-$50 dollar range would be pretty good motivation.


Decomposition - symmetric and anti-symmetric

Decompose a quadratic equation into symmetric, antisymmetric parts using its transpose.

@ehuan2 Hi Eric, for some reason I cannot add you as the reviewer. Please take a look at my work. Thank you.

Hi @AnhMai-bit the first thing I'll ask you to do is to remove all the comments and to put the definitions of your b variables all on one line. Please follow the format that were used to verify all other pages of the book. When you are done this, I can look at your code in more detail. You can just commit your newest changes to your patch-1 branch and this pull request will automatically get updates with whatever you commit to there.

Hi @ndattani, I updated the file just now.

Excellent! I'll take a deeper look on Tuesday. Now I'm preparing for a talk I'll be giving in Montreal tomorrow :)

Best of luck with your talk insert lucky clover ! Please also send me the link to the event if online registration is available, I would like to check it out :).

Oh I forgot to mention! Feel free to also edit the latex file with your example! Now that it's verified on MatLab, you can edit the Volume_1/Book_about_Quadratization.tex file. Let me know if you need help on this part, the setup can be a bit rough at times.

@ehuan2 thank you so much Eric. I will update it today. I will let you know on discord if I have more questions.

Alright I think I might've actually given bad advice - I think I forgot what the use of reshape is (and realizing I messed this up myself!). So, reshape is used to rearrange the output values we get into a matrix where we only care about the minimum in each row.
So a good example is if we take a look at pg. 52 of the pdf, we get the example of ba_1 = b1b3, ba_2 = b2b4. In this case, we can see from the output of what b looks like in matlab, that each 4 rows have the same first b1...b4.

This means that when we do reshape, we're essentially saying we don't care about what values we get for ba1, ba2 (since we group them together), we just care about the minimum that we get overall (since ba1 and ba2 are not actually variables we want to depend on).
So, in your case, think about whether or not there are any of these redundant ba's we need to get rid of. Is there any b_i that we can do without? (If not, then we don't need a reshape/min!).
I'm not 100% sure, so @ndattani can probably help me double check.

I like that we have an example function:
b1.*b2 + b2.*b3 + b3.*b4 - 4*b1.*b2.*b3
Now it's time to write that function as a sum of f_symm and f_antisymm where f_symm is a symmetric function and f_antisym is an anti-symmetric function. The symmetric component should be quadratized using one of the methods in the book for symmetric function quadratization (the top of the page will say something like SFR-BCR-1), and the anti-symmetric component should be quadratized using some other quadratization method.

Hey @AnhMai-bit ! Looks good to me! Feel free to edit the .tex with the equations (suggest to add in the quadratization for the symmetric and anti-symmetric part) and then the full example together. Let me know if you need help on this part. Feel free to merge after Dr. Dattani's approval!

Thank you for your feedback @ehuan2. I will start adding to the text file after the solution is approved.


The google drive link of the original point labels needs permission

Please try again using this link https://drive.google.com/file/d/1QA_Dn6WNsXDzVexnEC0fx_QgaUzAT9V8/view?usp=sharing

Thank you for your excellent work


Isolate exception state for hooks

Resolves https://github.com/open-telemetry/opentelemetry-php/issues/1150
This saves the values of the following globals before hook functions are called:

exception
prev_exception
opline_before_exception

These values are then reset to as if there is no exception raised currently. There should ideally be no exception raised at the moment this is called anyway, but this is just in case something has raised an internal exception (could be another observer for example). After the hook function, the old state of those values is restored, and if an exception was thrown by the hook, that is captured separately and logged as a warning.
Tested that the scenario from the issue mentioned above is fixed with this, and added that exact scenario as a test.

This looks great! You've probably already noticed some minor complaints about formatting and file references, but otherwise this looks ready to go.

Fixed formatting and PECL package list. However there seems to be some genuine bug on Windows with these changes, will investigate that.

Somehow EG(current_execute_data)->opline of the calling frame was not modified in Linux builds if the hook function throws an exception, but it was on Windows builds. Added save&restore for that too, now seems to work correctly on Windows too.


Cache charmcraft pack container, skip unstable tests except on schedule

Ported from https://github.com/canonical/mysql-k8s-operator/pull/146

It looks like tests need attention here. Unit test is failing on retrigger.

At first glance, the unit test failures appear unrelated to the changes in this PR

Tests from latest main don't fail both locally and in CI. I don't think anything was merged in the mean time. I'll take a look.


Clang HEAD with Boost 1.67 doesn't work correctly

Compiler is not able to find any files regarding boost 1.67.
https://wandbox.org/permlink/Lm9OcD1mtlXUoUMJ

ref: https://github.com/boostorg/asio/pull/91/commits/a58e2343efe86f7255692c16fd610bafc70ada18
I will try to apply a patch file before build boost 1.67.

fixed applying the patch https://github.com/melpon/wandbox-builder/commit/b3d3423ffbfe666dd33d7d15d930b5374da7f85d#diff-d2ace22e01440944e80f243ab6667299

Confirmed. Thanks!


Update src/* (fix Flow type breakage)

Work-in-progress

No more Flow errors 👍

Thanks @sacummings91 and @trentduncan for helping to fix this issue which was blocking our ability to merge PRs.


Use context instead of custom channel

Currently, we are using a custom implementation of context. This change introduces standard context that is supported by HTTP client this it will fix problems with cancelling a running job.

:wave:  @mrnugget @drewvanstone @br-lewis Can you review, please?

Codecov Report

Merging #90 into master will increase coverage by 0.36%.
The diff coverage is 73.52%.

@@            Coverage Diff             @@
##           master      #90      +/-   ##
==========================================
+ Coverage   60.46%   60.82%   +0.36%
==========================================
  Files          18       18
  Lines        1844     1838       -6
==========================================
+ Hits         1115     1118       +3
+ Misses        618      610       -8
+ Partials      111      110       -1

Impacted Files
Coverage Δ

api/diagnostics.go
74.58% <73.52%> (+1.35%)
:arrow_up:

Continue to review full report at Codecov.

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

And, looking at it again: am I correct in assuming that the main reason for this change is to have better timeout handling?

Yes and the second thing is I'd like to extract collectDataFromNodes function to a separated package and context is more generic than a custom channel.

Yes and the second thing is I'd like to extract collectDataFromNodes function to a separated package and context is more generic than a custom channel.

Okay, gotcha!


Unable to create inference service on GKE cluster

/kind bug
What steps did you take and what happened:
I need to create inference service with predictor for modelmesh serving on GKE cluster.
Steps:
To install modelmesh and kserve, I used the quick install script- https://github.com/kserve/kserve/blob/master/hack/install_kserve_mm.sh
I modified the script to install kserve in kubernetes mode.
Doing a "kubectl apply -f isvc.yaml" results in the following error:
Failed calling webhook \"inferenceservice.kserve-webhook-server.defaulter\": Post \"https://kserve-webhook-server-service.kserve.svc:443/mutate-serving-kserve-io-v1beta1-inferenceservice?timeout=10s\": context deadline exceeded
The yaml file used is the one from the docs in the repo - https://github.com/kserve/modelmesh-serving/blob/main/docs/inferenceservice.md
The kserve controller manager pod keeps restarting with the following message from the logs:
"Could not wait for Cache to sync","reconciler group":"serving.kserve.io","reconciler kind":"InferenceService","error":"failed to wait for inferenceservice caches to sync: timed out waiting for cache to be synced","stacktrace":"sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Start\n\t/go/pkg/mod/sigs.k8s.io/controller-runtime@v0.10.2/pkg/internal/controller/controller.go:234\nsigs.k8s.io/controller-runtime/pkg/manager.(*controllerManager).startRunnable.func1\n\t/go/pkg/mod/sigs.k8s.io/controller-runtime@v0.10.2/pkg/manager/internal.go:696"
A describe of the kserve controller manager:
kubectl describe pod kserve-controller-manager-0  -n kserve
...
...
Events:
  Type     Reason       Age                    From               Message
  ----     ------       ----                   ----               -------
  Normal   Scheduled    9m52s                  default-scheduler  Successfully assigned kserve/kserve-controller-manager-0 to gke-unxdev-platform--unxdev-platform--6bc80f4f-njw6
  Warning  FailedMount  9m21s (x7 over 9m52s)  kubelet            MountVolume.SetUp failed for volume "cert" : secret "kserve-webhook-server-cert" not found
  Normal   Pulled       8m48s                  kubelet            Successfully pulled image "kserve/kserve-controller:v0.8.0" in 213.859569ms
  Normal   Started      8m47s                  kubelet            Started container kube-rbac-proxy
  Normal   Pulled       8m47s                  kubelet            Container image "gcr.io/kubebuilder/kube-rbac-proxy:v0.8.0" already present on machine
  Normal   Created      8m47s                  kubelet            Created container kube-rbac-proxy
  Normal   Pulled       6m37s                  kubelet            Successfully pulled image "kserve/kserve-controller:v0.8.0" in 180.378903ms
  Normal   Created      4m14s (x3 over 8m47s)  kubelet            Created container manager
  Normal   Started      4m14s (x3 over 8m47s)  kubelet            Started container manager
  Normal   Pulled       4m14s                  kubelet            Successfully pulled image "kserve/kserve-controller:v0.8.0" in 180.502694ms
  Warning  BackOff      111s (x3 over 4m26s)   kubelet            Back-off restarting failed container
  Normal   Pulling      100s (x4 over 8m48s)   kubelet            Pulling image "kserve/kserve-controller:v0.8.0"

What did you expect to happen:
No restarts of the kserve controller manager pod due to cache syncing error, and successful creation of the inference service.
Anything else you would like to add:
I followed the same steps as above on my local setup in kind cluster on mac with intel processor and I am able to create isvc successfully there.
Environment:

Istio Version: 1.10.3
Knative Version:  (Not installing knative)
KFServing Version: kserve - v0.8.0
Kubeflow version: -
Kfdef:[k8s_istio/istio_dex/gcp_basic_auth/gcp_iap/aws/aws_cognito/ibm]
Minikube version: Using GKE
Kubernetes version: (use kubectl version): v1.21.11-gke.1900
OS (e.g. from /etc/os-release): Ubuntu 20.04

Did modelmesh controller start up correctly @portkey2112 ?

Yes,.. it did.
We are now following a different approach - using the inference service CRD alone instead of full fledged kserve for just the CRD. So, modelmesh serving + isvc CRD is working fine!

@portkey2112 did you set the deploymentMode to RawDeployment If you did not install Knative?

Please checkout the installation guide for raw deployment mode
https://kserve.github.io/website/0.8/admin/kubernetes_deployment/#3-install-kserve


KAFKA-16254: Allow MM2 to fully disable offset sync feature

Implementation of KIP-1031 https://cwiki.apache.org/confluence/display/KAFKA/KIP-1031%3A+Control+offset+translation+in+MirrorSourceConnector
Committer Checklist (excluded from commit message)

[ ] Verify design and implementation
[ ] Verify test coverage and CI build status
[ ] Verify documentation (including upgrade notes)

@OmniaGM I have left some comments in the discussion thread (https://lists.apache.org/thread/2scgvn66vs8c04ldxsj4sw2vlo6wd98o). It would be great if you have free time to take a look.
For another code style idea: Could we have a new static class including all "emit"-related code? That will have following benefits.

more readable. The static class can be null (or empty) to "prove" that this function is "disabled"
no unused objects are created. For example,  offsetProducer, delayedOffsetSyncs, pendingOffsetSyncs are unused if the emit is disable
easy to test emit behavior as all they in single static class now.

WDYT?

We kinda have OffsetSyncStore and based on the name it make it feel like the right place for this however,  it is  focused on read from the offsetSyncs topic. I added another one called OffsetSyncWriter and moved all emitting offsets code into there. let me know if this is okay!

just remind that today is the deadline for feature freeze. If this PR is necessary for 3.8.0, we need to cherry-pick to branch-3.8

cc @C0urante as you also voted on the KIP

We need to change the section on validation on the KIP to update this to mention we will log warning and not to fail the checkpoint connector.

@C0urante did you get a chance to review this?

@C0urante I believe I addressed all the comments now, can you please have a second look?

@mimaison @chia7712 @soarez I plan on merging this by the end of the week; if any of you would like to do another round before I merge, please let me know.

Thanks All for reviewing this PR. I reviewed the failed tests and they are unrelated.


Improve Engine Deployments Experience

This is a bulk issue for all issues related to the deployment tool.

[x] https://github.com/camunda/camunda-modeler/issues/1405
[ ] Store and use multiple endpoints https://github.com/camunda/camunda-modeler/issues/804
[ ] Improve display of deployment parse errors https://github.com/camunda/camunda-modeler/issues/1426
[ ] Remember deployment details with diagram https://github.com/camunda/camunda-modeler/issues/1066
[ ] Remember authentication details with endpoint configuration https://github.com/camunda/camunda-modeler/issues/1067
[ ] https://github.com/camunda/camunda-modeler/issues/839

Cf. UI sketches for details on the complete picture.

@barmac @volkergersabeck I've prepared and linked the UI sketches to this issue.


OpenAPI Emitter: @example doc tag should compile to example field

Clear and concise description of the problem
/**
 * Uniform Resource Name
 * @example urn:xx:service::foobar/d9aadcde-a4b3-4fba-9f20-c5bd2fdb5071
 */
scalar URN extends string;

Should compile to
    URN:
      type: string
      description: Uniform Resource Name
      example: urn:xx:service::foobar/d9aadcde-a4b3-4fba-9f20-c5bd2fdb5071

Checklist

[X] Follow our Code of Conduct
[X] Read the docs.
[X] Check that there isn't already an issue that request the same feature to avoid creating a duplicate.

The @example tag should not be used in the way it is mentioned in the issue description. It should be used as:
/**
 * Uniform Resource Name
 * Dummy Comments.
 */
@example("urn:xx:service::foobar/d9aadcde-a4b3-4fba-9f20-c5bd2fdb5071")
scalar URN extends string;

This is working fine. Here is the Playground link
I believe the we are getting the expected results. @timotheeguerin Any comments?

Yeah the issue is about being able to use the @example tag from the doc comment. But this require some design


[Improvement] Add the HADOOP_VERSION to the RSS Server image name by default

Code of Conduct

[X] I agree to follow this project's Code of Conduct

Search before asking

[X] I have searched in the issues and found no similar issues.

What would you like to be improved?
Now that Uniffle supports more than just Hadoop 2.x it would make sense to tag built docker images with the Hadoop version as well as the rss version.
How should we improve?
Just append to build.sh with HADOOP_VERSION in the image name
Are you willing to submit PR?

[X] Yes I am willing to submit a PR!

OK for me. You can go ahead.

I think we can just ignore the minor hadoop version so we treat Hadoop 3.2.4 as hadoop3.2 and the resulting image would be something like 0.8.0-SNAPSHOT-hadoop3.2-<git-commit>?

I would be fixing build.sh as currently it doesn't get the right RSS_VERSION as it has not been updated to pick it up as per https://github.com/apache/incubator-uniffle/blob/master/build_distribution.sh#L130


Send "meta.span_type" field with root spans

The "meta.kind" field should be populated with a value to ensure the Home screen and Traces are managed to their fullest extent. https://docs.honeycomb.io/working-with-your-data/settings/definitions/#metadata-kind
In consultation with Honeycomb, we've confirmed a value of of "root" should be set for root spans:

Kind is a way to annotate spans within a trace so that edges between components can be identified later. Values can be:

root - the start of a trace, as you say another way to mark the start in addition to a span having no parent
subroot - the first span from a service within a trace, used in some of Honeycombs built-ins to show you different services within a single environment
leaf - some of the beelines mark spans that are the last event from a service (maybe the end of a trace, maybe an end to a sub-process, or maybe the last span before an interaction with another service)
mid - not a root, subroot, or leaf; an interstitial event between a service's beginning of participation in a trace and the end

It's not yet clear just how much value these provide. This patch adds "root" for when we send a span without a parent span.

Having "root" is actually kind of nice. Merging.


Could a IMX585-AAMJ1 work ?

The IMX585-AAMJ1 is a monochrome 3840 (H) × 2160 (V); approx. 8.29M pixel;  Maximum frame rate in All-pixel scan mode: 12 bit: 60 frame/s, 10 bit: 90 frame/s.
My thinking was that with a monochrome sensor, I would only need to remove the glass window over the sensor (which absorbs UV)  and replace with a window made out of UV fused silica or fused quartz. That way I would not have to deal with removing the Bayer filter. Basically to use the 4K sensor with raw data for spectroscopy from ~220 to ~ 1250 nm.
I'm was at the toying with the idea stage, when noticed your project and though that looks nearly perfect. Thanks in advance.

Hell yeah.
I've been using monochrome IMX585 with this project for a while now, the driver also supports monochrome with the dtoverlay=imx585,mono flag.
Here is my experiment with UV photography - though I think the lens itself is absorbing UV.

IMX585-AAMJ1= IMX585-AAQJ1 in terms of hardware (and actually software, just that you need to tell ISP that this is a monochrome sensor).
So if you can get the sensor then just drop it in.

For me I'm mostly using it for H-alpha solar imaging

Absolutely perfect, thank you. That is music to my ears. I am moving at the moment, but once moved I know what I'll be doing.

So if you can get the sensor then just drop it in.
A quick search using "IMX585-AAMJ1 site:aliexpress.com", says that I probably can.


Define and document contributor roles, responsibilities, and benefits

Problem
Contrary to what some folks at Open Collective believe, the community is very difficult for new joiners to navigate, let alone know where to contribute.
Part of the problem is there are no clearly defined contributor roles that would help community members choose their own adventure.
Solution
Create contributor roles based on other existing sources.

[ ] Analyze other projects, communities, and resources that have clearly defined roles

[ ]  Hugh LashBrooke - Building a Well-Rounded Community Team
[ ] Drupal - Find your role - provides a thorough/searchable list of roles, skills required, and associated tasks
[ ] WordPress Training Team roles - provides a list of roles/responsibilities specific to the WordPress Training Team
[ ] What are some other good resources?

[ ] Compile a list (maybe in a google doc?)
[ ] Edit to match the needs of the Open Collective community

Hi @gusaus i've been following up with the thread on slack, i think this is a good place to start and i could begin with this task


cannot create new issue when your repository doesn't have any issue template

🐛 Summary
cannot create new issue when your repository doesn't have any issue template.
(could create new issue with repository which has issue templates.)
💔 Enviroment

Vim Version: 8.2
OS: macOS

👀 Steps

vnew gh://:owner/:repo/issues/new *the repo needs to have no issue template
enter title of new issue
press enter-key
close buffer and don't appear new issue buffer ( -> cannot input any issue body and never create new issue )

🆗 Expected
creating new issue will be successful even if the repo has no issue template.
🚑 Actual
cannot create new issue when the repo doesn't have any issue template.
Cause
(I guess) at L295 of autoload/gh/issues.vim (inside of s:open_template_list function),
only if you don't have any issue template, execute bw!, which means invalidate b:gh_issue_new,
but try to access b:gh_issue_new variable after that (inside of s:set_issue_template_buffer).
I confirmed that I could create new issue if the repo has no issue template before.
this change seems to cause this issue.

Thanks for detail issues :)
If your interesting, Wouldn't you fix this?

sure, I'm gonna try to fix this issue.


request stucks when any exception occurs during query execution

Hi,
Could you please check following case :

Use sqlserver(min 2008) for persistency instead of memory persistence provider
Donot enable  UseRowNumberForPaging for sql server configuration options. If not enabled then Skip() and Take() wont work
"x.UseSqlServer(connectionString, b => b.UseRowNumberForPaging())"
Try to execute following request =>
localhost:5000/api/products?take=1&skip=1
The request will stuck

I will try to get the root cause whenever i find time.
Best Regards,
Nurhat

Handling exceptions in filter seems to fix the problem.
  try
            {
                context.Result = new OkObjectResult(QueryableHelper.GetAutoQuery(queryString, entityType, query, new AutoQueryableProfile { UnselectableProperties = UnselectableProperties }));
            }
            catch(Exception ex) {
                context.Result = new BadRequestObjectResult(ex);
            }

Hi nurhat,
Is there a catched exception and what the exception message said ?
It's difficult to me to test with sqlserver 2008 this month (holidays with very small internet connection :)) but i'll test next month if the error persist.
I've tested with version 2012 & 2016 it seems to work.
Best Regards,
Thibaut

Hi,
The exception is given below. We may ignore it, because to use paging support
UseRowNumberForPaging must be enabled unless you are on mssql 2012 or higher .

System.Data.SqlClient.SqlException (0x80131904): Incorrect syntax near 'OFFSET'.
Invalid usage of the option NEXT in the FETCH statement.
at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action1 wrapCloseInAction)    at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection, Action1 wrapCloseInAction)
at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)
.....


We require good artwork / logo

For this project we will need a good artwork / logo design.

Hello @windelbouwman
I'm a graphic designer and I design logos for open source projects. I only create logos for projects that have a license, do you have one?
Usually I ask the following questions to assist me in the creative process:
Do you have something in your mind for the logo?
Do you want something specific for the logo?
What colors do you want in the logo?
With your answers I will design a logo for your project and if you like it you can keep it and used.
Best Regards
Zuur

Hello @zuuritaly ,
Thanks for reaching out! The license is not yet determined I guess. @shinglyu do you know this? I would suggest a license such as MIT or BSD? Or should be go GPL?
Regards,
Windel

As for my part (the vm), I used MIT. If @windelbouwman you are OK with it we can make everything MIT.
@zuuritaly Thank you so much! I don't have strong opinion about the logo. Since it's something related to Rust and Python, maybe the Rust gear plus the python snake? (Not very creative, I admit) Or something creative about metal, iron, rust (oxidation) and snake etc..

FYI, the Rust community loves metal-related project names. We have Nickel, Iron, stainless, just to name a few.

Hello, thanks for the informations, just one question, RustPython is a Python Interpreter written in Rust, what it does, can you tell me that.
Best  Regards
Zuur

I am fine with MIT! I think it is a good choice. So RustPython will be the same as normal python, except that "normal" python is also known as CPython, in the sense that python itself was programmed with C. RustPython is a copy, but then implemented in Rust (at least, that is the target). So for a logo, and idea might be a snake which is very rusty, or a rust gear with a snake?

Or a snake biting its tail, forming a circle which looks like a gear?

What about a metal snake with cool reflections?

It needs to look good on stickers and T-shirts, that's the only requirement (?!)

How about an old and rusty snake?

Some ideas


Double tooltips in editor UI

Tested versions

v4.3.beta.custom_build [b75f048]

System information
Godot v4.3.beta - Arch Linux 6.9.6-zen1 - X11 - Vulkan (Forward+) - dedicated NVIDIA GeForce GTX 1650 (nvidia; 550.90.07) - Intel(R) Core(TM) i5-10300H CPU @ 2.50GHz (8 Threads)
Issue description

That's what happens... (also ignore that carousel stuff)
Steps to reproduce

Use the editor theme that has bigger tooltip borders (e.g. Minimal Theme).
Hover anything that has offline documentation.

Minimal reproduction project (MRP)
Non-sense.

Are you sure this isn't because the footnote for Hybrid and Carousel is repeated for both items in the class reference? If so, it'll also be repeated in the tooltip.

Are you sure this isn't because the footnote for Hybrid and Carousel is repeated for both items in the class reference?
I recently updated screenshot so it's not confusing anymore, it's from another PR.
I mean, yes it repeated in tooltip itself. It has to do with tooltip code.

I don't see any repeated text in the tooltip. Are you referring to the tooltip border being doubled? This is a known issue; it's because there is both the border from the EditorHelpBit and the surrounding TooltipPanel.

Are you referring to the tooltip border being doubled?

There are two panels, not borders.
One is the original, while the other is from EditorHelpBitTooltip.


Add relative directory/filepath support to snippets

VSCode Version: Code 1.17.1 (1e9d36539b0ae51ac09b9d4673ebea4e447e5353, 2017-10-10T14:24:41.632Z)
OS Version: Windows_NT ia32 6.3.9600

Currently, snippets allow you to resolve the current directory or filepath with TM_DIRECTORY and TM_FILEPATH respectively. It would be great to be able to get the path for these relative to the root folder, whether directly (e.g. TM_DIRECTORY_REL) or by providing a variable with the root folder.
I'm trying to write a snippet to create a new C# file. Visual Studio will auto-populate the file with namespace Directory.Structure.Here, but that doesn't seem possible in Visual Studio Code right now.

We have added Variable Transformations for thing like this. Please give it a try

I'm not sure how that would help in this case. If TM_DIRECTORY resolves to C:\dev\projects\my_projects\secret_projects\secret_project1\features\secret_feature, how can I know where the project begins? If I have the project root at secret_project1, I would expect the namespace to be  secret_project1.features.secret_feature, but I don't see any way of reliably generating that without making assumptions about base folder structure.

I could also see this used for other situations, like generating a JavaScript file that imports a common file, like const myCommonLib = require('../../../common.js');. In this case, if I had the relative directory, I could easily use the Variable Transformations to generate ../../../

how can I know where the project begins?

Well, how would we know? Do you suggest to take the current folder? What if your project start one level deeper, like src and test? I like the idea of having a variable that resolves the active (workspace) folder but I don't know if it will help you. Tho, it might make it easier to craft a snippet with  transforms

Sorry, when I said project root, I meant workspace root.
You're right, it wouldn't solve every situation, but I think it could be handy to have.

Any idea how to make this works using variable transformations?

@Spielberg, if you hardcode root foder, you can use the next transformation:
"const myCommonLib = require('${TM_DIRECTORY/.*src(\\\\[^\\\\]*)(\\\\[^\\\\]*)?(\\\\[^\\\\]*)?(\\\\[^\\\\]*)?/${1:+../}${2:+../}${3:+../}${4:+../}/}common.js');",

@jrieken "variable that resolves the active (workspace) folder" is definitely missing. How about 'custom' variable that could read string from another file? Usually, if source root is not the relative folder, it is written in some (json, xml..) file in relative folder. Beside resolving this issue, probably that new variable would provide many more options in snippets.

Workspace-related snippet variables would be very handy for plenty of cases, I was surprised they weren't included already when I went looking for them

Add a new variable TM_WORKSPACE_ROOT pointing to the root path of the workspace will be awesome!

Add a new variable TM_WORKSPACE_ROOT pointing to the root path of the workspace will be awesome!

This would be great. If we could also get a TM_DIRECTORY_RELATIVE_WORKSPACE_ROOT, that would be super amazing, and provide a better basis for doing what the OP is trying to do.

When editing other settings for VS Code, you sometimes have access to ${workspaceFolder} and ${relativeFileDirname} variables. That is what we need here. I tried just using them, but they didn't work for me here.

@Spielberg, if you hardcode root foder, you can use the next transformation:
"const myCommonLib = require('${TM_DIRECTORY/.*src(\\\\[^\\\\]*)(\\\\[^\\\\]*)?(\\\\[^\\\\]*)?(\\\\[^\\\\]*)?/${1:+../}${2:+../}${3:+../}${4:+../}/}common.js');",

I'm really terrible at transformations and regex. Could you please provide a similar transformation that inserts the names of the directories after src/ that would produce code in this format:
namespace SomeHardCodedThing\Directory\Structure\After\Src;

2 years ago I asked this question on Stackoverflow about getting the base directory.
Having the current directory name (and not the full path) seems to be in demand. Sure people are giving their upvote for the transform but what we really want is a simple, relatively short variable to get it. The snippets are not that obvious with these transforms repeated everywhere and not the simplest thing to maintain.
Please, consider adding some variables like the ones mentioned here.

I don't mind trying to put together a PR, but I tend to have a hard time getting started in a new code base (new for me). Is someone able to point me both to the code that makes the ${workspaceFolder} and ${relativeFileDirname} variables available in other parts of VS Code, and the code that makes certain variables available to snippets?

Did a quick search and it is likely to be here: https://github.com/microsoft/vscode/blob/master/src/vs/workbench/services/configurationResolver/common/variableResolver.ts#L222-L290

I just realized something. Even if I had a variable that provided the relative path after project directory, I would still need to use the incomprehensible snippet expansion feature to remove 'src' from the start of that variable, so it wouldn't actually help me.

I'm trying to make a snippet always locate a Theme.js file no matter where it's created. Is there any way to say something like $RELATIVE(/src/theme) and have it automatically produce an output like ../theme if we're located in src/components/ActionBar.js?

I borrowed the transformation from @DVDima and it worked pretty well for my case. It's not perfect because neighboring components will use ../ and then come back down the path, but that could be solved by a linter.
Okay, let's say you have:

Workspace path: ~/git/my-folder
Path to relative library I want to create a snippet for: ~/git/my-folder/src/common/lib.js
Current file: ~/git/my-folder/src/special/cool/app/file.js

The following snippet should work up to 6 levels deep:
{
  "Import common lib": {
    "prefix": ["import lib from common", "common-lib", "lib"],
    "body": ["import lib from '${TM_DIRECTORY/.*src(\\/[^\\/]*)(\\/[^\\/]*)?(\\/[^\\/]*)?(\\/[^\\/]*)?(\\/[^\\/]*)?(\\/[^\\/]*)?/${1:+../}${2:+../}${3:+../}${4:+../}${5:+../}${6:+../}/}common/lib.js'"]
  }
}

Upon running the snippet, you should get import lib from '../../common/lib.js'
Caveats

The regex is assuming forward slashes in the directory—would need to be adjusted to backslashes on Windows or adjusted to be agnostic. A backward slash escaped in regex in JSON looks like \\\\ and would replace \\/ in all instances above.
This will work 6-subdirectories deep. If you need fewer or more, you can copy-paste the optional groups ([…])? and then place more variable insertions ${N:+../}.

Explanation
The regex is just trying to find as many groups beyond the common directory (src in the example above) and replacing them with ../. It's very simple. Having to escape the backslashes and putting it into JSON makes it hard to read. Basically we're saying:
in string TM_DIRECTORY, replace .*app(/[^/]*) with ${1:+../}/}common/lib.js
Transforming any-garbage-here/app/somedir → ../common/lib.js
Then the group for further directories needs to be repeated until you've reached what's practical for your project.
Hope this helps!

"const myCommonLib = require('${TM_DIRECTORY/.src(\\[^\\])(\\[^\\])?(\\[^\\])?(\\[^\\]*)?/${1:+../}${2:+../}${3:+../}${4:+../}/}common.js');",
I want to do something similar but if I use this one. It results in

const myCommonLib = require('../,../,,common.js');

No idea how but I am getting those commas. Is there a way to remove them?

Verified that the RELATIVE_FILEPATH works

Verified that the RELATIVE_FILEPATH works


Fixed incorrect uptime calculation for push monitors

Description
Fixes #919
I spent today trying to find out the cause of the problem of wrong Uptime calculation for push monitors.
I have found that if the push monitor misses a specified beat time, the time between beats is calculated, a few other actions are performed, and the current beat is stored in the previousBeat variable.
If the push monitor beats in time, nothing will be done.
This means that in the case of another event where the push monitor misses a beat, the duration calculation is performed from the time of the previous missed beat, not from the time of the last beat that was recorded via the /api endpoint.
I believe this should fix the problem, but I would need volunteers to test it.
Type of change

Bug fix (non-breaking change which fixes an issue)

Checklist

[x] My code follows the style guidelines of this project
[x] I ran ESLint and other linters for modified files
[x] I have performed a self-review of my own code and tested it
[x] I have commented my code, particularly in hard-to-understand areas
(including JSDoc for methods)
[x] My changes generate no new warnings
[ ] My code needed automated testing. I have added them (this is optional task)

Screenshots (if any)
Please do not use any external image service. Instead, just paste in or drag and drop the image here, and it will be uploaded automatically.

I got your point. Thanks for finding out the problem.
However, as originally it calls Monitor.getPreviousHeartbeat to get the previous beat. I can't remember why the sql queries are different from each other.
https://github.com/louislam/uptime-kuma/blob/5bf58cc6c4430226cc558deb0cc1738e6899baee/server/model/monitor.js#L186-L188
https://github.com/louislam/uptime-kuma/blob/5bf58cc6c4430226cc558deb0cc1738e6899baee/server/model/monitor.js#L899-L907
For upper one, in plain sql, it would be like monitor_id = ? ORDER BY time DESC LIMIT 1.
I suspected that the upper one may be having performance issue, because it sorts out all heartbeat records of the monitor_id and get the first one. But I am not quite sure yet, it is just my guess.

I got your point. Thanks for finding out the problem.
However, as originally it calls Monitor.getPreviousHeartbeat to get the previous beat. I can't remember why the sql queries are different from each other.
https://github.com/louislam/uptime-kuma/blob/5bf58cc6c4430226cc558deb0cc1738e6899baee/server/model/monitor.js#L186-L188
https://github.com/louislam/uptime-kuma/blob/5bf58cc6c4430226cc558deb0cc1738e6899baee/server/model/monitor.js#L899-L907
For the upper one, in plain sql, it would be like monitor_id = ? ORDER BY time DESC LIMIT 1.
I suspected that the upper one may be having performance issue, because it sorts out all heartbeat records of the monitor_id and get the first one. But I am not quite sure yet, it is just my guess.

Hi,
I'm really glad I found the cause of the problem with the push monitors (I hope). I really took it from the end and tried to find out the cause.
I still couldn't figure out what the given range in the duration column corresponded to. In the end, I wondered if this was the difference from the last non-UP status and bingo. It was like that.
If you want to go through my great detective work (jk 😂), you can go through the comments in #919.

By the way, I tried to verify your observation about the performance of individual SQL queries and it looks like getRow is a winner. Sometimes the difference is tenths to thousands of milliseconds, sometimes the difference is a few milliseconds (usually 1ms). findOne also returns a total of 9 records (columns) instead of 2, which returns getRow.
Here are the results: https://controlc.com/58dcd1a1
PS: I tested it on my big database.

PS2: If you want, I can replace findOne in monitor.js with Monitor.getPreviousHeartbeat(this.id) so you have it all in one PR.

I got your point. Thanks for finding out the problem.
However, as originally it calls Monitor.getPreviousHeartbeat to get the previous beat. I can't remember why the sql queries are different from each other.
https://github.com/louislam/uptime-kuma/blob/5bf58cc6c4430226cc558deb0cc1738e6899baee/server/model/monitor.js#L186-L188
https://github.com/louislam/uptime-kuma/blob/5bf58cc6c4430226cc558deb0cc1738e6899baee/server/model/monitor.js#L899-L907
For the upper one, in plain sql, it would be like monitor_id = ? ORDER BY time DESC LIMIT 1.
I suspected that the upper one may be having performance issue, because it sorts out all heartbeat records of the monitor_id and get the first one. But I am not quite sure yet, it is just my guess.

Hi, I'm really glad I found the cause of the problem with the push monitors (I hope). I really took it from the end and tried to find out the cause. I still couldn't figure out what the given range in the duration column corresponded to. In the end, I wondered if this was the difference from the last non-UP status and bingo. It was like that.
If you want to go through my great detective work (jk 😂), you can go through the comments in #919.
By the way, I tried to verify your observation about the performance of individual SQL queries and it looks like getRow is a winner. Sometimes the difference is tenths to thousands of milliseconds, sometimes the difference is a few milliseconds (usually 1ms). findOne also returns a total of 9 records (columns) instead of 2, which returns getRow.
Here are the results: https://controlc.com/58dcd1a1 PS: I tested it on my big database.
PS2: If you want, I can replace findOne in monitor.js with Monitor.getPreviousHeartbeat(this.id) so you have it all in one PR.

Thanks, then it is not as bad as I thought.