Introduce Filter CloudEvents Feature

Introduce filter CloudEvents feature
Checklist

[X] I have verified that my change is according to the deprecations & breaking changes policy
[X] Tests have been added
[X] Changelog has been updated and is aligned with our changelog requirements
[ ] A PR is opened to update our Helm chart (repo) (if applicable, ie. when deployment manifests are modified)
[ ] A PR is opened to update the documentation on (repo) (if applicable)
[X] Commits are signed with Developer Certificate of Origin (DCO - learn more)

Fixes #

Relates to https://github.com/kedacore/keda/issues/3533

Mind opening a doc PR?

LGTM, but I'd like to see these two improvements though to improve the user experience/usability:

https://github.com/kedacore/keda/pull/5424/files/2bfa4b99dde46f03786adddfbc2c8791d8cd5495#r1479293087
https://github.com/kedacore/keda/pull/5424#discussion_r1479292582

LGTM, but I'd like to see these two improvements though to improve the user experience/usability:

https://github.com/kedacore/keda/pull/5424/files/2bfa4b99dde46f03786adddfbc2c8791d8cd5495#r1479293087
Introduce Filter CloudEvents Feature  #5424 (comment)

Improvements added.

Would you mind fixing the conflicts please?

Fixed.

@zroubalik / @JorTurFer Do you mind reviewing? I am not enough of an expert on the codebase but think it's generally OK

I've been thinking about this. Does it make sense supporting both at the same time? I mean, shouldn't include and exclude be mutually exclusive? Maybe we should support both, but being mutually exlusive, @tomkerkhove ?

It will always let user confuse if include and exclude exist at the same time. It is better to have only one type in the specification.

End-users should be able to use both, for example:
eventSubscription: #Optional. Submit included/excluded event types will filter events when emitting events.
  includedEventTypes: #Optional. Only events in this section will be emitted.
  - keda.scaledobject.failed.v1
  excludedEventTypes: #Optional. Events in this section will not be emitted.
  - keda.scaledobject.ready.v1

But this should not be allowed and blocked:
eventSubscription: #Optional. Submit included/excluded event types will filter events when emitting events.
  includedEventTypes: #Optional. Only events in this section will be emitted.
  - keda.scaledobject.ready.v1
  excludedEventTypes: #Optional. Events in this section will not be emitted.
  - keda.scaledobject.ready.v1

End-users should be able to use both, for example:
eventSubscription: #Optional. Submit included/excluded event types will filter events when emitting events.
includedEventTypes: #Optional. Only events in this section will be emitted.

keda.scaledobject.failed.v1
excludedEventTypes: #Optional. Events in this section will not be emitted.
keda.scaledobject.ready.v1

Yeah, currently they can, but my doubt is if that makes sense. In the moment when you add include keda.scaledobject.failed.v1 you are automatically excluding keda.scaledobject.ready.v1 (because it's not the only included type). I mean, adding include or exclude, you are explicitly discarding the other group and supporting both at once can have more problems checking misconfigurations than the benefit we give to the users.
Maybe we can go adding them as mutually exclusive, we will maintain the flexibility for the users because they can use include or exclude, but we can improve the logic not supporting both at the same time. WDYT?

Oh in that way, that makes sense indeed. Let's only allow one or the other indeed

/run-e2e internal

/run-e2e internal

/run-e2e internal

/skip-e2e


Logging colours in debug console (Python)

The Debug Console for Python shows logging in red text, but print statements in white.
An idea would be to have different colours for different logging levels, rather than all of it white. Red suggests it's important, which it may not be. Red would work better for a warning level for example.
Regardless, having all the logging output come out as red isn't great. I'd rather this was white, if no colouring was used. Or, provide a setting to change the colours.
See image for more detail:

Please file this against the python extension. https://github.com/microsoft/vscode-python
They could use ansi coloring to get more colors which we do support in vscode.

Cheers!! Thought this was a vscode problem, rather than the extension. I have filed it against the python extension.


stanford core nlp link on readme page not working

Can't download

Hi,
You can copy the link (http://nlp.stanford.edu/software/stanford-corenlp-full-2018-10-05.zip) and use the wget to download.


wrong character reported when using tabs

Example:
var a = x == null ? null : 1;

-> Use '===' to compare with 'null'. line: 1, char: 11
Same line with a leading tab:
\tvar a = x == null ? null : 1;

-> Use '===' to compare with 'null'. line: 1, char: 15
It seems that one tab accounts for 4 characters. I'm running jshint on rhino.

Yeah indent is set to 4 in that case so that 1 tab character is interpreted as 4 columns. Seems to work as intended.

Thanks for the hint! Setting indent to 1 fixes the problem.
FWIW, I wonder what the purpose of this option is. If it's only there to shift the reported character count, wouldn't this be better done by the calling code? Since the field is named character instead of column, it seems to be even a bit misleading...

From other discussions like GH-295, I understand that the indent option is mainly used for indentation checking. So simply setting indent: 1 is not an option for IDE integration.
In this case, the character field in errors should really point to the actual index of the character, not to the column this character will appear in. This is needed to place error markers at the correct position. Maybe an additional column field might take the indentation into account?

Makes sense. Any thoughts on this @antonkovalyov @WolfgangKluge ??

I think I already solved it in #28 (https://github.com/WolfgangKluge/jshint/tree/format-check), but it get never productive ;) (and the change is too big to carry over into master)
I stopped replacing \t with "    " (with this, from shows the correct position) and started to store the real whitespace into the token.
I used this property to check indentation (instead of from property).


Provide .zip bundle on website

I'd like to be able to pull down the package and work it into a project setup/build process, but .tgz doesn't have any native/inbox tools on Windows to unzip.
Is it possible to distribute the package as a .zip file as well?

We recommend to use npm to download the monaco editor. Unfortunately we cannot offer a zip download.


Issue with viewport size units

I had no issue using the cssnano CLI until I added viewport-based units (vw to be exact) in my CSS file. Suddenly the output becomes blank; and if I comment the lines that use vw, cssnano works once again.
I assume that means those units are not supported by cssnano? Is it possible to update it to support them? The CLI was a really convenient way to minimize my CSS locally and right now I can't use it at all.

Could you provide some CSS that reproduces the problem, please?

I tried again today, and the problem was gone. Apparently what was actually causing the issue was that I left the old pixel values as placeholders while I was tweaking the vw values (so I had lines like font-size:3.125vw;52.5px;). Technically unclean code, I know, but it's weird that it worked in browser but made CSSnano fail. Sorry about the false alarm on vw values though.

Yeah, this invalid CSS would have caused a crash (whereas in browser the unrecognised syntax would have been ignored). We should probably handle these errors better in the CLI.

@ThibautNicodeme The CLI will now report any errors on stderr;
h1 { font-size:3.125vw;52.5px; }

Produces:
<css input>:1:24: Unknown word
> 1 | h1 { font-size:3.125vw;52.5px; }
    |                        ^
  2 |


Line breaks not shown like they are in github

The below is from the PR extension

The below is from github

Observe that after the first sentence, the former has no line break and the latter does

Fixed by https://github.com/Microsoft/vscode-pull-request-github/commit/9baed71f383ee169419c6cbce80cffbbfd13fc7d

It looks great now


feat: Add support for random row sampling on binary id columns

This PR adds support for random row sampling on binary id columns by:

Casting random binary values to hex
Adding a reverse cast back to binary in the IN list added for random binary id filters

Also adds random row options to DVT_BINARY integration tests. There are only 5 rows in the table as we validate with batch size 5 which at least proves that the filter works on each system. We probably need to add a more targeted random row integration tests in the future but that was not the purpose of this PR, I just want to know the casting works on all engines.

/gcbrun

/gcbrun

We appear to have an issue on Hive, unrelated to our changes.
Single IN list:
select * from pso_data_validator.`dvt_binary` where `binary_id` in (unhex('4456542d6b65792d35'));

+-----------------------+--------------------+------------------------+
| dvt_binary.binary_id  | dvt_binary.int_id  | dvt_binary.other_data  |
+-----------------------+--------------------+------------------------+
| DVT-key-5             | 5                  | Row 5                  |
+-----------------------+--------------------+------------------------+

Add a second item to the in list:
select * from pso_data_validator.`dvt_binary` where `binary_id` in (unhex('4456542d6b65792d35'),unhex('4456542d6b65792d33');

+-----------------------+--------------------+------------------------+
| dvt_binary.binary_id  | dvt_binary.int_id  | dvt_binary.other_data  |
+-----------------------+--------------------+------------------------+
+-----------------------+--------------------+------------------------+

No rows selected!

/gcbrun

/gcbrun


Accept OMOP ES batches

Definition of Done / Acceptance Criteria

[ ] PIXL CLI reads from multiple batches, within a single OMOP ES. Populating the queues as if it were a single batch
[ ] PIXL CLI copies the public files from multiple batches into the extracts directory
[ ] Assuming #192 is completed, then should refactor this to copy the directory structure rather thsn globbing

Testing

[ ] Will need to have a test example with multiple batches
[ ] If we have tests for copying parquet files via SFTP then this should also be tested, but if not this can be done when we implement the parquet uploading

Documentation
Update CLI documentation
Details and Comments
Expected structure for a single project which is split up over 3 batches (this would happen when there is a large amount of data and we want to ensure ease of transferring.
└── omop_extract
    ├── extract_1
    │   ├── extract_summary.json
    │   ├── private
    │   └── public
    ├── extract_2
    │   ├── extract_summary.json
    │   ├── private
    │   └── public
    └── extract_3
        ├── extract_summary.json
        ├── private
        └── public

Where omop_extract is the directory that is passed into pixl populate. extract_* are expected to be literal dir names.

I think it's worth checking our assumptions. The project_name + datetime combination that we are using to define an "extract" will be the same for each of the batches within this extract, right? And each batch is identified only by its directory name?

The project_name + datetime combination that we are using to define an "extract" will be the same for each of the batches within this extract, right?

Yep!

And each batch is identified only by its directory name?

I'm not quite sure what you mean here, will follow up in person (if I don't then prod me!) and comment here but I expect the answer is yes.

OMOP ES will merge parquet batches so not needed in the end


Have addDefinitionFromEpsgIo test if the definition already registered before calling the internet

Have addDefinitionFromEpsgIo test if the definition already registered in proj4 before calling the internet

Good idea! Added to 1.3.0:
projector.definitionIsRegistered('EPSG:WGS84')
ReProjector.instance().definitionIsRegistered('EPSG:WGS84')


WIP: render/egl: allow creating an llvmpipe EGL context

There are use-cases for forcing an llvmpipe EGL context, e.g. CI. Allow users to force it.
Depends on: https://github.com/swaywm/wlroots/pull/2671

Hm. So even if we're able to create an llvmpipe EGL context without a DRM FD, we still won't have an allocator we can use with it. We need a new EGL ext to create an EGLImageKHR from an existing chunk of memory.

We'll need https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10744


Add wrapper read_raw for specific read_raw_xxx readers

Fixes #7769.
This PR adds mne.io.read_raw, which is "just" a wrapper for specific readers. Based on the file extension, the wrapper dispatches known specific readers (and raises an error for unknown file types). I've included a suggested file type in the error message if the user tried to open a wrong file from formats consisting of multiple files (e.g. the BrainVision format has .eeg, .vmrk, and .vhdr files, of which only the last can be opened).
This is a first suggestion, please comment. We should also add a test - any suggestions what the test should do? I thought that we'd use read_raw to load each supported file type, and probably also an unsupported one.

I assume the error on Azure (Windows 3.7 conda) is unrelated? It said this job has failed several times in the past, so is there a way to fix it?
FAILED mne/minimum_norm/tests/test_inverse.py::test_make_inverse_operator_diag[testing_data-testing_data]

Yes we'll need to fix it. My money is on it being a hard-to-track-down (and even harder to get fixed) MKL bug. So for now feel free to add a if os.getenv('AZURE_CI_WINDOWS'-style skip with a big TODO comment saying that it should be fixed, and/or open an issue to fix it

Failing Azure job issue: #7814
I've added some tests, this should be good to go.

All green!

Awesome work, @cbrnr!


pull request for e2e test at 11/30/2016 04:26:21

:white_check_mark: Validation status: passed
For more details, please refer to the build report.
Note: If you changed an existing file name or deleted a file, broken links in other files to the deleted or renamed file are listed only in the full build report.


Standardize terminology on teacher/student or player/game or host/trader

Personally, I think we shouldn't call the participants "players" or "students", as it might be used for something which is not really a game, and the participants doesn't necessarily need to be students.
Here's some thoughts and ideas on terminology

the person initiatiating a session is called the "host"
the participants are called "traders" or "companies"
we could also somehow emphasize the words "economic experiment" to indicate that what they are doing are executing economic experiments (e.g. "Start new experiment", "Previous experiments")

In general what we're building is a site for doing one very specific economic experiment, in the future we might want to have other types of experiments as part of the site, and perhaps not, but it might we good to have that thought with us when we design the site.

Another way teachers students might use this, is that the teacher gets the students to be hosts, and invites people from outside their class to participate, and in that way the student/teacher-terminology isn't good, so I think we should move away from that and call it "participant view" and "host view", also in our internal discussions etc.


Auto-generated puzzles

This can be very interesting.
With the current puzzles, you can pretty much work your way to the solution with backwards compulsions.
(meaning: I must threat the king -> this is the only square I can threat him safely -> this is the only safe sqaure I can get to that square etc.)
I think that generally, longer solutions are harder and solutions with less compulsions are harder as well, since there are more options to explore.
I will try to work on this.
But, I think, if we can achieve something like this, we would need also a way to split puzzles into difficulty categories.

I agree, this can be a game-changer (oh, the puns).
I have a working implementation for this for the VanillaJS branch in feature-generator.
The algorithm looks something like this (pseudo-code):
let startBoard = someSimpleStartingBoardSetup;
let difficulty = 0;

for (let targetDifficulty = 0; targetDifficulty < finalTargetDifficulty; targetDifficulty++) {
  do {
    board = clone(startBoard);
    board.addRandomPiece();
    difficulty = Solver.solve(board).numOfStepsTaken;
  } while (difficulty < targetDifficulty);
  startBoard = board;
}

Actually not sure if I used random or tried all possible positions (I think I used random for equal distribution, and some sort of map for ensuring I don't try the same square+piece twice). It isn't too much to brute-force  all possibilities if we're adding one piece at a time.
numPossiblePieces = ['r', 'n', 'b', 'q', 'p'].length = 5
numPossibleSquares = 64
numDepth = 10 // sure why not, let's make a really hard puzzle
5 * 64 * 10 = 3200

Keep in mind, the solver runs every iteration. In reality, the number will be lower since some squares are already occupied in startBoard, and we're adding 1 piece to the board in every iteration, so it's actually less than 64 possible squares. Also, this assumes the worst case scenario (in most cases a solution be found before exhausting all possibilities).
This iterative method did give me some trouble when trying to generate puzzles that require more than 4-5 moves.
Perhaps the 8x8 bishop puzzles are limited by their nature - I wonder if there is a way to calculate the longest possible puzzle.
Also, there is probably a more intelligent way of auto-generating a puzzle that doesn't use brute-force.
This could also be useful in the future, because... I kinda want a 100x100 game mode (and then bruteforce might not cut it 😅).

Oh. I never looked at that branch.
I'll update when I get something working

I just realized that I may have misunderstood your intentions, and I apologize if I took over something you were already working on. If you intended to pass the work to someone else, that's totally fine, and I'd be happy to continue with it. Can you let me know what you had in mind?
In any case, I'm excited to collaborate with you on this! I noticed that our approaches to the generator are a bit different. While you seem to prefer a more chaotic approach, I'm more interested in taking a thoughtful and systematic approach. I'd like to start by understanding what makes a puzzle difficult and how we can programatically measure that. Additionally, I want to explore how to detect similarities between groups of puzzles and generate all possible interesting and unique puzzles. Of course, this is all easier said than done, but I'm looking forward to tackling these challenges together!


Refactoring SimpleJson.EatWhiteSpace

-Replacing arbitrary length IndexOf call with unrolled switch statement
-Reduces deserialization runtime on ~310KB test data from 13s to 5s.

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

Thanks very much @toddlang!


suppressed errors when closing session

What happened:
I wanted to sign a component descriptor in a remote repository, where pulling the artefacts is public and therefore doesn't require authentication, however pushing the artefact does require authentication.
Pulling the artefact and local signing worked fine. However pushing the artefact failed with a 401 Unauthorized. This failed push operation was initially triggered by the call of defer session.Close() in the sign cmd (see: https://github.com/open-component-model/ocm/blob/main/cmds/ocm/commands/ocmcmds/common/cmds/signing/cmd.go#L76). The error that occured during session.Close() wasn't propagated back to the root level (the command should have failed, which it didn't).
I took a look into the other commands, and it seems that there is the same problem. Everytime an error is thrown during session.Close() the error is suppressed.
What you expected to happen:
How to reproduce it (as minimally and precisely as possible):
Anything else we need to know:
Environment:

The error directly described is fixed with #167. It also provides a way how to handler deferred errors.


getview is null

hello
i use this lib
if press phone home key
and netowrk thread run
call getView() is null....
why getview() null?
i want background thread run and ui change
ps : sry im not write english very well...

I believe a ui update can only run on the main thread and if you are at the home screen the window is not attached and can't be updated.

no
ui update is getview() call update
activity onPause after
presenter is dropview method
view = null;
why onPause after dropview method is view = null; ?

@parkjaeiek hi, can you give me an example that reproduces your problem?
@darxval is right, getView() should not be null between onResume()/onPause() and all view updates must be in the main thread.

@konmik
hi example code
@RequiresPresenter(MainPresenter.class)
public class MainActivity extends NucleusAppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);

    getPresenter().test();
}

public void testToast(){
    Toast.makeText(this, "hello nucleus", Toast.LENGTH_SHORT).show();
}

}
public class MainPresenter extends RxPresenter{
public void test(){
    Handler handler = new Handler();
    handler.postDelayed(new Runnable() {
        @Override
        public void run() {
            getView().testToast();
        }
    }, 3000);
}

}
example handler but original source file is retrofit network..
main activity start before 3 second user home button click
main activity state onPause
and getview() is null

You can not guarantee the main window is attached esp in a post execute you have to wrap your post handler method to ensure the is not destroyed with isDestroyed()  before you call the toast method. The handler will run regardless of the life cycle so you have to be careful

@darxval
yes i know
this source only test sample code
and activity is not destroy only pause state...

Hi @parkjaeiek
If your activity is on pause then getView() should be null. This is intended behavior.
If you look at sources, you'll see:
@Override
protected void onResume() {
    super.onResume();
    helper.takeView(this);
}

@Override
protected void onPause() {
    super.onPause();
    helper.dropView(isFinishing());
}

I.e. you can access an activity from your presenter only when the activity it is not paused.
In Nucleus we solve this problem of inavailability of views by using deliver() method and its variants, see example: https://github.com/konmik/nucleus/blob/master/nucleus-example/src/main/java/nucleus/example/main/MainPresenter.java#L44
Anyway, the question of detaching between onPause/onResume is open. Google recommends to stop all actions during onPause. By detaching a presenter onPause we're letting it know that it should stop CPU/battery-consuming tasks. I never had a real use case for this, but I easily can imagine a couple.
If you have any thought on why we should (or not) detach a presenter onPause, I would like to hear from you.


Logic error correction

I think the logic is correct here, I guess the intention here it to return when there is no client secret, but this is being checked here: https://github.com/thomseddon/node-oauth2-server/blob/master/lib/grant.js#L88-L90