text:
fix: #6458 add timestamp to force revalidating data

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. All changesets should be patch until SvelteKit 1.0

Wouldn't "cache-control": "private no-store" on the response achieve the same without additional JS code on the client? That's what's done in #6809

Wouldn't "cache-control": "private no-store" on the response achieve the same without additional JS code on the client? That's what's done in #6809

When you setup Custom Domain using Cloudflare Pages, the data response headers is somehow replaced with cache-control: max-age=14400. 🤦
No issue when using default subdomain *.pages.dev.
Can't reproduce since it require a custom domain. 🤕🤕🤕

That sounds like an extremely serious bug in Cloudflare Pages. If that's the case, this would be only one manifestation of it. I don't think it would be appropriate to work around it here.
At the very least, it would need a reproduction (and if one of the steps is 'set up a custom domain on Cloudflare Pages' then so be it)

That sounds like an extremely serious bug in Cloudflare Pages. If that's the case, this would be only one manifestation of it. I don't think it would be appropriate to work around it here.
At the very least, it would need a reproduction (and if one of the steps is 'set up a custom domain on Cloudflare Pages' then so be it)

This repository: test-sk-cf-custom-domain
The page with default cf subdomain: test-sk-cf-custom-domain.pages.dev
The page with custom domain: test-sk-cf-custom-domain.dstserver.cloud
Step to reproduce:

Browse page
Click Invalidate several times.

Expected: Text Refreshing: true appear for 3 seconds then being replaced with Refreshing: false.
Actual: Sometimes Invalidate do load new data, sometimes it load from disk cache.
CF cache settings: all default.

I note that the repro's lockfile specifies next.489 as the version. cache-control: private, no-store was added in next.490. Can you upgrade to the latest Kit and see if the bug is still present?

I note that the repro's lockfile specifies next.489 as the version. cache-control: private, no-store was added in next.490. Can you upgrade to the latest Kit and see if the bug is still present?

As your suggestion, I have done these steps:

Upgrade SvelteKit to latest version next.493.
After that, CF build failed with this error: Error: Failed to publish your Function. Got error: Error 8000057: Rules must start with '/' in _routes.json.
Remove static/favicon.png help fix the _routes.json related error. This looks like another bug since a new PR #6530  🤔 .
Purge all CF cache on site dstserver.cloud
Repeat the testing steps. I did tried reload pages several times,
Results

Work as intended 👍

authors: Rich-Harris chientrm dummdidumm


text:
some "legacy svelte tutorial" links link to 500 not found pages

with third party cookies turned off, learn.svelte.dev gives you a "Yikes! We couldn't start the app" error with directions to enable cookies and a link to use the "legacy svelte tutorial"

the code for the <a /> tag just links to https://svelte.dev/tutorial/{$page.data.exercise.slug}
https://github.com/sveltejs/learn.svelte.dev/blob/b3b16664e390fef731c25ddfc0721622f35e9fdb/src/routes/tutorial/[slug]/Loading.svelte#L71-L75
but since not all learn.svelte.dev pages have a svelte.dev/tutorial equivalent, some pages redirect to a 500 not found page instead. not sure if i found all, but (at least some of) these pages are:

https://learn.svelte.dev/tutorial/welcome-to-svelte
https://learn.svelte.dev/tutorial/your-first-component
https://learn.svelte.dev/tutorial/styles
https://learn.svelte.dev/tutorial/component-styles

(slightly unrelated side note: a 500 not found error is really weird and cryptic. is it supposed to be like that?)

Best thing we can do here is to add the same stuff to legacy tutorial for the time being.

you could also rename some of the legacy svelte tutorial pages

https://svelte.dev/tutorial/basics is basically equivalent to https://learn.svelte.dev/tutorial/welcome-to-svelte
https://learn.svelte.dev/tutorial/your-first-component is equivalent to https://svelte.dev/tutorial/adding-data
https://learn.svelte.dev/tutorial/styles is almost kinda https://svelte.dev/tutorial/inline-styles
i don't think there is an equivalent to https://learn.svelte.dev/tutorial/component-styles tho

renaming tutorial pages seems like a pretty bad idea in my opinion, because i suspect that there are likely blogs or svelte introduction courses or whatever, that reference specific tutorial pages, but adding a redirect for those should work just fine i think?

how should I reproduce the following error ,When using the https://learn.svelte.dev/tutorial/welcome-to-sveltethe 500 error doesn't come for me

all of those does  provide any 500 error

All those links which have been mentioned is not giving any 500 error in my case, all those links works perfectly fine

@randomrahulm the broken links are not the links to learn.svelte.dev, but instead their redirects to the legacy svelte tutorial.
to reproduce the issue, go into your browser settings and turn off / block third-party-cookes
for example on the https://learn.svelte.dev/tutorial/welcome-to-svelte page it tries to redirect you to https://svelte.dev/tutorial/welcome-to-svelte, which gives you a 500 not found.
i'll edit the original issue comment so it becomes clearer

source: gharchive/issue

authors: PuruVJ m4rch3n1ng randomrahulm

license: MIT

license_type: permissive

license_source: github-api


text:
Rollup watch not respecting preprocess dependencies

I initialized a new Svelte project with npm init vite.
Then I configured a toy preprocessor in my svelte.config.js:
import { vitePreprocess } from '@sveltejs/vite-plugin-svelte'
import * as fs from 'fs';

export default {
  preprocess: [
      vitePreprocess(),
      // This is my toy preprocessor
      {
          style: ({ content, filename }) => {
              const cssFile = filename + ".css"
              if(fs.existsSync(cssFile)) {
                  return {
                      code: content + fs.readFileSync(cssFile, { encoding: "UTF-8" }),
                      dependencies: [cssFile]
                  }
              } else {
                  return { code: content }
              }
          }
      }
  ],
}

The preprocessor concatenates a CSS file onto the styles of each component. E.g. For a component named App.svelte, the preprocessor will add the contents of App.svelte.css into App.svelte's <style></style> tag.
Now I run: npm run build -- --watch. I expect a rebuild to be triggered if I edit App.svelte.css however no rebuild is triggered.
Attached is a minimal reproduction project: svelte-bug.zip

https://github.com/sveltejs/vite-plugin-svelte/blob/aba990bc8fd0dcaa8107ebf28e0504cdb0b376c9/packages/vite-plugin-svelte/src/index.ts#L238
needs a case for build (call this.addWatchFile). We handle it differently during dev because these non-js dependencies would cause problems on vites modulegraph otherwise.

authors: dominikg null-dev

repo: sveltejs/vite-plugin-svelte


text:
Update peerDependencies to support react 16

Library tested and working well for React 16

@svey can we merge this one?
I just tested and worked well with React 16.

source: gharchive/pull-request

repo: svey/ld-redux


text:
🛑 Ingroup is down

In 28fe26d, Ingroup (https://ingroup.biz) was down:

HTTP code: 0
Response time: 0 ms

Resolved: Ingroup is back up in 0bcf43a after 4 minutes.

repo: svilaa/websites-status


text:
Support JSON-B @JsonbProperty in generated documentation

Q
A

Bug or feature request?
feature request

Which Swagger-Core version?
2.0.0

Which Java version?
Java 8

Which JAX-RS framework & version?
2.0

The  JSON-B annotation javax.json.bind.annotation.JsonbProperty can be used to set a different property name for a JSON property much like the jackson annotation com.fasterxml.jackson.annotation.JsonProperty can.
@javax.json.bind.annotation.JsonbProperty(value = "_name1")
private String name1;

@com.fasterxml.jackson.annotation.JsonProperty (value = "_name2")
private String name2;

When using the jackson annotation the name is automatically used in the generated swagger documentation.
The generated documentation should also reflect the property name set with the JSON-B annotation.

Is there a workaround for that, I also have the same problem.

Hi,
i faced the same problem. Simple, but very ugly workaround is to add @Schema annotation
e.g.
public static final String JSON_ATTRIBUTE_ID = "_id";
...
@Schema(name = JSON_ATTRIBUTE_ID)
@JsonbProperty(JSON_ATTRIBUTE_ID)
private Long id;

Other solution I found was to use Jackson annotations instead of JSON-B annotations. The JAX-RS implementation I work with (RESTEasy in Wildfly) can use Jackson annotations for JSON serialization/deserialization out-of-the-box (without any configuration needed).
But I try to be not dependent on specific implementations of EE 8 API technologies, therefore I use the solution with @Schema

+1 for Swagger to read @JsonbProperty

I am using swagger plugin to generate classes from api spec (yaml) file. The generated model classes contains Jackson annotations. I would like to have JSON-B annotations instead of Jackson annotations. How this can be achieved?

+1 for Swagger to read @JsonbProperty

authors: anachronoxLF bcluap ghost idefixcert l-ray rallampalli

repo: swagger-api/swagger-core


text:
dataType field for ApiParam

In #846 I wished that proposal for overriding of data type (just by declaring it in string form) could be reconsidered.
It's quite cumbersome to register a Converter compared to @XmlSchemaType (and @XmlJavaTypeAdapter) of JAXB. I'd rather declare @ApiParam(dataType="date") LocalDate date directly at method param level, so that other tools like swagger-doclet can also utilize the annotation.
I'm ware of @ApiImplicitParam that has this feature, but I'm using JAX-RS and this annotation is intended for standalone usage (it provides the paramType, it's designed for method level usage and it has quite different semantics despite the similarities).

@TuomasKiviaho thank you for opening a new issue, the other one was hijacked and the title was wrong (it's not missing because it's not supposed to be there).  I do agree with the convenience, it's simply a priority issue.  If you like, you can for the develop_2.0 branch and send a pull request for it.  As long as it's well tested, we'll merge it.

This has been added in https://github.com/swagger-api/swagger-core/commit/9e8b2c6bff639598df077465b9a78ebb854f0b83

Question does this mean that by the type parameter we can override the schema ref property?

authors: TuomasKiviaho fehguy mikeholtkamp


text:
Swagger + Grizzly + Jersey - UI not loading

Hi,
I am new to Rest API and Swagger. I use Grizzly web container. I don't have web xml or httpservlet.
I added the pom xml entry, created a BeanConfig class, added the below to Jerseyconfig  to setup the resource details and version.
register(com.wordnik.swagger.jersey.listing.ApiListingResourceJSON.class);
register(com.wordnik.swagger.jersey.listing.JerseyApiDeclarationProvider.class);
register(com.wordnik.swagger.jersey.listing.JerseyResourceListingProvider.class);
When I open the http://localhost:8889/api_docs URL, I get all the rest apis listed correctly.
So I tried to add the UI flavor to it. I downloaded the Swagger ui and copied the dist folder from the master. Modified the index.html URL to my URL/api_docs. But the index.html is not displaying the APIs. No action is being performed when I hit the explore.
Could someone please advise what Im missing?

I imagine you didn't enable cors - https://github.com/swagger-api/swagger-ui#cors-support.

Thanks for the response. I would check how to enable CORS on Grizzly and get back

I enabled the CORS filter.
public class CrossDomainFilter implements ContainerResponseFilter {
@Override
public void filter(ContainerRequestContext creq, ContainerResponseContext cres) {
    cres.getHeaders().add("Access-Control-Allow-Origin", "");
    cres.getHeaders().add("Access-Control-Allow-Headers", "");
    cres.getHeaders().add("Access-Control-Allow-Credentials", "");
    cres.getHeaders().add("Access-Control-Allow-Methods", "");
    cres.getHeaders().add("Access-Control-Max-Age", "");
}

}
CORS filter added to Jersey Config as below.
public JerseyConfig() {
register(JacksonFeature.class);
register(MultiPartFeature.class);
//register(BasicAuthenticationFilter.class);
register(com.wordnik.swagger.jersey.listing.ApiListingResourceJSON.class);
register(com.wordnik.swagger.jersey.listing.JerseyApiDeclarationProvider.class);
register(com.wordnik.swagger.jersey.listing.JerseyResourceListingProvider.class);
register(new CrossDomainFilter());
packages("My package name");
}
ResourceConfig config = new JerseyConfig().property("contextConfig", applicationContext);
final HttpServer server = GrizzlyHttpServerFactory.createHttpServer(
uri, config, false);
server.start();
I still see api docs in JSON format from the URL/api-docs correctly. UI is not doing anything.
Please advise.

You probably need to add an asterisk value for all the headers, for example:
        cres.getHeaders().add("Access-Control-Allow-Origin", "*");

Thanks. I have add the asterisk still no change.
Do you have a sample project or code that illustrates how to configure swagger UI for Jersey/grizzly without using Web.xml? I have only been doing trail and error and spent two full days making it work. Any help would be greatly appreciated.

We don't have specific documentation for Grizzly (it's not that common), but there are a few topics about it in the google group that may be able to provide more information.
To be sure this is a CORS issue, open your browser's web console and check the errors as you try reading the api-docs.

Thanks. I made some progress and now stuck at this place. Could you advise why I get this error?

I assume that's because that's not the right URL. Is your api-docs hosted as the root of your application (literally /)?

thats right. I have two End points that starts after the 1.
i.e localhost:8889/SERVICE1/test and localhost:8889/SERVICE2/test.
I tried giving the below options in the index.html and it remains the same.

http://localhost:8889/api-docs
http://localhost:8889/api-docs/
http://localhost:8889/
http://localhost:8889
http://localhost:8889/SERVICE1_REST/api_docs
http://localhost:8889/SERVICE1_REST/api_docs

Do you get anything if you open those URLs directly (and not under the swagger-ui)?

If I comment the below lines in the code I get the JSON format result of all apis under my endpoints.
If I don't I get the Swagger UI html. Which givens the result as given in the above screenshot. Uncaught SyntaxError.
grizzlyhttpserver.....
httpserver.start();
//CLStaticHttpHandler staticHttpHandler = new //CLStaticHttpHandler(Test.class.getClassLoader(), "swagger-ui/");
//server.getServerConfiguration().addHttpHandler(staticHttpHandler, "/");

Okay, that sounds like you're trying to load the swagger-ui URL under swagger-ui and that obviously doesn't work. Unfortunately, the information you provide is a bit unclear.
Assuming you do host your swagger-ui at the root of your application (that is http://localhost:8889), what happens when you open the following URLs directly in your browser (and not in swagger-ui):

http://localhost:8889/api-docs
http://localhost:8889/api-docs/
http://localhost:8889/SERVICE1_REST/api_docs
http://localhost:8889/SERVICE1_REST/api_docs

Thanks. I am not trying to load the URL directly from swagger UI. I load it through browser.
When I type the http://localhost:8889 directly on my browser, I get the Swagger UI. But I do not get the APIS listed.  When I hit explore, I get
Uncaught SyntaxError: Unexpected token < as shown in the screen shot provided in my previous reply.

Any chance you can hop in our IRC channel? Would be easier to solve it synchronously. http://webchat.freenode.net/?channels=swagger

sorry. The site is restricted from my workplace.

Then I assume any other IRC client won't work. I'm in a meeting right now, but will look into the details you provided a bit later.

thank you

@gkbalu - apologies, this was lost under the workload. Have you managed to resolve it or do you need further assistance?

Closing due to lack of activity. Please reopen if needed.

authors: gkbalu webron


text:
NPE parsing referenced header parameters

When referencing a header parameter in my OAS spec, the parser throws NPE:
Exception while reading:
java.lang.NullPointerException: null
	at io.swagger.v3.parser.processors.ParameterProcessor.processParameters(ParameterProcessor.java:95)
	at io.swagger.v3.parser.processors.OperationProcessor.processOperation(OperationProcessor.java:39)
	at io.swagger.v3.parser.processors.PathsProcessor.processPaths(PathsProcessor.java:83)
	at io.swagger.v3.parser.OpenAPIResolver.resolve(OpenAPIResolver.java:49)
	at io.swagger.v3.parser.OpenAPIV3Parser.readLocation(OpenAPIV3Parser.java:53)
	at io.swagger.parser.OpenAPIParser.readLocation(OpenAPIParser.java:19)
	at org.openapitools.codegen.config.CodegenConfigurator.toClientOptInput(CodegenConfigurator.java:552)
	at org.openapitools.codegen.cmd.Generate.run(Generate.java:348)
	at org.openapitools.codegen.OpenAPIGenerator.main(OpenAPIGenerator.java:62)
Exception in thread "main" org.openapitools.codegen.SpecValidationException: There were issues with the specification. The option can be disabled via validateSpec (Maven/Gradle) or --skip-validate-spec (CLI).
 | Error count: 1, Warning count: 0
Errors:
	-null

	at org.openapitools.codegen.config.CodegenConfigurator.toClientOptInput(CodegenConfigurator.java:569)
	at org.openapitools.codegen.cmd.Generate.run(Generate.java:348)
	at org.openapitools.codegen.OpenAPIGenerator.main(OpenAPIGenerator.java:62)

According to OAS spec, parser should be ignoring parameters with "in:header" and with name "Content-Type.  Seems like that same logic be applied when referencing header parameters too.  At the very least, there should be no NPE.
I'm seeing this problem using parser v.3.3.3.
Attaching a simple OAS spec in JSON format that can be used to reproduce the problem.
headerError.txt

@pureJEagles  Kindly attach the swagger file with issue was reproduced. If possible please raise a PR with failing test case.
Thanks
R.Sreesaran

I am looking into it.

Looks like duplicate of https://github.com/swagger-api/swagger-parser/issues/934 #934

Actually, it might be a duplicate of #684 but the fix doesn't seem to be on master or in the 3.3.3 release.

Thanks @Malligarjunan @pureJEagles Please let us know if the issue keeps happening.
Closed by #961

authors: Malligarjunan gracekarina pureJEagles r-sreesaran

repo: swagger-api/swagger-parser


text:
Allow to set the chunk size used by the thread pool

There should be an option to allow the caller to provide the chunk size used by the thread pool created by p_tqdm._parallel. Using the default can be quite inefficient, especially when the caller knows that each of the operations inside the map is usually quite fast.
Rationale:
https://medium.com/@rvprasad/data-and-chunk-sizes-matter-when-using-multiprocessing-pool-map-in-python-5023c96875ef

I needed something similar but with the underlying multiprocessing.Pool instance. Needed to be able to specify maxtasksperchild=10 to the Pool constructor. You can do this by "monkeypatching" with functools.partial.
This worked for my needs:
import functools
import p_tqdm.p_tqdm as p_tqdm
from p_tqdm import p_map

def monkeypatch() -> None:
    p_tqdm.Pool = functools.partial(p_tqdm.Pool, maxtasksperchild=10)

monkeypatch()
results = p_map(_scrape_data_async, data_to_process, num_cpus=15)  # this will use maxtasksperchild=10, can similarly provide

In your case you could probably use something like this (haven't tested):
import functools
import p_tqdm.p_tqdm as p_tqdm
from p_tqdm import p_map

def monkeypatch() -> None:
    p_tqdm.Pool.map = functools.partial(p_tqdm.Pool.map, chunksize=15)  # whatever chunksize you want

monkeypatch()
results = p_map(_scrape_data_async, data_to_process, num_cpus=15)```

authors: BenBE joeyorlando


text:
Erroneous error on interface multiple inheritance

Describe the bug
SWC 1.2.144 emits an error on the following code, which does not error in the typescript playground or in SWC 1.2.143.
Input code
interface IThingy extends Record<'a', string>, Record<'c', number> {}

const x: IThingy = {a:"HI", b: 5};

Config
{
  "jsc": {
    "parser": {
      "syntax": "typescript",
      "tsx": false
    },
    "target": "es5",
    "loose": false,
    "minify": {
      "compress": false,
      "mangle": false
    }
  },
  "module": {
    "type": "es6"
  },
  "minify": false,
  "isModule": true
}

Playground link
https://play.swc.rs/?version=1.2.144&code=H4sIAAAAAAAAA8vMK0ktSktMTlXwDMnIzEuvVEitKEnNSylWCEpNzi9KsVFPVNdRKC4pAsrZ6cAFk4GCeaW5SalFdgrVtVxcyfl5xSUKFVZwU2wVqhOtlDw8lXQUkqwUTGutuQA6mJGjagAAAA%3D%3D&config=H4sIAAAAAAAAA0WNSwrDMAxE76J1ts0id%2BghjKsEF%2F%2FQKBBjfPfawSU7aebpqdIXlrZK2QhYxoQS1Vy0kZbMsOKy0kKKHu3Gg1tfjBysHWG8eudTAs92oeCi28sw2RSyMPBUJh7%2BT7YuCulzjqDez27hSu1xzDuH9wRVTm4%2FOkwQUrUAAAA%3D
Expected behavior
SWC 1.2.143 emits the correct code:
var x = {
    a: "HI",
    b: 5
};

Actual behavior
SWC 1.2.144 emits the error:
error: An interface can only extend an identifier/qualified-name with optional type arguments.
 --> input.ts:1:27
  |
1 | interface IThingy extends Record<'a', string>, Record<'c', number> {}
  |                           ^^^^^^^^^^^^^^^^^^^

Caused by:
    0: failed to process js file
    1: failed to process js file
    2: error was recoverable, but proceeding would result in wrong codegen
    3: Syntax Error

Version
1.2.144
Additional context
No response

Closing as it's already fixed.
https://github.com/swc-project/swc/issues/3694

repo: swc-project/swc


text:
Filter out cranelift trace when trace is enabled

Describe the bug
When plugin_runner compiles plugin for the first time, it hits cranelift compiler. Compiler have internal traces like
{"ph":"i","pid":1,"ts":22751.1,"name":"event C:\\Users\\kwono\\.cargo\\registry\\src\\github.com-1ecc6299db9ec823\\wasmer-compiler-cranelift-2.1.1\\src\\translator\\func_translator.rs:83","cat":"wasmer_compiler_cranelift::translator::func_translator","tid":7,"s":"p","args":{"[file]":"C:\\Users\\kwono\\.cargo\\registry\\src\\github.com-1ecc6299db9ec823\\wasmer-compiler-cranelift-2.1.1\\src\\translator\\func_translator.rs","[line]":83,"message":"translate(1623 bytes, u0:499(i64 vmctx, i32, i32, i32) windows_fastcall)"}},

which fills up our trace quickly - we should filter out those traces for our output.
Input code
No response
Config
No response
Playground link
No response
Expected behavior

Actual behavior
No response
Version
latest
Additional context
No response

Fixed by https://github.com/swc-project/swc/pull/3801


text:
Option to preserve comments?

Is there an option to preserve source comments? This is sometimes necessary for instance for Webpack "magic" comments like webpackChunkName to name bundles.

Cause
Currently comments are stored based on span, but while fixer removes span, span-comment map is not updated.
There's two way to fix it.

Make fixer don't strip parens.
Update span-comment map while fixing ast.

I prefer second one, and this requires knowing how magic comments are shaped
@elsassph Can you share an example of magic comments?

Thanks, I'll give it a try


text:
Not displayed methods names

Methods folded correct, names of methods not displayed:
30 class Zend_Locale
31 {
...

1051 +--  8 lines folded
1059 +--  7 lines folded
1066 +--  7 lines folded
1073 +--  7 lines folded
1080 +--  7 lines folded
1087 +--  7 lines folded
1094 +--  7 lines folded
1101 +-- 18 lines folded
1119 +-- 10 lines folded
1129 +-- 10 lines folded
1139 +-- 11 lines folded
1150 +-- 25 lines folded
1175 +-- 45 lines folded
1220 +-- 59 lines folded
1279 +-- 65 lines folded
1344 +-- 34 lines folded
1378 +-- 11 lines folded
1389 +-- 15 lines folded
1404 +-- 33 lines folded
1437 +-- 15 lines folded
1452 +-- 22 lines folded
1474 +-- 13 lines folded
1487 +-- 13 lines folded
1500 +-- 13 lines folded
1513 +-- 14 lines folded
1527 +-- 21 lines folded
1548 +-- 14 lines folded
1562 +-- 14 lines folded
1576 +-- 14 lines folded
1590 +-- 15 lines folded
1605 +-- 23 lines folded
1628 +-- 44 lines folded
1672 +-- 58 lines folded
1730 +-- 40 lines folded
1770 +-- 16 lines folded
1786 +-- 17 lines folded
1803 +-- 11 lines folded
1814 +-- 12 lines folded
1826 +-- 11 lines folded
1837 +-- 11 lines folded
1848 +-- 12 lines folded
1860 +-- 12 lines folded
1872 +-- 76 lines folded
1948 +-- 31 lines folded
}

What is a sample of the non-folded text?

https://github.com/zendframework/zf1/blob/master/library/Zend/Locale.php

authors: coresh swekaj

license: mit

license_source: bigquery


text:
Don't use deinit to shutdown http client

Shutting down the HTTP client in deinit might be problematic. I think, it is usually better to make this explicit by exposing the shutdown/syncShutdown methods directly on the KubernetesClient.
For example, if you were using the KubernetesClient in a NIO app and you happened to deinit an instance of the client on an event loop thread, you would be blocking this event loop which is verboten.
For example:
let eventLoop = elg.next()

let deployments : EventLoopFuture<apps.v1.DeploymentList> = eventLoop.flatSubmit {
    let client = KubernetesClient(provider: .shared(elg), logger: nil)!
    return client.appsV1.deployments.list()
}

print(try deployments.wait())

This hits a precondition error because the deinit and thus the syncShutdown of the client instance happens on the event loop thread.
Fatal error: BUG DETECTED: syncShutdown() must not be called when on an EventLoop.
Calling syncShutdown() on any EventLoop can lead to deadlocks.
Current eventLoop: SelectableEventLoop { selector = Selector { descriptor = 3 }, thread = NIOThread(name = NIO-ELT-0-#0) }: file AsyncHTTPClient/HTTPClient.swift, line 138
2021-01-09 22:32:06.490788+0100 [50257:6763987] Fatal error: BUG DETECTED: syncShutdown() must not be called when on an EventLoop.
Calling syncShutdown() on any EventLoop can lead to deadlocks.
Current eventLoop: SelectableEventLoop { selector = Selector { descriptor = 3 }, thread = NIOThread(name = NIO-ELT-0-#0) }: file AsyncHTTPClient/HTTPClient.swift, line 138

Thinking about it, there is probably also a problem with the init method. In the example above, the init of the client happens on the event loop thread. And because the init will try to load the config / credentials from the filesystem, this is also a hidden blocking IO call. The NIO way of doing things would be to use NonBlockingFileIO to access the local filesystem.
I see two options:

Make the init package internal and provide a public static makeAutoConfiguredClient factory method, that returns an EventLoopFuture<KubernetesClient>.
Alternatively, factor the auto-configuration part out of the client. The KubernetesClientConfig type itself could have an async static factory method, that does the auto configuration from the filesystem using NonBlockingFileIO, and then returns an EventLoopFuture<KubernetesClientConfig?> which can be used to create a client instance.

Thinking about it, there is probably also a problem with the init method. In the example above, the init of the client happens on the event loop thread. And because the init will try to load the config / credentials from the filesystem, this is also a hidden blocking IO call. The NIO way of doing things would be to use NonBlockingFileIO to access the local filesystem.
I see two options:

Make the init package internal and provide a public static makeAutoConfiguredClient factory method, that returns an EventLoopFuture<KubernetesClient>.
Alternatively, factor the auto-configuration part out of the client. The KubernetesClientConfig type itself could have an async static factory method, that does the auto configuration from the filesystem using NonBlockingFileIO, and then returns an EventLoopFuture<KubernetesClientConfig?> which can be used to create a client instance.

An explicit syncShutdown instead of deinit is definitely a better approach.
The init is another story. I haven't really thought about creating KubernetesClient instances on an EventLoop on demand, but rather initialised once on App start and then reused throughout the whole lifecycle.
Something like the Vapor example: https://github.com/swiftkube/examples/tree/main/swiftkubedash
The app is configured:
https://github.com/swiftkube/examples/blob/7a97f89eb3fbbc4d513abc037de7d8b91ac6b241/swiftkubedash/Sources/Run/main.swift#L7-L10
And the KubernetesClient is initialised on the main thread once:
https://github.com/swiftkube/examples/blob/7a97f89eb3fbbc4d513abc037de7d8b91ac6b241/swiftkubedash/Sources/App/configure.swift#L48-L52
then it can be (re)used on any EventLoop. This should be however mentioned or better explained in the docs.
I am quite frankly not sure yet, if the async init of the client the right way to go. I would like to hear more input/feedback from a wider audience first 😉. Hopefully we'll get more enthusiastic users soon 🤞

An explicit syncShutdown instead of deinit is definitely a better approach.
The init is another story. I haven't really thought about creating KubernetesClient instances on an EventLoop on demand, but rather initialised once on App start and then reused throughout the whole lifecycle.
Something like the Vapor example: https://github.com/swiftkube/examples/tree/main/swiftkubedash
The app is configured:
https://github.com/swiftkube/examples/blob/7a97f89eb3fbbc4d513abc037de7d8b91ac6b241/swiftkubedash/Sources/Run/main.swift#L7-L10
And the KubernetesClient is initialised on the main thread once:
https://github.com/swiftkube/examples/blob/7a97f89eb3fbbc4d513abc037de7d8b91ac6b241/swiftkubedash/Sources/App/configure.swift#L48-L52
then it can be (re)used on any EventLoop. This should be however mentioned or better explained in the docs.
I am quite frankly not sure yet, if the async init of the client the right way to go. I would like to hear more input/feedback from a wider audience first 😉. Hopefully we'll get more enthusiastic users soon 🤞

An explicit syncShutdown instead of deinit is definitely a better approach.

I really think you need both sync and async shutdown.

The init is another story. I haven't really thought about creating KubernetesClient instances on an EventLoop on demand, but rather initialised once on App start and then reused throughout the whole lifecycle.

Yes this is fair. I guess this would be the most common use case. For context, I’m doing it on the event loop because I need to recreate the client once my credentials expire.

then it can be (re)used on any EventLoop. This should be however mentioned or better explained in the docs.

documenting it would be a good solution I think

I am quite frankly not sure yet, if the async init of the client the right way to go. I would like to hear more input/feedback from a wider audience first 😉. Hopefully we'll get more enthusiastic users soon 🤞

The client works really well 👍 at least in my very limited use case 🙂

An explicit syncShutdown instead of deinit is definitely a better approach.

I really think you need both sync and async shutdown.

The init is another story. I haven't really thought about creating KubernetesClient instances on an EventLoop on demand, but rather initialised once on App start and then reused throughout the whole lifecycle.

Yes this is fair. I guess this would be the most common use case. For context, I’m doing it on the event loop because I need to recreate the client once my credentials expire.

then it can be (re)used on any EventLoop. This should be however mentioned or better explained in the docs.

documenting it would be a good solution I think

I am quite frankly not sure yet, if the async init of the client the right way to go. I would like to hear more input/feedback from a wider audience first 😉. Hopefully we'll get more enthusiastic users soon 🤞

The client works really well 👍 at least in my very limited use case 🙂

repo: swiftkube/client


text:
[6.0.2] [Windows] Fix incorrect TimeZone.current lookup logic

Explanation: Fixes lookup of the current timezone on Windows
Scope: Only impacts TimeZone.current on Windows
Original PR: https://github.com/swiftlang/swift-foundation/pull/975
Risk: Low - restores Swift 5.10 behavior and scope is minimal
Testing: Testing done via swift-ci testing and local testing
Reviewer: @parkera @compnerd

@swift-ci please test

repo: swiftlang/swift-foundation


text:
Ensure tests representing containing types of suites are synthesized if necessary

Ensure that when a suite is nested in one or more containing suite types, and those outer suites do not have an explicit @Suite attribute, we synthesize Test instances representing all containing suites.
Checklist:

[x] Code and documentation should follow the style of the Style Guide.
[x] If public symbols are renamed or modified, DocC references should be updated.

Resolves rdar://127770218

@swift-ci please test

@swift-ci please test Linux

@swift-ci please test

@swift-ci please test

@swift-ci please test

@swift-ci please test

@swift-ci please test

@swift-ci please test

repo: swiftlang/swift-testing


text:
RHEL 8 (and soon 9) binaries and/or packages

You target CentOS 7 but RHEL is the upstream distribution. I am sure you are aware.
However because you target CentOS you seem to have dropped CentOS 8 as target.
CentOS 8 may be dead, but RHEL 8 is free to use with the developers license. Further, CentOS replacements that are rebuilds of RHEL have appeared.
I work with RHEL 8 as a developer and my company uses VzLinux 8 in production (another CentOS alternative). Many others are like me.
Please provide official binaries and/or RPM packages for RHEL 8 (and soon 9).
Perhaps consider flatpak

cc @swiftlang/platform-steering-group.

I give up

We do support (and provide binaries for) RHEL UBI9. I don't know whether UBI9 binaries will work on VzLinux.
If you're after RPMs, I think we have previously experimented with distributing Swift in that format, but I don't believe we have up to date RPMs or Debian packages for Swift (@shahmishal, do I have that right?)

authors: AnthonyLatsis al45tair einar-hjortdal

repo: swiftlang/swift


text:
Compiler crash with complex protocol with associated types (ConcreteTypeMatcher::verify(): Duplicate substitution AND Rewrite system exceeded concrete type nesting depth limit)

Description
When conforming to a complex protocol with (at least?) three associated types, where:

one associated type (say A) is unbounded
the other two associated types (say Param and Ret) are constrained to the protocol itself
there is a generic function over B in the form func fn<B>(param: Param) -> Ret where Param.A == (A) -> B, Ret.A == B

When the conformer itself is used as the substitution for Param and Ret, the compiler goes stuck for a bit and then crashes saying:
(there's more info after the stack trace)
error: compile command failed due to signal 6 (use -v to see invocation)
ConcreteTypeMatcher::verify(): Duplicate substitution
Abstract differences with LHS < RHS:
Abstract differences with RHS < LHS:
- τ_1_0 (#1) -> τ_0_0
- τ_1_0 (#3) -> τ_0_0
... lots and lots of this ...
- τ_1_0 (#65533) -> τ_0_0
- τ_1_0 (#65535) -> τ_0_0
Concrete differences with LHS < RHS:
Concrete differences with RHS < LHS:
Concrete conflicts:
Please submit a bug report (https://swift.org/contributing/#reporting-bugs) and include the crash backtrace.
Stack dump:
(trace #1)

If I remove Param (which is on function parameter position) and replace it with the type (A) -> B, everything is ok. But if I replace Ret (which is on function return position) with B, the compiler crashes again but with a different error:
error: compile command failed due to signal 6 (use -v to see invocation)
Rewrite system exceeded concrete type nesting depth limit
Requirement machine for fresh signature < τ_0_0 τ_1_0 >
Rewrite system: {
- [Copyable].[Copyable] => [Copyable] [permanent]
- [Escapable].[Escapable] => [Escapable] [permanent]
- τ_1_0.[Copyable] => τ_1_0 [explicit]
- τ_1_0.[Escapable] => τ_1_0 [explicit]
- τ_0_0.[concrete: (τ_0_0) -> τ_1_0] => τ_0_0 [explicit] [subst↓]
- τ_0_0.[concrete: (@escaping (τ_0_0) -> τ_1_0) -> τ_1_0] => τ_0_0 [subst↓]
- τ_0_0.[concrete: (@escaping (@escaping (τ_0_0) -> τ_1_0) -> τ_1_0) -> τ_1_0] => τ_0_0 [subst↓]
- τ_0_0.[concrete: (@escaping (@escaping (@escaping (τ_0_0) -> τ_1_0) -> τ_1_0) -> τ_1_0) -> τ_1_0] => τ_0_0 [subst↓]
- τ_0_0.[concrete: (@escaping (@escaping (@escaping (@escaping (τ_0_0) -> τ_1_0) -> τ_1_0) -> τ_1_0) -> τ_1_0) -> τ_1_0] => τ_0_0 [subst↓]
... every row expands with one nested level per row until it gets massive! ...
Conformance paths: {
}
Please submit a bug report (https://swift.org/contributing/#reporting-bugs) and include the crash backtrace.
Stack dump:
(trace #2)

Reproduction
protocol Crash {
  associatedtype A
  associatedtype Param: Crash
  associatedtype Ret: Crash

  func fn<B>(param: Param) -> Ret
    where Param.A == (A) -> B, Ret.A == B
}

extension Optional: Crash {
  typealias A = Wrapped
  typealias Param = Optional
  typealias Ret = Optional

  func fn<B>(param: Param) -> Ret {
    fatalError()
  }
}

/* Also try to replace `Param` with `(A) -> B` and `Ret` with `B` */

Stack dump
(trace #1)

0.	Program arguments: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift-frontend -frontend -c -primary-file crash.swift -target arm64-apple-macosx14.0 -Xllvm -aarch64-use-tbi -enable-objc-interop -stack-check -sdk /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.0.sdk -color-diagnostics -new-driver-path /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift-driver -empty-abi-descriptor -resource-dir /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift -module-name sw -disable-clang-spi -target-sdk-version 15.0 -target-sdk-name macosx15.0 -external-plugin-path /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/usr/lib/swift/host/plugins#/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/usr/bin/swift-plugin-server -external-plugin-path /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/usr/local/lib/swift/host/plugins#/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/usr/bin/swift-plugin-server -plugin-path /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/host/plugins -plugin-path /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/local/lib/swift/host/plugins -o /var/folders/32/8zz3lkfd3tld9689tm_2nyym0000gp/T/TemporaryDirectory.MeEQ6t/sw-1.o
1.	Apple Swift version 6.0 (swiftlang-6.0.0.9.10 clang-1600.0.26.2)
2.	Compiling with effective version 5.10
3.	While evaluating request TypeCheckSourceFileRequest(source_file "crash.swift")
4.	While type-checking extension of Optional (at crash.swift:10:1)
5.	While type-checking protocol conformance Optional<Wrapped>: Crash at extension of Optional (at crash.swift:10:1)
6.	While evaluating request ResolveValueWitnessesRequest(<Wrapped> Optional<Wrapped>: Crash module sw)
7.	While evaluating request AbstractGenericSignatureRequest(NULL, {τ_0_0, τ_1_0}, {τ_0_0 : Copyable, τ_0_0 : Escapable, Optional<τ_0_0> : Crash, τ_1_0 == Optional<Wrapped>.A, Optional<Wrapped>.A == (Optional<Wrapped>.A) -> τ_1_0}, 0)
8.	While evaluating request AbstractGenericSignatureRequest(NULL, {τ_0_0, τ_1_0}, {τ_0_0 : Copyable, τ_0_0 : Escapable, Optional<τ_0_0> : Crash, τ_1_0 == τ_0_0, τ_0_0 == (τ_0_0) -> τ_1_0}, 0)
Stack dump without symbol names (ensure you have llvm-symbolizer in your PATH or set the environment var `LLVM_SYMBOLIZER_PATH` to point to it):
0  swift-frontend           0x0000000107c1f0fc llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) + 56
1  swift-frontend           0x0000000107c1d350 llvm::sys::RunSignalHandlers() + 112
2  swift-frontend           0x0000000107c1f6c8 SignalHandler(int) + 292
3  libsystem_platform.dylib 0x000000018ec06584 _sigtramp + 56
4  libsystem_pthread.dylib  0x000000018ebd5c20 pthread_kill + 288
5  libsystem_c.dylib        0x000000018eae2a30 abort + 180
6  swift-frontend           0x0000000103fcdb64 swift::rewriting::RewriteSystem::computeTypeDifference(swift::rewriting::Term, swift::rewriting::Symbol, swift::rewriting::Symbol, std::__1::optional<unsigned int>&, std::__1::optional<unsigned int>&) + 2216
7  swift-frontend           0x0000000103f97a1c swift::rewriting::PropertyMap::unifyConcreteTypes(swift::rewriting::Term, std::__1::optional<swift::rewriting::Symbol>&, llvm::SmallVectorImpl<std::__1::pair<swift::rewriting::Symbol, unsigned int>>&, swift::rewriting::Symbol, unsigned int) + 760
8  swift-frontend           0x0000000103f944dc swift::rewriting::PropertyMap::buildPropertyMap() + 1688
9  swift-frontend           0x0000000103fa6c40 swift::rewriting::RequirementMachine::computeCompletion(swift::rewriting::RewriteSystem::ValidityPolicy) + 240
10 swift-frontend           0x0000000103fa7d30 swift::rewriting::RequirementMachine::initWithWrittenRequirements(llvm::ArrayRef<swift::GenericTypeParamType*>, llvm::ArrayRef<swift::StructuralRequirement>) + 772
11 swift-frontend           0x0000000103fac1a4 swift::AbstractGenericSignatureRequest::evaluate(swift::Evaluator&, swift::GenericSignatureImpl const*, llvm::SmallVector<swift::GenericTypeParamType*, 2u>, llvm::SmallVector<swift::Requirement, 2u>, bool) const + 3744
12 swift-frontend           0x0000000103a29b50 swift::SimpleRequest<swift::AbstractGenericSignatureRequest, llvm::PointerIntPair<swift::GenericSignature, 3u, swift::optionset::OptionSet<swift::GenericSignatureErrorFlags, unsigned int>, llvm::PointerLikeTypeTraits<swift::GenericSignature>, llvm::PointerIntPairInfo<swift::GenericSignature, 3u, llvm::PointerLikeTypeTraits<swift::GenericSignature>>> (swift::GenericSignatureImpl const*, llvm::SmallVector<swift::GenericTypeParamType*, 2u>, llvm::SmallVector<swift::Requirement, 2u>, bool), (swift::RequestFlags)2>::evaluateRequest(swift::AbstractGenericSignatureRequest const&, swift::Evaluator&) + 288
13 swift-frontend           0x0000000103ecb8cc swift::AbstractGenericSignatureRequest::OutputType swift::Evaluator::getResultUncached<swift::AbstractGenericSignatureRequest, swift::AbstractGenericSignatureRequest::OutputType swift::evaluateOrDefault<swift::AbstractGenericSignatureRequest>(swift::Evaluator&, swift::AbstractGenericSignatureRequest, swift::AbstractGenericSignatureRequest::OutputType)::'lambda'()>(swift::AbstractGenericSignatureRequest const&, swift::AbstractGenericSignatureRequest::OutputType swift::evaluateOrDefault<swift::AbstractGenericSignatureRequest>(swift::Evaluator&, swift::AbstractGenericSignatureRequest, swift::AbstractGenericSignatureRequest::OutputType)::'lambda'()) + 660
14 swift-frontend           0x0000000103ecb580 swift::AbstractGenericSignatureRequest::OutputType swift::Evaluator::getResultCached<swift::AbstractGenericSignatureRequest, swift::AbstractGenericSignatureRequest::OutputType swift::evaluateOrDefault<swift::AbstractGenericSignatureRequest>(swift::Evaluator&, swift::AbstractGenericSignatureRequest, swift::AbstractGenericSignatureRequest::OutputType)::'lambda'(), (void*)0>(swift::AbstractGenericSignatureRequest const&, swift::AbstractGenericSignatureRequest::OutputType swift::evaluateOrDefault<swift::AbstractGenericSignatureRequest>(swift::Evaluator&, swift::AbstractGenericSignatureRequest, swift::AbstractGenericSignatureRequest::OutputType)::'lambda'()) + 692
15 swift-frontend           0x0000000103fabb94 swift::AbstractGenericSignatureRequest::evaluate(swift::Evaluator&, swift::GenericSignatureImpl const*, llvm::SmallVector<swift::GenericTypeParamType*, 2u>, llvm::SmallVector<swift::Requirement, 2u>, bool) const + 2192
16 swift-frontend           0x0000000103a29b50 swift::SimpleRequest<swift::AbstractGenericSignatureRequest, llvm::PointerIntPair<swift::GenericSignature, 3u, swift::optionset::OptionSet<swift::GenericSignatureErrorFlags, unsigned int>, llvm::PointerLikeTypeTraits<swift::GenericSignature>, llvm::PointerIntPairInfo<swift::GenericSignature, 3u, llvm::PointerLikeTypeTraits<swift::GenericSignature>>> (swift::GenericSignatureImpl const*, llvm::SmallVector<swift::GenericTypeParamType*, 2u>, llvm::SmallVector<swift::Requirement, 2u>, bool), (swift::RequestFlags)2>::evaluateRequest(swift::AbstractGenericSignatureRequest const&, swift::Evaluator&) + 288
17 swift-frontend           0x0000000103ecb8cc swift::AbstractGenericSignatureRequest::OutputType swift::Evaluator::getResultUncached<swift::AbstractGenericSignatureRequest, swift::AbstractGenericSignatureRequest::OutputType swift::evaluateOrDefault<swift::AbstractGenericSignatureRequest>(swift::Evaluator&, swift::AbstractGenericSignatureRequest, swift::AbstractGenericSignatureRequest::OutputType)::'lambda'()>(swift::AbstractGenericSignatureRequest const&, swift::AbstractGenericSignatureRequest::OutputType swift::evaluateOrDefault<swift::AbstractGenericSignatureRequest>(swift::Evaluator&, swift::AbstractGenericSignatureRequest, swift::AbstractGenericSignatureRequest::OutputType)::'lambda'()) + 660
18 swift-frontend           0x0000000103ecb580 swift::AbstractGenericSignatureRequest::OutputType swift::Evaluator::getResultCached<swift::AbstractGenericSignatureRequest, swift::AbstractGenericSignatureRequest::OutputType swift::evaluateOrDefault<swift::AbstractGenericSignatureRequest>(swift::Evaluator&, swift::AbstractGenericSignatureRequest, swift::AbstractGenericSignatureRequest::OutputType)::'lambda'(), (void*)0>(swift::AbstractGenericSignatureRequest const&, swift::AbstractGenericSignatureRequest::OutputType swift::evaluateOrDefault<swift::AbstractGenericSignatureRequest>(swift::Evaluator&, swift::AbstractGenericSignatureRequest, swift::AbstractGenericSignatureRequest::OutputType)::'lambda'()) + 692
19 swift-frontend           0x0000000103ec99b4 swift::buildGenericSignature(swift::ASTContext&, swift::GenericSignature, llvm::SmallVector<swift::GenericTypeParamType*, 2u>, llvm::SmallVector<swift::Requirement, 2u>, bool) + 272
20 swift-frontend           0x0000000103f7267c swift::RequirementEnvironment::RequirementEnvironment(swift::DeclContext*, swift::GenericSignature, swift::ProtocolDecl*, swift::ClassDecl*, swift::RootProtocolConformance*) + 2280
21 swift-frontend           0x0000000103a03c90 swift::matchWitness(llvm::DenseMap<std::__1::pair<swift::GenericSignatureImpl const*, swift::ClassDecl const*>, swift::RequirementEnvironment, llvm::DenseMapInfo<std::__1::pair<swift::GenericSignatureImpl const*, swift::ClassDecl const*>, void>, llvm::detail::DenseMapPair<std::__1::pair<swift::GenericSignatureImpl const*, swift::ClassDecl const*>, swift::RequirementEnvironment>>&, swift::ProtocolDecl*, swift::RootProtocolConformance*, swift::DeclContext*, swift::ValueDecl*, swift::ValueDecl*) + 520
22 swift-frontend           0x0000000103a04d28 swift::WitnessChecker::findBestWitness(swift::ValueDecl*, bool*, swift::NormalProtocolConformance*, llvm::SmallVectorImpl<swift::RequirementMatch>&, unsigned int&, unsigned int&, bool&) + 868
23 swift-frontend           0x0000000103a078d0 swift::ConformanceChecker::resolveWitnessViaLookup(swift::ValueDecl*) + 552
24 swift-frontend           0x0000000103a09ab0 swift::ConformanceChecker::resolveValueWitnesses() + 1364
25 swift-frontend           0x0000000103a2c1ec swift::SimpleRequest<swift::ResolveValueWitnessesRequest, std::__1::tuple<> (swift::NormalProtocolConformance*), (swift::RequestFlags)2>::evaluateRequest(swift::ResolveValueWitnessesRequest const&, swift::Evaluator&) + 140
26 swift-frontend           0x0000000103f69f9c swift::ResolveValueWitnessesRequest::OutputType swift::Evaluator::getResultCached<swift::ResolveValueWitnessesRequest, swift::ResolveValueWitnessesRequest::OutputType swift::evaluateOrDefault<swift::ResolveValueWitnessesRequest>(swift::Evaluator&, swift::ResolveValueWitnessesRequest, swift::ResolveValueWitnessesRequest::OutputType)::'lambda'(), (void*)0>(swift::ResolveValueWitnessesRequest const&, swift::ResolveValueWitnessesRequest::OutputType swift::evaluateOrDefault<swift::ResolveValueWitnessesRequest>(swift::Evaluator&, swift::ResolveValueWitnessesRequest, swift::ResolveValueWitnessesRequest::OutputType)::'lambda'()) + 1260
27 swift-frontend           0x0000000103a15694 (anonymous namespace)::MultiConformanceChecker::checkAllConformances() + 16612
28 swift-frontend           0x0000000103a0ecd4 swift::TypeChecker::checkConformancesInContext(swift::IterableDeclContext*) + 6792
29 swift-frontend           0x000000010399e42c (anonymous namespace)::DeclChecker::visit(swift::Decl*) + 22656
30 swift-frontend           0x0000000103998b9c swift::TypeChecker::typeCheckDecl(swift::Decl*) + 152
31 swift-frontend           0x0000000103a7fd5c swift::TypeCheckSourceFileRequest::evaluate(swift::Evaluator&, swift::SourceFile*) const + 660
32 swift-frontend           0x0000000103a873c0 swift::TypeCheckSourceFileRequest::OutputType swift::Evaluator::getResultUncached<swift::TypeCheckSourceFileRequest, swift::TypeCheckSourceFileRequest::OutputType swift::evaluateOrDefault<swift::TypeCheckSourceFileRequest>(swift::Evaluator&, swift::TypeCheckSourceFileRequest, swift::TypeCheckSourceFileRequest::OutputType)::'lambda'()>(swift::TypeCheckSourceFileRequest const&, swift::TypeCheckSourceFileRequest::OutputType swift::evaluateOrDefault<swift::TypeCheckSourceFileRequest>(swift::Evaluator&, swift::TypeCheckSourceFileRequest, swift::TypeCheckSourceFileRequest::OutputType)::'lambda'()) + 620
33 swift-frontend           0x0000000103a7faac swift::performTypeChecking(swift::SourceFile&) + 328
34 swift-frontend           0x000000010299ece0 swift::CompilerInstance::performSema() + 260
35 swift-frontend           0x00000001025cc190 performCompile(swift::CompilerInstance&, int&, swift::FrontendObserver*) + 1528
36 swift-frontend           0x00000001025caf58 swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) + 3572
37 swift-frontend           0x000000010255201c swift::mainEntry(int, char const**) + 3680
38 dyld                     0x000000018e84b154 start + 2476

(trace #2)

0.	Program arguments: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift-frontend -frontend -c -primary-file crash.swift -target arm64-apple-macosx14.0 -Xllvm -aarch64-use-tbi -enable-objc-interop -stack-check -sdk /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.0.sdk -color-diagnostics -new-driver-path /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift-driver -empty-abi-descriptor -resource-dir /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift -module-name sw -disable-clang-spi -target-sdk-version 15.0 -target-sdk-name macosx15.0 -external-plugin-path /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/usr/lib/swift/host/plugins#/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/usr/bin/swift-plugin-server -external-plugin-path /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/usr/local/lib/swift/host/plugins#/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/usr/bin/swift-plugin-server -plugin-path /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/host/plugins -plugin-path /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/local/lib/swift/host/plugins -o /var/folders/32/8zz3lkfd3tld9689tm_2nyym0000gp/T/TemporaryDirectory.XtqAK2/sw-1.o
1.	Apple Swift version 6.0 (swiftlang-6.0.0.9.10 clang-1600.0.26.2)
2.	Compiling with effective version 5.10
3.	While evaluating request TypeCheckSourceFileRequest(source_file "crash.swift")
4.	While type-checking extension of Optional (at crash.swift:9:1)
5.	While type-checking protocol conformance Optional<Wrapped>: Crash at extension of Optional (at crash.swift:9:1)
6.	While evaluating request ResolveValueWitnessesRequest(<Wrapped> Optional<Wrapped>: Crash module sw)
7.	While evaluating request AbstractGenericSignatureRequest(NULL, {τ_0_0, τ_1_0}, {τ_0_0 : Copyable, τ_0_0 : Escapable, Optional<τ_0_0> : Crash, τ_1_0 : Copyable, τ_1_0 : Escapable, Optional<Wrapped>.A == (Optional<Wrapped>.A) -> τ_1_0}, 0)
8.	While evaluating request AbstractGenericSignatureRequest(NULL, {τ_0_0, τ_1_0}, {τ_0_0 : Copyable, τ_0_0 : Escapable, Optional<τ_0_0> : Crash, τ_1_0 : Copyable, τ_1_0 : Escapable, τ_0_0 == (τ_0_0) -> τ_1_0}, 0)
Stack dump without symbol names (ensure you have llvm-symbolizer in your PATH or set the environment var `LLVM_SYMBOLIZER_PATH` to point to it):
0  swift-frontend           0x0000000107bbf0fc llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) + 56
1  swift-frontend           0x0000000107bbd350 llvm::sys::RunSignalHandlers() + 112
2  swift-frontend           0x0000000107bbf6c8 SignalHandler(int) + 292
3  libsystem_platform.dylib 0x000000018ec06584 _sigtramp + 56
4  libsystem_pthread.dylib  0x000000018ebd5c20 pthread_kill + 288
5  libsystem_c.dylib        0x000000018eae2a30 abort + 180
6  swift-frontend           0x0000000103f45e44 swift::rewriting::RequirementMachine::checkCompletionResult(swift::rewriting::CompletionResult) const + 88
7  swift-frontend           0x0000000103f4c1b0 swift::AbstractGenericSignatureRequest::evaluate(swift::Evaluator&, swift::GenericSignatureImpl const*, llvm::SmallVector<swift::GenericTypeParamType*, 2u>, llvm::SmallVector<swift::Requirement, 2u>, bool) const + 3756
8  swift-frontend           0x00000001039c9b50 swift::SimpleRequest<swift::AbstractGenericSignatureRequest, llvm::PointerIntPair<swift::GenericSignature, 3u, swift::optionset::OptionSet<swift::GenericSignatureErrorFlags, unsigned int>, llvm::PointerLikeTypeTraits<swift::GenericSignature>, llvm::PointerIntPairInfo<swift::GenericSignature, 3u, llvm::PointerLikeTypeTraits<swift::GenericSignature>>> (swift::GenericSignatureImpl const*, llvm::SmallVector<swift::GenericTypeParamType*, 2u>, llvm::SmallVector<swift::Requirement, 2u>, bool), (swift::RequestFlags)2>::evaluateRequest(swift::AbstractGenericSignatureRequest const&, swift::Evaluator&) + 288
9  swift-frontend           0x0000000103e6b8cc swift::AbstractGenericSignatureRequest::OutputType swift::Evaluator::getResultUncached<swift::AbstractGenericSignatureRequest, swift::AbstractGenericSignatureRequest::OutputType swift::evaluateOrDefault<swift::AbstractGenericSignatureRequest>(swift::Evaluator&, swift::AbstractGenericSignatureRequest, swift::AbstractGenericSignatureRequest::OutputType)::'lambda'()>(swift::AbstractGenericSignatureRequest const&, swift::AbstractGenericSignatureRequest::OutputType swift::evaluateOrDefault<swift::AbstractGenericSignatureRequest>(swift::Evaluator&, swift::AbstractGenericSignatureRequest, swift::AbstractGenericSignatureRequest::OutputType)::'lambda'()) + 660
10 swift-frontend           0x0000000103e6b580 swift::AbstractGenericSignatureRequest::OutputType swift::Evaluator::getResultCached<swift::AbstractGenericSignatureRequest, swift::AbstractGenericSignatureRequest::OutputType swift::evaluateOrDefault<swift::AbstractGenericSignatureRequest>(swift::Evaluator&, swift::AbstractGenericSignatureRequest, swift::AbstractGenericSignatureRequest::OutputType)::'lambda'(), (void*)0>(swift::AbstractGenericSignatureRequest const&, swift::AbstractGenericSignatureRequest::OutputType swift::evaluateOrDefault<swift::AbstractGenericSignatureRequest>(swift::Evaluator&, swift::AbstractGenericSignatureRequest, swift::AbstractGenericSignatureRequest::OutputType)::'lambda'()) + 692
11 swift-frontend           0x0000000103f4bb94 swift::AbstractGenericSignatureRequest::evaluate(swift::Evaluator&, swift::GenericSignatureImpl const*, llvm::SmallVector<swift::GenericTypeParamType*, 2u>, llvm::SmallVector<swift::Requirement, 2u>, bool) const + 2192
12 swift-frontend           0x00000001039c9b50 swift::SimpleRequest<swift::AbstractGenericSignatureRequest, llvm::PointerIntPair<swift::GenericSignature, 3u, swift::optionset::OptionSet<swift::GenericSignatureErrorFlags, unsigned int>, llvm::PointerLikeTypeTraits<swift::GenericSignature>, llvm::PointerIntPairInfo<swift::GenericSignature, 3u, llvm::PointerLikeTypeTraits<swift::GenericSignature>>> (swift::GenericSignatureImpl const*, llvm::SmallVector<swift::GenericTypeParamType*, 2u>, llvm::SmallVector<swift::Requirement, 2u>, bool), (swift::RequestFlags)2>::evaluateRequest(swift::AbstractGenericSignatureRequest const&, swift::Evaluator&) + 288
13 swift-frontend           0x0000000103e6b8cc swift::AbstractGenericSignatureRequest::OutputType swift::Evaluator::getResultUncached<swift::AbstractGenericSignatureRequest, swift::AbstractGenericSignatureRequest::OutputType swift::evaluateOrDefault<swift::AbstractGenericSignatureRequest>(swift::Evaluator&, swift::AbstractGenericSignatureRequest, swift::AbstractGenericSignatureRequest::OutputType)::'lambda'()>(swift::AbstractGenericSignatureRequest const&, swift::AbstractGenericSignatureRequest::OutputType swift::evaluateOrDefault<swift::AbstractGenericSignatureRequest>(swift::Evaluator&, swift::AbstractGenericSignatureRequest, swift::AbstractGenericSignatureRequest::OutputType)::'lambda'()) + 660
14 swift-frontend           0x0000000103e6b580 swift::AbstractGenericSignatureRequest::OutputType swift::Evaluator::getResultCached<swift::AbstractGenericSignatureRequest, swift::AbstractGenericSignatureRequest::OutputType swift::evaluateOrDefault<swift::AbstractGenericSignatureRequest>(swift::Evaluator&, swift::AbstractGenericSignatureRequest, swift::AbstractGenericSignatureRequest::OutputType)::'lambda'(), (void*)0>(swift::AbstractGenericSignatureRequest const&, swift::AbstractGenericSignatureRequest::OutputType swift::evaluateOrDefault<swift::AbstractGenericSignatureRequest>(swift::Evaluator&, swift::AbstractGenericSignatureRequest, swift::AbstractGenericSignatureRequest::OutputType)::'lambda'()) + 692
15 swift-frontend           0x0000000103e699b4 swift::buildGenericSignature(swift::ASTContext&, swift::GenericSignature, llvm::SmallVector<swift::GenericTypeParamType*, 2u>, llvm::SmallVector<swift::Requirement, 2u>, bool) + 272
16 swift-frontend           0x0000000103f1267c swift::RequirementEnvironment::RequirementEnvironment(swift::DeclContext*, swift::GenericSignature, swift::ProtocolDecl*, swift::ClassDecl*, swift::RootProtocolConformance*) + 2280
17 swift-frontend           0x00000001039a3c90 swift::matchWitness(llvm::DenseMap<std::__1::pair<swift::GenericSignatureImpl const*, swift::ClassDecl const*>, swift::RequirementEnvironment, llvm::DenseMapInfo<std::__1::pair<swift::GenericSignatureImpl const*, swift::ClassDecl const*>, void>, llvm::detail::DenseMapPair<std::__1::pair<swift::GenericSignatureImpl const*, swift::ClassDecl const*>, swift::RequirementEnvironment>>&, swift::ProtocolDecl*, swift::RootProtocolConformance*, swift::DeclContext*, swift::ValueDecl*, swift::ValueDecl*) + 520
18 swift-frontend           0x00000001039a4d28 swift::WitnessChecker::findBestWitness(swift::ValueDecl*, bool*, swift::NormalProtocolConformance*, llvm::SmallVectorImpl<swift::RequirementMatch>&, unsigned int&, unsigned int&, bool&) + 868
19 swift-frontend           0x00000001039a78d0 swift::ConformanceChecker::resolveWitnessViaLookup(swift::ValueDecl*) + 552
20 swift-frontend           0x00000001039a9ab0 swift::ConformanceChecker::resolveValueWitnesses() + 1364
21 swift-frontend           0x00000001039cc1ec swift::SimpleRequest<swift::ResolveValueWitnessesRequest, std::__1::tuple<> (swift::NormalProtocolConformance*), (swift::RequestFlags)2>::evaluateRequest(swift::ResolveValueWitnessesRequest const&, swift::Evaluator&) + 140
22 swift-frontend           0x0000000103f09f9c swift::ResolveValueWitnessesRequest::OutputType swift::Evaluator::getResultCached<swift::ResolveValueWitnessesRequest, swift::ResolveValueWitnessesRequest::OutputType swift::evaluateOrDefault<swift::ResolveValueWitnessesRequest>(swift::Evaluator&, swift::ResolveValueWitnessesRequest, swift::ResolveValueWitnessesRequest::OutputType)::'lambda'(), (void*)0>(swift::ResolveValueWitnessesRequest const&, swift::ResolveValueWitnessesRequest::OutputType swift::evaluateOrDefault<swift::ResolveValueWitnessesRequest>(swift::Evaluator&, swift::ResolveValueWitnessesRequest, swift::ResolveValueWitnessesRequest::OutputType)::'lambda'()) + 1260
23 swift-frontend           0x00000001039b5694 (anonymous namespace)::MultiConformanceChecker::checkAllConformances() + 16612
24 swift-frontend           0x00000001039aecd4 swift::TypeChecker::checkConformancesInContext(swift::IterableDeclContext*) + 6792
25 swift-frontend           0x000000010393e42c (anonymous namespace)::DeclChecker::visit(swift::Decl*) + 22656
26 swift-frontend           0x0000000103938b9c swift::TypeChecker::typeCheckDecl(swift::Decl*) + 152
27 swift-frontend           0x0000000103a1fd5c swift::TypeCheckSourceFileRequest::evaluate(swift::Evaluator&, swift::SourceFile*) const + 660
28 swift-frontend           0x0000000103a273c0 swift::TypeCheckSourceFileRequest::OutputType swift::Evaluator::getResultUncached<swift::TypeCheckSourceFileRequest, swift::TypeCheckSourceFileRequest::OutputType swift::evaluateOrDefault<swift::TypeCheckSourceFileRequest>(swift::Evaluator&, swift::TypeCheckSourceFileRequest, swift::TypeCheckSourceFileRequest::OutputType)::'lambda'()>(swift::TypeCheckSourceFileRequest const&, swift::TypeCheckSourceFileRequest::OutputType swift::evaluateOrDefault<swift::TypeCheckSourceFileRequest>(swift::Evaluator&, swift::TypeCheckSourceFileRequest, swift::TypeCheckSourceFileRequest::OutputType)::'lambda'()) + 620
29 swift-frontend           0x0000000103a1faac swift::performTypeChecking(swift::SourceFile&) + 328
30 swift-frontend           0x000000010293ece0 swift::CompilerInstance::performSema() + 260
31 swift-frontend           0x000000010256c190 performCompile(swift::CompilerInstance&, int&, swift::FrontendObserver*) + 1528
32 swift-frontend           0x000000010256af58 swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) + 3572
33 swift-frontend           0x00000001024f201c swift::mainEntry(int, char const**) + 3680
34 dyld                     0x000000018e84b154 start + 2476

Expected behavior
I expected the compiler to not crash and give some info about why the code is wrong at high level (e.g. the issue is that the generic constraints are... under constrained, so there are infinite solutions available?), not in tau / substitution map terms.
Environment
swift-driver version: 1.115 Apple Swift version 6.0 (swiftlang-6.0.0.9.10 clang-1600.0.26.2)
Target: arm64-apple-macosx14.0
Additional information
No response

cc @slavapestov

authors: technicated xedin


text:
TLS in a stubborn SMTP server

I had a very stubborn SMTP server which didn't allow me to authorize with TLS (and I knew I had to use TLS).
I tried with:
@@@
$smtp = fsockopen( "tls://mail.example.com", 587, $errno, $errstr );
@@@
got this:
@@@
Warning: fsockopen() [function.fsockopen]: SSL operation failed with code 1. OpenSSL Error messages: error:1408F10B:SSL routines:SSL3_GET_RECORD:wrong version number in E:\www\exp\test_email.php on line 49
Warning: fsockopen() [function.fsockopen]: Failed to enable crypto in E:\www\exp\test_email.php on line 49
Warning: fsockopen() [function.fsockopen]: unable to connect to tls://mail.example.com:587 (Unknown error) in E:\www\exp\test_email.php on line 49
@@@
When I tried first connecting with tcp:// and later switching to crypto connection with:
@@@
$smtp = fsockopen( "tcp://mail.example.com", 587, $errno, $errstr );
stream_socket_enable_crypto( $smtp, true, STREAM_CRYPTO_METHOD_TLS_CLIENT );
@@@
I got:
@@@
Warning: stream_socket_enable_crypto() [function.stream-socket-enable-crypto]: SSL operation failed with code 1. OpenSSL Error messages: error:1408F10B:SSL routines:SSL3_GET_RECORD:wrong version number in E:\www\exp\test_email.php on line 50
@@@
Using your system I got the same problem:
@@@
Warning: stream_socket_client() [function.stream-socket-client]: SSL operation failed with code 1. OpenSSL Error messages: error:1408F10B:SSL routines:SSL3_GET_RECORD:wrong version number in E:\www\exp\lib\swift\classes\Swift\Transport\StreamBuffer.php on line 271
Warning: stream_socket_client() [function.stream-socket-client]: Failed to enable crypto in E:\www\exp\lib\swift\classes\Swift\Transport\StreamBuffer.php on line 271
Warning: stream_socket_client() [function.stream-socket-client]: unable to connect to tls://mail.example.com:587 (Unknown error) in E:\www\exp\lib\swift\classes\Swift\Transport\StreamBuffer.php on line 271
Fatal error: Uncaught exception 'Swift_TransportException' with message 'Connection could not be established with host mail.example.com [ #0]' in E:\www\exp\lib\swift\classes\Swift\Transport\StreamBuffer.php:273 Stack trace: #0 E:\www\exp\lib\swift\classes\Swift\Transport\StreamBuffer.php(66): Swift_Transport_StreamBuffer->_establishSocketConnection() #1 E:\www\exp\lib\swift\classes\Swift\Transport\AbstractSmtpTransport.php(116): Swift_Transport_StreamBuffer->initialize(Array) #2 E:\www\exp\lib\swift\classes\Swift\Mailer.php(79): Swift_Transport_AbstractSmtpTransport->start() #3 E:\www\exp\test_swift.php(49): Swift_Mailer->send(Object(Swift_Message)) #4 {main} thrown in E:\www\exp\lib\swift\classes\Swift\Transport\StreamBuffer.php on line 273
@@@
I was close to give up but I encountered this post "Secure tls email through fsockopen":http://forum.powweb.com/showthread.php?t=73406 by Fred Kilbourn. The important fragments are:
@@@
cmd( "STARTTLS" );
stream_socket_enable_crypto( $smtp, true, STREAM_CRYPTO_METHOD_TLS_CLIENT );
cmd( "EHLO {$_POST['DomainName']}" );
@@@
so it is important to issue "STARTTLS" command, only after that start stream_socket_enable_crypto() and again issuing EHLO command. Only with this set of commands everything starts to work... I hope it may help you modify the code so that it will be possible to connect to more servers without any problems.
Original creation date: 2011-08-07T14:44:40Z
Original reporter: boryn
Original ticket: http://swiftmailer.lighthouseapp.com/projects/21527/tickets/215

I am currently running into this issue with SwiftMailer while trying to connect to our companies new Office365 mail accounts. Using TLS over port 587 is giving me the "...SSL3_GET_RECORD:wrong version number..." error message.  Is this something currently being worked on or is there a workaround in place?

Same as whitpan, Office365 mail account, SSL3_GET_RECORD:wrong version number

authors: ericholsinger swiftmailer whitpan

repo: swiftmailer/swiftmailer


text:
Having javascript:void(0) causes an error when HTTP Header Content Security Policy "script-src 'self'" is used

I'm submitting a ...
[ ] bug report
[X] feature request
[ ] support request

Current behavior
When securing an application with the HTTP header Content Security Policy: script-src 'self' (meaning that only javascript originating from the same origin can run) using inline javascript:void(0) like in the datatable-pager on L13 for example causes the following error:
Chrome:
Refused to run the JavaScript URL because it violates the following Content Security Policy
directive: "script-src 'self'". Either the 'unsafe-inline' keyword, a hash ('sha256-...'),
or a nonce ('nonce-...') is required to enable inline execution.

Edge:
CSP14312: Resource violated directive 'script-src 'self'' in Content-Security-Policy: inline script. Resource will be blocked.

Expected behavior
All  should be replaced by a simple
Reproduction of the problem
Have the Web Server respond with the HTTP Header Content-Security-Policy: script-src 'self'; and click on the pager buttons.
What is the motivation / use case for changing the behavior?
Avoiding a noisy JavaScript error in the console.
Please tell us about your environment:

Table version:
13.1.0

Angular version:
6.1.7

Browser:
Chrome 69.0.3497.100
Microsoft Edge 42.17134.1.0

Language:
Typescript 2.9.2

🆙 Any news about this ?

So this is basically not going to be fixed

So this is basically not going to be fixed

Can we get this PR merged? Without it, the pagination just doesn't work when Content-Security-Policy is applied to the website which is a major functional gap

Yes, pls merge this PR. We are also seeing the same issue.

Would it be possible to merge this PR? We are also running into this. Many thanks in advance!

authors: GJBisschop StillUpgrade dstj gallivantor sainture wj109s5

repo: swimlane/ngx-datatable


text:
Create trello.json

This pull request addresses Issue #690 and introduces Trello as a new search provider in SwirlAI. With this enhancement, users will now be able to seamlessly integrate Trello boards into their search results, providing a more comprehensive and streamlined search experience.
Changes Made:
Implemented Trello API integration to fetch search results.
Added functionality to parse and display Trello cards within search results.
Enhanced user interface to accommodate Trello-specific information, such as board names and card details.

Hi @HarshMN2345, thanks for the PR. Please check the contributing guidelines. You need to create a PR to the develop branch by branching out from the develop branch.

repo: swirlai/swirl-search


text:
Fix filter "Anzahl Personen"

The filter only lists one group entity though there should be many unspecific groups (>1) and several precise (Acht Herren (8), Stiftermönche (8), Stifterfiguren (116)...).

It seems we at one point changed the display to only show Persons, not Groups. Hence the filter was stuck at 1. I now changed the query to show Groups as well (since I don't remember why we did that change)

authors: MyriamSchmidt fkraeutli

repo: swiss-art-research-net/itten-app


text:
swoft 域名和controller的绑定目前没有，开发时限制这个需要些一堆。

现在是启动一个服务，绑定多个域名。希望能增加 域名和controller的绑定的功能。

可以通过中间件限制：
<?php declare(strict_types=1);
/**
 * This file is part of Swoft.
 *
 * @link     https://swoft.org
 * @document https://swoft.org/docs
 * @contact  group@swoft.org
 * @license  https://github.com/swoft-cloud/swoft/blob/master/LICENSE
 */

namespace App\Http\Middleware;

use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\ServerRequestInterface;
use Psr\Http\Server\RequestHandlerInterface;
use Swoft\Bean\Annotation\Mapping\Bean;
use Swoft\Http\Message\Request;
use Swoft\Http\Server\Contract\MiddlewareInterface;
use function context;
use function strpos;

/**
 * Class DomainLimitMiddleware
 *
 * @Bean()
 */
class DomainLimitMiddleware implements MiddlewareInterface
{
    private $domain2paths = [
        'user.com' => [
            // match all /user/*
            '/user/',
        ],
        'blog.com' => [
            // match all /blog/*
            '/blog/',
        ]
    ];

    /**
     * Process an incoming server request.
     *
     * @param ServerRequestInterface|Request $request
     * @param RequestHandlerInterface        $handler
     *
     * @return ResponseInterface
     * @inheritdoc
     */
    public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface
    {
        $uriPath = $request->getUriPath();
        $domain  = $request->getUri()->getHost();

        if (isset($this->domain2paths[$domain])) {
            return context()->getResponse()->withStatus(404)->withContent('invalid request domain');
        }

        foreach ($this->domain2paths[$domain] as $prefix) {
            // not match route prefix
            if (strpos($uriPath, $prefix) !== 0) {
                return context()->getResponse()->withStatus(404)->withContent('page not found');
            }
        }

        return $handler->handle($request);
    }
}

authors: inhere linjuchen

repo: swoft-cloud/swoft


text:
Create Coordinate Picker plugin

Listens for mouse clicks on the map, transforms them to a specified
frame, and prints a list of them in the plugin GUI. The most recent
coordinates are copied to the clipboard.
This is just the Indigo version of #593

No need to merge this in separately, it's in the new combined master branch.

authors: jatowler pjreed

repo: swri-robotics/mapviz


text:
🛑 BestQA is down

In d954350, BestQA ($SECRET_SITE) was down:

HTTP code: 0
Response time: 0 ms

Resolved: BestQA is back up in cf5f361.

Resolved: BestQA is back up in cf5f361.

repo: swuecho/upptime


text:
🛑 BestQA is down

In 3c57552, BestQA ($SECRET_SITE) was down:

HTTP code: 0
Response time: 0 ms

Resolved: BestQA is back up in 34d8038.


text:
🛑 BestQA is down

In cae59d6, BestQA (https://www.bestqa.net/) was down:

HTTP code: 0
Response time: 0 ms

Resolved: BestQA is back up in b6fd561.


text:
🛑 Random site is down

In ea8333e, Random site (https://www.southernjive.co.uk) was down:

HTTP code: 0
Response time: 0 ms

Resolved: Random site is back up in 32086b3.

repo: sxa/aoupptime


text:
Synchronization issue?

What system are you running Yazi on?
Linux Wayland
What terminal are you running Yazi in?
kitty 0.36.4
yazi --debug output
Yazi
    Version: 0.3.3 (35d781e 2024-10-23)
    Debug  : false
    OS     : linux-x86_64 (unix)

Ya
    Version: 0.3.3 (Arch Linux 2024-09-05)

Emulator
    Emulator.via_env: ("xterm-kitty", "")
    Emulator.via_csi: Ok(Kitty)
    Emulator.detect : Kitty

Adapter
    Adapter.matches: Kgp

Desktop
    XDG_SESSION_TYPE           : Some("wayland")
    WAYLAND_DISPLAY            : Some("wayland-1")
    DISPLAY                    : Some(":0")
    SWAYSOCK                   : None
    HYPRLAND_INSTANCE_SIGNATURE: Some("4520b30d498daca8079365bdb909a8dea38e8d55_1729671642_1738058818")
    WAYFIRE_SOCKET             : None

SSH
    shared.in_ssh_connection: false

WSL
    WSL: false

Variables
    SHELL              : Some("/usr/bin/bash")
    EDITOR             : Some("/usr/bin/nvim")
    VISUAL             : Some("/usr/bin/nvim")
    YAZI_FILE_ONE      : None
    YAZI_CONFIG_HOME   : None

Text Opener
    default     : Some(Opener { run: "${EDITOR:-vi} \"$@\"", block: true, orphan: false, desc: "$EDITOR (block)", for_: None, spread: true })
    block-create: Some(Opener { run: "${EDITOR:-vi} \"$@\"", block: true, orphan: false, desc: "$EDITOR (block)", for_: None, spread: true })
    block-rename: Some(Opener { run: "${EDITOR:-vi} \"$@\"", block: true, orphan: false, desc: "$EDITOR (block)", for_: None, spread: true })

Multiplexers
    TMUX               : false
    tmux version       : No such file or directory (os error 2)
    tmux build flags   : enable-sixel=Unknown
    ZELLIJ_SESSION_NAME: None
    Zellij version     : No such file or directory (os error 2)

Dependencies
    file             : 5.45
    ueberzugpp       : No such file or directory (os error 2)
    ffmpegthumbnailer: 2.2.3
    magick           : 7.1.1-39
    fzf              : 0.55.0
    fd               : 10.2.0
    rg               : 14.1.1
    chafa            : 1.14.2
    zoxide           : 0.9.6
    7z               : 17.05
    7zz              : No such file or directory (os error 2)
    jq               : 1.7.1

Did you try the latest nightly build to see if the problem got fixed?
Yes, and I updated the debug information above (yazi --debug) to the nightly that I tried
Describe the bug
In lua, repeatedly creating a tab and calling reveal to hover a directory on that tab, only works if the directories of every tab are the same.
Minimal reproducer
Create three files in /tmp
cd /tmp
touch file0
touch file1
touch file2

Now make a subdirectory and create three files in it again
mkdir tmp
cd tmp
touch file0
touch file1
touch file2

Now open yazi anywhere
cd ~
yazi

and run the plugin (at the bottom)
plugin bug --args=fails

I would expect file1 to be hovered in each tab, as it happens when
both reveals happen in the same directory (plugin bug --args=works)
If I run the commands one by one in Yazi using command.yazi, the procedure that fails programmatically, works as expected too.
tab_create /tmp
reveal /tmp/file1
tab_create /tmp/tmp
reveal /tmp/tmp/file1
tab_close 0
tab_switch 0

Works!
local function entry(_, args)
  ya.manager_emit("tab_create", { "/tmp" })
  ya.manager_emit("reveal", { "/tmp/file1" })

  if args[1] == "works" then
    ya.manager_emit("tab_create", { "/tmp" })
    ya.manager_emit("reveal", { "/tmp/file2" })
  elseif args[1] == "fails" then
    ya.manager_emit("tab_create", { "/tmp/tmp" })
    ya.manager_emit("reveal", { "/tmp/tmp/file1" })
  end

  -- Delete the original tab
  ya.manager_emit("tab_close", { 0 })

  -- Make the first tab we created active
  ya.manager_emit("tab_switch", { 0 })
end

local function setup(state, opts)
end

return {
  entry = entry,
  setup = setup,
}

Anything else?
No response

Please try https://github.com/sxyazi/yazi/pull/1826
Note that this PR renames the idx added yesterday to id - it will now be a unique, non-repeating value to solve the issue where the IDs of the later tabs get reordered when a previous tab is closed

Fixed, works great, thank you!

authors: dawsers sxyazi

repo: sxyazi/yazi


text:
Table Data Dialog Size

          This is not working for me with 2.15.0.

Originally posted by @ecchodun in https://github.com/syd711/vpin-studio/issues/186#issuecomment-2025743063

This is still a bug where the  pop-up table window exceeds the top of Vpin Studio (can't grab it to bring it down), but a workaround was to change your screen to portrait mode (from landscape), move the window down and then change the screen back.

The dialog is alway shown centered. So it is too big for your resolution and ends up partly outside the screen, right?

When I load Vpin Studio and click on Asset Manager, the window that pops up is already off screen at the top of my screen.  It looks like the attached.  I can barely see the change table icons at the top right and I'm forced to press Alt-F4 to close it to get back to the main dashboard.  I didn't have this issue with prior versions (prior to the last two updates).

Ok, that's indeed pretty annoying. Sorry for that. I have no idea what have caused this. Can you also attach a full screen screenshot or give me the resolution of your screen?

No worries.  Full screen shot attached.  My resolution is 1920 x 1080.

I think you have and addition scaling of 125% set. Usually the dialogs fit and are never larger than HD.
Anyway, it's a shortcoming on my side. I'll see what I can do to reduce the size of the dialogs.

You're exactly right.  Scaling is set at 125% per recommended in Widnows.   I can always push it down when I used Vpin Studio.

I fixed both dialogs so that they will fit for your resolution again. The only other dialog that has a larger size is the highscore card template designer. But that dialog and be resized and the size is stored, so there should be no issue.
The fixed dialogs will come with the next update.

Thank you.

Fixed with 2.16.0.
I also checked the preferences and fixed a bunch of issues (when used on smaller screens) there too.


text:
Genetic Algo example

Change log

Added genetic algorithm implementation in examples/genetic_algo_demo.py
Fixed the spelling mistake
Requirements & MAKEFILE added

Please review my pull request

Reminder.

Updated. Added test cases and created experiments directory.
need to integrate readthedocs and travis for documentation and running tests

looks good now

authors: Bazarovay syedmohsinbukhari

repo: syedmohsinbukhari/neat


text:
You are using Orange, but you have not set upstream servers for your project.

how to configure the upstream?

这个是提示你根据自己的需求，去配置 nginx upstream 。
涉及到业务逻辑的东西肯定不会写在默认配置文件的。
@cbcye

en, it's easy to add your own upstream servers after create a orange container by using
docker exec -it xxxx /bin/bash
vi /usr/local/orange/nginx.conf
This may not awesome, but I don't know any better way. PR is welcome.

or we could using include directive in nginx.conf file, the outer configuration file may be easy to add to a exist orange container like: docker run -v $OUT_CONF_DIR/:/usr/local/orange/upstream_conf

authors: cbcye syhily zhengxiaochuan-3

repo: syhily/docker-orange


text:
🛑 Concrete Connected is down

In 28f6816, Concrete Connected (https://concrete-connected.com/) was down:

HTTP code: 0
Response time: 0 ms

Resolved: Concrete Connected is back up in 36b65fe after 37 minutes.

repo: symapex/upsite


text:
🛑 Bring Back Clean is down

In 2adaa1b, Bring Back Clean (https://bringbackclean.com/) was down:

HTTP code: 0
Response time: 0 ms

Resolved: Bring Back Clean is back up in b722c5c after 45 minutes.


text:
🛑 Hard Stack Pro is down

In 8c0902c, Hard Stack Pro (https://hardstackpro.com/) was down:

HTTP code: 0
Response time: 0 ms

Resolved: Hard Stack Pro is back up in 79204fb after 36 minutes.


text:
🛑 Bricktically is down

In 3a48339, Bricktically (https://bricktically.com/) was down:

HTTP code: 0
Response time: 0 ms

Resolved: Bricktically is back up in de01654 after 19 minutes.


text:
🛑 Hard Stack Pro is down

In 61dc402, Hard Stack Pro (https://hardstackpro.com/) was down:

HTTP code: 0
Response time: 0 ms

Resolved: Hard Stack Pro is back up in cc692c8 after 40 minutes.


text:
🛑 Everlast Deck is down

In ecad79b, Everlast Deck (https://everlastdeck.com/) was down:

HTTP code: 0
Response time: 0 ms

Resolved: Everlast Deck is back up in eb323d3 after 3 hours, 7 minutes.


text:
🛑 Scrubble Carpet Cleaners is down

In b1ba0fb, Scrubble Carpet Cleaners (https://srubblecarpetcleaners.com/) was down:

HTTP code: 0
Response time: 0 ms

Resolved: Scrubble Carpet Cleaners is back up in ac26c87 after 10 minutes.


text:
🛑 Is Green Scene is down

In abe8a90, Is Green Scene (https://isgreen-scene.com/) was down:

HTTP code: 0
Response time: 0 ms

Resolved: Is Green Scene is back up in d21a4bc after 1 hour, 33 minutes.


text:
🛑 Cleanasium is down

In c3f6647, Cleanasium (https://cleanasium.com/) was down:

HTTP code: 0
Response time: 0 ms

Resolved: Cleanasium is back up in 1d6725b after 36 minutes.


text:
🛑 Pest Busters is down

In 47262ac, Pest Busters (https://pestbustersnc.com/) was down:

HTTP code: 0
Response time: 0 ms

Resolved: Pest Busters is back up in 1793ea1 after 11 minutes.


text:
🛑 Tidy Helpers CA is down

In cf0c1ce, Tidy Helpers CA (https://tidyhelpersca.com/) was down:

HTTP code: 0
Response time: 0 ms

Resolved: Tidy Helpers CA is back up in ab61304 after 43 minutes.


text:
🛑 Carpetomatic is down

In 0b2bc79, Carpetomatic (https://carpetomatic.com/) was down:

HTTP code: 0
Response time: 0 ms

Resolved: Carpetomatic is back up in 1c77e9a after 56 minutes.


text:
🛑 Precise Word AZ is down

In 4953b62, Precise Word AZ (https://precisewordaz.com/) was down:

HTTP code: 0
Response time: 0 ms

Resolved: Precise Word AZ is back up in b3fa145 after 52 minutes.


text:
🛑 Clean Wise is down

In 4875222, Clean Wise (https://cleanwisenv.com/) was down:

HTTP code: 0
Response time: 0 ms

Resolved: Clean Wise is back up in e7cadec after 48 minutes.


text:
🛑 Clean Kind is down

In d4ea992, Clean Kind (https://cleankindphx.com/) was down:

HTTP code: 0
Response time: 0 ms

Resolved: Clean Kind is back up in efd9dce after 10 minutes.


text:
🛑 Masonly Stockton is down

In 4ce5fb1, Masonly Stockton (https://masonlystockton.com/) was down:

HTTP code: 0
Response time: 0 ms

Resolved: Masonly Stockton is back up in 96b85b1.


text:
🛑 Precise Word AZ is down

In ce42460, Precise Word AZ (https://precisewordaz.com/) was down:

HTTP code: 0
Response time: 0 ms

Resolved: Precise Word AZ is back up in 32d16e9 after 20 minutes.


text:
🛑 Audio Key Kansas is down

In 3d799bb, Audio Key Kansas (https://audiokeykansas.com/) was down:

HTTP code: 0
Response time: 0 ms

Resolved: Audio Key Kansas is back up in c54bbc4.


text:
🛑 Bricktically is down

In ad1c692, Bricktically (https://bricktically.com/) was down:

HTTP code: 0
Response time: 0 ms

Resolved: Bricktically is back up in ddcb378 after 1 hour, 26 minutes.


text:
Fix lambdify heterogeneous

This also turns out in Lambdify.__call__ into kw-only argument (I think it is much more explicit, though technically this is a backward breaking change).

Thanks. I think having out as a kw-only argument is better.

authors: bjodah isuruf


text:
[LiveComponent] Allow disabling the error modal in production

Hello :wave:
Live components have a great error modal when something goes wrong on the server, however, it currently displays even in production, and I believe it's often not a wanted behaviour to display an error. I'm aware that it's possible to use the response:error event to stop the modal from rendering, but it would be great if we could do that globally (for all live components at once). Should it be a good idea to dispatch the error event on the window as well for that purpose ? It could then be easy to dispatch a toast each time an error occurs.
Another issue with the current handling of errors is that loading states are not removed, which means that, for example, a disabled submit button will stay disabled. This is explained in #1463. I believe this can be easily fixed by triggering the loading.state:finished event after handling the error. What do you all think ?
PS : The modal could use some accessibility improvements, I'm up for a PR

Hey @YummYume !
What a nice, complete bug report :)
I agree with your vision and i'd go even further: i believe we should not only "allow disabling"  but "force disable" when kernel.debug !==true
I'd probably split your ideas in 3 distinct PR

one handling the visibility/usage of the error modal depending on a configuration param ( = kernel.debug per default)
one related to event (but i do think this is already possible... but maybe not 😅 )
one related to fixing the loading states and stuff

This last one could even include some debug/log capacities depending on env too ?
So if you want to start one, two or the three, any help would be very welcomed and appreciated :)
And don't hesitate to start with minimal one / poc if you want and we can iterate from this !

Hi !
I agree that it should definitely not be present in production at all, and people should be "forced" to add their own error handling. At the very least, the modal shouldn't be present in production (and probably not tests either ?), and the component should still work, by simply removing the loaders and keeping the same state as before. It would maybe even be a good option to add a data-error, to show something only when an error occurs ? It could be an interesting idea.
I'll gladly start working on the third point you mentioned, which is to remove loading states (which is crucial in my opinion). By debug/log, you mean in the browser's console ? I'll also check to see if it's possible to catch the event globally, but I'm not sure since I think the events are not native JS events.

Nice!
And really, feel free to ask / poke / mail if you need any help, or want to chat about some work in progress stuff :)

Hi @smnandre !
I have been working on this data-error plugin as well as the proper clearing of loading state on error. It all works fine, and I'll make a PR soon after adding tests (and some documentation).
There's a catch, though. The attribute data-error seems so generic to me that it could be possible some people are already using it for other stuff, and it could technically break things on their end. Do you think there be a setting to allow changing the name of this attribute ?
I also changed the fact that, if you enter an error state but already have another request pending, then it executed as it should (it wasn't before), which pretty much instantly clears the error state, but honours the event hooks chain. Do you think this is a good thing ? I personally would expect pending requests to proceed, even if the current one failed.

Hey @YummYume! Thanks for your PR that's an excellent topic! But I think we should go a little further on this. Sorry, I am coming late.
You could need for example if your Component encounters an issue to display a completely different template for your component. For example, a text: Oups the loading of your avatar failed click on this button to reload the page, and a button to reload the page.
So I think we should give options to the developer to easily defined a different template if the component failed.
I have several solutions for this:

we can add to #[AsLiveComponent] [AsTwigComponent], a template_error key. So when the Component fails Symfony renders this template error.
I don't really like this solution because I wanted that to be easily done by a front-end developer.
we can reuse the template component but with a error variable, so the front end developper can use this variable to detect the error and display what we want
or we can just say every template inside /components/_errors/component_name.html.twig is the template that we use to render the error
But I am not sure as well, since this add more convention.
Tell me WDYT?
I think actually what I am talking here can be done in addition to your! I just want to start the discussion with you since you already start working on the PR.

@WebMamba this is a parralel question i think.
Here we're talking about cases where we get a 400/500 error (server down, page not found...) so this is the "JS" handling.
To implement your ideas, i think we would have to improve back-end error catching/handling.
(but i'm not sure we should do something that complex... i mean symfony framework has only one error page per default..)
So i suggest:
1/ we work on this one
2/ we work on the back-end one / your ideas
3/ we see how to link/mix both  (handling then 404 with JSON responses)
WDYT ?

Oh i just realized @WebMamba you may not have seen the related PR (i had the impression i was answering your comment on it)
https://github.com/symfony/ux/pull/1916

Hi ! Thanks for the great suggestions.
@WebMamba I actually thought of this before. I'm personally in favour of having an error template for components, but I'm also not too familiar with the current error catching that is done on (live) components on the server side... So perhaps it should be the first priority, as @smnandre said.
When using JS frameworks, it's very common to have "error" templates, whether it'd be in your routing or in a component. So I think it's a great idea in the future, because as much as we want to avoid them, 500 errors will always occur.
My current idea (and implementation) is just to have a simple JS attribute to, at the very least, display a potential error message to the user, to have the component still work (by clearing loading states) and to disable the current error modal by default in production (I don't think anyone wants that).

still relevant

authors: RafaelKr WebMamba YummYume smnandre

repo: symfony/ux


text:
[ux-components] on load page trigger event add ?

Hi, I've tried many different solutions for this issue link to discussion.
It seems that while the controller.js is being loaded (as confirmed by the console log), the "event" isn't being triggered when the page loads.
I'm stuck at this point and wondering if it's the same issue. Any insights?

It seems that I’ve found a solution, though I’m not sure if it’s the best approach since I haven’t seen this documented anywhere 👍
<div {{ stimulus_controller('@xorgxx/neox-dashboard-bundle/neox-modal') }}>
    <button data-action="click->xorgxx--neox-dashboard-bundle--neox-modal#modal">Open Modal</button>
</div>

To declare the controller, use {{ stimulus_controller('@xorgxx/neox-dashboard-bundle/neox-modal') }},
but for the data-action, use "click->xorgxx--neox-dashboard-bundle--neox-modal#modal".
i find this strange no ?

!!!! It might be worth considering modifying the page /create_ux_bundle.html to clearly highlight that the link
<div {{ stimulus_controller('@xorgxx/neox-dashboard-bundle/neox-modal') }}>
    <button data-action="click->xorgxx--neox-dashboard-bundle--neox-modal#modal">Open Modal</button>
</div>

stimulus_controller('@xorgxx/neox-dashboard-bundle/neox-modal') is automatically handled and "transformed," whereas other instances like data-action="click->xorgxx--neox-dashboard-bundle--neox-modal#modal" you need to be set up manually.

You can use stimulus_action() if you want the same behaviour than stimulus_controller.

authors: smnandre xorgxx


text:
[StimulusBundle] add togglePassword component to official packages list

Q
A

Bug fix?
no

New feature?
no

Tickets
N/A

License
MIT

TogglePassword component has been released with v2.11.0 so we can now add it to the official UX packages list 😃

Thank you Félix!

authors: feymo weaverryan


text:
Migrate off of Whitesource's Maven plugin

Whitesource have announced that they'll be EOLing their Maven plugin on May 1st 2019, so we need to move off of it.
Note: this is awaiting guidance from FINOS.

FINOS guidance now available.

Partially fixed in 4e82b371617366e9afd5e321bd944320e72f8798.  Sent following email to help@finos.org:
G'day!

As described in step 2 of the WhiteSource for GitHub.com configuration instructions, can you please enable WhiteSource's repository scanning for symphonyoss/clj-symphony?

I've removed the previous WhiteSource Maven plugin based steps from the Travis CI configuration, and added the new WhiteSource configuration files, but please advise if there are additional steps required on my end.

Thanks in advance,
Peter

This has apparently been configured, although the whitesource bot is doing unexpected things in the PR it submitted, so it's hard to tell what's going on...

@maoo and I are still figuring out how to do this - see https://github.com/symphonyoss/clj-symphony/pull/15 for that conversation.

repo: symphonyoss/clj-symphony


text:
strictssl should not be hardcoded as disabled by default

https://github.com/symphonyoss/symphony-node-binding/blob/02c275edc5366ad24dbd3fca440f56484ffeebeb/lib/RequestModel.js#L33

This is true, and in fact is unnecessary after testing. Feel free to make a pull request, or I'll try to get to it when I have a moment.

@Ondoher  Still held up on CLA.  Hopefully soon I can do the PR.

authors: Ondoher bingenito

repo: symphonyoss/symphony-node-binding


text:
add Locarize System Menu(Win) & Toggle Tool Bar

Windowsで表示されるSystem Settingと
Tool-Barインストール後にメニュー表示される 「Toggle Tool Bar」の日本語化をしました。

Thanks!

authors: keijir syon

repo: syon/atom-japanese-menu


text:
This script not longer works

The following script which I obtained from my modeling textbook no longer works. The issue appears to be with te.plotWithLegend (rr, result)
The error message is:
line 66, in figureFromTimecourse
if m.colnames[0] != 'time':
AttributeError: 'numpy.ndarray' object has no attribute 'colnames'
Running:
[('tellurium', '2.0.12'),
('roadrunner', '1.4.24'),
('antimony', '2.9.4'),
('libsbml', '5.15.0'),
('libsedml', '402'),
('phrasedml', '1.0.8'),
('pySBOL', '2.2.0')]
import tellurium as te
import numpy as np
Coherent Type I Genetic Network, noise filter
cell = '''
$G2 -> P2; Vmax2P1^4/(Km1 + P1^4);
P2 -> $w;  k1P2;
$G3 -> P3; Vmax3P1^4P2^4/(Km1 + P1^4P2^4);
P3 -> $w;  k1P3;
Vmax2 = 1; Vmax3 = 1;
Km1 = 0.5; k1 = 0.1;
P1 = 0;    P2 = 0;    P3 = 0;

'''
rr = te.loadAntimonyModel(cell)
rr.getSteadyStateValues()
print rr.model.getFloatingSpeciesConcentrations()
Pulse width
Set to 1 for no effect
Set to 4 for full effect
width = 1
rr.P1 = 0.3
m1 = rr.simulate(0, 10, 100, ["time", "P1", "P3"])
rr.P1 = 0.7 # input stimulus
m2 = rr.simulate(10, 10 + width, 100, ["time", "P1", "P3"])
rr.P1 = 0.3
m3 = rr.simulate(10 + width, 40, 100, ["time", "P1", "P3"])
m = np.vstack((m1, m2))
result = np.vstack((m, m3))
te.plotWithLegend(rr, result)

Basically, when vstack is called, the colnames are striped off. colnames are used to check that the array you pass through is actually formatted correctly. I don't think we should remove this check btw, the original script is already problematic because it does not have any information on time and its scale passed to plot.

What's the best way to splice two simulations together and plot them with a legend? I used the above approach a lot but if it doesn't work anymore I need another way to do.

vstack or concatenate will work fine for splicing. For plotting, something like:
plt.plot(result[:,0], result[:,1:])
plt.legend(["P1","P3"])
plt.show()

will do. In this case, notice that you are manually specifying x value and y values.

I'd like a simpler way for novice users, slicing is a bit scary for many
biologists.
H
On Sun, Mar 18, 2018 at 1:01 PM Kiri Choi notifications@github.com wrote:

vstack or concatenate will work fine for splicing. For plotting, something
like:
plt.plot(result[:,0], result[:,1:])
plt.legend(["P1","P3"])
plt.show()
will do. In this case, notice that you are manually specifying x value and
y values.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/sys-bio/tellurium/issues/347#issuecomment-374039644,
or mute the thread
https://github.com/notifications/unsubscribe-auth/ABAZDqcA2uPR3BYeqIM_DOgxQNcsu9k1ks5tfr0IgaJpZM4SvT-q
.

If one does not wish to use events, I don't think there are good alternatives. TBH, array manipulation is the basic of numpy basics, so it might be something they have to go through unfortunately.

The other thing I noticed is that plotWithLegend is deprecated anyway,
along with plotArray.
Hence what I will do is addplotWithLegend (without the restriction) as part
of my own personal set of utilities (along with the others I've created)
which people can choose to download if need be. That way I can also
continue to use these methods in my textbook.
Herbert
On Sun, Mar 18, 2018 at 1:24 PM, Kiri Choi notifications@github.com wrote:

If one does not wish to use events, I don't think there are good
alternatives. TBH, array manipulation is the basic of numpy basics, so it
might be something they have to go through unfortunately.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/sys-bio/tellurium/issues/347#issuecomment-374042100,
or mute the thread
https://github.com/notifications/unsubscribe-auth/ABAZDgRqLgpRpBUz2eeYHaLpggH2snZyks5tfsKGgaJpZM4SvT-q
.

authors: hsauro kirichoi

repo: sys-bio/tellurium