Gatekeeper Work (#265)

constraints: wip

constraints: wip

gatekeeper constraint template loading, rendering, and saving seems to be working

gatekeeper constraint template loading, rendering, and saving seems to be working

gatekeeper installation info endpoint; remove similar one from cluster controller

wip

gatekeeper module

deprecating old gatekeeper dtos

deprecated old gatekeeper dtos

cleanup in keeping with other pr

cleanup in keeping with other pr

gatekeeper frontend uses most utd backend

mark remaining gatekeeper methods in the cluster service as deprecated & move cluster functions out of the gatekeeper section

making interfaces & dtos more consistent

making interfaces & dtos more consistent

making interfaces & dtos more consistent

gatekeeper open-api-schema created

gatekeeper constraint template open-api-schema created

gatekeeper constraint & constraint template schemas built and in use

gatekeeper constraint template blueprint schema built and in use

GATEKEEPER_CONSTRAINT_TEMPLATE_DEPLOY_FAILED_SCHEMA added

deprecate things; move to use updated where possible

editing the constraint template from the details page saves

more cleaning up

more cleaning up

mark the rest of the deprecated things as such

cluster ID check interceptor

patching constraint template endpont added and in use

cleanup

delete constraint template endpont added and in use

add and implement ability to retrieve all gatekeeper violations in the cluster

little bug

working on add/edit constraint

working on add/edit constraint

create constraint endpoint moved over to the new gatekeeper implementation

old create constraint endpoint removed

revert cluster-event service for simplicity

revert cluster-event service for simplicity

http-exception.filter.ts: add type checking around exception.getResponse

TODO:

Backend:

move remaining routes to Gatekeeper module
"add constraint" endpoint: add template validation

Frontend GatekeeperService:

implement remaining routes
use new service
delete old service
delete old interfaces

Frontend:

add-template-constraint.component.ts disregards non-form values from editing the raw manifest, effectively making the raw manifest editor useless


Issue comp 328

this fixes alpheios-project/components#328
The problem was that if a page doesn't explicitly sent the charset, Safari chooses a default encoding which is not utf-8 and that messes up the encoding of the words in the ajax requests to the various services. To be safe, we should always be escaping words passed in to the services anyway.

Pull Request Test Coverage Report for Build 238

4 of 4 (100.0%)  changed or added relevant lines in 4 files are covered.
No unchanged relevant lines lost coverage.
Overall coverage remained the same at 86.495%

Totals

Change from base Build 225:
0.0%

Covered Lines:
734

Relevant Lines:
819

💛  - Coveralls


Feature request

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
Describe the solution you'd like
A clear and concise description of what you want to happen.
Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.
Additional context
Add any other context or screenshots about the feature request here.

Hey @amir4zh
We don't see any feature request details in this report. Can you please share the description of the issue you are seeing?


Bootstrap image verification failed due to missing key

I wanted to further look into #132 when I noticed that the bootstrap image can't be verified:
$ archlinux-repro -f /var/cache/pacman/pkg/ueberzug-18.3.1-3-x86_64.pkg.tar.zst
repro 20240527
pub   rsa2048 2011-04-10 [SC]
      4AA4767BBC9C4B1D18AE28B77F2D434B9741E8AC
uid           [ unknown] Pierre Schmitz<EMAIL_ADDRESS>sub   rsa2048 2011-04-10 [E]

==> Downloading bootstrap image...
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  131M  100  131M    0     0  2009k      0  0:01:06  0:01:06 --:--:-- 2204k
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   141  100   141    0     0   7047      0 --:--:-- --:--:-- --:--:--  7421
gpg: Signature made Sun 01 Dec 2024 06:50:47 AM CET
gpg:                using EDDSA key 3E80CA1A8B89F69CBA57D98A76A5EF9054449A5C
gpg:                issuer<EMAIL_ADDRESS>gpg: Can't check signature: No public key
==> ERROR: Can't verify image

This is here in the code:
https://github.com/archlinux/archlinux-repro/blob/6e8cee92270c127a67ef27414116b6c45deffc76/repro.in#L80
Maybe a command more similar to the one on the download page is needed:
gpg --auto-key-locate clear,wkd -v --locate-external-key<EMAIL_ADDRESS>

I think this is because there are 2 different keys for this uid:
% gpg -k 3E80CA1A8B89F69CBA57D98A76A5EF9054449A5C
pub   ed25519 2022-10-31 [SC] [expires: 2037-10-27]
      3E80CA1A8B89F69CBA57D98A76A5EF9054449A5C
uid           [ unknown] Pierre Schmitz<EMAIL_ADDRESS>uid           [ unknown] Pierre Schmitz<EMAIL_ADDRESS>sub   ed25519 2022-10-31 [A] [expires: 2037-10-27]
sub   cv25519 2022-10-31 [E] [expires: 2037-10-27]

% gpg -k 4AA4767BBC9C4B1D18AE28B77F2D434B9741E8AC
pub   rsa2048 2011-04-10 [SC]
      4AA4767BBC9C4B1D18AE28B77F2D434B9741E8AC
uid           [ unknown] Pierre Schmitz<EMAIL_ADDRESS>uid           [ unknown] Pierre Schmitz<EMAIL_ADDRESS>sub   rsa2048 2011-04-10 [E]

The 2022 key is used to sign the iso and the 2011 key is fetched in init_gnupg from wkd.
Note there are no security controls in the command we're using to fetch the key, we might as well use curl | gnupg --import from a well-known url, or we could inline the relevant parts of the key into the script.
Especially the keyserver approach is very prone to vandalism since anybody can submit keys for that uid.


Feature: cond function

I don't want hardtime in the way when recording macros, at all. The macro
pressure is enough, you know :)
My solution is at follows: introduce a cond configuration function. It could
be used as follows.
require('hardtime').setup {
    cond = function(_key)
        return #vim.fn.reg_recording() == 0
    end,
}

I already consider the condition of executing macro. You can just open a pr to add the condition of recording. I think it is much simpler.

Alright, but I wanted to consider any other reasons to specify a condition. What if you wanted to disable it for any other non builtin reason? Then cond could be used.

I understand your concern, but now I don't think of any other reasons to disable it.

Alright, PR'ing somewhere tonight, then 😅


Restructure and clarify extras_require

Currently the optional dependencies are a bit of a mess:

full should be what's needed for the full functionality of the package, but is actually not documented and just used for the CI tests
dev contains m2r2 which was made obsolete by switching to myst-parser in #36
dev should contain everything needed for development (i.e. the full functionality, test and doc requirements), but doesn't

This fixes all of that and documents the different categories :)

This is awesome! Very nice organization! Thanks @hofaflo!


Unclear how to spawn city from correctly exported RPK

Hi,
I can import RPK file, but it's not procedurally generating the city.
RPK exported with CGA from CityEngine 2019.
I'm on the Paris Base project.
Can be some clarifications about the procedure?

Hi!
Can you try the steps described here https://github.com/Esri/vitruvio/blob/master/doc/usage.md#advanced and let me know if that works for you?

I'll assume the problem is solved. Otherwise please report your issue on GeoNet  again.


externalize AWS AMI setup as part of workshop.yaml config

added AWS ami TF variables and added ami config in AWS example file

LGTM


cryptpad.fr solution

https://cryptpad.fr/

https://github.com/xwiki-labs/cryptpad/wiki/Installation-guide

[ ] flist

[ ] admin solution

[ ] marketplace solution

We deployed it in http://<IP_ADDRESS>:3000
but we have problem that's direct us to new approach :

CryptPad stores each document in an individual file on your hard drive in container that run server.
if container gone everything is gone too .
so we need to make backup approach to backup your data in other server to can get it again if container gone or that's problem of user if container gone because he didn't extend his pool.

Flist: https://hub.grid.tf/bola.3bot/3bot-cryptopad-latest.flist
TODO :

Test flist ( stellar now is down)
domain expose

Docker file : https://github.com/threefoldtech/tf-images/tree/master/cryptpad
Flist: https://github.com/threefoldtech/tf-images/tree/master/cryptpad
Chatflows Done
Solution Expose Done

TODO: https

verified


Add SGD with Armijo line search

Add support for Armijo Line Search. Different options for stepsise resetting are available, such as Goldstein Line search.  Add corresponding tests and documentation.
Rename step_size into stepsize in PolyakSGD for API consistency with ProximalGradientDescent.
Add an example in section stochastic to compare different Gradient Descent algorithms on simple classification task (under interpolation hypothesis), namely Gradient Descent, Proximal Gradient Descent, PolyakSGD and ArmijoSGD.

As suggested in discussions:

usage of increase_factor and decrease_factor for more explicit API
I removed the example that compares GD algorithms (will be pushed in an other PR)
armijo_line_search is now its own function that can be jitted, with loops that can be unrolled or not. Notice the code duplication in __post_init__() and the _run() of the base class: it might be worth it to encapsulate this logic in a separate method in the parent class. Significative gains in speed.
it is in version 0.1.1 of the changelog.

I modified examples files in deep_learning accordingly to the last commit.

Done :)


Add ga to docs pages

Confirmed that this works by running it locally.

Codecov Report

Merging #237 (1c63913) into main (85f0713) will increase coverage by 17.85%.
The diff coverage is n/a.

@@             Coverage Diff             @@
##             main     #237       +/-   ##
===========================================
+ Coverage   76.34%   94.20%   +17.85%
===========================================
  Files         184      114       -70
  Lines        4300     3004     -1296
  Branches      415        0      -415
===========================================
- Hits         3283     2830      -453
+ Misses       1014      174      -840
+ Partials        3        0        -3

Impacted Files
Coverage Δ

client/src/api/TestSuitesApi.ts

...lient/src/components/RequestDetailModal/styles.tsx

...estSuite/TestRunProgressBar/TestRunProgressBar.tsx

...lient/src/components/InputsModal/InputTextArea.tsx

client/src/components/ThemeProvider.tsx

...ent/src/components/App/__mocked_data__/mockData.ts

...src/components/RequestDetailModal/helpers/index.ts

...s/TestSuite/TestSuiteDetails/TestGroupListItem.tsx

...ient/src/components/InputsModal/InputTextField.tsx

...ite/TestSuiteDetails/TestListItem/ProblemBadge.tsx

... and 60 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.


Updates Type/Field Naming Convention

What kind of change does this PR introduce?
Updates SQL to GraphQL conversion naming conventions according to RFC
#18
What is the current behavior?
Attempts to inflect assuming a javascript client
What is the new behavior?
Does not inflect or pluralize type or field names in favor of prefixes/suffixes

Circulated this one around our org today and the general consensus is that with this change we'd likely not adopt pg_graphql, which would also prevent us from moving our db from Aurora to supabase. I do hate to be a downer about this one, and we're certainly not supabase's biggest account (not by a long stretch), but I did want to chime in with potential impact of a change to naming proposed here.


Error: invalid command name 'setup.py'

Hi,
I have a problem running my CI, it failed with the error:
errors: [
    Error: invalid command name 'setup.py'
        at verifySetupPy (/opt/hostedtoolcache/node/18.17.1/x[64](https://github.com/iftahnaf/pyvectorguidance/actions/runs/6321915420/job/17166635003#step:8:65)/lib/node_modules/semantic-release-pypi/lib/verify.js:43:15)
        at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
        at async verify (/opt/hostedtoolcache/node/18.17.1/x64/lib/node_modules/semantic-release-pypi/lib/verify.js:94:5)
        at async validator (file:///opt/hostedtoolcache/node/18.17.1/x64/lib/node_modules/semantic-release/lib/plugins/normalize.js:36:24)
        at async file:///opt/hostedtoolcache/node/18.17.1/x64/lib/node_modules/semantic-release/lib/plugins/pipeline.js:38:36
        at async Promise.all (index 0)
        at async next (file:///opt/hostedtoolcache/node/18.17.1/x64/lib/node_modules/semantic-release/node_modules/p-reduce/index.js:15:44) {
      pluginName: 'semantic-release-pypi'

my release.yml:
name: Release

on:
  push:
    branches:
      - main

jobs:
  release:
    name: Release
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v4
        with:
          fetch-depth: 0
      - name: Setup Node.js
        uses: actions/setup-node@v3
        with:
          node-version: 18
      - name: Install semantic-release
        run: npm install -g semantic-release @semantic-release/github @semantic-release/commit-analyzer @semantic-release/git @semantic-release/release-notes-generator semantic-release-pypi
      - name: Set up Python
        uses: actions/setup-python@v4
        with:
          python-version: 3.10.12
      - name: Install setuptools
        run: python -m pip install --upgrade setuptools wheel twine
      - name: Install Python dependencies
        run: |
          pip install -r requirements.txt
      - name: Release
        env:
          GH_TOKEN: ${{ secrets.SEMANTIC_RELEASE_ACCESS_TOKEN }}
          PYPI_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
        run: npx semantic-release
    permissions:
      contents: write

and the .release.json:
{
  "branches": ["main"],
  "plugins": [
      "@semantic-release/commit-analyzer",
      "@semantic-release/release-notes-generator",
      [
          "semantic-release-pypi",
          {
            "repoUrl": "https://upload.pypi.org/legacy/"
          }
      ],
      "@semantic-release/github",
      [
          "@semantic-release/git",
          {
              "message": "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}",
              "assets": ["CHANGELOG.md", "setup.py", "setup.cfg"]
          }
      ]
  ]
}

Any ideas on how to solve this issue?
Thanks in advance!

Hello again :)
The error message didn't really help me, but I checked out your repository (pyvectorguidance) and found a problem inside setup.py.
semantic-relase-pypi has some lmitations:

only supports setuptools (I should add this to the README)
The version parameter of setup must not be set

Here is a modified setup.py that should work
from setuptools import find_packages, setup

from pyvectorguidance import __version__

with open("README.md", "r") as fh:
    long_description = fh.read()

setup(
  name = 'pyvectorguidance',
  packages=find_packages(),
  license='Apache Software License',
  description = 'Vector Guidance methods implemented in Python.',
  long_description=long_description,
  long_description_content_type="text/markdown",
  author = 'Iftach Naftaly',
  author_email =<EMAIL_ADDRESS>  url = 'https://github.com/iftahnaf/pyvectorguidance',
  download_url = 'https://github.com/user/reponame/archive/v_01.tar.gz',
  keywords = ['Python', 'Vector Guidance'],
  install_requires=[
          'numpy==1.21.5',
          'rich==13.3.1',
          'scipy==1.10.0'
      ],
  classifiers=[
    'Development Status :: 3 - Alpha',
    'Intended Audience :: Developers',
    'Topic :: Software Development :: Build Tools',
    'License :: OSI Approved :: Apache Software License',
    'Programming Language :: Python :: 3.10'
  ],
)

@abichinger Thanks for the fast response, it solved this problem.


sparse_test_gpu start to fail when JAX is built w/ cuda-12.2.1

Description
A lot of individual tests in JAX's sparse_test_gpu start to fail when JAX is built w/ cuda-12.2.1.
Here are a few examples:
[ RUN      ] BCOOTest.test_bcoo_dot_general_cusparse29 (lhs_shape=(5,), rhs_shape=(5,), lhs_contracting=[0], rhs_contracting=[0], dtype=<class 'numpy.complex64'>)
 ** On entry to cusparseCreateCoo() parameter number 7 (cooValues) had an illegal value: the pointer must be aligned to 8, namely the size of CUDA_C_32F
...
[ RUN      ] SparseObjectTest.test_dense_round_trip15 (Obj=<class 'jax.experimental.sparse.csr.CSR'>, shape=(5, 5), dtype=<class 'numpy.float64'>)
** On entry to cusparseCreateDnMat() parameter number 5 (values) had an illegal value: the pointer must be aligned to 8, namely the size of CUDA_R_64F
...
[ RUN      ] cuSparseTest.test_csr_matmul_ad30 (shape=(5, 8), bshape=(8, 1), dtype=<class 'numpy.float32'>)
 ** On entry to cusparseSpMM_bufferSize(): SPMM_CSR_ALG3 is not supported when opA != OPERATION_NON_TRANSPOSE or opB == OPERATION_CONJUGATE_TRANSPOSE

There are a lot more.
What jax/jaxlib version are you using?
HEAD
Which accelerator(s) are you using?
GPU
Additional system info
Linux
NVIDIA GPU info
Failures happen on both GPU variants (sm_60 and sm_70).
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 525.125.06   Driver Version: 525.125.06   CUDA Version: 12.0     |
|-------------------------------+----------------------+----------------------+
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|                               |                      |               MIG M. |
|===============================+======================+======================|
|   0  NVIDIA TITAN V      Off  | 00000000:41:00.0 Off |                  N/A |
| 27%   43C    P0    36W / 250W |      0MiB / 12288MiB |      0%      Default |
|                               |                      |                  N/A |
+-------------------------------+----------------------+----------------------+
|   1  Quadro GP100        Off  | 00000000:42:00.0 Off |                    0 |
| 30%   44C    P0    28W / 235W |      0MiB / 16384MiB |      0%      Default |
|                               |                      |                  N/A |
+-------------------------------+----------------------+----------------------+

+-----------------------------------------------------------------------------+
| Processes:                                                                  |
|  GPU   GI   CI        PID   Type   Process name                  GPU Memory |
|        ID   ID                                                   Usage      |
|=============================================================================|
|  No running processes found                                                 |
+-----------------------------------------------------------------------------+

Hi - thanks for the report. We've seen these failures elsewhere, and unfortunately I don't think anyone is planning to look at them. cusparse has proven to be a bit of a moving target, and I think we'll probably fix this issue by just disabling testing of the GPU sparse lowerings.

Pointer alignment errors should be fixed by 34010a9e4aa5bb9529ca766794e0490700a5f400

And the unsupported algorithm/operand combo was fixed by 46ac9e2170177b4c20b1ad9947c48001d48c2daa.


[rfc][gas] Do not charge for loading Sui Framework or Move stdlib

The code for the Sui Framework and Move stdlib will live directly in the validator binary, so using these won't actually trigger an on-chain read. No need to charge users for this.
For Sui Framework developers, it's quite cumbersome to change the gas snapshot tests every time code in the Sui Framework changes (since it tweaks the loading cost). This is a pain for us today, but in the future it will also be a pain for third-party devs--a change in the size of the Sui Framework due to a framework upgrade will change the gas cost for a dependent package P even if the actual functions called by P are unchanged by the upgrade. This PR alleviates both the present and future pain.

One thing I am worried about: how do we currently charge for loading package deps? I want to make sure we also don't charge for loading these packages if (e.g.) a tx calls M::f() and M directly on indirectly depends on the Sui Framework (as it commonly will). It doesn't look like my changes will handle this case, but I can't find the code that charges for loading deps.

cc @bmwill, we were just talking about this today.  This (specifically the part about packages being part of the validator binary) is what gave me the impression that our framework code was not held in object storage, but it could be that that is referring to how they get put into storage via genesis.

I think that we are required to load framework modules from disk and cannot just have them in the binary due to:

staging a release of a new framework
starting a new node and wanting to be able to replay txns using an older version of the framework.
Having said that, we should probably always just have sui/move framework completely cached in memory so we probably could get away with not charging for using it


Fix #114: Viewer must filter out 'absent' and 'suppressed' issues by default

This implementation hews as closely as possible to the description in #114; please read that before the following:

The Suppression State column is hidden by default. It appears the first time the user opens a file containing suppression information, at which time "Suppressed" results are filtered out. If the user checks the "Suppressed" box in the filter UI, suppressed results are never again filtered out during this VS session.

The Category column, for some reason, is visible by default as soon as the user opens any log file. The first time the user opens a log file with "Absent" results, the filter is adjusted to exclude them. If the user checks the "Absent" box in the filter UI, absent results are never again filtered out during this VS session.

Also:

Replace the SarifDataTableSink class, which unnecessarily provided wrappers around all sink operations, with the SinkHolder class, which does nothing but hold a sink. The comments explain why. Mainly I did this because the existing code caused me to waste time wondering why it was necessary to wrap the sink operations, and it turned out the answer was that it wasn't necessary.

Fix a bug in a project file that prevented an xcopy operation from working.

UI test authoring is in progress.

Curious, why is the sarif-pattern-matcher submodule updated for this change?

        this.columnKeyToContent[StandardTableKeyNames2.TextInlines] = new Lazy<object>(() =>

You didn't make a change here, but there's something I don't understand about this code: if we produce inlines in a lazy fashion, how does the IDE understand whether to produce the expand/collapse chrome on the error list? are these values retrieved when messages are displayed (only) in the virtualized error list?

Refers to: src/Sarif.Viewer.VisualStudio/ErrorList/SarifResultTableEntry.cs:114 in 21bf8b0. [](commit_id = 21bf8b06fb90447171635f418d90051d403debc9, deletion_comment = False)

        this.columnKeyToContent[StandardTableKeyNames2.TextInlines] = new Lazy<object>(() =>

For each table entry (and this class does implement the ITableEntry interface), VS calls TryGetValue (implemented below) when it needs information from the entry. For instance, if it asks for the key "fulltext", and the entry has data for that key, that's how VS knows to show the expander. As you say, it presumably only asks for information about the items it needs to display.

In reply to: 740923590 [](ancestors = 740923590)

Refers to: src/Sarif.Viewer.VisualStudio/ErrorList/SarifResultTableEntry.cs:114 in 21bf8b0. [](commit_id = 21bf8b06fb90447171635f418d90051d403debc9, deletion_comment = False)

I updated the viewer's submodule pointer to use the latest sarif-pattern-matcher, and I did that only to get a version of sarif-pattern-matcher whose submodule pointer pointed to the latest sarif-sdk, and I did that because I wanted the newest Sarif\Core\Result helper methods.
And I wanted them because of the recently added Result.IsSuppressed and Result.IsAbsent methods that I wanted to use in my UI tests...
... except...
... that it turns out I misremembered, and it was actually Run that has the new extension methods, and they are HasSuppressedResults, HasAbsentResults. The Result methods that I wanted to do, don't actually exist.
But I decided there was no harm in keeping the viewer up to date anyway.

In reply to: 740892336 [](ancestors = 740892336)


Modal does not reliably steal focus

Modal can get into a state where focus is outside of the modal. This happens reliably when triggering a modal on Dropdown change:
function ModalWithButton() {
    const [isOpen, setIsOpen] = React.useState(false);
    const open = () => setIsOpen(true);
    const close = () => setIsOpen(false);
    return (
        <>
            <Dropdown variant="solid" onChange={open}>Open the modal</Dropdown>
            <Modal
                title="Confirm the prompt"
                isOpen={isOpen}
                onRequestClose={close}
                actions={[
                    <Button variant="outline" color="base" onClick={close}>
                        Also confirm
                    </Button>,
                    <Button variant="solid" onClick={close}>
                        Confirm
                    </Button>,
                ]}
            >
                <p>
                    This is a demo modal.
                    Real modals should have useful information here.
                </p>
            </Modal>
        </>
    );
}

This can also happen with the default button activation using NVDA on Windows:

Go to https://wwnorton.github.io/design-system/docs/components/modal
Activate NVDA
Select the button to activate the modal
Hold the space bar down.

Firefox 89 on Windows 10.

Great find! Thanks so much, @ottworks.
When the Dropdown closes, it returns focus to its triggering element, which we don't currently have a way to disable. The result is that both the Dropdown and the Modal are trying to control focus in the same event loop and the Dropdown is winning. I'll bring this up with the team to see if we can implement a way to control focus management in Dropdown.
We'll need to research the NVDA bug a bit more. It does appear to be a bug, but it's hard to say if it's an NVDA one or a design system one. Space emulates mouse clicks by default on NVDA, so holding it down will continually trigger the click event. From what I can tell, holding down Space causes the virtual cursor to get stuck on the button eventually, possibly because it lags behind focus. You won't see this issue unless a virtual cursor is involved because without it, click is triggered on keyup of Space, meaning you can't continuously click with Space (this is by design—Enter is the continuous click key).


Indexer prevents property lookup on classes and interfaces

Example:
declare class X {
  foo: string,
  [number]: number
};

declare var x: X;

x.foo; // ok
x[1]; // ok
x['foo']; // error

This works fine with object types.

+1

class Model {
 setKey(value: string | number): void {
    this[this.PRIMARY_KEY] = value
  }

  getKey(): string | number {
    return this[this.PRIMARY_KEY]
  }
}

FYI that the fix for this currently is to extend the class with Object
declare class X extends Object {
  foo: string,
  [number]: number
};

I faced a similar issue.
`//@flow
type x = {y?: {[k:string]: string}}
let y: x = {'y':{'a': 'b'}}
let test = y.y !== undefined ? Object.keys(y.y).map(l=> y.y[l]) : null
Flow finds this to be invalid. Error message:Cannot get y.y[l] because an indexer property is missing in undefined [1]`
I circumvented this problem by making a redundant check.
`
if (y.y !== undefined){
let test = Object.keys(y.y).map(l => {
if (y.y!== undefined && l in y.y){ // y.y !== undefined is redundant
return y.y[l]
}
})
}
`

The workaround seems to have been murdered with<EMAIL_ADDRESS>see flow/try
Any updates on this issue/other workarounds that don't involve completely dropping the use of classes?


Error for tag 'farmersdelight:tomato'

Describe the bug
When I create a world with the mod and without farmerdelight. I got this error:
Couldn't load tag [farmersdelight:tomato (from createdieselgenerators-1.20.1-1.1d.jar), farmersdelight:pumpkin_slice (from createdieselgenerators-1.20.1-1.1d.jar), farmersdelight:rice_panicle (from createdieselgenerators-1.20.1-1.1d.jar)] as it is missing following references: farmersdelight:tomato (from createdieselgenerators-1.20.1-1.1d.jar),
farmersdelight:pumpkin_slice (from createdieselgenerators-1.20.1-1.1d.jar),
farmersdelight:rice_panicle (from createdieselgenerators-1.20.1-1.1d.jar)
To Reproduce

Install the mod.
Run the game with the output console.
Create a world
Error is printed on console

Additional context

Mod version: 1.1d for 1.20.1
Forge version: 47.1.47
Create version: 0.5.1b for 1.20.1

It's a harmless little thing printed into the console, I will try to get it fixed in the next version of the mod


Improve tests of LabelEncoderTransformer

Codecov Report
All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 100.00%. Comparing base (b87452f) to head (bf2539f).
Report is 4 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##              main      #378   +/-   ##
=========================================
  Coverage   100.00%   100.00%
=========================================
  Files           56        56
  Lines         1463      1463
  Branches        55        55
=========================================
  Hits          1463      1463

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.


Typescript type definition

Is there type definition available for Typescript? Would be glad if Infobip can release a set of type definition to ease the integration for Angular / Ionic developer.

Hi @rephchunhoong,
currently we don't have the type definition for Typescript in our Cordova project, but we might provide a file from our side to ease the development (or you might check it up in native SDK libs if it's urgent for you now).
We might schedule it for one of the future releases.
Regards,
Tereza

Any update on that?

Hi @davidrock
Now you are able to use typings:
npm install --save-dev @types/mobile-messaging-cordova

Or ionic integration:
ionic cordova plugin add add com-infobip-plugins-mobilemessaging --save
npm install @ionic-native/mobilemessaging --save

Hope it will helps you!


Error Missing newline after argument -> (Lambda)

Hi hello! Encountered lots of lambda "Error Missing newline after argument" issues executing  "./aws2tf.sh -v yes"

Error: Missing newline after argument
on /Users/kj/Desktop/aws2tf-master/generated/tf.xxxxxxxxxxxx_ap-southeast-1/aws_lambda_function__Delete-Expired-Tagged-Snapshot.tf line 7, in resource "aws_lambda_function" "Delete-Expired-Tagged-Snapshot":
7:     description                    = "This function looks at all snapshots that have a "DeleteOn" tag containing the current day formatted as YYYY-MM-DD. This function should be run at least daily."
An argument definition must end with a newline.
Terraform validate ...
Error: Missing newline after argument
on aws_lambda_function__Delete-Expired-Tagged-Snapshot.tf line 7, in resource "aws_lambda_function" "Delete-Expired-Tagged-Snapshot":
7:     description                    = "This function looks at all snapshots that have a "DeleteOn" tag containing the current day formatted as YYYY-MM-DD. This function should be run at least daily."
An argument definition must end with a newline.

it's because there's a quote " in the description text - it needs to be escaped.  I'll look to reproduce and post a fix shortly.

committed fix for this

Thanks @awsandy!!  but the lambda issues still persist
 Error: Invalid resource name │  │   on aws_lambda_permission.0c6fb271-192b-4a5d-9c66-ee3dbbd6f0dc.tf line 1, in resource "aws_lambda_permission" "0c6fb271-192b-4a5d-9c66-ee3dbbd6f0dc": │    1: resource "aws_lambda_permission" "0c6fb271-192b-4a5d-9c66-ee3dbbd6f0dc" {} │  │ A name must start with a letter or underscore and may contain only letters, │ digits, underscores, and dashes.

fix committed for the above aws_lambda_permission issue

Error: Missing newline after argument

on aws_cloudwatch_event_target__default__SSMOpsItems-Autoscaling-instance-launch-failure__SSMOpsItems-Autoscaling-instance-launch-failureTarget.tf line 22, in resource "aws_cloudwatch_event_target" "default__SSMOpsItems-Autoscaling-instance-launch-failure__SSMOpsItems-Autoscaling-instance-launch-failureTarget":
22: input_template = "={ "title": "Auto Scaling EC2 instance launch failed", "description": "CloudWatch Event Rule SSMOpsItems-Autoscaling-instance-launch-failure was triggered. Your EC2 instance launch has failed. See below for more details.", "source": "EC2 Auto Scaling", "category": "Availability", "severity":"2", "resources": , "operationalData": { "/aws/dedup": {"type": "SearchableString", "value": "{\"dedupString\":\"SSMOpsItems-Autoscaling-instance-launch-failure\"}"}, "/aws/automations": { "value": "[ { \"automationType\": \"AWS:SSM:Automation\", \"automationId\": \"AWS-ASGEnterStandby\" }, { \"automationType\": \"AWS:SSM:Automation\", \"automationId\": \"AWS-ASGExitStandby\" } ]" }, "autoscaling-group-name": {"value": }, "status-message": {"value": }, "start-time": {"value": }, "end-time": {"value": }, "cause": {"value": }} }"
An argument definition must end with a newline.


Sub-templates/object patterns

Motivated by #2, you may want to parse more than just a list of strings, perhaps a list of objects that have values stored in them
For example trying to parse multiple F# let statements
let x = 1
let y = 2
let z = "Hello"

A template for one line might be let % Name: ident % = % Body: ident %%: newline %
The suggested feature is to allow "Smaller sub-templates as a pattern"
Suggested pattern syntax is <#{TEMPLATE CONTENT HERE}#>
So in the example above you could write
% MyLetBindings: <#let % Name: ident % = % Body: ident %%: newline %#>* %
Defaultability is determined by if the sub-template has any required variables, as you'd expect

How could this pattern be anonymised?
Maybe like this: {{Var:##let {{Name:ident}} = {{Body:ident}}{{:newline}}##}}
Getting a bit clunky in here now though
Thinking of ways to change the mustache clips to something smaller too without interfering with common code cases

So suggested non-anonymous syntax now looks like
%define Identifier =
##Literal template here % Var: Ident %##
%

define could just act as a macro for any pattern, with a lookup table (might make sem analysis challenging though, we'll see)

The only thing missing from this feature is - If we use an object variable in a pattern what do we match it with?
Example:
%# Member = <#private % Type: ident % _% Name: ident %;#>%
%# ConsParam = <#% Type: ident % % Name: ident %#>%
%# ConsInit = <#this._%:Name% = %:Name%#>%
%* Parses a class with a private member / 1 argument constructor *%
class MyClass
{
    %Mem: #Member%
    public MyClass(%:Mem as ConsParam%)%* <--- This is the important bit! *%
    {
        %:Mem as ConsInit%
    }
}

Here we are "casting" the object data as a specific object capture pattern, which specifies which way we want to read/write it. This is the proposed syntax (or maybe @) for reusing objects

Object data values are annotated with a "kind" - This lets the template look up what subtemplate was used to parse it.
Objects can be "cast" to a different kind, allowing that same object to be interpreted as the input for a different subtemplate
This opens up tons of possibilities - very useful for code generation!


Enable "Heat Energy (E1)" to be added as a heat source

Did you read the instructions?

[X] I have read the README.

The request
I saw the possibility to add a helper entity "Heat Energy to Gas" to express the heat in m3 for the energy panel.
However, the energy panel in home-assistant itself says that a entity with GJ can also be selected for the gas source. This might be added recently in Home Assistant?
The "Heat Energy (E1)" however is not listed. The dropdown does point to https://www.home-assistant.io/more-info/statistics/ and https://developers.home-assistant.io/docs/core/entity/sensor/#long-term-statistics which state it could be possible to use an entity as long as the state class is set correctly.
Is it possible to add this state class to "Heat Energy (E1)" so it can be listed under Gas Sources with unit GJ?
Additional information
No response

Hi @BramVerheij

However, the energy panel in home-assistant itself says that a entity with GJ can also be selected for the gas source. This might be added recently in Home Assistant?

can you point out where a GJ entity can be added as a gas source? As far as I know, this isn't a possibility, only ft³ and m³ units can be added as gas:

Since HA version 2022.11 GJ entities can be added in the Individual devices section.

Is it possible to add this state class to "Heat Energy (E1)" so it can be listed under Gas Sources with unit GJ?

No this isn't possible, this entity has already the correct device and state class, https://github.com/golles/ha-kamstrup_403/blob/main/custom_components/kamstrup_403/sensor.py#L25-L26.
And that why the Heat Energy to Gas sensor has been added with its specific device and state class: https://github.com/golles/ha-kamstrup_403/blob/main/custom_components/kamstrup_403/sensor.py#L278-L280
And graphs for gas sensors are much nicer than entities in the Individual devices section, as they are shown as kWh.

I've improved the documentation about the energy dashboard integration, have a look at it here:
https://github.com/golles/ha-kamstrup_403#integration-in-the-energy-dashboard
Please reopen if something is still unclear and I'll improve it even further.


Fix unicode decoding bug in compatability.py and add_original_name.py

Coverage increased (+0.008%) to 92.895% when pulling 8019ed6aceaddbe5f52866ad5c61f6c4fcd5a225 on fix-tools into ed1dbc6c9a40da028ba1a71e47352217f8c5b277 on master.


Cannot start service on newer RPi platforms: update to pinctrl instead of using /sys/class/gpio directory

See pull request. You are using /sys/class/gpio to interact with GPIO25 in bash. /sys/class/gpio has been deprecated since 2015 and targeted for removal in 2020 (see here).  pinctrl (see here) is the official Raspberry Pi util for command line manipulation and reading of GPIO. New Raspberry Pi OS versions will not support your current scripts (e.g., the Raspberry Pi 5).
I have submitted a tested PR to update to pinctrl. Please review and merge or provide comments for changes.
NOTE: I have forked and updated my own repo for my use. But because J4H officially points to this repo from their webpage, you should merge for others to use.

See fork using pinctrl here in case this repo is no longer maintained.


Incorrect path for windows.winmd reference

The documentation for adding the reference to windows.winmd appears to be incorrect.
It states that the file windows.winmd at C:\Program Files (x86)\Windows Kits\10\UnionMetadata\<sdk version>\Facade should be used.
However this causes:
Error CS0731 The type forwarder for type 'xyz' in assembly 'Windows' causes a cycle
Adding a referenc to the file Windows.winmd at C:\Program Files (x86)\Windows Kits\10\UnionMetadata\<sdk version>\ appears work correctly and does not cause the type forwarder errors.
Please can you clarify / update the documentation as needed.

Document Details
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

ID: 8d75cb81-9ff3-f9ad-8ad4-818e45da1d62
Version Independent ID: f21e558d-b41f-bcfd-ca8a-9daabf7fa85a
Content: Call Windows Runtime APIs in desktop apps
Content Source: hub/apps/desktop/modernize/desktop-to-uwp-enhance.md
Product: uwp
Technology: apps
GitHub Login: @mcleanbyron
Microsoft Alias: mcleans

Thanks for reaching out to us, and I'm sorry for the delay in responding to you. I just tested out the "To add the required references manually" instructions in this article (including referencing windows.winmd from the /Facade folder) in a Windows Forms project that targets the .NET Framework, and I am not seeing this error; I can successfully call a WinRT API with the current instructions. The engineering team that owns this feature area also confirmed that they are not aware of any changes to this experience.
If you are still seeing the error, please reopen this issue and provide more details about your scenario, such as the specific type of project in which you're seeing this error, your Visual Studio version, and the specific type mentioned in the type forwarder error (whatever 'xyz' is in your scenario).
Also, please confirm that you're only following the instructions in the "To add the required references manually" section (that is, make sure you're not also installing the Microsoft.Windows.SDK.Contracts NuGet package).

This was in a WPF application targetting .NET 4.8.
Visual Studio 2019 16.6.2.
Windows SDK 19041.
I just tried to produce a small repo of the issue and it seems a reference to Facade\windows.winmd gives the errors I reported if references to Windows.Foundation.UniversalApiContract.winmd and Windows.Foundation.FoundationContract.winmd are not included.
So from that angle, the instructions do work, although it was not clear to me that all three winmd files are required.  If I explain how I came at this in the first place, you will see why I had not expected to need to include every reference in the table.
A couple of years since, I had successfully used the approach in the DesktopBridge samples which references Windows.winmd in C:\Program Files (x86)\Windows Kits\10\UnionMetadata\. The is no reference including a 'Facade' folder or the names 'Windows.Foundation.UniversalApiContract.winmdorWindows.Foundation.FoundationContract.winmd`.
Therefore it seems clear that some changes have been made in more recent versions of the Windows SDK.  I had done a clean OS and VS install with the latest Windows SDK and this had broken earlier working references.  I found there were 5 different files named Windows.winmd in the Windows Kits\10\UnionMetadata subfolders and I was not certain on which one should be referenced or that Windows.Foundation.UniversalApiContract.winmd and Windows.Foundation.FoundationContract.winmd now need to be referenced.
Referencing C:\Program Files (x86)\Windows Kits\10\UnionMetadata\<sdk version>\ did however work perfectly without the extra winmd references.
A pointer in the docs that all 3 winmd references are needed would be useful (especially as references to System.Runtime.WindowsRuntime.UI.Xaml clearly aren't unless you want UI stuff).
There is also a minor typo in the docs though when compared to the 18362 and 19041 versions of the Windows SDK.  Reference paths for Windows.Foundation.UniversalApiContract.winmd and Windows.Foundation.FoundationContract.winmd are missing the \ preceding the <version>.

Thanks for all the additional info. You're correct that the intention is to reference all the .dll and .winmd files listed in the table, and I have updated the language to make this more explicit. I have also fixed the missing '' characters.
If you haven't tried the Microsoft.Windows.SDK.Contracts NuGet package yet, you may want to try that out in the future. It provides a much easier experience compared to adding all the references manually.


DMCA takedown notice

This repository contains code that I thought of first.

Closing due to material misrepresentation.


JIT startsWith and endsWith

I proposed this already in fastify/help long time ago, but maybe it has a use in nodejs core?
https://github.com/fastify/help/issues/711
true startsWith x 57,424,304 ops/sec ±0.61% (95 runs sampled)
true startsWith jit x 1,359,500,378 ops/sec ±0.12% (99 runs sampled)
true endsWith x 55,539,779 ops/sec ±0.73% (93 runs sampled)
true endsWith jit x 136,694,982 ops/sec ±0.92% (95 runs sampled)
false startsWith x 208,705,495 ops/sec ±0.52% (97 runs sampled)
false startsWith jit x 1,360,481,699 ops/sec ±0.15% (97 runs sampled)
false endsWith x 208,323,815 ops/sec ±0.83% (93 runs sampled)
false endsWith jit x 135,154,350 ops/sec ±0.74% (87 runs sampled)
'use strict'

const assert = require('assert')
const Benchmark = require('benchmark')

const test = 'Lorem Ipsum I dolor'
const startsWithJit = startsWithJitGen('Lorem')
const endsWithJit = endsWithJitGen('dolor')
const Lorem = 'Lorem'
const dolor = 'dolor'

const lorem = 'lorem'
const Dolor = 'Dolor'

assert.ok(startsWithJit('ol') === false)
assert.ok(startsWithJit('or') === false)
assert.ok(startsWithJit('Dolor') === false)
assert.ok(startsWithJit('dolor') === false)
assert.ok(startsWithJit('lorem') === false)
assert.ok(startsWithJit('Lorem') === true)

assert.ok(endsWithJit('ol') === false)
assert.ok(endsWithJit('or') === false)
assert.ok(endsWithJit('Dolor') === false)
assert.ok(endsWithJit('dolor') === true)

new Benchmark.Suite()
  .add('true startsWith', function () { test.startsWith(Lorem) })
  .add('true startsWith jit', function () { startsWithJit(test) })
  .add('true endsWith', function () { test.endsWith(dolor) })
  .add('true endsWith jit', function () { endsWithJit(test) })
  .add('false startsWith', function () { test.startsWith(lorem) })
  .add('false startsWith jit', function () { startsWithJit(test) })
  .add('false endsWith', function () { test.endsWith(Dolor) })
  .add('false endsWith jit', function () { endsWithJit(test) })
  .on('cycle', function (event) { console.log(String(event.target)) })
  .run()

function startsWithJitGen(sequence) {
  const chain = []

  chain.push('(typeof value === \'string\')')
  chain.push(`(value.length >= ${sequence.length})`)

  for (let i = 0, il = sequence.length; i < il; ++i) {
    chain.push(`(value[${i}] === '${sequence[i]}')`)
  }

  const fnBody = 'return ' + chain.join(' && ')
  return new Function('value', fnBody)
}

function endsWithJitGen(sequence) {
  const chain = []

  chain.push('(typeof value === \'string\')')
  chain.push(`(value.length >= ${sequence.length})`)

  for (let i = 0, il = sequence.length; i < il; ++i) {
    if (i === 0) {
      chain.push(`(value[len] === '${sequence[i]}')`)
      continue
    }
    chain.push(`(value[len + ${i}] === '${sequence[i]}')`)
  }

  const fnBody = `const len = value.length - ${sequence.length}; return ` + chain.join(' && ')
  return new Function('value', fnBody)
}

The native one seems to not cache the value. So there is no performance gain.

We absolutely can do this, I think I showed this to @anonrig at some point a while ago and we used the trick in bluebird back then.
It's faster than native because it does less work and it's jitted to a specific string value.

Looks really cool! But let's first consider native alternatives ;)
true startsWith x 73,398,707 ops/sec ±0.56% (100 runs sampled)
true indexOf x 968,185,969 ops/sec ±0.17% (97 runs sampled)
true startsWith jit x 959,753,026 ops/sec ±1.18% (98 runs sampled)
true endsWith x 111,526,784 ops/sec ±0.20% (97 runs sampled)
true indexOf end x 969,052,956 ops/sec ±0.08% (96 runs sampled)
true endsWith jit x 178,013,979 ops/sec ±0.28% (98 runs sampled)

"use strict";

const assert = require("assert");
const Benchmark = require("benchmark");

const test = "Lorem Ipsum I dolor";
const startsWithJit = startsWithJitGen("Lorem");
const endsWithJit = endsWithJitGen("dolor");
const Lorem = "Lorem";
const dolor = "dolor";

new Benchmark.Suite()
  .add("true startsWith", function () {
    test.startsWith(Lorem);
  })
  .add("true indexOf", function () {
    test.indexOf(Lorem) === 0;
  })
  .add("true startsWith jit", function () {
    startsWithJit(test);
  })
  .add("true endsWith", function () {
    test.endsWith(dolor);
  })
  .add("true indexOf end", function () {
    test.indexOf(dolor) === test.length - dolor.length;
  })
  .add("true endsWith jit", function () {
    endsWithJit(test);
  })
  .on("cycle", function (event) {
    console.log(String(event.target));
  })
  .run();

function startsWithJitGen(sequence) {
  const chain = [];

  chain.push("(typeof value === 'string')");
  chain.push(`(value.length >= ${sequence.length})`);

  for (let i = 0, il = sequence.length; i < il; ++i) {
    chain.push(`(value[${i}] === '${sequence[i]}')`);
  }

  const fnBody = "return " + chain.join(" && ");
  return new Function("value", fnBody);
}

function endsWithJitGen(sequence) {
  const chain = [];

  chain.push("(typeof value === 'string')");
  chain.push(`(value.length >= ${sequence.length})`);

  for (let i = 0, il = sequence.length; i < il; ++i) {
    if (i === 0) {
      chain.push(`(value[len] === '${sequence[i]}')`);
      continue;
    }
    chain.push(`(value[len + ${i}] === '${sequence[i]}')`);
  }

  const fnBody =
    `const len = value.length - ${sequence.length}; return ` +
    chain.join(" && ");
  return new Function("value", fnBody);
}

This is not correct. indexOf searches the whole string. So imagine 1 mb of string and at the end is the sequence you are looking for. In that case startsWith is faster as it will only check the beginning. The JIT variant is basically faster than startsWith as it does not have to process the "needle" everytime.
Also Using indexOf for endsWith is not good, you should use the second parameter of indexOf to force it to use the end or use lastIndexOf.

Hmm... thanks for pointing it out
BTW, did you release a module that does this?

Sorry I accidentally deleted the comment

No, I did not release it as a module.

You should in my opinion

This is not correct.

Yeah I was in a hurry, but they can be remedied
My point is code generation using Function should be avoided because of how easy it is to make a bad mistake, that's why a proper module that does this would be better
How about these? Note that .slice doesn't create a new string but makes a SlicedString:
true startsWith x 73,312,446 ops/sec ±0.55% (101 runs sampled)
true slice indexOf x 956,903,596 ops/sec ±0.38% (98 runs sampled)
true slice string comparison x 937,838,664 ops/sec ±1.52% (100 runs sampled)
true startsWith jit x 958,977,278 ops/sec ±0.19% (97 runs sampled)
true endsWith x 110,629,205 ops/sec ±0.30% (92 runs sampled)
true indexOf end x 965,330,475 ops/sec ±0.13% (97 runs sampled)
true slice indexOf end x 956,498,121 ops/sec ±0.83% (95 runs sampled)
true slice string comparison end x 960,627,186 ops/sec ±0.42% (98 runs sampled)
true endsWith jit x 177,147,868 ops/sec ±0.59% (95 runs sampled)

"use strict";

const assert = require("assert");
const Benchmark = require("benchmark");

const test = "Lorem Ipsum I dolor";
const startsWithJit = startsWithJitGen("Lorem");
const endsWithJit = endsWithJitGen("dolor");
const Lorem = "Lorem";
const dolor = "dolor";

new Benchmark.Suite()
  .add("true startsWith", function () {
    test.startsWith(Lorem);
  })
  .add("true slice indexOf", function () {
    test.slice(0, Lorem.length).indexOf(Lorem) === 0;
  })
  .add("true slice string comparison", function () {
    test.slice(0, Lorem.length) === Lorem;
  })
  .add("true startsWith jit", function () {
    startsWithJit(test);
  })
  .add("true endsWith", function () {
    test.endsWith(dolor);
  })
  .add("true indexOf end", function () {
    test.length >= dolor.length && test.indexOf(dolor, test.length - dolor.length) !== -1
  })
  .add("true slice indexOf end", function () {
    test.length >= dolor.length && test.slice(test.length - dolor.length).indexOf(dolor) === 0
  })
  .add("true slice string comparison end", function () {
    test.length >= dolor.length && test.slice(test.length - dolor.length) === dolor
  })
  .add("true endsWith jit", function () {
    endsWithJit(test);
  })
  .on("cycle", function (event) {
    console.log(String(event.target));
  })
  .run();

function startsWithJitGen(sequence) {
  const chain = [];

  chain.push("(typeof value === 'string')");
  chain.push(`(value.length >= ${sequence.length})`);

  for (let i = 0, il = sequence.length; i < il; ++i) {
    chain.push(`(value[${i}] === '${sequence[i]}')`);
  }

  const fnBody = "return " + chain.join(" && ");
  return new Function("value", fnBody);
}

function endsWithJitGen(sequence) {
  const chain = [];

  chain.push("(typeof value === 'string')");
  chain.push(`(value.length >= ${sequence.length})`);

  for (let i = 0, il = sequence.length; i < il; ++i) {
    if (i === 0) {
      chain.push(`(value[len] === '${sequence[i]}')`);
      continue;
    }
    chain.push(`(value[len + ${i}] === '${sequence[i]}')`);
  }

  const fnBody =
    `const len = value.length - ${sequence.length}; return ` +
    chain.join(" && ");
  return new Function("value", fnBody);
}

These sort of benchmarks are kind of meaningless due to the variety of data (string length, string type (whether tree/rope or flat), string encoding internally etc).
I recommend instead of these microbenchmark fairy tales (+1 if you get the reference) you look at the IR in indicitum (https://v8.github.io/tools/head/system-analyzer/index.html)

Of course I get you point; I wasn't arguing what I presented is the best performance-wise, just that we don't need to use new Function to get that level of performance
However, one thing all these benchmarks clearly demonstrate is how startsWith and endsWith are definitely slower than all the alternatives
Replacing them with one of the provided alternatives should be a no-brainer in node or any performance-centric project

Does startsWith or endsWith actually show up in the performance profile of any of our APIs that use them?

I don't know, does it matter?
I'm not pushing for this change, I simply mentioned my concerns for using new Function and provided an alternative that also seems to be 100 times faster than starts/endsWith in microbenchmarks — is that much of a difference realistic? No! Could it improve the performance of hot paths? Maybe
Also, endsWithJIT doesn't seem on par with what I submitted — I know if this was a lower level language, nothing beats what Uzlopak showed, but as we know, JS cheats when JIT compiling
Anyway, I don't know either if the results are similar with primordials
Reference:
https://github.com/RafaelGSS/nodejs-bench-operations/blob/main/RESULTS-v20.md#startswith-comparison
https://github.com/RafaelGSS/nodejs-bench-operations/blob/main/RESULTS-v20.md#endswith-comparison


New check: Check that glyph for U+0675 ARABIC LETTER HIGH HAMZA is not a mark

What needs to be checked?
U+0675 ARABIC LETTER HIGH HAMZA should be a base glyph not a mark and should be the same size as U+0621 ARABIC LETTER HAMZA but slightly higher above baseline.
Detailed description of the problem
Many fonts incorrectly treat U+0675 ARABIC LETTER HIGH HAMZA as a variant of U+0654 ARABIC HAMZA ABOVE and makes it a combining mark of the same size. But U+0675 is base letter and should be a variant of U+0621 ARABIC LETTER HAMZA but raised slightly above baseline.
Resources and steps needed to reproduce the problem
The current version of Noto Sans Arabic has this issue and many other fonts.
Suggested profile

[ ] Vendor-specific: Google Fonts
[ ] Vendor-specific: Adobe Fonts
[ ] OpenType (requirements imposed by the OpenType specification)
[x] Universal (broadly accepted best practices on the type design community)
[ ] Other:

Suggested result
Which log result level should the check have:

[x] 🔥 FAIL if U+0675 is mark and it size is different than U+0621
[ ] ⚠ WARN (A potential issues that may need to be addressed)

Severity assessment
4 as this effectively makes it useless for Jawi and possibly Kazakh as well.

All this is true, but it should apply to U+0674 (HIGH HAMZAH), not U+0675 (HIGH HAMZAH ALEF)

[U+0674] ARABIC LETTER HIGH HAMZA should be ... the same size as U+0621 ARABIC LETTER HAMZA but slightly higher above baseline.

Where does this information come from?  Unicode's current code charts certainly do not suggest this.

[U+0674] ARABIC LETTER HIGH HAMZA should be ... the same size as U+0621 ARABIC LETTER HAMZA but slightly higher above baseline.

Where does this information come from? Unicode's current code charts certainly do not suggest this.

This is based on its use as three quarters hamza in Jawi use and native readers preferences. See https://www.unicode.org/L2/L2022/22051-jawi-hamza.pdf and the Unicode response in https://www.unicode.org/L2/L2022/22068-script-adhoc-rept.pdf. Though the recommendation there is to have a Jawi-specific variant glyph and relay on language tagging, my understanding is that this extra complication is unnecessary as a full size hamza seems to be acceptable for Kazakh.

Thanks. So the result of Script Ad Hoc two years ago says:

However, the general consensus amongst the group was to unify THREE QUARTER HIGH HAMZA with
U+0674 HIGH HAMZA, and to highly encourage font designers to support the glyph with the expected
shape and positioning for Jawi, employing a language tag or creating a Jawi-specific font. Encoding a
new character would take several years, and text representation would be inconsistent, causing other
problems for users.

This suggests to me that this fontbakery test should apply only to fonts that have such language tag or are known to be designed specifically for Jawi.

should apply only to fonts that have such language tag

Actually, it is slightly more nuanced than that.
If the font has a Jawi language tag, then fontbakery should test 0674 glyph size with and without the that language applied, and the glyph size should be similar to 0621 in the first case and 0654 in the second.

The soon-to-be-released Unicode 16 has included information about Jawi usage to the discussion of high hamza. The Review Draft of Ch 9 now reflects the Script Ad Hoc recommendation, specifically saying:

Malay Jawi uses U+0674 ٴ ARABIC LETTER HIGH HAMZA. In Jawi, the letter is the same size as U+0621 ء ARABIC LETTER HAMZA; however, unlike U+0621, it is positioned above the baseline at three-quarters height of the U+0627 ا ARABIC LETTER ALEF. Font designers can use language tagging in order to support the preferred shapes for both Kazakh and Jawi in multilingual fonts

With that in view, it seems this test really needs to evaluate the size of high hamza based on langtag-specific rendering within the font. Whether this even possible with facilities within fontbakery I do not know. But it seems clear that the following logic would be needed:

If the MLY language system tag is in the font for Arabic script, then fontbakery should apply that tag and then check that the size of the resulting high hamza glyph is about that of U+0621 hamza
If the KAZ language system tag is in the font for Arabic script, then fontbakery should apply that tag and then check that the size of the resulting high hamza glyph is about that of U+0654 hamza above
Regarding the default glyph: Unless fontbakery knows that the font is intended only for Jawi — and I'm not sure how it could know that — then it seems to me the default glyph for high hamza should be as specified in the Unicode code charts, namely the size of U+0654 hamza above.


Add config descriptions

I cannot found some config  parameters descriptions in README and I does not add descriptions for them.

Thanks! :sunglasses:


allowing the ability to pass a scale parameter so it drags correctly inside of a scaled parent

This pull request addresses #174


Mumble not updating to latest version

Bug Report
Package Name: mumble
Current Behaviour
Since a month now the old stable is available only in extras repository
Expected Behaviour
Latest should be available:
https://dl.mumble.info/latest/stable/client-windows-x64.msi
https://dl.mumble.info/stable/

| mumble_client-1.4.230.x64.msi | 2022-01-16 17:34 | 31M |
-- | -- | -- | -- | --

Additional context/output
PS C:\Users\dutch> scoop list mumble
Installed apps matching 'mumble':
mumble 1.3.4 global [extras]
PS C:\Users\dutch>

https://github.com/ScoopInstaller/Extras/blob/master/bucket/mumble.json
"version": "1.3.4",
Possible Solution
Update extrax bucket
System details
N/A
Scoop Configuration

{
    "lastupdate":  "2022-02-15T12:19:34.2439724+01:00",
    "SCOOP_REPO":  "https://github.com/lukesampson/scoop",
    "SCOOP_BRANCH":  "master"
}

Can you make a PR for the update?


refactor(ui shell): Added a fluid UI shell story

Closes IBM/carbon-components-angular#1850
Added a UI Shell > Header fluid items to side navigation story to demonstrate how to deal with resizing ibm-header.
Extended isCurrentPage to the NavigationItem interface so it can be passed as part of the navigationItems property.

My pleasure. :)
Thanks for merging so quickly


New release?

Dear all,
it looks like the last release is now some time ago. Would it be possible to do another release, so I can have a stable, up-to-date environment please? That would make it easier for the project to be used by other's as well.
Thanks!

There hasn't been a code change in 3 years, I strongly doubt you will get a new release. If there is a security concern you have specifically then post an issue about it or even better fix it and open a pull request however it does seem the project is dead.


Don't derive ILayer from IAsyncDataFetcher

This will allow simpler layers for simpel cases.
There are a few issues with this.

RefreshData is now sometimes used to signal changes to trigger a redraw. The other option would be to call a RefreshGraphics on the MapControl but often manipulation of the data is done in a context where the MapControl is not available. There should be an alternative way to trigger this.
The AnimatedPointsLayer needs to know the current extent. This input now comes from the RefreshData method. A solution could be to keep it as an IAsyncDataFetcher.

Solutions:

Move RefreshData and/or OnDataChanged to ILayer. They will function as a mechanism to signal change in a non sync layer. But doing so will only leave AbortFetch and ClearCache in IAsyncDataFetcher. Could there be another solution for these methods?

Looking at AbortFetch. Only Layer and TileLayer do something useful. Which is _fetchMachine?.Stop();. They are used when a new Map is set or a layer is removed. Perhaps it is also relevant when a new datasource is set on a layer.
Perhaps this could be arranged by direct communication between the Map and the Layers.

Choice for now.

Move OnDataChange and RefreshData to ILayer.
Later: Make ClearCache internal for TileLayer and Layer.
Later: Move AbortFetch to te FetchMachine.


[BEAM-551] Add DisplayData handling of ValueProvider

R: @dhalperi
Notes:

An alternative would be to accept ValueProvider and call T.toString() if isAccessible
The parameter is not marked @Nullable because the DisplayData code calls checkNotNull

@swegner, I think you know this code best. Any comments?

I'll take a look.
CC: @ajamato

Addressed comments about typing to the best of my knowledge.  Please take another look.

Done!

LGTM,  back to @dhalperi for committer approval + merge.

LGTM. Merging.

Merged. Test failed for failing to find output. Manual check confirms the output is produced:
$ gsutil ls gs://temp-storage-for-end-to-end-tests/WordCountIT-2016-12-06-23-28-32-189/output/results*-of-*
gs://temp-storage-for-end-to-end-tests/WordCountIT-2016-12-06-23-28-32-189/output/results-00000-of-00004
gs://temp-storage-for-end-to-end-tests/WordCountIT-2016-12-06-23-28-32-189/output/results-00001-of-00004
gs://temp-storage-for-end-to-end-tests/WordCountIT-2016-12-06-23-28-32-189/output/results-00002-of-00004
gs://temp-storage-for-end-to-end-tests/WordCountIT-2016-12-06-23-28-32-189/output/results-00003-of-00004


Unpredictable RigidBody2D bounce against 2 bodies.

Godot version: Godot 3, b5b2ca8
OS/device including version: Ubuntu 17.10
Issue description:
While testing how rigid bodies gain energy after bounces I have found that collisions on 2 consecutive shapes can be totally unpredictable.
Perfect vertical bounces can make bodies from slowly move to a side to turn ballistic.
Steps to reproduce:
Run the example project and leave them bounce for a minute.
Bodies that partially touch a second tile will start to slowly move to the sides and later bounce with high angular velocity.
This is reproducible with with 2 bodies too, not only tiles (but mostly affects tilemap usability).
Minimal reproduction project:
bad_rb2d_collision.zip

I am not totally convinced this is a bug to be honest. Bounce model (when bounce is 1.0) has never been very realistic in physics engines, specially given how contacts are computed. By looking at this example, I don't really see anything that could be changed or fixed. It behaves as expected, even if it's weird.
I will be closing and archiving, but if a simpler and a lot more specific test case can be created when it's very clear that something is wrong, will be happy to open and test again.

A deterministic physics mode could be useful, getting always different responses makes the physics engine useless for some mechanics.


[fix] Postgres compatible LIMIT

Small change to make it compatible with LIMIT and OFFSET when using Postgres
More info
http://www.postgresql.org/docs/9.4/static/queries-limit.html

Thanks, we have merged into Medoo code. But please merge the change into develop branch next time, that's better.


Updated the schedule and added Friday and Monday. Fixed the shift functions.

Description
Include a summary of the change and which issue is fixed. List any dependencies that are required for this change.
Fixes # (issue)
Type of change

[👍] Bug fix (non-breaking change which fixes an issue)
[👍] New feature (non-breaking change which adds functionality)
[] Breaking change (fix or feature that would cause existing functionality to not work as expected)
[] This change requires a documentation update

Test Configuration:

Operating System (with version #): Windows 10 Build 19042.685
Firmware version: 20H2
Hardware: Dell Inspirion 7567 (Upgraded to 24GB RAM, 512 GB M.2 SSD)
Toolchain: Visual Studio Code with Live Server

Checklist:

[👍] My code follows the style guidelines of this project
[👍] I have performed a self-review of my own code
[ ] I have commented my code, particularly in hard-to-understand areas
[ ] I have made corresponding changes to the documentation
[👍] My changes generate no new warnings
[ ] I have added tests that prove my fix is effective or that my feature works
[ ] New and existing unit tests pass locally with my changes
[ ] Any dependent changes have been merged and published in downstream modules

lgtm

fixed merge conflict errors, merging now.


implement application.exit

To implement this, we'll need to keep a track of opened Window objects and close them when Application.Exit is called.

Is this for implementing the WPF Application.Exit event or the Windows Forms Application.Exit method?

I would so both really aka an event and the actual method.

This is for implementing the Perspex Application.Exit :)

@grokys I know, I was just wondering which one this was supposed to be an analog for, since this project is like "next WPF" but your comment matched the description of the Windows Forms Application.Exit.

Ooooh right because it's Application.Current.Shutdown() for WPF

I'm working on this now on the application.exit branch on my fork.

Not able to find the Application.Exit method.. Still not implemented?

See https://docs.avaloniaui.net/docs/getting-started/application-lifetimes


Add the possibility to set folders/files associations

In material-icon-theme extension, we can associate files with other's appearance:
"material-icon-theme.folders.associations": {
    "infra": "app",
    "entities": "class",
    "schemas": "class",
}

"material-icon-theme.files.associations": {
    "*.module.ts": "nest"
}

It would be interesting to see the same behavior in Catppuccin extension.

+1


How was the rosenbridge coprocessor, and its instruction set, discovered?

I think this is the penultimate question on everyone's minds right now.
Okay, so sandsifter did the heavy lifting; but that just firehoses random instructions at the CPU and looks for interesting results. That sounds like it would generate a nontrivial amount of noise - not so much so as to make the whole process overly tedious or simply unviable, but enough that skill and experience would be paramount to figure out what's worth following up on and what can be safely discarded.
But sandsifter just deals in discovery, and (in this case) to a very rudimentary extent - sandsifter was designed to find oddness in x86 CPUs, not entirely new processor architectures!
I am very interested to find out how you went from "hmm, that's weird" to pinpointing/establishing the very existence of the coprocessor, to identifying 21 of its instructions - and the x86 wrappings!
Also, in the same way a fighter pilot might share how to start up and fly an F-18, would you mind sharing how work on the assembler could be furthered by anyone with a VIA C3 who's interested in playing with this beyond going "huh, it's vulnerable"?
Please tell us that research papers and/or in-depth blog posts are in the pipeline. :)
And thanks, too. This is really awesome. ME, eat your heart out.

Yeah. That's why I don't think the Qubes OS is an ultra-secure OS as Rutkowska says, at least on a modern x86 hardware (new versions rely on VT-x and VT-d, so i can't use it on a non-modern x86 hardware). Thinking in the same direction, QubesOS' movement from Xen PV to VT-x could be a step backwards, because we can easily inspect how Xen PV works, but inspecting VT-x (on firmware and circuitry) is very hard, but using PV, a JavaScript malware loaded in a webbrowsing qube utilizing a hidden backdoor still would probably be able to switch itself with a magic way to ring 0/ring -1, read some data from memory/any DMA device and send it back in a next HTTP request... so if a CPU is backdoored, utilising or not utilising VT-x doesn't really seem to change anything. If I would want a really secure computing device, I could port Qubes OS to some chinese-manufactured in-order-executing ARM, MIPS, PowerPC or even a 68060 (which are probably less likely to be backdoored, especially the last one)... but they still can be backdoored. 68060 are enough simple to be inspected with a bowl of acid and a microscope, but still it's complicated. Well, maybe RISC-V would be secure enough, it would be very hard to backdoor one implemented in a FPGA or even synthesized and ordered as an ASIC in some Chinese factory.

This is how I found my way here.
Looks like it all started with a patent search.

In this video Mr Domas details his methodology and answers some of your questions above: https://youtu.be/_eSAF_qT_FY
It has been pointed out elsewhere that the DEC(sic) has been documented elsewhere in leaked proprietary documents. An online search for via C3 ALTINST should yield some useful results.
Not to detract in any way from Mr Domas' research, the video presentation detailing his methodology is simply amazing.


replace struct vfu_mmap_area with struct iovec

fixes #147

I've accidentally included the fix for https://github.com/nutanix/libvfio-user/issues/141, which apparently has issues. I'll see whether we can fix soon it via it's proper PR, otherwise I'll revert it.


Added changes to override the commandTimeout caps to resolve issues with default time out of 5s

[*] Added changes to override the commandTimeout caps to resolve issues with default time out of 5s

@jlipps This change couldn't be tested locally as the below issue is yet to be resolved.
https://github.com/headspinio/appium-altunity-plugin/issues/8


Trezor luks

Motivation for this change
Because in our company switch from debian-based distro to NixOs, we need to make sure our trezor will work here as-well. That was motivation for this change.
Things done
support of trezor cipher value and initrd for trezor support

[ ] Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS)
Built on platform(s)

[X] NixOS
[ ] macOS
[ ] other Linux distributions

[ ] Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
[ ] Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
[X] Tested execution of all binary files (usually in ./result/bin/)
[ ] Determined the impact on package closure size (by running nix path-info -S before and after)
[ ] Assured whether relevant documentation is up to date
[X] Fits CONTRIBUTING.md.

Is there some way how to use mainstream packages and install separately this one before it's merged? Peoples here already asking "when it will be". Something like in debian based distro I will just do .deb package which I will install.

@petrkr You can maintain a separate branch of nixpkgs and occasionally rebase your changes on top of channels/nixos-unstable.
Then you would just do
nixos-rebuild switch -I nixpkgs=$HOME/my-nixpkgs

That how i do on developmnet, but every monday it gets broken from mainstream, so it's not good way how do it.
Also it's impossible such way maintain like 20 computers. Somehow merge mainstream and this PR would me nice. Because i can teach users to do 'nixos rebuild switch' but not doing git fetch, rebase, switch with -I also when they wanna install own package, they also need use nix-env -I
So this is good maybe for me as
administrator who know linux, but not for 'regular' user.

@petrkr I believe nix-channel --help is meant for those cases, I haven't used it personally though. It should work the same way but without needing git.

Rebased to latest release 18.09 and renamed package. Hope that will help. Also it's proof-of-concept which works (tested). Feel free to contribute or make it "nicer".

Got some time to change this due latest notes.

rebased to latest master. Tested with TrezorOne.

Updated license.. Is there chance about use this in mainstream? I need some update for Mondays meeting at work :)

Closing as I working on different library which will use newer trezor libraries. PR #58968


Prisma language server crashes repeatedly

Bug description
Prisma language server crashes continuously, have to repeatedly restart the server over and over until it stays up. Happens most of the time on start up and periodically while using.

Using the version of @prisma/language-server that comes w/ extension

After upgrading the @prisma/language-server in the extension dir to the latest version:

Seems to be an issue w/ the formatter and some test.
How to reproduce
Open any .prisma file
Expected behavior
Prisma language server to stay up.
Success old version:

Success new version:

Prisma information
Issue is schema and project independent. Will occur regardless of schema content, including blank schemas. Has occured in every project
Environment & setup

OS: Ubuntu 20.04.3 LTS
Kernel: Linux <IP_ADDRESS>-microsoft-standard-WSL2 #1 SMP Wed Aug 25 23:20:18 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
Editor: NVIM
Editor version: 0.4.3 - Release ( LuaJIT 2.1.0-beta3 )
Extension version: coc.nvim version: 0.0.80-03c9add7cd / coc-prisma version: 0.10.0
Node: node 16.13.0

~/.config/nvim/init.vim
syntax on

set ruler
set showcmd
set showmode

set history=20
set incsearch
set browsedir=buffer
set cmdheight=2
set confirm
set hidden
set background=dark

set autoread
set noallowrevins

set smartindent
set expandtab
set shiftwidth=2
set tabstop=2
set linebreak
set number

set fileformat=unix
set nobomb

let g:coc_force_debug=1
call plug#begin(stdpath('data').'/plugged')
  Plug 'preservim/nerdtree'
  Plug 'Xuyuanp/nerdtree-git-plugin'
  Plug 'tiagofumo/vim-nerdtree-syntax-highlight'
  Plug 'vim-airline/vim-airline'
  Plug 'vim-airline/vim-airline-themes'
  Plug 'cocopon/iceberg.vim'
  Plug 'bling/vim-bufferline'
  Plug 'neoclide/coc.nvim', {'branch': 'release'}
  Plug 'vim-scripts/Rainbow-Parenthesis'
  Plug 'ryanoasis/vim-devicons'
  Plug 'tpope/vim-fugitive'
  Plug 'pantharshit00/vim-prisma'
call plug#end()

colorscheme iceberg
let g:arline_theme='deus'
augroup nerdtree
  autocmd StdinReadPre * let s:std_in=1
  autocmd VimEnter * if argc() == 0 && !exists('s:std_in') | NERDTree | endif

  autocmd StdinReadPre * let s:std_in=1
  autocmd VimEnter * if argc() == 1 && isdirectory(argv()[0]) && !exists('s:std_in') | execute 'NERDTree
' argv()[0] | wincmd p | enew | execute 'cd '.argv()[0] | endif
augroup END

augroup filetypedetect
  autocmd BufNewFile,BufRead *.cjs setf javascript
  autocmd BufNewFile,BufRead *.mts setf typescript
  autocmd BufNewFile,BufRead *.cts setf typescript
augroup END
let g:coc_filetype_map={'cjs':'javascript', 'mts': 'typescript', 'cts': 'typescript'}

~/.config/nvim/coc-settings.json
{
  "tsserver.enable": true,
  "tsserver.npm": "/usr/bin/pnpm",
  "typescript.preferences.quoteStyle": "single",
  "eslint.enable": true,
  "eslint.packageManager": "pnpm",
  "prisma.prismaFmtBinPath": ""
}

Can confirm, also an issue on Visual Studio Code as well.

This cluster of problems should not occur any more as with release 3.6.0 we do not have platform dependent binaries in the extension (and language server) any more, but a Wasm module that should be much more stable: https://github.com/prisma/prisma/releases/tag/3.6.0 🥳
Please let us know of course if this or a similar problem occurs again in the future. Thanks!

This appears to have fixed the issue

We now also published a blog post explaining the background and motivation of this change a bit: https://www.prisma.io/blog/vscode-extension-prisma-rust-webassembly


Speed optimizations for non-combined scan PASEF access

Speed optimizations for non-combined scan PASEF access, mostly in the form of grabbing an entire frame at once, and doing the index to mz conversion at one go to take advantage of threadedness inside the Bruker DLL
Passes all tests, including Skyline perf tests.

One drawback to squash merging is that the original commits aren't technically merged, so that's why they all show up here even though they're already in master. So you have to use a fresh branch. :(

Will do.

shall we delete this branch?


loading PDFs dynamically

change to allow PDFs to be loaded dynamically

Sorry for the spacing problems...have been extremely busy and did not pay attention to that...mybad.
But it should be trivial for you to fix them.


fix(linter): reno link updated

Noticed in CI failures (https://github.com/DataDog/datadog-agent/actions/runs/9864112674/job/27238371401?pr=27379) that the link pointed to in  the docs was to the wrong place, the docs for reno now live here: https://github.com/DataDog/datadog-agent/blob/main/docs/public/guidelines/contributing.md#reno, so updated the linter accordingly.

/merge


Initial setup from a feature branch

Math Magicians: setup
In this request:

Add a create react app setup
Add linters configuration
add configuration to git-flow

STATUS: INVALID 🔴
Hi @akos29
I'm sure you put a lot of effort into this project but this PR is invalid because you have unmodified README file 😓 please use this template.
Kindly fix the issue and submit the PR for review again 👍
Best of luck!

Every comment with the [OPTIONAL] prefix won't stop the approval of this PR. However, I strongly recommend you take them into account as they can make your code better. Some of them were simply missed by the previous reviewer and addressing them will improve your application.
Cheers and Happy coding!👏👏👏
Feel free to leave any questions or comments in the PR thread if something is not 100% clear.
Please, remember to tag me in your question so I can receive the notification.

As described in the Code reviews limits policy  you have a limited number of reviews per project (check the exact number in your Dashboard). If you think that the code review was not fair, you can request a second opinion using this form.


Feature - Top K Motifs

As of now, we only have the top K discords algorithm implemented. There is a need to have the top k motifs algorithm implemented as well per our discord channel.

#72 implements this. can close when pushed in version 0.0.8


HTTP Response - Bad response when create a new user

Description
Endpoint should be return the user account that created instead of a generic message

Discoveries

Reserved words of DynamoDB https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/ReservedWords.html


[20.03] flashplayer: <IP_ADDRESS>0 -> <IP_ADDRESS>3

(cherry picked from commit ac374d41c816f7365a3945e657d2beba3962587d)
Backported <IP_ADDRESS>3 to release 20.03 for important bug fixes.
Also needed because old upstream release is no longer available.

Motivation for this change
Things done

[ ] Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
Built on platform(s)

[x ] NixOS
[ ] macOS
[ ] other Linux distributions

[ ] Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
[ ] Tested compilation of all pkgs that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
[ ] Tested execution of all binary files (usually in ./result/bin/)
[ ] Determined the impact on package closure size (by running nix path-info -S before and after)
[ ] Ensured that relevant documentation is up to date
[ ] Fits CONTRIBUTING.md.

NOTE: Tested backport with chromium and firefox (minimal). Did not test stand-alone version.
See recent: PR #82322 (now outdated)
CC @taku0 @volth @worldofpeace

thanks @tollb :heart:


Keepalive requests

Hi!
The clients disconnects after some seconds.
Can you set keepalive requests in ws server?

Please specify what you are using:

PHP Socket (open)
NGINX + Socket
Apache + Socket
etc

This should be a web server problem, not an application

Ratchet on port 5900
nginx proxy this to https://host/wsapp

Simple nginx config (exemple.com)
# Default server configuration
#

server {

	server_name www.exemple.com;
	return 301 $scheme://exemple.com$request_uri;
}

map $http_upgrade $connection_upgrade {

	default upgrade;
	'' close;
}

upstream websocket {

	server exemple.com:5300;
}

server {

	listen 443;
	location / {

		proxy_pass http://websocket;
		proxy_http_version 1.1;
		proxy_set_header Upgrade $http_upgrade;
		proxy_set_header Connection $connection_upgrade;

		proxy_set_header Host $host;
		proxy_set_header X-Real-IP $remote_addr;
		proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
		proxy_set_header X-Forwarded-Proto https;
		proxy_redirect off;
	}
}

server {

	listen 80 default_server;
	listen [::]:80 default_server;

	root /var/www/exemple.com/public/;

	index index.php index.html index.htm index.nginx-debian.html;

	server_name exemple.com;

	location / {

		try_files $uri $uri/ /index.php?$query_string;
		location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|tif|tiff|css|js|htm|html|ttf|otf|webp|woff|txt|csv|rtf|doc|docx|xls|xlsx|ppt|pptx|odf|odp|ods|odt|pdf|psd|ai|eot|eps|ps|zip|tar|tgz|gz|rar|bz2|7z|aac|m4a|mp3|mp4|ogg|wav|wma|3gp|avi|flv|m4v|
		mkv|mov|mp4|mpeg|mpg|wmv|exe|iso|dmg|swf)$ {

			expires max;
			try_files $uri @fallback;
			limit_req zone=one burst=30;
		}

		location ~* ^.+\.(rss|atom|jpg|jpeg|gif|png|ico|rtf|js|css)$ {

			expires max;
		}

	}

	# pass the PHP scripts to FastCGI server listening on <IP_ADDRESS>:9000
	#
	location ~ \.php$ {

		limit_req zone=one burst=3;
		include snippets/fastcgi-php.conf;

		fastcgi_split_path_info ^(.+\.php)(/.+)$;
		fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
		include fastcgi_params;
		# With php7.0-cgi alone:
		#fastcgi_pass <IP_ADDRESS>:9000;
		#With php7.0-fpm:
		fastcgi_pass unix:/run/php/php7.0-fpm.sock;
	}
}

config/socket.php
<?php

return [

    /*
     * $httpHost HTTP hostname clients intend to connect to.
     * MUST match JS `new WebSocket('ws://$httpHost')
     */
    'httpHost'    => env('SOCKET_HTTP_HOST', 'exemple.com'),

    /*
     * Port to listen on. If 80, assuming production,
     * Flash on 843 otherwise expecting Flash to be proxied through 8843
     */
    'port'        =>  env('SOCKET_PORT', '5300'),

    /*
     * Public port for Nginx
     */
    'public_port' => env('SOCKET_PUBLIC_PORT', '443'),

    /*
     *IP address to bind to. Default is localhost/proxy only.
     *'<IP_ADDRESS>' for any machine.
     */
    'address'     => env('SOCKET_ADDRESS', '<IP_ADDRESS>'),
];

My configuration is :
upstream websocket {
server <IP_ADDRESS>:5300;
}
map $http_upgrade $connection_upgrade {
default upgrade;
'' close;
}
server {
listen 80;
listen [::]:80;
listen 443 ssl;
# *** host
server_name ***;
root /var/www/laravel/public;
index index.php index.html index.htm default.html;
    location / {
            try_files $uri $uri/ /index.php?$query_string;
    }

    location ~ ^/wsapp(/?)(.*)$ {
        proxy_pass http://websocket/$2$is_args$args;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection $connection_upgrade;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto https;
        proxy_redirect off;
    }

    # pass the PHP scripts to FastCGI server
    location ~ \.php$ {
            include snippets/fastcgi-php.conf;
            fastcgi_pass unix:/run/php/php7.0-fpm.sock;
    }

    # optimize static file serving
    location ~* \.(jpg|jpeg|gif|png|css|js|ico|xml)$ {
            access_log off;
            log_not_found off;
            expires 30d;
    }

    # deny access to .htaccess files, should an Apache document root conflict with nginx
    location ~ /\.ht {
            deny all;
    }

#...** the route of my ssl keys
ssl_certificate **;
ssl_certificate_**;
include **;
ssl_dhparam **;

if ($scheme != "https") {
    return 301 https://$host$request_uri;
} # managed by Certbot

}

Try changing
  location ~ ^/wsapp(/?)(.*)$ {
        proxy_pass http://websocket/$2$is_args$args;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection $connection_upgrade;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto https;
        proxy_redirect off;
    }

On how u done in my example

server {

	listen 443;
	location / {

		proxy_pass http://websocket;
		proxy_http_version 1.1;
		proxy_set_header Upgrade $http_upgrade;
		proxy_set_header Connection $connection_upgrade;

		proxy_set_header Host $host;
		proxy_set_header X-Real-IP $remote_addr;
		proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
		proxy_set_header X-Forwarded-Proto https;
		proxy_redirect off;
	}
}

appach server ?

i don't wnat to run websocket as standalone 443 port.
i have a site on SSL  same domain.  So my nginx configuration proxys the websocket to path.
https://example.com
Then then websocket on
https://example.com/wsapp/{routes}
i figured out how to make this work, so i'm happy now. Same domain, same nginx config, same port.
sorry for my bad english.


FancyZones Multi Monitor Snapping Issue, Jumps from Monitor 2 to 1

ℹ Computer information

PowerToys version:
PowerToy Utility: 0.27.0
Running PowerToys as Admin: Yes
Windows build number: [run "winver"] Version 20H2 OS Build 19042.630

📝 Provide detailed reproduction steps (if any)

Click to drag app, hold down the shift key to get zones
Drag the app to monitor 2 and the desired zone is highlighted
Release the mouse button to snap the app in the desired location
App Window jumps to Monitor 1 in the location that you wanted on Monitor 2

This happens with some programs only, in my example I'm using Inkscape but programs like word and Chrome seem to work just fine.
✔ Expected result
The App should snap to the location that was selected on monitor 2 when dragging and holding the shift key.
❌ Actual result
The app snaps to the location but on the wrong monitor.  Monitor 1, not Monitor 2 as desired.
📷 Screenshots
Are there any useful screenshots? WinKey+Shift+S and then just paste them directly into the form
Where I wanted it to go:

Where it actually went:

@jerems-glitch
does this happen with any application? Can you try notepad for example?

@enricogior
No, applications like Word, Chrome, Excel, notepad, outlook, virtual box etc. seem to work fine.
the applications that I have noticed it happening with so far are: Gimp, Inkscape, Razer app, caesium, Everything (Indexing/Search app)

@jerems-glitch
can you try this test: move the zone a little bit away from the screen edge.
The two monitors have the same DPI scaling %?

@enricogior
I tried the test by moving the zones away from the edges of the screen and the same thing is happening.
The two screens aren't the exact same DPI scaling.  It's a 15-inch laptop 1080P screen with a 28 inch 4k Monitor as the extended display.  The 4k 28 inch is Monitor 2 in this scenario.

@jerems-glitch
resolution and DPI scaling are two different things, I would like to verify if the problem persists when the two monitors have the same DPI scaling, in the Windows 10 Settings -> System -> Display the scaling can be set to the desired % for each monitor, can you give it a try and set the same value for your two monitors?

@enricogior
Sorry, my bad, I changed both to the same scaling and I think that was the ticket, the apps seems to be snapping correctly now.  I did have them different scaling values due to screen sizes are drastically different, I'll keep them the same from now on.
Thanks very much for your help!

@jerems-glitch
some applications are not DPI aware, that means that when we move them from one monitor to another with a different DPI scaling, they get "confused" because of that and they act in unpredictable manner.

@enricogior
That's good to know, makes sense why the more "official" applications like word and excel worked without issue.
Thanks again for your help.


update discarded_futures lint rule to not trigger when a widget expect a futur

Steps to reproduce
in the following code:
  @override
  Widget build(BuildContext context) {
    LutFoldersProvider lutFoldersProvider = Provider.of<LutFoldersProvider>(
      context,
    );
    return FutureBuilder<List<DirectoryTree>>(
      future: _getDirectoryTrees(lutFoldersProvider.lutFolders),
      builder:
          (BuildContext context, AsyncSnapshot<List<DirectoryTree>> snapshot) {
        if (snapshot.hasError) {

I get the following warning:
Asynchronous function invoked in a non-'async' function.
Try converting the enclosing function to be 'async' and then 'await' the future.

but future is expecting a Future<List<DirectoryTree>>? so this warning doesn't make sense in that case.
I will not await the futur.
So discarded_futures lint rule should be updated to allow this use case.
Expected results
see up
Actual results
see up
Code sample
Code sample
[Paste your code here]

Screenshots or Video

Screenshots / Video demonstration
[Upload media here]

Logs
Logs
[Paste your logs here]

Flutter Doctor output
Doctor output
[✓] Flutter (Channel stable, 3.19.6, on macOS 13.4.1 22F770820d darwin-x64, locale en-GB)
    • Flutter version 3.19.6 on channel stable at /Users/fractale/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 54e66469a9 (3 days ago), 2024-04-17 13:08:03 -0700
    • Engine revision c4cd48e186
    • Dart version 3.3.4
    • DevTools version 2.31.1

[!] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
    • Android SDK at /Users/fractale/Library/Android/sdk
    ✗ cmdline-tools component is missing
      Run `path/to/sdkmanager --install "cmdline-tools;latest"`
      See https://developer.android.com/studio/command-line for more details.
    ✗ Android license status unknown.
      Run `flutter doctor --android-licenses` to accept the SDK licenses.
      See https://flutter.dev/docs/get-started/install/macos#android-setup for more details.

[✓] Xcode - develop for iOS and macOS (Xcode 14.3.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 14E300c
    • CocoaPods version 1.15.2

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2022.2)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 17.0.6+0-17.0.6b802.4-9586694)

[✓] VS Code (version 1.88.1)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.86.0

[✓] Connected device (2 available)
    • macOS (desktop) • macos  • darwin-x64     • macOS 13.4.1 22F770820d darwin-x64
    • Chrome (web)    • chrome • web-javascript • Google Chrome 124.0.6367.61

[✓] Network resources
    • All expected network resources are available.

! Doctor found issues in 1 category.

@stephane-archer
If this is related to flutter_lints package you are using then, it is the utility to easily enable a specific set of existing lints but not an actual linter, so If I am guessing correctly, you are proposing to update discarded_futures lint rule, which would probably belong to dart-lang/linter repo.


Tweak rspec config

I set up a new project recently and running rspec init produced a config file with some interesting settings.

Kernel.srand config.seed - Pass RSpec's random seed to the Kernel for more reproducible tests.
expectations.include_chain_clauses_in_custom_matcher_descriptions = true - Sets if custom matcher descriptions and failure messages should include clauses from methods defined using chain
mocks.verify_partial_doubles = true - the same argument and
method existence checks that are performed for object_double are also performed on partial doubles

Both include_chain_clauses_in_custom_matcher_descriptions and verify_partial_doubles are going to be defaulted to true in RSpec 4.

:+1:


Command key related shortcut doesn't work if using an external keyboard, and swap the "command" and "option" key

Environment
MacOS 10.14.6, draw.io cloud 12.1.2
Issue Details
An external keyboard, which is a standard windows keyboard, is connected to my macbook.
I swap the "command" and "option" key with macOS build-in setting, which could be found at System Preferences -> Keyboard -> Modifier Keys, so I could execute "command" related shortcut like copy & paste with pressing the "Alt" key on the external keyboard. It works fine on all kinds of application (e.g. photoshop, chrome), except on draw.io cloud.

I'm seeing this as well on.
Environment
MacOS 10.14.6
Draw.io Cloud 12.9.14
Swapped Cmd and Opt keys on an external keyboard
Details
This behavior is not reproduced on firefox 75.0 so it may just be limited to chrome.
Reverting the keyboard to default fixes the issue, but it is cumbersome.  The original mappings are not the aligned to the mac keyboard, hence the need to swap them.

I'm also seeing this issue on Chrome and Safari. I have similar modifier key remappings via System Preferences. No repro on Firefox.
MacOS 10.14.6 (18G3020)
One helpful workaround is to use the "Duplicate" shortcut (Cmd+d), which does work.

I'll add the workaround I've found as well: select the item or group of items, then hold cmd and click and drag the selected item(s).  This produces a dupe of the selected items(s) automatically being dragged by the cursor.  So at least there's more than one option here.

Another workaround is using Karabiner-Elements  keyboard customization tool.


Fix max shards limit validation during partition creation

Summary of the changes / Why this improves CrateDB
Fixes the following scenario, also potentially fixes https://github.com/crate/crate/issues/15803:
cr>  set GLOBAL PERSISTENT "cluster.max_shards_per_node"=1;
SET OK, 1 row affected  (0.109 sec)
cr> create table t (a int) partitioned by (a) clustered into 1 shards;
CREATE OK, 1 row affected  (0.137 sec)
cr> select node['name'] ,closed,count(*) from sys.shards group by 1,2 limit 100;
+--------------+--------+----------+
| node['name'] | closed | count(*) |
+--------------+--------+----------+
+--------------+--------+----------+
SELECT 0 rows in set (0.003 sec)
cr> insert into t values (1), (2), (3);
INSERT OK, 3 rows affected  (1.677 sec)
cr> select node['name'] ,closed,count(*) from sys.shards group by 1,2 limit 100;
+---------------+--------+----------+
| node['name']  | closed | count(*) |
+---------------+--------+----------+
| Monte Talvena | FALSE  |        3 |
| Gran Paradiso | FALSE  |        3 |
+---------------+--------+----------+
SELECT 2 rows in set (0.061 sec)

which will now be rejected(to be precise, rejected because 3 primary shards were to be created that was over the limit):
cr> insert into t values (1), (2), (3);
SQLParseException[Validation Failed: 1: this action would add [3] total shards, but this cluster currently has [0]/[2] maximum shards open;]

Still does not address below scenario(that tries to create 2 primaries and 2 replicas where the number of primaries are under the limit):
cr> create table t (a int) partitioned by (a) clustered into 1 shards with (number_of_replicas = '0-1');
CREATE OK, 1 row affected  (0.151 sec)
cr> insert into t values (1), (2);
INSERT OK, 2 rows affected  (1.596 sec)
cr> select node['name'] ,closed,count(*) from sys.shards group by 1,2 limit 100;
+--------------+--------+----------+
| node['name'] | closed | count(*) |
+--------------+--------+----------+
| Ebenstein    | FALSE  |        2 |
| Hochwipfel   | FALSE  |        2 |
+--------------+--------+----------+
SELECT 2 rows in set (0.178 sec)

=> auto expanding replicas are not handled. Something like https://github.com/crate/crate/pull/15805 is needed.
Checklist

[ ] Added an entry in the latest docs/appendices/release-notes/<x.y.0>.rst for user facing changes
[ ] Updated documentation & sql_features table for user facing changes
[ ] Touched code is covered by tests
[ ] CLA is signed
[ ] This does not contain breaking changes, or if it does:

It is released within a major release
It is recorded in the latest docs/appendices/release-notes/<x.y.0>.rst
It was marked as deprecated in an earlier release if possible
You've thought about the consequences and other components are adapted
(E.g. AdminUI)

Thanks for the fix @jeeminso. Took over in https://github.com/crate/crate/pull/15843