Uncaught RangeError: Maximum call stack size exceeded

This error occurs in my console when the script is included, even if I didn't add any language classes anywhere.
This is my body:

Code goes here

I've included most of the languages available in my installation, and the line numbers plugin. I've tried only including the first four languages, the error still occurs.
This is the full error, as seen on my Chrome dev tools:
Uncaught RangeError: Maximum call stack size exceeded
match @ (program):128
_self.Prism.util.type @ prism.js:2
_self.Prism.languages.DFS @ prism.js:2
_self.Prism.languages.DFS @ prism.js:2
_self.Prism.languages.DFS @ prism.js:2
_self.Prism.languages.DFS @ prism.js:2
_self.Prism.languages.DFS @ prism.js:2
_self.Prism.languages.DFS @ prism.js:2
_self.Prism.languages.DFS @ prism.js:2
_self.Prism.languages.DFS @ prism.js:2

The highlighting still works - I just can't get the line numbers to work when I add a 'line-number' class to the
.

Hi, thanks for reporting.
This issue will be a tough one to fix... The DFS function is not able anymore to walk through all the languages. And the DFS function is called anytime insertBefore is called, which means... many times.
The DFS function is mainly needed because Prism relies on the order of the keys in the grammars. insertBefore creates a new object each time it's called (it can't be done "in place") and it needs to walk through all references of the previous object to update each one to the new reference.
I think #799 could help fixing this. I need to get back working on it.
For now, the only solution I can suggest is that you reduce the number of languages you included in your installation, preferably to match only the ones you actually need.

After some testing, I can indeed confirm that the problem stems from too many languages.
Thanks for your support!

FYI, I hit the same problem at prism-languages when trying to get it up to date. Given I just concat the language definitions, this happens.

I "resolved" this problem at prism-languages. I simply hacked together a dependency declaration of my own. Now it's possible to consume the definitions from Node easily. This makes it ideal for backend processing.
Ideally we would be able to drop prism-languages altogether. The current Node version of Prism seems better than what it used to be, but it's still missing most fo the language definitions.

I don't think the cause is from too many languages.  I started running into this same problem when I wanted to add a couple languages, and of course pulled the very latest js code.
There is something about a specific language module that seems to cause the problem.  haml is one of them.  For example, this combination works:
http://prismjs.com/download.html?themes=prism&languages=markup+css+clike+javascript+actionscript+apacheconf+applescript+aspnet+bash+c+csharp+cpp+coffeescript+ruby+css-extras+dart+git+go+handlebars+java+latex+less+lua+makefile+markdown+nginx+objectivec+perl+php+php-extras+python+r+scala+sql+swift+wiki+yaml
Add haml to it, and you get the error.  It was through the process of elimination that I found haml was the problem.  So even the following minimal set fails:
http://prismjs.com/download.html?themes=prism&languages=markup+css+clike+javascript+ruby+haml
There is at least one other language (not in my normal use set) that is causing the same problem, because if I include all languages except haml, the error occurs.
So the solution for me at the moment is not to include haml. I don't have the time to try and figure out exactly why haml causes the failure, but maybe this points someone in the right direction.

For some reason HAML didn't trigger the error for me, it was AsciiDoc that did it. Not sure why, at all.
I included all languages a few at a time (including haml), and the only one that caused the error was AsciiDoc.

It is not the number of languages that causes the problem. AsciiDoc contains an infinite recursion and DFS runs into it if you include any language with a call to insertBefore() after AsciiDoc.
AsciiDoc includes the following pattern:
Prism.languages.asciidoc = {
'macro': {
			pattern: /\b[a-z\d][a-z\d-]*::?(?:(?:\S+)??\[(?:[^\]\\"]|(["'])(?:(?!\1)[^\\]|\\.)*\1|\\.)*\])/,
			inside: {
				'function': /^[a-z\d-]+(?=:)/,
				'punctuation': /^::?/,
				'attributes': {
					pattern: /(?:\[(?:[^\]\\"]|(["'])(?:(?!\1)[^\\]|\\.)*\1|\\.)*\])/,
					inside: attributes.inside
				}
			}
		},

The simplest way to reproduce the problem is to select AsciiDoc first and then for example Ruby:
http://prismjs.com/download.html?themes=prism&languages=asciidoc+ruby

I have quickly put together a PR to prevent infinite recursion in DFS #841. That PR would also solve this issue, but it is probably better to fix AsciiDoc instead.

The following patch solves this issue, but it kind of breaks the AsciiDoc language. The cloned versions of macro and inline don't have all the fields, because that would cause an infinite recursion.
diff --git a/components/prism-asciidoc.js b/components/prism-asciidoc.js
index 55a6330..63bb51b 100644
--- a/components/prism-asciidoc.js
+++ b/components/prism-asciidoc.js
@@ -200,8 +200,8 @@
        // Allow some nesting. There is no recursion though, so cloning should not be needed.

        attributes.inside['interpreted'].inside.rest = {
-               'macro': Prism.languages.asciidoc['macro'],
-               'inline': Prism.languages.asciidoc['inline'],
+               'macro': Prism.util.clone(Prism.languages.asciidoc['macro']),
+               'inline': Prism.util.clone(Prism.languages.asciidoc['inline']),
                'replacement': Prism.languages.asciidoc['replacement'],
                'entity': Prism.languages.asciidoc['entity']
        };
@@ -238,7 +238,7 @@
        };

        Prism.languages.asciidoc['other-block'].inside.rest = {
-               'table': Prism.languages.asciidoc['table'],
+               'table': Prism.util.clone(Prism.languages.asciidoc['table']),
                'list-punctuation': Prism.languages.asciidoc['list-punctuation'],
                'indented-block': Prism.languages.asciidoc['indented-block'],
                'comment': Prism.languages.asciidoc['comment'],

I think the better solution is #841, because it enables such complex self-referencing languages like AsciiDoc.

This issue was fixed with #841. Closing.


[#129915689]turn _Line utility class into more robust _StringPipe class

Tangentially related to https://www.pivotaltracker.com/story/show/129915689

I'm not sure I see the benefit here?  Why might we want to iter_csv with something other than a csv writer? What does _StringPipe do for us that the previous code wasn't doing?

I was going to use a DictWriter but it turned out I didn't in the end anyway, so much of that bit is unnecessary now.
_StringPipe (other than having a better name) doesn't flush its buffer every time it's written to, instead concatenating it to any existing input. _Line would work fine as long as your code was guaranteed to do write read write read write read write read... if you did two successive writes before a read you would end up with some of your stream missing.

Ok, updated to remove now-redundant flexibility-adding features. It's just the _StringPipe fix now.

:+1:


Add space for Explain display

For example, the text of creating token is "Create token (support split) that max supply is XXXXXX", but Explain does not show the full text. Please add space for Register & Execute Contract Explain.

fixed by #27


A better OrderedWriter for building sparse bitmaps

It's quicker to use OrderedWriter for building bitmaps from ordered streams than repeatedly calling RoaringBitmap.add because it avoids the cost of locating the container and any binary searches. But using an 8KB bitset isn't the best decision when a very sparse bitmap (no bitmap containers) is to be built. Profiling shows that most time is spent in constructing array containers from bitmap containers. I think it would be quicker to have a variant of OrderedWriter which appends values to an ArrayContainer with a preallocated 4096 element short[], or maybe an estimated capacity, which flushes when each 16 bit boundary is crossed.

+1


Drush fails after fresh spinup: Class "DOMDocument" does not exist

Issue Type

Bug Report / Support Request

Your Environment
Vagrant 2.2.14
VirtualBox 6.1.16r140961
ansible 2.9.27
  config file = /etc/ansible/ansible.cfg
  configured module search path = [u'/home/vagrant/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python2.7/dist-packages/ansible
  executable location = /usr/bin/ansible
  python version = 2.7.17 (default, Jul 20 2020, 15:37:01) [GCC 7.5.0]

Your OS

Linux (version)

Summary
Spinning up a new project using DrupalVM with Acquia BLT and Acquia CMS. The box provisions correctly, but all drush commands fail when I ssh into the box. The error is:
 [preflight] Class "DOMDocument" does not exist
 [warning] Drush command terminated abnormally.

Some initial debugging shows that this can be caused by the absence of the php-xml extension. I modified box/config.yml to include this:
php_version: "7.4"
php_packages_extra:
  - "php{{ php_version }}-bz2"
  - "php{{ php_version }}-imagick"
  - "php{{ php_version }}-zip"
  - "php{{ php_version }}-intl"
  - "php{{ php_version }}-bcmath"
  - "php{{ php_version }}-xml"
  - imagemagick

And re-provisioned the box, but no success. phpinfo confirms the extension is present. Restarted PHP after re-provisioning just to be certain., but the issue still persists.

Updating with some more info: the cause for this turns out to be a PHP version mismatch. Even though 7.4 is explicitly declared in the box/config.yml, the VM spins up with 8.1. Apparently, php-xml is not installed for 8.1. Manually switching to 7.4 in the VM resolves the issue:
sudo update-alternatives --set php /usr/bin/php7.4
So the bug appears to be that the VM is not respecting the PHP version set in the box/config.yml when provisioning.

I've been having this happen on a number of Ubuntu servers lately, even after running upgrades. It looks like the CLI gets updated to PHP 8.1, while the web UI still runs PHP 7.3 or 7.4 (whatever version is set with php_version)... hmm...

Related: https://github.com/geerlingguy/ansible-for-devops/issues/451

Can you see if maybe php-apcu is in your configuration anywhere? If so, it needs to be changed to php7.4-apcu.

Nope...not setting that anywhere in the configuration  :(

Weird, it should be fixed, though I might also need to update Drupal VM to latest role versions soon to make sure that's not the issue.

Just reporting that I also experienced issues after cloning the latest master, not touching anything in config.yml and running vagrant up. The VM installed php 8.1 even though 7.4 was specified. I also got return type error messages similar to this:
PHP Deprecated: Return type of Symfony\Component\Console\Helper\HelperSet::getIterator()
should either be compatible with IteratorAggregate::getIterator(): Traversable,
or the #[ReturnTypeWillChange] attribute should be used to temporarily suppress the notice

Thanks helped a million.

Can you see if maybe php-apcu is in your configuration anywhere? If so, it needs to be changed to php7.4-apcu.

Live saver. Thanks you.


Save the lambdas source folder as a parameter

Save the lambdas source folder as a parameter from the main SaaS Boost stack so it can be passed to the tenant onboarding stack(s). Resolves the immediate cause of Issue #92.
To make this work, the Onboarding service now needs to invoke the Settings service during provisioned tenant update to go fetch the necessary settings for the lambda folder and other CloudFormation data.
I also discovered during testing the CloudFormation considers a no updates to perform state to be an error. I'm now swallowing this error and just logging it.
There are some updates (for example just changing the lambdas folder) that does not trigger a CloudFormation update. I could not figure out a way to force CloudFormation to perform a stack update consistently. I did add the metadata property to the onboarding templates as suggested by the documentation as a way to get CloudFormation to notice a change.
This flow also brings up some questions about whether the installer should be the place controlling these installation state changes and whether we should trigger a CloudFormation update on all provisioned tenants when we run update from the installer (we do not do that now). This could leave tenant environments in various states of infrastructure setup...
This PR also cleans up old developer cruft in the tenant onboarding CloudFormation template and clarifies that a tenant is either overriding the default compute settings or they're not. When override defaults is FALSE, the tenant does not have values for the individual compute settings.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license

Tested out the changes with a new install of SaaS Boost. Deployed a tenant and that points to the lambdas folder. Then ran the update using installer which created the new Lambda source folder. After which I onboarded another tenant and the lambda source folder in the tenant (and nested stacks) pointed to the new folder so that part looks good.
I tested the update of a tenant by changing the compute for the first provisioned tenant and this triggered the CloudFormation update on the main tenant stack. However, no update was triggered for the nested RDS and EFS stacks and the LambdaSourceFolder parameter for the RDS stack remained as lambdas. I think this aligns to what you found with how CloudFormation works.


Swap Shift Click option drop down list appears invisible

Type
Incorrect behavior
Operating System
Windows
OS Version
Windows 11
Bug description
When attempting to swap shift click options on any item, the drop down list to select what options you want to have shift-click abilities on does not appear.
Screenshots or videos

RuneLite version
RuneLite version: 1.10.42
Launcher version: 2.6.10
Logs
No response

Did you try safe mode mentioned at the top of the bug report template? You didn't include your logs so I can't check if you have.

Did you try safe mode mentioned at the top of the bug report template? You didn't include your logs so I can't check if you have.

I did not originally put RuneLite into safe mode. I just retried in safe mode, and the issue still stands. I did not think to post any logs because a crash did not occur, here is the log for safe-mode enabled below:
launcher.log

We need your client.log as well

We need your client.log as well

client.log
launcher.log

Had the same issue, looked into code, turns out my item swaps -> customizable shift-click option was disabled in the menu entry swapper settings. Enabling that fixed the issue.
Strange thing is I use the plugin-presets plugin, so I'm fairly sure that setting has been off for years, but shift-clicks always worked before. The config for shift clicks hasn't been touched for 4 years, so tried looking at recent changes to menu entry swapper plugin to understand why it worked before, but from the changes I saw it wouldn't have worked previously if the config was set to false (as intended) so no clue why it used to work. Only other explanation is I somehow manually set it to false then synced that to my plugin-preset, or the plugin-preset plugin disabled the setting somehow.
Either way might be worth hiding the menu entry for swap-shift click if customizable shift-click is set to false (and same for customizable left click) to avoid future confusion.

Had the same issue, looked into code, turns out my item swaps -> customizable shift-click option was disabled in the menu entry swapper settings. Enabling that fixed the issue.
Strange thing is I use the plugin-presets plugin, so I'm fairly sure that setting has been off for years, but shift-clicks always worked before. The config code for shift clicks hasn't been touched for 4 years, so tried looking at recent changes to menu entry swapper plugin to understand why it worked before, but from the changes I saw it wouldn't have worked previously if the config was set to false (as intended) so no clue why it used to work. Only other explanation is I somehow manually set it to false then synced that to my plugin-preset, or the plugin-preset plugin disabled the setting somehow.
Either way might be worth hiding the menu entry for swap-shift click if customizable shift-click is set to false (and same for customizable left click) to avoid future confusion.

I want to say that it was enabled, but then I disabled it then re-enabled it. After re-enabling "Customizable shift-click" it worked! Very strange. Thanks for pointing this out. I wonder if after further updates that maybe it bricks the customizable shift-click option? Either way, this was the solution for me as well. Thank you


chore: add mailmap to associate the right user

Signed-off-by: feng-tao<EMAIL_ADDRESS>
Summary of Changes
Each user could have multiple emails with the commit (https://blog.developer.atlassian.com/aliasing-authors-in-git/). Create mailmap file to associate multiple email to same user.
Tests

Documentation

CheckList
Make sure you have checked all steps below to ensure a timely review.

[ ] PR title addresses the issue accurately and concisely. Example: "Updates the version of Flask to v1.0.2"

In case you are adding a dependency, check if the license complies with the ASF 3rd Party License Policy.

[ ] PR includes a summary of changes.
[ ] PR adds unit tests, updates existing unit tests, OR documents why no test additions or modifications are needed.
[ ] In case of new functionality, my PR adds documentation that describes how to use it.

All the public functions and the classes in the PR contain docstrings that explain what it does

Airflow does this (https://github.com/apache/airflow/blob/master/.mailmap) . But I haven't been found out whether github official support mailmap or not.


Fix Deprecated icons

Description

old icon
appearance
new icon

E001
✔
E73E

10A
✖

8BB ~close~

947 ~multiply~

→
894 clear

711 ~cancel~

052
👁
F78D

26B
chev.R.small
970

26C
chev.L.small
96F

0E2
chev.L
76B

0E3
chev.R
76C

0E4
chev.U
70E

0E5
chev.D
70D

094,11A
🔎
721

00B
🖤
B52

115
⚙
713

Motivation and Context

They have been deprecated for years now.
Fixes: #8375 and #7350

https://github.com/microsoft/microsoft-ui-xaml/issues/6392
https://github.com/microsoft/microsoft-ui-xaml/issues/6390
https://github.com/microsoft/microsoft-ui-xaml/issues/7139

and many more, like

https://github.com/microsoft/PowerToys/issues/25284
https://github.com/microsoft/PowerToys/issues/21267
https://github.com/microsoft/microsoft-ui-xaml/issues/7850
https://github.com/microsoft/WinUI-Gallery/issues/1128

FYI @crutkas, @StephenLPeters and others

@pratikone any luck finding somebody?

Anybody home?

/azp run

Hey @Jay-o-Way thanks so much for filing the bug and submitting the fix. I'm currently verifying with the designers to make sure these are apt replacements for the glyphs, as well as trying to identify how this regression happened in the first place...

Thanks @karkarl . Same idea applies to the SymbolIcon application. Translating Icon="Settings to the actual icon code. Do you know where we can find that?

Any progress?
And, after this would be merged, when would the effects be visible? Any eta? First the next version of this source needs to be released, then every app should update to use that new version. I imagine that takes quite some time...

What's taking so long? I can't stand this!

@karkarl Any progress?
And, after this would be merged, when would the effects be visible? Any eta? First the next version of this source needs to be released, then apps (and don't forget the OS!) should update to use that new version. I imagine that takes quite some time...

After some investigation, here is what is happening with the icons:
Both Segoe MDL2 (Windows 10 icon font) and Segoe Fluent Icons (Windows 11 icon font) use the Unicode private use area (PUA) to encode icons. Some Chinese fonts encode Chinese characters in the PUA range. PUA range goes from Unicode E000-F8FF. Some simplified Chinese apps are reporting these issues. The only font that has Chinese characters in that lower PUA range is a font intended for Hong Kong (Mingliu_HKSCS).

To avoid these codepoint collisions, it is recommended to use glyphs higher in range. Hence the note specified here: https://learn.microsoft.com/en-us/windows/apps/design/style/segoe-ui-symbol-font

Glyphs with prefixes ranging from E0- to E5- (e.g. E001, E5B1) are currently marked as legacy and are therefore deprecated.

Note that these glyph ranges are not really "deprecated" in the traditional sense (misleading doc). The icons are still encoded and left intact. Unfortunately, this also means that should fonts start encoding in the higher PUA ranges, more collisions like this can still occur.
It still makes sense for us to update the glyphs, hence here are the next steps from our side:

Merge your PR, then figure out servicing schedule for this fix.
Port changes into WinUI3 (servicing is approved)
Update changes to Symbol enum - this is a breaking change thus requires formal API reviews
Investigate the potential regression and prevent future codepoint collisions - why the app fonts are overwriting the icon fonts.

/azp run

/azp run

There is an issue in the validation Pipeline building from forks. So I've merged this into a local user branch and will merge it to main from there.

See #8576

This is now merged to main. Thanks @Jay-o-Way for the fix.

That's great news! Thanks, and special thanks to @karkarl for digging in to this. Looks like quite alot of work went into it. And this is not even the end of the line.


Comparing modifiedAt before and after migration and finish earlier wh…

…en CIS has error and not called KEB at all

Description
Changes proposed in this pull request:

Comparing modifiedAt before and after migration and finish earlier when CIS has error and not called KEB at all
...
...

Related issue(s)

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


"cargo metadata" no longer displays "example"

I'm not quite sure what this issue is saying; I think we could use a bit more information.
Today, when I run cargo metadata in a project that has an example in examples/simple.rs, I see this output that includes the example target:
{
  "packages": [
    {
      "name": "dev-dep-test",
      "version": "0.1.0",
      "id": "dev-dep-test 0.1.0 (path+file:///Users/carolnichols/rust/dev-dep-test)",
      "license": null,
      "license_file": null,
      "description": null,
      "source": null,
      "dependencies": [],
      "targets": [
        {
          "kind": [
            "lib"
          ],
          "crate_types": [
            "lib"
          ],
          "name": "dev-dep-test",
          "src_path": "/Users/carolnichols/rust/dev-dep-test/src/lib.rs"
        },
        {
          "kind": [
            "example"
          ],
          "crate_types": [
            "bin"
          ],
          "name": "simple",
          "src_path": "/Users/carolnichols/rust/dev-dep-test/examples/simple.rs"
        }
      ],
      "features": {},
      "manifest_path": "/Users/carolnichols/rust/dev-dep-test/Cargo.toml"
    }
  ],
  "workspace_members": [
    "dev-dep-test 0.1.0 (path+file:///Users/carolnichols/rust/dev-dep-test)"
  ],
  "resolve": {
    "nodes": [
      {
        "id": "dev-dep-test 0.1.0 (path+file:///Users/carolnichols/rust/dev-dep-test)",
        "dependencies": []
      }
    ],
    "root": "dev-dep-test 0.1.0 (path+file:///Users/carolnichols/rust/dev-dep-test)"
  },
  "target_directory": "/Users/carolnichols/rust/dev-dep-test/target",
  "version": 1
}

What information used to be displayed for examples by cargo metadata?
Also useful would be the version of Cargo (or Rust) that used to display what you would expect, and the first version of Cargo/Rust that did not display what you expected.
Thanks!

I don't know what happened here, this issue was created inadvertently.  This looks like it was some mutant of #3654.  Sorry for the noise.


Decompiler: Inplace assignment operators are not always used

Describe the bug
Even when the Use inplace assignment operators decompiler setting is turned on, inplace assignment are not always used.
To Reproduce
Steps to reproduce the behavior:

Download no_inplace.xml.txt
Compile decomp_dbg
Run decomp_dbg (with the correct SLEIGHHOME environment variable set)
Run the following commands:

restore /path/to/no_inplace.xml.txt
lo fu FUN_0621be08
decompile
print C

Observe that the output looks like (especially the line lVar2 = lVar2 + 1;):

void FUN_0621be08(long param_1)

{
  bool bVar1;
  long lVar2;
  undefined **ppuVar3;
  uint *puVar4;

  lVar2 = 0;
  ppuVar3 = PTR_ARRAY_0620a110;
  puVar4 = (uint *)(param_1 + 0x58);
  do {
    FUN_0621c8d4(*ppuVar3,((ulong)*puVar4 * 0xcb73) / 1000000,0x42,0);
    bVar1 = lVar2 != 7;
    lVar2 = lVar2 + 1;
    ppuVar3 = ppuVar3 + 1;
    puVar4 = puVar4 + 1;
  } while (bVar1);
  return;
}

Expected behavior
I expected the "update" statements in the loop body to be rendered using inplace assignment operators, perhaps something like:
void FUN_0621be08(long param_1)

{
  bool bVar1;
  long lVar2;
  undefined **ppuVar3;
  uint *puVar4;

  lVar2 = 0;
  ppuVar3 = PTR_ARRAY_0620a110;
  puVar4 = (uint *)(param_1 + 0x58);
  do {
    FUN_0621c8d4(*ppuVar3,((ulong)*puVar4 * 0xcb73) / 1000000,0x42,0);
    bVar1 = lVar2 != 7;
    lVar2 += 1;
    ppuVar3 += 1;
    puVar4 += 1;
  } while (bVar1);
  return;
}

Attachments
no_inplace.xml.txt
Environment (please complete the following information):

OS: Linux
Ghidra Version: 10.3.2
Ghidra Origin: official Github release

Additional context
Of course, it would be even nicer if a special case was added for += 1 and -= 1 to be printed as ++ and --. However, even it is just += 1 and -= 1, that would already be a big improvement.

Maybe https://github.com/jobermayr/ghidra-staging/blob/master/2525-Decompiler-Add-C-deincrement-and-increment-oper.patch

Ah yeah, that would be nice. I saw that #2525 was closed without it being merged. However, I do think that it should be considered, since it seems like a great improvement to the decompiler output. I'm not sure what the best preferred to track that would be though. Maybe the original PR can be reopened? Maybe a new PR can be made with exactly those changes? Either way, it should be tracked in a different place than this issue, since it solves a different (but related) issue.
@ryanmkurtz What would be the preferred way to handle this? Just reopening the original PR seems the most logical to me.

I've reopened it and assigned to @caheckman for triage.

I have been able to get the in-place operators to show with these changes:
diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/printc.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/printc.cc
index b2637c1a5..1139a0813 100644
--- a/Ghidra/Features/Decompiler/src/decompile/cpp/printc.cc
+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/printc.cc
@@ -2340,12 +2340,20 @@ bool PrintC::emitInplaceOp(const PcodeOp *op)

 {
   OpToken *tok;
+
+  const HighVariable *outVar = op->getOut()->getHigh();
+
+  if (op->code() == CPUI_COPY && op->getIn(0)->getDef() != (const PcodeOp *)0) {
+    op = op->getIn(0)->getDef();
+  }
   switch(op->code()) {
   case CPUI_INT_MULT:
+  case CPUI_FLOAT_MULT:
     tok = &multequal;
     break;
   case CPUI_INT_DIV:
   case CPUI_INT_SDIV:
+  case CPUI_FLOAT_DIV:
     tok = &divequal;
     break;
   case CPUI_INT_REM:
@@ -2353,9 +2361,13 @@ bool PrintC::emitInplaceOp(const PcodeOp *op)
     tok = &remequal;
     break;
   case CPUI_INT_ADD:
+  case CPUI_PTRADD:
+  case CPUI_FLOAT_ADD:
     tok = &plusequal;
     break;
   case CPUI_INT_SUB:
+  case CPUI_PTRSUB:
+  case CPUI_FLOAT_SUB:
     tok = &minusequal;
     break;
   case CPUI_INT_LEFT:
@@ -2378,7 +2390,7 @@ bool PrintC::emitInplaceOp(const PcodeOp *op)
     return false;
   }
   const Varnode *vn = op->getIn(0);
-  if (op->getOut()->getHigh() != vn->getHigh()) return false;
+  if (outVar != vn->getHigh()) return false;
   pushOp(tok,op);
   pushVnExplicit(vn,op);
   pushVn(op->getIn(1),op,mods);

So with the provided example, there were actually two issues:

If the PCodeOp passed to PrintC::emitExpression is a CPUI_COPY and not directly a math operation, the logic to emit an in-place operator was not triggered.
If the relevant operator is a CPUI_PTRADD instead of a CPUI_INT_ADD (same for CPUI_PTRSUB/CPUI_INT_SUB), it would also not trigger. Note: I'm not 100% if this is the correct way to implement it because CPUI_PTRADD has a second input - the element size - but it seems to work just fine without doing anything with that.

Additionally, I have also made it so that floating point operations can also be shown in-place.
There are probably still some cases where in-place operators might not show, but I haven't extensively tested it yet.
Note that the PR/patch @jobermayr mentioned will not show ++/-- even with this patch applied, so it would have to be modified (simplest way is probably to directly integrate the feature into the PrintC::emitInplaceOp function).
@caheckman I'm happy to open a PR with both this fix and the increment/decrement feature, if you want.


oic: Add option to make OIC server compatible with OIC 1.0 spec

Some changes were made in 1.1 spec in server payload and those changes were
already implemented in Soletta. Adding now an option to force OIC server
to create payloads as specified in OIC 1.0 spec. This is important
because clients that implements 1.0 spec can't communicate with 1.1
servers. Note that 1.1 clients support both, 1.0 and 1.1 servers.
Signed-off-by: Otavio Pontes<EMAIL_ADDRESS>

fixed and merged


Change wording of "Lint on fly" option

Using an idiom—missing the "the", to boot—seems unfriendly. To someone not familiar with what "on the fly" means, it's confusing. I think a label more along the lines of "Lint as you type" is much more clear and might even allow the sub-label to be removed.

I would love to review a PR that renames it


Upgrade MapDB

Version 1.0.8 (and even v2) are not supported anymore, so upgrade to v3 or 4

Another Eclipse project has already got a CQ approved for MapDB 3.0.5 (CQ15650).
As the fine print on the Eclipse IP website mentions, we don't need to file a CQ anymore to piggyback on this approved use.

Note: There is no longer a requirement to create third party requests for reuse (piggybacks).

As the fine print on the Eclipse IP website mentions, we don't need to file a CQ anymore to piggyback on this approved use.

Do you have a link? Anyway that's great to hear, saves a lot of hassle!

Weird, I'll have to check the Eclipse site and/or mailinglist
But if you go to https://projects.eclipse.org/projects/technology.rdf4j/cq/create, it is mentioned at the bottom (just above the continue button) that a piggyback CQ is not needed anymore

I guess they just didn't update the handbook yet - it's mostly just Wayne editing that I think. I'll ping them and suggest an update.

Hmz, expireOverflow is not available for Sets, only for Maps :-(

After some research, I'd suggest to wait for MapDB 4 (when/if that release becomes available).
MapDB 3 still seems to be slower than version 1 :-/
And for the HDT writer (#232) I'm looking into other options (or stick with 1.0) / rewrite

I'm taking another look at this because I think there are several features of MapDB 3 that are relevant to us, and if we can keep the performance loss at a minimum, it might be worth the cost.

@barthanssens is it ok if I "take over" your issue branch for this? That is: I'll rebase it against the latest main / develop and do some measuring.

@barthanssens is it ok if I "take over" your issue branch for this? That is: I'll rebase your existing branch against the latest main / develop and do some measuring.

Sure :-)


[GH-476] Allow specifying install method for windows_feature resources

Introduces new attribute ['iis']['windows_feature_install_method']
if the node is present its value is passed into any windows_feature
resources as the install_method property

Signed-off-by: dave-q<EMAIL_ADDRESS>Description
Exposes the ability to dictate what install method is used by any windows_feature resources.
Issues Resolved
476
Check List

[x] All tests pass. See TESTING.md for details.
[x] New functionality includes testing.
[x] New functionality has been documented in the README if applicable.

@dave-q please can you also add an entry in the changelog file under the ## Unreleased header

@Xorima So after a bit of fiddling I've got the test's passing. The code in the PR is all working but in my opinion I need to give it one more pass over and tidy it up. But I was hoping to get your opinion on a couple of things.

I've added this helper function to translate 'dism-format' feature names into 'powershell-format', if the install method is powershell - While this works pretty well and saves having to have a conditional in each place that wants a feature managed (to decide which name to use). It also makes the api more flexible, it can accept the additional features node containing either format. However one could argue that its extra complexity and in a way the fact that the 'api' is so 'forgiving' could infact be a little confusing.. I'd be interested to hear your's (or anyone elses) opinion on this. The other option is that all the recipes that install windows features decide which format to use in the recipe and then use that with windows_feature
If we think the that 'translating' the feature name depending on the install method is good then that leaves me with one more questions. Currently I've introduce a helper method in a library AND a wrapper resource. I think it should be one or the other. Either a library that is called in every recipe, that then goes on to called windows_feature. Or we continue to have the wrapper resource and the resource can just define the functionality for 'feature name translation'. Again I'm not sure whats better. I'd lean towards the wrapper resource.. but that maybe due to my background of OOP...

Let me know your thoughts and I can update the PR

@rlaveycal  would you be able to take a look over these changes as a heavy user of the iis cookbook?

I'd lean more to the library-in-resource and use window_feature approach because it avoids having to keep the wrapper resource in API sync. It also avoids the temptation for people to use this resource themselves.

Definetly go with the library method route imo.
The conversion helper method can be refactored to make it more idiomatic ruby wise:

Use map instead of each which will shorten it and remove several intermediate variables
Instead of using splat to pass the feature names in it would be better served by passing an Array to a single parameter. Splat is idomatically used to make a variable number of different parameters into a method, as this takes a single parameter (that may be of variable length) it doesn't really make sense to use splat. Wrap it in Array() to cover the cases where just a string is passed in.

@bmhughes @rlaveycal
Thanks for taking the time to review my PR. I've updated it with your suggestions and all the tests are passing.
I have a couple of questions.

I wasn't sure about Monkey patching the ::Chef::DSL::Recipe class with my helper, but I was told and from doing some reading too, this is the correct way to do this, anyway.. I'm happy if you guys are but if you have a suggestion for a different way, I'm all ears
My initial attempt was incorrect (i just called include IISCookbook::WindowsFeatureHelper directly in the recipe) however I didn't notice that until the site inspec test ran... I would have caught it much sooner, if there was just a basic 'it converges' spec test for all recipes. I'm happy to add them if you think its worth it.

Thanks

@bmhughes @rlaveycal
Thanks for taking the time to review my PR. I've updated it with your suggestions and all the tests are passing.
I have a couple of questions.
1. I wasn't sure about Monkey patching the ::Chef::DSL::Recipe class with my helper, but I was told and from doing some reading too, this is the correct way to do this, anyway.. I'm happy if you guys are but if you have a suggestion for a different way, I'm all ears

2. My initial attempt was incorrect (i just called include IISCookbook::WindowsFeatureHelper directly in the recipe) however I didn't notice that until the site inspec test ran... I would have caught it much sooner, if there was just a basic 'it converges' spec test for all recipes. I'm happy to add them if you think its worth it.

Thanks

You've got a couple of options here depending on where you need the helper method to be available. From a quick scan through I can't see you needing it outside of the custom resource so I wouldn't mix it into the recipe DSL class for this, just include it in the outer resource definition (which I think you already have done) and drop the include to the recipe class.
Something to note is that with how it is now the method will only be mixed into the outer resource definition class (properties etc) and won't be in the action_class(es), if you needed the module methods within the action class(es) as well then that's where the action_class block comes in handy as each action class will yield that on compiliation and include the module within all the actions of the resource.

@lamont-granquist @bmhughes
I appreciate the feedback. You've both made a couple of comments that seemed to be based around the thought that the only place we are using the new attribute (windows_feature_install_method) is in the install.rb resource. It is used in almost every recipe (any starting with mod_) since all those recipes use the windows_feature resource, so we need to pass that into those resources.
We also kind of need to use that Module helper method I added, in all those mod_* recipes since we need to translate the feature name. We could do a switch on the install mode and 'hardcode' the powershell version of feature name in there too
something like
feature_name = ''
if install_method == :windows_powershell do
  feature_name = <powershell format>
else
  feature_name = <dism format>
end

personally I think thats a little messy, but I can see an argument for doing it
anyway, I'm going to hold off making any changes right now just until this is a bit clearer

I know the sticks in the mud hate it but is there any reason those recipes can't go away and be replaced by a resource? A lot of them just seem to be doing the same thing from a quick skim through.

I know the sticks in the mud hate it but is there any reason those recipes can't go away and be replaced by a resource? A lot of them just seem to be doing the same thing from a quick skim through.

I've got no strong opinion one way or the other really, but just so I'm clear what you are suggesting.
The recipes wouldn't exist at all? And people should call them as resources?? That would definitely be a big breaking change wouldn't it? Since anyway who utilised those recipes in a downstream cookbook would get their cookbook broken right?
If the recipes still existed..they would just be calling in to a resource.. much like 90% of them do now anyway. It would just be a resource from this cookbook rather than a core resource. I did take a stab at that in one of my earlier iterations, essentially a windows_feature wrapper that did all of the stuff with install modes and symbols and feature names. But we opted to move away from that as it would be exposed as a resource for others to use and also we'd have to keep the API in sync. I'm happy to put that back on the table if you think that's better.

Yes that's what I meant (I'd wait for someone else to chime in incase I'm missing something obvious though), apologies for the garden path route to it.
The massive breaking change is why I made the sticks in the mud comment, in general we're (sous-chefs) trying to move to resource-only cookbooks where the final implementation is created by the user in a wrapper cookbook that wraps the resources to what they need rather than trying to cover 90% of use cases with a generic recipe. Some people are aginst this because they have to create org specific wrapper cookbooks, but with the right style and some forethough they're very quick to create and have very little substance (the guts of the logic are implemented by the resources) so aren't the end of the world. It's the same paradigm as terraform/ansible when you add a provider or module.
I wouldn't create (or think of it as) a wrapper for the windows_feature though, I (personally) would call it module_install or something along those lines. The fact that is will mostly be a wrapper around windows_feature is irrelevant as the desired outcome of the resource is to install an IIS module, it just happens to use windows_feature to achieve that in the same way as a lot of the other resources in sous cookbooks use package, template etc. The core resources don't undergo massive API changes in general without giving you plenty of notice and warning, so I don't see that as an issue.
That's my 2p anyway.  I reserve the right to be completely wrong 😂.

I can definitely see the benefits of that model for sure.
I'm to familiar with the use cases of chef. I know at my work we have our own internal supermarket so creating a wrapper would be simple enough. But what about companies that don't have that infrastructure and just want to use public recipes directly with some other orchestrating framework? I suppose I'm just speculating now really.
Anyway... For this PR, would a good compromise be to introduce a new resource 'module_install' (much better name) that wraps all that logic nicely and then for now update the recipes to just call that resource so they essentially stay the same but just call the new resource.
Then in the future it would be simple to remove the recipes in a larger breaking change release?

I'm open to the general concensus on that, personally I'd just rip it all out including the attributes and move everything to library/resources. But it certainly is an alternative option and does deal with removing the need to mix that library (or for it to exist at all as @lamont-granquist points out) into the recipe DSL unnecessarily.

So I've taken a lot of what you both suggested on board @bmhughes @lamont-granquist
I noticed that with a little refactoring, the install resource could do all the new work translating feature names and optionally do the starting of the W3SVC service if desired.
This makes the recipes really really basic now, they all just call into the same resource (some call other internal resources too)
If we want to take the route @bmhughes  said of removing the recipes, this would be very easy in the future.
I added some new spec tests for the install resource since it had a little more 'behavior' in it.
I also added a spec test for all the mod_* recipes. I think its a good habit and gives some quick confidence that things aren't broken.
Look forward to hearing your thoughts
Thanks

@Xorima and @bmhughes are you both happy with the way this current PR is?

Released as: 8.1.0


Overlord Dynamic Configuration  not work

description: I use http  http://<OVERLORD_IP>:/druid/indexer/v1/worker  to post a  JSON  request,but response is:
"  textStatus: error
连接网络时发生异常： http://c4-miui-ad-druid-small03.bj:8753/druid/indexer/v1/worker "
how to settle the issue?

dynamic configuration works fine in my cluster(0.16). According to error message, it seems that the host is not reachable. Are you sure you're using the right host address and port ?

dynamic configuration works fine in my cluster(0.16). According to error message, it seems that the host is not reachable. Are you sure you're using the right host address and port ?

I‘m sure that host and address is right.  GET method work ok and response normal,But POST method response error. My druid cluster is 0.13.0

I update  post json to settle the issue!!


⚠ Samsung has degraded performance

In e3f89ab, Samsung (https://samsung.com) experienced degraded performance:

HTTP code: 200
Response time: 2322 ms

Resolved: Samsung performance has improved in c29ff3b.


LMS!

this happen when i set gamemode to 4 LMS

Same, i dont think he is done.

Its still beta @PrinceDark9243 @CalvinDKL

@PrinceDark9243 It looks fine for me, what exactly is wrong there?

Mass

I'm going to close this...


Failing to multistage build distroless image from wolfi-base

Which image/versions are related to this issue/feature request?
cgr.dev/chainguard/wolfi-base
Issue/Feature description
I'm trying to follow the tutorial from https://edu.chainguard.dev/open-source/wolfi/wolfi-with-dockerfiles/ when i try to build the image an error occurs
=> ERROR [builder 2/6] RUN adduser -D nonroot                                       0.3s
------
 > [builder 2/6] RUN adduser -D nonroot:
#0 0.250 adduser: user 'nonroot' in use
------
Dockerfile:4
--------------------
   2 |
   3 |     ARG version=3.11
   4 | >>> RUN adduser -D nonroot
   5 |     WORKDIR /app
   6 |
--------------------
ERROR: failed to solve: process "/bin/sh -c adduser -D nonroot" did not complete successfully: exit code: 1

I even tried to comment the add user line and remove the --user to install pip requirements, as follow on my Dockerfile:
FROM cgr.dev/chainguard/wolfi-base as builder

ARG version=3.11
#RUN adduser -D nonroot
WORKDIR /app

RUN apk add python-$version py${version}-pip

USER nonroot
COPY requirements.txt /app/
RUN  pip3 install -r requirements.txt

FROM cgr.dev/chainguard/python:latest

ARG version=3.11
WORKDIR /app

COPY --from=builder /home/nonroot/.local/lib/python${version}/site-packages /home/nonroot/.local/lib/python${version}/site-packages

COPY inky.py inky.png /app/

ENTRYPOINT [ "python", "/app/inky.py" ]

but i got the error ( even changing the python lib path to /usr/lib/python${version}/site-packages /usr/lib/python${version}/site-packages
Traceback (most recent call last):
  File "/app/inky.py", line 2, in <module>
    import climage
ModuleNotFoundError: No module named 'climage'

when i used the entire wolfi-base image to run the container and reproduce the steps i have success

Closing, i opened issue on the right repo https://github.com/chainguard-dev/edu


If tick is called in futureTickQueue we got exception

Hi,
On our project we call futureTick() in case in stream handler we need to wait for new data to populate. It has internal call to tick() that eventually clears current futureTick queue. In FutureTickQueue in tick() we simply call dequeue() exact amount of times equal to queue length at the tick() beginning. The problem is that we don't check if queue is already empty.

I'm not sure I follow what you're doing, can you provide a gist to reproduce this?
In case you're calling tick() will the loop is running, this is probably where the problem comes from. This should not be done, ever.

@clue Please check this library:
https://github.com/WyriHaximus/reactphp-psr7-stream-converter/blob/master/src/ReactToPSR7Stream.php
Here tick() is called if on read there is no data. If I understand correctly, this is for loop not to block.
I use futureTick to queue read/write pipeline, eg:
public function tick()
{
    while (true) {
        $data = $this->input->read(self::BUFFER);
        if ('' === $data) {
            break;
        }

        // TODO: limit write rate
        $this->output->write($data);
    }

    if (!$this->input->eof()) {
        $this->queueTick();
        return;
    }
    $this->input->close();
    $this->output->close();
    call_user_func($this->result);
}

protected function queueTick()
{
    $this->loop->futureTick([$this, 'tick']);
}

Is this a correct way to implement PSR7->PSR7 pipeline?

Another example:
https://github.com/WyriHaximus/ReactGuzzle/blob/master/src/HttpClientAdapter.php
What if we make a call inside a loop?

Let's ping @WyriHaximus and let's see what he has to add :+1:

@nick4fake it's a horrible hack that I would not recomend :disappointed: , heck I strongly discourage of doing it when there are alternatives. It 'works' but only in most circumstances. That one in particular was made to provide a fully working PSR-7 stream. @clue made a much better way of doing that here. Another place I use it is here, but there I'm doing it because Guzzle uses some funky queue that I have to keep running in order for the adapter to work :disappointed: .

@WyriHaximus thanks for giving some insight! What do you suggest we should do here? Is this something worth fixing or should we look into avoiding this altogether (is this even reasonable?)?

I believe this has been superseded now that #72 is in and the tick() method has been removed :+1:
I'm closing this for now, please feel free to come back with more details if this problem persists and we can reopen this :+1:


ServiceWorker never registered because entry.client.jsx#window.addEventListener("load", ...) is never triggered

Hello,
I've just installed remix-pwa@latest on a pristine<EMAIL_ADDRESS>app (no template, using remix server). The service worker is never registered, I managed to pinpoint the problem to the lack of triggering of the window.addEventListener("load", ...) but can't manage to solve the issue.
This happens both in dev and prod deployments.
Changing to window.addEventListener("click", ...) does work.

Any insight welcome :-)

Regards.

Thank you. I would look at it over the weekend :+1:

hello, any updates about this? facing the same issue

You might have some other issue. For me it works fine. Which browser are you using ?

good point. Basically I have the same situation mentioned above where the load event seemingly wasn't triggered (or the listener wasn't added). if ("serviceWorker" in navigator) returns true though. Changing to click did register the service worker. I was using chrome for that. After testing, the service worked registered just fine on firefox, but not on chrome and safari.

hello, any updates about this? facing the same issue

Nope. Seemed okay to me. I even ran it in an isolated VM to make sure it wasn't any of my settings and it ran just fine

hello, any updates about this? facing the same issue

Nope. Seems okay to me. I even ran it on a different machine to make sure it wasn't any of my settings and it ran just fine

Thanks for the follow up.
Could you quickly write the process you've used to setup the app so I can test your setup?
ie.
(considering node 18 -- optional I think it wont impact)

(important: is it indie stack or no stack or stg else?) install remix (latest) npx create-remix@latest --template remix-run/indie-stack.
install remix pwa (latest) npx remix-pwa@latest
use javascript instead of typescript
Just-In-Time Caching
no additional remix-pwa services

just revisited the project. the window load event now fires as expected on chrome and safari, therefore my issue is resolved. Probably it was a browser bug?

Perhaps. Happy to hear it's been fixed :blush:

This issue is closed due to the issue being resolved. If you have any other issue or further comment, please open a new issue


Add new metrics - Matthews correlation coefficient

Most datasets are unbalanced (different sizes of positive and negative samples); Although F1 score is usually considered as metric; however, it needs to be careful to assign positive samples. If assign in a wrong way, the score will be totally different. One advantage of MMC (Matthews correlation coefficient) can avoid this kind of situation. I'd like to know if it will be considered as an important metric. Thanks.

@autoih Do you want to contribute to Addons by opening a PR?
Also, in the future, we would prefer if you used the template for feature requests.

Thanks @Squadrick. I'd love to contribute this. Yes, I'll use the template in the future.

@autoih Looking forward to the PR.

Reference: Wikipedia


Skype integration with RASA

Is there any way to integrate RASA with skype or any other communication channel like - facebook, telegram, kik...

Rasa NLU doesn't provide implementations for the communication channels. NLU is only part of what you need to build a bot, so you can either take a look at using Rasa Core together with NLU (which will provide you with input channels for facebook and telegram and the possibility to create your own). Alternatively, I think there are other services out there that will allow you to connect to the input channel (e.g. botkit).


[Feature Request]: Get last token from document object

Context

[X] This issue is not a bug report. (please use a different template for reporting a bug)
[X] This issue is not a duplicate of an existing issue. (please use the search to find existing issues)

Description
Description
We are trying to implement our custom language editor but I wanted to ask if there is a method which we can use to get the last token.
i.e:
if expression input is email.substring(1, 2)
We want to have getLastToken() method which returns substring(1, 2)
document.getLastToken() //  returns substring(1, 2)

We are currently using our own helper function by splitting inputs with space
export const getCurrentTextToken = (
  document: monaco.editor.ITextModel,
  position: monaco.Position
): string => {
  const { lineNumber, column } = position;
  const currentText = document
    .getLineContent(lineNumber)
    .slice(0, column - 2);
  const tokens = currentText.split(" ");
  return tokens[tokens.length - 1];
};

The reason why we are NOT splitting it by . is because we also have namespaces(i.e: user.data.email) and we should get the entire object in order to get the return type and show corresponding suggestions.
Please let me know if there is a way to make this work. Thanks in advance!
Monaco Editor Playground Link
No response
Monaco Editor Playground Code
No response

We closed this issue because we don't plan to address it in the foreseeable future. If you disagree and feel that this issue is crucial: we are happy to listen and to reconsider.
If you wonder what we are up to, please see our roadmap and issue reporting guidelines.
Thanks for your understanding, and happy coding!


[5.4] withCount + select returns no results

Laravel Version: 5.4.23
PHP Version: 7.0.12
Database Driver & Version: 10.1.21-MariaDB

Description:
Should return the queried model with the related count.
Steps To Reproduce:
>>> App\Cottage::select('id')->find(2)

=> App\Cottage {#800
     id: 2,
   }

>>> App\Cottage::withCount('rents')->select('id')->find(2)

=> null

How do you have your rents relationship defined in your Cottage model?

Please share the underlaying query using the query logger. @salomoni

closing for lack of activity and being unable to replicate using the given information.


Can i Install Truevote Backend program on a Ubuntu Machine

From the readme file have just read Truevote is written in C#, a programming language widely for developing Windows-based systems.
I extensively use Linux in particular ubuntu for my deployments. I loved everything about Truevote, its proposition, the founders behind this project (the wide programming scope) and more so because Truevote uses bitcoin to secure electoral ballots using opentimestamps(I just learnt 😳 of it from reading about Truevote).
I want to run this project on ubuntu how I can get to do that.

Yes, the back-end services are written in C# .NET Core 9.0. .NET Core can run in Windows, Linux, macOS, and Docker. The current deployed instances of TrueVote services are actually running in Ubuntu in production on Microsoft Azure.


Consolidated causality notebooks

PR for actual causality-related contributions, consolidating materials from multiple other sources
Note: This description will evolve as consolidation efforts progress.
Folder docs/source now contains a folder actual_causality which includes a few subfolders, gathering information/code to prepare the final versions. Most of this will be removed/cleaned up before merging into main:
INCLUDED

preemption_no_log_prob: This is the batch of notebooks used in July, imports updated to match the current shape of    main. We keep them handy because the textual content and examples will be re-used.

Actual causality, responsibility, blame, and explanation rely on random preemptions, and work correctly, including minimality and factivity checks.
contains multiple examples with solutions, which can be used as test cases for the log-prob-based versions
downside: once preemption is used, most of the checks are not reduced to log-prob ranking/comparison

pre_release_versions is meant to contain files that y the end of the process will be released, where the new handlers are employed and AC-related tests are formulated in terms of log probs.

actual_causality.ipynb  contains the most recent version of the actual causality notebook, updated to match the current shape of the handlers in main.

tests_ac contains tests that either test an existing functionality but haven't been refactored and moved to join the other tests for Chirho, or wishes for later functionalities. The purpose of each file is explained at the top of the file in a comment.

test_infer_discrete_ac.py (test) contrasts the correct results provided by sampling with those delivered by infer_discrete.
test_notebooks.py (test) tests if all ac-related notebooks execute without error, useful for keeping them functional while keeping up with main. Despite downgrading sample sizes in the examples and using xdist, they take a few minutes, so they should only be run after rebasing.
test_stacking_BiasedPreemptions.py (wish).  There should be a principled way of representing both witness preemption on an antecedent-intervened variable, and antecedent intervention on a witness preempted variable.

NOT INCLUDED

Does this subsume #236 ?

It now includes all the files from #236 that are needed to move further. #236 can now be safely closed. Would you like me to do so?

This branch is now outdated and will be deleted. A new causality staging branch, ru-causality-staging will be created directly from master, to avoid complications resulting from too many files seen as changed as the result of pull origin master. All explanation-related PRs from now on will be directed at the new staging area.


Scrapping jobs from LinkedIn?

Oof, you don't want to do that; LinkedIn is very against being scraped and employs very good anti-scraping tech. Plus adding such functionality might get the project removed from GitHub...


Create ellipses-and-variadic-templates.md

I guess it's often making a difficult choice between making the code sample as simple as possible to convey the informative or taking the risk of using C++ features that make the example more obscure than it needs to be. :-)
However, there's also the risk of transmitting information that's copy/pasted again and again when there is a better way to write it in  "modern" C++ that all descent compilers support in 2017. That's why I believe:

constexpr should be used here instead of const.
The size in bytes of the type (size_t) will be different on x86 and x64 so auto (or size_t) would be recommended.
Using uniform initialization as it doesn't allow you to implicitly narrow a type into another type: useful here if you'd have compiled under x64 and assigned to an unsigned (32-bit) type.

This seems like a small (but important) contribution, so no Contribution License Agreement is required at this point. We will now review your pull request.
Thanks,
Microsoft Pull Request Bot


Add basic GTK renderer code

Based on the work discussed in #306.

Should I close #306 and move the discussion in here?
@carson-katri I have a question regarding WidgetView:
Currently the update implementation destroys the current widget. A side effect of this is that ModifiedContent elements (which use WidgetView) are destroyed upon update.
I tried implementing a background color modifier, and adding this to a view causes it to be destroyed.
In my own attempt to fix the issue, I have extended WidgetView to take both a build and an update closure - and then from within ModifiedContent I implement it be calling update on the content.
Here's what the WidgetView change looks like:
struct WidgetView<Content: View>: View, AnyWidget, ParentView {
  let build: (UnsafeMutablePointer<GtkApplication>) -> UnsafeMutablePointer<GtkWidget>
  let update: ((Widget) -> Void)?
  let content: Content
  let expand: Bool

  init(build: @escaping (UnsafeMutablePointer<GtkApplication>) -> UnsafeMutablePointer<GtkWidget>,
       update: ((Widget) -> Void)? = nil,
       expand: Bool = false,
       @ViewBuilder content: () -> Content)
  {
    self.build = build
    self.expand = expand
    self.content = content()
    self.update = update
  }

  func new(_ application: UnsafeMutablePointer<GtkApplication>) -> UnsafeMutablePointer<GtkWidget> {
    build(application)
  }

  func update(widget: Widget) {
    if case let .widget(w) = widget.storage {
      if let u = self.update {
        u(widget)
      } else {
        // Rebuild from scratch
        widget.destroy()
      }
    }
  }
...

And the usage from ModifiedContent - I refactored it a bit to be able to handle the two different ways to get an AnyWidget in the same way:
extension ModifiedContent: ViewDeferredToRenderer where Content: View {
  public var deferredBody: AnyView {
    guard let widgetModifier = modifier as? WidgetModifier else {
        return AnyView(content)
    }
    let anyWidget: AnyWidget
    if let anyView = content as? ViewDeferredToRenderer,
       let _anyWidget = mapAnyView(
        anyView.deferredBody,
        transform: { (widget: AnyWidget) in widget }
       )
    {
        anyWidget = _anyWidget
    } else if let _anyWidget = content as? AnyWidget {
        anyWidget = _anyWidget
    } else {
        return AnyView(content)
    }
    return AnyView(WidgetView {
        let contentWidget = anyWidget.new($0)
        widgetModifier.modify(widget: contentWidget)
        return contentWidget
    }
    update: { widget in
        anyWidget.update(widget: widget)

        // Is it correct to run the modifier again after updating?
        // I assume so since the modifier parameters may have changed.
        if case .widget(let w) = widget.storage {
            widgetModifier.modify(widget: w)
        }
    }
    content: {
        if let parentView = anyWidget as? ParentView, parentView.children.count > 1 {
            ForEach(Array(parentView.children.enumerated()), id: \.offset) { _, view in
                view
            }
        } else if let parentView = anyWidget as? ParentView, parentView.children.count == 1 {
            // Is it a worthwile shortcut to not wrap the children in a ForEach when there is only one?
            parentView.children[0]
        }
    })
  }
}

I am not 100% certain that I understand the purpose of WidgetView, so I don't know if my fix is sound. I also don't know if the update should be optional (as I made it now, with the fallback to destroying the widget upon update), or if I should require it always and then always forward the update call instead of destroying.

Yeah, so WidgetView is kind of like the HTML view in TokamakDOM. In some cases conforming to AnyWidget just doesn't work well, for instance, when building a widget with children.
I think the update closure is a good additon, and I don't have a strong opinion on whether it should be Optional or not, but if not then the default behavior should be documented.

I have experimented a bit more, and it appears to make sense to always have it (and never destroy the widget upon update), but have an empty closure of the default, since the only place I've had to do extra work is to forward updates with regards to modifiers.
Should I make PRs against this branch, or would it be better to wait until this PR lands?
Btw: The funniest thing happened yesterday: I searched for some gtk APIs and found the gtk_measure_widget API which is part of GTK 4. That got me curious and I looked at the version history. When I saw that GTK 4 has been in development for many years I gave up hope for using that API any time soon.
Then yesterday evening I saw that GTK 4 was just released!
What a weird coincidence.

Just random thoughts - please ignore if you are busy:
This brings up a question about the goal for Tokamak of which I am a bit uncertain:
I know that it's a goal to provide a SwiftUI compatible API to create apps using other UI 'backends'.
What I don't know is how far it should/could go with regards to implementing the same layout behaviors of SwiftUI.
Again with a reference to objc.io, they seem to gather that SwiftUI has two phases of rendering - first the sizing and then the rendering. I guess that the sizing might not make a whole lot of sense in the DOM world (until the DOM nodes are actually rendered), so there it may not make sense to emulate this behavior.
But for some 'backends' (perhaps including GTK 4 although I am only guessing), it may make sense to take it a step further and see if it's possible to get closer to the layout behavior of SwiftUI too.
So my question - although I know that it's probably kind of vague:
Is it a goal to try and mimick the layout behaviour of SwiftUI?
Might it be possible to extend the API to allow for implementing the sizing behaviour for some 'backends' while skipping it for others?

Is it a goal to try and mimick the layout behaviour of SwiftUI?

Yes, in my opinion it is. I think layout algorithms are crucial enough for people to expect that they behave the same as SwftUI does on all platforms that Tokamak supports. I think we can get pretty close or maybe even get full compatibility with the DOM renderer without re-implementing our own layout engine. And that's great, because binary code size is a big concern on the web, I'd rather rely on CSS or maybe a few bits of JS here and there than ship our own layout engine in every web app built with Tokamak. But shipping a built-in layout engine on other platforms is probably more acceptable.
This will probably require modifying the renderer API, and I don't know how yet. But all suggestions are welcome. I'll tag a new version of carton in the next few days to get CI passing in this PR. Feel free to target the branch of this PR in your own PRs, they'll change their target branch to main automatically after this one is merged.

Here's a bit of discussion on Gtk4:
https://twitter.com/migueldeicaza/status/1336422305224937474?s=21

@TokamakUI/core-team anyone available for review?

Most of the commits here come from @carson-katri, which I approve. If any of the maintainers think that either of these commits or my own commits added on top need to be reverted, let me know. I'm merging this now to unblock the rest of the PRs and to avoid merge conflicts.


refresh Settingfragment

I use ListPreference and chose language. I need to refresh the fragment, when the option from ListPreference was chosen.
I have used a lot of solution, but it is imposible.
How can I resolve this problem.

getActivity().recreate()


Viewer style unification

Addressing https://github.com/mozilla/thimble.mozilla.org/issues/2361
cc @Pomax @humphd @gideonthomas
If any of you could take some time to test this out, I'd really appreciate that. This PR includes updates to...

Image viewer
PDF viewer
Font viewer
Video viewer

Here's a project you can import that contains one of each of those files...

viewer-files.zip

Cheers!

Here's the video viewer as a sample of the changes...

I like where this is heading.  Some functional testing feedback:
When a filename has spaces (or other characters), we need to encodeURI(...) it before we show the user what to use in src="..." and the like.  Consider:

Every viewer except PDF uses the form "... File":

Also, the padding/margin at the top of the PDF title is different than the others, and I'm not sure if the font is the same?  Might just be an illusion based on other fonts in the PDF itself.
I'll look at the code next.

@humphd - the PDF viewer has a weird behaviour where after the PDF loads, it is scrolled down slightly, changing the padding you are seeing at the top of the page. Can you confirm that after opening a PDF you can scroll the page up slightly?

@humphd - the PDF viewer has a weird behaviour where after the PDF loads, it is scrolled down slightly, changing the padding you are seeing at the top of the page. Can you confirm that after opening a PDF you can scroll the page up slightly?

Yeah, that's what it is.  Let's ignore it, unless you really care.

Also, I'm not sure how to localize the PDF viewer to include "File" which is why I omitted it. If it's easy enough to do, we should.

You have to pass it into the iframe via a data attribute::

Make a new string, Strings.PDF_File or something in Thimble/Brackets
Add a data-title attribute to the pdf iframe template here https://github.com/mozilla/brackets/blob/master/src/extensions/extra/PDFView/htmlContent/pdf-view.html#L4-L5
Add it to the template rendering, and use Strings.PDF_FILE or whatever you added above.
Read the values off the <iframe ... data-*> attributes https://github.com/mozilla/brackets/blob/master/src/extensions/extra/PDFView/bramble-pdfjs.js#L5-L8 and then use them in the UI

@humphd here's what I did...

Used encodeURI for image and video file URL
Localized "Image File" title in Image Viewer
Moved string changes for Image Viewer to Thimble

https://github.com/mozilla/thimble.mozilla.org/pull/2377

Filed follow-up issue for localizing the PDF viewer title here:

https://github.com/mozilla/thimble.mozilla.org/issues/2378

@humphd - Okay, the Image, Video and Font viewer now update properly when the filename changes.

This looks like it mostly works, but the video viewer doesn't seem to stay open.  I see this same behaviour for some other file types some of the time, but it's random.

@humphd Yeah I've seen that weird behavior randomly as well where it switches viewers. I'll investigate - let me know if you come up with STRs.

@humphd - also added an audio "viewer" to this PR

Important Update
This is good to test again, but with a caveat...

If you are testing this PR in standalone brackets, then only test if it you load the editor with a non-viewer file as the starting file (so use index.html) for example.

Why? Because there is a bug if the editor starts with a viewer open
If a viewer is open initially, then we never call the destroy method on it when we move to viewing another file and it's markup persists in the DOM
I'll file the issue

Secondly - this is good to test again, I've addressed the weird issue with different viewers showing up out of nowhere that @humphd found

When I try to load the image viewer, I get this:

which is probably due to a missing l10n string:

Another odd thing.  I was on a Font Viewer (works well) and clicked back on an image, and got this:

For some reason there is no position on $container for this one image.  I'm not exactly sure what I did differently, but it's like it lost its DOM elements or something:

I think this is mostly ready to go:

let's fix the code issues I pointed out
let's get the string changes landed in Thimble before we land this
let's land this and file follow-up bugs on it, and fix things we find.

I also wonder if we can re-use code between the various viewers, especially the Audio and Video viewers, which are pretty much identical.  I don' t think that's a blocker, though.


Input Taghelper generates invalid value

Using ASP.NET 5 RC1
Model member:
public DateTime CreatedDate { get; set; }
Razor content:
<input asp-for="CreatedDate" type="datetime-local"<EMAIL_ADDRESS>/>
Expected output
<input type="datetime-local" value="2015-11-21T20:55:17" data-val="true" id="CreatedDate" name="CreatedDate">
Actual output
<input type="datetime-local" value="11/21/2015 8:55:17 PM" data-val="true" id="CreatedDate" name="CreatedDate">
I also tried using asp-format="{0:s}" but that had no effect either.  However, that does work when no value specified.
-- http://www.w3.org/TR/html-markup/input.datetime-local.html#input.datetime-local.attrs.value

@mguinness this behaviour is expected: Unless the value attribute is left null, the InputTagHelper does not perform formatting. Few if any of the MVC tag helpers override attributes explicitly provided in the .cshtml files.
Suggest removing the value attribute entirely. If the DateTime.Now expression is intended as a default for CreatedDate, move that setting elsewhere e.g. into the model type's constructor or the action.

@dougbu - thanks for explaining and solution.  I ended up setting value attribute to @DateTime.Now.ToString("s") for now.

@mguinness that'll work when a Create.cshtml view is initially loaded but doesn't make sense in any view where the model is not initially null. For example, that expression will not reuse the first value when reloading the view due to a validation error.
Please close this issue if the concern is resolved.

@dougbu - I just tried this in view Edit.cshtml where an initialized model is passed, but it's not working as expected.
Date is not formatted correctly with <input asp-for="CreatedDate" type="datetime-local" /> and it has to be overridden with <input asp-for="CreatedDate" type="datetime-local" asp-format="{0:s}" />.
I understand your point about explicitly specifying the value attribute, but an issue exists when it's omitted (unless I'm missing something obvious) - it should be easy to repro.

@mguinness InputTagHelper special cases datetime-local but only when ViewContext.Html5DateRenderingMode == Html5DateRenderingMode.Rfc3339 (see line 356). Otherwise the helper performs the default conversion to string. So, now that you've got value out of the way, you need to either specify asp-format or use Html5DateRenderingMode.Rfc3339.

@dougbu - Ah, didn't know about that enumeration.  Thanks!


Support post-verified partner signup transactional email

https://www.figma.com/file/5HAkM0MfpSzoQj9Ap03W1Y/Account-Auth?type=design&node-id=1-3&mode=design&t=mQssROWn0MzMFB6v-0 Auth Flow 4

Dup of #640


Zero Division Error Fix

Add an if statement to check if len(freq) is 0. If it is, 0 is returned. This prevents zero division error.

Actually thinking about it a bit more, if a word is not present in the frequencies dictionary, then we should assume its frequency is 0 (and have that value influence the mean) instead of ignoring it. We can keep the check you added for the case when a sample has no words at all, but it would be good to also change the line that gets all the frequencies by removing the check that ensures it is in the dictionary and adding 0 as a default argument on get

Ok I think I did it :)

On second thought this won't work as we are taking the log in the end. It should be a value different from 0, possibly 1/10 of the smallest value in the frequencies table. Will take a better look tomorrow.
Sorry about that

@guipenedo Hi! Did you get a chance to look over it? Is it fine as it is or do you think it needs another change?

Yeah let's change the 0 to 1e-9. The lowest frequency is around 2.2e-8, so this seems like a decent enough value for an "unknown" unigram.

Thanks for the help @NicholasLindner


[Iconify — Search Icons] ...

Extension
https://www.raycast.com/destiner/iconify
Description

Error:
Error: Worker terminated due to reaching memory limit: JS heap out of memory

NodeError:errors:393:5
[kOnExit]:worker:277:26
Worker.<computed>.onexit:worker:199:20

Steps To Reproduce

Lunch View Icons command
Start typing waffle and type it fast

Current Behaviour
Showing error page
Expected Behaviour
Show icons

This issue still persists. @Destiner any chance you can have a look? As it stands, the command seems to be unusable 😅
https://user-images.githubusercontent.com/1155589/222105106-7469a460-7dd1-440b-a147-743a91b2964b.mov


Cannot use :version in a route

I am trying to describe the following URL structure:
namespace 'versions' do
  desc "List all versions"
  get

  namespace ':version' do
    desc "Get details about a version
    get
  end
end

Which I expect to make these URLs:
/versions              List all versions
/versions/{version}    Get details about a version

But what ends up being show in Swagger UI/swagger_doc JSON is:
/versions              List all versions
/versions              Get details about a version

I believe this is because of this code: https://github.com/ruby-grape/grape-swagger/blob/5001a64817df78f277b4de67da215bd0f0d3b203/lib/grape-swagger/doc_methods/path_string.rb#L22
I'm not using path versioning. Is there a way to turn this off? Or maybe could Grape and Grape-Swagger use a more specific name (such as {__version}) to avoid collisions?

Hi @justincampbell … mmh, the problem is, that version itself  is a reserved word, and yeah the place you pointed to, there the version will be set, if one was given, but will be build here https://github.com/ruby-grape/grape-swagger/blob/master/lib/grape-swagger.rb
I think you can achieve what you want very simple, without any changes in grape, or grape-swagger, by using version as a parameter, and this is what you want, something like this:
namespace :versions do
  desc 'get all of versions',
       is_array: true
  get do
    # your code goes here
  end

  desc 'get specific version'
  params do
    requires :version
  end
  get ':version' do
    # your code goes here
    present :params, params
  end
end

another version to achieve it, is:
resource :versions do
  desc 'List all version'
  get do
    { params: params }
  end

  route_param :version do
    desc 'Lists a single version'
    get do
      { params: params }
    end
  end
end

Thanks! I'll try those out.

please have in mind, this is only a fix, cause route params actual are not supported, see: https://github.com/ruby-grape/grape-swagger/issues/532


import of a local module is running endlessly

Describe the bug
I tried to import a class from a local python file, that I will call my-module.
import sys
sys.path.insert(0,absolute-path-of-the-directory-of-my-module)
import my-module

This leaded to the cell running endlessly (I stopped it after 15minutes via shutdown), with the buttons to interrupt the run not working.
Environment
{
"marimo": "0.1.86",
"OS": "Linux",
"OS Version": "6.2.0-36-generic",
"Processor": "x86_64",
"Python Version": "3.10.12",
"Binaries": {
"Chrome": "120.0.6099.129",
"Node": "--"
},
"Requirements": {
"black": "24.1.1",
"click": "8.1.7",
"jedi": "0.19.1",
"pymdown-extensions": "10.7",
"starlette": "0.27.0",
"tomlkit": "0.12.0",
"typing_extensions": "4.8.0",
"uvicorn": "0.24.0.post1"
}
}
Code to reproduce
import sys
sys.path.insert(0,absolute-path-of-the-directory-of-my-module)
import my-module

Hi @eugeniemarescaux, thanks for reporting. I'm not able to reproduce this issue, but I would like to help. I have a couple questions:

Can you try running the notebook in the directory where my_module is (without modifying sys.path)? I'd like to see if the issue is with the path modification or the import itself.
If possible, can you share the source code of my-module, or a simplified version of it that still causes marimo to hang on import?

Hi @akshayka ,
Thanks for your help :)
I have investigated further, and the issue seems to be with an import done in mymodule. Unfortunately, the core of the problem seems to be an import of code from my company, which I cannot share :/
The closer to the issue I got was
from mycompanymodule.submodule1.submodule2 import MyClass
print("hey")
MyClass()

Doing that, the cell runs endlessly and cannot be interrupted, but "hey" has been printed and the import has worked.
It returns:
hey
Traceback (most recent call last):

TypeError: MyClass.__init__() missing 1 required positional argument: 'myargname'

Thanks for sharing. That's helpful but I still can't reproduce, though I feel we're closer!
Can I ask you to try two things?

Try with an older marimo version 0.1.79 (pip install marimo==0.1.79) and see if the issue still exists there
Create a file called foo.py, with the following code:

class Foo:
    def __init__(self, arg):
        pass

Save the below to import_test.py, then run marimo edit import_test.py. For me I see an error like yours but the cell finishes running in just a few milliseconds. I'm curious whether this notebook runs endlessly for you.
import marimo

__generated_with = "0.1.86"
app = marimo.App()

@app.cell
def __():
    from foo import Foo
    print('hey')
    Foo()
    return Foo,

if __name__ == "__main__":
    app.run()

I tried your suggestions, and the issue persists with the older marimo version. The problem doesn't appear with import_test, it runs quickly and properly.
In case it would help, some additional information: ̀import mycompanymoduleandfrom mycompanymodule import submodule1both work and finish in a finite time. Butfrom mycompanymodule.submodule1 import submodule2` runs endlessly.
The file architecture is as follow : mycompanymodule/submodule1/submodule2.py

Thanks. And just to confirm, a cell containing just the following line hangs?
from mycompanymodule.submodule1 import submodule2

It's curious that
from mycompanymodule.submodule1.submodule2 import MyClass
print("hey")
MyClass()

successfully emits the print statement and TypeError, but still hangs

Is there anything special about submodule2?

When you import it outside of marimo, say in the Python repl, is anything printed to the console? I'm wondering if there's an edge case in how we handle console output that gets hit when submodule2 is imported.
If I had the code of submodule2, I would try deleting blocks of code from it until the import worked, and then try to figure out what code marimo was tripped up on.
I would also try running marimo with marimo -l debug -d edit your_notebook.py and see if the logs told me anything helpful

@eugeniemarescaux , one more question that would provide me with more information:

Does the cell hang in run mode? i.e., marimo run your_notebook.py

Thanks to your pointers, I have been able to isolate the problem !
If I put the following code in foo.py
from multiprocessing import Manager
mymanager = Manager().dict()

class Foo:
    def __init__(self, arg):
        pass

and reuse the same import_test.py from your previous message (https://github.com/marimo-team/marimo/issues/684#issuecomment-1917530826), the cell runs endlessly on my machine - with the expected output:
hey
Traceback (most recent call last):
  Cell /tmp/marimo_98667/__marimo__cell_Hbol__output.py, line 3
    Foo()
TypeError: Foo.__init__() missing 1 required positional argument: 'arg'

Sorry for the delay, I was on holiday. I just tested the latest version (0.2.4) and the problem is gone. Thanks a lot !