NPE parsing var declaration with no assignment

File:
component {
  function test () {
	  var foo.bar('baz');
  }
}

Result:
com.cflint.exception.CFLintScanException: java.lang.NullPointerException
	at com.cflint.CFLint.process(CFLint.java:347)
	at com.cflint.CFLint.scan(CFLint.java:295)
	at com.cflint.CFLint.scan(CFLint.java:206)
	at com.cflint.api.CFLintAPI.scan(CFLintAPI.java:65)
	at com.cflint.cli.CFLintCLI.execute(CFLintCLI.java:371)
	at com.cflint.cli.CFLintCLI.main(CFLintCLI.java:339)
Caused by: java.lang.NullPointerException
	at org.antlr.v4.runtime.tree.AbstractParseTreeVisitor.visit(AbstractParseTreeVisitor.java:18)
	at cfml.parsing.cfscript.walker.CFExpressionVisitor.visitLocalAssignmentExpression(CFExpressionVisitor.java:174)
	at cfml.parsing.cfscript.walker.CFExpressionVisitor.visitLocalAssignmentExpression(CFExpressionVisitor.java:77)
	at cfml.CFSCRIPTParser$LocalAssignmentExpressionContext.accept(CFSCRIPTParser.java:5480)
	at org.antlr.v4.runtime.tree.AbstractParseTreeVisitor.visit(AbstractParseTreeVisitor.java:18)
	at cfml.parsing.cfscript.walker.CFScriptStatementVisitor.visitStatement(CFScriptStatementVisitor.java:278)
	at cfml.parsing.cfscript.walker.CFScriptStatementVisitor.visitStatement(CFScriptStatementVisitor.java:100)
	at cfml.CFSCRIPTParser$StatementContext.accept(CFSCRIPTParser.java:2352)
	at org.antlr.v4.runtime.tree.AbstractParseTreeVisitor.visitChildren(AbstractParseTreeVisitor.java:46)
	at cfml.parsing.cfscript.walker.CFScriptStatementVisitor.visitCompoundStatement(CFScriptStatementVisitor.java:254)
	at cfml.parsing.cfscript.walker.CFScriptStatementVisitor.visitCompoundStatement(CFScriptStatementVisitor.java:100)
	at cfml.CFSCRIPTParser$CompoundStatementContext.accept(CFSCRIPTParser.java:2179)
	at org.antlr.v4.runtime.tree.AbstractParseTreeVisitor.visit(AbstractParseTreeVisitor.java:18)
	at cfml.parsing.cfscript.walker.CFScriptStatementVisitor.visitFunctionDeclaration(CFScriptStatementVisitor.java:176)
	at cfml.parsing.cfscript.walker.CFScriptStatementVisitor.visitFunctionDeclaration(CFScriptStatementVisitor.java:100)
	at cfml.CFSCRIPTParser$FunctionDeclarationContext.accept(CFSCRIPTParser.java:642)
	at org.antlr.v4.runtime.tree.AbstractParseTreeVisitor.visitChildren(AbstractParseTreeVisitor.java:46)
	at cfml.CFSCRIPTParserBaseVisitor.visitElement(CFSCRIPTParserBaseVisitor.java:48)
	at cfml.CFSCRIPTParser$ElementContext.accept(CFSCRIPTParser.java:563)
	at org.antlr.v4.runtime.tree.AbstractParseTreeVisitor.visitChildren(AbstractParseTreeVisitor.java:46)
	at cfml.CFSCRIPTParserBaseVisitor.visitComponentGuts(CFSCRIPTParserBaseVisitor.java:160)
	at cfml.CFSCRIPTParser$ComponentGutsContext.accept(CFSCRIPTParser.java:2245)
	at org.antlr.v4.runtime.tree.AbstractParseTreeVisitor.visit(AbstractParseTreeVisitor.java:18)
	at cfml.parsing.cfscript.walker.CFScriptStatementVisitor.visitComponentDeclaration(CFScriptStatementVisitor.java:115)
	at cfml.parsing.cfscript.walker.CFScriptStatementVisitor.visitComponentDeclaration(CFScriptStatementVisitor.java:100)
	at cfml.CFSCRIPTParser$ComponentDeclarationContext.accept(CFSCRIPTParser.java:431)
	at org.antlr.v4.runtime.tree.AbstractParseTreeVisitor.visitChildren(AbstractParseTreeVisitor.java:46)
	at cfml.CFSCRIPTParserBaseVisitor.visitScriptBlock(CFSCRIPTParserBaseVisitor.java:20)
	at cfml.parsing.cfscript.walker.CFScriptStatementVisitor.visitScriptBlock(CFScriptStatementVisitor.java:108)
	at cfml.parsing.cfscript.walker.CFScriptStatementVisitor.visitScriptBlock(CFScriptStatementVisitor.java:100)
	at cfml.CFSCRIPTParser$ScriptBlockContext.accept(CFSCRIPTParser.java:257)
	at org.antlr.v4.runtime.tree.AbstractParseTreeVisitor.visit(AbstractParseTreeVisitor.java:18)
	at cfml.parsing.CFMLParser.parseScript(CFMLParser.java:539)
	at com.cflint.CFLint.process(CFLint.java:338)
	... 5 more
Error: "java.lang.NullPointerException" Location: com.cflint.CFLint.process(CFLint.java:347)

Version 1.4.1.

Workaround: Remove the unnecessary var.

If the var here doesn't do anything, I don't think this is worth addressing. In that case, it's not a proper language construct and one of the CFML engines just happens to ignore it.

Yeah, that's a good point. It's not really valid code, but it seems to work OK in Lucee 4.5/5. Still, I'd like to see a PARSE_ERROR for any invalid code, rather than a NullPointerException.
Oddly, ACF's compile also produces an NPE when compiling similar code: https://trycf.com/gist/5c1ad2a8d21d222366ec4e1ce4f57b00/acf2018

If the NPE is not being caught then that is an issue worth addressing.
You should really be testing with the latest dev snapshot before reporting to ensure that the issue has not already been fixed. I've run your sample on the 1.5.0 snapshot through the CLI, and it appears to be able to parse.

Is there a place where I can download a JAR of the dev branch? I haven't
gotten set up to build the project myself yet.
On Tue, Oct 15, 2019 at 4:51 PM KamasamaK<EMAIL_ADDRESS>wrote:

If the NPE is not being caught then that is an issue worth addressing.
You should really be testing with the latest dev snapshot before
reporting to ensure that the issue has not already been fixed. I've run
your sample on the 1.5.0 snapshot through the CLI, and it appears to be
able to parse.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/cflint/CFLint/issues/648?email_source=notifications&email_token=AABQQN6556A3GY22JQFGJJLQOYUNFA5CNFSM4JBA3AGKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEBKFV7A#issuecomment-542399228,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AABQQNZRVQLAR6HDC7UHX7TQOYUNFANCNFSM4JBA3AGA
.

@sbleon No, snapshots don't get releases. Building is very simple. You just need JDK8 installed and run the command gradlew build. See Building CFLint.


CaptureAndSaveAsync saving the same picture over and over again

I'm generating a QR Code...once generated I automatically save the screenshot and get the path....then I go back one page and generate another QR Code but when saving the screenshot this time the saved image is the same as previous.....haven´t found a way to dispose of the previous capture without closing the app.
the new path and image is correctly generated and saved....but the screenshot are all the same...the QR Code changes in my app but in the screenshot is always the first generated QR Code.
To Reproduce
Steps to reproduce the behavior:

with a button save a screenshot with CaptureAndSaveAsync
go back to the button page
press the button again
See error

Expected behavior
every time the button is pressed the generated screenshot is different from the last one

This solved in this PR #9


Publishing collection of INotifications

In v2.1 I was able to loop through a collection of INotifications and publish the events since it used var notificationType = notification.GetType(); to determine the exact notification type of the handlers to execute.  In v3, it uses var notificationType = typeof(TNotification);, which causes it to look for handlers that implement IAsyncNotificationHandler.  Can this be changed back to the original behavior?

Not sure what the problem is, do you have a snippet that shows the bad behavior? I want to write a test for this and I'm not sure what I'm aiming for.

Here is a variation of the unit test.  I collect a list of events and then publish them at the end of my process, so the list could contain different types.
[Fact]
        public async Task Should_resolve_handler_for_list_of_generic_notifications()
        {
            var builder = new StringBuilder();
            var writer = new StringWriter(builder);

            var container = new Container(cfg =>
            {
                cfg.Scan(scanner =>
                {
                    scanner.AssemblyContainingType(typeof(AsyncPublishTests));
                    scanner.IncludeNamespaceContainingType<Ping>();
                    scanner.WithDefaultConventions();
                    scanner.AddAllTypesOf(typeof(IAsyncNotificationHandler<>));
                });
                cfg.For<TextWriter>().Use(writer);
                cfg.For<IMediator>().Use<Mediator>();
                cfg.For<SingleInstanceFactory>().Use<SingleInstanceFactory>(ctx => t => ctx.GetInstance(t));
                cfg.For<MultiInstanceFactory>().Use<MultiInstanceFactory>(ctx => t => ctx.GetAllInstances(t));
            });

            var mediator = container.GetInstance<IMediator>();

            var pings = new List<INotification>()
            {
                new Ping {Message = "Ping"}
            };

            foreach (var ping in pings)
            {
                await mediator.Publish(ping);
            }

            var result = builder.ToString().Split(new[] { Environment.NewLine }, StringSplitOptions.None);
            result.ShouldContain("Ping Pong");
        }

Ah, makes sense.

I was able to get it to work by adding the handler wrappers back in.  Let me know what you think.
https://github.com/jbogard/MediatR/compare/master...jblackburn21:feature/NotificationHandlerWrapper?expand=1
Also, thanks for fixing my other issue.  I was able to verify it after I got this working.

I am running into this as well when dynamically publishing notifications.
I added a failing test here: https://github.com/remcoros/MediatR/commit/244659d8e8392508368a00b4d49f318bf13b5569
Note that it publishes using the notification base type like this:
INotification ping = new Ping()
mediatr.Publish(ping);

As @jblackburn21 said, this is because typeof(TNotification) is used instead of notification.GetType() as the notification type.


feat: add a check for remote references in values.schema.json

Resolves https://github.com/redhat-certification/chart-verifier/issues/353
Related to: https://issues.redhat.com/browse/OCPBUGS-14665, https://github.com/janus-idp/helm-backstage/pull/66

OpenShift dev console Helm chart catalog doesn't support $refs other than those that start with # (local reference), all remote references should flag the chart as failing.
Adds a NotContainValuesSchemaRemoteRef check
Creates new profile version including this new check
This check is Manadatory for Community as well - I'm not sure how to handle this, but I don't think Community charts should be allowed to break the Dev Console
The check is based on regex, you may want to change this to traversing the JSON schema - I just though this is much simpler way to check it, if you have concerns I will try spending more time here.
I'm not sure if I've updated the profiles/default profile/profile tests properly.

Please provide feedback if I'm heading in the right direction.

Closing this as the associated OCP bug has been resolved.


[Task]: Add Java thread information in the Plugin Module

This is required to rule out the possibility of blocking IO operations on main thread.
From the #monitoring channel, we found out that the /actions/execute API calls have the highest frequency of getting invoked and the presence of any blocking IO in this call affects our entire system adversely.
This task aims to add logs in the plugin module for Java threads from the execute() function call.
Ref: https://theappsmith.slack.com/archives/C01EDBBC4JW/p1723118766951209?thread_ts=1723116189.088799&cid=C01EDBBC4JW
Why?
Help in minimizing production downtimes.

Tried updating the lombok package version, reconfiguring the pom.xml files but it does not help. For some reason, the logger does not work within the /appsmith-plugins directory.
If this does not work the alternative approach would be to add System.out.println()
cc: @nidhi-nair @manish535 if you have any ideas on what could be the reason for this please guide.

Created another issue here for fixing the logging in plugins directory as it needs more research.
Working on the current task with another approach.


ModuleNotFoundError: No module named 'pip' on github/codeql-action/analyze

I'm trying to call github/codeql-action/analyze@v2 in my workflow. It ran fine 5 days ago. When I reran for the same commit today it failed
the failed job
  codeql:
    name: security-scan
    runs-on: ubuntu-latest

    strategy:
      fail-fast: false
      matrix:
        language: [python]

    steps:
      - name: Checkout repository
        uses: actions/checkout@v2

      - name: Initialize CodeQL
        uses: github/codeql-action/init@v2
        with:
          languages: ${{ matrix.language }}

      - name: Autobuild
        uses: github/codeql-action/autobuild@v2

      - name: Perform CodeQL Analysis
        uses: github/codeql-action/analyze@v2

output from the run
/opt/hostedtoolcache/CodeQL/0.0.0-20221123/x64/codeql/codeql version --format=terse
 2.11.4

  /home/runner/.cache/pypoetry/virtualenvs/my-project-SllqOPWN-py3.10/bin/python -c import os; import pip; print(os.path.dirname(os.path.dirname(pip.__file__)))
  Traceback (most recent call last):
    File "<string>", line 1, in <module>
  ModuleNotFoundError: No module named 'pip'
  Error: The process '/home/runner/.cache/pypoetry/virtualenvs/my-project-SllqOPWN-py3.10/bin/python' failed with exit code 1
  Error: The process '/home/runner/.cache/pypoetry/virtualenvs/my-project-SllqOPWN-py3.10/bin/python' failed with exit code 1
      at ExecState._setResult (/home/runner/work/_actions/github/codeql-action/v2/node_modules/@actions/exec/lib/toolrunner.js:592:25)
      at ExecState.CheckComplete (/home/runner/work/_actions/github/codeql-action/v2/node_modules/@actions/exec/lib/toolrunner.js:575:18)
      at ChildProcess.<anonymous> (/home/runner/work/_actions/github/codeql-action/v2/node_modules/@actions/exec/lib/toolrunner.js:469:27)
      at ChildProcess.emit (node:events:390:28)
      at maybeClose (node:internal/child_process:1064:16)
      at Process.ChildProcess._handle.onexit (node:internal/child_process:301:5)

Happy to submit any other relevant information if anything's missing. Any guidance is appreciated!

@RasmusWL  virtualenvs.options.no-pip is not set in my pyproject.toml.
I was able to find a work around however.

I was using github/codeql-action/autobuild@v2 to build the project in this job. I removed that and built the project the project the same way I do in other workflows.
I also needed to specify to codeql which python to use

/opt/hostedtoolcache/CodeQL/0.0.0-20221123/x64/codeql/codeql version --format=terse
2.11.4
/home/runner/.cache/pypoetry/virtualenvs/my-project-SllqOPWN-py3.10/bin/python -c import os; import pip; print(os.path.dirname(os.path.dirname(pip.file)))
Traceback (most recent call last):
File "", line 1, in
ModuleNotFoundError: No module named 'pip'
Error: The process '/home/runner/.cache/pypoetry/virtualenvs/my-project-SllqOPWN-py3.10/bin/python' failed with exit code 1
Error: The process '/home/runner/.cache/pypoetry/virtualenvs/my-project-SllqOPWN-py3.10/bin/python' failed with exit code 1
at ExecState._setResult (/home/runner/work/_actions/github/codeql-action/v2/node_modules/@actions/exec/lib/toolrunner.js:592:25)
at ExecState.CheckComplete (/home/runner/work/_actions/github/codeql-action/v2/node_modules/@actions/exec/lib/toolrunner.js:575:18)
at ChildProcess. (/home/runner/work/_actions/github/codeql-action/v2/node_modules/@actions/exec/lib/toolrunner.js:469:27)
at ChildProcess.emit (node:events:390:28)
at maybeClose (node:internal/child_process:1064:16)
at Process.ChildProcess._handle.onexit (node:internal/child_process:301:5)


IndexError raised when plotting ICA sources using evoked data

Description of the problem
Using ICA.plot_sources raises an IndexError under specific circumstances. The circumstances are:
-- User is plotting using evoked input
-- User requests to plot a selection of ICA components with gaps (e.g. [0, 2] does not work, but [0, 1, 2] does)
Steps to reproduce
import os
import mne
from mne.preprocessing import ICA

sample_dir = mne.datasets.sample.data_path()
sample_raw = os.path.join(sample_dir, 'MEG', 'sample', 'sample_audvis_raw.fif')
raw = mne.io.read_raw_fif(sample_raw)

raw.crop(tmax=40)
raw.pick_types(meg='mag')
raw.load_data()

ica = ICA(n_components=10)
ica.fit(raw)

epochs = mne.make_fixed_length_epochs(raw)
evoked = epochs.average()

ica.plot_sources(epochs, picks=0)       # Works fine
ica.plot_sources(epochs, picks=[0, 1])  # Works fine
ica.plot_sources(epochs, picks=1)       # Works fine

ica.plot_sources(evoked, picks=0)       # Works fine
ica.plot_sources(evoked, picks=[0, 1])  # Works fine
ica.plot_sources(evoked, picks=1)       # IndexError

Link to data
No response
Expected results
No index error and the corresponding plot.
Actual results
Traceback (most recent call last):
  File "K:\Code\SR-switches-analysis-meg\scratch.py", line 25, in <module>
    ica.plot_sources(evoked, picks=1)       # IndexError
  File "C:\Users\Joshua\anaconda3\envs\mne2023\lib\site-packages\mne\preprocessing\ica.py", line 2226, in plot_sources
    return plot_ica_sources(self, inst=inst, picks=picks,
  File "C:\Users\Joshua\anaconda3\envs\mne2023\lib\site-packages\mne\viz\ica.py", line 112, in plot_ica_sources
    fig = _plot_ica_sources_evoked(
  File "C:\Users\Joshua\anaconda3\envs\mne2023\lib\site-packages\mne\viz\ica.py", line 689, in _plot_ica_sources_evoked
    color, style = label_props[ii]
IndexError: list index out of range

Additional information
mne:              1.3.1
numpy:            1.23.5 {MKL 2022.1-Product with 4 threads}
scipy:            1.10.1
matplotlib:       3.7.1 {backend=QtAgg}

sklearn:          1.2.1
numba:            0.56.4
nibabel:          5.0.1
nilearn:          0.10.0
dipy:             1.6.0
openmeeg:         2.5.5
cupy:             Not found
pandas:           1.5.3
pyvista:          0.38.3 {OpenGL 4.5.0 - Build <IP_ADDRESS>2 via Intel(R) UHD Graphics 620}
pyvistaqt:        0.9.1
ipyvtklink:       0.2.2
vtk:              9.2.6
qtpy:             2.3.0 {PyQt5=5.15.6}
ipympl:           Not found
pyqtgraph:        0.13.2
pooch:            v1.7.0

mne_bids:         Not found
mne_nirs:         Not found
mne_features:     Not found
mne_qt_browser:   0.4.0
mne_connectivity: Not found
mne_icalabel:     Not found

If there is not a simple solution to this distinctive bug, I would be happy to look into the problem further myself.

This does seem like a bug, please do investigate @jCalderTravis !


Long image screenshot is incomplete, please help me!

The following is the playwright version and code sample：
com.microsoft.playwright
playwright
1.17.0
public static void main(String[] args) throws Exception {
try (Playwright playwright = Playwright.create()) {
Browser browser = playwright.chromium().launch();
Page page = browser.newPage();
page.addInitScript(Paths.get("./scroll.js"));
Page.NavigateOptions navigateOptions = new Page.NavigateOptions();
navigateOptions.setWaitUntil(WaitUntilState.NETWORKIDLE);
page.navigate("https://www.meipian.cn/3eh6t1fr", navigateOptions);
while (true) {
page.keyboard().down("PageDown");
TimeUnit.MILLISECONDS.sleep(500);
Boolean isBottom = (Boolean) page.evaluate("isBottom()");
if (isBottom) {
TimeUnit.MILLISECONDS.sleep(500);
break;
}
}
page.evaluate("scrollTop()");
    TimeUnit.MILLISECONDS.sleep(1000);
    Page.ScreenshotOptions screenshotOptions = new Page.ScreenshotOptions();
    screenshotOptions.setFullPage(true);
    byte[] screenshot = page.screenshot(screenshotOptions);
    byte2image(screenshot, "./tmp.jpg");
    System.out.println("over!");
    browser.close();
}

}

It's not clear for us what you are trying to achieve and what the issue is. Keep in mind that we discourage from using time.sleep see here: https://playwright.dev/java/docs/next/multithreading#pagewaitfortimeout-vs-threadsleep

Closing as part of the triage process since it seemed stale. Please create a new issue with a detailed reproducible or feature request if you still face issues.


Support for generated sources

Allow C, C++, Objective-C source and header files and Swift source files to be generated prior to compilation and IDE import. Support generated test source files.

This currently works for sources generated within a project, but fails for generated public headers across projects.

See #994 for the generated public headers. This issue should tie up whatever is missing to support generated sources such as reviewing all open issues on the board to either close them, prioritize them or write more sample to demonstrate.

I find the current approach (aka using ConfigurableFileCollection) to be satisfying for solving this roadmap item. There's a bug and addressing it will not change the direction for supporting generated sources. Let's close this issue, fix issue #994 as a bug fix and open new issues with specific use-cases that we may have missed with this feature.

Both Swift and https://github.com/gradle/native-samples/tree/master/cpp/source-generation have samples showing how to generate sources.


Missing types for @nuxt/test-utils/playwright

Hey,
Today I used patch-package to patch<EMAIL_ADDRESS>for the project I'm working on.
Main branch already has these changes and it fixes issue where I am not able to import from @nuxt/test-utils/playwright due to missing types.
import { expect, test } from '@nuxt/test-utils/playwright'

Here is the diff that solved my problem:
diff --git<EMAIL_ADDRESS><EMAIL_ADDRESS>index 2bc5c2e..e0d7b15 100644
---<EMAIL_ADDRESS>+++<EMAIL_ADDRESS>@@ -23,6 +23,7 @@
     "dist",
     "config.d.ts",
     "e2e.d.ts",
+    "playwright.d.ts",
     "experimental.d.ts",
     "module.d.ts",
     "runtime.d.ts",
diff --git<EMAIL_ADDRESS><EMAIL_ADDRESS>new file mode 100644
index 0000000..1b71747
--- /dev/null
+++<EMAIL_ADDRESS>@@ -0,0 +1 @@
+export * from './dist/playwright'

But as I can see these changes are already on main branch. Is it possible to create minor release / tag in order to fix it?
As you can see both playwright.d.ts and files inpackage.json are missing from 3.12.0 release.

I'm having the same problem with version<EMAIL_ADDRESS>

Thanks for the reply!

But as I can see these changes are already on main branch. Is it possible to create minor release / tag in order to fix it?
As you can see both playwright.d.ts and files inpackage.json are missing from 3.12.0 release.

Looks like already fixed in https://github.com/nuxt/test-utils/pull/797

I'm waiting for the release of a fixed version :)

Thanks @danielroe! 🙇🏻
New release: https://github.com/nuxt/test-utils/releases/tag/v3.12.1


Enhancement - Conditional plugin support

What's the issue?
For some organizations, a monorepo of application manifests can contain a mix of different deployment mechanisms, especially when different teams with different preferences for things like Helm/Kustomize/etc are handling different deployments. If each of those deployments uses a standard structure that Argo natively understands, ApplicationSets can handle that with no issue.
However, if some of those manifests require special deployment logic (kustomized-helm, for example), the current ApplicationSet generators are basically all-or-nothing deals, mainly because of the fact that pluginSpec is a map and an ApplicationSpec can't just contain a name field with an empty string (otherwise this could be handled by setting or not setting a plugin value in settings file if we were using the git file generator.
(Potential) Solution: Allow maps to be substituted
The current git file generator only seems to support substituting values as strings, adding map support could address this use case (and potentially others down the line)
apiVersion: argoproj.io/v1alpha1
kind: ApplicationSet
metadata:
  name: sample
spec:
  generators:
  - git:
      repoURL: https://github.com/argoproj-labs/applicationset.git
      revision: HEAD
      files:
      - path: "examples/git-generator-files-discovery/cluster-config/**/config.json"
  template:
    metadata:
      name: '{{cluster.name}}-guestbook'
    spec:
      project: default
      source:
        repoURL: https://github.com/argoproj-labs/applicationset.git
        targetRevision: HEAD
        path: "examples/git-generator-files-discovery/apps/guestbook"
      destination:
        server: https://kubernetes.default.svc
        namespace: guestbook
        '{{ plugin }}'

If we want to include a plugin, we add this to our config.json for a given app
{
  "plugin": {
    "name": "kustomized-helm"
  }
}

If not, we either explicitly set plugin to be empty {}, or else omit the key, and the generator can just drop the plugin field from the generated ApplicationSpec

@rbkaspr Did you ever a figure out a workaround for this?
I am in a similar boat where the entire cluster is deployed using a single ApplicationSet utilizing Helm. However, one of the deployments requires Kustomize and that means I need to either deploy it separately or add kustomization.yaml for every project. Neither is ideal.

anyone found a workaround maybe with the latest changes as the gotemplate sprig functions https://github.com/Masterminds/sprig ?
Or another workouround that allows applications with or without plugins from the same application set?

Hello, is there already a solution to this problem available? I have the same requirement.


Prometheus remote_write server returned HTTP status 405 method not allowed

Hi All,
I am working on sending data from prometheus to elasticsearch using remote_write in k8s and I am using Prometheus 2.28 image.
Below is the remote write configuration defined in configMap (k8s).
---
kind: ConfigMap
apiVersion: v1
metadata:
  name: monitor-config
data:
  prometheus.yml: |-
    global:
      scrape_interval: 5s
      evaluation_interval: 5s
    scrape_configs:
      - job_name: opensearch
        scrape_interval: 10s
        metrics_path: "/_prometheus/metrics"
        scheme: https
        static_configs:
        - targets:
          - opensearch-cluster-master:9200
          - opensearch-cluster-data:9200
        tls_config:
          insecure_skip_verify: true
        basic_auth:
          username: 'admin'
          password: 'admin'
    remote_write:
      - url: "https://opensearch-cluster-master:9200/write"
        remote_timeout: 30s
        queue_config:
          capacity: 10000
          max_shards: 10
          min_shards: 2
          max_samples_per_send: 5000
          batch_send_deadline: 30m
          min_backoff: 50ms
          max_backoff: 1s
        basic_auth:
          username: 'admin'
          password: 'admin'
        tls_config:
          insecure_skip_verify: true
  datasource.yml: |-
    apiVersion: 1
    datasources:
    - name: Prometheus
      type: prometheus
      url: http://<IP_ADDRESS>:9090

Once the prometheus pod starts running below is the error I am getting in pod logs,

ts=2022-04-18T09:35:06.123Z caller=dedupe.go:112 component=remote level=error remote_name=e3afd4 url=https://opensearch-cluster-master:9200/write msg="non-recoverable error" count=495 exemplarCount=0 err="server returned HTTP status 405 Method Not Allowed: {"error":"Incorrect HTTP method for uri [/write] and method [POST], allowed: [DELETE, GET, HEAD, PUT]","status":405}"**

[root@k8master1 prometheus-grafana]# kubectl logs monitoring-6c7546db6c-h9djx -n es -c prometheus -f
level=info ts=2022-04-18T09:34:16.086Z caller=main.go:148 msg="Experimental remote-write-receiver enabled"
level=info ts=2022-04-18T09:34:16.089Z caller=main.go:388 msg="No time or size retention was set so using the default time retention" duration=15d
level=info ts=2022-04-18T09:34:16.089Z caller=main.go:426 msg="Starting Prometheus" version="(version=2.28.0, branch=HEAD, revision=ff58416a0b0224bab1f38f949f7d7c2a0f658940)"
level=info ts=2022-04-18T09:34:16.089Z caller=main.go:431 build_context="(go=go1.16.5, user=root@32b9079a2740, date=20210621-15:45:36)"
level=info ts=2022-04-18T09:34:16.089Z caller=main.go:432 host_details="(Linux 3.10.0-957.el7.x86_64 #1 SMP Thu Nov 8 23:39:32 UTC 2018 x86_64 monitoring-6c7546db6c-h9djx (none))"
level=info ts=2022-04-18T09:34:16.089Z caller=main.go:433 fd_limits="(soft=1048576, hard=1048576)"
level=info ts=2022-04-18T09:34:16.089Z caller=main.go:434 vm_limits="(soft=unlimited, hard=unlimited)"
level=info ts=2022-04-18T09:34:16.094Z caller=web.go:541 component=web msg="Start listening for connections" address=<IP_ADDRESS>:9090
level=info ts=2022-04-18T09:34:16.095Z caller=main.go:807 msg="Starting TSDB ..."
ts=2022-04-18T09:34:16.098Z caller=log.go:124 component=web level=info msg="TLS is disabled." http2=false
level=info ts=2022-04-18T09:34:16.102Z caller=head.go:780 component=tsdb msg="Replaying on-disk memory mappable chunks if any"
level=info ts=2022-04-18T09:34:16.102Z caller=head.go:794 component=tsdb msg="On-disk memory mappable chunks replay completed" duration=6.709µs
level=info ts=2022-04-18T09:34:16.102Z caller=head.go:800 component=tsdb msg="Replaying WAL, this may take a while"
level=info ts=2022-04-18T09:34:16.102Z caller=head.go:854 component=tsdb msg="WAL segment loaded" segment=0 maxSegment=0
level=info ts=2022-04-18T09:34:16.102Z caller=head.go:860 component=tsdb msg="WAL replay completed" checkpoint_replay_duration=18.859µs wal_replay_duration=322.23µs total_replay_duration=364.154µs
level=info ts=2022-04-18T09:34:16.104Z caller=main.go:834 fs_type=EXT4_SUPER_MAGIC
level=info ts=2022-04-18T09:34:16.104Z caller=main.go:837 msg="TSDB started"
level=info ts=2022-04-18T09:34:16.104Z caller=main.go:964 msg="Loading configuration file" filename=/etc/prometheus/prometheus.yml
ts=2022-04-18T09:34:16.111Z caller=dedupe.go:112 component=remote level=info remote_name=e3afd4 url=https://opensearch-cluster-master:9200/write msg="Starting WAL watcher" queue=e3afd4
ts=2022-04-18T09:34:16.111Z caller=dedupe.go:112 component=remote level=info remote_name=e3afd4 url=https://opensearch-cluster-master:9200/write msg="Starting scraped metadata watcher"
ts=2022-04-18T09:34:16.111Z caller=dedupe.go:112 component=remote level=info remote_name=e3afd4 url=https://opensearch-cluster-master:9200/write msg="Replaying WAL" queue=e3afd4
level=info ts=2022-04-18T09:34:16.112Z caller=main.go:995 msg="Completed loading of configuration file" filename=/etc/prometheus/prometheus.yml totalDuration=8.219377ms remote_storage=5.66082ms web_handler=637ns query_engine=877ns scrape=870.296µs scrape_sd=39.662µs notify=1.047µs notify_sd=4.678µs rules=4.199µs
level=info ts=2022-04-18T09:34:16.112Z caller=main.go:779 msg="Server is ready to receive web requests."
ts=2022-04-18T09:34:23.455Z caller=dedupe.go:112 component=remote level=info remote_name=e3afd4 url=https://opensearch-cluster-master:9200/write msg="Done replaying WAL" duration=7.344249957s
ts=2022-04-18T09:35:03.459Z caller=dedupe.go:112 component=remote level=error remote_name=e3afd4 url=https://opensearch-cluster-master:9200/write msg="non-recoverable error" count=5000 exemplarCount=0 err="server returned HTTP status 405 Method Not Allowed: {\"error\":\"Incorrect HTTP method for uri [/write] and method [POST], allowed: [DELETE, GET, HEAD, PUT]\",\"status\":405}"
ts=2022-04-18T09:35:06.119Z caller=dedupe.go:112 component=remote level=info remote_name=e3afd4 url=https://opensearch-cluster-master:9200/write msg="Remote storage resharding" from=2 to=10
**ts=2022-04-18T09:35:06.123Z caller=dedupe.go:112 component=remote level=error remote_name=e3afd4 url=https://opensearch-cluster-master:9200/write msg="non-recoverable error" count=494 exemplarCount=0 err="server returned HTTP status 405 Method Not Allowed: {\"error\":\"Incorrect HTTP method for uri [/write] and method [POST], allowed: [DELETE, GET, HEAD, PUT]\",\"status\":405}"
ts=2022-04-18T09:35:06.123Z caller=dedupe.go:112 component=remote level=error remote_name=e3afd4 url=https://opensearch-cluster-master:9200/write msg="non-recoverable error" count=495 exemplarCount=0 err="server returned HTTP status 405 Method Not Allowed: {\"error\":\"Incorrect HTTP method for uri [/write] and method [POST], allowed: [DELETE, GET, HEAD, PUT]\",\"status\":405}"**

Please let me know how we can resolve this issue and correct me If I am doing anything wrong in the setup.
Thanks,
Ganeshbabu R

Prometheus remote write always uses POST, see the spec here, specifically

Remote write Senders MUST encode the Write Request in the body of a HTTP POST request and send it to the Receivers via HTTP at a provided URL path.  The Receiver MAY specify any HTTP URL path to receive metrics.

If I remember correctly, you need an additional component between prometheus and elasticsearch: https://www.elastic.co/guide/en/beats/metricbeat/master/metricbeat-metricset-prometheus-remote_write.html

@cstyan
I have checked the document in the link which you shared and I tried to include the headers in the HTTP request. below is the changes I have given in remote_write configuration,

remote_write:
  - url: "http://opensearch-cluster-master-0.opensearch-cluster-master-headless.es.svc.cluster.local:9200/write"
    remote_timeout: 20s
    headers:
      Content-Encoding: "snappy"
      Content-Type: "application/x-protobuf"
      User-Agent: "2.34.0"
      X-Prometheus-Remote-Write-Version: "0.1.0"

When its deployed again in k8s the pod is not coming up and below is the error I am getting when I checked the pod logs,
[root@k8master1 prometheus-grafana]# kubectl logs monitoring-7cd8d64bc7-4wt9b -n es -c prometheus -f
ts=2022-04-20T18:40:46.828Z caller=main.go:438 level=error msg="Error loading config (--config.file=/etc/prometheus/prometheus.yml)" file=/etc/prometheus/prometheus.yml err="parsing YAML file /etc/prometheus/prometheus.yml: User-Agent is a reserved header. It must not be changed"

Attached the prometheus manifest which I tried in my k8s environment and let me know your thoughts
prometheus-manifest-k8s.txt
Kindly correct me If I am doing anything wrong in the setup.
Thanks,
Ganeshbabu R

The point was that I think you cannot write directly to elastic search, you have to go through this thing they call metricbeat.

@cstyan
Yes right we cant write directly to elasticsearch I have tried deployed the metricbeat as a pod in k8s and in the metricbeat.yml I have added the below config,
    - module: prometheus
      metricsets: ["remote_write"]
      host: "<IP_ADDRESS>"
      port: "9201"

and In prometheus config I have added the below config,
    remote_write:
      - url: "http://<IP_ADDRESS>:9201/write"
        remote_timeout: 20s

When I redeployed it I am getting the below error in prometheus pod logs,
ts=2022-04-21T07:16:25.698Z caller=main.go:1179 level=info msg="Completed loading of configuration file" filename=/etc/prometheus/prometheus.yml totalDuration=1.943444ms db_storage=1.24µs remote_storage=679.909µs web_handler=450ns query_engine=2.79µs scrape=674.947µs scrape_sd=30.6µs notify=1.062µs notify_sd=1.867µs rules=3.889µs tracing=12.323µs
ts=2022-04-21T07:16:25.698Z caller=main.go:910 level=info msg="Server is ready to receive web requests."
ts=2022-04-21T07:16:35.508Z caller=dedupe.go:112 component=remote level=info remote_name=783aa3 url=http://<IP_ADDRESS>:9201/write msg="Done replaying WAL" duration=9.810702748s
ts=2022-04-21T07:16:35.700Z caller=dedupe.go:112 component=remote level=error remote_name=783aa3 url=http://<IP_ADDRESS>:9201/write msg="non-recoverable error" count=10 exemplarCount=0 err="server returned HTTP status 404 Not Found: 404 page not found"
ts=2022-04-21T07:17:35.711Z caller=dedupe.go:112 component=remote level=error remote_name=783aa3 url=http://<IP_ADDRESS>:9201/write msg="non-recoverable error" count=10 exemplarCount=0 err="server returned HTTP status 404 Not Found: 404 page not found"

and below is the error I am getting metricbeat pod logs because metricbeat module prometheus not able to connect the host defined in config,
2022-04-21T06:19:56.630Z        INFO    http/http.go:115        Starting HTTP server on <IP_ADDRESS>:9090
2022-04-21T06:19:56.630Z        INFO    cfgfile/reload.go:224   Loading of config files completed.
2022-04-21T06:19:56.630Z        ERROR   http/http.go:118        Unable to start HTTP server due to error: listen tcp <IP_ADDRESS>:9201: bind: cannot assign requested address

My doubt was how 9201 port is getting deployed in which service? Bcs from the elastic link I couldnt able to figure it out.
Do I need to add any config in prometheus for listening 9201 port?
Pls correct me If I am doing anything wrong.
Thanks,
Ganeshbabu R

In the docs from elasticsearch it's metricbeat that needs to start up and listen on 9201, which afaict from your config is correct, however metricbeat has the error bind: cannot assign requested address which iirc usually means something else is already listening on that port. Trying changing ports. Elasticsearch community or the prometheus-users mailing list might be a better place to ask further questions about this setup.


variable number of URL params

My app has nested projects:
/group/project
/group/subgroup/project2
/group/subgroup/subgroup/project3
etc.
Given the above originalUrl I am able to successfully match to my project view, but I am getting Page Not Found if I don't have an exact match of URL parameters.
E.g.:
/group/project
/group2/project2
/group3/subgroup1/project3
… will only match project and project2 with a /:one/:two route key, and will only match project3 with a /:one/:two/:three route key.
I am not even using the URL parameters in the above case, as I'm able to determine my project just with the originalUrl string.
I have tried to use the '*' wildcard but I'm getting Page Not Found for all projects in that case.
Any clues as to how I should be approaching the above routing?

I'm not sure I understand exactly the requirements here. Is the issue that you do not know how deeply the paths will be nested?

Pretty much yes!
I guess I can summarize it as follows.  I want to determine the view based solely on originalUrl, which can contain arbitrarily deep nesting of user-provided group slugs, subgroup slugs, and project slugs.
I want the entire URL string (which originalUrl gives me) and can determine the view based solely on that, but, as you said, there is an arbitrary depth to the paths.

So this is a bit of a hack, but I think this may work?
map(req => {
  return mount({
    [getMyPath(req.originalUrl)]: route(
      //...
    )
  })
})

Thanks … I will try this.  What is getMyPath, though?

Glad that it works!
getMyPath was just a placeholder for transforming the URL however you want, but if it works without it then that’s great :-)
Will close for now as this seems resolved.


Loosing RemoteIpAddress when acting as reverse proxy

I have an asp.net core web application that can access to the request IP via HttpContext.Connection.RemoteIpAddress the application itself is listening to http://<IP_ADDRESS>:5090 but when putting it behind the reverse proxy as the following configuration shows, my web app detects HttpContext.Connection.RemoteIpAddress equal to "<IP_ADDRESS>".
{
    "Logging": {
        "LogLevel": {
            "Default": "Information"
        }
    },
    "AllowedHosts": "*",
    "Kestrel": {
        "Endpoints": {
            "Http": {
                "Url": "http://my-public-ip-here:80"
            }
        }
    },
    "ReverseProxy": {
        "Routes": {
            "route1": {
                "ClusterId": "cluster1",
                "Match": {
                    "Hosts": [ "my-domain-name-here.com" ]
                },
                "Transforms": [
                	{ "RequestHeadersCopy": "true" },
          		{ "RequestHeaderOriginalHost": "true" }
                ]
            }
        },
        "Clusters": {
            "cluster1": {
                "Destinations": {
                    "destination1": {
                        "Address": "http://<IP_ADDRESS>:5090/"
                    }
                }
            }
        }
    }
}

That's common with any proxy. The following docs should help:
https://microsoft.github.io/reverse-proxy/articles/header-guidelines.html#x-forwarded--forwarded
https://docs.microsoft.com/en-us/aspnet/core/host-and-deploy/proxy-load-balancer?view=aspnetcore-6.0
https://microsoft.github.io/reverse-proxy/articles/transforms.html#defaults

Triage: Closing as answered, please re-open if there are more issues.


Speedup other reaction calculations

More optimizations around get_reactions and related functions.
RuSr2GdCu2O8-Example runs < 45sec for me
General improvements

remove need to call deepcopy()
remove repeated calculations outside of for loops
better cache method using ComputedStructureEntry.data dictionary instead of lru_cache
more structural re-architecture within reactions.py
updated end-to-end test to be more stable

Pull Request Test Coverage Report for Build<PHONE_NUMBER>

203 of 227 (89.43%)  changed or added relevant lines in 3 files are covered.
10 unchanged lines in 1 file lost coverage.
Overall coverage decreased (-0.3%) to 78.003%

Changes Missing Coverage
Covered Lines
Changed/Added Lines
%

piro/reactions.py
186
210
88.57%

Files with Coverage Reduction
New Missed Lines
%

piro/utils.py
10
60.0%

Totals

Change from base Build<PHONE_NUMBER>:
-0.3%

Covered Lines:
461

Relevant Lines:
591

💛  - Coveralls


updated the repository url

since it was pointing to a previous location that now 404s

Oops, thank you for fixing!


Add LoomProvider test for static calls

We've got tests for eth signed txs in https://github.com/loomnetwork/loom-js/blob/master/src/tests/e2e/client-test-tx-middleware.ts but we don't have any tests for static calls using foreign addresses.
Basically we need a version of the SimpleStore EVM contract that looks something like this:
contract SimpleStore {
  mapping(address => uint256) balances;

  function setBalance(uint256 _val) external {
    balances[msg.sender] = _val;
  }

  function getBalance() public view returns(uint256) {
    return balances[msg.sender];
  }
}

The test should then call setBalance followed by getBalance using the same caller (eth:0x...), and verify that the balance matches.

https://github.com/loomnetwork/loom-js/pull/311


Docs: set the right repository on pub.dev

Is your feature request related to a problem? Please describe.
Currently this link sents you to the original hive repository and not this one

Describe the solution you'd like
It should open your repository: https://github.com/martipello/hive_built_value
It is pretty hard to find the code of the plugin

this is correct, it will be addressed if we ever manage to make  new release updating the analyzer and other packages


Dialog is still present in the visual tree after second opening

I'm seeing a strange behavior using DialogHost.Avalonia 0.7.1 + Avalonia 11.0.0-preview6 (cross platform solution).
Basically if one open a dialog, then closes it, then opens it again, then closes it, the dialog's content remains present in the main visual tree.
I've prepared a sample application to show it (please test the Desktop or Android project) DialogHostTest.zip
Also a video of the issue: https://we.tl/t-zLkYAVr5cH

Wow, there is a surprise, that animations with fill mode Forward or Both will set last values with priority Local, so it can't be overridden in any styles way


Add context field to sessions.

Description
Add a context field to the Session message.
Also add a write-session CLI command and standardize the Use lines for the metadata tx CLI commands based on the cobra documentation.
closes: #276

Before we can merge this PR, please make sure that all the following items have been
checked off. If any of the checklist items are not applicable, please leave them but
write a little note why.

[x] Targeted PR against correct branch (see CONTRIBUTING.md)
[x] Linked to Github issue with discussion and accepted design OR link to spec that describes this work.
[ ] Wrote unit and integration tests
[x] Updated relevant documentation (docs/) or specification (x/<module>/spec/)
[ ] Added relevant godoc comments.
[x] Added a relevant changelog entry to the Unreleased section in CHANGELOG.md
[x] Re-reviewed Files changed in the Github PR explorer
[ ] Review Codecov Report in the comment section below once CI passes

@dwedul-figure I think we will need a way to set this context on the MsgP8eMemorializeContractRequest and have that be set on the session via the conversion

@dwedul-figure I think we will need a way to set this context on the MsgP8eMemorializeContractRequest and have that be set on the session via the conversion

Doh! Yup. Totally forgot that part. Fixed now though. I added it to the Contract message: MsgP8eMemorializeContractRequest.Contract.Context. It's an Any field there too, and it just gets straight up copied over into the Session.Context field.

A URL/resource name that uniquely identifies the type of the serialized
protocol buffer message. This string must contain at least
one "/" character. The last segment of the URL's path must represent
the fully qualified name of the type (as in
path/google.protobuf.Duration). The name should be in a canonical form
(e.g., leading "." is not accepted).
In practice, teams usually precompile into the binary all types that they
expect it to use in the context of Any. However, for URLs which use the
scheme http, https, or no scheme, one can optionally set up a type
server that maps type URLs to message definitions as follows:

If no scheme is provided, https is assumed.
An HTTP GET on the URL must yield a [google.protobuf.Type][]
value in binary format, or produce an error.
Applications are allowed to cache lookup results based on the
URL, or have them precompiled into a binary to avoid any
lookup. Therefore, binary compatibility needs to be preserved
on changes to types. (Use versioned type names to manage
breaking changes.)

Note: this functionality is not currently available in the official
protobuf release, and it is not used for type URLs beginning with
type.googleapis.com.
Schemes other than http, https (or the empty scheme) might be
used with implementation specific semantics.

I think I am running into issues when sending an Any value related to the stuff @iramiller mentioned above. I have tried several different ways (different prefixes, setting the any type url to github.com/provenance-io/provenance/x/metadata/types/p8e.UUID thinking maybe I had to use the go_package version) and seem to always get something like UNKNOWN: unable to resolve type URL /provenance.metadata.v1.p8e.UUID: tx parse error: invalid request.
Initially I was using a proto from within p8e, but hten switched to this UUID proto that is present in the provenance p8e protos, hoping that it would resolve, but no luck so far.

Note for the future: The Cosmos SDK was trying to do some automatic validation of the Any field and failing because it couldn't find the TypeURLs being provided. So we decided to just use a byte array for the Context instead. Since the Session already is already associated with a process, it shouldn't have to tell others what the Context is.


Room index- app/views/rooms/index.html.erb  - missing row setup

In the code window for:  "Open app/views/rooms/index.html.erb and change its contents to:"
Need to add the first line of:

or it won't set up the two columns properly.   It's correct in the repo - https://github.com/iridakos/rails-chat-tutorial/blob/e1f2f225f885d2be8d579de3b16e989ad9709aa9/app/views/rooms/index.html.erb
So just need to update the code block in the tutorial.

@tonydehnke Thank you for reporting! Done, post updated.
https://iridakos.com/tutorials/2019/04/04/creating-chat-application-rails-websockets.html#acknowledgments


Added tutorial for template literals in the existing string tutorial

1. This pull request resolves #58
2. Description
I have added a tutorial for Template Literals in Javascript to the existing tutorial on Strings. A challenge related to Template Literals has been added at the end as well to test the understanding of the reader.
3. Fill in checklist by marking [x]

[x] I've read the CONTRIBUTING.md
[x] I was assigned to this issue
[x] My code is formatted using required linting
[x] I've run my code locally and checked it works

Kindly consider this PR as a contribution for Hacktoberfest!

Thanks for your contribution @bigsbunny 🎉


Upgrade crypto library

Readiness checklist

[ ] I added/updated tests.
[x] I ensured that the PR title is good enough for the changelog.
[x] I labeled the PR.

@Magnus-Kuhn I've updated the PR as discussed today, so that you have an example how it can be used for pw hashing.

@stnmtz you brought some things in this PR that are not really belonging to this PR.
also eslint and prettier are heavily complaining, please check your setup.


Bump flutter_svg to 2.0

Note: we need to publish pay_android and then update pay to use that new version.

@JlUgia
Could you take a look at this PR?
We are using dependency_override to support flutter_svg 2.x

It's so crazy that this PR isn't yet merged regardless being an easy thing to look at, yet its very vital for this plugin to be used without much headache

Please, check this PR!

bump

There is a new version of flutter_svg: ^2.0.5 maybe we can have the latest before this is merged?

@aytunch We use 2.0.5 but we have custom widgets.

Thank you for the review @acoutts.
Missed this one in the previous review: the next version after 1.0.9 is 1.0.10.
Everything else looks good.

Thank you @acoutts. Merging.


Fixed atecc library and function reference typo

It seems that there is a typo in the latest branch updated a few hours ago.
This issue prevents the code to compile as it can't find the header file and the existing header file does not have matching function names.

Updated repo with changes to the ATECC608 naming instead of reverting to the old naming. It better reflects the chip name convention that Microchip is using and reduces confusion with customers. Fixed references to the newly renamed atecc608 files in https://github.com/m5stack/Core2-for-AWS-IoT-EduKit/commit/1c791321848c12ef859d44ae130b12368d4278d1.


[suggestion] Please consider providing typescript definition files

For those who like me are just learning programming through javascript/typescript, I can't tell you how helpful having strongly typed objects is! Typescript definitions (d.ts) make our life much easier by allowing the IDE to provide intellisense (auto-completion of methods and parameters), to find errors before compilation, to look up docs in-line... It makes for fewer bugs and more productive coding, especially if JSDoc documentation is included.
Unfortunately, the most recent definitions for Chart.js are outdated, making them unreliable.  Please consider either including a well documented d.ts file with your distribution or contributing to that one to keep it up to date.

I guess this is an old request: #1572 ,
According to #2344 , there seems to have been no  movement on the matter in almost two months. You must be very busy; please consider this.

Closing as duplicate of #1572
I will try to get to this soon.


Excel add-in causes 'Microsoft Excel is waiting for another application to complete an OLE action' error

After installing the Microsoft Excel add-in, I sometimes receive the error "Microsoft Excel is waiting for another application to complete an OLE action" when trying to close a file, and the only way to successfully close the file is to choose "Cancel".
Disabling the add-in fixes the error, so I am sure that it's due to this add-in and not any others.
Thanks!

+1 on this

I have encountered the same issue

Confirm this in Office 2013.

A new version has been released.


move from pkg_resources to importlib.resources for loading data files

Fixed easily with help from Barry Warsaw (https://www.youtube.com/watch?v=ZsGFU2qh73E&ab_channel=PyCon2018)


Improve new Connections dialog

Fixed dialog not correctly reopening in advanced mode once enabled and closed,
Added tooltips to "Deferred" and "Oneshot".
Made "Advanced" into a CheckButton and the "Deferred" and "Oneshot" into CheckBoxes (see here why).
Made the dialog just readjust its size instead of reopening when advanced mode is enabled.

With the progress of #27988, and it being superior to this PR, I will be closing this.

I actually prefer this PR.

@reduz I can open a new one with this code if you desire.


Access nested model value in custom type

Question
I have a field configuration accessing value of a nested field like:key: 'nested.field.value' and have written a custom typeahead component. To be able to select the right initial value i have to access
the models nested value at above path. Does formly expose the internal method to get this value?

use field.formControl.value
use getFieldValue:

related to https://github.com/ngx-formly/ngx-formly/issues/3331:
import { ɵgetFieldValue as getFieldValue } from '@ngx-formly/core';
// getFieldValue(field);

You are a god among the opensource maintainers


How to use this plugin with Ionic/Capacitor

Hi,
Please suggest me, How can i use this with ionic/capacitor.
Thanks

@chemerisuk is there a way for this library to be added to Ionic Native or how to be used on Ionic?


Use console.log() instead of util.puts()

Since https://github.com/nodejs/node/commit/896b2aa7074fc886efd7dd0a397d694763cac7ce (included in v0.11.3), util.puts() becomes deprecated API. This pull-request uses console.log instead of util.puts.
Before pull-request
$ node demo.js
State: 1
State: 1
(node:29751) [DEP0027] DeprecationWarning: util.puts is deprecated. Use console.log instead.
State: 2
State: 3
State: 4
Complete.
Body length: 10959
Body:
<!doctype html>
<!--
HTML5 Boilerplate! AAAAAAAAAAWWWWWW YYYYYYEEEEEEEEAAAAAAAA!
...

After pull-request
$ node demo.js
State: 1
State: 1
State: 2
State: 3
State: 3
State: 4
Complete.
Body length: 10959
Body:
<!doctype html>
<!--
HTML5 Boilerplate! AAAAAAAAAAWWWWWW YYYYYYEEEEEEEEAAAAAAAA!
...

thx! :tada:


Slack webhook only working in dotnet core

When I set my logger up to sink to a webhook, it works when I test it inside visual studio.
The moment I build it however and run the executable, the webhook gets no messages whatsoever.
I've tried both Debug and Release mode, none seem to work.
[edit]: when running the build in .net 4.6.1 it doesn't work, however it works with .net core 1.1

I just tried this on a Console application targeting .NET Framework 4.6.1. The complete code sample is as follows:
using System;
using Serilog.Sinks.Slack;

namespace ConsoleApp1
{
    class Program
    {
        static void Main(string[] args)
        {
            Serilog.Log.Logger = new Serilog.LoggerConfiguration()
                .WriteTo.Slack(new Serilog.Sinks.Slack.Models.SlackSinkOptions
                {
                    CustomIcon = ":ghost:",
                    CustomUserName = "Test App",
                    WebHookUrl = "https://hooks.slack.com/services/XXXXXXXXX/XXXXXXXXXXX/XXXXXXXXXXXXXXXXXXXXXXXX"
                })
                .CreateLogger();

            Serilog.Log.Logger.Warning("This is a test.");
            Console.ReadLine();
        }
    }
}

This is working for me, as is .NET Core. Considering the time when this was written and the lack of detail, I will consider this issue resolved.

I just tried this on a Console application targeting .NET Framework 4.6.1. The complete code sample is as follows:
using System;
using Serilog.Sinks.Slack;

namespace ConsoleApp1
{
    class Program
    {
        static void Main(string[] args)
        {
            Serilog.Log.Logger = new Serilog.LoggerConfiguration()
                .WriteTo.Slack(new Serilog.Sinks.Slack.Models.SlackSinkOptions
                {
                    CustomIcon = ":ghost:",
                    CustomUserName = "Test App",
                    WebHookUrl = "https://hooks.slack.com/services/XXXXXXXXX/XXXXXXXXXXX/XXXXXXXXXXXXXXXXXXXXXXXX"
                })
                .CreateLogger();

            Serilog.Log.Logger.Warning("This is a test.");
            Console.ReadLine();
        }
    }
}

This is working for me, as is .NET Core. Considering the time when this was written and the lack of detail, I will consider this issue resolved.


Only inline exceptions stemming from Faraday

Previously an exception thrown in the body of a with_request block
would be caught and propagated as an inline exception.  This can be
quite confusing when your with_request block is suddenly being called
twice!
Added a test to catch this case too.

Only too late do I realize I should have called this branch "inline-exception-inception".  Damn.

:+1:


This should complete the fix for issue 333

Should be self-explanatory.

Bien vu! We didn't pay attention to this implementation.

@lemire  "offset" should not be a short, and this test will throw because of it, perhaps asserts in the containers that the ranges passed in make sense (e.g. the minimum is not negative) would help.
  @Test
  public void intersectBitmapWithRangeHighBits() {
    Container[] values = new Container[1];
    RoaringArray ra = new RoaringArray(new short[1], values, 1);
    long[] bitmap = new long[1024];
    Arrays.fill(bitmap, 0, 512, 0xAAAAAAAAAAAAAAAAL);
    values[0] = new BitmapContainer(bitmap, 512 * Long.bitCount(0xAAAAAAAAAAAAAAAAL));
    RoaringBitmap rr1 = new RoaringBitmap(ra);
    Assert.assertFalse(rr1.intersects((1 << 15) , 0xFFFF));
  }

Could you fix it on this PR by changing
short offset = Util.highbits(minimum);

to
int offset = (int)(minimum & 0xFFFF);

in both implementations?

@richardstartin I have added your test as well as extra tests.

I think this should be ok. Merging.


Does the package load in Atom 1.19+ ?

I have been sitting on 10.x version of the package for some time but recently decided to try version 11.0.9.
It appears that it does not work at all. E.g., shortcuts do not work nor does autocompletion.
The only thing that appears after installing the package is the menu Packages->Typescript with 3 choices, none of which does anything.
There are no error logs.
I tried with Atom 1.19 and now also with Atom 1.20.
None of the 11.0.x version currently works but I do remember that I tried 11.0.x before (with an older version of Atom) and it did work.
The same ts project behaves well with atom-typescript 10.x or Visual Studio Code.
Is anyone else seeing this?

I believe I experienced the same. Does syntax highlighting appear to be broken as well? It did not seem to work with my test Angular app.

atom-typescript<v11.0.7 is pretty broken on Atom 1.19+, and 11.0.7 should address precisely that. Note that v11.0.7 will refuse to start on Atom <1.19
I'm using latest on Atom 1.20 and see no problems that you describe. A thought that comes to mind that your Atom installation behaves like it's <1.19 for some reason (due to botched update or somesuch maybe?)

@anthony-pinskey Syntax highlighting is working (this is the only working thing).
I tried on a fresh system and it works. But still no lack trying to run on old (but updated) install of Atom. Maybe there is a conflict with some other package.
Anyway, if it does not affect anybody else, I think there's no use to investigate it in detail.
But let's maybe keep it open for a while.

It seems that the issue is with https://atom.io/packages/one-light-ui-adwaita instead.
It throws error on atom startup and somehow prevents atom-typescript from loading.
(in promise) TypeError: Cannot read property 'toLowerCase' of undefined
    at setLayoutMode (config.coffee [sm]:28)
    at Object.apply (config.coffee [sm]:1)
    at settings.coffee [sm]:2
    at Function.module.exports.Emitter.simpleDispatch (/usr/lib/atom/node_modules/event-kit/lib/emitter.js:25)
    at Emitter.module.exports.Emitter.emit (/usr/lib/atom/node_modules/event-kit/lib/emitter.js:141)
    at theme-manager.coffee:284


bun 1.0.7 is not picking up default timezone from Mac OS

OS: Mac Sonoma 14.0 (23A344)
Bun: 1.0.7
expected:
bun will pick up timezone (TZ) from OS, just as does nodejs.
// nodejs
new Date().getTimezoneOffset()
// output
360

actual:
bun tz offset is 0
// bun
new Date().getTimezoneOffset()
// output
0

Workaround:
Set TZ using environment variable, but this is less than ideal on a laptop that gets moved around.

@jpravetz I think you filed the issue in the wrong repository. The repository is about the vscode-eslint extension.

Doh!


Issue with react-router-redux listenForReplays

Hey Matt,
Nice work on this package. I'm having some trouble getting it working with react-router-redux however... specifically the listenForReplays part (see below). Basically the line let routerState = state.getIn(['router', 'location']) evaluates to undefined. Without the optimistic wrapper around rootReducer, everything works fine however. I suspect it has something to do with initialization, but am not sure if it's something I'm doing wrong or if there is an incompatibility somewhere.
const routerMiddleware = syncHistory(history)
  const middleware = [thunkMiddleware, routerMiddleware, apiMiddleware, loggerMiddleware]
  let finalCreateStore = applyMiddleware(...middleware)
  if (__DEBUG__) finalCreateStore = withDevTools(finalCreateStore)

  const store = finalCreateStore(createStore)(optimistic(rootReducer), fromJS(initialState))

  if (__DEBUG__) {
    routerMiddleware.listenForReplays(store, (state) => {
      let routerState = state.getIn(['router', 'location'])
      return routerState.toJS()
    })
  }

Let me know if you need any further information about the configuration.
Cheers

see ensureState in the readme. I do something similar in my meatier repo that you can check out.
As a side note, I suggest you keep your 3rd party reducers as pure JS objects. While it's ugly to have a mutable inside an immutable, most developers don't officially support both so you'll eventually end up with at least one that has to be a mutable. Also, all performance gain is lost when you have to convert to an immutable & back to a JS object.

Ah yes, of course – thanks!


open_groups for zarr backends

[x] Part of #8572
[x] Tests added
[ ] User visible changes (including notable bug fixes) are documented in whats-new.rst
[ ] New functions/methods are listed in api.rst

cc @TomNicholas, @flamingbear, @owenlittlejohns, @keewis and @shoyer !


Add Gemini market feed

Using ccxt for GeminiAPI.
Add support for Websocket market feed.
Include demo in samples.

This is awesome; and exactly what I was hoping for from the community!
There are some issues which we need to sort out first, which I can apply if you give me push permissions to this PR, or you can take a stab at yourself.

Must fix: The type of a LevelMessage should be level.
Must fix: Does Gemini provide a snapshot message after subscribing to a book? If not, we need to queue messages until we can get one from the REST API, and manually push the snapshot message and then clear the queue.

The acid test here is to pipe the feed into a LiveOrderbook and see if it matches the orderbook on the website. (See src/samples/Live???OrderbookDemo.ts)

Optional: The auction message can be wrapped in an UnknownMessage and pushed down the stream.

Thanks, Cayle. Please feel free to push to this branch. I do have the checkbox for "Allow edits from maintainers" checked.
'level' isn't a recognized type for Gemini, but I'm guessing that setting to 'level' is important to your implementation of CCXT.
By snapshot message, do you mean an ACK message? Gemini does respond with one.
One thing to note is that the MarketFeed instance only supports one gdaxProduct. I noticed the other feeds all subscribe to multiple products. I couldn't quite figure out a way to do that.
I will work on your feedback and if it doesn't quite meet what you were going for, you're welcome to push changes.
Thanks for all your contributions to this toolkit. It is really awesome to have this available to everyone!

Researched some more - if I am understanding this right, a snapshot message contains the initial state of the orderbook, which is received right after subscription. In Gemini, the 'Change' event contains a reason field that indicates 'initial', 'trade', 'place', 'cancel'. So by gathering all the 'initial' array items, I can build out the snapshot message and push that message - am I on the right track?

You're 100% right. To keep the orderbook state up-to-date, we first need the initial state (snapshot); and then update it with the diffs (WS feed messages).
Ok, I did a quick check of Gemini's docs and yes, you're actually very close.
It looks like (but you should check by doing a dump of their feed and examining it) that type==='change' && reason === 'initial' messages are only sent on message 0. (if not, the logic is a bit trickier, but still manageable). (You might also be able to inspect their WS handling logic from their site to confirm).
So all you need to do is gather up the initial messages and construct a SnapshotMessage instance (see GDAXFeed.ts for an example of how to do this).
If there are any non-initial messages, keep them in a queue.
Then push that snapshot message onto the stream, followed by the queued messages.
There shouldn't be any initial messages after the first batch. According to their docs:

To keep an up-to-date order book, just watch for any events with {"type": "change"}, and update the price level at price with the amount at remaining. The initial response message will contain all the change events necessary to populate your order book from scratch.

If you replicate the liveOrderbook demo with this feed, you should see printed out orderbook match Gemini's exactly (slight timing differences notwithstanding).
Hope that helps!

I just saw your other comment now.

'level' isn't a recognized type for Gemini, but I'm guessing that setting to 'level' is important to your implementation of CCXT.

That's expected. The ExchangeFeed class is like a mincer where all WS feeds come out looking the same :) So whatever the equivalent message(s) from the original exchange is/are that represents a change to an order price level, must be coerced into a level message.
Now you're free to plug that stream into any GTT WritableStream component and it will understand it.

One thing to note is that the factory only supports one symbol to subscribe to. I noticed the other factories can subscribe to multiple products.
That's ok too. If you need multiple Gemini streams (for different products), you'd create multiple connections. If it works correctly (I haven't tested it thoroughly), the backend should be smart enough to create a new feed to a new book, and return an existing one if it's asked for again

I will work on your feedback and if it doesn't quite meet what you were going for, you're welcome to push changes.

You're almost there, and I'm a bit tied up for the next week and a bit, so I'd say take it over the finish line!

Thanks for the detailed message and for confirmation. Will get it done this week.

Added a live orderbook demo for the Gemini Market feed - looks accurate.

Very nice. Thank you. I haven't had a chance to test it myself, but let's get it merged.

Thanks for all of your great work on this! I'm trying to get the LiveGeminiOrderbookDemo running and noticed that the LiveOrderbook.ticker event isn't firing. The other orderbook events such as .snapshot, .update, and .trade seem to be working fine.
Based on a quick peek at GeminiMarketFeed.js and the core LiveOrderbook , it looks like maybe this hasn't been mapped out yet?

@github-ajt Would you like to take a bash at this?


Custom Height

Can we set custom height and y position in Half Modal Presentation Controller? It always presents up to the middle of the screen. As far I understand I have to pass custom values to HalfModalPresentationController and set values in the overridden member frameOfPresentedViewInContainerView. If anyone has implemented it - can you please share details. Thanks a lot

In HalfModalTransitioningDelegate and HalfModalPresentationController
I have declared a variable customHeight
In HalfModalTransitioningDelegate I modified the function

func presentationController(forPresented presented: UIViewController, presenting: UIViewController?, source: UIViewController) -> UIPresentationController? {
let controller = HalfModalPresentationController(presentedViewController: presented, presenting: presenting)
controller.customHeight = customHeight
return controller
}

In HalfModalPresentationController I modified this function

override var frameOfPresentedViewInContainerView: CGRect {
return CGRect(x: 0,
y: customHeight == 0 ? containerView!.bounds.height / 2 : containerView!.bounds.height - customHeight,
width: containerView!.bounds.width,
height: customHeight == 0 ? containerView!.bounds.height / 2 : customHeight)
}


[5.6] Delete duplicated config('app.debug') from Exception Handler

Illuminate/Foundation/Exceptions/Handler.php refactoring about config('app.debug')

@TBlindaruk What is exactly the gain here?

I'd say the gain is about making it easier for the possibility to change how the debugger information gets resolved.

@deleugpn ,
Yes.
As for me, in the future will be better to create a configuration class for getting all default config settings like app.debug, app.env etc


Polish translation (Polski)

@myConsciousness this will take me a while - I'll take it out of draft when it's ready :D
Any way to build the app locally to test the translation?


Move keys and other sensitive application related information to a separate config file

As of now we have a naming convention of custom_configFile.json. So this config file deals with the front end, Inside the server/ we need to have another config file for the twitter app details and stuff, for convention sake let us call it config.temp.json with the instruction to be
cp server/serverconfig.temp.json server/serverconfig.json, Needs to be implemented with #80 as discussed.

Used custom_configFile.json to store the keys.

a8aa6e6 needs to ensure that the server is always run as
loklak_webclient $ node server/index.js

and cannot work through
loklak_webclient/server $ node index.js

results in throw of
ENOENT, stat '/path/loklak_webclient/server/build/index.html'

We need to fix this for later too if possible or start the node server through a shell command from the application root than from a folder.

Closed as Fixed.


treewide: remove -march=native

Description of changes

-march=native breaks purity, so let's remove it.
Things done

Built on platform(s)

[ ] 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.11 Release Notes (or backporting 22.05 Release notes)

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

[x] Fits CONTRIBUTING.md.

-march=native breaks purity, so let's remove it.

Not only that, the generated code will expect everybody that downloads it from caches to have the same processor as the builder, we don't use server's CPUs, so probably it makes performance even worse.

-march=native breaks purity, so let's remove it.

Not only that, the generated code will expect everybody that downloads it from caches to have the same processor as the builder, we don't use server's CPUs, so probably it makes performance even worse.

From a performance stand point -march=native may increase performance even considering that Hydra != host machine, because we use very conservative options right now: https://github.com/NixOS/nixpkgs/pull/202526/files#diff-e32d2e727a496a1da28a670f938cf5b76322be57c4f86b1d5a6f29eb2c5dead6
But of course, it is impossible to know since it would need tests.

These impure flags should have been handled by the cc-wrapper:
https://github.com/NixOS/nixpkgs/blob/20193b6d86ff3859aac9ab5855bb3e7c0688f5f9/pkgs/build-support/cc-wrapper/cc-wrapper.sh#L108-L121

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

2 packages built:

glava
opentrack

These impure flags should have been handled by the cc-wrapper

I wasn't aware of this behavior until it was mentioned on Matrix today. It affects usage in an impure mkShell environment as well, which can be surprising/undesirable. I opened #203675 so we can discuss about this.


Unexpected token s in JSON at position 0

Hi,
I got problem after trying to send insert data into my php using ajax example. My data successfully inserted into database. But I got error in console:
VM2662:1 Uncaught SyntaxError: Unexpected token s in JSON at position 0
    at JSON.parse (<anonymous>)
    at altEditor._editRowCallback (dataTables.altEditor.free.js:611)
    at Object.success (dataTables.altEditor.free.js:285)

What I want is just right after data succesfully inserted, it's show result in php via console or alert.

Probably your web service is returning data in a format that is different
from what altdatatable expects. The right format is this one:
https://raw.githubusercontent.com/KasperOlesen/DataTable-AltEditor/master/example/03_ajax_objects/mock_svc_ok.json
Or, there may be some issue in your onEditRow.
Il gio 12 set 2019, 05:50 Rasyiid Who<EMAIL_ADDRESS>ha scritto:

Hi,
I got problem after trying to send insert data into my php using ajax
example. My data successfully inserted into database. But I got error in
console:
VM2662:1 Uncaught SyntaxError: Unexpected token s in JSON at position 0
at JSON.parse ()
at altEditor._editRowCallback (dataTables.altEditor.free.js:611)
at Object.success (dataTables.altEditor.free.js:285)
What I want is just right after data succesfully inserted, it's show
result in php via console or alert.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/KasperOlesen/DataTable-AltEditor/issues/51?email_source=notifications&email_token=ACLII2EAT4GVJPVXNTHQAKLQJG36XA5CNFSM4IV6R2SKYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4HK4AYDA,
or mute the thread
https://github.com/notifications/unsubscribe-auth/ACLII2H2FZM4B6PHIZCX4ILQJG36XANCNFSM4IV6R2SA
.

Probably your web service is returning data in a format that is different from what altdatatable expects. The right format is this one: https://raw.githubusercontent.com/KasperOlesen/DataTable-AltEditor/master/example/03_ajax_objects/mock_svc_ok.json Or, there may be some issue in your onEditRow. Il gio 12 set 2019, 05:50 Rasyiid Who<EMAIL_ADDRESS>ha scritto:
…
Hi, I got problem after trying to send insert data into my php using ajax example. My data successfully inserted into database. But I got error in console: VM2662:1 Uncaught SyntaxError: Unexpected token s in JSON at position 0 at JSON.parse () at altEditor._editRowCallback (dataTables.altEditor.free.js:611) at Object.success (dataTables.altEditor.free.js:285) What I want is just right after data succesfully inserted, it's show result in php via console or alert. — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub <#51?email_source=notifications&email_token=ACLII2EAT4GVJPVXNTHQAKLQJG36XA5CNFSM4IV6R2SKYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4HK4AYDA>, or mute the thread https://github.com/notifications/unsubscribe-auth/ACLII2H2FZM4B6PHIZCX4ILQJG36XANCNFSM4IV6R2SA .

I have already solved this by modify success in ajax. Thanks :D


Remove myEnvFun

We should remove myEnvFun and provide instructions how to replace it for different use cases.
$ git grep myEnvFun
pkgs/misc/my-env/default.nix:      sdlEnv = pkgs.myEnvFun {
pkgs/misc/my-env/default.nix:            pkgs.myEnvFun {
pkgs/top-level/all-packages.nix:  myEnvFun = callPackage ../misc/my-env {

This has been discussed before and nix-shell should be cover the same usecases.
Please state why you use myEnvFun if you do so we can provide alternative ways.

I wouldn't mind not having myEnvFun around.
Am I correct that it doesn't set any additional environment variables, contrary to nix-shell? If true, then I would argue that myEnvFun can't yet be replaced by nix-shell until we get say a nix use which doesn't set any additional variables. Since I think this is how most people use myEnvFun and "misuse" nix-shell.

I used it a lot, to provide dev environments, which updates all-at-once on system rebuild

I use myEnvFun quite extensively, but I'd like to see how to replace my use cases with nix-shell.  Let me know when you have those examples, and I'd be happy to try them out by switching over my configuration.

@domenkozar - do you want to remove myEnvFun because it fulfills a similar role to nix-shell?
@jwiegley - I had a look at your public git repo and AFAICT you mostly use myEnvFun for getting some binaries into your path? Please correct me if that's not accurate :)
I think that use case would be covered by e.g.:
nix-shell -p clang llvm

Here's a search: https://github.com/search?l=Nix&q=myenvfun&type=Code&utf8=✓ for use cases.

@teh Several of the environments that I define for use with myEnvFun involve many dependencies, so enumerating them with nix-shell -p would simply be unacceptable.  Also, I want to ensure that every dependency is rebuilt when I upgrade the environment; anonymously named dependencies passed to nix-shell may not still be available in the future, and if I'm on an airplane, that doesn't help.
So myEnvFun gives me a few things:

A single name for a large set of dependencies that are not immediately accessible from my user environment.
A convenient command to bring these dependencies into scope.
Because of the relationship of the command to the dependencies, they are all upgraded together when using -u --leq.

As far as I can tell, nix-shell gives me none of these benefits.

On Wed, Feb 22, 2017 at 09:38:36AM -0800, teh wrote:

@domenkozar - do you want to remove myEnvFun because it fulfills a similar role to nix-shell?
@jwiegley - I had a look at your public git repo and AFAICT you mostly use myEnvFun for getting some binaries into your path? Please correct me if that's not accurate :)
I think that use case would be covered by e.g.:
nix-shell -p clang llvm

It contrast with myEnvFun it not allow to tie that to build process for
entrie system -- for example -- I have building load-env's scripts for
golang, haskell, ocaml and wine.
I definelly won't wait build/download when I do load-env-golang, and
moreover, I won't fix errors on this time. I have dedicated time for it,
when I update whole system.  (It only my own use cases, other folks can
have own).
So we need revamp myEnvFun, and possible rename to myInteractiveShell,
or likewise.

Those seem like valid use cases to me. @domenkozar is myEnvFun a support burden? Can I do anything to make it nicer that would allow us to close this bug?
@avnik renaming seems like unnecessary churn unless you feel strongly about this.

All those use cases work with nix-shell used together with a default.nix. You can specify as many dependencies as you want, fix the NIX_PATH, etc.
The only thing you'd need to do is something like a bash alias my-project = nix-shell /path/to/my/default.nix.
Am I missing something here?

@domenkozar How do you tie that to the build process for the entire system?
I have a local server with Hydra. I want the configuration of all my machines (including laptop, server and others) to build in my Hydra system at the same time, including all my programming environments.
With myEnvFun it's very simple - I just add my programming environments (one for each programming language) to environment.systemPackages and that's the end of it.
If I have a bunch of default.nix files scattered all over my filesystem, wouldn't it be more difficult to keep track of them and include them in my system configuration so that I can send it to my Hydra instance?

@wizeman you could define your environments in just one file, even in your configuration.nix, and add your envs to the Nixpkgs tree with say packageOverrides.
Anyway, nix-shell executes a shellHook which I don't think is always desirable.

On Thu, Feb 23, 2017 at 01:20:13AM -0800, teh wrote:

Those seem like valid use cases to me. @domenkozar is myEnvFun a support burden?

It have a lot of bare understandable hacks inside, so I believe it can
be simplified.
Also I feel it can be extended by executing pre-defined, or customized
shell instead bash.

I suppose something like PATH=:$(nix-build -A someDerivation)/bin $SHELL would typically be enough?

On Fri, Feb 24, 2017 at 09:56:05AM -0800, Frederik Rietdijk wrote:

I suppose something like PATH=:$(nix-build -A someDerivation)/bin $SHELL would typically be enough?

Doesn't cover case for "I want all my language specific dev environments
built at once with all system"

I'm not a Nix expert, so I might be missing something; but as far as I can tell, besides the changes to the prompt that myEnvFun performs, the buildEnvs I create in my config.nix do the same thing:
https://gist.github.com/dhess/2ca7e5e836c52fd0187637a49ace04fb
I can nix-shell -p shell-env to get an environment with my shell tools, nix-env -i haskell-env to ensure that GHC and friends are always available, or nix-env -i meta-env to install the lot.
I can build everything in advance (for occasions when I don't have Internet access, which, as mentioned by others, is often very convenient) just by calling nix-instantiate, which I do whenever I update my nixpkgs git repo from upstream, along with pushing everything to my own binary cache so that I only have to build the new derivations once, and can re-use them on my other machines.
In fact, by changing just buildEnv → myEnvFun,  paths → buildInputs, and meta-env → env-meta (etc.) in that confix.nix file, I was able to trivially swap between the two methods. None of the packages even needed to be re-built. (I ended up switching back to my system because I don't like the changes that myEnvFun makes to the environment.)
The only thing I'm unhappy about is this hack:
    ## This exposes the locally-defined package to other Nix files,
    ## e.g., default.nix in a git repo which you're using to develop a
    ## Haskell package.
    dhess-ssh-keygen = (my-haskell-packages super.haskell.packages.ghc801).dhess-ssh-keygen;
    fm-assistant = (my-haskell-packages super.haskell.packages.ghc801).fm-assistant;
    hpio = (my-haskell-packages super.haskell.packages.ghc801).hpio;

If I don't do that, nix-env complains that the dhess-ssh-keygen and fm-assistant packages that I refer to in my haskell-core function aren't defined; and it picks up the nixpkgs version of hpio, rather than my override. If someone can help me with the Nix-foo required to get rid of that hack, that would be awesome. The reason I define the haskell-core function is that I want the same set of Haskell packages for each of the GHC environments that I might build/install. (Using myEnvFun had the same issue, so this is not specific to my environment.) The convoluted Haskell package stuff I'm doing at the bottom of the config.nix file is my way of removing problematic packages from the master list if particular packages don't work with particular versions of GHC.

I used both buildEnv and myEnvFun.  The problem is that if I install a buildEnv, all of its dependencies become visible at user scope, meaning I can't install two buildEnvs with conflicting paths.  And if I don't install them, then they don't rebuilt when I upgrade my environment, but only when I try to use them.
myEnvFun both keeps the dependencies built, and makes them accessible only when requested.
Now, if there were a way to provide a list that meant "always build these, but don't install them", then I could introduce the buildEnvs using nix-shell when needed.

@jwiegley I believe you could do that with nix-instantiate '<nixpkgs>' -A meta-env where meta-env is a buildEnv with all of the environments you want to build, but not install. I do that for my stack-env, which is never installed in my environment, but I like to have it ready to go on a moment's notice.
I guess you just want to run nixos-rebuild switch or whatever and not have to worry about the extra step? (I'm on a Mac, so for me, that's not an option.)

Yes, right now nix-env -u --leq handles everything, and that's what has made myEnvFun the right tool for the job so far.

A simple way to get the automatic updating might be to install a script that artificially depends on everything you want and calls nix-shell on itself, something like
runCommand "fooenv"
{ buildInputs = [ <...> ]; }
''
  mkdir -p $out/bin
  cat > $out/bin/fooenv <<EOF
  #! ${stdenv.shell}
  exec nix-shell \$(nix-store --query --deriver $out)
  # $buildInputs $nativeBuildInputs
  EOF
  chmod +x $out/bin/fooenv
'';

Why not generate a wrapper that just executes nix-shell or is there something that myEnvFun does differently?

The issues I've run into with nix-shell are:

You can't build and cache the environment it assembles using Hydra
You can't install the environment on a NixOS system using environment.systemPackages
It's difficult to override nixpkgs when using the --packages flag

Simple solution:

specify environments with buildEnv and make them accessible by overriding the package set, e.g. in config.nix. You could e.g. add myEnvs.someEnv = buildEnv { ... };
nix-shell -p myEnvs.buildEnv to access your env

@FRidh That's an interesting idea! I'll give that a try and see how it works.

@jwiegley How'd it work?

I haven't had the chance yet to retool my environment; I rely on myEnvFun in quite a few ways.

OK, I've tried in earnest over the last six months to make nix-shell an integral part of my workflow, and I have to say at this point that it's still very much inferior to myEnvFun, on multiple counts. Here are all the problems I'm still having with it, none of which are a problem for myEnvFun:

nix-shell always uses <nixpkgs>, despite giving it a different path (see https://github.com/NixOS/nix/issues/459, linked above). For my use case, this means I have to hack the default.nix file to use <darwin> for all of my projects.

You cannot copy the closure for a nix-shell environment after it is built, requiring that all machines redo that work. I currently work around this by copying every file from /nix/store to my other machines -- since that's faster than rebuilding everywhere -- but that's still quite inefficient to solve this problem.

nix-shell appears to randomly decides that it needs the Internet to build your shell. This happened to me on the airplane the other day, in mid-air: I hadn't changed anything in my Nix configuration, nor in my system configuration, nor even in the dependencies of my project, yet I couldn't enter nix-shell because it suddenly required the Internet. The fix: enter the myEnvFun I keep around with the same environment, since that never asks for the Internet after being built.

You cannot "upgrade all of your nix-shells" with a single command. Instead, it must be done shell by shell, using hand-rolled scripting that's much easier to get wrong than nix-env -u --leq.

You must manually manage GC roots to avoid your nix-shell dependencies from being garbage collected, especially if you have multiple projects pinned to different versions of their related dependencies.

So far, the only upside I've discovered with using nix-shell is that I can use haskellPackages.developPackage so that it provides whatever Haskell dependencies my project thinks it needs, rather than a static list I must keep in my Nix configuration. This is quite cool.
In sum, if the above issues concerning nix-shell could be fixed, I'd happily switch to it for its per-project convenience. But until then, the risk of not being able to use nix-shell at all when the internet is missing is a show-stopper. Please keep myEnvFun around until at least that is fixed!

@jwiegley very accurately summarizes the issues I've had with nix-shell.  I've been bitten by every single bullet point he mentioned

I was trying to drive-by unblock this ticket, but am also now a user of myEnvFun. @domenkozar unless myEnvFun is a support burden [1] maybe we can close this ticket?
[1]
I think the evidence shows it's not a burden: 1 commit in 2018 (by @jwiegley) and 3 commits in 2017.

Now, if there were a way to provide a list that meant "always build these, but don't install them",

system.extraDependencies I think?

I will say that right now, even though I'm using nix-shell far more than not now, my biggest blocker is the seemingly unpredictable nature of its dependence on the Internet.  The beauty of myEnvFun lies in avoiding the case of wanting to work while on the plane, but getting stuck because nix-shell wants the Internet and I don't have it.

nix-shell with a .drv file that's been registered as a GC root and previously been shelled into should work consistently without having to download anything as far as I know. (as long as the keep-outputs option is set)
$ grep keep-outputs /etc/nix/nix.conf
gc-keep-outputs = true
$ nix-instantiate shell.nix --indirect --add-root $PWD/shell-drv
$ nix-shell ./shell-drv --run true
<stuff is downloaded>
$ nix-store --gc
$ nix-shell ./shell-drv --run true
<nothing downloaded>

Nix 2.0 is out for some time now. How is your experience with using nix run?
default.nix in project folder
with import <nixpkgs> {};
buildEnv {
  name = "myEnv";
  paths = [ python2 python3 ];
}

and execute nix run.
overlay
self: super: {

  hello = super.hello.overrideAttrs(oldAttrs: { name = "foo"; });

  envs = let
    items = {

      env1 = super.buildEnv {
        name = "env1";
        paths = with super; [ python2 python3 ];
      };

      env2 = super.buildEnv {
        name = "env2";
        paths = with self; [ hello ];
      };
    };
  # Create a text file that references every env.
  # Install this, and you will have built versions of
  # the envs available.:
  #
  # `nix-env -iA nixpkgs.envs`
  #
  # Activate env:
  #
  # `nix-run -iA nixpkgs.envs.env1`
  in super.writeTextFile {
    name = "envs";
    text = super.lib.attrValues items;
    destination = "/nix/envs";
  } // items;
}

Of course, using a different Nixpkgs is always possible with say fetchTarball.

@FRidh  s/nix-run -iA/nix run/ ?

@lheckemann Such management is highly manual right now, whereas myEnvFun's can be collected into a list in the main system configuration, and even upgraded all at once.
I'd like to step back and see if a redesign of nix-shell is in order, so that we merge the benefits of both approaches, and expel some of these weaknesses.

Another advantage of myEnvFun and similar constructions is that the environments can be pre-built on one machine and transferred to others. Not GC'ing the drv only works on the machine where the evaluation was performed.

@jwiegley well, nix-shell does what it needs to do, at least in my opinion. It's just that nix-shell is often also used for just running programs, something which it is not completely intended for, considering the hooks it runs.
nix run on the other is intended for starting up programs or environments.

@FRidh I have no problems with nix-shell being a special-purpose tool. My problem lies with suggesting that a tool which does work, myEnvFun, should be removed, and I should be using nix-shell for purposes it clearly wasn't intended for. This happens in the #nixos channel too, where the answer to so many questions has been "just use nix-shell". That makes it sound like it's not actually a special purpose tool.
If it is special purposes, and we want to deprecate myEnvFun, then let's make a new tool that combines their functionality.

I don't think OP explained why myEnvFun should be removed, and there's several examples of why myEnvFun shouldn't be removed in this thread. Closing.

Thank you. I still use my myEnvFun functions daily.


Add tiktoken to calculate tokens dynamically

Looks good! Good idea to get a token count. This'll help us with breaking up context later on

@janzheng Thanks for the review!!


Currency

The currency of the numbers is not mentioned. I guess that most of the numbers should be treated as USD. If you want to normalize that everything is in EUR than you may have to mention how you transform other currencies into USD (exchange rate in that year, when exactly?).
Moreover, it seems also that some publishers (e.g. Elsevier) mix different currencies in their table. E.g. the APC of Computational and Structural Biotechnology Journal (2001-0370) in the 2018 list is given in EUR where you have the same information without any indications:
https://github.com/lmatthia/publisher-oa-portfolios/blob/e258c0d62418a9a6b38ec92bca6cc0f0e844ffc1/elsevier_oa_and_hybrid.csv#L10173-L10174
Sometimes I find also EUR in your list, e.g. https://github.com/lmatthia/publisher-oa-portfolios/blob/e258c0d62418a9a6b38ec92bca6cc0f0e844ffc1/elsevier_oa_and_hybrid.csv#L2875
Another idea: Maybe you want to mention that these APCs are without any tax which means that in reality one has to pay much more than just the APCs from the lists here. (It is 19% on top for taxes on APCs in Germany.)

It says in the Readme file that prices are in USD, but I'll add that these are excluding taxes! I'm also working to normalize currencies I haven't yet. :)

finally fixed ;)


Revert "[ASCII-2246] Log Fx Events using logger.Debug (#28925)"

This reverts commit 9b6988a83f619f648053c76a0364f83b72ca35f7.
There is no way to disable these logs in unit tests. So reverting for now to properly handle it after the code freeze.

What does this PR do?

Motivation

Additional Notes

Possible Drawbacks / Trade-offs

Describe how to test/QA your changes

Close as this https://github.com/DataDog/datadog-agent/pull/28925 didn't change this behavior


Hilla 2.3.3 endpoint generation error with generics return type

Describe the bug
The generated typescript endpoint produces an error when the return type is declared using java generics. In this particular example the return type is a Map containing a List of UUIDs as values. When the Map is wrapped in a class and used as a return type in the endpoint the following error is generated:
`
2023-11-16T08:27:11.010+02:00  INFO 148665 --- [v-server-output] c.v.b.devserver.DevServerOutputTracker   :  ERROR(TypeScript)  Type 'ObjectModel<NonNullable<T["options"]>>' is not assignable to type 'ObjectModel<Record<string, readonly string[]>>'.
2023-11-16T08:27:11.010+02:00  INFO 148665 --- [v-server-output] c.v.b.devserver.DevServerOutputTracker   :   Type 'NonNullable<T["options"]>' is not assignable to type 'Record<string, readonly string[]>'.
2023-11-16T08:27:11.010+02:00  INFO 148665 --- [v-server-output] c.v.b.devserver.DevServerOutputTracker   :     'string' index signatures are incompatible.
2023-11-16T08:27:11.010+02:00  INFO 148665 --- [v-server-output] c.v.b.devserver.DevServerOutputTracker   :       Type '(string | undefined)[] | undefined' is not assignable to type 'readonly string[]'.
2023-11-16T08:27:11.010+02:00  INFO 148665 --- [v-server-output] c.v.b.devserver.DevServerOutputTracker   :         Type 'undefined' is not assignable to type 'readonly string[]'.
2023-11-16T08:27:11.011+02:00  INFO 148665 --- [v-server-output] c.v.b.devserver.DevServerOutputTracker   :  FILE  /hilla233EndpointGenericsError/frontend/generated/org/vaadin/example/endpoints/DataRecordModel.ts:6:9
2023-11-16T08:27:11.011+02:00  INFO 148665 --- [v-server-output] c.v.b.devserver.DevServerOutputTracker   :
2023-11-16T08:27:11.011+02:00  INFO 148665 --- [v-server-output] c.v.b.devserver.DevServerOutputTracker   :     4 |     static override createEmptyValue = makeObjectEmptyValueCreator_1(DataRecordModel);
2023-11-16T08:27:11.011+02:00  INFO 148665 --- [v-server-output] c.v.b.devserver.DevServerOutputTracker   :     5 |     get options(): ObjectModel_1<Record<string, ReadonlyArray>> {
2023-11-16T08:27:11.011+02:00  INFO 148665 --- [v-server-output] c.v.b.devserver.DevServerOutputTracker   :   > 6 |         return this[_getPropertyModel_1]("options", (parent, key) => new ObjectModel_1(parent, key, true, { meta: { javaType: "java.util.Map" } }));
2023-11-16T08:27:11.012+02:00  INFO 148665 --- [v-server-output] c.v.b.devserver.DevServerOutputTracker   :       |         ^^^^^^
2023-11-16T08:27:11.012+02:00  INFO 148665 --- [v-server-output] c.v.b.devserver.DevServerOutputTracker   :     7 |     }
2023-11-16T08:27:11.012+02:00  INFO 148665 --- [v-server-output] c.v.b.devserver.DevServerOutputTracker   :     8 | }
2023-11-16T08:27:11.012+02:00  INFO 148665 --- [v-server-output] c.v.b.devserver.DevServerOutputTracker   :     9 | export default DataRecordModel;
`
This problem is present in Hilla 2.3.3. (Worked OK with Hilla 2.2.2)
Expected-behavior
Hilla should generate a valid typescript file
Reproduction
See https://github.com/random9067047/hilla233EndpointGenericsError
Run the application.
If the error is not produced immediately, edit the main-view.ts and save it. This should trigger a re-generation of the ts-file and make the error visible.
System Info
Ubuntu 22.04.3 LTS
FireFox 119.0.1 (64-bit)
Hilla 2.3.3
Java 17 (Java 21)
IntelliJ IDEA

This is already fixed in Hilla 2.5. You can update your application to 2.5.1.

Closing as this has been resolved with #1793


WIP eh_frame CIE with version 3

This is the __eh_frame section of my /usr/lib/libobjc.A.dylib.
See #244
WIP pull request until we figure out what to do with this.

Coverage decreased (-94.04%) to 0.0% when pulling 549d37ce5f1a0b360e2f2c51d55c832aebd76500 on fitzgen:eh-frame-with-version-3 into de7eeff87fa21264e41f2b2e0b82f45f88851b2d on gimli-rs:master.

D'oh not sure what I did... Going to just close this for now.


WinSDK: further extend the WinSock module

Add the new afunix.h header to the WinSock module which was introduced
in the 10.0.17134 release.

Replace this paragraph with a description of your changes and rationale. Provide links to external references/discussions if appropriate.

Resolves SR-NNNN.

@swift-ci please smoke test

@swift-ci please test Windows platform

What does this header provide, and is it backwards-deployable?

@millenomi this provides AF_UNIX socket support.  This is not really back-deployable, but, this is when building the module.  If you do not use AF_UNIX in your code, then you can back-deploy.  That said, we already have the minimal platform SDK at 10.0.17763 and this was introduced in 10.0.17134.

Got it. We use AF families in a bunch of places, and I was evaluating if we could adopt anything from here in eg SocketPort et al.

The JIT regression is unrelated to this change, tracking in #29863.