CORE-10385 Custom query execution (part 1)

Overview

Change PagedQuery to return a ResultSet instead of a List<R>, this will keep the APIs aligned (Persistence/Ledger-persistence)
Modify EntityResponse avro schema to return similar properties as in ResultSet (newOffset, hasNextPage, size, results)
Create ExecuteVaultNamedQueryRequest avro schema for custom query execution
Add new VaultNamedParameterizedQuery to represent vault named queries
Fix cordapp-configuration.properties to align with the replaced VaultNamedQueryFactory

Surely this needs a version bump right?


raspa: init at 2.0.47

Description of changes

RASPA is a classical molecular dynamic simulation software.
Things done

Built on platform(s)

[X] x86_64-linux
[ ] aarch64-linux
[ ] x86_64-darwin
[ ] aarch64-darwin

[ ] For non-Linux: Is sandbox = true set in nix.conf? (See Nix manual)
[ ] Tested, as applicable:

NixOS test(s) (look inside nixos/tests)
and/or package tests
or, for functions and "core" functionality, tests in lib/tests or pkgs/test
made sure NixOS tests are linked to the relevant packages

[ ] Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
[X] Tested basic functionality of all binary files (usually in ./result/bin/)
22.11 Release Notes (or backporting 22.05 Release notes)

[ ] (Package updates) Added a release notes entry if the change is major or breaking
[ ] (Module updates) Added a release notes entry if the change is significant
[ ] (Module addition) Added a release notes entry if adding a new NixOS module
[ ] (Release notes changes) Ran nixos/doc/manual/md-to-db.sh to update generated release notes

[X] Fits CONTRIBUTING.md.

The package test run-examples-basic seems to heavy. I'll move it out of passthru.tests.

Split out raspa-data and make strictDeps = true for raspa (and make it build) to prepare for the successive Python binding packaging.

Workaround #16182 and make raspa-data build by creating an empty $out directory.

Rebased and simplify the package test.

This pull request has been mentioned on NixOS Discourse. There might be relevant details there:
https://discourse.nixos.org/t/prs-ready-for-review/3032/1507


Multiphase refactor and support OpenPAI training service.

Refactoring multiphase interface, enable all builtin tuners as multiphase tuner, such as:

Support multiphase for OpenPAI training service.

another related issue: https://github.com/microsoft/nni/issues/1170

looks good. We also have tuners under nni/examples/tuners, better to update the input argument in them as well :)

looks good. We also have tuners under nni/examples/tuners, better to update the input argument in them as well :)

Thanks, updated.

@xuehui1991 there is an enas tuner referenced by our repo, could you update the tuner interface in it?

@Crysple please update the tuner interface of the nas example in your repo after this pr is merged.

@chicm-ms could you also update the doc/tutorial, for example: https://nni.readthedocs.io/en/latest/CustomizeTuner.html

NNI Advisors (hyperband, BOHB) have not supported multi-phase, let me fix it after this pr is merged.

@chicm-ms could you also update the doc/tutorial, for example: https://nni.readthedocs.io/en/latest/CustomizeTuner.html

Done


fix gh-73. Fix summary collected count when tests are deselected.

Added deselected count in summary.
Added CHANGELOG.md file.

Notice the name session.testscollected is wrong.
https://github.com/pytest-dev/pytest/issues/9614

Appreciate you digging into the oddities of pytest's stats calculation logic! I changed the patch a bit to preserve functionality related to reporting collectors.
I also appreciate your suggestion of a dedicated CHANGELOG.md. I absolutely see why that's useful addition, but I'm going to look into that separately and read up on best practices first. So I'll not be merging it right now within this PR.

Appreciate you digging into the oddities of pytest's stats calculation logic! I changed the patch a bit to preserve functionality related to reporting collectors.
I also appreciate your suggestion of a dedicated CHANGELOG.md. I absolutely see why that's useful addition, but I'm going to look into that separately and read up on best practices first. So I'll not be merging it right now within this PR.


Clash with the Google Analytics Plugin

https://github.com/danwilson/google-analytics-plugin/commit/22c98145a365f461aa4d6c5c5fdaa5ea336be13e
After this update to the google analytics plugin, these 2 plugins started clashing, the build fails complaining there are 2 .gms packages (I assume it's this 2 plugins by the way, haven't verified it yet)
I guess I can solve the issue manually, but is it logical to update this plugin's .gms dependency structure too?

+1, Having the same issue when building

+1,

+1

Our platform now supports Gradle build for Cordova-Android versions 3.6 and up so I was able to fix this once and for all. Available in 3.0.1.


Merge refs/heads/temp-branch-6404067439 into alpha

Merge refs/heads/temp-branch-6404067439 into alpha

This PR has not been merged into alpha. Please fix the issues and re-open the PR.

This PR has not been merged into alpha. Please fix the issues and re-open the PR.


Consistently record host.id as a resource attribute

Is your feature request related to a problem? Please describe.
I would like to be able to consistently record host.id as a resource attribute. The spec has the following description:

Unique host ID. For Cloud, this must be the instance_id assigned by the cloud provider. For non-containerized Linux systems, the machine-id located in /etc/machine-id or /var/lib/dbus/machine-id may be used.

The cloud provider resource detectors (aws ec2, gcp, etc) add the host.id as spec'd but we don't have a way to easily add it for non-cloud hosts.
Describe the solution you'd like
I propose collecting the host.id in the existing HostDetector, which currently only collects non-cloud host attributes. Depending on OS there are files that can be read, or commands that can be executed to obtain the machine id. There is a well used library, nodde-machind-id that handles machine id discovery for *nix, MacOs, and Windows. We can use it, or write something comparable ourselves if we'd rather avoid a dependency.
Describe alternatives you've considered
If we don't think this functionality belongs in HostDetector we could introduce it in a separate detector.
Additional context
I'm planning to do this work and will open a PR shortly. We can continue discussions here and/or there.

@mwear did you open a spec issue for this?

I have a spec PR here: https://github.com/open-telemetry/opentelemetry-specification/pull/3173


TestTrackWithTokenDismissesGregor

r? @maxtaco

Not sure whether we also want to test DismissWithToken in go/service/track.go. This would be one of those "test whether a function that just calls Foo actually calls Foo" cases.

@patrickxb do you have time to take a look at this one?

I think it's a fine test as-is, no test necessary in service.
LGTM

:mag_right: No visual changes found as a result of these commits.

:mag_right: No visual changes found as a result of these commits.


Fix string constants for standalone sys

This change fixes two issues described in #2499.

String constants are (currently) specially handled to resolve to PCSTR or PCWSTR based on the constant field, but this was not reflected in type collection. The standalone type collection now ignores string constants since it knows they are special, so HSTRING is no longer added if not used elsewhere.
String constant emission unconditionally emits s! or w!  to create the string literal, but in standalone + sys mode this means the macros are not prefixed with the crate, the only special case in the current bindgen for the crate name. Now if in standalone + sys mode it assumes windows_core is used and emits that.

The other way to fix issue 2 is to get rid of the macros altogether in favor of just emitting either a byte string (with null terminator) for ansi, or a precomputed u16 array (with null terminator) directly in the bindings. The byte string would be as readable as the macro is today, and it would be trivial to add a comment on top of the u16 array to say the human readable string that it represents. But I did the simplest fix for now.
Resolves: #2499

I think the main issue is support for string literals in standalone code generation. I'll think some more on the best way to handle those in sys-style code generation. It should work fine for non-sys code generation.


Two phase commits

Thanks for the PR. In order to support this on distributed part, what should I do? I cannot find the confirmCommit() method to confirm the transaction after commit.

There are two methods ODatabase#initiateCommit() and ODatabase#initiateCommit(boolean), which return OUncompletedCommit, which has complete and rollback methods.


Adjust limit for chained searches

Pending some work to make chained search more efficient, a more conservative limit on chain length will help prevent large queries from affecting system stability

coverage: 93.851%. remained the same when pulling 01b28be9c57f88756d2eb777b77b91a46d123989 on lower-chained-search-limit into 3e5401d9330c833e2369b968769253758702b611 on main.


Missing panels

I apologize if this has been tackled before. Working on some homebrew  things with the Homebrewery. At home on the PC I have no problems. On the go I use a tablet. That's where my questions are.
First,  while working, the HTML side expanded to full screen. I can't figure out how to get the "live" side back.
2nd, (and this just happened ) while moving things around in my document, the live side went blue screen of death. I've tried copying everything I've written but it went blue death on me again. I'm pretty sure I  copied something I shouldn't have just wondering if there was an easy fix. When I share it's all blue screen...
Additional Details
http://homebrewery.naturalcrit.com/share/B173v-ZDKZ

If you have a blue screen it means you have some invalid HTML in your code that is causing the display to crash. Make sure you don't have anything missing an end tag or something.

OK fixed the blue screen (messed up table codes ). ..still can't get the live side back on my tablets...just have a full screen html side. Any ideas?


Problem about the evaluation with the checkpoint.

Hi!
Tanks for your great work. But there is a bug when I run this in terminal:
python main.py --data [MY_data_path] --evaluate checkpoint/affectnet-7-model_best.pth
The erros information is:
RuntimeError: Error(s) in loading state_dict for pyramid_trans_exper2:     Missing key(s) in state_dict
It seems like the .pth file does not corresponds to the model used in main.py. How can I fix this bug?

i have the same problem, if you use run this code in your own computer with 1 gpu or cpu, you will meet Missing key(s) .


Deviation UUID changes on title rename?

Hi,
is this correct behaviour that the uuid ID of a deviation changes, if the user edits the deviation, e.g. changing the title? How can I track that a deviation changed?

UUID is assigned permanently and doesn't change.
One way to track deviation changes is to cache response from /deviation/{deviationid} call and compare attributes later, though it really depends on your use case.

Alright thank you. Then the user didn't only change a title but deleted and reuploaded the deviation. thank you very much. That is fine.


Support cross compiling

this should help #8, i have plan to move the current CMake-based build system to Xmake but im still in stage of getting used to it

i plan to use the mstorsjo/llvm-mingw (aka llvm-mingw) container for cross Windows builds after moving this project to Xmake

i have got some progress on adapting the current CMake build system for cross-compiling, and vcpkg seems to provide the depedencies used by magiskboot, so arm ci might be added soon

instructions for cross compiling is added in README

arm windows and linux builds works on my machine now

arm ci for linux, macos and windows is added in dev branch,
and arm linux build is tested in ci via qemu.
ci doesn't test arm macos and windows builds for obivous reasons


Error on running prerender locally

Just got the latest, tried to run it on my local:
Windows 10 64bit, Chrome 112
node server.js
2023-04-18T01:49:17.191Z Starting Prerender
2023-04-18T01:49:17.197Z Starting Chrome
2023-04-18T01:49:17.214Z Prerender server accepting requests on port 3000
2023-04-18T01:49:17.235Z Chrome connection closed... restarting Chrome
2023-04-18T01:49:17.236Z Chrome died immediately after restart... stopping Prerender
Did I missing anything here?

Set chromeLocation (path where your chrome binaries are installed).
Example :
const server = prerender({
chromeLocation: '/usr/bin/google-chrome'
});

I'm having the same issue Chrome seems to be found, but it just dies... Some idea of what might be failing?
Thanks!

Did this get resolved? I've tried a few of the fixes, including Chromium, but I'm currently unable to run this (MacOS M3).


Requirements documentation.

First list Python version, then the dependencies and finally the installation command.

Covered by:
https://github.com/NLeSC/pycoeman/commit/6a23f2bb5c89cef334349f902a0fa7d6f4e2d2e5

Done by
https://github.com/NLeSC/pycoeman/pull/10


Prompt user to confirm location returned by MapQuest

Sometimes MapQuest returns an undesired location name for input location and that name is then used in the destination dir name.
User should be informed a priori so he can cancel the operation.

Ideally the prompt also lets the user input another location in addition to cancelling the command.


AttributeError: module 'tensorflow' has no attribute 'config'

My environment is tensorflow-gpu1.13.1 , keras 2.2.4.
Using TensorFlow backend.
Traceback (most recent call last):
File "D:/Projects/Segment/Portrait/keras-maskrcnn/examples/ResNet50MaskRCNN.py", line 38, in
setup_gpu(0)
File "C:\Users\wuq\AppData\Roaming\Python\Python35\site-packages\keras_retinanet\utils\gpu.py", line 25, in setup_gpu
gpus = tf.config.list_physical_devices('GPU')
AttributeError: module 'tensorflow' has no attribute 'config'

For tensorflow1, to find out which device is used, you can enable log device placement and check outputs.
sess = tf.Session(config=tf.ConfigProto(log_device_placement=True))


encrypted checkbox is mapped to autofocus

When textbox data tab encrypted checkbox is checked, it resolves to autofocus true/false in template. Does not seems right. Here are two templates. The only difference between them is encrypt was checked. See 2 files attached.
template2.txt
tempalte1.txt

Hello Again,
Thank you for bring this issue to our attention. This will require some investigation on our side to replicate this issue.  We have created a ticket (FOR-1850) and have added to our backlog. We will let you know when this issue has been prioritized.
Please let me know if you have any further questions or concerns.
Thank you!

This is fixed in latest renderer.


Fixing the link for 2.0.0's CSV

Fixes an issue in  the CSV that screws up a link to the KC (fixed in operatorhub and redhat already).

@mew2057 is anything pending on this PR, and can be fix this link issue for 2.0.1 as well ?


on click New Chat get a Black screen

I use the Galaxy Watch 6 classic.  When I click on new chat I get a black screen.  The app is still running, I can swipe back.
 Wenn ich auf Neuer Chat klicke bekomme ich ein schwarzen Bildschirm. Die app läuft noch, ich kann zurück wischen.

Edit: Found a bug.  I selected the gboard keyboard.  It works with the Samsung keyboard

Hey, thanks for pointing that out. I've had my eye on the bug since the first version. Unfortunately, I think the bug lies with Google GBoard, as I use the official code to open the keyboard. For me, it always works the second time I open it, when the keyboard doesn't appear the first time. Try that out, otherwise the Samsung keyboard works too, of course.
I am testing the app with a Samsung Galaxy Watch 4 LTE.


Issue when auto correcting a template that contains multiple lint errors

Hi,
I detected the following issue:
Given a template with:
= "#{ @hello }"
= "#{ @hello }"
= "#{ @hello }"

When I run rubocop -A I get
Inspecting 1 file
C

Offenses:

apps/mis/app/views/mis/documents/_documents_import.html.slim:1:6: C: [Corrected] Layout/SpaceInsideStringInterpolation: Space inside string interpolation detected.
= "#{ @hello }"
     ^
apps/mis/app/views/mis/documents/_documents_import.html.slim:1:13: C: Layout/SpaceInsideStringInterpolation: Space inside string interpolation detected.
= "#{ @hello }"
            ^
apps/mis/app/views/mis/documents/_documents_import.html.slim:2:6: C: [Corrected] Layout/SpaceInsideStringInterpolation: Space inside string interpolation detected.
= "#{ @hello }"
     ^
apps/mis/app/views/mis/documents/_documents_import.html.slim:2:13: C: Layout/SpaceInsideStringInterpolation: Space inside string interpolation detected.
= "#{ @hello }"
            ^
apps/mis/app/views/mis/documents/_documents_import.html.slim:3:6: C: [Corrected] Layout/SpaceInsideStringInterpolation: Space inside string interpolation detected.
= "#{ @hello }"
     ^

And the file is auto corrected like this:
= "#{ @hello }"
= "#{@hello}"
= "#{@hello}"

So auto correction works only partially when there are multiple issues in a given template.

Thanks for the report 👍
Since slimi is just a Slim parser and has nothing to do with RuboCop, I transferred this issue from slimi to rubocop-slim.

Perhaps this is not a problem with the implementation of individual plugins such as rubocop-slim or rubocop-erb, but with rubocop, so I think it should actually be recognized as a rubocop's template API issue.
In rubocop, there is a mechanism to repeat autocorrection for a single file until there are no more offenses. On the other hand, rubocop's template API has a mechanism to treat multiple Ruby codes embedded in one template file as multiple virtual files. I assume that these mechanisms do not work well together, resulting in this problem...

After investigating for a while, I found out that RuboCop generates multiple ProcessedSource from one template, autocorrects them independently, and writes the conversion result to the original template file multiple times. Individual conversions do not take other conversions into account. So, in the end, it appears that only the result of the autocorrect for the last ProcessedSlource processed is written to the original template file.


fix(config): stop throwing on config.yml 404, fix manual init

Summary

We weren't catching the error when config.yml was 404, so manual init without a config file wasn't possible.

Deploy preview for netlify-cms-www ready!
Built with commit 37c83186af5a70b1f5446d40ce478fda3fa68be3
https://deploy-preview-1801--netlify-cms-www.netlify.com

Deploy preview for cms-demo ready!
Built with commit 37c83186af5a70b1f5446d40ce478fda3fa68be3
https://deploy-preview-1801--cms-demo.netlify.com


Not able to merge two variable fonts

Hi there,
I try to merge two variable fonts with each other and I get the following error:
AttributeError: type object 'VarStore' has no attribute 'mergeMap'
Anyone with similar experiences?
I cannot share the font file here, but I am happy to share the data with someone via PM.
Thanks a lot in advance :)

This is not currently implemented I'm afraid.

@behdad Thanks a lot for your quick answer.

Duplicate of https://github.com/fonttools/fonttools/issues/1059


ESM import does not work

npm init -y

npm pkg set type=module

npm i @mapbox/sphericalmercator@2

echo "import { SphericalMercator } from '@mapbox/sphericalmercator';" > index.js

node index.js

import { SphericalMercator } from '@mapbox/sphericalmercator';
         ^^^^^^^^^^^^^^^^^
SyntaxError: Named export 'SphericalMercator' not found. The requested module '@mapbox/sphericalmercator' is a CommonJS module, which may not support all module.exports as named exports.
CommonJS modules can always be imported via the default export, for example using:

import pkg from '@mapbox/sphericalmercator';
const { SphericalMercator } = pkg;

Shoot, this was my fault in #45! Maybe @greenlaw or @AlexanderBelokon could lend some 👀 to help remedy this in a patch release.

@MattIPv4 @mapsam PR here for your review: https://github.com/mapbox/sphericalmercator/pull/47


Mat-option class is not added to the mat-option element

Bug, feature request, or proposal:
mat-form-field
mat-select placeholder="Not Working"
mat-option class="food-{{ food.value }}" *ngFor="let food of foods" [value]="food.value"
{{food.viewValue}}
mat-option
mat-select
mat-form-field
What is the expected behavior?
La classe "mat-option" viene aggiunta all'elemento "mat-option".
What is the current behavior?
If I add a class to the dynamically composed "mat-option" element, the "mat-option" class is not added to the element.
What are the steps to reproduce?
angular-material2-issue.zip
Which versions of Angular, Material, OS, TypeScript, browsers are affected?
Angular: v6
Material: v6.4.7
Google Chrome: V70.0.3538.102 64 bit

@crisbeto Thanks.


Cannot extend native Error class

class FooError extends Error {
    constructor(message:string) {
        super(message);
    }
}
console.log((new FooError('foo')).message); // <nothing>
console.log((new Error('bar')).message); // bar

Am I missing something obvious or is there a bug with 1.8.9?

looks like a duplicate of https://github.com/Microsoft/TypeScript/issues/5069, please see the discussion in https://github.com/Microsoft/TypeScript/issues/1168#issuecomment-107833988

I did. @ahejlsberg says:

Fixed by #3516. Classes can now extend arbitrary expressions of constructor function types.

Relevant PR contains an example:
class MyError extends Error { }

it can. the compiler does not complain at you any more. the problem is not the TS compiler.
the problem here is that these classes are native, your runtime does not support extending them at the moment. In the future i would expect all these native types to be conformant with ES6 spec. @unional has a comment on how to get it to work with the engines today: https://github.com/Microsoft/TypeScript/issues/1168#issuecomment-107833988.

@mhegazy , wow, you got good memory. :+1:

Ok, I feel a little awkward here, but that example doesn't compile:
'super' must be called before accessing 'this' in the constructor of a derived class. (17009)
Type 'Error | string' is not assignable to type 'Error'.

From what I can take from there, the suggested solution is to simply do this.message = message in the constructor?

The first line is a guard. You can take it out. The compiler has changed since then.


Calling alarm_pool_cancel_alarm() with an ID of 0 will assert

Calling alarm_pool_cancel_alarm(pool, 0) or cancel_alarm(0) will trigger the assert assert(alarm_id != pool->alarm_in_progress).
Nothing in the documentation states that calling these functions with 0 as an ID is not allowed. Instead false should be returned because an alarm with ID 0 does not (and cannot) exist.

merged into develop


Make it possible to mix strings and dicts in class_names list.

To further emulate classnames it would be nice if you could provide a mix of string and dicts in the list to class_ (or {"class": ...}).
For example div(class_=("class-1", "class-2", {"class-3": False, "class-4": True})) and it resulting in

This change is very useful. Thanks!


Hostname resolution in client library

https://github.com/nats-io/nats-architecture-and-design/issues/23

Replaced by https://github.com/nats-io/nats.java/issues/734


Grunt Compass Operation Not Permitted

Hello all,
I'm rather new to grunt and am loving it, but quite frustrated with my lack of success after moving to 'el capitan' with compass. From the grunt project directory, running 'grunt' has an EPERM error seemingly indicating that my sass/scss fails to compile with the compass/watch combo:
sh-3.2# grunt
Running "compass:dev" (compass) task
unchanged img/common/1x-scb9effd9a6.png
unchanged img/common/2x-sd9683d03fa.png
Errno::EPERM on line ["512"] of /Library/Ruby/Gems/2.0.0/gems/sass-3.4.19/lib/sass/plugin/compiler.rb: Operation not permitted - /Applications/MAMP/htdocs/Repos/dev/wp-content/themes/quindodo/_/css/giving.css
Run with --trace to see the full backtrace
Warning: ↑ Use --force to continue.

Grunt file is as follows:
  module.exports = function(grunt) {

//All configuration goes here
grunt.initConfig({
	pkg: grunt.file.readJSON('package.json'),

	compass: {
		dev: {
	    	options: {
	        	sassDir: 'sass',
	        	cssDir: 'css',
	        	fontsDir: 'fonts',
	        	imagesDir: 'img',
	        	images: 'img',
	        	javascriptsDir: 'js/pro',
	        	//environment: 'development',
	        	outputStyle: 'compressed',
	        	relativeAssets: false,
	        	httpPath: '.',
	        }
	    },
	},

	watch: {
	        compass: {
	    	files: ['*.{scss,sass}'],
	    	tasks: ['compass:dev'],
	    }

	},
});
// Where we tell Grunt we plan to use this plug-in.
grunt.loadNpmTasks('grunt-contrib-compass');
grunt.loadNpmTasks('grunt-contrib-watch');

// Where we tell Grunt what to do when we type "grunt" into the terminal.
grunt.registerTask('default',['compass','watch']);
};

Lastly, my package.json
 {
"name": "quindido",
"version": "0.0.0",
"description": "Quindodo Theme CSS",
"private": true,
"devDependencies": {
 "grunt": "~0.4.5",
 "grunt-contrib-jshint": ">=0.10.0",
 "grunt-contrib-nodeunit": ">=0.4.1",
 "grunt-contrib-sass": ">0.0.1",
 "grunt-contrib-watch": ">0.0.1"
  }
 }

I will be hugely thankful for a solution. I tried disabling CIP. I also tried 'sudo gem install -n /usr/local/bin compass' as well as 'gem update --system'. I think I've successfully uninstalled and re-installed npm and the modules. I also just tried removing 'grunt-contrib-compass' from the devDependencies.

On further note, I've tried bypassing the grunt file and simply using sass to watch my file. It seems compass is not working 'Line 1: File to import not found or unreadable: compass'

The error is coming from Compass, not this plugin:

Errno::EPERM on line ["512"] of /Library/Ruby/Gems/2.0.0/gems/sass-3.4.19/lib/sass/plugin/compiler.rb: Operation not permitted

Seems you have some permission problems. Try reinstalling Sass. If not, Stack Overflow is where you'd want to ask support questions.


Question

Brock, I see that this project is still in "beta".  Is it something that is safe to use on an enterprise project?  I want to make sure I'm not investing in something that is not being supported.

It's designed to be a developer and possible an admin focused UI tool to replace the old ASP.NET user admin tool (mainly to bootstrap your identity database). It's not designed for end user scenarios (for example, UI customization).

No for sure.  I want to use it as an admin focused UI tool, I just wanted to make sure that it was "done" enough to be able to do that.  Otherwise I'll extract the database portion of it and simply roll my own front end.

People do use it for their admins. But, like I said, it's not designed for any UI flexibility, so once you start wanting to customize things you will need your own UI. There is flexibility in the user data model, though.
YMMV


Select explain

Here's a screenshot showing a streamlit app that makes a HF inference API request based on selected text and displays the result to the user. Note that only the button is part of the component, the selected text is outside the component iframe.

I didn't find a way to adjust the security settings to get past the same-origin restriction on the component iframe, so I'm having to build the JS and serve it via the same port as the Streamlit application, which is more annoying than using the default Streamlit dev process, but we could at least improve it with a process that detects file changes and automatically rebuilds.

@Prtfw A few updates:

I added chokidar-cli to make the development process a bit smoother (rebuilds the JS after detecting file changes).
Moved the component to the sidebar in the demo app, which is probably a good choice for our app too:
Added a way to choose which model you're using to provide the explanation. Neither of the options I've included so far is really usable but at least show how to interact with the HF inference API and display the result.


Different export format

Right now the export use jiffy and generate a json. It would be nicer to simply output a string format that is more specific.
There are a few. No idea yet which one would make sense. Will add more research

See in particular https://github.com/aggregateknowledge/hll-storage-spec/blob/master/STORAGE.md


[Question][HELP] Change yurt-manager ClusterRoleBinding name

What happened:
now, in openyurt  helm chart, the name of yurt-manager clusterrolebing is manager-rolebinding.
manager-rolebinding is a generic name created by kubebuild, which is prone to name conflicts and cannot be used properly

What you expected to happen:
I suggest changing the name manager-rolebinding to manager-yurt-manager-rolebinding
How to reproduce it (as minimally and precisely as possible):
Anything else we need to know?:
Environment:

OpenYurt version:
Kubernetes version (use kubectl version):
OS (e.g: cat /etc/os-release):
Kernel (e.g. uname -a):
Install tools:
Others:

others
/kind question

@kadisi  I see that in creating a test cluster in e2e, the name of ClusterRoleBinding is yurt-manager-rolebinding. Perhaps we could also change it to this.


Use npm for third party libraries

Part of https://github.com/CesiumGS/cesium/issues/9473. This moves most of the third party libraries to npm.
A few things are missing from this PR still, but maybe the missing packages can be a follow-up PR:

[x] Test NoSleep on mobile
[x] Test npm with release steps (i.e. makeZipFile)
~- [ ] protobuf is missing due to a circular dependency that looks incompatible with rollup - https://github.com/protobufjs/protobuf.js/issues/1402~
~- [ ] knockout wrapper is missing because we added our own export to the knockout-es5 module and I haven't figured out how to access the attachToKo function with the npm package version.~
~- [ ] zip.js is missing because we used an old version that used the createWriter function which doesn't exist in any of the npm releases. This probably isn't hard to work around, just needs some changes in exportKml and KmlDataSource.~

This might be a question for @mramato, but I noticed there is a pako.min.js file in Apps/Sandcastle/ThirdParty. Are we fine with keeping this here now that we use the pako npm package?

Thanks for the pull request @ebogo1!

:heavy_check_mark: Signed CLA found.
:grey_question: Changes to third party files were made.

Looks like a file in one of our ThirdParty folders (ThirdParty/, Source/ThirdParty/) has been added or modified. Please verify that it has a section in LICENSE.md and that its license information is up to date with this new version.

:grey_question: Unit tests were not updated.

Make sure you've updated tests to reflect your changes, added tests for any new code, and ran the code coverage tool.

Reviewers, don't forget to make sure that:

[ ] Cesium Viewer works.
[ ] Works in 2D/CV.
[ ] Works (or fails gracefully) in IE11.

Can ktx-parse be added too? CC https://github.com/CesiumGS/cesium/issues/9473#issuecomment-866257585

I didn't test all that carefully besides running the unit tests but the changes look fine. @mramato do you want to review?

Thanks, I will take a look.  @ebogo1 what is your plan for the checklist?

Can ktx-parse be added too? CC #9473 (comment)

Yeah, good call #:+1:

what is your plan for the checklist?

For this PR's checklist, I will test NoSleep and try to get zip.js working with the newer version. Not sure what the best workarounds are for knockout or protobuf yet, but I'd be okay with doing them in a separate pass.
For the issue checklist, I imagine there will be a PR for whatever's left in the "npm category" after this one, another for moving files into Source/ (i.e. FXAA), and maybe a couple small ones for individual packages like Uri.js if they can be removed entirely now that IE11 is dropped. Also I'd like to try and make gltf-pipeline and npm package.

Thanks @ebogo1. I built the code and did some spot checks of sandcastle examples and ran the units tests. Will do a full review once the staging branch is ready to merge into main.

Also, what's the order of events for follow up PRs?

what's the order of events for follow up PRs?

I'm thinking:

zip.js, which should be able to remove the inflate/deflate files in the Workers folder
knockout and protobuf in some order (these are the npm modules that didn't work straight away)
measureText + Uri (probably to be removed)
google-earth-dbroot-parser.js, GltfPipeline, FXAA (to be moved into Source)
Draco decoder with npm

These can be done in any order though.


PANIC in query-engine/core/src/interpreter/query_interpreters/nested_read.rs:233:50called Option::unwrap() on a None value

Hi Prisma Team! My Prisma Client just crashed.
Everything work for the first query:
{
  skip: 0,
  take: 20,
  cursor: undefined,
  where: undefined,
  orderBy: { time: 'desc' },
  include: { history: { select: {name: true } } }
}

And then it crashes on the second query:
{
  skip: 20,
  take: 20,
  cursor: undefined,
  where: undefined,
  orderBy: { time: 'desc' },
  include: { history: { select: {name: true } } }
}

I'm not sure what I should be looking for, as the error isn't descriptive for me.
Generated report:
Versions

Name
Version

Node
v12.18.1

OS
debian-openssl-1.1.x

Prisma Client
2.26.0

Query Engine
query-engine 9b816b3aa13cc270074f172f30d6eda8a8ce867d

Database
undefined

Query
query {
  findManyBan(
    skip: 5
    take: 5
    orderBy: [
      {
        time: desc
      }
    ]
  ) {
    id
    uuid
    ip
    reason
    banned_by_uuid
    banned_by_name
    removed_by_uuid
    removed_by_name
    removed_by_date
    removed_by_reason
    time
    until
    server_scope
    server_origin
    silent
    ipban
    ipban_wildcard
    active
    history {
      name
    }
  }
}

Logs
8m
  prisma:engine Search for Query Engine in /home/armeeh/Projects/Me/minecraft/website/apis/node_modules/.prisma/client
  prisma:engine Search for Query Engine in /home/armeeh/Projects/Me/minecraft/website/apis/node_modules/.prisma/client
  plusX Execution permissions of /home/armeeh/Projects/Me/minecraft/website/apis/node_modules/.prisma/client/query-engine-debian-openssl-1.1.x are fine
  plusX Execution permissions of /home/armeeh/Projects/Me/minecraft/website/apis/node_modules/.prisma/client/query-engine-debian-openssl-1.1.x are fine
  prisma:engine { flags: [ '--enable-raw-queries', '--port', '45539' ] }
  prisma:engine stdout  Starting a mysql pool with 13 connections.
  prisma:engine stdout  Started http server on http://<IP_ADDRESS>:45539
  prisma:engine Search for Query Engine in /home/armeeh/Projects/Me/minecraft/website/apis/node_modules/.prisma/client
  plusX Execution permissions of /home/armeeh/Projects/Me/minecraft/website/apis/node_modules/.prisma/client/query-engine-debian-openssl-1.1.x are fine
  prisma:engine Client Version: 2.26.0
  prisma:engine Engine Version: query-engine 9b816b3aa13cc270074f172f30d6eda8a8ce867d
  prisma:engine Active provider: mysql
  prisma:engine stdout  PANIC in query-engine/core/src/interpreter/query_interpreters/nested_read.rs:233:50
called `Option::unwrap()` on a `None` value  +7s
  prisma:engine {
  prisma:engine   error: SocketError: other side closed
  prisma:engine       at Socket.onSocketEnd (/home/armeeh/Projects/Me/minecraft/website/apis/node_modules/@prisma/client/runtime/index.js:25782:24)
  prisma:engine       at Socket.emit (events.js:327:22)
  prisma:engine       at endReadableNT (_stream_readable.js:1221:12)
  prisma:engine       at processTicksAndRejections (internal/process/task_queues.js:84:21) {
  prisma:engine     code: 'UND_ERR_SOCKET'
  prisma:engine   }
  prisma:engine }
  prisma:engine {
  prisma:engine   error: Error: connect ECONNREFUSED <IP_ADDRESS>:45539
  prisma:engine       at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1141:16) {
  prisma:engine     errno: 'ECONNREFUSED',
  prisma:engine     code: 'ECONNREFUSED',
  prisma:engine     syscall: 'connect',
  prisma:engine     address: '<IP_ADDRESS>',
  prisma:engine     port: 45539
  prisma:engine   }
  prisma:engine }
  prisma:engine { cwd: '/home/armeeh/Projects/Me/minecraft/website/apis/prisma' }
  prisma:engine Search for Query Engine in /home/armeeh/Projects/Me/minecraft/website/apis/node_modules/.prisma/client
  plusX Execution permissions of /home/armeeh/Projects/Me/minecraft/website/apis/node_modules/.prisma/client/query-engine-debian-openssl-1.1.x are fine  +7s
  prisma:engine { flags: [ '--enable-raw-queries', '--port', '46589' ] }
  prisma:engine stdout  Starting a mysql pool with 13 connections.
  prisma:engine stdout  Started http server on http://<IP_ADDRESS>:46589
  prisma:engine Search for Query Engine in /home/armeeh/Projects/Me/minecraft/website/apis/node_modules/.prisma/client
  plusX Execution permissions of /home/armeeh/Projects/Me/minecraft/website/apis/node_modules/.prisma/client/query-engine-debian-openssl-1.1.x are fine
  prisma:engine Client Version: 2.26.0
  prisma:engine Engine Version: query-engine 9b816b3aa13cc270074f172f30d6eda8a8ce867d
  prisma:engine Active provider: mysql
  prisma:engine stdout  PANIC in query-engine/core/src/interpreter/query_interpreters/nested_read.rs:233:50
called `Option::unwrap()` on a `None` value
  prisma:engine {
  prisma:engine   error: SocketError: other side closed
  prisma:engine       at Socket.onSocketEnd (/home/armeeh/Projects/Me/minecraft/website/apis/node_modules/@prisma/client/runtime/index.js:25782:24)
  prisma:engine       at Socket.emit (events.js:327:22)
  prisma:engine       at endReadableNT (_stream_readable.js:1221:12)
  prisma:engine       at processTicksAndRejections (internal/process/task_queues.js:84:21) {
  prisma:engine     code: 'UND_ERR_SOCKET'
  prisma:engine   }
  prisma:engine }

Client Snippet
import { Injectable } from '@nestjs/common';
import { Prisma } from '@prisma/client';

// PrismaService is basically 1:1 copy of nestjs prisma recipe https://docs.nestjs.com/recipes/prisma#use-prisma-client-in-your-nestjs-services
import { PrismaService } from '../prisma/prisma.service';

@Injectable()
export class BansService {
  constructor(private prisma: PrismaService) {}

  async bans(params: {
    skip?: number;
    take?: number;
    cursor?: Prisma.BanWhereUniqueInput;
    where?: Prisma.BanWhereInput;
    orderBy?: Prisma.BanOrderByInput;
  }) {
    const { skip, take, cursor, where, orderBy } = params;
    const bans = await this.prisma.ban.findMany({
      skip,
      take,
      cursor,
      where,
      orderBy,
      include: {
        history: {
          select: { name: true },
        },
      },
    });
    const count = await this.prisma.ban.count({ where });

    return {
      count,
      bans: bans.map(({ id, time, until, ...ban }) => ({
        id: Number(id),
        ...ban,
        time: new Date(Number(time)),
        until: new Date(Number(until)),
      })),
    };
  }
}

Schema
model Ban {
  id                BigInt      @id @default(autoincrement()) @db.UnsignedBigInt
  uuid              String?     @db.VarChar(36)
  ip                String?     @db.VarChar(45)
  reason            String      @db.VarChar(2048)
  banned_by_uuid    String?     @db.VarChar(36)
  banned_by_name    String?     @db.VarChar(128)
  removed_by_uuid   String?     @db.VarChar(36)
  removed_by_name   String?     @db.VarChar(128)
  removed_by_date   DateTime?   @db.Timestamp(0)
  removed_by_reason String?     @db.VarChar(2048)
  time              BigInt
  until             BigInt
  server_scope      String?     @db.VarChar(32)
  server_origin     String?     @db.VarChar(32)
  silent            Boolean     @db.Bit(1)
  ipban             Boolean     @db.Bit(1)
  ipban_wildcard    Boolean     @db.Bit(1)
  active            Boolean     @db.Bit(1)
  history           BanHistory? @relation(fields: [uuid], references: [uuid])

  @@index([active], name: "idx_lbans_bans_active")
  @@index([banned_by_uuid], name: "idx_lbans_bans_banned_by_uuid")
  @@index([ip], name: "idx_lbans_bans_ip")
  @@index([ipban], name: "idx_lbans_bans_ipban")
  @@index([ipban_wildcard], name: "idx_lbans_bans_ipban_wildcard")
  @@index([time], name: "idx_lbans_bans_time")
  @@index([until], name: "idx_lbans_bans_until")
  @@index([uuid], name: "idx_lbans_bans_uuid")
  @@map("lbans_bans")
}

model BanHistory {
  id   BigInt    @id @default(autoincrement()) @db.UnsignedBigInt
  date DateTime? @default(now()) @db.Timestamp(0)
  name String    @db.VarChar(16)
  uuid String    @db.VarChar(36)
  ip   String    @db.VarChar(45)

  @@index([ip], name: "idx_lbans_history_ip")
  @@index([name], name: "idx_lbans_history_name")
  @@index([uuid], name: "idx_lbans_history_uuid")
  @@map("lbans_history")
  Ban Ban[]
}

If any more info would be helpfull, let me know, I'll provide it.

I suspected this might be a problem with the data but running following query:
SELECT lb.id, lb.uuid, lb.ip, reason, banned_by_uuid, banned_by_name, removed_by_uuid, removed_by_name, removed_by_date, removed_by_reason, `time`, until, server_scope, server_origin, silent, ipban, ipban_wildcard, active, lh.name
FROM gamerealms.lbans_bans as lb
LEFT JOIN gamerealms.lbans_history lh on lh.uuid = lb.uuid
LIMIT 20 OFFSET 20;

Returns all records and the join is successful for all of them.

I think I found the core of the problem, a single Ban can have multiple History records, however they are not linked using id, so I can't figure out how to make this relation work in my prisma schema.
Changed my schema to this:
model Ban {
  id                BigInt      @id @default(autoincrement()) @db.UnsignedBigInt
  uuid              String?     @db.VarChar(36)
  ip                String?     @db.VarChar(45)
  reason            String      @db.VarChar(2048)
  banned_by_uuid    String?     @db.VarChar(36)
  banned_by_name    String?     @db.VarChar(128)
  removed_by_uuid   String?     @db.VarChar(36)
  removed_by_name   String?     @db.VarChar(128)
  removed_by_date   DateTime?   @db.Timestamp(0)
  removed_by_reason String?     @db.VarChar(2048)
  time              BigInt
  until             BigInt
  server_scope      String?     @db.VarChar(32)
  server_origin     String?     @db.VarChar(32)
  silent            Boolean     @db.Bit(1)
  ipban             Boolean     @db.Bit(1)
  ipban_wildcard    Boolean     @db.Bit(1)
  active            Boolean     @db.Bit(1)
  history           BanHistory[] @relation(fields: [uuid], references: [uuid])

  @@index([active], name: "idx_lbans_bans_active")
  @@index([banned_by_uuid], name: "idx_lbans_bans_banned_by_uuid")
  @@index([ip], name: "idx_lbans_bans_ip")
  @@index([ipban], name: "idx_lbans_bans_ipban")
  @@index([ipban_wildcard], name: "idx_lbans_bans_ipban_wildcard")
  @@index([time], name: "idx_lbans_bans_time")
  @@index([until], name: "idx_lbans_bans_until")
  @@index([uuid], name: "idx_lbans_bans_uuid")
  @@map("lbans_bans")
}

I endup with:
Error: Schema parsing
error: Error validating: Many to many relations must always reference the id field of the
 related model. Change the argument `references` to use the id field of the related model
 `BanHistory`. But it is referencing the following fields that are not the id: uuid

From a rough read, making the uuid the @id in your schema might be the only way really to achieve this. Although our error message might be a bit confusing here, as it says id where I think it means @id.

I'm not sure how that helps me. If I switch to the many-to-many it just won't work, since it's looking for a relation table (which I can't create, the DB schema is out of my hands).
I changed my prisma schema to this:
model Ban {
  id                BigInt      @id @default(autoincrement()) @db.UnsignedBigInt
  uuid              String?     @db.VarChar(36)
  ip                String?     @db.VarChar(45)
  reason            String      @db.VarChar(2048)
  banned_by_uuid    String?     @db.VarChar(36)
  banned_by_name    String?     @db.VarChar(128)
  removed_by_uuid   String?     @db.VarChar(36)
  removed_by_name   String?     @db.VarChar(128)
  removed_by_date   DateTime?   @db.Timestamp(0)
  removed_by_reason String?     @db.VarChar(2048)
  time              BigInt
  until             BigInt
  server_scope      String?     @db.VarChar(32)
  server_origin     String?     @db.VarChar(32)
  silent            Boolean     @db.Bit(1)
  ipban             Boolean     @db.Bit(1)
  ipban_wildcard    Boolean     @db.Bit(1)
  active            Boolean     @db.Bit(1)
  history           BanHistory[] @relation(fields: [uuid], references: [uuid])

  @@index([active], name: "idx_lbans_bans_active")
  @@index([banned_by_uuid], name: "idx_lbans_bans_banned_by_uuid")
  @@index([ip], name: "idx_lbans_bans_ip")
  @@index([ipban], name: "idx_lbans_bans_ipban")
  @@index([ipban_wildcard], name: "idx_lbans_bans_ipban_wildcard")
  @@index([time], name: "idx_lbans_bans_time")
  @@index([until], name: "idx_lbans_bans_until")
  @@index([uuid], name: "idx_lbans_bans_uuid")
  @@map("lbans_bans")
}

model BanHistory {
  id   BigInt    @db.UnsignedBigInt
  date DateTime? @default(now()) @db.Timestamp(0)
  name String    @db.VarChar(16)
  uuid String    @id @db.VarChar(36)
  ip   String    @db.VarChar(45)
  Ban Ban[]

  @@index([ip], name: "idx_lbans_history_ip")
  @@index([name], name: "idx_lbans_history_name")
  @@index([uuid], name: "idx_lbans_history_uuid")
  @@map("lbans_history")
}

I end up with this error:
Invalid `prisma.ban.findMany()` invocation:

The table `_BanToBanHistory` does not exist in the current database.

The information is very fragmented here. I tried a reproduction but couldn't reproduce.
Can you share a minimal example which crashes in a git repo?


fix #335: change converter priority to permit client_secret_post authentication

invert priority between client secret post authentication converter and client secret basic authentication converter, to prevent exception thrown in method :
public OAuth2ClientSecretAuthenticationToken attemptConvert(HttpServletRequest request) {
    try {
        Pair<String, Optional<String>> basicAuth = extractBasicAuth(request);
        if (basicAuth == null) {
            throw new OAuth2AuthenticationException(new OAuth2Error(OAuth2ErrorCodes.INVALID_REQUEST));
        }
of class ClientSecretBasicAuthenticationConverter.
client_id and client_secret authentication is an allowed method and should not thrown INVALID_REQUEST exception.

new pull request with bugfix instead of workaround #337


from /usr/local/include/absl/types/optional.h:39,
from /localssd/balint/catkin_ws3/src/cartographer/cartographer/mapping/trajectory_node.h:24,
from /localssd/balint/catkin_ws3/src/cartographer/cartographer/mapping/2d/map_limits.h:28,
from /localssd/balint/catkin_ws3/src/cartographer/cartographer/mapping/2d/grid_2d.h:22,
from /localssd/balint/catkin_ws3/src/cartographer/cartographer/mapping/2d/submap_2d.h:25,
from /localssd/balint/catkin_ws3/src/cartographer/cartographer/mapping/internal/2d/local_trajectory_builder_2d.h:24,
from /localssd/balint/catkin_ws3/src/cartographer/cartographer/metrics/register.cc:19:
/usr/local/include/absl/meta/type_traits.h:481:31: error: ‘hash’ is not a member of ‘std’
decltype(std::declval<std::hash&>()(std::declval<Key const&>())),
^
/usr/local/include/absl/meta/type_traits.h:481:31: note: suggested alternatives:
In file included from /usr/include/c++/5/tr1/unordered_map:40:0,
from /usr/local/include/google/protobuf/stubs/hash.h:152,
from /usr/local/include/google/protobuf/map.h:49,
from /usr/local/include/google/protobuf/generated_message_table_driven.h:34,
from ./cartographer/mapping/proto/cell_limits_2d.pb.h:25,
from /localssd/balint/catkin_ws3/src/cartographer/cartographer/mapping/2d/xy_index.h:28,
from /localssd/balint/catkin_ws3/src/cartographer/cartographer/mapping/2d/map_limits.h:26,
from /localssd/balint/catkin_ws3/src/cartographer/cartographer/mapping/2d/grid_2d.h:22,
from /localssd/balint/catkin_ws3/src/cartographer/cartographer/mapping/2d/submap_2d.h:25,
from /localssd/balint/catkin_ws3/src/cartographer/cartographer/mapping/internal/2d/local_trajectory_builder_2d.h:24,
from /localssd/balint/catkin_ws3/src/cartographer/cartographer/metrics/register.cc:19:
/usr/include/c++/5/tr1/functional_hash.h:45:12: note:   ‘std::tr1::hash’
struct hash : public std::unary_function<_Tp, size_t>
^
In file included from /usr/include/boost/shared_ptr.hpp:17:0,
from /usr/include/boost/iostreams/filter/symmetric.hpp:60,
from /usr/include/boost/iostreams/filter/zlib.hpp:31,
from /usr/include/boost/iostreams/filter/gzip.hpp:38,
from /localssd/balint/catkin_ws3/src/cartographer/cartographer/common/port.h:21,
from /localssd/balint/catkin_ws3/src/cartographer/cartographer/common/time.h:24,
from /localssd/balint/catkin_ws3/src/cartographer/cartographer/mapping/internal/2d/local_trajectory_builder_2d.h:23,
from /localssd/balint/catkin_ws3/src/cartographer/cartographer/metrics/register.cc:19:
/usr/include/boost/smart_ptr/shared_ptr.hpp:1019:28: note:   ‘boost::hash’
template< class T > struct hash;
^
In file included from /usr/local/include/google/protobuf/map.h:49:0,
from /usr/local/include/google/protobuf/generated_message_table_driven.h:34,
from ./cartographer/mapping/proto/cell_limits_2d.pb.h:25,
from /localssd/balint/catkin_ws3/src/cartographer/cartographer/mapping/2d/xy_index.h:28,
from /localssd/balint/catkin_ws3/src/cartographer/cartographer/mapping/2d/map_limits.h:26,
from /localssd/balint/catkin_ws3/src/cartographer/cartographer/mapping/2d/grid_2d.h:22,
from /localssd/balint/catkin_ws3/src/cartographer/cartographer/mapping/2d/submap_2d.h:25,
from /localssd/balint/catkin_ws3/src/cartographer/cartographer/mapping/internal/2d/local_trajectory_builder_2d.h:24,
from /localssd/balint/catkin_ws3/src/cartographer/cartographer/metrics/register.cc:19:
/usr/local/include/google/protobuf/stubs/hash.h:336:8: note:   ‘google::protobuf::hash’
struct hash : public GOOGLE_PROTOBUF_HASH_NAMESPACE::hash {
^
In file included from /usr/local/include/absl/utility/utility.h:50:0,
from /usr/local/include/absl/types/optional.h:39,
from /localssd/balint/catkin_ws3/src/cartographer/cartographer/mapping/trajectory_node.h:24,
from /localssd/balint/catkin_ws3/src/cartographer/cartographer/mapping/2d/map_limits.h:28,
from /localssd/balint/catkin_ws3/src/cartographer/cartographer/mapping/2d/grid_2d.h:22,
from /localssd/balint/catkin_ws3/src/cartographer/cartographer/mapping/2d/submap_2d.h:25,
from /localssd/balint/catkin_ws3/src/cartographer/cartographer/mapping/internal/2d/local_trajectory_builder_2d.h:24,
from /localssd/balint/catkin_ws3/src/cartographer/cartographer/metrics/register.cc:19:
/usr/local/include/absl/meta/type_traits.h:481:45: error: ‘&’ cannot appear in a constant-expression
decltype(std::declval<std::hash&>()(std::declval<Key const&>())),
^
/usr/local/include/absl/meta/type_traits.h:481:50: error: ‘declval’ is not a member of ‘std’
decltype(std::declval<std::hash&>()(std::declval<Key const&>())),
^
/usr/local/include/absl/meta/type_traits.h:481:50: note: suggested alternative:
In file included from /usr/include/boost/utility/result_of.hpp:32:0,
from /usr/include/boost/iostreams/detail/execute.hpp:44,
from /usr/include/boost/iostreams/detail/streambuf/direct_streambuf.hpp:23,
from /usr/include/boost/iostreams/stream_buffer.hpp:21,
from /usr/include/boost/iostreams/chain.hpp:35,
from /usr/include/boost/iostreams/filtering_streambuf.hpp:17,
from /usr/include/boost/iostreams/filtering_stream.hpp:22,
from /localssd/balint/catkin_ws3/src/cartographer/cartographer/common/port.h:22,
from /localssd/balint/catkin_ws3/src/cartographer/cartographer/common/time.h:24,
from /localssd/balint/catkin_ws3/src/cartographer/cartographer/mapping/internal/2d/local_trajectory_builder_2d.h:23,
from /localssd/balint/catkin_ws3/src/cartographer/cartographer/metrics/register.cc:19:
/usr/include/boost/utility/declval.hpp:40:44: note:   ‘boost::declval’
typename add_rvalue_reference::type declval() BOOST_NOEXCEPT; // as unevaluated operand
^
In file included from /usr/local/include/absl/utility/utility.h:50:0,
from /usr/local/include/absl/types/optional.h:39,
from /localssd/balint/catkin_ws3/src/cartographer/cartographer/mapping/trajectory_node.h:24,
from /localssd/balint/catkin_ws3/src/cartographer/cartographer/mapping/2d/map_limits.h:28,
from /localssd/balint/catkin_ws3/src/cartographer/cartographer/mapping/2d/grid_2d.h:22,
from /localssd/balint/catkin_ws3/src/cartographer/cartographer/mapping/2d/submap_2d.h:25,
from /localssd/balint/catkin_ws3/src/cartographer/cartographer/mapping/internal/2d/local_trajectory_builder_2d.h:24,
from /localssd/balint/catkin_ws3/src/cartographer/cartographer/metrics/register.cc:19:
/usr/local/include/absl/meta/type_traits.h:481:76: error: a function call cannot appear in a constant-expression
decltype(std::declval<std::hash&>()(std::declval<Key const&>())),
^
/usr/local/include/absl/meta/type_traits.h:481:77: error: a function call cannot appear in a constant-expression
decltype(std::declval<std::hash&>()(std::declval<Key const&>())),
^
/usr/local/include/absl/meta/type_traits.h:482:20: error: wrong number of template arguments (3, should be at least 1)
std::size_t>::value>> : std::true_type {};
^
/usr/local/include/absl/meta/type_traits.h:475:8: note: provided for ‘template<class Key, class> struct absl::type_traits_internal::IsHashable’
struct IsHashable : std::false_type {};
^
/usr/local/include/absl/meta/type_traits.h:482:28: error: expected unqualified-id before ‘>>’ token
std::size_t>::value>> : std::true_type {};
^
/usr/local/include/absl/meta/type_traits.h:492:10: error: expected type-specifier before ‘decltype’
-> decltype(std::declval<std::hash>()(std::declval<Key const&>()));
^
/usr/local/include/absl/meta/type_traits.h:492:10: error: expected initializer before ‘decltype’
/usr/local/include/absl/meta/type_traits.h:497:15: error: ‘nullptr_t’ in namespace ‘std’ does not name a type
static std::nullptr_t DoIt() {
^
/usr/local/include/absl/meta/type_traits.h: In function ‘void absl::type_traits_internal::AssertHashEnabled()’:
/usr/local/include/absl/meta/type_traits.h:523:9: error: expected nested-name-specifier before ‘Helper’
using Helper = AssertHashEnabledHelper;
^
/usr/local/include/absl/meta/type_traits.h:524:3: error: ‘Helper’ has not been declared
Helper::Sink(Helper::DoIt()...);
^
/usr/local/include/absl/meta/type_traits.h:524:16: error: ‘Helper’ has not been declared
Helper::Sink(Helper::DoIt()...);
^
/usr/local/include/absl/meta/type_traits.h:524:31: error: expected primary-expression before ‘>’ token
Helper::Sink(Helper::DoIt()...);
^
/usr/local/include/absl/meta/type_traits.h:524:33: error: expected primary-expression before ‘)’ token
Helper::Sink(Helper::DoIt()...);
^
/usr/local/include/absl/meta/type_traits.h: At global scope:
/usr/local/include/absl/meta/type_traits.h:541:1: error: expected unqualified-id before ‘using’
using IsSwappableImpl = decltype(swap(std::declval<T&>(), std::declval<T&>()));
^
/usr/local/include/absl/meta/type_traits.h:545:35: error: ‘integral_constant’ in namespace ‘std’ does not name a template type
class IsNoexcept = std::integral_constant<
^
/usr/local/include/absl/meta/type_traits.h:545:52: error: expected ‘>’ before ‘<’ token
class IsNoexcept = std::integral_constant<
^
/usr/local/include/absl/meta/type_traits.h:547:80: error: expected unqualified-id before ‘;’ token
using IsNothrowSwappableImpl = typename std::enable_ifIsNoexcept::value::type;
^
/usr/local/include/absl/meta/type_traits.h:555:47: error: ‘IsSwappableImpl’ was not declared in this scope
: absl::type_traits_internal::is_detected<IsSwappableImpl, T> {};
^
/usr/local/include/absl/meta/type_traits.h:555:65: error: template argument 1 is invalid
: absl::type_traits_internal::is_detected<IsSwappableImpl, T> {};
^
/usr/local/include/absl/meta/type_traits.h:563:47: error: ‘IsNothrowSwappableImpl’ was not declared in this scope
: absl::type_traits_internal::is_detected<IsNothrowSwappableImpl, T> {};
^
/usr/local/include/absl/meta/type_traits.h:563:72: error: template argument 1 is invalid
: absl::type_traits_internal::is_detected<IsNothrowSwappableImpl, T> {};
^
/usr/local/include/absl/meta/type_traits.h:569:26: error: ‘absl::enable_if_t’ has not been declared
template <class T, absl::enable_if_t<IsSwappable::value, int> = 0>
^
/usr/local/include/absl/meta/type_traits.h:569:37: error: expected ‘>’ before ‘<’ token
template <class T, absl::enable_if_t<IsSwappable::value, int> = 0>
^
/usr/local/include/absl/meta/type_traits.h:570:27: error: expected initializer before ‘noexcept’
void Swap(T& lhs, T& rhs) noexcept(IsNothrowSwappable::value) {
^
/usr/local/include/absl/meta/type_traits.h:579:7: error: expected nested-name-specifier before ‘StdSwapIsUnconstrained’
using StdSwapIsUnconstrained = IsSwappable<void()>;
^
/usr/local/include/absl/meta/type_traits.h:588:22: error: ‘absl::swap_internal::Swap’ has not been declared
using swap_internal::Swap;
^
/usr/local/include/absl/meta/type_traits.h:589:22: error: ‘absl::swap_internal::StdSwapIsUnconstrained’ has not been declared
using swap_internal::StdSwapIsUnconstrained;
^
In file included from /usr/local/include/absl/types/optional.h:39:0,
from /localssd/balint/catkin_ws3/src/cartographer/cartographer/mapping/trajectory_node.h:24,
from /localssd/balint/catkin_ws3/src/cartographer/cartographer/mapping/2d/map_limits.h:28,
from /localssd/balint/catkin_ws3/src/cartographer/cartographer/mapping/2d/grid_2d.h:22,
from /localssd/balint/catkin_ws3/src/cartographer/cartographer/mapping/2d/submap_2d.h:25,
from /localssd/balint/catkin_ws3/src/cartographer/cartographer/mapping/internal/2d/local_trajectory_builder_2d.h:24,
from /localssd/balint/catkin_ws3/src/cartographer/cartographer/metrics/register.cc:19:
/usr/local/include/absl/utility/utility.h:75:9: error: expected nested-name-specifier before ‘value_type’
using value_type = T;
^
/usr/local/include/absl/utility/utility.h:76:10: error: ‘constexpr’ does not name a type
static constexpr size_t size() noexcept { return sizeof...(Ints); }
^
/usr/local/include/absl/utility/utility.h:76:10: note: C++11 ‘constexpr’ only available with -std=c++11 or -std=gnu++11
/usr/local/include/absl/utility/utility.h:85:1: error: expected unqualified-id before ‘using’
using index_sequence = integer_sequence<size_t, Ints...>;
^
/usr/local/include/absl/utility/utility.h:95:9: error: expected nested-name-specifier before ‘type’
using type = integer_sequence<T, Ints..., (Ints + SeqSize)...>;
^
/usr/local/include/absl/utility/utility.h:100:9: error: expected nested-name-specifier before ‘type’
using type = integer_sequence<T, Ints..., (Ints + SeqSize)..., 2 * SeqSize>;
^
/usr/local/include/absl/utility/utility.h:107:9: error: expected nested-name-specifier before ‘type’
using type =
^
/usr/local/include/absl/utility/utility.h:113:9: error: expected nested-name-specifier before ‘type’
using type = integer_sequence;
^
/usr/local/include/absl/utility/utility.h:126:1: error: expected unqualified-id before ‘using’
using make_integer_sequence = typename utility_internal::Gen<T, N>::type;
^
/usr/local/include/absl/utility/utility.h:134:1: error: expected unqualified-id before ‘using’
using make_index_sequence = make_integer_sequence<size_t, N>;
^
/usr/local/include/absl/utility/utility.h:142:1: error: expected unqualified-id before ‘using’
using index_sequence_for = make_index_sequence<sizeof...(Ts)>;
^
In file included from /usr/local/include/absl/utility/utility.h:48:0,
from /usr/local/include/absl/types/optional.h:39,
from /localssd/balint/catkin_ws3/src/cartographer/cartographer/mapping/trajectory_node.h:24,
from /localssd/balint/catkin_ws3/src/cartographer/cartographer/mapping/2d/map_limits.h:28,
from /localssd/balint/catkin_ws3/src/cartographer/cartographer/mapping/2d/grid_2d.h:22,
from /localssd/balint/catkin_ws3/src/cartographer/cartographer/mapping/2d/submap_2d.h:25,
from /localssd/balint/catkin_ws3/src/cartographer/cartographer/mapping/internal/2d/local_trajectory_builder_2d.h:24,
from /localssd/balint/catkin_ws3/src/cartographer/cartographer/metrics/register.cc:19:
/usr/local/include/absl/utility/utility.h:160:1: error: ‘constexpr’ does not name a type
ABSL_INTERNAL_INLINE_CONSTEXPR(in_place_t, in_place, {});
^
/usr/local/include/absl/utility/utility.h:160:1: note: C++11 ‘constexpr’ only available with -std=c++11 or -std=gnu++11
/usr/local/include/absl/utility/utility.h:160:1: error: ‘constexpr’ does not name a type
ABSL_INTERNAL_INLINE_CONSTEXPR(in_place_t, in_place, {});
^
/usr/local/include/absl/utility/utility.h:160:1: note: C++11 ‘constexpr’ only available with -std=c++11 or -std=gnu++11
/usr/local/include/absl/utility/utility.h:160:1: error: ‘constexpr’ does not name a type
ABSL_INTERNAL_INLINE_CONSTEXPR(in_place_t, in_place, {});
^
/usr/local/include/absl/utility/utility.h:160:1: note: C++11 ‘constexpr’ only available with -std=c++11 or -std=gnu++11
/usr/local/include/absl/utility/utility.h:160:1: error: expected constructor, destructor, or type conversion before ‘(’ token
ABSL_INTERNAL_INLINE_CONSTEXPR(in_place_t, in_place, {});
^
In file included from /usr/local/include/absl/types/optional.h:39:0,
from /localssd/balint/catkin_ws3/src/cartographer/cartographer/mapping/trajectory_node.h:24,
from /localssd/balint/catkin_ws3/src/cartographer/cartographer/mapping/2d/map_limits.h:28,
from /localssd/balint/catkin_ws3/src/cartographer/cartographer/mapping/2d/grid_2d.h:22,
from /localssd/balint/catkin_ws3/src/cartographer/cartographer/mapping/2d/submap_2d.h:25,
from /localssd/balint/catkin_ws3/src/cartographer/cartographer/mapping/internal/2d/local_trajectory_builder_2d.h:24,
from /localssd/balint/catkin_ws3/src/cartographer/cartographer/metrics/register.cc:19:
/usr/local/include/absl/utility/utility.h:197:1: error: ‘constexpr’ does not name a type
constexpr absl::remove_reference_t&& move(T&& t) noexcept {
^
/usr/local/include/absl/utility/utility.h:197:1: note: C++11 ‘constexpr’ only available with -std=c++11 or -std=gnu++11
/usr/local/include/absl/utility/utility.h:206:1: error: ‘constexpr’ does not name a type
constexpr T&& forward(
^
/usr/local/include/absl/utility/utility.h:206:1: note: C++11 ‘constexpr’ only available with -std=c++11 or -std=gnu++11
/usr/local/include/absl/utility/utility.h:214:26: error: expected ‘,’ or ‘...’ before ‘&&’ token
auto apply_helper(Functor&& functor, Tuple&& t, index_sequence<Indexes...>)
^
/usr/local/include/absl/utility/utility.h:215:8: error: expected type-specifier before ‘decltype’
-> decltype(absl::base_internal::Invoke(
^
/usr/local/include/absl/utility/utility.h:215:8: error: expected initializer before ‘decltype’
/usr/local/include/absl/utility/utility.h:265:19: error: expected ‘,’ or ‘...’ before ‘&&’ token
auto apply(Functor&& functor, Tuple&& t)
^
/usr/local/include/absl/utility/utility.h:266:8: error: expected type-specifier before ‘decltype’
-> decltype(utility_internal::apply_helper(
^
/usr/local/include/absl/utility/utility.h:266:8: error: expected initializer before ‘decltype’
/usr/local/include/absl/utility/utility.h:269:67: error: expected unqualified-id before ‘)’ token
typename std::remove_reference::type>::value>{})) {
^
In file included from ./cartographer/mapping/proto/trajectory_node_data.pb.h:32:0,
from /localssd/balint/catkin_ws3/src/cartographer/cartographer/mapping/trajectory_node.h:26,
from /localssd/balint/catkin_ws3/src/cartographer/cartographer/mapping/2d/map_limits.h:28,
from /localssd/balint/catkin_ws3/src/cartographer/cartographer/mapping/2d/grid_2d.h:22,
from /localssd/balint/catkin_ws3/src/cartographer/cartographer/mapping/2d/submap_2d.h:25,
from /localssd/balint/catkin_ws3/src/cartographer/cartographer/mapping/internal/2d/local_trajectory_builder_2d.h:24,
from /localssd/balint/catkin_ws3/src/cartographer/cartographer/metrics/register.cc:19:
./cartographer/sensor/proto/sensor.pb.h:1286:30: error: expected ‘}’ before end of line
./cartographer/sensor/proto/sensor.pb.h:1286:30: error: expected declaration before end of line
ninja: build stopped: subcommand failed.
<== Failed to process package 'cartographer':
Command '['ninja', '-j4', '-l4']' returned non-zero exit status 1
Reproduce this error by running:
==> cd /localssd/balint/catkin_ws3/build_isolated/cartographer && ninja -j4 -l4
Command failed, exiting.

Hi @vargabalint92 ,
which compiler, ubuntu and ros are you using? Supported is Ubuntu 20.04 (Focal) and ROS noetic
My output of CMake.
-- The C compiler identification is GNU 9.3.0
-- The CXX compiler identification is GNU 9.3.0
-- Check for working C compiler: gcc
-- Check for working C compiler: gcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: g++
-- Check for working CXX compiler: g++ -- works

If CMake finds other compilers, you can change them by using the CC and CXX environment variable:
e.g.:
export CC="gcc" CXX="g++"
Hope that helps you to identify and solve the issue.


Preferred converters

I'm not sure it is such a good idea with the concept of "preferred converters", and that the script always tries all converters, and only allows changing the order. Mostly, because it is not intuitive. I guess it may come as a surprise that after calling setPreferredConverters(array('ewww')), all converters will still be tried - that it just moves 'ewww' up to the front.
On the other hand, this may be exactly what you want. If for example you decided for yourself that 'cwebp' is the best converter, you can call setPreferredConverters without having to supply the complete list of converters. And when new converters are added to webp-convert, you will not miss out on them.
On the other other hand, there may be cases where you want to limit the converters tried. For example in order to test if a converter works. This may for example be useful, if you have an admin interface, where you allow users some insight and configuration options.
Another thing about the option is that it is currently set with a static call. The other static properties are being removed with the next PR. So this one stands alone.
Yet another thing is that the default order ought to be set to something wise. Right now the default order is not decided consciously.
I have two proposals. We should select between them (or come up with another solution)
Proposal A

We keep the setPreferredConverters method as is (but perhaps rename it, if we can find a better name)
In addition, we add an $converters as an extra optional option in convert. If supplied, only those converters listed here, will be tried out. Otherwise, all converters will be tried - in the order determined by defaults, and calls to setPreferredConverters.

Proposal B

We remove setPreferredConverters method
We add an $converters as an extra optional option in convert. If supplied, only those converters listed here, will be tried out. Otherwise all converters will be tried, in default order.

What do you think, @S1SYPHOS ?

The question boils down to whether we want to keep the option for reordering converters with setPreferredConverters. I guess the option has its merits. But it also introduces some complexity, which I guess is rarely needed.

a better name would perhaps be reorderConverters

I'd go for something like setConverters or defineConverters with two parameters: first param being an array (like right now), second (optional) param being whether the passed converters should be used exclusively or not (default being what we currently have).

So you prioritize reordering.
There are also a couple of good things about it. For example, that it really doesn't hurt to have backup converters waiting, should your preferred converter fail. And sometimes users may be surprised that a converter fails. For example, one may not have considered that gd per default fails for PNG's.
So yes, we should not encourage that users remove converters.

A related note:
I guess we should supply a public method for getting available converters - to facilitate things like an admin interface.
With such method in place, users would be able to do reordering on their own. But no, it would not be practical, and it would not encourage users to keep all converters on the list.
From the discussion so far, we can rule out proposal B.

True, but I'd suggest taking this on after the v1.0.0 release, what do you say? While I'm at it: I added a basic .travis.yml, but, same as with Packagist, you have activate it.

I really believe we should get this settled before the version release, as it is API changing. We should minimize releases that are API changing.

I'm on it, hold on ..

    public static $preferredConverters = [];
    public static $excludeDefaultBinaries = false;

    // ...

    public static function setConverters($array, $exclude = false)
    {
        self::$preferredConverters = $array;

        if ($exclude) {
            self::$excludeDefaultBinaries = true;
        }
    }

    // ...

    public static function getConverters()
    {
        // Prepare building up an array of converters
        $converters = [];

        // Saves all available converters inside the `Converters` directory to an array
        $availableConverters = array_map(function ($filePath) {
            $fileName = basename($filePath, '.php');
            return strtolower($fileName);
        }, glob(__DIR__ . '/Converters/*.php'));

        // Checks if preferred converters match available converters and adds all matches to $converters array
        foreach (self::$preferredConverters as $preferredConverter) {
            if (in_array($preferredConverter, $availableConverters)) {
                $converters[] = $preferredConverter;
            }
        }

        if (self::$excludeDefaultBinaries) {
            return $converters;
        }

        // Fills $converters array with the remaining available converters, keeping the updated order of execution
        foreach ($availableConverters as $availableConverter) {
            if (in_array($availableConverter, $converters)) {
                continue;
            }
            $converters[] = $availableConverter;
        }

        return $converters;
    }

The name setConverters is perhaps not the best choice, when default is to reorder, rather than set.

The latest commit 1db125e will close this issue once it gets merged.
// Update: True, but it corresponds well with getConverters() and in some way it 'sets' the converters, just not exclusively, but in another order

I guess the only use case for wanting to set exclusively is when you want to test a single converter.

Do you prefer a static method rather than an extra argument?
I think I prefer an extra argument. But if we also need an "exclusive" argument, I don't

True. But it is that name of the function

The confusion comes when you return to the code, and see that setConverters is called.
I myself got confused, when I returned to this code.
I wanted to test just one converter, and changed the array to array('ewww').

In my opinion people don't need a warning since the feature they should be warned about is disabled by default, so turning it on is for people knowing what they do.
Well, I get now why this would be confusing at first .. but I guess that's because you have detailed knowledge about this library :sunny:

You got a point there.
Actually, we should probably remove setPreferredConverters (or what it will be) from the example.
I guess we can also agree that the decision is not that important.
Still, we must decide on one thing or another.

New static method VS new parameter to the convert call *
We can probably agree that general setting, that you only want to set once should be set with a static method. For example, we want converter options to be set separately, rather than in the convert call (#18). It is not something that you need to change from one convert-call to the next. When it comes to selection of converters, it is not always so. In most cases, you want to set it just once. But in rare cases, you need it to be different from call to call. So you could argue both ways. So I do not feel strongly about whether it will be the one or the other. I seems that you prefer not to have it part of the convert call? If yes, then ok, then

... And I prefer two.
Mainly, in order to avoid confusion when returning to code. Usually, when you set something, you think about it in an explicit fashion. I do, at least.
But I also think that what the two things does are different enough to call for two methods. Changing the order of something is quite different from defining something explicitly.
It is not that I don't see some sense in having just one method. The actions are after all not that different. And having an extra boolean option will bring attention to the fact that there is another option.

So, lets vote ;)

Alright, but what about someone declaring them being exclusive but not defining a custom set / order of converters? We'd have to test for that, and it seems inconvenient - you only need to think about converters being exclusive when they were set at all!

.. which is possibly the strongest point: they are intrinsically connected!

I'm not sure I follow.
I was thinking of a functionality that could be achieved like this:

You rename your setConverters to _setConverters or something, and make it private
You define a couple of new functions:

public static function setConvertersExplicitly($convertersArray) {
 self::_setConverters($convertersArray, true)
}

public static function setConvertersOrder($convertersArray) {
 self::_setConverters($convertersArray, false)
}

As it is basically the same code, but split into two methods, we surely do not require further tests?

Private methods cannot be tested afaik. Also, I think this would make the code harder to understand ..

Also, prefixing functions with underscores smells like JavaScript :cat:

heh :)

Whoops. I realize I got to go fetch the kids now.

Well, trust me, the current way is practical and easy to understand for people that are new to this library. For everyone already using it, nothing changes - except the name. Also, it’s very DRY.

Perhaps we just need slightly different names.
Or perhaps a method for pinpointing a single converter to be used

We want to underexose the option to set explicitly as much as possible

But still have available the option to use just a single converter

I'm with @S1SYPHOS on this. The current way on branch patch-1 is convincingly simple and achieves the goal easily. People get what they expect, and working with it is a breeze (which is why I already included this branch in my setup)!

I argued that there is no need to set converters explicitly. There is just a need to be able to use a single converter.
The solution is straight forward:
We refactor convert, so it delegates the job of calling a single converter to a new public method.
It will keep things DRY, as well as provide a way to ask for a conversion using just a single converter
And we will not need the "explicly" option, which makes the act of understanding the library more complicated.

Maybe another point in favor of the current solution is this: it‘s flexible, meaning that since I don‘t know what people are doing with this, they should be the ones making the decisions - like for whatever reason have only two specific converters try to convert an image.. my solution makes this dead simple :dancer:

I seriously don't want to spam you, but here's another thought - the logic we should follow is 'one function = one purpose' (kind of the OOP philosophy, too). Splitting convert() we get

one function doing 'take one script from Binaries + convert image with it'
one function doing 'take multiple scripts from Binaries + convert image with it'

.. in a way, that's duplicate code (which is not dry). There's already a function taking care of 'take script, convert image with it'. Simply put, this is about modularity and loose coupling.
Therefore, creating different functions whose only purpose it is to call another function, except one time passing true, and the other time passing false, isn't dry either.

I seriously don't want to spam you too :)
I'm very happy with the work you have done, and would hate to spoil a good teamwork by getting nitty-gritty about small stuff.
You wrote while I was writing. Here is my response to your second-latest reply:
True that it is more flexible. But there is no need for limiting to a set, which makes it bloat, and also makes usage less simple. If one limits it to a set, it is probably because one has not grasped that it is a bad idea to do so. Limiting to one has its use: Namely to test whether a specific converter works.
I'm considering what you write in your latest reply. I'm not yet sure if I agree or disagree

‚One cannot simply spoil good teamwork‘ - discussing changes is butter on my bread :sunny:

I doubt that my proposal breaks the DRY principle.
From Wikipedia:
"When the DRY principle is applied successfully, a modification of any single element of a system does not require a change in other logically unrelated elements [...] Besides using methods and subroutines in their code, Thomas and Hunt [...]"
From some other unreliable source:
"When you need to write new code which has similar (or the exact same) functionality to previous code already in the project you should take the logic (the previous code) and make it a generic callable sub routine, which can be used for multiple purposes.
This generic sub routine can cover all the use-cases via parameter values passed to it."
[http://mindfsck.net/dont-repeat-yourself/]
It seems that doing what I propose is exactly in the spirit of DRY.
But I do make sense in what you write. The one function = one purpose thing. Sounds like the single responsibility principle. Each class should have only one responsibility.
Perhaps, I should have created the library in such a way, that the single converters could be used directly.... Well, now that I think of it, I actually did. Well, then I guess my need is fulfilled that way. Only I'd like the test that the destination file actually exists also to be done by the single converter. So I can rely on it. And actually that is where it belongs - the responsibility to convert and tell if it went okay must lie within the single converter (the responsibility of WebPConvert, I guess, is to provide a way of calling the converters in succession). We could put the "does destination file exist"-test in a super-class that the converters inherit. Perhaps in 1.1.0.

Actually that would also mean that createWritableFolder, isAllowedExtension and isValidTarget should belong to a new base class for the single converters.

I thought about that, too: Having a base Converter class which holds the basic tasks (which as of now are part of WebPConvert).
After all, this library should loop over all converters, maximizing chances of successful conversion. Users may choose order and specific subset of converters, but generally this should not be necessary.
New proposal: keeping implementation of setConverters, but outsourcing basic tasks to Converter base class.

ahh. Perhaps I was too quick, when I said that my needs are fulfilled. I can instantiate the single converters directly. But I'd like to do it in a generic fashion. I'd like to ask WebPConfig for the available converters, and then be able to run that converter (based on its name id, ie 'ewww'). And I cannot do that (easily) by creating instances of the single converters directly. It would be a drag.
So perhaps I'd like a convertWithSingleConverter(converterId) method after all. And it doesn't go against the purpose of WebPConvert, if stated as "to provide a generic interface for handling the converters"

.. but why repeat common tasks for every converter?

Oh, I thought that we were on level here. Do you propose to add let WebPConvert inherit a base class? Well, no need, is there? - there would be no other classes than WebPConvert that would be going to inherit it.
The reason for having the base class on the single converters is a separation of concerns. The consern of a converter is to convert a file and report if it is able to do that or not. But right now, part of that concern is maintained by WebPConvert, which for instance checks if target file exists. But this is none of its business. WebPConvert business is to provide uniformed access to converters and to make themwork in tandem.
As I propose to hand these common tasks over to a base class, they are not be repeated in a bad way.

I want to be able to do the things I could do with the library before the rewrite. I want for example to show in plain text the flow of the conversion.  It will not take anything away from the ease of use of the library that it allows more than its primary function.
The proposed base class was refactoring for the sake of separation of concerns. It does not even have to change the API. I remember that I thought about doing it, when I created the library. But I didn't remember why I did not do it. But I think I know now. If for example the target file doesn't exist, then it makes sense exit early with that message. There is no need to loop through all converters - they will predictively fail. So while separation of concerns would dictate that the converters took the complete concern of converting and detecting errors, it is not practical in this case.
I think it is time to move on.
For 1.0.0, we can use your solution with setConverters($array, $exclude = false). But I will rename it. Probably I will go for setPreferredConverters or setConverterOrder. The primary use is to set order. This also allows for depreciating the exclude option later, if a better solution is discovered.
I will do the renaming after merging your patch, along with other modifications.
I see that you made a lot of methods public. Perhaps in order to make unit tests? But such concerns should not impact decisions about the API. Methods such as isValidTarget, isAllowedExtension and createWritableFolder clutters the public API. I also think we should make getConverters private to begin with. We can make it public later without breaking anything. But we cannot do the opposite. And having it public requires us to maintain the functionality, which limits our possibilities to change the inner workings.

It is btw possible to unit test private methods with the reflection api. See here:
[https://jtreminio.com/2013/03/unit-testing-tutorial-part-3-testing-protected-private-methods-coverage-reports-and-crap/] (in the section "Targeting private/protected methods directly").
But I think it is enough to unit test the public methods for starters.


Possible datarace at cacheShard.get

Is there any possibility of datarace call RUnlock before return by calling readEntry at the end of the function? How about call s.lock.RUnlock() by defer s.lock.RUnlock() to ensure lock is held until data copying is done?
func (s *cacheShard) get(key string, hashedKey uint64) ([]byte, error) {
	s.lock.RLock()
	itemIndex := s.hashmap[hashedKey]

	if itemIndex == 0 {
		s.lock.RUnlock()
		s.miss()
		return nil, ErrEntryNotFound
	}

	wrappedEntry, err := s.entries.Get(int(itemIndex))
	if err != nil {
		s.lock.RUnlock()
		s.miss()
		return nil, err
	}
	if entryKey := readKeyFromEntry(wrappedEntry); key != entryKey {
		if s.isVerbose {
			s.logger.Printf("Collision detected. Both %q and %q have the same hash %x", key, entryKey, hashedKey)
		}
		s.lock.RUnlock()
		s.collision()
		return nil, ErrEntryNotFound
	}
	s.lock.RUnlock() // call this function with defer
	s.hit()
	return readEntry(wrappedEntry), nil
}

I took a look into this code since bigCache returns a not nil but empty slice which is not expected to be returned.

For reasons not to use defer, please see #37.

Thanks for the explanation =)
If so, how about getting the result from the readEntry and then unlock manually like below?
s.hit()
result := readEntry(wrappedEntry)
s.lock.RUnlock()
return result, nil

Good idea @ehnuje
Looks like this will solve an edge case.

I'm happy to take a look at any PRs you come up with @ehnuje :)

After check the latest code, it has been fixed by e24eb225f15679bbe54f91bfa7da3b00e59b9768
I’ve only checked my local code since we recently started using bigcache. Let me close this issue.


Port multiple route support controls from kaoto

Context
Currently, there's no visual mechanism to handle which route is presented in the canvas
Goal
The goal of this issue is to port the multiple route controls from kaoto into kaoto-next. This could be done by leveraging contextToolbar property of @patternfly/react-topology
Prerequisites

https://github.com/KaotoIO/kaoto-next/issues/136
https://github.com/KaotoIO/kaoto-next/issues/137

Demo

Todo list

[ ] Port the multiple route support components to kaoto-next
[ ] Wire up the new route toggle with the currentDsl property (Remember to warn the user that the source code will be removed)
[ ] Wire up the new route button, depending on the currentDsl property to add new entities (Some DSL might support multiple routes while others don't)

Note: IT might be needed to update the toVizNode() method to return an Array<VisualNodes> to support Integration type

Due to upcoming possible change in BaseVisualEntities and BaseEntities we agreed that in first shot we will bring

SourceType (Dsl) selector control
New route button disabled/enabled according the selected SourceType(DSL).

Implemented


warpsql: Add Citus Extension

Update Dockerfile's
Install Citus dependencies (curl, jq)
Add build dependencies for Citus (gcc, libc-dev, make, curl-dev, lz4-dev, libxslt-dev, libxml2-dev)
Download and install Citus with specified version
Remove build dependencies and cleanup temporary files after Citus installation
Add Citus extension smoke tests to GitHub Actions workflow
Update Bitnami entrypoint script to preload Citus extension
Test Citus extension and distributed table creation in smoke tests
Ensure logs are displayed for debugging purposes

Hi @ChakshuGautam, I have added the smoke tests and tested the smoke tests workflow in my forked repo. Could you approve the workflow here as well.

Hey @jayanth-kumar-morem shared feedback on the PR.

Hi @ChakshuGautam , couldn't find any comments on the PR :astonished: ?

Ahh, my bad. Can you check now?


reconciliation review page

https://docs.google.com/presentation/d/1rzcLkYCEHoN1jUqX-M1O9VJfYq2Gnw--/edit#slide=id.p7
\datasets\templates\datasets\review.html
http://localhost:8001/datasets/9/review/439d2a94-1af6-4adc-8527-fcaf450702cc/pass1 ???
views: def review(request, pk, tid, passnum)

The view review() takes an auth parameter, which is either wdlocal (wikidata) or one of whg or idx (the whg index). It generates and returns a django formset for each hit, but the structure of a hit varies between the two cases, reflected in the raw_hits delivered to each page in the context object. Then the templates review.html and accession.html do the work of parsing raw_hits.
For the maps, which it the only concern, the geometry found in each record’s formset is “sent” to javascript with this:
                <!-- push geometries to js -->
                {% if form.json.value|get:"geoms"|length > 0 %}
                  {% for g in form.json.value|get:"geoms" %}
                    {{ g|safe|json_script:g.id }}
                  {% endfor %}
                {% endif %}

Those get turned into geojson for the map by the map_init() function. If a feature’s ds is the current dataset, it gets a green marker, otherwise orange.

TO DO

[ ] What geom is being displayed? Incoming green missing.


aws sdk in nitro enclave

Hi, thanks for great sample
as for now the enclave python program use "kmstool_enclave_cli" to do the kms decrypt job, it is quit limited and complicated to run.
is it possible to use aws kms python sdk directly(or java sdk)  in the enclave enviroment?

Hi @redaready ,
yes it is possible to use any AWS SDK from inside the enclave. To do so a internal proxy needs to be started: https://nitro-enclaves.workshop.aws/en/my-first-enclave/secure-local-channel.html
These SDKs do not support cryptographic attestation per default. kmstool_enclave_cli is based on the Nitro SDK (https://github.com/aws/aws-nitro-enclaves-sdk-c) and thus can make use of the cryptographic attestation.
@redaready does that answer your question?

thanks david,  that's all what i need


Component Times Used Position

sort out right side navBar
push eye and lock icons on components down to bottom

Fixed through pull request #56


Misc fixes

No withBlockProperties in detached mode

@sneridagh It seems that these changes are already in develop branch due to https://github.com/eea/volto-slate/pull/96


[Benchmark] Remove Java benchmarking or pull code from arrow-java to fix failing builds

Describe the bug, including details regarding any error messages, version, and platform.
Java benchmarks are failing because java/ was moved to arrow-java:
https://buildkite.com/apache-arrow/arrow-bci-benchmark-on-amd64-m5-4xlarge-linux/builds/562#0193ac96-8042-4083-aeab-4d47355004b6
https://buildkite.com/apache-arrow/arrow-bci-benchmark-on-amd64-c6a-4xlarge-linux/builds/564#0193ac96-729c-4009-a904-005b9401185a/6-13393
We should pull the code from arrow-java for now similar to #44980
Component(s)
Benchmarking

Where are Buildkite configuration files?

Does someone know where is ursabot running? To be honest I struggle to understand the workflow followed to exercise the benchmarks. The following documentation doesn't give me a clear picture to be honest:
https://github.com/apache/arrow/tree/main/dev/conbench_envs


question about eval_mot.py

Hello, I saw the readme you posted and proceeded with learning based on fairmot_dla34_30e_1088x608.yml.
I received the data as you uploaded and have a structure like your readme's 4.3 Dataset Structure.
So, I got ./output/fairmot_dla34_30e_1088x608/model_final through learning, and when I run infer_mot.py using it, I get very good results. I am very grateful for that.
But
python tools/eval_mot.py
-c ./configs/snmot/fairmot/fairmot_dla34_30e_1088x608.yml
-o weights=./output/fairmot_dla34_30e_1088x608/model_final
Running this command gives bad results.

But strangely, the result is like this
If you pass the --save_images option to this command as shown below,
python tools/eval_mot.py
-c ./configs/snmot/fairmot/fairmot_dla34_30e_1088x608.yml
-o weights=./output/fairmot_dla34_30e_1088x608/model_final --save_images
The results come out very well. So, it seems to me that there is a little difference between the gt of the test data and the results I output. Can you explain this?

The first one is the gt of snmot_116.txt
1,136,520,51,135,1,-1
1,478,565,51,140,1,-1
1,565,518,48,124,1,-1
1,468,433,46,113,1,-1
1,557,302,34,84,1,-1
1,935,548,59,140,1,-1
1,981,541,69,137,1,-1
1,1061,488,40,122,1,-1
1,1096,487,64,122,1,-1
1,1288,457,53,113,1,-1
1,1387,432,32,110,1,-1
1,1419,425,37,105,1,-1
1,1433,452,65,107,1,-1
1,1461,446,33,125,1,-1
1,1457,446,27,109,1,-1
1,1479,449,29,119,1,-1
1,1498,444,23,122,1,-1
1,1511,443,42,123,1,-1
1,1527,444,44,114,1,-1
1,474,381,12,11,1,-1
2,138,521,50,134,1,-1
2,478,565,52,140,1,-1
The second is the result of eval_mot.py for snmot_116.txt.
1,1,979.3623657226562,537.5514526367188,67.99530029296875,142.71917724609375,0.8652112483978271,-1,-1,-1
1,2,1059.39111328125,487.4664306640625,50.0430908203125,125.7547607421875,0.8487852215766907,-1,-1,-1
1,3,561.3187866210938,517.5396118164062,50.31048583984375,125.93096923828125,0.8338124752044678,-1,-1,-1
1,4,469.16290283203125,562.5975952148438,63.3663330078125,146.7279052734375,0.8325880765914917,-1,-1,-1
1,5,1385.3065185546875,435.7818908691406,37.7908935546875,104.35342407226562,0.8277827501296997,-1,-1,-1
1,6,930.896728515625,545.0053100585938,67.34722900390625,141.5628662109375,0.8227060437202454,-1,-1,-1
1,7,1095.5455322265625,486.6717224121094,62.39013671875,123.30844116210938,0.8168835043907166,-1,-1,-1
1,8,137.36280822753906,521.64794921875,57.26155090332031,132.1103515625,0.7864314317703247,-1,-1,-1
1,9,1289.9215087890625,458.0888671875,54.00048828125,109.88653564453125,0.7662001848220825,-1,-1,-1
1,10,1435.694091796875,460.97503662109375,35.9664306640625,95.9007568359375,0.7223823070526123,-1,-1,-1
1,11,1524.3800048828125,447.9779968261719,43.870849609375,108.17288208007812,0.7123496532440186,-1,-1,-1
1,13,1508.180419921875,453.407470703125,47.8900146484375,109.7581787109375,0.6771827340126038,-1,-1,-1
1,14,555.231201171875,304.4537658691406,35.3944091796875,78.3070068359375,0.6704235672950745,-1,-1,-1
1,15,1454.0382080078125,449.23687744140625,44.5313720703125,118.51806640625,0.6550086736679077,-1,-1,-1
1,16,467.6395263671875,434.97662353515625,50.28375244140625,111.728271484375,0.647138237953186,-1,-1,-1
1,17,1490.5936279296875,451.5460510253906,40.251220703125,110.70571899414062,0.627478301525116,-1,-1,-1
1,18,1477.7757568359375,453.5410461425781,36.9327392578125,111.53018188476562,0.5647479295730591,-1,-1,-1

got same problem. And one more problem, when add "save_images" option in the command, i got assertion error

Did you solve this?

1,5,1385.3065185546875,435.7818908691406,37.7908935546875,104.35342407226562,0.8277827501296997
got same problem. And one more problem, when add "save_images" option in the command, i got assertion error

Did you solve this?


Remove scrolling in FOAM Example

Allow display of entire code/example w/o scrolling
Increase display size
Changed to:

From:

The following code has no effect on display.  Either display is wrong or this code is irrelevant.
      // Format table cells that contain children: List first names.
      tableFormatter: function(children) {
        if ( ! children ) return '';
        return children.map(function(c) { return c.firstName; }).join(', ');
      }

@bartonhammond

Person Model was displayed twice

What do you mean?  There are two people: Jaden and Willow, which is why there are two Persons shown.  Is that what you mean?

The definition/declaration was twice - I removed the unnecessary duplicate:
        <code-snippet ref="Person" title="Person Model" />

@bartonhammond

The following code has no effect on display. Either display is wrong or this code is irrelevant.

The data in the third-column appears as:
Jaden, Willow
Which is the result of this tableFormatter.
It affects the output in example 1.3.11, but it doesn't have any change in 1.3.10, which isn't a table.  Is that what you mean?

I see. Thx
On 31 March 2016 at 16:49, Barton Hammond<EMAIL_ADDRESS>wrote:

The definition/declaration was twice - I removed the unnecessary duplicate:
    <code-snippet ref="Person" title="Person Model" />

—
You are receiving this because you commented.
Reply to this email directly or view it on GitHub
https://github.com/foam-framework/foam/pull/551#issuecomment-204121753

... it doesn't have any change in 1.3.10, which isn't a table. Is that what you mean?

Yes

It's the same Model referenced from both examples (and another one as well), which is why the tableFormatter appears.  I've added a comment to explain this.

All suggestions have been addressed, one way or another.  Thank you very much.