Update notebook with simple states example

Update https://github.com/ModECI/MDF/blob/main/examples/SimpleExample.ipynb with a section 4 introducing states.

[ ] create a new node
[ ] add stateless parameter increment=1 and stateful parameter count = count + increment & an output port
[ ] show graphic
[ ] execute once print the output
[ ] show how to execute 5 times (chaging increment=10 say) and print output
[ ] explain steps and concepts along the way with links to docs

@Ivy8127 this will set up nicely a section 5 on conditions reusing this node...

@Ivy8127 Branch here for you to work on: https://github.com/ModECI/MDF/tree/notebook_updates

Thanks @Ivy8127


LayerSwitcher list do not refresh when layer add/remove event happen

FYI @martyrion

Hey @Zemledelec! I am looking into it. Are you sure, that adding a layer doesn't work? In the layerSwitcher.html, I think it works.

@martyrion you can try add/remove layer after control is created.  also, previously, control can be created in globe constructor, now it has issue if doing so.

Also, there is no scroller now

Fixed remove/add baseLayers only.


use requestContext.addZuulRequestHeader to set chinese value, then get the header is messy code

ctx.addZuulRequestHeader("userName",claims.get("userName").toString());
userName is chinese
@RequestMapping(value = "/count", method = { RequestMethod.GET, RequestMethod.POST })
public RSResult count(@RequestHeader("userName") String name, @RequestBody AdminPo cond) {
//name is messy code;
}
how can i resolve it?

Please learn how to properly format code and logs.
https://stackoverflow.com/questions/4400678/what-character-encoding-should-i-use-for-a-http-header
Maybe use base64 encoding?

@spencergibb thank you ,I have resolve it according to your guidance!


chore(litmus-portal): Integrate kubera-ui theme provider

Proposed changes
Add base styles for integrating kubera-ui theme-provider into litmus-portal.
Types of changes
What types of changes does your code introduce to Litmus? Put an x in the boxes that apply

[ ] New feature (non-breaking change which adds functionality)
[ ] Bugfix (non-breaking change which fixes an issue)
[x] Breaking change (fix or feature that would cause existing functionality to not work as expected)
[ ] Documentation Update (if none of the other choices applies)

Checklist
Put an x in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code.

[x] I have read the CONTRIBUTING doc
[x] I have signed the commit for DCO to be passed.
[x] Lint and unit tests pass locally with my changes
[ ] I have added tests that prove my fix is effective or that my feature works (if appropriate)
[ ] I have added necessary documentation (if appropriate)

Special notes for your reviewer:
Colours might look off in certain cases as custom theme in no longer used.

@saswatamcode build has failed please run npx browserslist@latest --update-db

@saswatamcode build has failed please run npx browserslist@latest --update-db

@saswatamcode build has failed please run npx browserslist@latest --update-db

This is just a warning, the build has failed due to the time limit being exceeded. It required more time to complete the optimized build because of the size of the project currently. Generally, it times out in 12 minutes or so, we need to increase the timeout to 20 minutes like we did in Chaos.

@saswatamcode build has failed please run npx browserslist@latest --update-db

This is just a warning, the build has failed due to the time limit being exceeded. It required more time to complete the optimized build because of the size of the project currently. Generally, it times out in 12 minutes or so, we need to increase the timeout to 20 minutes like we did in Chaos.


internal error: entered unreachable code: We should never have decoded calldata for contract creations

Component
Forge
Have you ensured that all of these are up to date?

[X] Foundry
[X] Foundryup

What version of Foundry are you on?
forge 0.2.0 (93f64c7 2023-10-27T00:24:49.496418315Z)
What command(s) is the bug in?
forge test
Operating System
Linux
Describe the bug
Multiple times during CI runs I face the following error (example)
Running 1 test for test/invariants/CreateX_Invariants.t.sol:CreateX_Invariants
[PASS] statefulFuzz_EtherBalance() (runs: 5000, calls: 75000, reverts: 74998)
The application panicked (crashed).
Message:  internal error: entered unreachable code: We should never have decoded calldata for contract creations
Location: crates/evm/traces/src/lib.rs:262

I'm doing an invariant test on my create factory here. The issue as it seems is that for certain initCode inputs (i.e. decoded calldata) it panics. It's getting pretty annoying lately tbh. Any way to disable this in my test environment?

@Evalir what changed with trace decoding?
https://github.com/foundry-rs/foundry/blob/cc760aac6e971ecc89b0f90efbb38f9bb49a672d/crates/evm/traces/src/lib.rs#L262-L262
this unreachable doesn't look sound to me

@mattsse we'll have to triage—this unreachable was already there from the previous implementation. Possible that the issue might come from another place

looks like we're decoding init code now, so I'm removing the unreachable
https://github.com/foundry-rs/foundry/pull/6141
this shouldn't be there anyway

any other issues we need to fix asap @pcaversaccio ? :)
sorry for the inconveniences lately, lots of moving parts atm -.-

triggering new release once merged

any other issues we need to fix asap @pcaversaccio ? :)
sorry for the inconveniences lately, lots of moving parts atm -.-

Well you might look at a similar issue I reported some months ago: https://github.com/foundry-rs/foundry/issues/5629. Very weird behaviour.

any other issues we need to fix asap @pcaversaccio ? :)
sorry for the inconveniences lately, lots of moving parts atm -.-

Well you might look at a similar issue I reported some months ago: #5629. Very weird behaviour.

See the debugging info I added there.

okay that's the same bug, yeah.
so the bug here is actually pretty simple that we just didn't handle the case where we were able to decode the constructor calldata
this panic is now removed with #5629, so no more crashes here

okay that's the same bug, yeah.
so the bug here is actually pretty simple that we just didn't handle the case where we were able to decode the constructor calldata
this panic is now removed with #5629, so no more crashes here

you mean https://github.com/foundry-rs/foundry/pull/6141

Amazing! Is this closeable @pcaversaccio ?

Amazing! Is this closeable @pcaversaccio ?

one sec -currently running my CI with the latest release

LGTM - thx for fixing.


How do I set UserInfo anonymousId?

Describe the bug
I would like to set the anonymousId for a user, preferably when calling identify, but there is no overload of that method that allows this. Is there any other way to do this I am missing?
I have considered setting this in the EnrichmentClosure, but this only changes the anonymousId for the identify event. Other events still contain the random anonymous id generated internally by this lib.
To Reproduce
n/a
Expected behavior
I should be able to set anonymousId for a user from the client.
Screenshots
n/a
Platform (please complete the following information):

Library Version in use: 1.16.3
Platform being tested: Android
Integrations in use: Amplitude

Additional context
n/a

hi @nwagu , you can do this via a plugin. please refer to this comment for example. if you'd like the anonymousId to stay once identify is called, you'd be doing something similar to the following:
// Pseudo code below
class AnonymousIdPlugin : EventPlugin {
    anonymousId: String

    identify(event) {
        // update anonymousId with the value from event
        anonymousId = event.properties.anonymousId
    }

    execute(event) {
        // let super run first, so identify is called before overwriting anonymousId
       super.execute(event)

        // overwrite anonymousId with local variable
       event.anonymousId = anonymousId
    }
}

Thanks, I did not know I could do this.
But then this solution only modifies events, it does not change the actual userInfo, so calling something like analytics.anonymousId() still returns the internally generated anonymousId. Is there any reason why we should not be able to set the userInfo anonymousId?

@wenxi-zeng could you please review my PR and see if it can be merged? It would be more convenient for us to set the anonymousId directly instead of using a plugin

hi @nwagu sorry for delayed response. I have brought this to our team. the anonymousId is also used by the backend for other things. we need more discussion and evaluation to make this API changes across the board. in the meanwhile, please use the plugin to overwrite anonymousId and retrieve it via an extension function through your plugin instance. something like:
fun Analytics.myAnonymousId(): String {
    return anonymousIdPlugin. anonymousId;
}

Okay. Could I get more info (maybe link to a doc) about what the anonymous id is used for in the backend? This is just so that I am clear what overwriting it implies @wenxi-zeng

@nwagu one of the known use case is de-duping on backend. changing the anonymousId might not have any impact since we do have customers doing it via plugins and we hear no complains so far. we just have to be very cautious on making this change, since it's a public API and we need to evaluate the potential risk.


MD select not rendering properly

I tried using select with Angular 4. It's not rendering options as it is displayed in the documentation. Options are rendered at the bottom of the page.

Please use the issue template and/or let's keep GitHub issues for bug reports / feature requests. Better avenues for troubleshooting / questions are Stack Overflow, gitter, mailing list, etc.

I thought it's an issue with select in Angular Material. Because each and every thing in angular material is working fine except select.

It's hard to tell what is going on from the issue description. Can you post an example? You can use this as a template.

Closing this issue as it does not follow the issue template. Please file a new issue that follows the template, which gives the team the information needed to investigate.


Is there an way to set default value as empty instead of 0 ?

If you set the value to null, it should be set as empty. Are you able to post a use-case where it's showing 0?

Closing due to inactivity

I managed to try it here and I notice that it clears the value once out of range. What do you think about the idea of setting the max value instead so it makes explicit what max value is? Same for min. In my use case, this would be really useful, if not by default maybe through a property.


New AWS SSO config format

Describe the bug
This plugin is not compatible with the new default AWS SSO sessions format
To Reproduce
Steps to reproduce the behavior:

Define a new sso session profile with aws configure sso
Try to deploy a serverless stack with this plugin and the new profile
The plugin will try to use the default profile.

Expected behavior
The plugin loads the right profile.
Desktop (please complete the following information):

OS: MacOS
Version v1.1.2
Serverless Version 3.26.0

Hi -
Thanks for reporting this (and sorry for the slow response!).
Annoyingly it's a bug I'm aware of. Although in this case (unlike #9), it is something that has some support in newer versions of v2 of the aws-sdk (i.e. doesn't require a re-write to v3).
I'll see what I can do!

No worries!
The workaround if anyone is wondering: when running aws configure sso, just press Entrer without writing anything for the first prompt (SSO session name (Recommended):).

@aldebout Unfortunately that didn't work for me.

@aldebout your tip is just reverting to legacy configuration mode

@aldebout When I have already created a named session, running aws configure sso again defaults to that name instead.
My understanding is that you try to create a default session similar to [profile default], I want to try that but I have never seen how a default session looks like in ~/.aws/config.
Is it called [sso-session default], or is it something else?

This may be addressed in v1.2.1 - feel free to re-open if not.

@thomasmichaelwallace There is a small issue when using Serverless Compose. When multiple services try to open up browser window for SSO authentication, only one would actually open.
Running this again would actually fix it because it reuses the now active sso session, but this bug renders CI/CD impossible.

@thomasmichaelwallace using sso-session + sso_session still does not work with 2.0.0 (AWS provider credentials not found.); reverting to the legacy SSO format resolves things


picture upload doesn't work

Picture for upload can be selected from explorer, but only a selected frame is visible in GUI after "uploading" (see attached pic).

After Discussion with @fkleedorfer:
Images will be uploaded as part of the message-passing for the create process. Images will be uploaded as separate documents/graphs so that e.g. matchers can choose not to download the images to save on traffic.

Currently we've got code using Media-Ont. However it's designed for multimedia applications (read: video+sound). We could switch to <schema.org>'s ImageObject which is conceptualized for images as the name implies.

The images can be embedded as literals as follows: "/9j/4AAQSkZJRgABAQAAAQABAAD{...}"^^xsd:base64Binary

More ontologies:
http://dublincore.org/documents/dcmi-terms/index.shtml#terms-format

implemented version:
{
     // attachment 1 of N
    '@id': 'http://.../resource/attachment/3827681755765819400',
    'cnt:ContentAsBase64' : {
         'cnt:bytes': 'iVBORw0{...}ORK5CYII=',
         'msg:contentType': 'image/png'
    }
}

with the namespace:
'cnt' : 'http://www.w3.org/2011/content#'

close since this is a problem within the old ui


[COMMUNITY] New committer -- leandron

Dear community:
Please join us to welcome @leandron as a new committer. Leandro's most notable contribution has been on the TVM command line driver.

Commits History
Code Review
Community Forum Summary

Thierry

Congratulation @leandron
Merged now @tmoreau89


Research the impact of various fields existing in the Grafana objects

Grafana gets mad if you try to post an object with an old version.  Just blindly strip the version field from any objects.

This issue was never fixed.  I must have accidentally closed it.
After some research we are taking things a whole new direction.  Instead of using the grafana API we will be using grafana object provisioning:
http://docs.grafana.org/administration/provisioning/
Refactor all the things!

Sadly provisioning won't work b/c dashboards are the only object that Grafana will repeatedly scan for updates.  All other object types are only read on startup.

A set of patterns for updating grafana objects that makes sense and is consistent across objects

All objects are now maintained through their respective ids.  For alert-notifications and datasources this is the integer "id" field.  For dashboards this is the string "uid" field.
We are now stripping id and version from all Grafana objects but leaving uid.  UID is intended to be a cross grafana install method of tracking the same dashboards and will be left alone.

Also spend some time understand the "name" field and what happens we change it on the Grafana side or in the k8s objects.

This is now handled correctly.  The new pattern pins objects to "ids" and changing the names on either side is inconsequential.

Documentation in the readme discussing these patterns and how to manage your grafana objects in k8s.

Not really necessary.  Things just work now.  Previously there were weird caveats and corners.

Tests that confirm the appropriate behavior is followed.

Still thinking about this.  Perhaps there are additional tests that could be fixed.

All tests passing.  Going to merge this in.  Need to address tests generally as part of https://github.com/number101010/kubernetes-grafana-controller/issues/13

Closing with merge of: https://github.com/number101010/kubernetes-grafana-controller/tree/issue-17


Integrate virus scanning of uploaded files

Use a scanner such as Clam AV. This helps prevent malicious users from uploading malware for other users to download.

Resolved by #1712


state of this project ?

Hi there
we're looking for a lightweight wysiwyg editor for angular and this project seems like a great start, but I note there hasn't been much activity for a while and we can't install with versions of angular > 9.. and there are unmerged PRs.
Is it worth us making a PR to bring this project up to angular 16 (and merging the disabled state) or should we consider the project 'archived' .. any feedback would be appreciated.
thanks !
-ivan

It seems dead to me, we use it in our company, but due to lack of maintenance, I ended up creating my own WYSIWYG editor version. https://ngx-simple-text-editor.netlify.app/

oh wow ok that looks cool probably would have used it if it existed at the time we were looking !
we ended up using NgxEditor, (built on ProseMirror) , which meant we could have the plugins that come with prosemirror, noteably "@mentions" (autocomplete) which we needed also.. so far so good.
good luck !

Hi all! Yes sadly you should probably consider this projet as not actively maintained. I've started work on updating to the latest Angular version and move to standalone components but I don't have much time to dedicate to this.
I'll still try to push my work once it's done but even so I don't expect to be able to do much more after that.
@Raiper34 your editor looks great!


bug: Panic on 32-bit platforms

There are a number of field alignment issues in this package, which cause panics on 32-bit platforms. I built a quick Docker image to run the tests:
Dockerfile.test:
FROM golang:1.22

WORKDIR /app

COPY . .

$ docker build --platform=linux/386 -t test_32bit -f Dockerfile.test .
[...]
$ docker run --platform=linux/386 --rm test_32bit go test ./...
?       github.com/hack-pad/hackpadfs/fstest    [no test files]
?       github.com/hack-pad/hackpadfs/internal/mounttest        [no test files]
?       github.com/hack-pad/hackpadfs/internal/assert   [no test files]
?       github.com/hack-pad/hackpadfs/internal/pathlock [no test files]
?       github.com/hack-pad/hackpadfs/keyvalue/blob     [no test files]
--- FAIL: TestChmod (0.00s)
panic: unaligned 64-bit atomic operation [recovered]
        panic: unaligned 64-bit atomic operation

goroutine 23 [running]:
testing.tRunner.func1.2({0x81d5b80, 0x82378b0})
        /usr/local/go/src/testing/testing.go:1631 +0x2a3
testing.tRunner.func1()
        /usr/local/go/src/testing/testing.go:1634 +0x434
panic({0x81d5b80, 0x82378b0})
        /usr/local/go/src/runtime/panic.go:770 +0x103
runtime/internal/atomic.panicUnaligned()
        /usr/local/go/src/runtime/internal/atomic/unaligned.go:8 +0x2d
runtime/internal/atomic.Load64(0x886609c)
        /usr/local/go/src/runtime/internal/atomic/atomic_386.s:225 +0x10
github.com/hack-pad/hackpadfs/keyvalue/blob.(*Bytes).Len(0x8866090)
        /app/keyvalue/blob/bytes.go:56 +0x26
[...]

This particular failure is due to the blob.Bytes type, which is misaligned:
type Bytes struct {
	bytes  []byte		// 24 bytes on 64-bit, 12 bytes on 32-bit
	length int64		// 8 bytes
	mu     *sync.Mutex	// 8 bytes on 64-bit, 4 bytes on 32-bit
}

If we run fieldalignment on this, we see (on 64-bit):
$ fieldalignment ./keyvalue/blob/
/Users/hairyhenderson/go/src/github.com/hack-pad/hackpadfs/keyvalue/blob/bytes.go:23:12: struct with 40 pointer bytes could be 16

And on 32-bit:
$ go install golang.org/x/tools/go/analysis/passes/fieldalignment/cmd/fieldalignment@latest
[...]
$ fieldalignment ./keyvalue/blob/
/app/keyvalue/blob/bytes.go:23:12: struct with 24 pointer bytes could be 8

So it's not optimally-aligned, but that's not actually the root issue. The root issue is a known bug on 32-bit systems on many atomic.* functions, namely:

On ARM, 386, and 32-bit MIPS, it is the caller's responsibility to arrange for 64-bit alignment of 64-bit words accessed atomically via the primitive atomic functions (types Int64 and Uint64 are automatically aligned). [...]

Thankfully, fixing this automatically with fieldalignment works fine (it moves mu to the beginning so we get a 32-byte or 16-byte offset before length, thus aligning length on a 64-bit/8-byte boundary as it needs to be).
I'm going to issue a PR that enables the fieldalignment linter (which is built into the govet linter in golangci-lint), and fixes the found problems.

Thank you for the issue and PR! I’ll take a look soon.
I’ll be honest, I didn’t realize things like this weren’t handled automatically by Go. Really appreciate you bringing this to our attention.

@JohnStarich no worries. I've got a PR in progress on my fork https://github.com/hairyhenderson/hackpadfs/pull/4 that I'll re-upstream once I get fully working. There's a bunch of other lint failures that'll need to be fixed separately though. I started on that a few days back in #42, but that was a sort of half-hearted effort 😉

@JohnStarich ok, I've got #44 up and ready to review - it fixes the bug 😁

Thanks again for your time and effort on this one! Your change has been released in v0.2.2 :rocket:

Thanks for the quick review and release @JohnStarich! 🙇♂


pcf dev very slow to start

I'm running cf 6.34.0, pcf dev 0.28 on a Windows 7 PC with 8GB RAM.
I've used all the defaults following https://pivotal.io/platform/pcf-tutorials/getting-started-with-pivotal-cloud-foundry-dev/introduction
When I run cf dev start it takes 45 minutes to start up.
Unfortunately this is unusable, even as a trial to get familiar with PCF.
$ date
Sun, Jan 14, 2018  1:18:05 PM

$ cf dev start
Using existing image.
Starting VM...
Provisioning VM...
Waiting for services to start...
8 out of 58 running
8 out of 58 running
8 out of 58 running
8 out of 58 running
8 out of 58 running
8 out of 58 running
10 out of 58 running
17 out of 58 running
28 out of 58 running
35 out of 58 running
46 out of 58 running
58 out of 58 running
 _______  _______  _______    ______   _______  __   __
|       ||       ||       |  |      | |       ||  | |  |
|    _  ||       ||    ___|  |  _    ||    ___||  |_|  |
|   |_| ||       ||   |___   | | |   ||   |___ |       |
|    ___||      _||    ___|  | |_|   ||    ___||       |
|   |    |     |_ |   |      |       ||   |___  |     |
|___|    |_______||___|      |______| |_______|  |___|
is now running.
To begin using PCF Dev, please run:
   cf login -a https://api.local.pcfdev.io --skip-ssl-validation
Apps Manager URL: https://apps.local.pcfdev.io
Admin user => Email: admin / Password: admin
Regular user => Email: user / Password: pass

$ date
Sun, Jan 14, 2018  2:02:58 PM

I've been waiting close to an hour and my machine has 32Gb of memory.

After an hour wait it failed:
kdvolder@dellicioso:~$ date && cf dev start && date
Wed Feb 20 16:10:08 PST 2019
Using existing image.
Starting VM...
Provisioning VM...

FAILED
Error: failed to provision VM: Process exited with: 1. Reason was:  ().

@kdvolder You're using an outdated version of the CF Dev cli. Please upgrade:
$ cf uninstall-plugin cfdev
$ cf install-plugin -r "CF-Community" cfdev
$ cf dev version
CLI: 0.0.13

Tried. But this happens:
$ cf uninstall-plugin cfdev
Plugin cfdev does not exist.
FAILED

Checking version of cf dev I have:
$ cf dev version
$ cf dev version
PCF Dev version 0.30.0 (CLI: 850ae45, OVA: 0.549.0)

Version 0.30.0 is newer than 0.0.13? At least it is a higher number isn't it?

I figured the name of the plugin is actually 'pcfdev' so unistalled that. Then...
$ cf install-plugin -r "CF-Community" cfdev
Searching CF-Community for plugin cfdev...
Plugin requested has no binary available for your platform.
FAILED

So what now? (platform is Linux, Ubuntu 18.04 BTW).
Strange thing is the version 0.30.0 I had before was working fine until not too long ago when it seemed to be getting slower and slower starting up. I have since done a few rounds of cf dev destroy to try and clear that up, but problem only seems to be getting worse.

@kdvolder Very sorry about that. version 0.30.0 stopped working recently because the self-signed certificates inside the VM image expired. You can better track that issue here: https://github.com/pivotal-cf/pcfdev/issues/365
As of right now, linux support is not yet available but is actively being worked on.

Okay thanks for the info. Unfortunately that means I don't have any practical way to do testing for some of the stuff I'm working on. So I hope there will be a solution for this soon.
BTW: If the version of pcf dev is indeed old, then there is a problem with instructions for setting it up here: https://docs.pivotal.io/pcf-dev/install-linux.html


Show stack traces for rendering errors that arise from user code

Description
Currently, errors that happen during evaluation show a stack trace, but errors that happen in user code during rendering (using functions such as cite or locate) do not.
Improving this would require storing a stack trace for each content node that can fail to render.
Whenever an error occurs during evaluation, the error message should show a stack trace showing the calls that led to this error. To minimize screen space usage, each entry should consist of a single line: at <function name> (<file>:<line>:<col>).
Currently, Vm doesn’t keep track of the information needed to generate a stack trace. We could make it do so using one of the following methods:

rename Vm to Frame and make Vm a stack of Frames, plus a Vec<StackTraceEntry> that is pushed and popped on function calls and returns
add a RefCell<Vec<StackTraceEntry>> field to Vm
add an Arc<StackTrace> field to Vm, where StackTrace stores a StackTraceEntry for the current frame and an Option<Arc<StackTrace>> for the rest of the trace. This makes the trace a linked list with shared nodes, which requires some pointer chasing to traverse but incurs less cost than the other approaches to store these traces in Content nodes (see below).

Use Case
Make it easier to debug these types of errors.
Related issues: #1702
Possible drawbacks:

adds extra complexity
incurs extra overhead

This seems like a wrong description for the issue.
error: cannot divide by zero
  ┌─ /tmp/Typst/a.typ:4:2
  │
4 │   1/0
  │   ^^^

help: error occurred in this call of function `bar`
  ┌─ /tmp/Typst/a.typ:8:10
  │
8 │   let a = bar(key)
  │           ^^^^^^^^

help: error occurred in this call of function `foo`
   ┌─ /tmp/Typst/a.typ:12:1
   │
12 │ #foo("invalid")
   │  ^^^^^^^^^^^^^^

When the error is something like 1/0, a full stack trace is shown. The problem is cite() does not immediately check for the validity while evaluating, instead it postpones it to "render phase".
A similar issue can be seen for other delayed-evaluation functions such as locate:

#let bar() = {
  //1/0  // ← use this stack trace is shown
  locate(x => 1/0)
}

#let foo() = {
  bar()
}

#foo()

Ah, never bothered trying to see if this feature already existed! I’ll change the description.

On another note, it would be really useful to get a function that checks if a citation exist, that way library writer can give meaningful error message. (this must necessarily be a delayed function)

If we’re adding delayed functions, would it be worth having an async/await-like feature? Something like
#let foo(key) = async {
  if await has-cite-key(key) {
    cite(key)
  } else {
    panic("cite key " + key + " missing")
  }
}

foo("valid") // implicitly creates a delayed content node

The idea about the "async-await syntax" was mentioned in https://github.com/typst/typst/issues/267.
About has-cite-key idea, perhaps another design is cite(key, onerror: () => panic("citation "+key+" passed in function foo() does not exist!")) which covers the most common case of giving meaningful error message when the cite does not exist.

About has-cite-key idea, perhaps another design is cite(key, onerror: () => panic("citation "+key+" passed in function foo() does not exist!")) which covers the most common case of giving meaningful error message when the cite does not exist. (of course this isn't fully-functional like a proper has-cite-key)

I think that's a bad idea, it should be typst's responsibility to report better error messages in general. Showing the key in the error message is a good start, but this extends to other error messages too. Especially in complex documents and packages, debugging becomes quote a pain when things like introspection are involved, as the culprit is often hard to identify without printing some of the inputs to a function that took generated or queried inputs.

This can be solved with the context proposal. The context can carry the stack trace where it was created and prepend it to the local stack traces resulting from it's evaluation.

About has-cite-key idea, perhaps another design is cite(key, onerror: () => panic("citation "+key+" passed in function foo() does not exist!")) which covers the most common case of giving meaningful error message when the cite does not exist. (of course this isn't fully-functional like a proper has-cite-key)

I think that's a bad idea, it should be typst's responsibility to report better error messages in general. Showing the key in the error message is a good start, but this extends to other error messages too. Especially in complex documents and packages, debugging becomes quote a pain when things like introspection are involved, as the culprit is often hard to identify without printing some of the inputs to a function that took generated or queried inputs.

The two parts are not exclusive. Typst can report better error messages, and anyone who write a wrapper function like foo() can also explain what's wrong with the invocation of foo() itself instead of the invocation of cite() buried inside foo()..

The two parts are not exclusive. Typst can report better error messages, and anyone who write a wrapper function like foo() can also explain what's wrong with the invocation of foo() itself instead of the invocation of cite() buried inside foo()..

I should have been more clear about what I meant, I think adding a callback parameter like this is a bad idea. I had a few discussions from the discord in mind.
There have been proposals of adding try expressions to allow trying a piece without panicking. That would allow a more general error handling mechanism for something like foo.
#let foo(arg) = {
  let x = try cite(arg)
  assert.ne(x, none, message: "key '" + arg +"' was not found in bib")
  ...
}

Although like I said the key should be included in the cite error message by default anyway, so the example is a bit contrived, but it illustrates the point.

Problem is, cite is an "async" function, where whether the error exist can only be decided when the resulting content block is rendered.
If you want something like your syntax, you'd need https://github.com/typst/typst/issues/267 first.

I guess that's a valid concern.
I think, while the evaluation of cite is delayed by the Vt similar to a custom locate callback, it will return default content during the early iterations and proper content/an error once the bibliography elment and the key is found (or not).
So, the try syntax would need to know whether the expression it evaluates is such a contextual expression and in those cases bind itself into the delayed execution so to speak. Then it should, in theroy, only come into play once the contextual expression is fully evaluated. This is probably why erros are currently ignored for delayed execution if they are resolved later on.

Unfortunately, it is a bit trickier than I thought in https://github.com/typst/typst/issues/1747#issuecomment-1762012620 because accessing the stack trace where the context is created is an impure operation, which isn't really allowed.


The ruleset file does not exist error

I upgraded to the latest version and I got the error:
SyntaxError: Unexpected token 'E', "ERROR: The"... is not valid JSON
["ERROR" - 9:57:44 AM] ERROR: The file "Sites/dev/app/public/wp-content/plugins/example/phpcs.xml" does not exist.

There is a space in my project path. The full path is: /home/dani/Local Sites/dev/app/public/wp-content/plugins/example/phpcs.xml
Vscode version: 1.92.2
OS: Fedora 40
Local dev env: Local by FlyWheel
Extension version: 0.0.19

I got the same issue.

Same issue, switching back to the previous version fixed it for me at the moment.

Confirmed. Switching back to the previous version works fine

This seems to be the same issue as #136 I've opened a PR there to fix the issue, looking for folks on Windows to help test, otherwise I'll test on Windows next week.


[WIP] Add min & max project size settings

Supersedes #80337 and closes godotengine/godot-proposals#7586
So far this includes only changes of the superseded PR

You need to co-author the original author as you are using their code, add the following at the end of your commit:

co-authored-by: Name <email>

Get the details from their commit author line 🙂

You need to push with git push --force to update the branch, or it'll merge both, and you need to add the full details, like so:
Add min & max project size settings

co-authored-by: reptofrog<EMAIL_ADDRESS>
Remember the empty line, also remove the feat and start with capital letter

This is silly, and I apologize for added unnecessary work, but can my email here be changed to<EMAIL_ADDRESS>😅
I no longer use that other email address (my bad!) and cannot be reached there.

@reptofrog Make sure that other email is connected to your GitHub account, otherwise it won't count towards your contributions. reptofrog<EMAIL_ADDRESS>is what you used with your own commits.

By the way, I think the original commit message was nicer, so I'd prefer if we amended it here :)
Add minimum / maximum window size project setting

Kinda caught up with few things right now, will make sure to finish this by the end of next week 🙏🏼

Hi everyone, sorry for the delay, I'm back.
Although I'm encountering a weird issue where the build I see doesn't seem to have the code fully applied?

I can't see settings like display/window/size/window_minimum_width that I defined, and for some reason window override width / height is now set to 1 by default?
Am I building the project wrong, or is something else an issue here? Could somebody just confirm is this just on my end, or is it something else? I'm running executable with following arguments:
dev_build=yes platform=linuxbsd target=editor -j8

Any update when this will be pushed?

Any update when this will be pushed?

This PR needs a rebase first. Also, we are currently in feature freeze for 4.3, so any new features can only be merged in 4.4 at the earliest.

@Calinou sorry for the mention, but what does this PR need to make it to 4.4? What do I need to do?

@Calinou sorry for the mention, but what does this PR need to make it to 4.4? What do I need to do?

You need to rebase to fix merge conflicts, as this PR currently still has merge conflicts.


Clean up "many" relational descriptors.

buildbot, test this please.

@akaariai I think this is as green as Jenkins will let me have today (no test failures but 2 red dots).

buildbot, test this please.

@timgraham I've reworked a lot of comments and docstrings (in a separate commit), could you take a look at it when you have some time?


[VL] Fix offload input_file_name assert error

What changes were proposed in this pull request?
The project with input_file_name expression may have multiple data source by union all, reference:
https://github.com/apache/spark/blob/e459674127e7b21e2767cc62d10ea6f1f941936c/sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/rules.scala#L519
For example, pulls the protocol and metadata of the delta lake table from the files
https://github.com/delta-io/delta/blob/074ce173bb070ed60f10e98d3ef7dcc04cc2a744/core/src/main/scala/org/apache/spark/sql/delta/Snapshot.scala#L209
How was this patch tested?
UT.

@zhztheplayer cc @gaoyangxiaozhu

@zhztheplayer could you help merge ?

Thank you all for review. Does this bug fix need to be merged into branch-1.2? @zhztheplayer

Sounds fair. Would you please open a PR for that? Thanks.


python310Packages.aioamqp: 0.14.0 -> 0.15.0

Description of changes
https://github.com/Polyconseil/aioamqp/blob/master/docs/changelog.rst#aioamqp-0150

Things done

Built on platform(s)

[x] x86_64-linux
[ ] aarch64-linux
[ ] x86_64-darwin
[ ] aarch64-darwin

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

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

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

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

[x] Fits CONTRIBUTING.md.

Result of nixpkgs-review pr 172233 run on x86_64-linux 1

2 packages built:

python310Packages.aioamqp
python39Packages.aioamqp


Update KVS Schema and utilize a new feature

Overview
I updated KVS schema from 3.0.0 to 5.0.0.
New feature: Default value
Some features were introduced in this update. A change that affects to this project is Support default value. If a field is difined as a constant, KVS schema reads and assigns the value to the generated class as a default value like below.
// Schema class
@Table(name = "io.github.droidkaigi.confsched_preferences")
public abstract class DefaultPrefsSchema {
    @Key(name = "notification_setting")
    final boolean notificationFlag = true;

// Generated class
  public boolean getNotificationFlag() {
    return getBoolean("notification_setting", true); // A constant value we set is specified.
  }

So we don't have to specify default values expressly.
prefs.getNotificationFlag(); // It returns true if `notification_setting` is not stored.
prefs.getNotificationFlag(true); // Specifying default value is also fine.

@konifar Please review 🙏

👀 Thanks! I'll review it after going back home.

👀

👀

LGTM
Thanks for great update! 🆒


CDC Debezium Connector is generating unwanted topics

When using CDC Debezium Connector with PostgreSQL we need to specify which tenant, namespace and topic we're using to persist change logs. However, Debezium is generating unwanted topics on both specified and "public" tenants.
I'm using the following configurations in order to create a CDC Source Connector:
tenant: "limadelrey"
namespace: "first"
name: "first-limadelrey-source-connector"
topicName: "first-outbox-topic"
archive: "connectors/pulsar-io-debezium-postgres-2.4.1.nar"

parallelism: 1

configs:
  database.hostname: "first-service-db"
  database.port: "5432"
  database.user: "postgres"
  database.password: "postgres"
  database.dbname: "first"
  database.server.name: "first"
  table.whitelist: "limadelrey.outbox"
  pulsar.service.url: "pulsar://<IP_ADDRESS>:6650"

What I would expect to see the generation of two topics on the tenant/namespace combination that I specified before:
Tenant/Namespace/Topic
limadelrey/first/first-limadelrey-source-connector-debezium-offset-topic
limadelrey/first/first-outbox-topic
However, Debezium is generating the following topics (one seems to be the output of database.server.name + table.whitelist properties):
Tenant/Namespace/Topic
limadelrey/first/first-limadelrey-source-connector-debezium-offset-topic
limadelrey/first/first-outbox-topic
limadelrey/first/first.limadelrey.outbox
public/default/first-outbox-topic

Please set topicName
topicName: "limadelrey/first/first-outbox-topic"

@limadelrey Have you tried what @tuteng suggested?

Any update on this issue @limadelrey. I would like to close this issue first and reopen it if needed.

Hi @codelipenghui,
I haven't been using Apache Pulsar for a while now. I assume that @tuteng's suggestion solves the problem.


[DICOM] permanent import of dicom fails, tempo data saved corrupted

Doing tests: on MUSICardio binary and package, but not on medInria, there are 2 bugs with DICOMS:
Permanent import

Browser -> Import on a DICOM directory -> "Could not save data file" message error, but no log.

Temporary import

Browser -> Temporary Import a DICOM directory -> OK
Open a workspace (Visualization for instance), right click on the data -> Save:

DEBUG - mer. oct. 28 15:54:46 2020 - "medDatabaseNonPersistentImporter created with uuid: \"{c58af7c3-ead9-4ea5-b961-a6b61935c544}\""
DEBUG - mer. oct. 28 15:54:46 2020 - "Chosen directory contains  1  files"
DEBUG - mer. oct. 28 15:55:39 2020 - "onMenuSaveClicked() after storeNonPersistentSingleDataToDatabase"
DEBUG - mer. oct. 28 15:55:39 2020 - "index (2, 100000000, 100000000, 100000000)"
WARN  - mer. oct. 28 15:55:39 2020 - "\"Unable to write image /1606d1aa-28b7-41f3-9c72-e6737e83a7cf/479ac597-a44a-4bbc-945b-f05dddfd9e89.mha\""
WARN  - mer. oct. 28 15:55:39 2020 - "Either there is nothing to write or a problem occured when writing."

Open the saved data in the view -> error. Example of log:

DEBUG - mer. oct. 28 14:40:55 2020 - "medDatabaseReader::run:  \"No data found at path:/home/mathildemerle/.local/share/data/INRIA_IHU-LIRYC/MUSICardio/0fd08a9d-58dd-4c73-8764-01951f597e06/2ed185db-bac9-434d-961b-969fd23d7d411.mha\""

/home/mathildemerle/.local/share/data/INRIA_IHU-LIRYC/MUSICardio exists, but the data does not.

Weird

not relevant anymore


[identity] azure-identity should use the latest msal-extensions 1.0.0

Azure Identity has pinned msal-extensions to
https://github.com/Azure/azure-sdk-for-python/blob/b8a947329a3c5f9578a7b1f7a345d654b76bdce2/sdk/identity/azure-identity/setup.py#L79
This makes it impossible for Azure CLI to use msal-extensions 1.0.0 (https://pypi.org/project/msal-extensions/) which has some improvements like https://github.com/AzureAD/microsoft-authentication-extensions-for-python/pull/108.
Please make azure-identity compatible with msal-extensions 1.0.0. Thanks.

So when will this be released? The combination of azure cli v2.36.0 and the azure-identity module is not working at the moment!

What is the fix for trying to write python that needs this? My CLi is up-to-date, but I'm running into the same problem when I try to use azure-identity in my code

Hi @geekydonna, msal-extensions 1.0.0 is supported starting with azure-identity version 1.10.0. If you're having a conflict, you may need to upgrade your version of azure-identity.


Mission string not checked for equality in multi-agent missions

Reopening. I've had to disable this check since it was returning a false negative in the case of MultiMaze.py, and probably many more multiagent missions.
There are a few reasons for this:

The MazeDecorator writes the agent's start position directly back into the Mission object, so the XML used in the comparison already differs from the original. (There may be other issues along these lines.)
The XSD-generated java classes use lazy-initialisation in some of the getters - i.e. calling "getColour" results in a collection object being created if it didn't already exist. These (empty) objects then get written back into the XML upon serialisation.

I guess the easiest fix would be to take a copy of the virgin XML before it's used, and keep that for comparisons.

Some more thought is needed here - do we even need to do this check? Do we want to force all agents to use the same XML...? Am closing this and opening a separate issue to track the bigger picture.


[Bug]: Patchcore exported ONNX file is not usable

Describe the bug
Hi all! Has anyone tried to do inference with the Patchcore exported ONNX from anomalib with onnxruntime for example?
The model is apprently buggy as it is asking for an insane amount of memory (haven't been able to run it on 80GB machine on CPU for example). The error I keep getting is :
onnxruntime/onnxruntime/core/framework/bfc_arena.cc:342 void* onnxruntime::BFCArena::AllocateRawInternal(size_t, bool) Failed to allocate memory for requested buffer of size<PHONE_NUMBER>32.
The problematic layer is apparently this sub node.

Does anyone has any clue how to fix it? or is there any workaround?
Dataset
Folder
Model
PatchCore
Steps to reproduce the behavior
1 - Install Anomalib
2 - Train a Patchcore model
3 - Try to infer with the ONNX
OS information
OS information:

OS: [e.g. Ubuntu 20.04]
Python version: [e.g. 3.8.10]
Anomalib version: [e.g. 0.4.0]
PyTorch version: [e.g. 1.9.0]
CUDA/cuDNN version: [e.g. 11.4]
GPU models and configuration: [1x A100]

Expected behavior
exported ONNX model from patchcore is not working.
Screenshots
No response
Pip/GitHub
pip
What version/branch did you use?
0.4.0
Configuration YAML
model:
  name: patchcore
  backbone: wide_resnet50_2
  pre_trained: true
  layers:
    - layer2
    - layer3
  coreset_sampling_ratio: 0.1
  num_neighbors: 9
  normalization_method: min_max # options: [null, min_max, cdf]

metrics:
  image:
    - F1Score
    - AUROC
  pixel:
    - F1Score
    - AUROC
  threshold:
    method: adaptive #options: [adaptive, manual]
    manual_image: null
    manual_pixel: null

visualization:
  show_images: False # show images on the screen
  save_images: True # save images to the file system
  log_images: True # log images to the available loggers (if any)
  image_save_path: null # path to which images will be saved
  mode: full # options: ["full", "simple"]

project:
  seed: 42
  path: ./results

logging:
  logger: [] # options: [comet, tensorboard, wandb, csv] or combinations.
  log_graph: false # Logs the model graph to respective logger.

optimization:
  export_mode: onnx #options: onnx, openvino

# PL Trainer Args. Don't add extra parameter here.
trainer:
  enable_checkpointing: true
  default_root_dir: null
  gradient_clip_val: 0
  gradient_clip_algorithm: norm
  num_nodes: 1
  devices: 1
  enable_progress_bar: true
  overfit_batches: 0.0
  track_grad_norm: -1
  check_val_every_n_epoch: 1 # Don't validate before extracting features.
  fast_dev_run: false
  accumulate_grad_batches: 1
  max_epochs: 1
  min_epochs: null
  max_steps: -1
  min_steps: null
  max_time: null
  limit_train_batches: 1.0
  limit_val_batches: 1.0
  limit_test_batches: 1.0
  limit_predict_batches: 1.0
  val_check_interval: 1.0 # Don't validate before extracting features.
  log_every_n_steps: 50
  accelerator: auto # <"cpu", "gpu", "tpu", "ipu", "hpu", "auto">
  strategy: null
  sync_batchnorm: false
  precision: 32
  enable_model_summary: true
  num_sanity_val_steps: 0
  profiler: null
  benchmark: false
  deterministic: false
  reload_dataloaders_every_n_epochs: 0
  auto_lr_find: false
  replace_sampler_ddp: true
  detect_anomaly: false
  auto_scale_batch_size: false
  plugins: null
  move_metrics_to_cpu: false
  multiple_trainloader_mode: max_size_cycle

Logs
onnxruntime/onnxruntime/core/framework/bfc_arena.cc:342 void* onnxruntime::BFCArena::AllocateRawInternal(size_t, bool) Failed to allocate memory for requested buffer of size<PHONE_NUMBER>32.

Code of Conduct

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

Hello,
I'm not sure what the problem is, but I can reproduce this. It definitely isn't normal that model requests 288gigs of memory, but I'm not entirely sure if that node is the only problem.

I've encountered the same issue,
My current workaround is to either use the .ckpt file with the pytorch lightning interpreter
or extract the memory_bank as a numpy array,
define a custom PatchCoreModel wrapper
and manually load & store the memory_bank as a tensor.
I was only able to run the ONNX file on a server with 64 GB RAM when using an input size of 224 and a sampling rate of 0.01, so that I get ~6.7k entries (shape of 6700x1536) for the memory_bank.

I've narrowed it down quite a bit to this line:
https://github.com/openvinotoolkit/anomalib/blob/main/src/anomalib/models/patchcore/torch_model.py#L191
It seems that in the ONNX representation (and apparently also OpenVINO?), the input for cdist is shaped 1, 48000, 1536 (called %onnx::Sub_770 in ONNX), whereas it is shaped 48000, 1536 according to pytorch. The other input (%/Reshape_output_0) is shaped 2500, 1536, but seems to get unsqueezed to 2500, 1, 1536 (presumably to match. The calculated output shape of cdist is then 2500, 48000, 1536, which is way too large.
I believe the Sub_770 tensor should be squeezed so that it doesn't have three dimensions .. but not sure where this happens. I'm not entirely sure on the details, but at the moment I have this diff (thanks to https://github.com/openvinotoolkit/anomalib/issues/440#issuecomment-1191184221):
diff --git a/src/anomalib/models/patchcore/torch_model.py b/src/anomalib/models/patchcore/torch_model.py
index 7f4f11f5..00185d43 100644
--- a/src/anomalib/models/patchcore/torch_model.py
+++ b/src/anomalib/models/patchcore/torch_model.py
@@ -18,6 +18,14 @@ from anomalib.models.patchcore.anomaly_map import AnomalyMapGenerator
 from anomalib.pre_processing import Tiler

+def my_cdist(x1, x2):
+    x1_norm = x1.pow(2).sum(dim=-1, keepdim=True)
+    x2_norm = x2.pow(2).sum(dim=-1, keepdim=True)
+    res = torch.addmm(x2_norm.transpose(-2, -1), x1, x2.transpose(-2, -1), alpha=-2).add_(x1_norm)
+    res = res.clamp_min_(1e-30).sqrt_()
+    return res
+
+
 class PatchcoreModel(DynamicBufferModule, nn.Module):
     """Patchcore Module."""

@@ -153,7 +161,7 @@ class PatchcoreModel(DynamicBufferModule, nn.Module):
             Tensor: Patch scores.
             Tensor: Locations of the nearest neighbor(s).
         """
-        distances = torch.cdist(embedding, self.memory_bank, p=2.0)  # euclidean norm
+        distances = my_cdist(embedding, self.memory_bank)  # euclidean norm
         if n_neighbors == 1:
             # when n_neighbors is 1, speed up computation by using min instead of topk
             patch_scores, locations = distances.min(1)
@@ -188,7 +196,7 @@ class PatchcoreModel(DynamicBufferModule, nn.Module):
         # indices of N_b(m^*) in the paper
         _, support_samples = self.nearest_neighbors(nn_sample, n_neighbors=self.num_neighbors)
         # 4. Find the distance of the patch features to each of the support samples
-        distances = torch.cdist(max_patches_features.unsqueeze(1), self.memory_bank[support_samples], p=2.0)
+        distances = my_cdist(max_patches_features, self.memory_bank[support_samples].squeeze())
         # 5. Apply softmax to find the weights
         weights = (1 - F.softmax(distances.squeeze(1), 1))[..., 0]
         # 6. Apply the weight factor to the score

I haven't yet checked if the output of the ONNX model is correct, but at the very least it runs. I will check the output tomorrow.

@hgaiser thanks for this. This seems to be the problem, and from what I see here, I think cdist might even work, but that unsqueeze on dimension 1 needs to be changed as well as squeeze added to memory bank. Basically what you did with squeezing, but using cdist.
Now I'm not sure if this would really work, as I'll need to test it and I'm not that familiar with patchcore code and cdist, but I'll test it and report back. It'd also be great to hear your findings with your function.

@hgaiser thanks for this. This seems to be the problem, and from what I see here, I think cdist might even work, but that unsqueeze on dimension 1 needs to be changed as well as squeeze added to memory bank. Basically what you did with squeezing, but using cdist. Now I'm not sure if this would really work, as I'll need to test it and I'm not that familiar with patchcore code and cdist, but I'll test it and report back. It'd also be great to hear your findings with your function.

I thought the same and I tried that, but it still allocated the wrong size of memory. My model with the patch applied seems to work the same as the pytorch version, but I need to fix something in the training itself. The patch seems to resolve my issue, so my investigation stops here for now since I have limited time to work on this. I hope someone can pick it up and make a proper fix for it.

Good to hear that it works. We'll see what to do from here on and try to implement this fix and test it. Thanks for all the input :)

So in case anyone else is still struggling with this. The above my_cdist  brakes during training because torch.addmm does not take a batch size. Replacing my_cdist by something like:
def euclidean_norm(x1, x2):
    x1_norm = x1.pow(2).sum(dim=-1, keepdim=True)
    x2_norm = x2.pow(2).sum(dim=-1, keepdim=True)
    res = x1_norm - 2 * torch.matmul(x1,x2.transpose(-2,-1)) + x2_norm.transpose(-2, -1)
    res = res.clamp_min_(0).sqrt_()
    return res

makes everything work for me. As far as I can tell torch implements cdist for p=2 in a similar way, but the onnx export of torch.cdist seems to become something like:
def onnx_cdist(x1,x2):
    x1 = x1.unsqueeze(-2)
    return (x1 - x2).pow(2).sum(dim=-1).sqrt()

@hgaiser, @jasonvanzelm . Thank you for providing a solution to the problem with using PatchCore's Onnx model. I noticed that your comments mentioned that your program got working correctly after the modification to the ./src/models/patchcore/torch_model.py. So I tried the same modifications as you did, as follows:
1: I added the "my_cdist" program：
def my_cdist(x1, x2):
    x1_norm = x1.pow(2).sum(dim=-1, keepdim=True)
    x2_norm = x2.pow(2).sum(dim=-1, keepdim=True)
    res = torch.addmm(x2_norm.transpose(-2, -1), x1, x2.transpose(-2, -1), alpha=-2).add_(x1_norm)
    res = res.clamp_min_(1e-30).sqrt_()
    return res

2: I made two changes in "./src/models/patchcore/torch_model.py" where torch.cdist is used
        # distances = torch.cdist(embedding, self.memory_bank, p=2.0)  # Annotated it

        distances = my_cdist(embedding, self.memory_bank)  # This is the program after the replacement

       # distances = torch.cdist(max_patches_features.unsqueeze(1), self.memory_bank[support_samples], p=2.0) # Annotated it

        distances = my_cdist(max_patches_features, self.memory_bank[support_samples].squeeze()). # This is the program after the replacement

I have made sure that the modifications are the same as you said. My pytorch is version 1.12.1 (CUDA: 11.3). But when I modified the corresponding code to run train.py, the program runs for a while and then has problems. The details are as follows:

Why do I have this problem? Am I missing something that still needs to be changed? I look forward to hearing from you, thank you!

If you replace my_cdist by
def my_cdist(x1, x2):
    x1_norm = x1.pow(2).sum(dim=-1, keepdim=True)
    x2_norm = x2.pow(2).sum(dim=-1, keepdim=True)
    res = x1_norm - 2 * torch.matmul(x1,x2.transpose(-2,-1)) + x2_norm.transpose(-2, -1)
    res = res.clamp_min_(0).sqrt_()
    return res

It should work. (The issue is that torch.addmm does not take batch dimensions, so replacing it by torch.matmul and an additional addition solves this problem.)

I tried exporting again last week and ran into the same issue. I believe I fixed it by only using the custom cdist function in compute_anomaly_score and not in nearest_neighbor.
However if the above solution also works, it's probably a safer bet :).

If you replace my_cdist by
def my_cdist(x1, x2):
    x1_norm = x1.pow(2).sum(dim=-1, keepdim=True)
    x2_norm = x2.pow(2).sum(dim=-1, keepdim=True)
    res = x1_norm - 2 * torch.matmul(x1,x2.transpose(-2,-1)) + x2_norm.transpose(-2, -1)
    res = res.clamp_min_(0).sqrt_()
    return res

It should work. (The issue is that torch.addmm does not take batch dimensions, so replacing it by torch.matmul and an additional addition solves this problem.)

@jasonvanzelm Thank you very much for your patient reply. When I replace my_cdist with the latest method you provided, should I use the official method for calculating the two distances in "torch_model.py", or the @hgaiser  modified method?
The official method of calculating distances in two places in the __torch_mode.py__：
        1:  distances = torch.cdist(embedding, self.memory_bank, p=2.0)

        2:  distances = torch.cdist(max_patches_features.unsqueeze(1), self.memory_bank[support_samples], p=2.0)

The corresponding parameters provided by hgaiser:
        1:   distances = my_cdist(embedding, self.memory_bank)

        2:  distances = my_cdist(max_patches_features, self.memory_bank[support_samples].squeeze())

Perhaps I should have been more precise about my question:
1: After I update my my_cdist function to the one you provided, should the parameters I pass in the corresponding two places remain the same as the official one, as follows:
After putting in the program with the demo you provided, pass in the corresponding parameters of my_cdist to modify：

        1:   distances = my_cdist(embedding, self.memory_bank)

        2:  distances = my_cdist(max_patches_features.unsqueeze(1), self.memory_bank[support_samples])

       # The parameters passed by the official and @hgaiser are not the same in 2. The parameters passed by the updated MY_Cdist should be the same as the official ones, right?

2:Another question I have is whether this modification might have an impact on PatchCore's performance
@jasonvanzelm  Thank you for your patience and explanation, thank you very much!

I tried exporting again last week and ran into the same issue. I believe I fixed it by only using the custom cdist function in compute_anomaly_score and not in nearest_neighbor.
However if the above solution also works, it's probably a safer bet :).

Thank you very much for your answer, just @jasonvanzelm  provided a new solution idea, you can also try. I am testing it now and hope the modification will work once.
Numerous methods are provided in Anomalib, and it seems that PatchCore performs well among all the models that can be trained just once to get there. But I checked the related material with the original paper and found that Padim using Wide_ResNet 50 also performs well. But strangely, the model cannot be trained correctly after I set the backbone of Padim to wide_ResNet 50, you can refer to #1045 for more details.
I wonder if you can provide some ideas for this problem, thank you very much!

Hey everybody, I am also having the issue above when exporting to ONNX. I've tried

I tried exporting again last week and ran into the same issue. I believe I fixed it by only using the custom cdist function in compute_anomaly_score and not in nearest_neighbor.
However if the above solution also works, it's probably a safer bet :).

and can get the model to train and inference using the Pytorch version of the model just fine. When using the exported ONNX file of the same model on an Nvidia Triton inference server I still receive the memory error (onnxruntime/onnxruntime/core/framework/bfc_arena.cc:342 void* onnxruntime::BFCArena::AllocateRawInternal(size_t, bool) Failed to allocate memory for requested buffer of size<PHONE_NUMBER>32.). Have @hgaiser @jasonvanzelm found the same with your ONNX exports? Appreciate any help!

@laogonggong847 did you get any of the above combinations to work? I've tried every permutation and the ONNX model still has the memory issue at inference. I can get training to run to completion and the torch model runs through testing fine, but still have issues with the memory error (onnxruntime/onnxruntime/core/framework/bfc_arena.cc:342 void* onnxruntime::BFCArena::AllocateRawInternal(size_t, bool) Failed to allocate memory for requested buffer of size<PHONE_NUMBER>32.)

@bellenfanttyler one thing you also need to take care when using above modified cdist is to also change arguments when calling the function. Did you adjust that as well?

@bellenfanttyler one thing you also need to take care when using above modified cdist is to also change arguments when calling the function. Did you adjust that as well?

@blaz-r Appreciate the response! I did change the arguments when trying to get this to work. I was able to get a successful ONNX export today without the memory error during inference. What ended up working was a combination of version changes and using the custom my_cdist function:
def my_cdist(x1, x2):
    x1_norm = x1.pow(2).sum(dim=-1, keepdim=True)
    x2_norm = x2.pow(2).sum(dim=-1, keepdim=True)
    res = x1_norm - 2 * torch.matmul(x1,x2.transpose(-2,-1)) + x2_norm.transpose(-2, -1)
    res = res.clamp_min_(0).sqrt_()
    return res

only in the nearest_neighbor and not in the compute_anomaly_score. For nearest neighbor I changed the arguments according to what @hgaiser provided in the diff file above (distances = my_cdist(embedding, self.memory_bank).  I still have to validate the scores/outputs but it appears to be working. Thanks to everyone above for putting in the legwork to help get a solution!


Which config is not allowing widevine plugin to be downloaded?

I'm at my wits end here. After 5 hours of troubleshooting to make other things work, I'm exhausted and the only thing left is getting widevine to install. One of the configs is blocking the url for it's installation and for the life of me I can't find out which one. Please help
I get this at about:addons > plugins
"Widevine Content Decryption Module provided by Google Inc. will be installed shortly."

See section 1825
https://github.com/ghacksuserjs/ghacks-user.js/blob/e4f80225d8f2c5c70681e53a9ca607293a5695ed/user.js#L888-L891

See section 1825
https://github.com/ghacksuserjs/ghacks-user.js/blob/e4f80225d8f2c5c70681e53a9ca607293a5695ed/user.js#L888-L891

These are enabled, but it's still not installing. I suspect a kinda hostblock on installing plugins or something. I think it could install itself at this point, it just won't download the file.

Did you also allow DRM content - 1830?
And, silly question (just checking), but you aren't just resetting these in about:config, but also adding them as overrides (or commenting the lines out) in the user.js (for when you restart)?

I'm keen on finding the culprit as well, because I want the setup tags to work. Assuming the above is correct, and it's still failing
It seems like you started with a new profile (otherwise you would already have had widevine), so do you intend to stay with that, and import your bookmarks, extension settings etc. If the answer is yes, then your workaround to get widevine first and then apply the user.js might suffice (for now)
But this just raises questions: will regular widevine updates fail (security)? I'll see if I can have a play later on, but I'll need some sort of link to trigger the widevine download (I do not have a netflix account)?

https://support.mozilla.org/en-US/questions/1226162 = same problem, the person flipped "remember history" and then netflix worked.
Maybe it's some weird Netflix thing: what happens if you visit https://bitmovin.com/demos/drm

After 5 hours of troubleshooting to make other things work, I'm exhausted

I'm sorry about that. The widevine issue aside, it shouldn't be that hard. And you seem to be pretty knowledgeable. If you get time, can you elaborate on the things you had trouble with so I can improve the troubleshooting setup tags

Did you also allow DRM content - 1830?

media.eme.enabled is enabled

And, silly question (just checking), but you aren't just resetting these in about:config, but also adding them as overrides (or commenting the lines out) in the user.js (for when you restart)?

I didn't know they was a way to override, what I did was manually reset about:config values that I wanted to change, and also commenting it out in user.js before restarting firefox.

It seems like you started with a new profile (otherwise you would already have had widevine), so do you intend to stay with that, and import your bookmarks, extension settings etc. If the answer is yes, then your workaround to get widevine first and then apply the user.js might suffice (for now)
But this just raises questions: will regular widevine updates fail (security)? I'll see if I can have a play later on, but I'll need some sort of link to trigger the widevine download (I do not have a netflix account)?

I don't intend to stay on this new profile because of what you've mentioned, I most likely will not get widevine updates.

https://support.mozilla.org/en-US/questions/1226162 = same problem, the person flipped "remember history" and then netflix worked.

Remember history is default, I tried toggling it off and on as a ditch effort, and I'm not surprised it didn't work.

Maybe it's some weird Netflix thing: what happens if you visit https://bitmovin.com/demos/drm

Same issue, this happens on any website that needs DRM; Netflix and Spotify to name a few.

After 5 hours of troubleshooting to make other things work, I'm exhausted

I'm sorry about that. The widevine issue aside, it shouldn't be that hard. And you seem to be pretty knowledgeable. If you get time, can you elaborate on the things you had trouble with so I can improve the troubleshooting setup tags

Thanks for the concern. I'll try it again knowing I can override should be a little simpler than manually removing/adding preferences one by one.
Could you point a way to the troubleshoot wiki for overriding? Ctrl + F 'override' doesn't show up anything or I'm extremly tired. I'm assuming from google that I just need to add in a override-user.js file.

Firefox's new Private Virtual Network was what was blocking widevine from downloading.
You may have to also reset all media.gmp-widevine* configs if firefox got tricked into installing widevine when it actually installed nothing.
Thanks for letting me know about the override function. If anything, I'd say please make it more obvious in the wiki that the tool exists. Thanks for your help again and sorry for the stupid conclusion to this mess.

re-opening because I want to remind myself to dig a little deeper, and improve the user.js

overrides: https://github.com/ghacksuserjs/ghacks-user.js/wiki/3.2-Applying-Your-Changes
I don't use the updater scripts or keep a separate overrides.js as a master copy. Basically add anything you want overriden to the end of the user.js, and manually update once per release by copy/pasting (and read the release logs we do).
You can also use your overrides section to add prefs we don't have
e.g here's mine
// OVERRIDES
/* experimenting */
// user_pref("privacy.fuzzyfox.enabled", true); // FF65+
/* urlbar FF71+ */
user_pref("browser.urlbar.megabar", false);
/* startup */
user_pref("browser.startup.page", 1);
user_pref("browser.startup.homepage", "moz-extension://0639706b-0794-46b6-b5f4-9f28aa9cbf20/dial.html");
/* reset this in case I forgot when toggling */
user_pref("privacy.file_unique_origin", true);
/* updates */
user_pref("extensions.update.autoUpdateDefault", false);
/* AS crap */
user_pref("browser.library.activity-stream.enabled", false);
user_pref("browser.newtabpage.activity-stream.asrouter.userprefs.cfr.addons", false);
user_pref("browser.newtabpage.activity-stream.asrouter.userprefs.cfr.features", false);
/* hide/disable pocket, sync, reader, screenshots icons and various menu items */
user_pref("extensions.pocket.enabled", false);
user_pref("extensions.screenshots.disabled", true);
user_pref("identity.fxaccounts.enabled", false);
user_pref("reader.parse-on-load.enabled", false);
/* cookies */
user_pref("network.cookie.cookieBehavior", 2);
user_pref("privacy.clearOnShutdown.cookies", false);
user_pref("privacy.cpd.cookies", false);
/* warnings & whats new */
user_pref("browser.tabs.warnOnClose", false);
user_pref("browser.tabs.warnOnCloseOtherTabs", false);
user_pref("browser.tabs.warnOnOpen", false);
user_pref("full-screen-api.warning.delay", 0);
user_pref("full-screen-api.warning.timeout", 0);
user_pref("browser.tabs.closeWindowWithLastTab", false);
user_pref("browser.startup.homepage_override.mstone", "ignore");
/* findbar etc */
user_pref("findbar.modalHighlight", true);
user_pref("findbar.highlightAll", true);
user_pref("accessibility.typeaheadfind", true);
/* use last dir for downloads */
user_pref("browser.download.folderList", 2);
/* font stuff */
  //user_pref("font.system.whitelist", "");
  //NOTE: ^^ set manually due to UTF-8 same as TB for Windows
/* OCSP */
user_pref("security.OCSP.require", false); // too much breakage
/* RFP */
user_pref("privacy.window.maxInnerWidth", 1600);
user_pref("privacy.window.maxInnerHeight", 900);
/* other */
user_pref("dom.allow_cut_copy", true); // for autocopy extension
user_pref("browser.backspace_action", 2);
user_pref("browser.urlbar.decodeURLsOnCopy", true);
user_pref("browser.bookmarks.max_backups", 0);
user_pref("network.manage-offline-status", false);
user_pref("extensions.webextensions.restrictedDomains", ""); // allow extensions on AMO etc
user_pref("browser.sessionstore.interval", 120000); // make SR once every 2 mins
/* UI */
user_pref("browser.urlbar.suggest.history", false);
user_pref("browser.urlbar.suggest.bookmark", false);
user_pref("browser.urlbar.suggest.openpage", false);
user_pref("browser.urlbar.oneOffSearches", false);
user_pref("browser.urlbar.autoFill", false);
user_pref("toolkit.cosmeticAnimations.enabled", false);
user_pref("toolkit.legacyUserProfileCustomizations.stylesheets", true); // userChrome/userContent
user_pref("ui.key.menuAccessKey", 0); // disable alt key toggling the menu bar [RESTART]
user_pref("browser.tabs.extraDragSpace", false); // stop theme turning drag space on

/* END: internal custom pref to test for syntax errors ***/
user_pref("_user.js.parrot", "SUCCESS: No no he's not dead, he's, he's restin'!");

Firefox's new Private Virtual Network was what was blocking widevine from downloading

Thanks for working that one out. We don't even have that in the user.js. I'll have to read up on it's deployment etc

blog - available for US only (for now)
website

So my question would be: does the widevine update blocking happen when its off (i.e the extension is enabled but using it is not), or just because the extension is installed. I suspect it's the former
Has anyone told the Mozilla team behind it? - https://github.com/mozilla/secure-proxy/issues
Since it's an extension, I don't think there's anything I can do about it, and the problem should be fixed upstream. I'll post something for Mozilla and link back here

* [blog](https://blog.mozilla.org/blog/2019/09/10/firefoxs-test-pilot-program-returns-with-firefox-private-network-beta/) - available for US only (for now)

* [website](https://private-network.firefox.com/)

So my question would be: does the widevine update blocking happen when its off (i.e the extension is enabled but using it is not), or just because the extension is installed. I suspect it's the former
Has anyone told the Mozilla team behind it? - https://github.com/mozilla/secure-proxy/issues
Since it's an extension, I don't think there's anything I can do about it, and the problem should be fixed upstream. I'll post something for Mozilla and link back here

Sorry I was vague on that answer but yeh the former. If I switch the proxy off, it allows the installation.


import fail with err "No module named 'torch.nn.attention'"

Traceback (most recent call last):
File "D:\ai\ComfyUI\nodes.py", line 2006, in load_custom_node
module_spec.loader.exec_module(module)
File "", line 883, in exec_module
File "", line 241, in call_with_frames_removed
File "D:\ai\ComfyUI\custom_nodes\ComfyUI-MochiWrapper_init.py", line 1, in
from .nodes import NODE_CLASS_MAPPINGS, NODE_DISPLAY_NAME_MAPPINGS
File "D:\ai\ComfyUI\custom_nodes\ComfyUI-MochiWrapper\nodes.py", line 15, in
from .mochi_preview.t2v_synth_mochi import T2VSynthMochiModel
File "D:\ai\ComfyUI\custom_nodes\ComfyUI-MochiWrapper\mochi_preview\t2v_synth_mochi.py", line 54, in
from .dit.joint_model.asymm_models_joint import AsymmDiTJoint
File "D:\ai\ComfyUI\custom_nodes\ComfyUI-MochiWrapper\mochi_preview\dit\joint_model\asymm_models_joint.py", line 40, in
from torch.nn.attention import sdpa_kernel, SDPBackend
ModuleNotFoundError: No module named 'torch.nn.attention'
Cannot import D:\ai\ComfyUI\custom_nodes\ComfyUI-MochiWrapper module for custom nodes: No module named 'torch.nn.attention'

Torch version too old

Which one do your nodes need?

Which one do your nodes need?

Highly recommend the latest 2.5.1

Which one do your nodes need?

Highly recommend the latest 2.5.1

when i update torch to 2.5,i can't find a flash_attn whl for win10
do you know where can i download a pre compile whl for win10 torch2.5?


Fix parsing of user-agent for HttpStartStop logs

HttpStartStop logs are being parsed incorrectly and leaving behind many extra fields on the index pattern, such as syslog_sd_params.xdpi.
These fields are being erroneously created when parsing a user_agent string like so:
user_agent="Mozilla/5.0 (Linux; Android 12; SM-A032F Build/SP1A.210812.016; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/131.0.6778.105 Mobile Safari/537.36 [FBAN/EMA;FBLC/pt_PT;FBAV/4<IP_ADDRESS>.106;FB_FW/1;FBDM/DisplayMetrics{density=2.0, width=720, height=1459, scaledDensity=2.0, xdpi=268.941, ydpi=269.139};\]"]

Acceptance Criteria

[ ] Fix the logstash filters so that the user_agent is parsed correctly and does not leave behind extra syslog_sd_params fields

looks like the issue is the kv filter considers ()[] to mean seperate so truing to find a way to tell it to ignore those in values, i think we can tell it only to split on the :


[WFCORE-2868] Upgrade Wildfly-Elytron-Tool to 1.0.0.Beta6

https://issues.jboss.org/browse/WFCORE-2868
https://issues.jboss.org/browse/JBEAP-11127

Core - Full Integration Build 5043 outcome was FAILURE using a merge of d0a7fa698701088ed40b44873c18bfc3a09826bd
Summary: Tests passed: 3914, ignored: 135; exit code 1 (new) Build time: 00:49:30


Precompile tests and ship them with NPM package

Just had an interesting discussion on Twitter about how not shipping tests breaks npm explore. Maybe we should precompile tests and make sure they don't depend on Babel by the time npm test executes inside a published package. I wonder if any lib does that, and whether it's worth doing something similar.

The current concern is that running npm install and npm test inside the NPM package folder (not the GitHub clone!) won't work because it doesn't contain the Webpack config, babelrc, etc. But we don't want to include babelrc because of issues like #1032.

Basically, this is only problematic because the presence of configs inside node_modules breaks some broken tools - in other words, anything that delves inside node_modules is broken, because it's supposed to be a black box. The need to work around this exists, but it's still very frustrating that it impacts the entire ecosystem just because some people didn't want to transpile before publishing :-/

@ide What's the official React Native stance on this? Do you plan to encourage people to publish ES6 RN modules? Or is the plan to go back to treating node_modules as ES5 black boxes?

@gaeron it's been really good to have people publishing ES6/7 code. It's probably a little late to ship Babel with Node but if it were a possibility I think I would want to try it because it's mostly been a success for RN -- it's really good that people don't need to learn how to set up Babel for each project and source maps just work. So for React Native (and soon generic React components once RN is refactored to depend on the React package) I think we'll encourage, or at least support, publishing of ES6/7 code to npm.

Haha I'm so ambivalent about this. Probably going to be good long term, but painful for non-RN-exclusive maintainers today.

I don't think it will be good long term. Until the community settles on a convention where "main" is ES5, and "something else" is ES6, it's user-hostile to publish non-ES5.

Some thoughts:

Babel should provide an option that RN can use to tell Babel to ignore .babelrc files under node_modules. We still want Babel to pick up .babelrc files in the user's project though, so we don't want to ignore all .babelrc files. This is the only scalable solution that currently comes to mind. We don't want every package author to have to omit .babelrc.
RN can and should continue to work with ES5 packages.
My sense is that it'd be good for everyone to publish ES6, for many of the same reasons why it's awesome that npm has generally been a way to distribute source code (as opposed to package managers that distribute binaries/byte code). So I like that RN has been an experiment in this direction.
But that's a long way off so for today I think we want just a way for Redux to either ship compiled code or to include .babelrc and not break RN. I think it is likely a combination of RN and Babel's fault here that Redux can't ship .babelrc.
FB directs RN and Babel -- if there is a way to get this on the roadmap of one or two engineers who care about open source, that could be a good way to get this issue resolved. Doesn't have to be you @gaearon - I think that FB is the best entity to make progress on this front though.

From @ljharb's tweet

npm explore foo && npm install && npm test should always work.

Can I ask why? What we're downloading from NPM is a executable distribution package, not the full source environment. We don't include documentation or examples for similar reasons; they're not required to use the module in our code. If you do need that stuff, you can find it in the repository field or just npm repo (really handy command, btw!) to start browsing.
Perhaps I'm missing something, but this seems like a non-issue to me.

Interesting. I just realized these commands weren't actually part of npm explore :-D There's some value in being able to run tests on dependencies to diagnose local potentially environment-specific issues. However I agree it's not a must.

@timdorr I recommend absolutely including documentation or examples. For server assets, unused files are ignored, and just sit harmlessly on disk - for browser assets, your build pipeline picks up only the used code and ignores the rest. I shouldn't have to go to the git repo unless I want to make changes to the module.

Agree with @ljharb. I would stand for including sources as well, esp. in transpilers era. I don't understand why having sources at hand is so underestimated. In my opinion it is even more important than tests / docs. I would include everything that has to do with lib usage — so basically everything except build pipeline stuff etc.

@ljharb If you run npm docs, it opens your browser to the docs tree on github. Other than npm explore, there is no command that even directs you towards node_modules. It's all built around hiding that aspect of the package manager. Hence, it's not really a place you should be interacting with.
If you want to hack on the code, you should be cloning the repo and using npm link to test against your changes. I really don't want to encourage users to mess around with what should be an immutable artifact from npm. There's a reason everyone stopped checking in node_modules a while ago :smile:

yes, i agree with you - i'm saying i should be able to explore the module, including its tests. The instant I want to make changes, I should be cloning the repo, but anything I can do prior to that step, I should be able to.

Sometimes you don't have access to internet. I really like when npm-modules are shipped with docs. Once I have installed a package, I can open docs, at least Readme and figure something out.
As for tests. I have never have to run it for installed modules.
I hope my point makes sense for you

We do include README and the source.

I think at this point it's not worth the hassle. I understand the initial argument and I agree it's not ideal, but I won't work on this. If you feel like submitting a PR to fix this I'd be happy to consider it. Overall I don't think it's a very common use case.


Bug in save code

I ran into a bug today when trying to export some onnx models to torch.  (See models and script here).
>>> from hummingbird.ml import convert
>>> import onnx
>>> o = onnx.load('hospital_DecisionTree_BINARY_MaxDepth_20_batch_optimized.onnx', 'r')
>>> type(o)
<class 'onnx.onnx_ONNX_REL_1_6_ml_pb2.ModelProto'>
>>> t=convert(o,'torch')
/usr/local/lib/python3.6/dist-packages/torch/nn/modules/container.py:434: UserWarning: Setting attributes on ParameterList is not supported.
  warnings.warn("Setting attributes on ParameterList is not supported.")
>>> type(t)
<class 'hummingbird.ml.containers.sklearn.pytorch_containers.PyTorchSklearnContainerClassification'>
>>> t.save('hospital_DecisionTree_BINARY_MaxDepth_20_batch_optimized.zip')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/sshuser/hummingbird/hummingbird/ml/containers/sklearn/pytorch_containers.py", line 81, in save
    dill.dump(self, file)
  File "/usr/local/lib/python3.6/dist-packages/dill/_dill.py", line 267, in dump
    Pickler(file, protocol, **_kwds).dump(obj)
  File "/usr/local/lib/python3.6/dist-packages/dill/_dill.py", line 454, in dump
    StockPickler.dump(self, obj)
  File "/usr/lib/python3.6/pickle.py", line 409, in dump
    self.save(obj)
  File "/usr/lib/python3.6/pickle.py", line 521, in save
    self.save_reduce(obj=obj, *rv)
  File "/usr/lib/python3.6/pickle.py", line 634, in save_reduce
    save(state)
  File "/usr/lib/python3.6/pickle.py", line 476, in save
    f(self, obj) # Call unbound method with explicit self
  File "/usr/local/lib/python3.6/dist-packages/dill/_dill.py", line 941, in save_module_dict
    StockPickler.save_dict(pickler, obj)
  File "/usr/lib/python3.6/pickle.py", line 821, in save_dict
    self._batch_setitems(obj.items())
  File "/usr/lib/python3.6/pickle.py", line 847, in _batch_setitems
    save(v)
  File "/usr/lib/python3.6/pickle.py", line 521, in save
    self.save_reduce(obj=obj, *rv)
  File "/usr/lib/python3.6/pickle.py", line 634, in save_reduce
    save(state)
  File "/usr/lib/python3.6/pickle.py", line 476, in save
    f(self, obj) # Call unbound method with explicit self
  File "/usr/local/lib/python3.6/dist-packages/dill/_dill.py", line 941, in save_module_dict
    StockPickler.save_dict(pickler, obj)
  File "/usr/lib/python3.6/pickle.py", line 821, in save_dict
    self._batch_setitems(obj.items())
  File "/usr/lib/python3.6/pickle.py", line 847, in _batch_setitems
    save(v)
  File "/usr/lib/python3.6/pickle.py", line 521, in save
    self.save_reduce(obj=obj, *rv)
  File "/usr/lib/python3.6/pickle.py", line 631, in save_reduce
    self._batch_setitems(dictitems)
  File "/usr/lib/python3.6/pickle.py", line 852, in _batch_setitems
    save(v)
  File "/usr/lib/python3.6/pickle.py", line 521, in save
    self.save_reduce(obj=obj, *rv)
  File "/usr/lib/python3.6/pickle.py", line 634, in save_reduce
    save(state)
  File "/usr/lib/python3.6/pickle.py", line 476, in save
    f(self, obj) # Call unbound method with explicit self
  File "/usr/local/lib/python3.6/dist-packages/dill/_dill.py", line 941, in save_module_dict
    StockPickler.save_dict(pickler, obj)
  File "/usr/lib/python3.6/pickle.py", line 821, in save_dict
    self._batch_setitems(obj.items())
  File "/usr/lib/python3.6/pickle.py", line 847, in _batch_setitems
    save(v)
  File "/usr/lib/python3.6/pickle.py", line 521, in save
    self.save_reduce(obj=obj, *rv)
  File "/usr/lib/python3.6/pickle.py", line 631, in save_reduce
    self._batch_setitems(dictitems)
  File "/usr/lib/python3.6/pickle.py", line 847, in _batch_setitems
    save(v)
  File "/usr/lib/python3.6/pickle.py", line 521, in save
    self.save_reduce(obj=obj, *rv)
  File "/usr/lib/python3.6/pickle.py", line 634, in save_reduce
    save(state)
  File "/usr/lib/python3.6/pickle.py", line 476, in save
    f(self, obj) # Call unbound method with explicit self
  File "/usr/local/lib/python3.6/dist-packages/dill/_dill.py", line 941, in save_module_dict
    StockPickler.save_dict(pickler, obj)
  File "/usr/lib/python3.6/pickle.py", line 821, in save_dict
    self._batch_setitems(obj.items())
  File "/usr/lib/python3.6/pickle.py", line 847, in _batch_setitems
    save(v)
  File "/usr/lib/python3.6/pickle.py", line 496, in save
    rv = reduce(self.proto)
_pickle.PickleError: can't pickle repeated message fields, convert to list first

It seems there is a similar issue with saving tensorflow models.

On it!

On it!


Lists following paragraphs

If a list follows a paragraph without a blank line, it does not correctly parse the list
This will not render correctly
Some text
- A
- B
- C

This will
Some text

- A
- B
- C

Hi, thanks for reporting this.
I can confirm that GitHub's markdown parser will interpret the first input without a blank line as a paragraph and list, but the blackfriday v1 parser that this library uses does not. At least not with the options I'm using.
Does the Markdown specification (loosely speaking, but we can look at CommonMark for a proper specification) say anything about the blank line being optional?

I'm not sure what the spec says, but that is the behavior on GitHub.
Here's an example in one of my repos: https://github.com/AdamColton/packeter/blob/master/readme.md

Sorry for the delay. I've gotten around to investigating this, and I have a fix. It turned out to be quite short. There's a flag that controls this behavior in Blackfriday, and we need to use it to match GitHub Flavored Markdown rendering.
Thanks again for reporting the issue @AdamColton!


Need editable data-grid (or easy way to attach inputs)

Feature request
Using the data-grid to display tabular info (obviously), but want to make it more of an editor in-line experience as well.  Would like to be able to have an 'edit' mode to change cells to editable or input capture.
Expected behavior
Would expect a nice 'editable' mode, but absent that give better ways to attach more elements to a dynamically created data-grid-cell when using the rowsData approach to binding the data.
Current behavior
No ability to make data-grid editable
Use case
Richer editing on top of structured XML or CSV
Screenshots/references

I also need this too. I'd much prefer some events that we could tag onto instead of hacking my own methods.
// Get the data grid by id
const scroller = document.getElementById("scroller");

// Make columns editable?
scroller.cellsEditable = true;

// Handle when the cell is done editing (onblur or on enter?)
scroller.onCellDone = (e) => {...};

// Set the rows of the dg.
scroller.rowsData = data.rows;

Instead, I've got this hack which works ok.
const scroller = document.getElementById("scroller");
scroller.onclick = cellClick;

function cellClick(cell) {
  const {srcElement} = cell;
  if (srcElement && srcElement.className !== "column-header") {
    const handleChange = (target) => {
      console.log(target)
      const column = target._columnDefinition;
      const originalRow = target._rowData;
      const originalValue = originalRow[column.columnDataKey];
      const newValue = target.textContent;

        console.log({newValue, column, originalRow});

      if (originalValue !== newValue) {
        console.log("Value changed");
        target._rowData[column.columnDataKey] = newValue;
      }

      srcElement.setAttribute("contenteditable", "false");

      // Unregister the events for this cell
      srcElement.onkeydown = undefined;
      srcElement.onblur = undefined;
    }

    srcElement.onkeydown = (e) => {
      if (e.code === "Enter") {
        handleChange(e.target);

        // prevent the default behaviour of return key pressed
        return false;
      }
    }

    srcElement.onblur = (e) => {
      handleChange(e.target);
    }

    srcElement.setAttribute("contenteditable", "true");
  }
}

Video example here: https://www.youtube.com/watch?v=N-Jn8zf6KRs&feature=youtu.be

Ahh yeah... a more batteries-included interactive data grid (along with virtualization support for that matter, #210) is totally a north star dream of mine for the toolkit. But it's, unfortunately, something that won't be happening anytime soon (if ever) just because building an interactive data grid (and getting it right) is easily one of the most time/resource-intensive components out there.
Additionally, this is actually a request that should be bubbled up to the FAST team because they own the underlying data grid implementation.
With all that said, @worksofliam's solution/workaround with the contenteditable attribute is exactly what I would have suggested so thank you for providing that!
I was going to offer some suggested improvements to the snippet yesterday (namely that you can use a custom cell-focused event that the data grid emits to create a cleaner solution), but I ended up having fun and now I have my own suggested solution for this problem 😅
Here are some of the highlighted improvements:

Make use of the cell-focused event that data grids emit (here are the FAST API docs where I found this info btw)
I added more keyboard events: "enter" will now toggle between edit and non-edit, "escape" will also exit edit mode

Also used e.key instead of e.code because e.code ignores keyboard layouts

When a cell enters edit mode the text inside the cell will be highlighted automatically
If using TypeScript, I added type casts/annotations that improve IntelliSense immensely
srcElement is a deprecated property on the Event interface so I switched it to Event.target
I used addEventListener/removeEventListener instead of on{event} and on{event} = undefined (btw: I believe this should actually be on{event} = null) to more explicitly add and remove events
Use e.preventDefault(); to prevent default event behavior instead of returning false
Added more null/error checks (mainly suggested by TS)

import { DataGrid, DataGridCell } from "@vscode/webview-ui-toolkit";

// ... other data grid configuration code ...

initEditableDataGrid("default-grid");

function initEditableDataGrid(id: string) {
  const grid = document.getElementById(id) as DataGridCell;
  grid?.addEventListener("cell-focused", (e: Event) => {
    const cell = e.target as DataGridCell;
    // Do not continue if `cell` is undefined/null or is not a grid cell
    if (!cell || cell.role !== "gridcell") {
      return;
    }
    // Do not allow data grid header cells to be editable
    if (cell.className === "column-header") {
      return;
    }

    // Note: Need named closures in order to later use removeEventListener
    // in the handleBlurClosure function
    const handleKeydownClosure = (e: KeyboardEvent) => {
      handleKeydown(e, cell);
    };
    const handleClickClosure = () => {
      setCellEditable(cell);
    };
    const handleBlurClosure = () => {
      syncCellChanges(cell);
      unsetCellEditable(cell);
      // Remove the blur, keydown, and click event listener _only after_
      // the cell is no longer focused
      cell.removeEventListener("blur", handleBlurClosure);
      cell.removeEventListener("keydown", handleKeydownClosure);
      cell.removeEventListener("click", handleClickClosure);
    };

    cell.addEventListener("keydown", handleKeydownClosure);
    cell.addEventListener("click", handleClickClosure);
    cell.addEventListener("blur", handleBlurClosure);
  });
}

// Handle keyboard events on a given cell
function handleKeydown(e: KeyboardEvent, cell: DataGridCell) {
  if (!cell.hasAttribute("contenteditable") || cell.getAttribute("contenteditable") === "false") {
    if (e.key === "Enter") {
      e.preventDefault();
      setCellEditable(cell);
    }
  } else {
    if (e.key === "Enter" || e.key === "Escape") {
      e.preventDefault();
      syncCellChanges(cell);
      unsetCellEditable(cell);
    }
  }
}

// Make a given cell editable
function setCellEditable(cell: DataGridCell) {
  cell.setAttribute("contenteditable", "true");
  selectCellText(cell);
}

// Make a given cell non-editable
function unsetCellEditable(cell: DataGridCell) {
  cell.setAttribute("contenteditable", "false");
  deselectCellText();
}

// Select the text of an editable cell
function selectCellText(cell: DataGridCell) {
  const selection = window.getSelection();
  if (selection) {
    const range = document.createRange();
    range.selectNodeContents(cell);
    selection.removeAllRanges();
    selection.addRange(range);
  }
}

// Deselect the text of a cell that was previously editable
function deselectCellText() {
  const selection = window.getSelection();
  if (selection) {
    selection.removeAllRanges();
  }
}

// Syncs changes made in an editable cell with the
// underlying data structure of a vscode-data-grid
function syncCellChanges(cell: DataGridCell) {
  const column = cell.columnDefinition;
  const row = cell.rowData;

  if (column && row) {
    const originalValue = row[column.columnDataKey];
    const newValue = cell.textContent;

    if (originalValue !== newValue) {
      row[column.columnDataKey] = newValue;
    }
  }
}

Hope that helps! And, of course, please follow up with questions/comments
With that said because FAST owns the data grid implementation I'm going to close this issue and encourage you open an issue in the FAST repo requesting these changes if you'd like a proper first-party solution, hope you understand :)

@hawkticehurst thanks for this great write up. Documenting this somewhere searchable would be super nice.

Of course! And ahhh great call, I'll actually reopen this issue and consider the resolution an addition to our docs with this info.

Agreed, thanks @hawkticehurst! I removed the select/unselect functions as they actually seemed to be getting in the way of actual edits.

I would also change from using textContent to innerText as in my experience textContent is bringing in some additional characters versus innerText is 'pure'

I removed the select/unselect functions as they actually seemed to be getting in the way of actual edits.

Oh interesting! I found that without the text selection functionality the cursor will not automatically focus within the cell when using the enter keyboard shortcut
It still works fine with a mouse click, but again not with keyboard shortcuts. Were you able to get cursor focus when using a keyboard shortcut?

I would also change from using textContent to innerText as in my experience textContent is bringing in some additional characters versus innerText is 'pure'

Ooh thank you! I'll update my snippet from above and make sure any docs/samples also reflect this.

I removed the select/unselect functions as they actually seemed to be getting in the way of actual edits.

Oh interesting! I found that without the text selection functionality the cursor will not automatically focus within the cell when using the enter keyboard shortcut
It still works fine with a mouse click, but again not with keyboard shortcuts. Were you able to get cursor focus when using a keyboard shortcut?

Oh never mind, I think I realize what you were talking about now. When you use a mouse to try to deselect and just have a cursor somewhere in the text it will always reselect the entire text, right?
If so, the solution is to change that initial add a click event listener call to only run once:
cell.addEventListener("click", handleClickClosure, { once: true });

Now the first time you click a data grid cell the entire text string will be highlighted but if you click again it becomes a case where you can click anywhere on the string and the cursor will move to that position.
I've updated the above snippet to reflect this change too.

When you use a mouse to try to position the cursor at a specific place in the cell text it will always reselect the entire string, right?

Yep you got it -- good update.

Found another good edit and a use case I'm trying out.
contenteditable -- in my case I'm going to set to plaintext-only instead of just true -- probably a nuance for different folks, but I can only accept plain text so a good edit.
enablying newlines -- trapping the enter key is preventing allowing newlines in the edit.  I'm going to play around with checking e.shiftKey as well

Decided to actually finish this while I still had all the context in my head. Feel free to keep adding comments here with issues/ideas/improvements or (even better) open issues in the toolkit sample repo with any issues/improvements :)


Feature request: Sortable headers in the Redirects tab

It would be useful to be able to click the "Old URL", "New URL", "Wildcard" and "Redirect Type" headers to toggle between ascending/descending sorting of the table.

@ellinge Perfect, thanks!

I’m not part of Geta /  so it’s up to them


Hugo as subdomain website images not rendering

In config.toml, I set baseURL = "http://example.org/tutorial_site/".
Running hugo server, the website is hosted on localhost:1313/tutorial_site/.
The website works fine except for the images.
My image syntax does not work
![twitter blue](/twitter-blue.png) broken
Inspect element shows that hugo is looking for the image in localhost:1313/twitter-blue.png when in reality it is located in localhost:1313/tutorial_site/twitter-blue.png.
Besides doing
![twitter blue](/tutorial_site/twitter-blue.png)
is there a way to get images to work properly.
Ideally, they should work using ![twitter blue](/twitter-blue.png).

Thanks for getting in touch, but it feels like this is a question  that would be better suited to the Hugo Discussion Forum. GitHub issues are used only for bugs and enhancements. You may also find the answers you search for in Hugo Documentation.


Add config reload, and config dump commands

Blocked by #1
Something like !config reload and !config dump, these should only be runnable by users with the "moderator_role" (#1)

!config reload Reloads the bot's config, so that the running bot is in sync with the config files (Currently, the config files can be changed while the bot is running, and the only way to get them in sync again is to stop and restart the container)
!config dump Dumps the currently running bot's config in a message as yaml. Ideally, there would be a way to only show the config to the user who ran the command, but I am not sure if that is possible


[Feature request] Add connection timeout parameter

Hello,
I'm trying to use this plugin to monitor connections to database nodes. Currently if node is not responding check fails after 30 s. It would be great if there would be possibility to define connection timeout.

Three weeks later, the server has been on and waiting for your control panel. I can't afford to delay any time. Please, can you give me a reply? Virtkick.com

Three weeks later, the server has been on and waiting for your control panel. I can't afford to delay any time. Please, can you give me a reply? Virtkick.com, my account is<EMAIL_ADDRESS>


New fixture - American DJ Fog Fury Jett

Created on 01/09/15.
Modifed to add RGBA colour macros with debatable mapping to RGB values.

Thanks, I'll fix "mode"