Support for tools like telefunc

Describe the bug
Telefunc allows simple frontend to backend calls, avoiding direct call to fetch.
// The `CreateTodo.telefunc.js` file is not loaded:
// Telefunc transforms `*.telefunc.js` imports into a
// thin HTTP client.
import { onNewTodo } from './CreateTodo.telefunc.js'

...

await onNewTodo({ text })

Using telefunc + sveltekit can cause the following issues:

Cannot import $env/static/private into client-side code
Cannot import $lib/server/xyz.telefunc.ts into client-side code

Those errors happen at build time and in dev mode, but in dev mode, switching between pages can make it work again. See reproduction repo
Reproduction
https://github.com/magne4000/sveltekit-telefunc-repro
pnpm i && pnpm run dev
The 3 links at the top have the 3 following cases:

working
failing because of $env/static/private import
failing because of $lib/server

Logs
[vite-plugin-svelte-kit] Cannot import $lib/server/test3.telefunc.ts into client-side code:
- .svelte-kit/generated/nodes/4.js
  - src/routes/failing/server-folder/+page.svelte
    - $lib/server/test3.telefunc.ts
error during build:
Error: Cannot import $lib/server/test3.telefunc.ts into client-side code:
- .svelte-kit/generated/nodes/4.js
  - src/routes/failing/server-folder/+page.svelte
    - $lib/server/test3.telefunc.ts
    at IllegalModuleGuard.assert_legal (file:///home/magne/workspace/sveltekit-telefunc/node_modules/.pnpm/@sveltejs+kit@1.0.0-next.480_svelte@3.50.1+vite@3.1.0/node_modules/@sveltejs/kit/src/exports/vite/utils.js:47:11)
    at IllegalModuleGuard.assert_legal (file:///home/magne/workspace/sveltekit-telefunc/node_modules/.pnpm/@sveltejs+kit@1.0.0-next.480_svelte@3.50.1+vite@3.1.0/node_modules/@sveltejs/kit/src/exports/vite/utils.js:49:9)
    at prevent_illegal_rollup_imports (file:///home/magne/workspace/sveltekit-telefunc/node_modules/.pnpm/@sveltejs+kit@1.0.0-next.480_svelte@3.50.1+vite@3.1.0/node_modules/@sveltejs/kit/src/exports/vite/utils.js:424:8)
    at file:///home/magne/workspace/sveltekit-telefunc/node_modules/.pnpm/@sveltejs+kit@1.0.0-next.480_svelte@3.50.1+vite@3.1.0/node_modules/@sveltejs/kit/src/exports/vite/index.js:357:7
    at Array.forEach (<anonymous>)
    at Object.handler (file:///home/magne/workspace/sveltekit-telefunc/node_modules/.pnpm/@sveltejs+kit@1.0.0-next.480_svelte@3.50.1+vite@3.1.0/node_modules/@sveltejs/kit/src/exports/vite/index.js:349:25)
    at file:///home/magne/workspace/sveltekit-telefunc/node_modules/.pnpm/rollup@2.78.1/node_modules/rollup/dist/es/shared/rollup.js:22710:40
    at async PluginDriver.hookParallel (file:///home/magne/workspace/sveltekit-telefunc/node_modules/.pnpm/rollup@2.78.1/node_modules/rollup/dist/es/shared/rollup.js:22632:17)
    at async file:///home/magne/workspace/sveltekit-telefunc/node_modules/.pnpm/rollup@2.78.1/node_modules/rollup/dist/es/shared/rollup.js:23763:13
    at async catchUnfinishedHookActions (file:///home/magne/workspace/sveltekit-telefunc/node_modules/.pnpm/rollup@2.78.1/node_modules/rollup/dist/es/shared/rollup.js:23088:20)

Cannot import $env/static/private into client-side code:
- src/routes/failing/private-env/+page.svelte
  - $lib/test2.telefunc.ts
    - $env/static/private
Error: Cannot import $env/static/private into client-side code:
- src/routes/failing/private-env/+page.svelte
  - $lib/test2.telefunc.ts
    - $env/static/private
    at IllegalModuleGuard.assert_legal (file:///home/magne/workspace/sveltekit-telefunc/node_modules/.pnpm/@sveltejs+kit@1.0.0-next.480_svelte@3.50.1+vite@3.1.0/node_modules/@sveltejs/kit/src/exports/vite/utils.js:47:11)
    at IllegalModuleGuard.assert_legal (file:///home/magne/workspace/sveltekit-telefunc/node_modules/.pnpm/@sveltejs+kit@1.0.0-next.480_svelte@3.50.1+vite@3.1.0/node_modules/@sveltejs/kit/src/exports/vite/utils.js:49:9)
    at prevent_illegal_vite_imports (file:///home/magne/workspace/sveltekit-telefunc/node_modules/.pnpm/@sveltejs+kit@1.0.0-next.480_svelte@3.50.1+vite@3.1.0/node_modules/@sveltejs/kit/src/exports/vite/utils.js:437:8)
    at Object.result.component (file:///home/magne/workspace/sveltekit-telefunc/node_modules/.pnpm/@sveltejs+kit@1.0.0-next.480_svelte@3.50.1+vite@3.1.0/node_modules/@sveltejs/kit/src/exports/vite/dev/index.js:93:9)
    at async Promise.all (index 1)
    at async render_response (file:///home/magne/workspace/sveltekit-telefunc/node_modules/.pnpm/@sveltejs+kit@1.0.0-next.480_svelte@3.50.1+vite@3.1.0/node_modules/@sveltejs/kit/src/runtime/server/page/render.js:82:16)
    at async render_page (file:///home/magne/workspace/sveltekit-telefunc/node_modules/.pnpm/@sveltejs+kit@1.0.0-next.480_svelte@3.50.1+vite@3.1.0/node_modules/@sveltejs/kit/src/runtime/server/page/index.js:276:10)
    at async resolve (file:///home/magne/workspace/sveltekit-telefunc/node_modules/.pnpm/@sveltejs+kit@1.0.0-next.480_svelte@3.50.1+vite@3.1.0/node_modules/@sveltejs/kit/src/runtime/server/index.js:231:17)
    at async respond (file:///home/magne/workspace/sveltekit-telefunc/node_modules/.pnpm/@sveltejs+kit@1.0.0-next.480_svelte@3.50.1+vite@3.1.0/node_modules/@sveltejs/kit/src/runtime/server/index.js:301:20)
    at async file:///home/magne/workspace/sveltekit-telefunc/node_modules/.pnpm/@sveltejs+kit@1.0.0-next.480_svelte@3.50.1+vite@3.1.0/node_modules/@sveltejs/kit/src/exports/vite/dev/index.js:406:22

System Info
System:
    OS: Linux 5.19 undefined
    CPU: (16) x64 AMD Ryzen 7 5800X 8-Core Processor
    Memory: 23.40 GB / 31.26 GB
    Container: Yes
    Shell: 5.1.16 - /bin/bash
  Binaries:
    Node: 16.15.0 - ~/.volta/tools/image/node/16.15.0/bin/node
    Yarn: 1.22.19 - ~/.volta/tools/image/node/16.15.0/bin/yarn
    npm: 8.10.0 - ~/.volta/tools/image/npm/8.10.0/bin/npm
  Browsers:
    Firefox: 104.0.2
  npmPackages:
    @sveltejs/adapter-auto: next => 1.0.0-next.72
    @sveltejs/kit: next => 1.0.0-next.480
    svelte: ^3.44.0 => 3.50.1
    vite: ^3.1.0 => 3.1.0

Severity
serious, but I can work around it
Additional Information
The .telefunc. files are untouched on server side, but are obviously transformed when used client side. There seems to be a mixup in the dependencies check.
I don't know how difficult of a fix this is, but a hacky workaround could be to exclude .telefunc. files from the check :shrug:.

cc @brillout

Is the idea to use this during SSR as well? The would be a pretty big change and I honestly have no idea what that would look like yet, because SvelteKit currently figures out which responses it needs to serialize into the HTML by having all of the API requests go through its wrapped fetch function. If fetch is skipped, it can't figure that out.
Or is the plan to only use this for requests from the browser, and the issue is that SK is looking at untransformed modules (or something) and sees a client-side import of a module that should be server-only?

Is the idea to use this during SSR as well?

I guess so, but what I'm actually doing is importing the .telefunc. files I need in +page.server.ts and pass the result as props.
I think that it would be great if it could work, but it's IMO less important than the second point.

Or is the plan to only use this for requests from the browser, and the issue is that SK is looking at untransformed modules (or something) and sees a client-side import of a module that should be server-only?

That's currently the issue most of people will face, and that's what is reported here :+1:

This is intended behavior. You can't import anything from $lib/server into client-side code. Same for $env/*/private. The errors are showing you the import chain that's causing the problem.

Or is the plan to only use this for requests from the browser

Yea I think we can focus on this for now and then see later if we want to also support fetching SSR data.

You can't import anything from $lib/server into client-side code. Same for $env/*/private. The errors are showing you the import chain that's causing the problem.

The thing is that the file itself is not imported into client-side code, it's replaced by something else.
Conceptually I could understand that we would still not want to "see" $lib/server imports written in client-side code (whether there is actually server side code in it or not), but for $env/*/private it's a real issue.
I have actual use-cases where I need private env vars in my .telefunc. files (DB connection), they will never appear in client-side code, but I still get an error. For now I had to use process.env. to circumvent the issue.

@tcc-sejohnson Telefunc transforms .telefunc.js imports into a thin client making HTTP requests, see https://telefunc.com/. So while the code of .telefunc.js files is server code, the imports don't actually load the file.

I don't think there's really any way for us to help with this from an environment variable standpoint. The idea behind telefunc is cool, but the fact is you are importing a server-only module on the client. We don't really have any way of knowing that you're going to screw with it in order to split it.
I think this would have to somehow be resolved from the telefunc side -- you'd have to compile your separate modules prior to the SvelteKit Vite plugin. @Rich-Harris, any ideas?

One solution I see is Telefunc's Vite plugin setting some kind of config, e.g. vite.config.js#svelteKit.allowServerImportFromClient = (filename) => filename.endsWith('.telefunc.js'), for SvelteKit to pick up.
Btw. Telefunc was on Hacker News's front page earlier today. While Telefunc is still young, I think there is interest in RPC solutions like Telefunc and many have asked whether Telefunc supports SveleKit in the past.
I'm very much looking forward to have Telefunc support SvelteKit!

I'm going to hazard a guess that that solution is going to be a "no" from Rich. I think the "correct" solution here would be to use a public environment variable. You're trying to enable importing a private variable on the client. SvelteKit has no way of knowing that you're "not really" importing it on the client, nor do I really think from a platform perspective that we'd want to trust other libraries when they say "trust me bro, it might look like a client import, but it's not" -- because there's no way of actually verifying it. If you want your environment variables to be importable from client files, they need to be public.
Alternatively, telefunc could provide its own environment variable module in its own Vite plugin. Imagine this:
import { TELEFUNC_API_KEY } from `$telefunc/static` // throws if imported from anywhere but a `.telefunc.` file

If you'd like to take a look at that route, I'd be happy to contribute the code. I could modify a personal Vite plugin I built and steal some code from Kit.

I didn't look at the reproduction, so I may miss something, but I think we are conflating two issues? AFAIK (but I may miss something) the only thing Telefunc needs here is the client to be able to import from the server, since that's, well, the whole idea of Telefunc.

Incorrect. Telefunc can already be imported from the server on the client. It can't be imported on the client if the server file is accessing private environment variables.

I think this would have to somehow be resolved from the telefunc side -- you'd have to compile your separate modules prior to the SvelteKit Vite plugin

This breaks the whole point of Telefunc if I understand correctly, as it would require to use different imports on server and client.

SvelteKit has no way of knowing that you're "not really" importing it on the client, nor do I really think from a platform perspective that we'd want to trust other libraries when they say "trust me bro, it might look like a client import, but it's not" -- because there's no way of actually verifying it

I understand the point, but I do not fully agree with it. Yes it seems weird to add some kind of whitelist directly in SvelteKit code, but a specific configuration as mentioned by @brillout does circumvent that.
SvelteKit safety checks are good enough without being perfect. This new configuration option would not break SvelteKit in any way, it just allows developers to tell SvelteKit that they know what they are doing.

I would like to give a real life example of what actually happens on one of my project with SvelteKit+Telefunc.
Telefunc accesses backend stuffs such as:

DB credentials and query executions
External API calls with Secrets

Many of those files should reside in $lib/server in a SvelteKit project. In my case, I had to rename src/lib/server to src/lib/_server to be able to compile anything.
What this mean is that I had to disable the whole SvelteKit check in order not to micro manage files that were used both by SvelteKit and Telefunc (it's more than 50% of them anyway).
Same thing for $env/static/private, I had to replace the vast majority of those by either process.env or import.meta.env.
The finality is that the added safety of SvelteKit is now almost totally disabled.

I tried debugging this, but the only error I got was about @brillout/json-s:

@brillout/json-s doesn't appear to be written in CJS, but also doesn't appear to be a valid ES module (i.e. it doesn't have "type": "module" or an .mjs extension for the entry point). Please contact the package author to fix.

See https://publint.bjornlu.com/<EMAIL_ADDRESS>

During build, it's only the file in $lib/server that fails. Using $env/static/private is fine. The solution here is pretty simple: don't name your folder server
There might be a bug in dev though

I believe the SvelteKit code is working as intended here. Telefunc returns the following from transform:
import { PRIVATE_KEY } from '$env/static/private'\nimport { shield as __shieldGenerator_shield } from \"telefunc\";\n\nexport async function test2(subject: string) {\n  return 'test2: ' + PRIVATE_KEY + ' ' + subject;\n}\n\nconst __shieldGenerator_t = __shieldGenerator_shield.type;\n__shieldGenerator_shield(test2, [__shieldGenerator_t.string], { __autoGenerated: true })\n

It's using the PRIVATE_KEY, which is what we're trying to prevent. If it's expected that telefunc does not use the private key on the client, then I think this bug is primarily in telefunc as the removal of the key doesn't appear to be happening.
It actually uses PRIVATE_KEY in build mode as well, so I'm surprised it doesn't fail on that. @tcc-sejohnson I think there might be a bug here in SvelteKit and that we should actually be stricter and are somehow missing a case.

@benmccann Can you share your efforts at repro-ing?

I believe the SvelteKit code is working as intended here. Telefunc returns the following from transform:
import { PRIVATE_KEY } from '$env/static/private'\nimport { shield as __shieldGenerator_shield } from \"telefunc\";\n\nexport async function test2(subject: string) {\n  return 'test2: ' + PRIVATE_KEY + ' ' + subject;\n}\n\nconst __shieldGenerator_t = __shieldGenerator_shield.type;\n__shieldGenerator_shield(test2, [__shieldGenerator_t.string], { __autoGenerated: true })\n

It's using the PRIVATE_KEY, which is what we're trying to prevent.

That's the server-side transform so it's expected that PRIVATE_KEY is still in there.
The client-side transform does nuke the whole file, including PRIVATE_KEY.

During build, it's only the file in $lib/server that fails. Using $env/static/private is fine. The solution here is pretty simple: don't name your folder server
There might be a bug in dev though

Hum, didn't saw that at first: it still fails, but only if you reload the page.

I tried debugging this and kept getting a warning about @brillout/json-s:

@brillout/json-s doesn't appear to be written in CJS, but also doesn't appear to be a valid ES module (i.e. it doesn't have "type": "module" or an .mjs extension for the entry point). Please contact the package author to fix.

I filed brillout/json-serializer#9

👍 Fixed. @magne4000 I made a PR to the reproduction.


Feature Request:

Bug description / Feature request:
Can I have the draggable/resizable events over a span of 4 days or a week. Currently I think it is only intra-day. Something like in the link shared below
Link to minimally-working plunker that reproduces the issue
http://dhtmlx.com/docs/products/dhtmlxScheduler/sample_basic.shtml
Versions
Angular: 1.3/1.4/1.5
Calendar directive: draggable/resizable events
Browser name and version: Chrome v51 (ubuntu) / firefox 47 (ubuntu)

There is the calendarConfig.showTimesOnWeekView = true option that you can use to make the week view more like the day view. The only caveat is that end times are ignored, so resizing events won't work, however dragging and dropping between times and days will.


multiple content types in openAPI spec result in SyntaxError in contract tests

portman version 1.3.2
Using the following openAPI spec document:
https://gist.github.com/scags9876/889d739a72217f68ef3d1d93b2a6a034
When contract tests are generated, there is a SyntaxError:
 1.  SyntaxError                      Identifier 'schema' has already been declared
                                      at test-script
                                      inside "Get Pastry by name"

Looking at the generated tests in the collection, I see:
// Response Validation
const schema = {"title":"Root Type for Pastry","description":"The root of the Pastry type's schema.","type":"object","properties":{"name":{"description":"Name of this pastry","type":"string"},"description":{"description":"A short description of this pastry","type":"string"},"size":{"description":"Size of pastry (S, M, L)","type":"string"},"price":{"description":"Price (in USD) of this pastry","type":"number"},"status":{"description":"Status in stock (available, out_of_stock)","type":"string"}},"example":{"name":"My Pastry","description":"A short description os my pastry","size":"M","price":4.5,"status":"available"}}

// Validate if response matches JSON schema
pm.test("[GET]::/pastry/:name - Schema is valid", function() {
    pm.response.to.have.jsonSchema(schema,{unknownFormats: ["int32", "int64"]});
});

// Response Validation
const schema = {"title":"Root Type for Pastry","description":"The root of the Pastry type's schema.","type":"object","properties":{"name":{"description":"Name of this pastry","type":"string"},"description":{"description":"A short description of this pastry","type":"string"},"size":{"description":"Size of pastry (S, M, L)","type":"string"},"price":{"description":"Price (in USD) of this pastry","type":"number"},"status":{"description":"Status in stock (available, out_of_stock)","type":"string"}},"example":{"name":"My Pastry","description":"A short description os my pastry","size":"M","price":4.5,"status":"available"}}

// Validate if response matches JSON schema
pm.test("[GET]::/pastry/:name - Schema is valid", function() {
    pm.response.to.have.jsonSchema(schema,{unknownFormats: ["int32", "int64"]});
});

It looks like, since there are multiple content types in the responses.status.content map, as the spec allows, a test is added for each content type.  Perhaps a separate request should be added to the collection for each content type with the content type header specified, and the schema validation for only that content type should be run in the tests for that request.  Or, explicitly state that portman only supports json responses and do not generate tests for other content types.
Additionally to the issue above, the collection tests also include:
// Validate if response header has matching content-type
pm.test("[GET]::/pastry/:name - Content-Type is application/json", function () {
   pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json");
});

// Validate if response header has matching content-type
pm.test("[GET]::/pastry/:name - Content-Type is text/xml", function () {
   pm.expect(pm.response.headers.get("Content-Type")).to.include("text/xml");
});

One of which will likely fail.  The same solutions I describe above could fix this too, or I'm sure some other method is possible.
Further info.
using the cli-options:
{
  "url": "https://gist.githubusercontent.com/scags9876/889d739a72217f68ef3d1d93b2a6a034/raw/d979161b9f468c90c6203035c0de72dec7df3622/APIPastry-openapi-fixed-price.yaml",
  "baseUrl": "http://<IP_ADDRESS>:4010",
  "output": "collection.postman.json",
  "includeTests": true,
  "syncPostman": false,
  "runNewman": true
}

Let me know if I can provide further info.

Thanks @scags9876 for bringing it to our attention.
There are a number of ways to solve this, so we are looking into an option that is easy to configure with the test injection.
The different content-types can be considered response variations (tackled in the variation testing part) but they also are part of the contract testing.
You already hinted at a number of options to solve this, which we will take into account.
While we work on enhancing the support for multiple content-types, we will introduce a fix, where we will take the 1st content-type that is defined in the OpenAPI response.

@scags9876 in the 1.3.3 release we already applied the temporary fix, to provide working tests with multiple content-types.
We will continue with the enhancement of supporting multiple content-types. This will take more time finalise.

@scags9876 We are actively working on a configuration option for handling the multiple content-types. I m wondering to hear your feedback. The goal is to make the test suite configuration easy but still allow flexibility.
Idea: openapi allows to define multiple responses and multiple content-types, Portman would provide a "standard" that picks 1 response and 1 content-type of that response, meaning a 2xx response and 1 content-type for the 2xx response.
Some questions:

Would you be ok with this idea? Or have different expectations?

would you be ok to separate the contract testing for the multiple content-types in 2 parts: one for standard response: 2xx - 1 content-type and have the other content types split off in a variation test? Which would still lead to different postman request per content type, but the variations would be grouped in the variation test folder. Keeping the main request cleaner.

That seems like an acceptable solution.  I have not played with the variation tests very much, so I'm not sure if it would fit my use case exactly.
My ideal solution would be to have a all content types be exercised in the contract tests: one request in the collection for each content type.   That is the way I've hand written contract tests in postman in the past.  That is, each path gets 2 requests in the collection: one for json, one for xml.
If it's your preference to keep them in the variation tests and that flows better for you, then I'm fine with adapting my testing strategy if this tool fits my needs :)


Feature-Request: Case sensistive replacements

If I have
leagues := getLeagues(),
and I want to replace leagues with teams, I end up with
teams := getteams()
instead of
teams := getTeams().
Basically, when replacing, have a toggle that can keep the "in-place" case of the replacement. JEdit does this very well, and it is extremely handy.

This feature request will not be considered in the next 6-12 months roadmap and as such will be closed to keep the number of issues we have to maintain actionable. Thanks for understanding and happy coding!


Analyze by percent

Codecov Report

Merging #60 into master will decrease coverage by 0.35%.
The diff coverage is 50%.

@@            Coverage Diff             @@
##           master      #60      +/-   ##
==========================================
- Coverage   81.81%   81.45%   -0.36%
==========================================
  Files          10       10
  Lines        1424     1440      +16
==========================================
+ Hits         1165     1173       +8
- Misses        259      267       +8

Impacted Files
Coverage Δ

paprika/analysis.py
88.51% <50%> (-3.22%)
:arrow_down:

paprika/tleap.py
88.76% <0%> (+0.72%)
:arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2dce999...bbebf2b. Read the comment docs.


Array: Insert Interval in C++

You are given an array of non-overlapping intervals intervals where intervals[i] = [starti, endi] represent the start and the end of the ith interval and intervals is sorted in ascending order by starti. You are also given an interval newInterval = [start, end] that represents the start and end of another interval.
Insert newInterval into intervals such that intervals is still sorted in ascending order by starti and intervals still does not have any overlapping intervals (merge overlapping intervals if necessary).
Return intervals after the insertion.
Example 1:

Input: intervals = [[1,3],[6,9]], newInterval = [2,5]
Output: [[1,5],[6,9]]

I'll take up this.

I THINK YOU'RE DISABLED THE UPLOAD


Daisyui colors not using custom prefix

Hello!
I'm using daisyui with a custom prefix "ui-" and I expected the custom colors provided by the library to respect that configuration, meaning "bg-base-100" would translate to "ui-bg-base-100" for example, but apparently they do not.
Just to confirm, is this the intended behaviour?
Playground: https://play.tailwindcss.com/1ZCeyGvaEi
Thanks! 😄

The difference between a class name like .btn and a class name like .bg-base-100 is that the first one is added by daisyUI but the second one is getting added by Tailwind CSS.
daisyUI actually extends Tailwind CSS colors and adds new color names like primary, secondary, etc.
So, yes it is how it should work.
You might also want to add prefixes to all Tailwind CSS class names if you want
Let me know if you have any questions

Thanks for the quick response!
I guess my mental model was incorrect, as I assumed "everything related to daisyui would be prefixed". It works either way, thanks! 😄


add MEDIA QUERIES to css (after other code is finalized)

added media queries for various screen sizes to the style.css file -- determined break points via testing.


Client v1.14.0 floods STDOUT with mashie warnings

Environment
Ruby 2.4.0
Hashie 3.5.5
This likely occurs as a result of using Hashie 3.5+ , which introduced the warning "feature".
Reproducing

Call client.tickets.last (or anything, really)
Observe warning spam like the following:

You are setting a key that conflicts with a built-in method Hashie::Mash#class defined in
 Kernel. This can cause unexpected behavior when accessing the key via as a property. You
 can still access the key via the #[] method.
W, [2017-02-27T01:20:01.552016 #367]  WARN -- : You are setting a key that conflicts with
 a built-in method Hashie::Mash#class defined in Kernel. This can cause unexpected behavi
or when accessing the key via as a property. You can still access the key via the #[] met
hod.

Expected behaviour
If the warnings are expected, silence them. See the section relating to disable_warnings in https://github.com/intridea/hashie .
Workarounds
Set hashie logger to Rails logger or disable it entirely. This feels a little aggressive, though. e.g. https://github.com/berkshelf/berkshelf/pull/1668/files

@bentheax thanks for reporting! I'm seeing this too.

Fixed in v1.14.3 by #327.


Deep frying shader doesn't work on a lot of renderers

Description

So far confirmed on:
AMD Mesa (source: me)
Intel Integrated Mesa (source: @Leander-0)

I have modified the shader to not use a reserved keyword for mesa. Let's see if anyone else has issues and close if there's no further reports within a few days.

somehow it works on proprietary novideo drivers, even though 99% of effect shaders like drugs get really glitchy

The last known issues involving unspecified precision were fixed in the last deep fryer commit, and I haven't heard of any new issues involving the shader. I feel like we can close this for now.
For future reference, the most compatible way to write a shader for SS14 seems to be to always specify precision for all variables and function arguments, and to avoid using keywords that may be reserved on one interpreter but not another.


Remove constructors without location information from ast.h

Should we remove constructors without location information from ast.h in the future?
Originally posted by @mmarchini in https://github.com/iovisor/bpftrace/pull/845#issuecomment-531887628

Yeah sounds reasonable.

Similar to #912, possibly do both together.

Can I grab this one?

@danobi Do you want me to wait with this before you merge #912?

Done by #1625.


Fix broken links for dotnet CLI

PR Summary
Fixes links in markdown that point to the wrong place.
PR Context

PR Checklist

[x] PR has a meaningful title

Use the present tense and imperative mood when describing your changes

[x] Summarized changes
[x] Make sure all .h, .cpp, .cs, .ps1 and .psm1 files have the correct copyright header
[x] This PR is ready to merge and is not Work in Progress.

If the PR is work in progress, please add the prefix WIP: or [ WIP ] to the beginning of the title (the WIP bot will keep its status check at Pending while the prefix is present) and remove the prefix when the PR is ready.

Breaking changes

[x] None
OR
[ ] Experimental feature(s) needed

[ ] Experimental feature name(s):

User-facing changes

[x] Not Applicable
OR
[ ] Documentation needed

[ ] Issue filed:

Testing - New and feature

[x] N/A or can only be tested interactively
OR
[ ] Make sure you've added a new test if existing tests do not effectively test the code changed

Tooling

[x] I have considered the user experience from a tooling perspective and don't believe tooling will be impacted.
OR
[ ] I have considered the user experience from a tooling perspective and opened an issue in the relevant tool repository. This may include:

[ ] Impact on PowerShell Editor Services which is used in the PowerShell extension for VSCode
(which runs in a different PS Host).

[ ] Issue filed:

[ ] Impact on Completions (both in the console and in editors) - one of PowerShell's most powerful features.

[ ] Issue filed:

[ ] Impact on PSScriptAnalyzer (which provides linting & formatting in the editor extensions).

[ ] Issue filed:

[ ] Impact on EditorSyntax (which provides syntax highlighting with in VSCode, GitHub, and many other editors).

[ ] Issue filed:

@PoshChan  Please remind me in 1 hour

I restarted the static CI with different results - it seems a network is unstable today :-(

@TravisEz13, this is the reminder you requested 1 hour ago

azp /help

/azp list

/azp run PowerShell-CI-static-analysis

What is right milestone for the commit?


Join Forces with Rakugo

Hi, @coppolaemilio  I and  Vaasref are making our own Dialogue system called Rakugo with rollback and save feature.
We are now chaing it a lot. So maybe you want to join? Here is discord project: https://discord.gg/K9gvjdg

never mind


Update action-diff to not include the stable component ID

This PR reworks how networking via ActionDiff works:

instead of using a "Stable ID Component" that uniquely identifies entities across client and server, we introduce the ActionDiffEvent type, which has:

an owner: the Entity that generates the action, or None if we are using a global ActionState
the action_diff itself

we remove the process_action_diffs system in favor of a method ActionState.apply_diff(action_diff), to leave more flexibility to users over how to process the action-diffs (perform entity-mapping, etc.)

I'm slightly confused about this: https://github.com/Leafwing-Studios/leafwing-input-manager/blob/main/src/systems.rs#L216: we detect if the button is Pressed/ValueChanged just based on the value?
What if we have a 'Value' type button that has a value of 1.0? We would then get a Pressed ActionDiff, which seems incompatible?
NOTE: it might actually be more efficient to have the ActionDiffEvent contains a Vec<ActionDiff> since we can compute all of them in one go for a given entity

I'm slightly confused about this: https://github.com/Leafwing-Studios/leafwing-input-manager/blob/main/src/systems.rs#L216: we detect if the button is Pressed/ValueChanged just based on the value?
What if we have a 'Value' type button that has a value of 1.0? We would then get a Pressed ActionDiff, which seems incompatible?

Yeah, this seems a bit sloppy to me too. Can you make an issue about this?

NOTE: it might actually be more efficient to have the ActionDiffEvent contains a Vec since we can compute all of them in one go for a given entity

Agreed, I think this is important given the networking-centric nature of this code. Feel free to make that change in this PR or a follow-up.

I'm slightly confused about this: https://github.com/Leafwing-Studios/leafwing-input-manager/blob/main/src/systems.rs#L216: we detect if the button is Pressed/ValueChanged just based on the value?
What if we have a 'Value' type button that has a value of 1.0? We would then get a Pressed ActionDiff, which seems incompatible?

Yeah, this seems a bit sloppy to me too. Can you make an issue about this?

NOTE: it might actually be more efficient to have the ActionDiffEvent contains a Vec since we can compute all of them in one go for a given entity

Agreed, I think this is important given the networking-centric nature of this code. Feel free to make that change in this PR or a follow-up.

I made the change for the Event to contain a Vec<ActionDiff>.
And sure i'll create an issue!


Something is wrong on some of the output images?

I used the default settings and params. After training on my own datasets, in some of my test output images using the saved model, there are strange green areas on them like the image on the right below(the left one is the origin test image). Is this related to the Bilateral Learning algorithm?

Looks like some dimensions are transposed, are you having the same issue with the pretrained models?

@mgharbi Thanks for your reply. Yes, it is! Here are some of the results below. The left one is processed by pretrained model of hdrp, and the right one is processed by pretrained model of instagram. I think using other pretrained models will also get the similar issue.

Ah crap, if your TF might have changed some the internal storage pattern of the tensors somewhere, this is definitely not the expected output. The provided sample image sample_data/input.png should work, if not we'll have to dig deeper.
One way to debug this would be to isolate the "bilateral_slice_apply" operator and feed it with simple images e.g. an image with R=1 G=2 B=3, and a bilateral grid that contains all zeros except for one of the 12 coefficients. For instance with coef0=1 only, the output should be coef0R + coef1G +coef2B + coef3 = 11 = 1 everywhere, if that is not the case something got transposed

@mgharbi Only partial test output results are bad and the others are good. There is no problem on the  output of the sample image. In addition, I found that the guidance map of the input image is already corrupt.

@mgharbi @cfanyyx Hi, i have the same issue with just some images, depending on their shape.
The strange thing is that if you substitute these lines https://github.com/mgharbi/hdrnet_legacy/blob/b06d0119e2fb22c62c757161e6d351a304720544/hdrnet/models.py#L177-L185
which learn to convert an RGB image in a grayscale one, with guidemap = tf.image.rgb_to_grayscale(curve) the problem disappears.
I still don't know why but maybe @mgharbi has some ideas about it.

This fix surely would guide you a guide, but you will not be able to learn a better occupation of the grid (via the tonecurve).
I would also be surprised if the conv2d layer was bogus, and I suspect the logic that comes before that to have turned stale:
https://github.com/mgharbi/hdrnet_legacy/blob/b06d0119e2fb22c62c757161e6d351a304720544/hdrnet/models.py#L154-L173
instead of rgb_to_grayscale, you could try to set inputs=input_tensor in L177 to verify this part.
If the output looks like an image (no wieird transpose), the next steps would be:

isolate the curve part: you could comment out L163-175 and sum guidemap along the channel dimension to get a valid grayscale image.
isolate the change of color basis ccm (for color correction matrix): comment L154-160. The dimension of guidemap should still be valid to use as argument to the tonecurve below.

@mgharbi @cortes93 After testing, it seems that there is something wrong with ccm, the part of curve looks normal, and the conv2d also has something wrong, but the problem of conv2d may come from its prior ccm as it is a convolution layer.

@mgharbi @cfanyyx I think I found a workaround for the issue which let us maintain the convolutional layer. You need to run the multiplication in L157 and the convolution in L177 with the CPU. I don't know the reason but I think that it is due to a mismatch between the way that GPU learned to multiply the two matrix and the shape of the input we want to make inference.


Refresh exports to use those for imports

Hey :) Thank you for working on this great plugin - love it!
What I find annoying - I create an export, e.g.
export NEW_CONST = 'x';

and then want to use it. Sadly, the new export cannot be found among the imports list.
If I reopen vscode or change project forth and back, then the export appears among suggestions.
It would be great to provide a shortcut to re-scan the code for new exports.
What do you think @wangtao0101 ?

@astrauka actually the extension will watch file create, change and then rescan the exports, and i have test
the export 'export NEW_CONST = 'x';', in my vscode i can get the NEW_CONST  in imports list. Can you test once more?

@astrauka  can this help you ?

@wangtao0101 it works, thank you for checking it :)


customRuntimeOptions in "Creates a new Pulsar Source in cluster mode" API call in source connector doesn't add nodeselectors & tolerations

Describe the bug
The API call "Creates a new Pulsar Source in cluster mode"  LINK Adding node selectors and toleration under customRuntimeOptions flag doesn't seem to add those selectors & toleration to the created pulsar functions source pods. For reference I'm using apache pulsar installed using helm on k8
To Reproduce
Steps to reproduce the behavior:

Create an "Creates a new Pulsar Source in cluster mode"  with "customRuntimeOptions":  json.dumps(
"nodeSelectorLabels": {
"customLabel": "value"
},
"tolerations": [
{
"key": "custom-key",
"value": "value",
"effect": "NoSchedule"
}
]) As mentioned here

2, the created source connector doesn't have the node selector / toleration
Expected behavior
The passed nodeselectors and tolerations from customRuntimeOptions should be inherited onto the pods that get created
Desktop (please complete the following information):

OS: Mac OS 13.5.2 (22G91) Apple M1 Pro

Additional context
Add any other context about the problem here.

Related to #382

Related to #382

In this issue , you suggested to configure things by passing values to broker's config map. which i did
PF_runtimeCustomizerClassName: "org.apache.pulsar.functions.runtime.kubernetes.BasicKubernetesManifestCustomizer"
PF_runtimeCustomizerConfig_nodeSelectorLabels_test: value

based on this configuration , this will add nodeSelectors test:value to all the functions which will be deployed. Which is correct its the default nodeSelector. But I different nodeSelector for different functions which I deploy. So I should pass ": "customRuntimeOptions": "{\"nodeSelectorLabels:{\"customLabel\":\"value\"}"  Passing it as string because type of customRuntimeOptions is string which is mentioned here.
I am getting this error when I am paassing customRuntimeOptions when creating a pulsar function ->
{"reason":"Function  my-test-function cannot be admitted:- java.io.EOFException: End of input at line 1 column 40 path $.nodeSelectorLabels"}

If I don't pass customRuntimeOptions while creating the function , it works fine and take the default node selector test:value

But I want different nodeSelector for different functions which I deploy.

@kunjbosamiaFalkonry One possible approach would be to create your own customizer implementation. Currently there's not an easy way to get your custom classes into use. You need a custom overlay docker image with the jar file in /pulsar/lib . There's a feature request to add init container support that could copy the jar file to /pulsar/lib when the pod starts. That's #491 / #240 . This is an open source project and contributions are more than welcome to improve Apache Pulsar Helm chart.


feat: Warn users when submitting forms with files but no enctype="multipart/form-data"

Closes #9819. What it says on the tin.
Please don't delete this checklist! Before submitting the PR, please make sure you do the following:

[x] It's really useful if your PR references an issue where it is discussed ahead of time. In many cases, features are absent for a reason. For large changes, please create an RFC: https://github.com/sveltejs/rfcs
[x] This message body should clearly illustrate what problems it solves.
[x] Ideally, include a test that fails without this PR but passes with it.

Tests

[x] Run the tests with pnpm test and lint the project with pnpm lint and pnpm check

Changesets

[x] If your PR makes a change that should be noted in one or more packages' changelogs, generate a changeset by running pnpm changeset and following the prompts. Changesets that add features should be minor and those that fix bugs should be patch. Please prefix changeset messages with feat:, fix:, or chore:.

Oops, the line's too long now. You have to run format locally.


Google set to limit Chromium usage of Google APIs

In this blog post [1], Google states that after March 15, 2021, they will be limiting access to various Google APIs that they are now describing as "private" and "only intended for Google's use".  The most notable of this apparently includes "Chrome sync" which allows syncing bookmarks / browser history / etc. across multiple browsers logged-in to a given Google account.
Additionally, emails [2] have been sent out to chromium maintainers from other Linux distros stating that users of their chromium-based browser will no longer be able to sign in to their Google accounts.  They recommend these chromium-based browsers remove google_default_client_id and google_default_client_secret from the build configuration, or alternatively, set --allow-browser-signin=false at startup.
@edolstra  Did we get a similar email as the one shown in [2]?
[1] https://blog.chromium.org/2021/01/limiting-private-api-availability-in.html
[2] https://groups.google.com/a/chromium.org/g/chromium-packagers/c/SG6jnsP4pWM/m/HdoGEO0qCwAJ
CC @primeos @thefloweringash @bendlas

Further discussion

https://groups.google.com/a/chromium.org/g/embedder-dev/c/NXm7GIKTNTE/m/ec6ArH9SBwAJ

With actual "answer"

https://groups.google.com/a/chromium.org/g/embedder-dev/c/NXm7GIKTNTE/m/Qxcew5lfCAAJ

Basically, unless Google backtracks, the API key will become unusable for a distro-level deployment. We could continue providing the derivation, with bring-your-own API keys. This would be expensive to build for end-users. I wonder if the keys are trivially replaceable in the resulting binary though. If they are, we could produce prebuilt unusable binaries, and let users "finish" the build with their own keys.

Further discussion

https://groups.google.com/a/chromium.org/g/embedder-dev/c/NXm7GIKTNTE/m/ec6ArH9SBwAJ

With actual "answer"

https://groups.google.com/a/chromium.org/g/embedder-dev/c/NXm7GIKTNTE/m/Qxcew5lfCAAJ

Basically, unless Google backtracks, the API key will become unusable for a distro-level deployment. We could continue providing the derivation, with bring-your-own API keys. This would be expensive to build for end-users. I wonder if the keys are trivially replaceable in the resulting binary though. If they are, we could produce prebuilt unusable binaries, and let users "finish" the build with their own keys.

Some will poo-poo the thought because "not FLOSS" and similar ideologies, let's think about end-users first here.

We're smaller than those distros, but if there's a common front to talk with Google about it, we should participate or approve of such a front.

https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=972134
https://twitter.com/fedora/status/1351631726791983105
https://lists.archlinux.org/pipermail/arch-dev-public/2021-January/030263.html

This will end-up hurting a part of our end-users.

Some will poo-poo the thought because "not FLOSS" and similar ideologies, let's think about end-users first here.

We're smaller than those distros, but if there's a common front to talk with Google about it, we should participate or approve of such a front.

https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=972134
https://twitter.com/fedora/status/1351631726791983105
https://lists.archlinux.org/pipermail/arch-dev-public/2021-January/030263.html

This will end-up hurting a part of our end-users.

Personally, I don't use chrome. Google does, what google wants.
I don't think we have much of a choice, and will just provide what we can. I'm sure users will be aware that the limitation exists regardless of platform.

Personally, I don't use chrome. Google does, what google wants.
I don't think we have much of a choice, and will just provide what we can. I'm sure users will be aware that the limitation exists regardless of platform.

Yes, we should be able to pass these API keys from the environment instead of baking them in. From https://www.chromium.org/developers/how-tos/api-keys

Providing Keys at Runtime
If you prefer, you can build a Chromium binary (or use a pre-built Chromium binary) without API keys baked in, and instead  provide them at runtime. To do so, set the environment variables GOOGLE_API_KEY, GOOGLE_DEFAULT_CLIENT_ID and GOOGLE_DEFAULT_CLIENT_SECRET to your "API key", "Client ID" and "Client secret" values respectively.

Yes, we should be able to pass these API keys from the environment instead of baking them in. From https://www.chromium.org/developers/how-tos/api-keys

Providing Keys at Runtime
If you prefer, you can build a Chromium binary (or use a pre-built Chromium binary) without API keys baked in, and instead  provide them at runtime. To do so, set the environment variables GOOGLE_API_KEY, GOOGLE_DEFAULT_CLIENT_ID and GOOGLE_DEFAULT_CLIENT_SECRET to your "API key", "Client ID" and "Client secret" values respectively.

Quoting a couple lines here from the email thread, since it was initially unclear to me exactly which keys we needed to remove:

The change we announced impacts the ability to "Sign into Chrome" and consequently first party features that depend on being signed into Chrome. This does not include Safe Browsing, which doesn't depend on being signed into Chrome, and is available to third parties for non-commercial use (cf https://developers.google.com/safe-browsing).

and

This is a (partial) list of APIs Chrome depends on, including APIs available to third parties. The changes we announced affect the OAuth 2.0 client id and secret which are used for signing into Chrome, not the API key.

So, we'll just need to remove google_default_client_id and google_default_client_secret, but not google_api_key from our builds.

Quoting a couple lines here from the email thread, since it was initially unclear to me exactly which keys we needed to remove:

The change we announced impacts the ability to "Sign into Chrome" and consequently first party features that depend on being signed into Chrome. This does not include Safe Browsing, which doesn't depend on being signed into Chrome, and is available to third parties for non-commercial use (cf https://developers.google.com/safe-browsing).

and

This is a (partial) list of APIs Chrome depends on, including APIs available to third parties. The changes we announced affect the OAuth 2.0 client id and secret which are used for signing into Chrome, not the API key.

So, we'll just need to remove google_default_client_id and google_default_client_secret, but not google_api_key from our builds.

I drafted a PR: #114977. Feedback is welcome (I lost track of this for a bit).
Thanks for this issue btw :)


Add optional wrap/unwrap functions

Add optional wrap/unwrap functions of ROS message which can be overloaded by child bridge classes.
Solves #49

As I commented in #49, you can achieve this by defining custom serializer and deserializer.


Split element namespace

This splits namespace and element name, both in Sassone.Handler callbacks and in the internal representation format.

It works, but I haven't looked at the benchmarks in depth. I guess this can be optimized by doing it with the existing parser logic instead of String.split.


Make transform_block configuration fork internally

Currently transform_block expects consumers to fork the stream themselves. Instead it could fork internally and advance the stream accordingly if the callback succeeded.

Done in https://github.com/stoically/syn-rsx/commit/1c774f0671b1ef0716a4858db77bfcd0d534c3a1.


I'm confused

every time I try to run the command I get the error "Invalid Syntax" with "pip" highlighted red
I don't know what I'm doing wrong

How are you running it (providing a screenshot would be useful).


Local test stack becomes more expensive over time

When contracts are deployed right after test stack startup, the cost is minor:
  Deployment gasUsed: 1648702
    Deployment cumulativeGasUsed: 1648702
    Helper contract deployed as 0x6823D92A6BFA703978D3E9d81aB7A32f0Af88129 on L2
    Remaining funds: 4999.999999496651897609 ETH

  RegisterMethod TX gasUsed: 66756
    RegisterMethod TX cumulativeGasUsed: 66756
    Remaining funds: 4999.999999495919530853 ETH

  Deployment gasUsed: 1527133
    Deployment cumulativeGasUsed: 1527133
    Test contract deployed as 0x821638926FAF1C7d17F2a23367aD06A807b93a8C
    Remaining funds: 4999.99999947854170372 ETH

but if those same contracts are deployed e.g. 100 times, then at some point, each deployment costs about 10 ETH:
  Deployment gasUsed: 1648702
    Deployment cumulativeGasUsed: 1648702
    Helper contract deployed as 0x13b1900CFF42994842b0e8f60d71721bE180d7F9 on L2
    Remaining funds: 4848.997919261799172203 ETH

  RegisterMethod TX gasUsed: 66756
    RegisterMethod TX cumulativeGasUsed: 66756
    Remaining funds: 4839.560289261476955047 ETH

  Deployment gasUsed: 1527133
    Deployment cumulativeGasUsed: 1527133
    Test contract deployed as 0x9cfce1D02581E8f0eC2a5e9797d5F6870779edba
    Remaining funds: 4830.12265924450927777 ETH

Notably, the gasUsed and the cumulativeGasUsed are constant. Hypothesis - gas-price-oracle setting itself to a new, higher value after a timeout?

The gas-price-oracle doesn't work locally due to miss the ADDRESS_MANAGER_ADDRESS. I created PR to fix the gas-price-oracle. #244

The initial gas price in docker-compose.yml also needs to be set to a reasonable value (currently at 1 wei): [https://github.com/omgnetwork/optimism-v2/blob/0b8a3f1ba81dc0d08171c6d5232877fee4571f80/ops/docker-compose.yml#L162]

I updated two things. The first thing is GAS_PRICE_ORACLE_DECIMALS = "6", so it reduces l1GasFee.
  function getL1Fee(bytes memory _data) public view returns (uint256) {
    uint256 l1GasUsed = getL1GasUsed(_data);
    uint256 l1Fee = l1GasUsed * l1BaseFee;
    uint256 divisor = 10**decimals;
    uint256 unscaled = l1Fee * scalar;
    uint256 scaled = unscaled / divisor;
    return scaled;
  }

Anther is thing is that the GAS_PRICE_ORACLE_FLOOR_PRICE and GAS_PRICE_ORACLE_ROOF_PRICE are updated for the gas-price-oracle.
The gas-oracle-price also updates the overhead price. However, it doesn't work in the production. I commented it out in this PR: #242 {"level":30,"time":1640127268154,"overheadGas":151855912199630,"msg":"Updated overhead gas"}
The problem is solved.


[Question]: Why do I need a docstore when constructing a KnowledgeGraphIndex?

Question Validation

[X] I have searched both the documentation and discord for an answer.

Question
I don't know why a docstore is needed since the documents are passed in to the KnowledgeGraphIndex class either way. Is there a reason for this?

The docstore is holding the nodes and their original text


Reduce palette size of themes

Feature Description
Right now, the _base.less file defines all of the colours for the base theme (which is overridden for the dark theme), and the current palette size is… 121 colours, with 105 unique colours; some are duplicated but not referencing each other.
Honestly, I'd say it's a big stretch that this should be larger than 20, but the exact number isn't nearly as important. We definitely have too many.
Auditing things like colour contrast is basically not possible with this many combinations, and if someone wants to make simple changes (e.g. changing just the accent colour), this isn't really feasible, since there are so many different shades of each colour.
I think it's extremely worthwhile seeing what can be trimmed from the palette by either using a similar shade or opacity to blend with the background (in cases like the heatmap).
Screenshots
No response

I agree with needlessly eliminating variables but disagree completely with the required number of shades. At a minimum, since the stylesheet is using LESS, it should be computing required shades if necessary rather than hard-coding them, since it makes it difficult to discern what would need to be changed in case someone wanted to modify the colours.

since the stylesheet is using LESS, it should be computing required shades if necessary rather than hard-coding them

Computing colors in LESS is something I certainly want to avoid because those variables can not be interacted with at runtime (we already do that as part of the monaco themeing) and it makes 3rd party theming a lot more complex as they'd need to depend on our LESS sources. Imho, variables inside the styling must strictly stay custom properties.
CSS custom properties integrate much better than preprocessor variables. It's a shame that standard CSS still does not offer a way to modify colors at runtime, but there have been some recent proposals for just that in W3C, so maybe we'll get something in 5-10 years.

I think you're misunderstanding what I'm saying-- take the existing CSS variable definitions and replace the actual colours with versions computed using LESS functions. If you reference the compiled CSS, you'll still have static colours, but if you reference the LESS, you'll know where the colours came from.

We've migrated from Less to CSS now. Once color-mix is well supported in browsers, it can be used to reduce the number of colors, but I take it will be a year or two until that point.

This still doesn't respond at all to the argument that the stylesheet could due with substantially fewer shades than it has.
If we're talking about super-granular case like the heatmap in user profiles, this could easily be accomplished today with opacity instead of explicitly setting the background to a mixed colour. In all other cases, I still strongly disagree that a large number of shades are needed for standard UI elements; even a user with very good vision would be hard-pressed to identify ten different shades of a colour on all the standard UI elements, and much more than four is really pushing it.
I mentioned using LESS as a starting point for this issue, not the ending point.

I agree that there are too many colors. Is there a feasible plan about how to cleaning them up?

And actually, I have slight objection for such UI ( #22864) , I am not a fan of making UI too colorful .....
It's better to have some widely-accepted UI design patterns.

Another big reason against those kinds of changes is that the contrast tends to be rather poor. For example, the contrast between the red and green in the bar next to "README.md" there is effectively zero if you're red-green colourblind, and the contrast between the yellow text and the white background is also very poor.
This is also the main reason why I disagree with so many shades of colours. For example, the background colour of the header for the file element is #f7f7f7, and the colour of the main background is #ffffff. This is such a low contrast that it's effectively visible even for someone with a good monitor and good vision. This colour should be reduced to a darker shade or replaced with the original colour.

Luckily, the green-red gauge only provides some minor information, it only makes the UI looks slightly beautiful.
The real problem for me here is the orange color, I am the poor man who doesn't have a good monitor / good vision .... it's difficult for me to read how many files get changed at first glance .... 🤔

@clarfonthey Now there are new requirements for colors (focus/active), do you have more ideas about it? #24507

These are indiscussable I'd say. Fomantic UI has 4 different colors for button states, if we don't overwrite all, inconsistent colors will show up on buttons.

The discussion is about whether different states should be different colours, not whether we should set the colours in the CSS. I think we're both with you on making sure they actually follow the theme correctly, but the question is what the theme should be in the first place.

Interesting tidbit, number of color variables comparing GitHub and Gitea. GitHub has major spaghetti going on in their CSS variables, we are not nearly at that point, thankfully.
GitHub
Object.entries(getComputedStyle(document.documentElement)).filter(e => e[1].startsWith("--") && e[1].includes("color")).length
489

Gitea
> Object.entries(getComputedStyle(document.documentElement)).filter(e => e[1].startsWith("--") && e[1].includes("color")).length
224

Will be fixed with https://github.com/go-gitea/gitea/issues/19353 which will give us total color freedom.


rotate_basis should be a pure function

The PolynomialTensor method rotate_basis changes the PolynomialTensor object in place. This behavior is inconsistent with our general approach (for example, in _operator_utils.py) to have functions that create a new operator as output. Often, one really does want to keep the original operator around. @jarrodmcc @babbush

I think the reason its like this is because we've only implemented basis rotations for certain 1- and 2-body types of operators. For instance, we haven't written code to do it for 3-body operators or higher.

I believe we did that in https://github.com/quantumlib/OpenFermion/pull/117.

Oh I guess so. Well in that case I support this change but we need to be careful to propagate the change to all dependancies since I believe that changing this will break OpenFermion-Psi4 and OpenFermion-PySCF. Let's not make this change until a big version bump (perhaps to v1.0) is imminent.

One can use general_basis_transform as a substitute which is standalone.


Find/Replace drawer doesn't close

On 1.0.12 (OS X) now after opening the Find/Replace drawer/sub-window, it does not close with the Esc button, nor does right-click and Close Pane work.
It usually only closes after closing an open tab.

I can't reproduce this on Atom 1.0.18, Windows 10.  Can you please try updating to Atom 1.0.18 and see if that fixes it?  If not, does running Atom in safe mode (atom --safe) help?

This issue was moved to atom/find-and-replace#538


Wrong URL for kubelet-tls-bootstrapping

The URL is https://kubernetes.io/docs/admin/kubelet-tls-bootstrapping/

This change is

I signed it!


README: add brew install instructions

Hello 👋 . I'm a maintainer for the Homebrew project. I love wtfis and have packaged it for users who use our package manager. This PR adds instructions for installing via Homebrew. Thanks!

@p-linnane so awesome! I'm a regular homebrew user myself. Thank you!


fix(Card): add text strings to defaultProps (Il8n)

Relates #107

👍 ✅

Bluemix toolchain: Delivery Pipeline deployed carbon-components-react to Bluemix Design System, including commit cc86f1f53394a852d9764d81dcd100c2fc31f0d2


Composite glyphs must be initialized first.

In order to get composite glyphs to work, I found out that I have to 'initialize' the affected normal glyphs first:
Before I can use any composite glyph I found this workaround, than everything is fine:
	      // Workaround to initialize composite glyphs.
	      for (var i = 0; i < this .font .numGlyphs; ++ i)
				this .font .glyphs .get (i) .getPath (0, 0, 1);

I this due to the fact, that the glyphs are cached maybe?

Thank you! this solved my problem with composite glyphs!

For further debugging, just use http://nodebox.github.io/opentype.js/glyph-inspector.html load a font, try to write some swedish umlauts (åäöÅÄÖ) and they will display as (aaoAAO)

Anyone know what needs to change in the code to make this happen automatically when a glyph is instantiated?

It's also not clear to me that this issue only affects composite glyphs.
At least, I have glyphs (from a WOFF font) for which the property "isComposite" is not set, and I still have this issue of having to make 'fake' getPath() calls to initialize the glyphs.

The composite glyphs need to be "kicked" into action through getPath(). The reason is that some fonts have an enormous amount of glyphs  (e.g. Chinese fonts) which can make the memory usage of OpenType.js blow up (this is problematic on embedded systems and servers).
The good news is that we can solve this. We just need to be a bit more careful when loading getPath() on composite glyphs that getPath() for the composites is also called.
@kennethmac2000 the WOFF issue is weird. Can you send me an example font + a bit of usage code so I can debug this?

For composite glyphs I can no longer reproduce this.
Here's the test code I use to draw a path:
opentype.load(FONT_URL, function(err, font) {
  console.assert(!err, err);
  var path = font.getPath('Öpéñtÿpè', 0, 200, 100);
  path.draw(ctx);
});

which shows all diacritics correctly:

See https://jsfiddle.net/zv7an0yx/ for a demo.

I have a glyph (eg, "1") from this Google font: open-sans-v13-latin_latin-ext-600.woff
If I try to get glyph.yMax before calling glyph.getPath(), the value of glyph.yMax is undefined. If I call glyph.getPath() first, glyph.yMax then has a value. It's that simple. :)

@kennethmac2000  OK so it's accessing yMax that's the problem, not getPath(). Thanks for clearing this up. I'll take a look.

Yeah, there's no problem with getPath() per se, but, as per the comments above, getPath() seems to need to be called to 'kick' the glyphs into action.

I've just pushed a fix so that metrics information is kept behind a JavaScript property that forces the path to load first. This should fix the issues with composite paths (although it's not just composite paths).

Beware that Object.defineProperty has some performance impact.

Thanks!


Marker cluster with  and infowindow

Hi, I have this working HTML code :
    <map zoom="5" center="41.8919300, 12.5113300" on-center-changed="centerChanged()">
	     <marker ng-repeat="pos in markers" position="{{pos.lat}},{{pos.lon}}" on-click="showStore(event, pos.k)" title="Click to zoom"></marker>
	     <info-window id="foo2">

     	        {{item.title}}

        	  {{item.data}}

  </info-window>
</map>

How can I use MarkerCluster in my situation? I have see your example, but in your example you use $scope.dynMarkers.push(new google.maps.Marker({position:latLng})); and you don't use any infowindow (opened at the marker click). I need to open an infowindow with "dynamic" value into.
Thanks.

Please check this example
https://rawgit.com/allenhwkim/angularjs-google-maps/master/testapp/infowindow_compile.html

Closing


update FAQ - where to get tested.

@MikeMcC399 Your suggestions will add empty lines. Please remove them (this is not your fault, GitHubs system is a bit strange here).

@Ein-Tim

Your suggestions will add empty lines. Please remove them (this is not your fault, GitHubs system is a bit strange here).

Thanks for your hint! I hadn't noticed and I only recently started using this method after I saw that you were using it.
I have removed all the extra lines added by GitHub!

@MikeMcC399 and @Ein-Tim Thanks! Great help!


C# .Net Core memory leak when using ForEachAsync streaming

Testing simple client/server code using .Net Core but noticed massive memory leaks. Checking sample gRPC code could not see anything obvious.
global.json:
{
  "projects": [],
  "sdk": {
    "version": "1.0.0-preview2-003131"
  }
}

proto def:
message Ping {}
message Pong {}
rpc Stream (stream Ping) returns (stream Pong) {};

server code:
public override async Task Stream(IAsyncStreamReader<Ping> requestStream, IServerStreamWriter<Pong> responseStream, ServerCallContext context)
{
            await requestStream.ForEachAsync(ping =>
            {
                responseStream.WriteAsync(_pong);
                return Task.CompletedTask;
            });
}

client code:
for (var i = 0; i < 1000000; i++)
{
            await client.Stream().RequestStream.WriteAsync(ping);
}

Haven't reproduced yet but is also the case with the latest 1.1.0?

@apolcyn the memory leak was in 1.1.0, for example client project.json looks something like:
{
  "version": "1.0.0-*",

  "dependencies": {
    "Grpc.Core": "1.1.0",
    "Grpc.Tools": "1.1.0",
    "Google.Protobuf": "3.2.0",
    "NETStandard.Library": "1.6.1"
  },

  "frameworks": {
    "net46": {
      "dependencies": {
      }
    }
  },

  "runtimes": {
    "win7-x64": {}
  }
}

CC @jtattermusch.

@MedAnd , how did you diagnose that it is a leak?

@jtattermusch I run the above client server sample sending a simple ping and pong message between processes and notice via task manager that memory for both client and server process starts at ~43mb and climbs to well of 3GB+ per process. Given the ping and pong messages have no data (see proto def)  I would assume simple test process should not be taking this much memory for streaming async operations?
Some more testing, when I change the client code to:
client.Stream().RequestStream.WriteOptions = new WriteOptions(WriteFlags.NoCompress);
for (var i = 0; i < messageCount; i++)
{
       using (var stream = client.Stream())
       {
              await stream.RequestStream.WriteAsync(ping);
       }
}

and server code to:
public override async Task Stream(IAsyncStreamReader<Ping> requestStream, IServerStreamWriter<Pong> responseStream, ServerCallContext context)
{
       responseStream.WriteOptions = new WriteOptions(WriteFlags.NoCompress);
       await requestStream.ForEachAsync(ping => responseStream.WriteAsync(_pong));
}

now both client and server processes never go above 80mb each... however CPU on a quad core i5-3570K is at 100% and the performance is horrible, i.e. the test is very slow to complete. I think this is due to the using (var stream = client.Stream()) which might be disposing and re-creating channels?
Does the above indicate that the server (and thus server resources) are at the mercy of the client process, or rather a badly behaved client could cause excessive memory/CPU consumption on the server? Is my client code wrong, or is this a bug?
Any insight greatly appreciated.

From looking at your code, the problem seems to be that you are actually creating a new streaming call in each cycle:
for (var i = 0; i < 1000000; i++)
{
            await client.Stream().RequestStream.WriteAsync(ping);
}

instead you should be doing:
var call = client.Stream();  // creates the call that can stream messages
for (var i = 0; i < 1000000; i++)
{
            await call.RequestStream.WriteAsync(ping);  // send one message in each cycle
}

Btw, your "fix" also creates a new call in each cycle but prevents the memory leak because
using (var stream = client.Stream())
{
}

Disposes the call once the using block ends (and because the call is still active by that time - you don't really close it yourself, the effect is actually cancelling the call)

@jtattermusch with your change:
var call = client.Stream();  // creates the call that can stream messages
for (var i = 0; i < 1000000; i++)
{
            await call.RequestStream.WriteAsync(ping);  // send one message in each cycle
}

the server is now never called at all. Happy to provide the sample source code if that helps?

Sure, feel free to provide more examples, but I'm pretty sure that the code I'm suggesting would work.
Btw, there's more issues with your code:
On the server side you should have
await requestStream.ForEachAsync(async ping =>
            {
                await responseStream.WriteAsync(_pong);  // only one write allowed at a time, so await the current write.
            });

Also, you are doing a ping pong but you are actually never reading the responses on the client side.
But I am pretty sure that the server side handler will get called.

@jtattermusch attempted your suggested changes but still not working as expected so I've published the code for your consideration: https://github.com/MedAnd/gRPCSample

I'm pretty sure gRPC is behaving correctly.
It looks like the problem is that on the client side, you are only sending messages and you are never receiving them (which is bad in general, in the end you should always attempt to read from the responseStream to obtain the call status at least), but on the server-side you are trying to send a response for each received request. Because the client is not reading the responses at all, the flow control window will get filled very soon and the attempt to send a response will block unless you request reading messages on the client side (this is a mechanism to prevent overloading peers that aren't able to accept messages as quickly as you are sending them).
https://github.com/MedAnd/gRPCSample/blob/08cea43e9b435b418aa28f293b58c4b39b200581/Client/Program.cs#L37
https://github.com/MedAnd/gRPCSample/blob/08cea43e9b435b418aa28f293b58c4b39b200581/Server/gRPCServiceBase.cs#L21
If you want to benchmark one-way sending of messages, this would work:  start sending them from client the way you do, receive them on the server-side (but don't send anything back), calculate staticstics on the serverside and once the request stream is closed, send a summary message with all the statistics back to the client (or just print them).

Appreciate the feedback @jtattermusch and will incorporate into my sample...
Wondering if this is the team's offical perf dashboard: GA gRPC Performance Multi-language

Yes, it is an official perf dashboard, but for version v1.0.x (so >6months old). C# numbers have improved significantly since then.
Newer dashboards are linked from here:
http://www.grpc.io/docs/guides/benchmarking.html
specifically, you can take a look at
Multi-language performance dashboard @latest_release (lastest available stable release)


520: Origin Error and Reached retry limit

Hello, I am not sure if this error is reddit related, JRAW related, or my code related but whenever I call the loadMoreComments on the submission root comment node, after a few seconds I get the following error:
java.lang.RuntimeException: An error occurred while executing doInBackground()                                                                                at android.os.AsyncTask$3.done(AsyncTask.java:309)                                                                                at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:354)                                                                                at java.util.concurrent.FutureTask.setException(FutureTask.java:223)                                                                                at java.util.concurrent.FutureTask.run(FutureTask.java:242)                                                                                at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:234)                                                                                at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)                                                                                at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)                                                                                at java.lang.Thread.run(Thread.java:818)                                                                               Caused by: java.lang.IllegalStateException: Reached retry limit                                                                                at net.dean.jraw.RedditClient.execute(RedditClient.java:153)                                                                                at net.dean.jraw.RedditClient.execute(RedditClient.java:155)                                                                                at net.dean.jraw.RedditClient.execute(RedditClient.java:155)                                                                                at net.dean.jraw.RedditClient.execute(RedditClient.java:155)                                                                                at net.dean.jraw.RedditClient.execute(RedditClient.java:155)                                                                                at net.dean.jraw.RedditClient.execute(RedditClient.java:155)                                                                                at net.dean.jraw.RedditClient.execute(RedditClient.java:155)                                                                                at net.dean.jraw.RedditClient.execute(RedditClient.java:137)                                                                                at net.dean.jraw.models.CommentNode.getMoreComments(CommentNode.java:422)                                                                                at net.dean.jraw.models.CommentNode.loadMoreComments(CommentNode.java:275)
However, this error occurs when I am trying to load more comments in a submission with a lot of comments in it. With submissions with not that much comments, it loads them just fine.
This is the part of my program where it is causing the error:
`
private void loadMoreEndComments() {
    new AsyncTask<Void, Void, Void>() {

        @Override
        protected Void doInBackground(Void... params) {

            mRootNode.loadMoreComments(mRedditClient) ; // Right here seems to be the issue.

            //Log.d("TAG",moreComments.toString());

            Iterable<CommentNode> iterable = mRootNode.walkTree();

            for (CommentNode node :iterable) {

                Comment comment = new Comment();

                net.dean.jraw.models.Comment nodeComment = node.getComment();

                if(!checkIfExsist(nodeComment)) {....}

            }

        }
    }

}
`

An HTTP 520 code is a CloudFlare error. There isn't anything you can do about this, it's a server-side issue.

Ah I see. The 520 status code has seem to have gone away now. However,  strangely now I get a 400 status code when trying to use loadMoreComments() on posts with 7k+ comments. That seems to be a bad request error, but only for loadMoreComments requests on posts with tons of comments.

Hmm, it seems like my issue is similar to #120 if not the exact same scenario, but it still persists for me. I believe I have the latest version of JRAW so if it is fixed, then it must be something on my end maybe.

From README.md:

gradle release will generate four Jar files in build/releases: a normal jar with just the library, a "fat" jar with all of JRAW's runtime dependencies, a Javadoc jar, and a sources jar.

Include the fat jar into an isolated project where you can test it.

Thank you for your help. Closing now.


I found somewhere on this wiki about using read containerId < < (x11docker ......) to get the containerId, it did get a seemingly valid containerId, but when I use docker kill containerId to kill it, it doesn't do anything, so I did docker container list --all, guess what, that container Id does not exist, I am not sure how you produced that id in the first place, any pointer would be appreciated.

This works here as expected:
lauscher@debianlaptop:~/git/microscopy-tools$ read id < <(x11docker --showid -d wine)
x11docker WARNING: User lauscher is member of group docker.
  That allows unprivileged processes on host to gain root privileges.

x11docker note: Using X server option --xephyr

x11docker note: Xephyr is a quite stable nested X server.
  Less stable, but resizeable is nxagent with option --nxagent.

lauscher@debianlaptop:~/git/microscopy-tools$ docker ps
CONTAINER ID        IMAGE               COMMAND                  CREATED             STATUS              PORTS               NAMES
1321ed28d927        wine                "env /usr/local/bin/…"   14 seconds ago      Up 12 seconds                           x11docker_X102_wine_96042916730
a7ddc652183a        x11docker/firefox   "env /usr/local/bin/…"      10 minutes ago      Up 10 minutes                           x11docker_X101_x11docker-firefox_95491104020

x11docker returns the full id 1321ed28d92731331841aba355ed1418cd41492dd840a271e149bc29460a7406.
docker ps only shows the first 12 digits of the id: 1321ed28d927.
After docker kill 1321ed28d92731331841aba355ed1418cd41492dd840a271e149bc29460a7406 the wine container disappears.
Please try to reproduce these steps and show me the terminal output if it still fails for you. Note that the id also disappears if the container terminates otherwise.

You are right, the error was in my code .... I had a "&" at the end of x11docker call, it was required for an earlier version of it when I launch something from dmenu, no longer needed. Thanks, this is working as you described, and as I originally expected.


Modified demo and added some examples

@callumrollo

Can you remove output from the notebook? It makes a mess of the git diff, so it's impossible to see what's changed when reviewing
Kernal >> Restart kernel and clear output of all cells


Nice love it ty

Using it fior nitro gen
Btw how long does it take to find nitro

very low chance of working lol


Install v1.1.0 of kenv for waas/v2alpha1

To use latest version of Kenv so that it is compatible with the version of Kustomize used.

LGTM


Figure out async calls to WinRT

As an example, this doesn't work yet:
https://github.com/timsneath/win32/blob/main/example/winrt_picker.dart#L20
FileOpenPicker is here:
https://github.com/timsneath/win32/blob/main/lib/src/com/IFileOpenPicker.dart
which is derived using the Windows Runtime metadata using my Dart-based parser (https://pub.dev/packages/winmd).
The original signature is here:
https://docs.microsoft.com/en-us/uwp/api/windows.storage.pickers.fileopenpicker.picksinglefileasync?view=winrt-19041

Here's a Go-based example from @mraleph:
https://github.com/mraleph/go_dart_ffi_example
and more on the general issue:
https://github.com/dart-lang/sdk/issues/37022

I don't know anything about Dart (yet) 😉 but am the creator of C++/WinRT and more recently started creating Rust/WinRT.
A WinRT async method returns one of four async interfaces (IAsyncXxx). The caller is responsible for either blocking the calling thread until the async object is complete or using some form of coroutine/future, depending on what the language provides, to cooperatively wait for completion. Either way, the caller is notified of completion by providing a delegate implementation that is provided to the async implementation via the Completed property. Obviously, you'll need a way to create WinRT delegates in Dart. Once complete, the caller uses the GetResults method that will either return the successful result of the async object or rethrow/return any error that may have occurred. Both C++/WinRT and Rust/WinRT provide implementations of this pattern for reference. As an example, a C++ blocking call looks something like this:
auto file = picker.PickSingleFileAsync().get();

And C++ coroutines are used for cooperatively waiting (without blocking calling thread):
auto file = co_await picker.PickSingleFileAsync();

Happy to answer any questions you might have<EMAIL_ADDRESS>

I also wanted to know, how async callbacks work for flutter/dart (not necessarily in conjunction with WinRT though). I built a proof of concept here: https://github.com/ghost23/win32_midi
If you're interested, the method in question there is Win32Midi.openMidiInput(...) in ./lib/win32_midi.dart
and its counterpart openMidiInput(...) in ./windows/win32_midi_plugin.cpp, which is taking
an async callback and then answers it in the function MidiInProc in the same file.
Also important is the CallbackManager.h/cpp , which manages the port and the conversion of data from c++ to dart.

@jhancock4d from https://github.com/flutter/flutter/issues/64958#issuecomment-870581871
You could track the WinRT projection here


Add backgroundRingBlur inspectable property to ring view

Hi @Kishimotovn,
Thanks for providing this addition, but I can't merge it, because it has severe performance issues as well as some bugs like wrong ring size - you can try to enable rings blur in the example project to see what I mean.
Considering rather slow performance for the current implementation (without blur), if another level of heavy computation is added (separate background image generating), the control would become unusable.
If you have a requirement for background ring blur in your project, I'd suggest adding a separate pre-rendered view for this and setting the control's background ring color to transparent.


Is it possible to define that the blocks are to be added inside a container?

When I define that the editor should use the p tag for the blocks:
var editor = new Squire(document.getElementById('editor'), {
  blockTag: 'p',
  blockAttributes: {}
});

the resulting html is like this:

test

test

Is it possible to define that the blocks come inside a container? Something like:

test

test

Sorry no, this is not something that's supported automatically.


WIP: #320 review and improve vagrant instructions

issue #320 review and improve vagrant instructions

Closing this as the work in #360 covers this now


Remove leading is_ from is_data_loaded?

Style preferences are

is_predicate for guard-safe macros and
predicate? for regular boolean functions.

Thank you @kbaird!  @jeregrine any objections?  I'm all for this.  We'll need to bump the version of the new release you cut to account for the breaking change.

You're welcome, @doomspork. I have a separate question about custom relationships in a View. Where's the best venue for that?


Automatic Refresh during developing in Storybook does not work

See also:
https://github.com/storybookjs/storybook/issues/22124 (Storybook 7 + Stencil 3.2)
https://github.com/ionic-team/stencil/issues/2817 (2022 old)
https://github.com/storybookjs/storybook/issues/22018 (uses Vite)
https://github.com/storybookjs/storybook/issues/20869 (uses Vite)
https://github.com/storybookjs/storybook/issues/13914 (2021 old)

Closed after moving to Lit.


Illegal Instruction Exception not Raised

RISC-V Specification:

Unprivileged ISA

Issue Description:
An illegal instruction updates the register file and the associated csrs and executes normally without raising an illegal instruction exception.
Example:
The instruction 32'h2820d013 is decoded and executed with no illegal instruction exception being flagged, as machine csrs: mepc, mstatus and mcause aren't updated.

Product: OneSpin 360 DV-Verify
App: Processor Verification App
Tool's version: 2020.2.0

Thanks for raising this @shetalani
I have a proposed fix in #1130 - can you give that a go and let us know if it fixes the problem?

@tomroberts-lowrisc It is fixed, my pleasure!


nltk.app.nemo_app seems to be broken

class Zone, line 52: root is not defined there
https://github.com/nltk/nltk/blob/master/nltk/app/nemo_app.py#L52

root is declared global in app()

Closing.  This isn't pretty, but it works.


Add Solr Exension

I really want to start using nanobox for my projects. But one of them uses the Solr extensions. Is there anyway you could add this to the list of extensions available?

(cc @notxarb)


Please add screenshots of the app to the readme

Having to install an APK to get a glimps on how the app looks and works is not a good idea. You can use sth. like fastlane to automate screenshots.

Having to install an APK to get a glimps on how the app looks and works is not a good idea. You can use sth. like fastlane to automate screenshots.

Thx for your comment, i will add them soon

Added screenshots


Burp Enterprise parser fails

Bug description
An exception error occurred during the report import:module 'defusedxml.ElementTree' has no attribute 'HTMLParser'

Probably fixed already, my prod is running late by a couple weeks from dev.


[SystemZ] Fix register ordering for BinaryRRF instructions

Summary:
The ordering of registers in BinaryRRF instructions are wrong, and
affects the copysign instruction (CPSDR). This results in the wrong
magnitude and sign being set.
Author: zhanjunl
Reviewers: kbarton, uweigand
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D20308
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269922 91177308-0d34-0410-b5e6-96231b3b80d8

@fredriss This commit is also needed for the z Systems port to fix a test failure (test/1_stdlib/tgmath.swift).

@fredriss A friendly reminder to please review this pull request... Thanks.

Sorry I completely missed this...

@swift-ci Please test

Thanks!


Build OPAE for PACN300 Worker image failing

Trying to get the FPGA virtualization enabled using the flexran flavor, the host has a the N3000 accelaration card.
I copied the OPAE_SDK_1.3.7-5_el7.zip file in the appropriate Dir and see it getting copied to the worker node. These are the last script logs:
Any idea why it might be failing ?. I was having issues replacing my worker node's 3.10.0-1127.el7.x86_64 to a RT one, so disabled them in the group_vars/* scripts..

2021-03-08 17:54:17,161 p=36551 u=ravi n=ansible | TASK [opae_fpga/node : build OPAE for PACN3000 FPGA worker image] **************************************************************************************************************************************************
2021-03-08 17:58:34,668 p=36551 u=ravi n=ansible | fatal: [node01]: FAILED! => {
"changed": true,
"cmd": [
"make",
"fpga-opae"
],
"delta": "0:04:17.269720",
"end": "2021-03-09 13:57:54.851411",
"rc": 2,
"start": "2021-03-09 13:53:37.581691"
}
STDOUT:
docker build -t fpga-opae-pacn3000:1.0 -f ./dist/fpga_opae/Dockerfile ./dist/fpga_opae/
Sending build context to Docker daemon  8.372MB
Step 1/28 : FROM centos:7.8.2003
---> afb6fca791e0
Step 2/28 : WORKDIR /root/opae
---> Using cache
---> a39330ecc30e
Step 3/28 : ENV http_proxy=$http_proxy
---> Using cache
---> 651374cefcc8
Step 4/28 : ENV https_proxy=$https_proxy
---> Using cache
---> 880f0867908d
Step 5/28 : RUN yum install -y gcc gcc-c++ cmake make autoconf automake libxml2 libxml2-devel json-c-devel boost ncurses ncurses-devel ncurses-libs boost-devel libuuid libuuid-devel python2-jsonschema doxygen hwloc-devel libpng12 rsync bc python-devel python-libs python-sphinx unzip which wget python36 epel-release sudo
---> Using cache
---> f1ee31287176
Step 6/28 : RUN easy_install pip==20.3.3 && pip install intelhex
---> Using cache
---> f55f0cc8aca3
Step 7/28 : RUN wget http://linuxsoft.cern.ch/cern/centos/7/rt/CentOS-RT.repo -O /etc/yum.repos.d/CentOS-RT.repo
---> Using cache
---> 4eb96bf07ac0
Step 8/28 : RUN wget http://linuxsoft.cern.ch/cern/centos/7/os/x86_64/RPM-GPG-KEY-cern -O /etc/pki/rpm-gpg/RPM-GPG-KEY-cern
---> Using cache
---> a5f5096b203a
Step 9/28 : RUN export isRT=$(uname -r | grep rt -c) && if [ $isRT = "1" ] ; then yum install -y "kernel-rt-devel-uname-r == $(uname -r)"; else yum install -y "kernel-devel-uname-r == $(uname -r)"; fi
---> Running in a3d94b53d570
Loaded plugins: fastestmirror, ovl
Loading mirror speeds from cached hostfile

base: mirror.keystealth.org
epel: mirror.sfo12.us.leaseweb.net
extras: centos-distro.cavecreek.net
updates: mirrors.xtom.com
No package kernel-devel-uname-r == 3.10.0-1127.el7.x86_64 available.
Error: Nothing to do

STDERR:
The command '/bin/sh -c export isRT=$(uname -r | grep rt -c) && if [ $isRT = "1" ] ; then yum install -y "kernel-rt-devel-uname-r == $(uname -r)"; else yum install -y "kernel-devel-uname-r == $(uname -r)"; fi' returned a non-zero code: 1
make: *** [fpga-opae] Error 1
MSG:
non-zero return code
2021-03-08 17:58:34,672 p=36551 u=ravi n=ansible | PLAY RECAP *********************************************************************************************************************************************************************************************************
2021-03-08 17:58:34,673 p=36551 u=ravi n=ansible | node01                     : ok=122  changed=26   unreachable=0    failed=1    skipped=130  rescued=0    ignored=2

For now I'm setting the Kernel_skip = false, for both controller and the worker node. The issue is that when the installation was booting the worker node with the new RT kerne, but with the edge node the server wouldn't come up, it was setting it to a bad state.
But, I guess, RT kernel is not a requisite right, to test the basic SR-IOV and FPGA virtualization features ?
The worker node is on 3.10.0-1127.el7.x86_64. I was able to bypass the check stuck in that message log above and the installation went fine. But now cannot update the fpga using the 'kubect rsu..' update commands...guess the fpga_opae container is not running in the worker node..


Gnome module doesn't set fonts

I can't be bothered forking and creating a PR, but the GNOME HM module doesn't set fonts. This can lead to some theme incosistencies.
Adding something like this to modules/gnome/hm.nix is required.
dconf.settings = {
    "org/gnome/desktop/interface" = with config.stylix.fonts ; {
      font-name = "${sansSerif.name} ${toString sizes.applications}";
      document-font-name = "${serif.name}  ${toString (sizes.applications - 1)}";
      monospace-font-name = "${monospace.name} ${toString sizes.applications}";
    };
  };

Had some free time, so... #116


 I'm creating a repo-review plugin and wanted to include a Markdown code block in the error results. However, the output renders very harshly in the terminal and is not visually accessible (note that the hyphens are not visible due to the colors in use):

The .check() string that produced this includes this Markdown code:
```yaml
- repo: "meta"
  hooks:
    - id: "check-hooks-apply"
    - id: "check-useless-excludes"
```

I don't think this is related to my plugin, but rather the default syntax highlighting used in the repo-review framework.

I think we can't detect the terminal color scheme, and Rich forces you to pick a fixed pigments theme for code blocks, so I picked the light one because I thought it was more readable. Unless that changes, we are kind of stuck. You'd need to covert a Pygments color theme (256 fixed colors) into the 16 terminal settable colors.

From my little test, it looks like ansi_light and ansi_dark might both do exactly the same thing and work?
#!/usr/bin/env uv run --quiet

# /// script
# dependencies = ["rich"]
# ///

import sys

from rich.console import Console
from rich.markdown import Markdown
from rich.syntax import Syntax

THEME = sys.argv[1]
MARKDOWN = """
# This is an h1

Rich can do a pretty *decent* job of rendering markdown.

1. This is a list item
2. This is another list item

```python
from rich.console import Console
from rich.markdown import Markdown

def f():
    return 42

- repo: "meta"
  hooks:
    - id: "check-hooks-apply"
    - id: "check-useless-excludes"

"""
console = Console()
md = Markdown(MARKDOWN, code_theme=THEME)
console.print(md)

Released 0.11.3 with the fix, thanks!

(also added a similar fix to https://github.com/scikit-hep/uproot-browser when it gives example code ;) )

Nice! Thank you so much!


Comparison with other models?!

Thanks, I just finished reading your article. I would like to know,
have you tried to compare your results with the ones produced by other models?
The model which I have in mind is described in the article
"Full implications for CMS convexity" by Simon Cedervall and Vladimir Piterbarg.
https://www.yumpu.com/en/document/view/25786587/full-article-risknet
Alexander.

Hi Alexander. Thank you for your comment. The paper to which you refer is a very interesting one. I've now read it in full. We did compare our results to the ones produced by other models, in particular, the model of Bermin & Williams, and suggestions in papers of Henrard and of Lutz to consider Hull-White, linear swap rate model, LIBOR market model. We also considered other methods. Not all of those comparisons were documented in the paper, but rather these were documented in Frank's Master's thesis. If I compare the model described in our paper to the one of Cedervall and Piterbarg, then I believe to observe the following difference: The annuity mapping function M(x) defined in equation (5) appears to be dependent on one stochastic variable (S(T)) whereas in our model we model two stochastic variables. One related to forecasting, the other to discounting. I hope my answer makes sense, I'm curious to find out your thoughts.

Hi Raoul,
thank you for your answer!

Frank's Master's thesis

it is not referenced in the article, could you share a link, please?!
There are few things which worries me and a colleague of mine, with
whom I have discussed your article. The first concern is about this
section:

...Corollary 3.2 is paradoxical to the result of Mercurio (2008)....
...formula for cash-settled swaptions is not arbitrage-free ...
... Mercurio (2008) uses the terminal measure ...
... We use the physical measure  ...

But the model is arbitrage-free (or not) regardless of the measure!
And one more thing about LEMMA 3.1:

...Assume there exists an additional process y∗ ...
... PVBP(t) = lambda * Ann(.)   [formula 7]

I tend to agree that IF such process exists, your formula (8) is
correct. But why it should exist?!
It seems that you have found a special case with formula (7) when
cash-settled swaptions can be calculated
with (8). But there is no guarantee that this can be applied on the
real market data. Or do we miss something?
With best wishes,
Alexander


How to get the ONLY original documents' chunks?

While retrieval I did context, __ = RA.retrieve(question) to see the context, since I was not getting the desired response.
I noticed that the context that is being passed to qa_model to answer question self.qa_model.answer_question(context, question) is not the actual chunk of text. There are also summarized text in the node list when we do self.context_chunks = [node.text for node in node_list].
I wonder how can I get the actual chunks nodes only, since I desire to pass only the actual context text to qa model.
My actual docs has lots of tutorial urls (which i need in response) in various places. But every time I get the response, the urls are messed up, broken or missing. So I dig up to check and found out that qa not getting only the actual chunks.
Is there any way to retrieve the context which should be the original portions of documents?
Thanks.

@parthsarthi03

you can set start_layer=0 and num_layers=1 in either RA.retrieve or RA.answer_question. This will effectively set it to retrieve from only the leaf layer which is the original text. You can also also set the tb_num_layers while building the tree to not build summaries.

Thanks for the response @parthsarthi03 . Alright, I'll try and get back to you.
One question if I set tb_num_layers to say 0. And it doesn't do summarization, so will this be helpful in any way?
Because it might act as Naive RAG where we input all the doc chunks to retriever to get the top_k let's say, because that summarization and clustering is the specialty of RAPTOR. Am i right?

Yes, it will act as naive RAG. Looking back at your original question, are you using do you want use the tree traversal method of RAPTOR and just filter for the last layer? Because the setting I mentioned will just restrict the retrieval to those layer effectively doing naive RAG.

Yes I want the tree traversal method of RAPTOR and get me the chunks of the original doc.

Ah, okay, that is a bit harder but doable. You'll have to add the following filter before the below line to filter for the leaf nodes.
selected_nodes = [node for node in selected_nodes if node.index in self.tree.leaf_nodes]
https://github.com/parthsarthi03/raptor/blob/7da1d48a7e1d7dec61a63c9d9aae84e2dfaa5767/raptor/tree_retriever.py#L249
This should filter the selected nodes to only the leaf nodes. let me know if you run into any issues.

Thanks @parthsarthi03 I can get the original doc chunks from the traversal tree method.
I have few questions:

When we set start_layer=0 and num_layers=1 through which we get the current_nodes. This current_nodes is basically all the nodes of layer#1. And layer#1 is the first layers containing chunks of the original doc BEFORE any summarization is done. Am i right?
And also I want to transform the retrieval_information function to get me the relevant chunks until max_token. So that I can have the maximum context, and will be of only original document. Is this possible with the help of current_nodes?

if you want to use the tree traversal method of RAPTOR and only use the original docs, do not set start_layer=0 and num_layers=1, simply add the filter that I had given before. I believe, though. I'll have to check the indexing, that layer 0 should be the first layer before any summarization.
yes, you can have a filter for max tokens. it is supported in the retrieve_information_collapse_tree function and you should be able to copy over the logic with some minor changes. You'll have to decide how to rank the nodes though. you can do something similar to retrieve_information_collapse_tree where you do cosine similarity and rank or have a fancier BFS/DFS search and stopping based on max_token. If you implement the second, feel free to send in a PR.