text1
stringlengths 0
536k
| text2
stringlengths 0
536k
| label
int64 0
1
|
---|---|---|
<p dir="auto"><strong>Is this a request for help?</strong> (If yes, you should use our troubleshooting guide and community support channels, see <a href="http://kubernetes.io/docs/troubleshooting/" rel="nofollow">http://kubernetes.io/docs/troubleshooting/</a>.): No</p>
<p dir="auto"><strong>What keywords did you search in Kubernetes issues before filing this one?</strong> (If you have found any duplicates, you should instead reply there.): Everything 'ELB' for past few months</p>
<hr>
<p dir="auto"><strong>Is this a BUG REPORT or FEATURE REQUEST?</strong> (choose one): Bug report</p>
<p dir="auto"><strong>Kubernetes version</strong> (use <code class="notranslate">kubectl version</code>): 1.4.6</p>
<p dir="auto"><strong>Environment</strong>:</p>
<ul dir="auto">
<li><strong>Cloud provider or hardware configuration</strong>: AWS</li>
<li><strong>OS</strong> (e.g. from /etc/os-release): Jessie</li>
<li><strong>Kernel</strong> (e.g. <code class="notranslate">uname -a</code>): 4.4.26-k8s</li>
<li><strong>Install tools</strong>: kops 1.4.1</li>
<li><strong>Others</strong>:</li>
</ul>
<p dir="auto"><strong>What happened</strong>:</p>
<p dir="auto">My goal was to expose a k8s Service using an AWS ELB, using both HTTP and HTTPS. HTTPS should use an AWS cert, passing through both HTTP and HTTPS to an nginx container.</p>
<p dir="auto">Scenario A:</p>
<p dir="auto">With these three options set:<br>
service.beta.kubernetes.io/aws-load-balancer-ssl-cert: arn:aws:acm:xxxxxx<br>
service.beta.kubernetes.io/aws-load-balancer-ssl-ports: https<br>
service.beta.kubernetes.io/aws-load-balancer-backend-protocol: https</p>
<p dir="auto">The listeners created were:<br>
TCP/80 -> TCP/(nodeport for container's 80)<br>
HTTPS/443 -> HTTPS/(nodeport for container's 443), using AWS cert</p>
<p dir="auto">While this does move traffic on both 80 and 443, the source IP is lost on port 80. 443 works properly.</p>
<p dir="auto">Scenario B:</p>
<p dir="auto">Backend changed to http, otherwise the same:<br>
service.beta.kubernetes.io/aws-load-balancer-backend-protocol: http</p>
<p dir="auto">The listeners created this time were:<br>
HTTP/80 -> HTTP/(nodeport for container's 80)<br>
HTTPS/443 -> HTTP/(nodeport for container's 443), using AWS cert</p>
<p dir="auto">In this instance, 80 works properly, but 443 is completely broken as it's attempting to deliver HTTP traffic to the container over port 443.</p>
<p dir="auto"><strong>What you expected to happen</strong>:</p>
<p dir="auto">In scenario A (backend-protocol: https), I expected:<br>
HTTP/80 -> HTTP/(nodeport for container's 80) [or alternatively, -> HTTPS/(nodeport for 443)]<br>
HTTPS/443 -> HTTPS/(nodeport for container's 443)</p>
<p dir="auto">In short, I expected HTTP on 80, not TCP, which would enable proper L7 on both ports.</p>
<p dir="auto">In scenario B (backend-protocol: http), I expected:<br>
HTTP/80 -> HTTP/(nodeport for container's 80)<br>
HTTPS/443 -> HTTP/(nodeport for container's 80)</p>
<p dir="auto">Here I expected the backend HTTP to be directed to the NodePort that forwards to container's port 80 in both cases.</p>
<p dir="auto">In my mind, in the presence of aws-load-balancer-ssl-cert, k8s already assumes traffic should now be L7. I expect L7 (and the benefits of the X-Forwarded-* set of headers) to happen on both 80 and 443, not just 443.</p>
<p dir="auto">Further, I expect the Instance Protocol and the NodePort assigned to Instance Port to match, and not get HTTP traffic directed to a NodePort for HTTPS, or vice versa.</p>
<p dir="auto"><strong>How to reproduce it</strong> (as minimally and precisely as possible):<br>
I installed Kubernetes via Kops 1.4.1, targeting K8s 1.4.6. Then I built a simple nginx container (that exposes 80 + 443) and used the following Service definition:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="apiVersion: v1
kind: Service
metadata:
name: web
labels:
app: web
annotations:
service.beta.kubernetes.io/aws-load-balancer-ssl-cert: arn:aws:acm:xxxxxx
service.beta.kubernetes.io/aws-load-balancer-ssl-ports: https
service.beta.kubernetes.io/aws-load-balancer-backend-protocol: https
# or http
spec:
type: LoadBalancer
ports:
- name: http
port: 80
protocol: TCP
- name: https
port: 443
protocol: TCP
selector:
app: web"><pre class="notranslate"><code class="notranslate">apiVersion: v1
kind: Service
metadata:
name: web
labels:
app: web
annotations:
service.beta.kubernetes.io/aws-load-balancer-ssl-cert: arn:aws:acm:xxxxxx
service.beta.kubernetes.io/aws-load-balancer-ssl-ports: https
service.beta.kubernetes.io/aws-load-balancer-backend-protocol: https
# or http
spec:
type: LoadBalancer
ports:
- name: http
port: 80
protocol: TCP
- name: https
port: 443
protocol: TCP
selector:
app: web
</code></pre></div>
<p dir="auto"><strong>Anything else do we need to know</strong>:</p>
<p dir="auto">Ideally, I'd like backend-protocol of both http and https to be working, as we do run some sensitive services that require https. If only https worked, we'd accept the internal slowdown on less critical services.</p> | <p dir="auto"><strong>Is this a request for help?</strong> (If yes, you should use our troubleshooting guide and community support channels, see <a href="http://kubernetes.io/docs/troubleshooting/" rel="nofollow">http://kubernetes.io/docs/troubleshooting/</a>.): Yes</p>
<p dir="auto"><strong>What keywords did you search in Kubernetes issues before filing this one?</strong> (If you have found any duplicates, you should instead reply there.): elasticsearch</p>
<hr>
<p dir="auto"><strong>Is this a BUG REPORT or FEATURE REQUEST?</strong> (choose one): BUG REPORT</p>
<p dir="auto"><strong>Kubernetes version</strong> (use <code class="notranslate">kubectl version</code>): 1.4.6_coreos.0</p>
<p dir="auto"><strong>Environment</strong>:</p>
<ul dir="auto">
<li><strong>Cloud provider or hardware configuration</strong>: on premise, vCloud</li>
<li><strong>OS</strong> (e.g. from /etc/os-release): CoreOS alpha (1221.0.0)</li>
<li><strong>Kernel</strong> (e.g. <code class="notranslate">uname -a</code>): Linux f1 4.8.6-coreos <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="35192559" data-permission-text="Title is private" data-url="https://github.com/kubernetes/kubernetes/issues/1" data-hovercard-type="issue" data-hovercard-url="/kubernetes/kubernetes/issues/1/hovercard" href="https://github.com/kubernetes/kubernetes/issues/1">#1</a> SMP Thu Nov 3 04:43:35 UTC 2016 x86_64 Intel(R) Xeon(R) CPU E5-2660 v2 @ 2.20GHz GenuineIntel GNU/Linux</li>
<li><strong>Install tools</strong>: None. Default installation</li>
<li><strong>Others</strong>:</li>
</ul>
<p dir="auto"><strong>What happened</strong>:<br>
When I tried to install es-controller.yaml, The containers are created successfully and but terminated with the following error:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Exception in thread "main" java.lang.IllegalStateException: Unable to access 'path.data' (/data/kubernetes-logging)
Likely root cause: java.nio.file.AccessDeniedException: /data/kubernetes-logging
at sun.nio.fs.UnixException.translateToIOException(UnixException.java:84)
at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:102)
at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:107)
at sun.nio.fs.UnixFileSystemProvider.createDirectory(UnixFileSystemProvider.java:384)
at java.nio.file.Files.createDirectory(Files.java:674)
at java.nio.file.Files.createAndCheckIsDirectory(Files.java:781)
at java.nio.file.Files.createDirectories(Files.java:767)
at org.elasticsearch.bootstrap.Security.ensureDirectoryExists(Security.java:337)
at org.elasticsearch.bootstrap.Security.addPath(Security.java:314)
at org.elasticsearch.bootstrap.Security.addFilePermissions(Security.java:259)
at org.elasticsearch.bootstrap.Security.createPermissions(Security.java:212)
at org.elasticsearch.bootstrap.Security.configure(Security.java:118)
at org.elasticsearch.bootstrap.Bootstrap.setupSecurity(Bootstrap.java:212)
at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:183)
at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:286)
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:35)
Refer to the log for complete error details."><pre class="notranslate"><code class="notranslate">Exception in thread "main" java.lang.IllegalStateException: Unable to access 'path.data' (/data/kubernetes-logging)
Likely root cause: java.nio.file.AccessDeniedException: /data/kubernetes-logging
at sun.nio.fs.UnixException.translateToIOException(UnixException.java:84)
at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:102)
at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:107)
at sun.nio.fs.UnixFileSystemProvider.createDirectory(UnixFileSystemProvider.java:384)
at java.nio.file.Files.createDirectory(Files.java:674)
at java.nio.file.Files.createAndCheckIsDirectory(Files.java:781)
at java.nio.file.Files.createDirectories(Files.java:767)
at org.elasticsearch.bootstrap.Security.ensureDirectoryExists(Security.java:337)
at org.elasticsearch.bootstrap.Security.addPath(Security.java:314)
at org.elasticsearch.bootstrap.Security.addFilePermissions(Security.java:259)
at org.elasticsearch.bootstrap.Security.createPermissions(Security.java:212)
at org.elasticsearch.bootstrap.Security.configure(Security.java:118)
at org.elasticsearch.bootstrap.Bootstrap.setupSecurity(Bootstrap.java:212)
at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:183)
at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:286)
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:35)
Refer to the log for complete error details.
</code></pre></div>
<p dir="auto"><strong>What you expected to happen</strong>:<br>
The container runs successfully.</p>
<p dir="auto"><strong>How to reproduce it</strong> (as minimally and precisely as possible):<br>
in a running kube cluster, run</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="kubectl create -f cluster/addons/fluentd-elasticsearch/es-controller.yaml"><pre class="notranslate"><code class="notranslate">kubectl create -f cluster/addons/fluentd-elasticsearch/es-controller.yaml
</code></pre></div>
<p dir="auto">The pod will restart itself because of the error. The error message is in the container log.</p>
<p dir="auto"><strong>Anything else do we need to know</strong>:<br>
It seems that when container mount the volume /data, it mounted as root:root (755). However, elasticsearch is running under user elasticsearch. So it couldn't write the files under /data.<br>
After I run <code class="notranslate">chown elasticsearch:elasticsearch /data</code>, the container runs fine.</p>
<p dir="auto">/cc <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/crassirostris/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/crassirostris">@crassirostris</a></p> | 0 |
<p dir="auto"><strong>Symfony version(s) affected</strong>: 4.1.1</p>
<p dir="auto"><strong>Description</strong><br>
I'm working on a microservice that does not have a homepage, because we have this policy of prefixing our APIs with <code class="notranslate">/api</code>. I didn't configuration a homepage, and while in dev, I get a welcome page aimed at developers, in production, I get a 500 because this welcome page is displayed by throwing a <code class="notranslate">NoConfigurationException</code></p>
<p dir="auto">Here is what I believe is the configuration responsible for this:</p>
<p dir="auto"></p><div class="Box Box--condensed my-2">
<div class="Box-header f6">
<p class="mb-0 text-bold">
<a href="https://github.com/symfony/symfony/blob/adb137d5c1f5c2b0831b5135c0e171b46bac81ca/src/Symfony/Component/Routing/Matcher/Dumper/PhpMatcherDumper.php#L198">symfony/src/Symfony/Component/Routing/Matcher/Dumper/PhpMatcherDumper.php</a>
</p>
<p class="mb-0 color-fg-muted">
Line 198
in
<a data-pjax="true" class="commit-tease-sha" href="/symfony/symfony/commit/adb137d5c1f5c2b0831b5135c0e171b46bac81ca">adb137d</a>
</p>
</div>
<div itemprop="text" class="Box-body p-0 blob-wrapper blob-wrapper-embedded data">
<table class="highlight tab-size mb-0 js-file-line-container" data-tab-size="8" data-paste-markdown-skip="">
<tbody><tr class="border-0">
<td id="L198" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="198"></td>
<td id="LC198" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> <span class="pl-s1"><span class="pl-c1">$</span>code</span> .= "<span class="pl-s"> throw new Symfony\Component\Routing\Exception\NoConfigurationException();</span>\n"; </td>
</tr>
</tbody></table>
</div>
</div>
<p></p>
<p dir="auto"><strong>How to reproduce</strong></p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="cd /tmp
composer create-project symfony/skeleton
cd skeleton
sed -i 's/dev/prod/' .env
php -S 127.0.0.1:8000 -t public"><pre class="notranslate"><code class="notranslate">cd /tmp
composer create-project symfony/skeleton
cd skeleton
sed -i 's/dev/prod/' .env
php -S 127.0.0.1:8000 -t public
</code></pre></div>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="[Fri Jul 13 17:05:48 2018] PHP Fatal error: Uncaught Symfony\Component\Routing\Exception\NoConfigurationException in /tmp/skeleton/var/cache/prod/srcProdProjectContainerUrlMatcher.php:65
Stack trace:
#0 /tmp/skeleton/var/cache/prod/srcProdProjectContainerUrlMatcher.php(21): srcProdProjectContainerUrlMatcher->doMatch('/', Array, Array)
#1 /tmp/skeleton/vendor/symfony/routing/Matcher/UrlMatcher.php(107): srcProdProjectContainerUrlMatcher->match('/')
#2 /tmp/skeleton/vendor/symfony/routing/Router.php(262): Symfony\Component\Routing\Matcher\UrlMatcher->matchRequest(Object(Symfony\Component\HttpFoundation\Request))
#3 /tmp/skeleton/vendor/symfony/http-kernel/EventListener/RouterListener.php(115): Symfony\Component\Routing\Router->matchRequest(Object(Symfony\Component\HttpFoundation\Request))
#4 /tmp/skeleton/vendor/symfony/event-dispatcher/EventDispatcher.php(212): Symfony\Component\HttpKernel\EventListener\RouterListener->onKernelRequest(Object(Symfony\Component\HttpKernel\Event\GetResponseEvent), 'kernel.request', Object(Symfony\Component\EventDispatcher\ in /tmp/skeleton/vendor/symfony/http-kernel/EventListener/RouterListener.php on line 139
[Fri Jul 13 17:05:48 2018] 127.0.0.1:51332 [500]: / - Uncaught Symfony\Component\Routing\Exception\NoConfigurationException in /tmp/skeleton/var/cache/prod/srcProdProjectContainerUrlMatcher.php:65
Stack trace:
#0 /tmp/skeleton/var/cache/prod/srcProdProjectContainerUrlMatcher.php(21): srcProdProjectContainerUrlMatcher->doMatch('/', Array, Array)
#1 /tmp/skeleton/vendor/symfony/routing/Matcher/UrlMatcher.php(107): srcProdProjectContainerUrlMatcher->match('/')
#2 /tmp/skeleton/vendor/symfony/routing/Router.php(262): Symfony\Component\Routing\Matcher\UrlMatcher->matchRequest(Object(Symfony\Component\HttpFoundation\Request))
#3 /tmp/skeleton/vendor/symfony/http-kernel/EventListener/RouterListener.php(115): Symfony\Component\Routing\Router->matchRequest(Object(Symfony\Component\HttpFoundation\Request))
#4 /tmp/skeleton/vendor/symfony/event-dispatcher/EventDispatcher.php(212): Symfony\Component\HttpKernel\EventListener\RouterListener->onKernelRequest(Object(Symfony\Component\HttpKernel\Event\GetResponseEvent), 'kernel.request', Object(Symfony\Component\EventDispatcher\ in /tmp/skeleton/vendor/symfony/http-kernel/EventListener/RouterListener.php on line 139
[1] 7903 segmentation fault (core dumped) php -S 127.0.0.1:8000 -t public
"><pre lang="2018-07-13T15:05:48+00:00" class="notranslate"><code class="notranslate">[Fri Jul 13 17:05:48 2018] PHP Fatal error: Uncaught Symfony\Component\Routing\Exception\NoConfigurationException in /tmp/skeleton/var/cache/prod/srcProdProjectContainerUrlMatcher.php:65
Stack trace:
#0 /tmp/skeleton/var/cache/prod/srcProdProjectContainerUrlMatcher.php(21): srcProdProjectContainerUrlMatcher->doMatch('/', Array, Array)
#1 /tmp/skeleton/vendor/symfony/routing/Matcher/UrlMatcher.php(107): srcProdProjectContainerUrlMatcher->match('/')
#2 /tmp/skeleton/vendor/symfony/routing/Router.php(262): Symfony\Component\Routing\Matcher\UrlMatcher->matchRequest(Object(Symfony\Component\HttpFoundation\Request))
#3 /tmp/skeleton/vendor/symfony/http-kernel/EventListener/RouterListener.php(115): Symfony\Component\Routing\Router->matchRequest(Object(Symfony\Component\HttpFoundation\Request))
#4 /tmp/skeleton/vendor/symfony/event-dispatcher/EventDispatcher.php(212): Symfony\Component\HttpKernel\EventListener\RouterListener->onKernelRequest(Object(Symfony\Component\HttpKernel\Event\GetResponseEvent), 'kernel.request', Object(Symfony\Component\EventDispatcher\ in /tmp/skeleton/vendor/symfony/http-kernel/EventListener/RouterListener.php on line 139
[Fri Jul 13 17:05:48 2018] 127.0.0.1:51332 [500]: / - Uncaught Symfony\Component\Routing\Exception\NoConfigurationException in /tmp/skeleton/var/cache/prod/srcProdProjectContainerUrlMatcher.php:65
Stack trace:
#0 /tmp/skeleton/var/cache/prod/srcProdProjectContainerUrlMatcher.php(21): srcProdProjectContainerUrlMatcher->doMatch('/', Array, Array)
#1 /tmp/skeleton/vendor/symfony/routing/Matcher/UrlMatcher.php(107): srcProdProjectContainerUrlMatcher->match('/')
#2 /tmp/skeleton/vendor/symfony/routing/Router.php(262): Symfony\Component\Routing\Matcher\UrlMatcher->matchRequest(Object(Symfony\Component\HttpFoundation\Request))
#3 /tmp/skeleton/vendor/symfony/http-kernel/EventListener/RouterListener.php(115): Symfony\Component\Routing\Router->matchRequest(Object(Symfony\Component\HttpFoundation\Request))
#4 /tmp/skeleton/vendor/symfony/event-dispatcher/EventDispatcher.php(212): Symfony\Component\HttpKernel\EventListener\RouterListener->onKernelRequest(Object(Symfony\Component\HttpKernel\Event\GetResponseEvent), 'kernel.request', Object(Symfony\Component\EventDispatcher\ in /tmp/skeleton/vendor/symfony/http-kernel/EventListener/RouterListener.php on line 139
[1] 7903 segmentation fault (core dumped) php -S 127.0.0.1:8000 -t public
</code></pre></div>
<p dir="auto"><strong>Possible Solution</strong><br>
Catch the exception somehwere?</p> | <table role="table">
<thead>
<tr>
<th>Q</th>
<th>A</th>
</tr>
</thead>
<tbody>
<tr>
<td>Bug report?</td>
<td>no</td>
</tr>
<tr>
<td>Feature request?</td>
<td>yes</td>
</tr>
<tr>
<td>BC Break report?</td>
<td>no</td>
</tr>
<tr>
<td>RFC?</td>
<td>no</td>
</tr>
</tbody>
</table>
<h2 dir="auto">Steps to reproduce:</h2>
<p dir="auto">Create a project:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="composer create-project symfony/skeleton symfony-skeleton"><pre class="notranslate"><code class="notranslate">composer create-project symfony/skeleton symfony-skeleton
</code></pre></div>
<p dir="auto">Set the app environment to prod:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="sed -i -e 's/APP_ENV=dev/APP_ENV=prod/g' .env"><pre class="notranslate"><code class="notranslate">sed -i -e 's/APP_ENV=dev/APP_ENV=prod/g' .env
</code></pre></div>
<p dir="auto">This can be shown also with setting the APP_ENV environment variable.</p>
<p dir="auto">Add a <a href="https://symfony.com/doc/current/page_creation.html" rel="nofollow">simple controller and a route</a>.</p>
<p dir="auto">Add an <code class="notranslate">.htaccess</code> file in /public as follows (we use Apache):</p>
<div class="highlight highlight-source-apache-config notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="<IfModule mod_rewrite.c>
Options -MultiViews
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php [QSA,L]
</IfModule>"><pre class="notranslate"><<span class="pl-ent">IfModule</span> mod_rewrite.c>
<span class="pl-c1">Options</span> -MultiViews
<span class="pl-c1">RewriteEngine</span> On
<span class="pl-c1">RewriteCond</span> <span class="pl-c1">%{REQUEST_FILENAME}</span> <span class="pl-s">!-f</span>
<span class="pl-c1">RewriteRule</span> <span class="pl-sr">^(.*)$</span> <span class="pl-s">index.php</span> <span class="pl-sr">[QSA,L]</span>
</<span class="pl-ent">IfModule</span>></pre></div>
<p dir="auto">Try to get "/foo". In the prod environment, ResourceNotFoundException is not caught or converted to a 404:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="2018-01-18T15:53:46-05:00 [critical] Uncaught Exception: No route found for "GET
/foo" [Thu Jan 18 15:53:46.592760 2018] [php7:notice] [pid 66514] [client
::1:58156] PHP Fatal error: Uncaught
Symfony\\Component\\Routing\\Exception\\ResourceNotFoundException in
var/cache/prod/srcProdProjectContainerUrlMatcher.php:38\nStack trace:\n#0
vendor/symfony/routing/Matcher/UrlMatcher.php(95):
srcProdProjectContainerUrlMatcher->match('/foo')\n#1
vendor/symfony/routing/Router.php(262): Symfony\\Component\\Routing\\Matcher\\Ur
lMatcher->matchRequest(Object(Symfony\\Component\\HttpFoundation\\Request))\n#2
vendor/symfony/http-kernel/EventListener/RouterListener.php(109): Symfony\\Compo
nent\\Routing\\Router->matchRequest(Object(Symfony\\Component\\HttpFoundation\\R
equest))\n#3 vendor/symfony/event-dispatcher/EventDispatcher.php(212): Symfony\\
Component\\HttpKernel\\EventListener\\RouterListener->onKernelRequest(Object(Sym
fony\\Component\\HttpKernel\\Event\\GetResponseEvent), 'kernel.request',
Object(Symfony\\Component\\EventDispatcher\\EventDispatcher))\n#4 /Users/cjm/Si
in vendor/symfony/http-kernel/EventListener/RouterListener.php on line 139"><pre class="notranslate"><code class="notranslate">2018-01-18T15:53:46-05:00 [critical] Uncaught Exception: No route found for "GET
/foo" [Thu Jan 18 15:53:46.592760 2018] [php7:notice] [pid 66514] [client
::1:58156] PHP Fatal error: Uncaught
Symfony\\Component\\Routing\\Exception\\ResourceNotFoundException in
var/cache/prod/srcProdProjectContainerUrlMatcher.php:38\nStack trace:\n#0
vendor/symfony/routing/Matcher/UrlMatcher.php(95):
srcProdProjectContainerUrlMatcher->match('/foo')\n#1
vendor/symfony/routing/Router.php(262): Symfony\\Component\\Routing\\Matcher\\Ur
lMatcher->matchRequest(Object(Symfony\\Component\\HttpFoundation\\Request))\n#2
vendor/symfony/http-kernel/EventListener/RouterListener.php(109): Symfony\\Compo
nent\\Routing\\Router->matchRequest(Object(Symfony\\Component\\HttpFoundation\\R
equest))\n#3 vendor/symfony/event-dispatcher/EventDispatcher.php(212): Symfony\\
Component\\HttpKernel\\EventListener\\RouterListener->onKernelRequest(Object(Sym
fony\\Component\\HttpKernel\\Event\\GetResponseEvent), 'kernel.request',
Object(Symfony\\Component\\EventDispatcher\\EventDispatcher))\n#4 /Users/cjm/Si
in vendor/symfony/http-kernel/EventListener/RouterListener.php on line 139
</code></pre></div> | 1 |
<p dir="auto">Upon clicking open files using the scroll wheel, instead of closing, a scroll symbol appears.</p>
<p dir="auto">This is the expected behaviour in Chrome:<br>
<a target="_blank" rel="noopener noreferrer nofollow" href="https://cloud.githubusercontent.com/assets/1297882/13435641/900f3f56-dfdb-11e5-80bc-a83fc1a2d7f8.gif"><img src="https://cloud.githubusercontent.com/assets/1297882/13435641/900f3f56-dfdb-11e5-80bc-a83fc1a2d7f8.gif" alt="chrome" data-animated-image="" style="max-width: 100%;"></a></p>
<p dir="auto">This is the resulting behaviour in VSCode:<br>
<a target="_blank" rel="noopener noreferrer nofollow" href="https://cloud.githubusercontent.com/assets/1297882/13435699/d718cc96-dfdb-11e5-888c-9322a309da81.gif"><img src="https://cloud.githubusercontent.com/assets/1297882/13435699/d718cc96-dfdb-11e5-888c-9322a309da81.gif" alt="working_files" data-animated-image="" style="max-width: 100%;"></a></p>
<p dir="auto">This works in VSCode on OS X.</p> | <p dir="auto">Forgive if this is already submitted but I couldn't find a similar ticket when I searched the issues. I love the Git integration in VSCode but what do you think about add filters to the Git Sidebar? My thought is that you have toggle buttons for different Git Statues (Added, Modified, Deleted, Confict) and then an input field that allows you to filter the list. This would make large amounts of changes such as those in a merge conflict so much easier to deal with it and finding the right file.</p> | 0 |
<p dir="auto">Hi,</p>
<p dir="auto">i am new to node packages and i am trying to build the packages and i spent my whole day to find out what might be the issue but i am unable to sort it out. below is my <code class="notranslate">package.json</code> file</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="{
"private": true,
"scripts": {
"dev": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js",
"watch": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --watch --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js",
"production": "cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js",
"production-noprogress": "cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js"
},
"dependencies": {
"@babel/core": "^7.12.10",
"@ungap/url-search-params": "^0.1.2",
"@vimeo/player": "^2.0.1",
"axios": "^0.21.1",
"babel-plugin-syntax-dynamic-import": "^6.18.0",
"babel-polyfill": "^6.26.0",
"babel-preset-es2015": "^6.24.1",
"bootstrap": "^4.1.1",
"bootstrap-daterangepicker": "2.1.27",
"bootstrap-sass": "^3.3.7",
"bootstrap-select": "^1.13.8",
"bugsnag-sourcemap-webpack-plugin": "^0.9.7",
"countup.js": "^1.9.3",
"cross-env": "^3.2.3",
"css-loader": "^0.28.11",
"dotenv": "^5.0.1",
"eonasdan-bootstrap-datetimepicker": "^4.17.47",
"font-awesome": "^4.7.0",
"img-loader": "^2.0.0",
"intl-tel-input": "^12.1.10",
"jquery": "^3.3.1",
"jquery-toast-plugin": "^1.3.2",
"js-cookie": "^2.1.0",
"laravel-mix": "2.1.14",
"metismenu": "^2.7.8",
"modernizr": "^3.6.0",
"moment": "^2.17.1",
"moment-timezone": "^0.4.0",
"normalize.css": "^8.0.1",
"nouislider": "^10.0.0",
"numeral": "^2.0.6",
"object.entries": "^1.0.4",
"outdated-browser-rework": "^2.9.0",
"pace-progress": "^1.0.2",
"perfect-scrollbar": "0.8.1",
"popper.js": "^1.14.3",
"promise": "^7.1.1",
"scrollreveal": "3.4.0",
"slick-carousel": "1.6.0",
"sweetalert2": "^7.24.4",
"trix": "^1.0.0",
"ua-parser-js": "^0.7.20",
"underscore": "^1.8.3",
"urijs": "^1.17.0",
"v-img": "^0.2.0",
"vee-validate": "^2.1.0-beta.2",
"vue": "^2.2.4",
"vue-flatpickr-component": "^8.0.0",
"vue-infinite-scroll": "^2.0.0",
"vue-l-carousel": "^1.0.1",
"vue-loader": "^11.1.4",
"vue-multiselect": "^2.1.0",
"vue-template-compiler": "^2.2.4",
"vuex": "^3.0.1",
"weakmap-polyfill": "^2.0.0"
},
"devDependencies": {
"@babel/preset-env": "^7.12.11",
"babel-core": "^6.26.3",
"babel-loader": "^8.2.2",
"less": "^3.0.1",
"less-loader": "^4.1.0"
}
}
"><pre class="notranslate"><code class="notranslate">{
"private": true,
"scripts": {
"dev": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js",
"watch": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --watch --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js",
"production": "cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js",
"production-noprogress": "cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js"
},
"dependencies": {
"@babel/core": "^7.12.10",
"@ungap/url-search-params": "^0.1.2",
"@vimeo/player": "^2.0.1",
"axios": "^0.21.1",
"babel-plugin-syntax-dynamic-import": "^6.18.0",
"babel-polyfill": "^6.26.0",
"babel-preset-es2015": "^6.24.1",
"bootstrap": "^4.1.1",
"bootstrap-daterangepicker": "2.1.27",
"bootstrap-sass": "^3.3.7",
"bootstrap-select": "^1.13.8",
"bugsnag-sourcemap-webpack-plugin": "^0.9.7",
"countup.js": "^1.9.3",
"cross-env": "^3.2.3",
"css-loader": "^0.28.11",
"dotenv": "^5.0.1",
"eonasdan-bootstrap-datetimepicker": "^4.17.47",
"font-awesome": "^4.7.0",
"img-loader": "^2.0.0",
"intl-tel-input": "^12.1.10",
"jquery": "^3.3.1",
"jquery-toast-plugin": "^1.3.2",
"js-cookie": "^2.1.0",
"laravel-mix": "2.1.14",
"metismenu": "^2.7.8",
"modernizr": "^3.6.0",
"moment": "^2.17.1",
"moment-timezone": "^0.4.0",
"normalize.css": "^8.0.1",
"nouislider": "^10.0.0",
"numeral": "^2.0.6",
"object.entries": "^1.0.4",
"outdated-browser-rework": "^2.9.0",
"pace-progress": "^1.0.2",
"perfect-scrollbar": "0.8.1",
"popper.js": "^1.14.3",
"promise": "^7.1.1",
"scrollreveal": "3.4.0",
"slick-carousel": "1.6.0",
"sweetalert2": "^7.24.4",
"trix": "^1.0.0",
"ua-parser-js": "^0.7.20",
"underscore": "^1.8.3",
"urijs": "^1.17.0",
"v-img": "^0.2.0",
"vee-validate": "^2.1.0-beta.2",
"vue": "^2.2.4",
"vue-flatpickr-component": "^8.0.0",
"vue-infinite-scroll": "^2.0.0",
"vue-l-carousel": "^1.0.1",
"vue-loader": "^11.1.4",
"vue-multiselect": "^2.1.0",
"vue-template-compiler": "^2.2.4",
"vuex": "^3.0.1",
"weakmap-polyfill": "^2.0.0"
},
"devDependencies": {
"@babel/preset-env": "^7.12.11",
"babel-core": "^6.26.3",
"babel-loader": "^8.2.2",
"less": "^3.0.1",
"less-loader": "^4.1.0"
}
}
</code></pre></div> | <h3 dir="auto"><g-emoji class="g-emoji" alias="computer" fallback-src="https://github.githubassets.com/images/icons/emoji/unicode/1f4bb.png">💻</g-emoji></h3>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> Would you like to work on a fix?</li>
</ul>
<h3 dir="auto">How are you using Babel?</h3>
<p dir="auto">Programmatic API (<code class="notranslate">babel.transform</code>, <code class="notranslate">babel.parse</code>)</p>
<h3 dir="auto">Input code</h3>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="fn(class WorkerClient {
static #worker_threads() {
return WorkerClient;
}
});"><pre class="notranslate"><span class="pl-en">fn</span><span class="pl-kos">(</span><span class="pl-k">class</span> <span class="pl-v">WorkerClient</span> <span class="pl-kos">{</span>
<span class="pl-k">static</span> #<span class="pl-en">worker_threads</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
<span class="pl-k">return</span> <span class="pl-v">WorkerClient</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span>
<span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">;</span></pre></div>
<p dir="auto"><a href="https://babeljs.io/repl#?browsers=chrome%2060&build=&builtIns=false&corejs=false&spec=false&loose=false&code_lz=GYOwFAxgNghgznABAdQPYCcDWBTdBhKAS2xABdEBvAKEUTlJlMIkQGIB3DHdAfVIAt02GABM4YAJSUatRENIBXdCBRdcBYmQDcMgL5VdErUA&debug=false&forceAllTransforms=false&shippedProposals=false&circleciRepo=&evaluate=true&fileSize=false&timeTravel=false&sourceType=script&lineWrap=true&presets=env&prettier=false&targets=&version=7.14.4" rel="nofollow">REPL</a></p>
<h3 dir="auto">Configuration file name</h3>
<p dir="auto"><em>No response</em></p>
<h3 dir="auto">Configuration</h3>
<div class="highlight highlight-source-json notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="{
"plugins": [
"@babel/plugin-proposal-private-methods",
"@babel/plugin-proposal-class-properties"
]
}"><pre class="notranslate">{
<span class="pl-ent">"plugins"</span>: [
<span class="pl-s"><span class="pl-pds">"</span>@babel/plugin-proposal-private-methods<span class="pl-pds">"</span></span>,
<span class="pl-s"><span class="pl-pds">"</span>@babel/plugin-proposal-class-properties<span class="pl-pds">"</span></span>
]
}</pre></div>
<h3 dir="auto">Current and expected behavior</h3>
<p dir="auto">It is compiled to this:</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="var _class;
fn(_class = class WorkerClient {});
function _worker_threads() {
return WorkerClient;
}"><pre class="notranslate"><span class="pl-k">var</span> <span class="pl-s1">_class</span><span class="pl-kos">;</span>
<span class="pl-en">fn</span><span class="pl-kos">(</span><span class="pl-s1">_class</span> <span class="pl-c1">=</span> <span class="pl-k">class</span> <span class="pl-v">WorkerClient</span> <span class="pl-kos">{</span><span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-k">function</span> <span class="pl-en">_worker_threads</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
<span class="pl-k">return</span> <span class="pl-v">WorkerClient</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span></pre></div>
<p dir="auto">As you can see, <code class="notranslate">WorkerClient</code> is not reachable. It should be compiled to something like this:</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="var _class;
fn(_class = class WorkerClient {});
function _worker_threads() {
return _class;
}"><pre class="notranslate"><span class="pl-k">var</span> <span class="pl-s1">_class</span><span class="pl-kos">;</span>
<span class="pl-en">fn</span><span class="pl-kos">(</span><span class="pl-s1">_class</span> <span class="pl-c1">=</span> <span class="pl-k">class</span> <span class="pl-v">WorkerClient</span> <span class="pl-kos">{</span><span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-k">function</span> <span class="pl-en">_worker_threads</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
<span class="pl-k">return</span> <span class="pl-s1">_class</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span></pre></div>
<h3 dir="auto">Environment</h3>
<ul dir="auto">
<li>Babel 7.14.4</li>
</ul>
<h3 dir="auto">Possible solution</h3>
<p dir="auto">In the <code class="notranslate">replaceThisContext</code> function that we use to replace <code class="notranslate">this</code> usage in class fields and private methods:<br>
</p><div class="Box Box--condensed my-2">
<div class="Box-header f6">
<p class="mb-0 text-bold">
<a href="https://github.com/babel/babel/blob/813f2a3cce04a5366de7c1cc370652db64507305/packages/babel-helper-create-class-features-plugin/src/fields.ts#L672">babel/packages/babel-helper-create-class-features-plugin/src/fields.ts</a>
</p>
<p class="mb-0 color-fg-muted">
Line 672
in
<a data-pjax="true" class="commit-tease-sha" href="/babel/babel/commit/813f2a3cce04a5366de7c1cc370652db64507305">813f2a3</a>
</p>
</div>
<div itemprop="text" class="Box-body p-0 blob-wrapper blob-wrapper-embedded data">
<table class="highlight tab-size mb-0 js-file-line-container" data-tab-size="8" data-paste-markdown-skip="">
<tbody><tr class="border-0">
<td id="L672" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="672"></td>
<td id="LC672" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> <span class="pl-k">function</span> <span class="pl-en">replaceThisContext</span><span class="pl-kos">(</span> </td>
</tr>
</tbody></table>
</div>
</div>
<p></p>
<p dir="auto">we should add a new <code class="notranslate">path.traverse</code> call to replace references to the inner binding, with a visitor similar to this one:</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="const innerReferencesVisitor = {
ReferencedIdentifier(path, state) {
const { name } = path.node;
if (path.scope.bindingIdentifierEquals(name, state.innerBinding)) {
state.needsClassRef = true;
path.replaceWith(t.cloneNode(state.classRef));
}
},
};"><pre class="notranslate"><span class="pl-k">const</span> <span class="pl-s1">innerReferencesVisitor</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span>
<span class="pl-en">ReferencedIdentifier</span><span class="pl-kos">(</span><span class="pl-s1">path</span><span class="pl-kos">,</span> <span class="pl-s1">state</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
<span class="pl-k">const</span> <span class="pl-kos">{</span> name <span class="pl-kos">}</span> <span class="pl-c1">=</span> <span class="pl-s1">path</span><span class="pl-kos">.</span><span class="pl-c1">node</span><span class="pl-kos">;</span>
<span class="pl-k">if</span> <span class="pl-kos">(</span><span class="pl-s1">path</span><span class="pl-kos">.</span><span class="pl-c1">scope</span><span class="pl-kos">.</span><span class="pl-en">bindingIdentifierEquals</span><span class="pl-kos">(</span><span class="pl-s1">name</span><span class="pl-kos">,</span> <span class="pl-s1">state</span><span class="pl-kos">.</span><span class="pl-c1">innerBinding</span><span class="pl-kos">)</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
<span class="pl-s1">state</span><span class="pl-kos">.</span><span class="pl-c1">needsClassRef</span> <span class="pl-c1">=</span> <span class="pl-c1">true</span><span class="pl-kos">;</span>
<span class="pl-s1">path</span><span class="pl-kos">.</span><span class="pl-en">replaceWith</span><span class="pl-kos">(</span><span class="pl-s1">t</span><span class="pl-kos">.</span><span class="pl-en">cloneNode</span><span class="pl-kos">(</span><span class="pl-s1">state</span><span class="pl-kos">.</span><span class="pl-c1">classRef</span><span class="pl-kos">)</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span>
<span class="pl-kos">}</span><span class="pl-kos">,</span>
<span class="pl-kos">}</span><span class="pl-kos">;</span></pre></div>
<p dir="auto">where <code class="notranslate">state</code> is the one used by <code class="notranslate">thisContextVisitor</code> with the addition of <code class="notranslate">state.innerBinding</code>, which is the node representing the id of the class expression.</p>
<p dir="auto">Note that we don't need to merge this visitor with <code class="notranslate">environmentVisitor</code>: <code class="notranslate">environmentVisitor</code> is only needed to avoid replacing nested <code class="notranslate">this</code>es that don't refer to the class, while for normal bindings we use <code class="notranslate">path.scope.bindingIdentifierEquals</code>.</p>
<p dir="auto">We can get <code class="notranslate">innerBinding</code> from right before extracting the class reference at </p><div class="Box Box--condensed my-2">
<div class="Box-header f6">
<p class="mb-0 text-bold">
<a href="https://github.com/babel/babel/blob/813f2a3cce04a5366de7c1cc370652db64507305/packages/babel-helper-create-class-features-plugin/src/index.ts#L173-L178">babel/packages/babel-helper-create-class-features-plugin/src/index.ts</a>
</p>
<p class="mb-0 color-fg-muted">
Lines 173 to 178
in
<a data-pjax="true" class="commit-tease-sha" href="/babel/babel/commit/813f2a3cce04a5366de7c1cc370652db64507305">813f2a3</a>
</p>
</div>
<div itemprop="text" class="Box-body p-0 blob-wrapper blob-wrapper-embedded data">
<table class="highlight tab-size mb-0 js-file-line-container" data-tab-size="8" data-paste-markdown-skip="">
<tbody><tr class="border-0">
<td id="L173" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="173"></td>
<td id="LC173" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> <span class="pl-k">if</span> <span class="pl-kos">(</span><span class="pl-s1">path</span><span class="pl-kos">.</span><span class="pl-en">isClassExpression</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-c1">||</span> <span class="pl-c1">!</span><span class="pl-s1">path</span><span class="pl-kos">.</span><span class="pl-c1">node</span><span class="pl-kos">.</span><span class="pl-c1">id</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> </td>
</tr>
<tr class="border-0">
<td id="L174" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="174"></td>
<td id="LC174" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> <span class="pl-en">nameFunction</span><span class="pl-kos">(</span><span class="pl-s1">path</span><span class="pl-kos">)</span><span class="pl-kos">;</span> </td>
</tr>
<tr class="border-0">
<td id="L175" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="175"></td>
<td id="LC175" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> <span class="pl-s1">ref</span> <span class="pl-c1">=</span> <span class="pl-s1">path</span><span class="pl-kos">.</span><span class="pl-c1">scope</span><span class="pl-kos">.</span><span class="pl-en">generateUidIdentifier</span><span class="pl-kos">(</span><span class="pl-s">"class"</span><span class="pl-kos">)</span><span class="pl-kos">;</span> </td>
</tr>
<tr class="border-0">
<td id="L176" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="176"></td>
<td id="LC176" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> <span class="pl-kos">}</span> <span class="pl-k">else</span> <span class="pl-kos">{</span> </td>
</tr>
<tr class="border-0">
<td id="L177" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="177"></td>
<td id="LC177" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> <span class="pl-s1">ref</span> <span class="pl-c1">=</span> <span class="pl-s1">t</span><span class="pl-kos">.</span><span class="pl-en">cloneNode</span><span class="pl-kos">(</span><span class="pl-s1">path</span><span class="pl-kos">.</span><span class="pl-c1">node</span><span class="pl-kos">.</span><span class="pl-c1">id</span><span class="pl-kos">)</span><span class="pl-kos">;</span> </td>
</tr>
<tr class="border-0">
<td id="L178" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="178"></td>
<td id="LC178" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> <span class="pl-kos">}</span> </td>
</tr>
</tbody></table>
</div>
</div>
<p></p>
<p dir="auto">We only need to get it if we have a <code class="notranslate">ClassExpression</code> and <code class="notranslate">path.node.id</code> is set, otherwise we can leave <code class="notranslate">innerBinding</code> as <code class="notranslate">undefined</code> and use it as a "signal" to skip the new <code class="notranslate">path.traverse</code> call.</p>
<p dir="auto">After working on the fix itself, we'll need a bunch of tests:</p>
<ul dir="auto">
<li>A simple <code class="notranslate">input.js</code>/<code class="notranslate">output.js</code> test, for example my original example</li>
<li>An <code class="notranslate">exec.js</code> test, to check that the binding is the correct one. For example:
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="let x = class Test {
static #getTest() { return Test }
static getTest() { return this.getTest() }
};
expect(x.getTest()).toBe(x);"><pre class="notranslate"><span class="pl-k">let</span> <span class="pl-s1">x</span> <span class="pl-c1">=</span> <span class="pl-k">class</span> <span class="pl-v">Test</span> <span class="pl-kos">{</span>
<span class="pl-k">static</span> #<span class="pl-en">getTest</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> <span class="pl-k">return</span> <span class="pl-v">Test</span> <span class="pl-kos">}</span>
<span class="pl-k">static</span> <span class="pl-en">getTest</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> <span class="pl-k">return</span> <span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-en">getTest</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">}</span>
<span class="pl-kos">}</span><span class="pl-kos">;</span>
<span class="pl-en">expect</span><span class="pl-kos">(</span><span class="pl-s1">x</span><span class="pl-kos">.</span><span class="pl-en">getTest</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-en">toBe</span><span class="pl-kos">(</span><span class="pl-s1">x</span><span class="pl-kos">)</span><span class="pl-kos">;</span></pre></div>
</li>
<li>An <code class="notranslate">input</code>/<code class="notranslate">output</code> test to verify that it works when the binding is used in nested scopes, for example:
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="let x = class Test {
static #method() {
return function inner() {
return Test;
};
}
}"><pre class="notranslate"><span class="pl-k">let</span> <span class="pl-s1">x</span> <span class="pl-c1">=</span> <span class="pl-k">class</span> <span class="pl-v">Test</span> <span class="pl-kos">{</span>
<span class="pl-k">static</span> #<span class="pl-en">method</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
<span class="pl-k">return</span> <span class="pl-k">function</span> <span class="pl-en">inner</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
<span class="pl-k">return</span> <span class="pl-v">Test</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span>
<span class="pl-kos">}</span></pre></div>
</li>
<li>An <code class="notranslate">input</code>/<code class="notranslate">output</code> test to verify that it doesn't rewrite shadowed bindings:
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="let x = class Test {
static #method() {
new Test();
return function inner() {
let Test = 2;
return Test;
};
}
}"><pre class="notranslate"><span class="pl-k">let</span> <span class="pl-s1">x</span> <span class="pl-c1">=</span> <span class="pl-k">class</span> <span class="pl-v">Test</span> <span class="pl-kos">{</span>
<span class="pl-k">static</span> #<span class="pl-en">method</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
<span class="pl-k">new</span> <span class="pl-v">Test</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-k">return</span> <span class="pl-k">function</span> <span class="pl-en">inner</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
<span class="pl-k">let</span> <span class="pl-v">Test</span> <span class="pl-c1">=</span> <span class="pl-c1">2</span><span class="pl-kos">;</span>
<span class="pl-k">return</span> <span class="pl-v">Test</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span>
<span class="pl-kos">}</span></pre></div>
</li>
</ul>
<h3 dir="auto">Additional context</h3>
<p dir="auto">The same bug happens with static class fields (both public and private) and instance private methods:</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="fn(class WorkerClient {
static #x = WorkerClient;
static y = WorkerClient;
});"><pre class="notranslate"><span class="pl-en">fn</span><span class="pl-kos">(</span><span class="pl-k">class</span> <span class="pl-v">WorkerClient</span> <span class="pl-kos">{</span>
<span class="pl-k">static</span> #<span class="pl-c1">x</span> <span class="pl-c1">=</span> <span class="pl-v">WorkerClient</span><span class="pl-kos">;</span>
<span class="pl-k">static</span> <span class="pl-c1">y</span> <span class="pl-c1">=</span> <span class="pl-v">WorkerClient</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">;</span></pre></div>
<p dir="auto">we should duplicate the tests for those cases.</p> | 0 |
<p dir="auto"><a href="http://stackoverflow.com/questions/21773473/twitter-bootstrap-icons-and-opera-mobile" rel="nofollow">http://stackoverflow.com/questions/21773473/twitter-bootstrap-icons-and-opera-mobile</a></p> | <p dir="auto">When I checked my site to be compatible with my phone (Android 2.3.6), I noticed that the Glyphicons not work. Previously, when not used fonts and PNG image problems were not.<br>
Sreenshot:<br>
<a target="_blank" rel="noopener noreferrer nofollow" href="https://camo.githubusercontent.com/f8486b590ee2982f91f0d41d8008930e8ee8c418275384122bd1a3284fa877e2/687474703a2f2f6933392e74696e797069632e636f6d2f6267363432612e706e67"><img src="https://camo.githubusercontent.com/f8486b590ee2982f91f0d41d8008930e8ee8c418275384122bd1a3284fa877e2/687474703a2f2f6933392e74696e797069632e636f6d2f6267363432612e706e67" data-canonical-src="http://i39.tinypic.com/bg642a.png" style="max-width: 100%;"></a><br>
I use browser Opera Mobile v12.10. In default browser this work fine</p> | 1 |
<p dir="auto">If I am not mistaken, after enabling _ttl & _timestamp, one must also then add a request for the _ttl & _timestamp fields (and _source, otherwise, it disappears) to (every) search request thereafter in order to get the values - if we want to display them.</p>
<p dir="auto">Is there a downside to having them included with the other hit fields (_id, _index, _type, _score) automatically?</p>
<p dir="auto">It seems to me to be the most intuitive behaviour.<br>
At least thats what I (and my pair) were expecting - and we had to go on a bit of a tour of stackexchange to find out why it wasnt behaving like that what hoops we had to jump through</p> | <p dir="auto">When you search or GET to retrieve documents you don't get back the value for <code class="notranslate">_parent</code> field (or <code class="notranslate">_routing</code> for that matter) which is part of the essential metadata. Meaning the document cannot be retrieved or updated without the value. This is breaking some functionality, example use cases:</p>
<ul dir="auto">
<li>reindex (results of <code class="notranslate">scan</code> being fed into <code class="notranslate">bulk</code>) cannot work</li>
<li>persistence layers on top of elasticsearch cannot update a document they retrieved from ES without additional info/queries</li>
<li>you cannot GET a document you searched for (for example to retrieve fields you excluded)</li>
</ul>
<p dir="auto">I believe it would be worth the cost to retrieve the value of <code class="notranslate">_parent</code> field when retrieving a child document.</p> | 1 |
<p dir="auto">I'd like to select second 'text="John"' in the list.</p> | <h3 dir="auto">waitForSelectors</h3>
<p dir="auto">There are quite a few requests for more advanced logic to retrieve elements matching selectors. For example:</p>
<ul dir="auto">
<li>wait for at least one element matching selector and get all matching elements;</li>
<li>wait for at least one element matching selector to be visible and get it.</li>
</ul>
<p dir="auto">Proposal:</p>
<p dir="auto"><code class="notranslate">page.waitForSelectors(selector, countOrPredicate, { state?: 'attached' | 'visible' | 'hidden', filter? }): Promise<ElementHandle[]></code></p>
<p dir="auto">This method will query all elements matching <code class="notranslate">selector</code>, filter them by them by visibility <code class="notranslate">state</code>, then filter by the <code class="notranslate">filter</code> predicate, and then resolve with remaining elements if there are not less than <code class="notranslate">countOrPredicate</code> of them when it's a number or the predicate returns true.</p>
<p dir="auto">Examples:</p>
<ul dir="auto">
<li><code class="notranslate">page.waitForSelectors('button', 2)</code> - at least two buttons.</li>
<li><code class="notranslate">page.waitForSelectors('button', buttons => buttons.length >= myButtonsCount)</code> - at least <code class="notranslate">myButtonsCount</code> buttons;</li>
<li><code class="notranslate">page.waitForSelectors('button', 1, { state: 'visible' })</code> - at least one visible button;</li>
<li><code class="notranslate">page.waitForSelectors('button', 3, { state: 'visible', filter: b => !b.disabled })</code> - at least three visible and enabled buttons.</li>
</ul>
<h3 dir="auto">selectors.visible</h3>
<p dir="auto">There are requests to match not the first element, but the first visible one. This is more flaky and the preferred way is to use a stable selector the uniquely identifies the visible target element. That said, maybe it makes sense to introduce a wrapper that takes a regular selector:</p>
<p dir="auto"><code class="notranslate">selectors.visible('css=div')</code></p>
<p dir="auto">Questions:</p>
<ul dir="auto">
<li>How does this interact with <code class="notranslate">waitForSelector()</code> state option that could be <code class="notranslate">visible | hidden | attached | detached</code>?</li>
</ul>
<h3 dir="auto">selectors.index</h3>
<p dir="auto">This could simplify selecting a particular item from the list.</p>
<p dir="auto">Examples:</p>
<ul dir="auto">
<li><code class="notranslate">page.click(selectors.index('.my-list-item', 3))</code> - click at the third list item;</li>
<li><code class="notranslate">page.waitForSelector(selectors.index('button', 2))</code> - wait until there are at least two buttons.</li>
</ul> | 1 |
<p dir="auto">See here:</p>
<p dir="auto"><a href="http://plnkr.co/edit/sKkTPTraGIP2BcLWzEQU?p=preview" rel="nofollow">http://plnkr.co/edit/sKkTPTraGIP2BcLWzEQU?p=preview</a></p>
<p dir="auto">It is a situation that occurs after minification with mangling, but I tried to reproduce without minification by using the same class name for both components (since I don't know how to easily provide a minified example in Plunkr). Mangling will typically convert all class names to something like "a".<br>
As you can see, both components are rendered with the template of Component2, unless you switch back to beta.0.</p>
<p dir="auto">I have found several other issues about minification, but not any open one that is exactly the same as this.<br>
<a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="125920583" data-permission-text="Title is private" data-url="https://github.com/angular/angular/issues/6397" data-hovercard-type="pull_request" data-hovercard-url="/angular/angular/pull/6397/hovercard" href="https://github.com/angular/angular/pull/6397">#6397</a> mentions there might be name collisions in TemplateCompiler.</p> | <p dir="auto">Hello,</p>
<p dir="auto">I have trouble for build an application with <code class="notranslate">JSPM</code> and <code class="notranslate">angular2</code> (<code class="notranslate">2.0.0-beta.0</code>).</p>
<p dir="auto">When we install <code class="notranslate">angular2</code> through <code class="notranslate">npm</code>, the package is in <code class="notranslate">node_modules</code> and with a good <code class="notranslate">tsconfig</code> configuration we can load <code class="notranslate">angular2</code> modules with TypeScript without trouble like this:</p>
<div class="highlight highlight-source-ts notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="import { Component } from 'angular2/core';"><pre class="notranslate"><span class="pl-k">import</span> <span class="pl-kos">{</span> <span class="pl-smi">Component</span> <span class="pl-kos">}</span> <span class="pl-k">from</span> <span class="pl-s">'angular2/core'</span><span class="pl-kos">;</span></pre></div>
<p dir="auto">But I use <code class="notranslate">JSPM</code> for my app.</p>
<p dir="auto">So I install <code class="notranslate">angular2</code> through it and <code class="notranslate">JSPM</code> put the dependency in the subfolder <code class="notranslate">jspm_packages</code> by default. When I load it in the browser with <code class="notranslate">SystemJS</code> I don't have any problems.</p>
<p dir="auto">The only issue is in the TypeScript compiler.</p>
<p dir="auto">When I try to import <code class="notranslate">angular2</code> modules, the TypeScript compiler will try to load modules specify in <code class="notranslate">tsconfig</code> (<code class="notranslate">files</code>) and in <code class="notranslate">node_modules</code> but like I said, the dependency isn't in <code class="notranslate">node_modules</code> but in <code class="notranslate">jspm_packages</code>.</p>
<p dir="auto">Therefore, I have the following error which is normal :</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Cannot find module 'angular2/core';"><pre class="notranslate"><code class="notranslate">Cannot find module 'angular2/core';
</code></pre></div>
<p dir="auto">Because TypeScript try to load <code class="notranslate">nodes_modules/angular2/core</code> instead of <code class="notranslate">jspm_packages/.../angular2/core</code>.</p>
<p dir="auto">So, my question is how I can do for load <code class="notranslate">angular2</code> correctly inside the TypeScript compiler ?</p> | 0 |
<p dir="auto">We already have <a href="https://deno.land/x/bcrypt" rel="nofollow">bcrypt</a> and <a href="https://deno.land/x/argon2" rel="nofollow">argon2</a> modules on /x, it would be nice to have them in std just like in golang, also i think both of them (and others too) can be implemented via wasm for better perfomance</p> | <p dir="auto">Some applications like handling password will require hashing and encryption. These operations could be implemented in js/ts, but It really needs to be handled from a trusted environment to be secure. It looks like there have been some attempts to get this one rolling before recently with <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="395880648" data-permission-text="Title is private" data-url="https://github.com/denoland/deno/issues/1461" data-hovercard-type="pull_request" data-hovercard-url="/denoland/deno/pull/1461/hovercard" href="https://github.com/denoland/deno/pull/1461">#1461</a>.</p> | 1 |
<ol dir="auto">
<li>I have Android studio as well as flutter installed on my system</li>
<li>When I run <code class="notranslate">flutter create myapp</code> or create a new flutter application in Android Studio, I get the following error</li>
</ol>
<h2 dir="auto">Logs</h2>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="[ +32 ms] executing: [C:\src\flutter\] git rev-parse --abbrev-ref --symbolic
@{u}
[ +233 ms] Exit code 0 from: git rev-parse --abbrev-ref --symbolic @{u}
[ +4 ms] origin/stable
[ +1 ms] executing: [C:\src\flutter\] git rev-parse --abbrev-ref HEAD
[ +174 ms] Exit code 0 from: git rev-parse --abbrev-ref HEAD
[ +2 ms] stable
[ +1 ms] executing: [C:\src\flutter\] git ls-remote --get-url origin
[ +171 ms] Exit code 0 from: git ls-remote --get-url origin
[ +2 ms] https://github.com/flutter/flutter.git
[ +1 ms] executing: [C:\src\flutter\] git log -n 1 --pretty=format:%H
[ +176 ms] Exit code 0 from: git log -n 1 --pretty=format:%H
[ +2 ms] 5391447fae6209bb21a89e6a5a6583cac1af9b4b
[ +1 ms] executing: [C:\src\flutter\] git log -n 1 --pretty=format:%ar
[ +175 ms] Exit code 0 from: git log -n 1 --pretty=format:%ar
[ +2 ms] 12 days ago
[ +1 ms] executing: [C:\src\flutter\] git describe --match v*.*.*
--first-parent --long --tags
[ +177 ms] Exit code 0 from: git describe --match v*.*.* --first-parent --long
--tags
[ +2 ms] v1.0.0-0-g5391447fa
[ +574 ms] Creating project mynewapp...
[ +41 ms] mynewapp\.gitignore (created)
[ +26 ms] mynewapp\.idea\libraries\Dart_SDK.xml (created)
[ +23 ms] "flutter create" took 397ms.
Oops; flutter has exited unexpectedly.
Sending crash report to Google.
Crash report sender itself crashed: HandshakeException: Connection terminated
during handshake
#0 IOClient.send (package:http/src/io_client.dart:33:23)
<asynchronous suspension>
#1 CrashReportSender.sendReport
(package:flutter_tools/src/crash_reporting.dart:118:56)
<asynchronous suspension>
#2 _handleToolError (package:flutter_tools/runner.dart:114:40)
#3 _AsyncAwaitCompleter.start (dart:async/runtime/libasync_patch.dart:49:6)#4 _handleToolError (package:flutter_tools/runner.dart:70:29)
#5 run.<anonymous closure> (package:flutter_tools/runner.dart:64:20)
#6 _asyncErrorWrapperHelper.<anonymous closure>
(dart:async/runtime/libasync_patch.dart:84:45)
#7 _rootRunBinary (dart:async/zone.dart:1144:38)
#8 _CustomZone.runBinary (dart:async/zone.dart:1037:19)
#9 _FutureListener.handleError (dart:async/future_impl.dart:143:20)
#10 Future._propagateToListeners.handleError
(dart:async/future_impl.dart:654:47)
#11 Future._propagateToListeners (dart:async/future_impl.dart:675:24)
#12 Future._completeError (dart:async/future_impl.dart:494:5)
#13 _SyncCompleter._completeError (dart:async/future_impl.dart:55:12)
#14 _Completer.completeError (dart:async/future_impl.dart:27:5)
#15 _AsyncAwaitCompleter.completeError
(dart:async/runtime/libasync_patch.dart:40:18)
#16 FlutterCommandRunner.runCommand
(package:flutter_tools/src/runner/flutter_command_runner.dart)
#17 _asyncErrorWrapperHelper.<anonymous closure>
(dart:async/runtime/libasync_patch.dart:84:45)
#18 _rootRunBinary (dart:async/zone.dart:1144:38)
#19 _CustomZone.runBinary (dart:async/zone.dart:1037:19)
#20 _FutureListener.handleError (dart:async/future_impl.dart:143:20)
#21 Future._propagateToListeners.handleError
(dart:async/future_impl.dart:654:47)
#22 Future._propagateToListeners (dart:async/future_impl.dart:675:24)
#23 Future._completeError (dart:async/future_impl.dart:494:5)
#24 _SyncCompleter._completeError (dart:async/future_impl.dart:55:12)
#25 _Completer.completeError (dart:async/future_impl.dart:27:5)
#26 _AsyncAwaitCompleter.completeError
(dart:async/runtime/libasync_patch.dart:40:18)
#27 AppContext.run (package:flutter_tools/src/base/context.dart)
#28 _asyncErrorWrapperHelper.<anonymous closure>
(dart:async/runtime/libasync_patch.dart:84:45)
#29 _rootRunBinary (dart:async/zone.dart:1144:38)
#30 _CustomZone.runBinary (dart:async/zone.dart:1037:19)
#31 _FutureListener.handleError (dart:async/future_impl.dart:143:20)
#32 Future._propagateToListeners.handleError
(dart:async/future_impl.dart:654:47)
#33 Future._propagateToListeners (dart:async/future_impl.dart:675:24)
#34 Future._completeError (dart:async/future_impl.dart:494:5)
#35 _SyncCompleter._completeError (dart:async/future_impl.dart:55:12)
#36 _Completer.completeError (dart:async/future_impl.dart:27:5)
#37 _AsyncAwaitCompleter.completeError
(dart:async/runtime/libasync_patch.dart:40:18)
#38 AppContext.run.<anonymous closure>
(package:flutter_tools/src/base/context.dart)
#39 _asyncErrorWrapperHelper.<anonymous closure>
(dart:async/runtime/libasync_patch.dart:84:45)
#40 _rootRunBinary (dart:async/zone.dart:1144:38)
#41 _CustomZone.runBinary (dart:async/zone.dart:1037:19)
#42 _FutureListener.handleError (dart:async/future_impl.dart:143:20)
#43 Future._propagateToListeners.handleError
(dart:async/future_impl.dart:654:47)
#44 Future._propagateToListeners (dart:async/future_impl.dart:675:24)
#45 Future._completeError (dart:async/future_impl.dart:494:5)
#46 _SyncCompleter._completeError (dart:async/future_impl.dart:55:12)
#47 _Completer.completeError (dart:async/future_impl.dart:27:5)
#48 _AsyncAwaitCompleter.completeError
(dart:async/runtime/libasync_patch.dart:40:18)
#49 FlutterCommandRunner.runCommand.<anonymous closure>
(package:flutter_tools/src/runner/flutter_command_runner.dart)
#50 _asyncErrorWrapperHelper.<anonymous closure>
(dart:async/runtime/libasync_patch.dart:84:45)
#51 _rootRunBinary (dart:async/zone.dart:1144:38)
#52 _CustomZone.runBinary (dart:async/zone.dart:1037:19)
#53 _FutureListener.handleError (dart:async/future_impl.dart:143:20)
#54 Future._propagateToListeners.handleError
(dart:async/future_impl.dart:654:47)
#55 Future._propagateToListeners (dart:async/future_impl.dart:675:24)
#56 Future._completeError (dart:async/future_impl.dart:494:5)
#57 _SyncCompleter._completeError (dart:async/future_impl.dart:55:12)
#58 _Completer.completeError (dart:async/future_impl.dart:27:5)
#59 _AsyncAwaitCompleter.completeError
(dart:async/runtime/libasync_patch.dart:40:18)
#60 CommandRunner.runCommand (package:args/command_runner.dart)
#61 _asyncErrorWrapperHelper.<anonymous closure>
(dart:async/runtime/libasync_patch.dart:84:45)
#62 _rootRunBinary (dart:async/zone.dart:1144:38)
#63 _CustomZone.runBinary (dart:async/zone.dart:1037:19)
#64 _FutureListener.handleError (dart:async/future_impl.dart:143:20)
#65 Future._propagateToListeners.handleError
(dart:async/future_impl.dart:654:47)
#66 Future._propagateToListeners (dart:async/future_impl.dart:675:24)
#67 Future._completeError (dart:async/future_impl.dart:494:5)
#68 _SyncCompleter._completeError (dart:async/future_impl.dart:55:12)
#69 _Completer.completeError (dart:async/future_impl.dart:27:5)
#70 _AsyncAwaitCompleter.completeError
(dart:async/runtime/libasync_patch.dart:40:18)
#71 AppContext.run (package:flutter_tools/src/base/context.dart)
#72 _asyncErrorWrapperHelper.<anonymous closure>
(dart:async/runtime/libasync_patch.dart:84:45)
#73 _rootRunBinary (dart:async/zone.dart:1144:38)
#74 _CustomZone.runBinary (dart:async/zone.dart:1037:19)
#75 _FutureListener.handleError (dart:async/future_impl.dart:143:20)
#76 Future._propagateToListeners.handleError
(dart:async/future_impl.dart:654:47)
#77 Future._propagateToListeners (dart:async/future_impl.dart:675:24)
#78 Future._completeError (dart:async/future_impl.dart:494:5)
#79 _SyncCompleter._completeError (dart:async/future_impl.dart:55:12)
#80 _Completer.completeError (dart:async/future_impl.dart:27:5)
#81 _AsyncAwaitCompleter.completeError
(dart:async/runtime/libasync_patch.dart:40:18)
#82 AppContext.run.<anonymous closure>
(package:flutter_tools/src/base/context.dart)
#83 _asyncErrorWrapperHelper.<anonymous closure>
(dart:async/runtime/libasync_patch.dart:84:45)
#84 _rootRunBinary (dart:async/zone.dart:1144:38)
#85 _CustomZone.runBinary (dart:async/zone.dart:1037:19)
#86 _FutureListener.handleError (dart:async/future_impl.dart:143:20)
#87 Future._propagateToListeners.handleError
(dart:async/future_impl.dart:654:47)
#88 Future._propagateToListeners (dart:async/future_impl.dart:675:24)
#89 Future._completeError (dart:async/future_impl.dart:494:5)
#90 _SyncCompleter._completeError (dart:async/future_impl.dart:55:12)
#91 _Completer.completeError (dart:async/future_impl.dart:27:5)
#92 _AsyncAwaitCompleter.completeError
(dart:async/runtime/libasync_patch.dart:40:18)
#93 FlutterCommand.run.<anonymous closure>
(package:flutter_tools/src/runner/flutter_command.dart)
#94 _asyncErrorWrapperHelper.<anonymous closure>
(dart:async/runtime/libasync_patch.dart:84:45)
#95 _rootRunBinary (dart:async/zone.dart:1144:38)
#96 _CustomZone.runBinary (dart:async/zone.dart:1037:19)
#97 _FutureListener.handleError (dart:async/future_impl.dart:143:20)
#98 Future._propagateToListeners.handleError
(dart:async/future_impl.dart:654:47)
#99 Future._propagateToListeners (dart:async/future_impl.dart:675:24)
#100 Future._completeError (dart:async/future_impl.dart:494:5)
#101 _SyncCompleter._completeError (dart:async/future_impl.dart:55:12)
#102 _Completer.completeError (dart:async/future_impl.dart:27:5)
#103 _AsyncAwaitCompleter.completeError
(dart:async/runtime/libasync_patch.dart:40:18)
#104 FlutterCommand.verifyThenRunCommand
(package:flutter_tools/src/runner/flutter_command.dart)
#105 _asyncErrorWrapperHelper.<anonymous closure>
(dart:async/runtime/libasync_patch.dart:84:45)
#106 _rootRunBinary (dart:async/zone.dart:1144:38)
#107 _CustomZone.runBinary (dart:async/zone.dart:1037:19)
#108 _FutureListener.handleError (dart:async/future_impl.dart:143:20)
#109 Future._propagateToListeners.handleError
(dart:async/future_impl.dart:654:47)
#110 Future._propagateToListeners (dart:async/future_impl.dart:675:24)
#111 Future._completeError (dart:async/future_impl.dart:494:5)
#112 _SyncCompleter._completeError (dart:async/future_impl.dart:55:12)
#113 _Completer.completeError (dart:async/future_impl.dart:27:5)
#114 _AsyncAwaitCompleter.completeError
(dart:async/runtime/libasync_patch.dart:40:18)
#115 CreateCommand.runCommand
(package:flutter_tools/src/commands/create.dart)
#116 _asyncErrorWrapperHelper.<anonymous closure>
(dart:async/runtime/libasync_patch.dart:84:45)
#117 _rootRunBinary (dart:async/zone.dart:1144:38)
#118 _CustomZone.runBinary (dart:async/zone.dart:1037:19)
#119 _FutureListener.handleError (dart:async/future_impl.dart:143:20)
#120 Future._propagateToListeners.handleError
(dart:async/future_impl.dart:654:47)
#121 Future._propagateToListeners (dart:async/future_impl.dart:675:24)
#122 Future._completeError (dart:async/future_impl.dart:494:5)
#123 _SyncCompleter._completeError (dart:async/future_impl.dart:55:12)
#124 _Completer.completeError (dart:async/future_impl.dart:27:5)
#125 _AsyncAwaitCompleter.completeError.<anonymous closure>
(dart:async/runtime/libasync_patch.dart:43:20)
#126 _rootRun (dart:async/zone.dart:1124:13)
#127 _CustomZone.run (dart:async/zone.dart:1021:19)
#128 _CustomZone.bindCallback.<anonymous closure>
(dart:async/zone.dart:947:23)
#129 _microtaskLoop (dart:async/schedule_microtask.dart:41:21)
#130 _startMicrotaskLoop (dart:async/schedule_microtask.dart:50:5)
#131 _runPendingImmediateCallback
(dart:isolate/runtime/libisolate_patch.dart:115:13)
#132 _RawReceivePortImpl._handleMessage
(dart:isolate/runtime/libisolate_patch.dart:172:5)"><pre lang="flutter" class="notranslate"><code class="notranslate">[ +32 ms] executing: [C:\src\flutter\] git rev-parse --abbrev-ref --symbolic
@{u}
[ +233 ms] Exit code 0 from: git rev-parse --abbrev-ref --symbolic @{u}
[ +4 ms] origin/stable
[ +1 ms] executing: [C:\src\flutter\] git rev-parse --abbrev-ref HEAD
[ +174 ms] Exit code 0 from: git rev-parse --abbrev-ref HEAD
[ +2 ms] stable
[ +1 ms] executing: [C:\src\flutter\] git ls-remote --get-url origin
[ +171 ms] Exit code 0 from: git ls-remote --get-url origin
[ +2 ms] https://github.com/flutter/flutter.git
[ +1 ms] executing: [C:\src\flutter\] git log -n 1 --pretty=format:%H
[ +176 ms] Exit code 0 from: git log -n 1 --pretty=format:%H
[ +2 ms] 5391447fae6209bb21a89e6a5a6583cac1af9b4b
[ +1 ms] executing: [C:\src\flutter\] git log -n 1 --pretty=format:%ar
[ +175 ms] Exit code 0 from: git log -n 1 --pretty=format:%ar
[ +2 ms] 12 days ago
[ +1 ms] executing: [C:\src\flutter\] git describe --match v*.*.*
--first-parent --long --tags
[ +177 ms] Exit code 0 from: git describe --match v*.*.* --first-parent --long
--tags
[ +2 ms] v1.0.0-0-g5391447fa
[ +574 ms] Creating project mynewapp...
[ +41 ms] mynewapp\.gitignore (created)
[ +26 ms] mynewapp\.idea\libraries\Dart_SDK.xml (created)
[ +23 ms] "flutter create" took 397ms.
Oops; flutter has exited unexpectedly.
Sending crash report to Google.
Crash report sender itself crashed: HandshakeException: Connection terminated
during handshake
#0 IOClient.send (package:http/src/io_client.dart:33:23)
<asynchronous suspension>
#1 CrashReportSender.sendReport
(package:flutter_tools/src/crash_reporting.dart:118:56)
<asynchronous suspension>
#2 _handleToolError (package:flutter_tools/runner.dart:114:40)
#3 _AsyncAwaitCompleter.start (dart:async/runtime/libasync_patch.dart:49:6)#4 _handleToolError (package:flutter_tools/runner.dart:70:29)
#5 run.<anonymous closure> (package:flutter_tools/runner.dart:64:20)
#6 _asyncErrorWrapperHelper.<anonymous closure>
(dart:async/runtime/libasync_patch.dart:84:45)
#7 _rootRunBinary (dart:async/zone.dart:1144:38)
#8 _CustomZone.runBinary (dart:async/zone.dart:1037:19)
#9 _FutureListener.handleError (dart:async/future_impl.dart:143:20)
#10 Future._propagateToListeners.handleError
(dart:async/future_impl.dart:654:47)
#11 Future._propagateToListeners (dart:async/future_impl.dart:675:24)
#12 Future._completeError (dart:async/future_impl.dart:494:5)
#13 _SyncCompleter._completeError (dart:async/future_impl.dart:55:12)
#14 _Completer.completeError (dart:async/future_impl.dart:27:5)
#15 _AsyncAwaitCompleter.completeError
(dart:async/runtime/libasync_patch.dart:40:18)
#16 FlutterCommandRunner.runCommand
(package:flutter_tools/src/runner/flutter_command_runner.dart)
#17 _asyncErrorWrapperHelper.<anonymous closure>
(dart:async/runtime/libasync_patch.dart:84:45)
#18 _rootRunBinary (dart:async/zone.dart:1144:38)
#19 _CustomZone.runBinary (dart:async/zone.dart:1037:19)
#20 _FutureListener.handleError (dart:async/future_impl.dart:143:20)
#21 Future._propagateToListeners.handleError
(dart:async/future_impl.dart:654:47)
#22 Future._propagateToListeners (dart:async/future_impl.dart:675:24)
#23 Future._completeError (dart:async/future_impl.dart:494:5)
#24 _SyncCompleter._completeError (dart:async/future_impl.dart:55:12)
#25 _Completer.completeError (dart:async/future_impl.dart:27:5)
#26 _AsyncAwaitCompleter.completeError
(dart:async/runtime/libasync_patch.dart:40:18)
#27 AppContext.run (package:flutter_tools/src/base/context.dart)
#28 _asyncErrorWrapperHelper.<anonymous closure>
(dart:async/runtime/libasync_patch.dart:84:45)
#29 _rootRunBinary (dart:async/zone.dart:1144:38)
#30 _CustomZone.runBinary (dart:async/zone.dart:1037:19)
#31 _FutureListener.handleError (dart:async/future_impl.dart:143:20)
#32 Future._propagateToListeners.handleError
(dart:async/future_impl.dart:654:47)
#33 Future._propagateToListeners (dart:async/future_impl.dart:675:24)
#34 Future._completeError (dart:async/future_impl.dart:494:5)
#35 _SyncCompleter._completeError (dart:async/future_impl.dart:55:12)
#36 _Completer.completeError (dart:async/future_impl.dart:27:5)
#37 _AsyncAwaitCompleter.completeError
(dart:async/runtime/libasync_patch.dart:40:18)
#38 AppContext.run.<anonymous closure>
(package:flutter_tools/src/base/context.dart)
#39 _asyncErrorWrapperHelper.<anonymous closure>
(dart:async/runtime/libasync_patch.dart:84:45)
#40 _rootRunBinary (dart:async/zone.dart:1144:38)
#41 _CustomZone.runBinary (dart:async/zone.dart:1037:19)
#42 _FutureListener.handleError (dart:async/future_impl.dart:143:20)
#43 Future._propagateToListeners.handleError
(dart:async/future_impl.dart:654:47)
#44 Future._propagateToListeners (dart:async/future_impl.dart:675:24)
#45 Future._completeError (dart:async/future_impl.dart:494:5)
#46 _SyncCompleter._completeError (dart:async/future_impl.dart:55:12)
#47 _Completer.completeError (dart:async/future_impl.dart:27:5)
#48 _AsyncAwaitCompleter.completeError
(dart:async/runtime/libasync_patch.dart:40:18)
#49 FlutterCommandRunner.runCommand.<anonymous closure>
(package:flutter_tools/src/runner/flutter_command_runner.dart)
#50 _asyncErrorWrapperHelper.<anonymous closure>
(dart:async/runtime/libasync_patch.dart:84:45)
#51 _rootRunBinary (dart:async/zone.dart:1144:38)
#52 _CustomZone.runBinary (dart:async/zone.dart:1037:19)
#53 _FutureListener.handleError (dart:async/future_impl.dart:143:20)
#54 Future._propagateToListeners.handleError
(dart:async/future_impl.dart:654:47)
#55 Future._propagateToListeners (dart:async/future_impl.dart:675:24)
#56 Future._completeError (dart:async/future_impl.dart:494:5)
#57 _SyncCompleter._completeError (dart:async/future_impl.dart:55:12)
#58 _Completer.completeError (dart:async/future_impl.dart:27:5)
#59 _AsyncAwaitCompleter.completeError
(dart:async/runtime/libasync_patch.dart:40:18)
#60 CommandRunner.runCommand (package:args/command_runner.dart)
#61 _asyncErrorWrapperHelper.<anonymous closure>
(dart:async/runtime/libasync_patch.dart:84:45)
#62 _rootRunBinary (dart:async/zone.dart:1144:38)
#63 _CustomZone.runBinary (dart:async/zone.dart:1037:19)
#64 _FutureListener.handleError (dart:async/future_impl.dart:143:20)
#65 Future._propagateToListeners.handleError
(dart:async/future_impl.dart:654:47)
#66 Future._propagateToListeners (dart:async/future_impl.dart:675:24)
#67 Future._completeError (dart:async/future_impl.dart:494:5)
#68 _SyncCompleter._completeError (dart:async/future_impl.dart:55:12)
#69 _Completer.completeError (dart:async/future_impl.dart:27:5)
#70 _AsyncAwaitCompleter.completeError
(dart:async/runtime/libasync_patch.dart:40:18)
#71 AppContext.run (package:flutter_tools/src/base/context.dart)
#72 _asyncErrorWrapperHelper.<anonymous closure>
(dart:async/runtime/libasync_patch.dart:84:45)
#73 _rootRunBinary (dart:async/zone.dart:1144:38)
#74 _CustomZone.runBinary (dart:async/zone.dart:1037:19)
#75 _FutureListener.handleError (dart:async/future_impl.dart:143:20)
#76 Future._propagateToListeners.handleError
(dart:async/future_impl.dart:654:47)
#77 Future._propagateToListeners (dart:async/future_impl.dart:675:24)
#78 Future._completeError (dart:async/future_impl.dart:494:5)
#79 _SyncCompleter._completeError (dart:async/future_impl.dart:55:12)
#80 _Completer.completeError (dart:async/future_impl.dart:27:5)
#81 _AsyncAwaitCompleter.completeError
(dart:async/runtime/libasync_patch.dart:40:18)
#82 AppContext.run.<anonymous closure>
(package:flutter_tools/src/base/context.dart)
#83 _asyncErrorWrapperHelper.<anonymous closure>
(dart:async/runtime/libasync_patch.dart:84:45)
#84 _rootRunBinary (dart:async/zone.dart:1144:38)
#85 _CustomZone.runBinary (dart:async/zone.dart:1037:19)
#86 _FutureListener.handleError (dart:async/future_impl.dart:143:20)
#87 Future._propagateToListeners.handleError
(dart:async/future_impl.dart:654:47)
#88 Future._propagateToListeners (dart:async/future_impl.dart:675:24)
#89 Future._completeError (dart:async/future_impl.dart:494:5)
#90 _SyncCompleter._completeError (dart:async/future_impl.dart:55:12)
#91 _Completer.completeError (dart:async/future_impl.dart:27:5)
#92 _AsyncAwaitCompleter.completeError
(dart:async/runtime/libasync_patch.dart:40:18)
#93 FlutterCommand.run.<anonymous closure>
(package:flutter_tools/src/runner/flutter_command.dart)
#94 _asyncErrorWrapperHelper.<anonymous closure>
(dart:async/runtime/libasync_patch.dart:84:45)
#95 _rootRunBinary (dart:async/zone.dart:1144:38)
#96 _CustomZone.runBinary (dart:async/zone.dart:1037:19)
#97 _FutureListener.handleError (dart:async/future_impl.dart:143:20)
#98 Future._propagateToListeners.handleError
(dart:async/future_impl.dart:654:47)
#99 Future._propagateToListeners (dart:async/future_impl.dart:675:24)
#100 Future._completeError (dart:async/future_impl.dart:494:5)
#101 _SyncCompleter._completeError (dart:async/future_impl.dart:55:12)
#102 _Completer.completeError (dart:async/future_impl.dart:27:5)
#103 _AsyncAwaitCompleter.completeError
(dart:async/runtime/libasync_patch.dart:40:18)
#104 FlutterCommand.verifyThenRunCommand
(package:flutter_tools/src/runner/flutter_command.dart)
#105 _asyncErrorWrapperHelper.<anonymous closure>
(dart:async/runtime/libasync_patch.dart:84:45)
#106 _rootRunBinary (dart:async/zone.dart:1144:38)
#107 _CustomZone.runBinary (dart:async/zone.dart:1037:19)
#108 _FutureListener.handleError (dart:async/future_impl.dart:143:20)
#109 Future._propagateToListeners.handleError
(dart:async/future_impl.dart:654:47)
#110 Future._propagateToListeners (dart:async/future_impl.dart:675:24)
#111 Future._completeError (dart:async/future_impl.dart:494:5)
#112 _SyncCompleter._completeError (dart:async/future_impl.dart:55:12)
#113 _Completer.completeError (dart:async/future_impl.dart:27:5)
#114 _AsyncAwaitCompleter.completeError
(dart:async/runtime/libasync_patch.dart:40:18)
#115 CreateCommand.runCommand
(package:flutter_tools/src/commands/create.dart)
#116 _asyncErrorWrapperHelper.<anonymous closure>
(dart:async/runtime/libasync_patch.dart:84:45)
#117 _rootRunBinary (dart:async/zone.dart:1144:38)
#118 _CustomZone.runBinary (dart:async/zone.dart:1037:19)
#119 _FutureListener.handleError (dart:async/future_impl.dart:143:20)
#120 Future._propagateToListeners.handleError
(dart:async/future_impl.dart:654:47)
#121 Future._propagateToListeners (dart:async/future_impl.dart:675:24)
#122 Future._completeError (dart:async/future_impl.dart:494:5)
#123 _SyncCompleter._completeError (dart:async/future_impl.dart:55:12)
#124 _Completer.completeError (dart:async/future_impl.dart:27:5)
#125 _AsyncAwaitCompleter.completeError.<anonymous closure>
(dart:async/runtime/libasync_patch.dart:43:20)
#126 _rootRun (dart:async/zone.dart:1124:13)
#127 _CustomZone.run (dart:async/zone.dart:1021:19)
#128 _CustomZone.bindCallback.<anonymous closure>
(dart:async/zone.dart:947:23)
#129 _microtaskLoop (dart:async/schedule_microtask.dart:41:21)
#130 _startMicrotaskLoop (dart:async/schedule_microtask.dart:50:5)
#131 _runPendingImmediateCallback
(dart:isolate/runtime/libisolate_patch.dart:115:13)
#132 _RawReceivePortImpl._handleMessage
(dart:isolate/runtime/libisolate_patch.dart:172:5)
</code></pre></div>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="flutter doctor -v
[√] Flutter (Channel stable, v1.0.0, on Microsoft Windows [Version 10.0.14393], locale en-IN)
• Flutter version 1.0.0 at C:\src\flutter
• Framework revision 5391447fae (12 days ago), 2018-11-29 19:41:26 -0800
• Engine revision 7375a0f414
• Dart version 2.1.0 (build 2.1.0-dev.9.4 f9ebf21297)
[!] Android toolchain - develop for Android devices (Android SDK 28.0.3)
• Android SDK at C:\Users\Deepa663180\AppData\Local\Android\Sdk
• Android NDK location not configured (optional; useful for native profiling support)
• Platform android-28, build-tools 28.0.3
• ANDROID_HOME = C:\Users\Deepa663180\AppData\Local\Android\Sdk
• Java binary at: C:\Program Files\Android\Android Studio1\jre\bin\java
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1136-b06)
X Android license status unknown.
[√] Android Studio (version 3.2)
• Android Studio at C:\Program Files\Android\Android Studio1
• Flutter plugin installed
• Dart plugin installed
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1136-b06)
[√] VS Code, 32-bit edition (version 1.24.0)
• VS Code at C:\Program Files (x86)\Microsoft VS Code
• Flutter extension version 2.21.1
[√] VS Code, 64-bit edition
• VS Code at C:\Program Files\Microsoft VS Code
• Flutter extension version 2.21.1
[!] Connected device
! No devices available
! Doctor found issues in 2 categories.
[flutter_01.log](https://github.com/flutter/flutter/files/2671753/flutter_01.log)
"><pre class="notranslate"><code class="notranslate">flutter doctor -v
[√] Flutter (Channel stable, v1.0.0, on Microsoft Windows [Version 10.0.14393], locale en-IN)
• Flutter version 1.0.0 at C:\src\flutter
• Framework revision 5391447fae (12 days ago), 2018-11-29 19:41:26 -0800
• Engine revision 7375a0f414
• Dart version 2.1.0 (build 2.1.0-dev.9.4 f9ebf21297)
[!] Android toolchain - develop for Android devices (Android SDK 28.0.3)
• Android SDK at C:\Users\Deepa663180\AppData\Local\Android\Sdk
• Android NDK location not configured (optional; useful for native profiling support)
• Platform android-28, build-tools 28.0.3
• ANDROID_HOME = C:\Users\Deepa663180\AppData\Local\Android\Sdk
• Java binary at: C:\Program Files\Android\Android Studio1\jre\bin\java
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1136-b06)
X Android license status unknown.
[√] Android Studio (version 3.2)
• Android Studio at C:\Program Files\Android\Android Studio1
• Flutter plugin installed
• Dart plugin installed
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1136-b06)
[√] VS Code, 32-bit edition (version 1.24.0)
• VS Code at C:\Program Files (x86)\Microsoft VS Code
• Flutter extension version 2.21.1
[√] VS Code, 64-bit edition
• VS Code at C:\Program Files\Microsoft VS Code
• Flutter extension version 2.21.1
[!] Connected device
! No devices available
! Doctor found issues in 2 categories.
[flutter_01.log](https://github.com/flutter/flutter/files/2671753/flutter_01.log)
</code></pre></div> | <h2 dir="auto">Steps to Reproduce</h2>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="flutter create -v flutter_test_app"><pre class="notranslate"><code class="notranslate">flutter create -v flutter_test_app
</code></pre></div>
<p dir="auto">Behind company proxy (<a href="http://proxy.our-domain.com:8080" rel="nofollow">http://proxy.our-domain.com:8080</a>) (No HTTPS/SSL)</p>
<h2 dir="auto">Environment</h2>
<p dir="auto">OS: Windows 10</p>
<p dir="auto">HTTP_PROXY and HTTPS_PROXY Env vars are set.</p>
<h2 dir="auto">Logs</h2>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="[ +28 ms] [C:\Users\i01002704\AppData\Local\flutter\] git rev-parse --abbrev-ref --symbolic @{u}
[ +93 ms] Exit code 0 from: git rev-parse --abbrev-ref --symbolic @{u}
[ +1 ms] origin/beta
[ +2 ms] [C:\Users\i01002704\AppData\Local\flutter\] git rev-parse --abbrev-ref HEAD
[ +58 ms] Exit code 0 from: git rev-parse --abbrev-ref HEAD
[ +1 ms] beta
[ +3 ms] [C:\Users\i01002704\AppData\Local\flutter\] git ls-remote --get-url origin
[ +67 ms] Exit code 0 from: git ls-remote --get-url origin
[ +1 ms] https://github.com/flutter/flutter.git
[ +2 ms] [C:\Users\i01002704\AppData\Local\flutter\] git log -n 1 --pretty=format:%H
[ +54 ms] Exit code 0 from: git log -n 1 --pretty=format:%H
[ +1 ms] b397406561f5e7a9c94e28f58d9e49fca0dd58b7
[ +2 ms] [C:\Users\i01002704\AppData\Local\flutter\] git log -n 1 --pretty=format:%ar
[ +51 ms] Exit code 0 from: git log -n 1 --pretty=format:%ar
[ +1 ms] 9 days ago
[ +2 ms] [C:\Users\i01002704\AppData\Local\flutter\] git describe --match v*.*.* --first-parent --long --tags
[ +50 ms] Exit code 0 from: git describe --match v*.*.* --first-parent --long --tags
[ +1 ms] v0.2.8-0-gb39740656
[ +437 ms] Creating project flutter_test_app...
[ +26 ms] flutter_test_app\.gitignore (created)
[ +19 ms] flutter_test_app\.idea\libraries\Dart_SDK.xml (created)
[ +12 ms] flutter_test_app\.idea\libraries\Flutter_for_Android.xml (created)
[ +3 ms] flutter_test_app\.idea\modules.xml (created)
[ +5 ms] flutter_test_app\.idea\runConfigurations\main_dart.xml (created)
[ +4 ms] flutter_test_app\.idea\workspace.xml (created)
[ +5 ms] flutter_test_app\.metadata (created)
[ +3 ms] flutter_test_app\android\app\build.gradle (created)
[ +5 ms] flutter_test_app\android\app\src\main\java\com\example\fluttertestapp\MainActivity.java (created)
[ +6 ms] flutter_test_app\android\build.gradle (created)
[ +5 ms] flutter_test_app\android\.gitignore (created)
[ +2 ms] flutter_test_app\android\app\src\main\AndroidManifest.xml (created)
[ +3 ms] flutter_test_app\android\app\src\main\res\drawable\launch_background.xml (created)
[ +4 ms] flutter_test_app\android\app\src\main\res\mipmap-hdpi\ic_launcher.png (created)
[ +4 ms] flutter_test_app\android\app\src\main\res\mipmap-mdpi\ic_launcher.png (created)
[ +3 ms] flutter_test_app\android\app\src\main\res\mipmap-xhdpi\ic_launcher.png (created)
[ +3 ms] flutter_test_app\android\app\src\main\res\mipmap-xxhdpi\ic_launcher.png (created)
[ +5 ms] flutter_test_app\android\app\src\main\res\mipmap-xxxhdpi\ic_launcher.png (created)
[ +3 ms] flutter_test_app\android\app\src\main\res\values\styles.xml (created)
[ +4 ms] flutter_test_app\android\gradle\wrapper\gradle-wrapper.properties (created)
[ +3 ms] flutter_test_app\android\gradle.properties (created)
[ +5 ms] flutter_test_app\android\settings.gradle (created)
[ +3 ms] flutter_test_app\ios\Runner\AppDelegate.h (created)
[ +3 ms] flutter_test_app\ios\Runner\AppDelegate.m (created)
[ +2 ms] flutter_test_app\ios\Runner\main.m (created)
[ +3 ms] flutter_test_app\ios\Runner.xcodeproj\project.pbxproj (created)
[ +15 ms] flutter_test_app\ios\.gitignore (created)
[ +3 ms] flutter_test_app\ios\Flutter\AppFrameworkInfo.plist (created)
[ +3 ms] flutter_test_app\ios\Flutter\Debug.xcconfig (created)
[ +2 ms] flutter_test_app\ios\Flutter\Release.xcconfig (created)
[ +3 ms] flutter_test_app\ios\Runner\Assets.xcassets\AppIcon.appiconset\Contents.json (created)
[ +4 ms] flutter_test_app\ios\Runner\Assets.xcassets\AppIcon.appiconset\[email protected] (created)
[ +3 ms] flutter_test_app\ios\Runner\Assets.xcassets\AppIcon.appiconset\[email protected] (created)
[ +3 ms] flutter_test_app\ios\Runner\Assets.xcassets\AppIcon.appiconset\[email protected] (created)
[ +3 ms] flutter_test_app\ios\Runner\Assets.xcassets\AppIcon.appiconset\[email protected] (created)
[ +3 ms] flutter_test_app\ios\Runner\Assets.xcassets\AppIcon.appiconset\[email protected] (created)
[ +4 ms] flutter_test_app\ios\Runner\Assets.xcassets\AppIcon.appiconset\[email protected] (created)
[ +3 ms] flutter_test_app\ios\Runner\Assets.xcassets\AppIcon.appiconset\[email protected] (created)
[ +3 ms] flutter_test_app\ios\Runner\Assets.xcassets\AppIcon.appiconset\[email protected] (created)
[ +3 ms] flutter_test_app\ios\Runner\Assets.xcassets\AppIcon.appiconset\[email protected] (created)
[ +3 ms] flutter_test_app\ios\Runner\Assets.xcassets\AppIcon.appiconset\[email protected] (created)
[ +4 ms] flutter_test_app\ios\Runner\Assets.xcassets\AppIcon.appiconset\[email protected] (created)
[ +3 ms] flutter_test_app\ios\Runner\Assets.xcassets\AppIcon.appiconset\[email protected] (created)
[ +3 ms] flutter_test_app\ios\Runner\Assets.xcassets\AppIcon.appiconset\[email protected] (created)
[ +3 ms] flutter_test_app\ios\Runner\Assets.xcassets\AppIcon.appiconset\[email protected] (created)
[ +3 ms] flutter_test_app\ios\Runner\Assets.xcassets\AppIcon.appiconset\[email protected] (created)
[ +4 ms] flutter_test_app\ios\Runner\Assets.xcassets\LaunchImage.imageset\Contents.json (created)
[ +3 ms] flutter_test_app\ios\Runner\Assets.xcassets\LaunchImage.imageset\LaunchImage.png (created)
[ +4 ms] flutter_test_app\ios\Runner\Assets.xcassets\LaunchImage.imageset\[email protected] (created)
[ +4 ms] flutter_test_app\ios\Runner\Assets.xcassets\LaunchImage.imageset\[email protected] (created)
[ +3 ms] flutter_test_app\ios\Runner\Assets.xcassets\LaunchImage.imageset\README.md (created)
[ +3 ms] flutter_test_app\ios\Runner\Base.lproj\LaunchScreen.storyboard (created)
[ +3 ms] flutter_test_app\ios\Runner\Base.lproj\Main.storyboard (created)
[ +3 ms] flutter_test_app\ios\Runner\Info.plist (created)
[ +4 ms] flutter_test_app\ios\Runner.xcodeproj\project.xcworkspace\contents.xcworkspacedata (created)
[ +3 ms] flutter_test_app\ios\Runner.xcodeproj\xcshareddata\xcschemes\Runner.xcscheme (created)
[ +4 ms] flutter_test_app\ios\Runner.xcworkspace\contents.xcworkspacedata (created)
[ +3 ms] flutter_test_app\lib\main.dart (created)
[ +7 ms] flutter_test_app\flutter_test_app.iml (created)
[ +3 ms] flutter_test_app\flutter_test_app_android.iml (created)
[ +3 ms] flutter_test_app\pubspec.yaml (created)
[ +3 ms] flutter_test_app\README.md (created)
[ +4 ms] flutter_test_app\test\widget_test.dart (created)
[ +21 ms] Wrote 65 files.
[ +5 ms] Running "flutter packages get" in flutter_test_app...
[ +4 ms] Using C:\Users\i01002704\AppData\Local\flutter\.pub-cache for the pub cache.
[ +4 ms] [C:\Users\i01002704\Documents\i01002704\Projects\Android\flutter_test_app\] C:\Users\i01002704\AppData\Local\flutter\bin\cache\dart-sdk\bin\pub.bat --verbosity=warning --verbose get --no-precompile
[+64423 ms] Got TLS error trying to find package cupertino_icons at https://pub.dartlang.org.
[ +23 ms] pub get failed (69) -- attempting retry 1 in 1 second..."><pre class="notranslate"><code class="notranslate">[ +28 ms] [C:\Users\i01002704\AppData\Local\flutter\] git rev-parse --abbrev-ref --symbolic @{u}
[ +93 ms] Exit code 0 from: git rev-parse --abbrev-ref --symbolic @{u}
[ +1 ms] origin/beta
[ +2 ms] [C:\Users\i01002704\AppData\Local\flutter\] git rev-parse --abbrev-ref HEAD
[ +58 ms] Exit code 0 from: git rev-parse --abbrev-ref HEAD
[ +1 ms] beta
[ +3 ms] [C:\Users\i01002704\AppData\Local\flutter\] git ls-remote --get-url origin
[ +67 ms] Exit code 0 from: git ls-remote --get-url origin
[ +1 ms] https://github.com/flutter/flutter.git
[ +2 ms] [C:\Users\i01002704\AppData\Local\flutter\] git log -n 1 --pretty=format:%H
[ +54 ms] Exit code 0 from: git log -n 1 --pretty=format:%H
[ +1 ms] b397406561f5e7a9c94e28f58d9e49fca0dd58b7
[ +2 ms] [C:\Users\i01002704\AppData\Local\flutter\] git log -n 1 --pretty=format:%ar
[ +51 ms] Exit code 0 from: git log -n 1 --pretty=format:%ar
[ +1 ms] 9 days ago
[ +2 ms] [C:\Users\i01002704\AppData\Local\flutter\] git describe --match v*.*.* --first-parent --long --tags
[ +50 ms] Exit code 0 from: git describe --match v*.*.* --first-parent --long --tags
[ +1 ms] v0.2.8-0-gb39740656
[ +437 ms] Creating project flutter_test_app...
[ +26 ms] flutter_test_app\.gitignore (created)
[ +19 ms] flutter_test_app\.idea\libraries\Dart_SDK.xml (created)
[ +12 ms] flutter_test_app\.idea\libraries\Flutter_for_Android.xml (created)
[ +3 ms] flutter_test_app\.idea\modules.xml (created)
[ +5 ms] flutter_test_app\.idea\runConfigurations\main_dart.xml (created)
[ +4 ms] flutter_test_app\.idea\workspace.xml (created)
[ +5 ms] flutter_test_app\.metadata (created)
[ +3 ms] flutter_test_app\android\app\build.gradle (created)
[ +5 ms] flutter_test_app\android\app\src\main\java\com\example\fluttertestapp\MainActivity.java (created)
[ +6 ms] flutter_test_app\android\build.gradle (created)
[ +5 ms] flutter_test_app\android\.gitignore (created)
[ +2 ms] flutter_test_app\android\app\src\main\AndroidManifest.xml (created)
[ +3 ms] flutter_test_app\android\app\src\main\res\drawable\launch_background.xml (created)
[ +4 ms] flutter_test_app\android\app\src\main\res\mipmap-hdpi\ic_launcher.png (created)
[ +4 ms] flutter_test_app\android\app\src\main\res\mipmap-mdpi\ic_launcher.png (created)
[ +3 ms] flutter_test_app\android\app\src\main\res\mipmap-xhdpi\ic_launcher.png (created)
[ +3 ms] flutter_test_app\android\app\src\main\res\mipmap-xxhdpi\ic_launcher.png (created)
[ +5 ms] flutter_test_app\android\app\src\main\res\mipmap-xxxhdpi\ic_launcher.png (created)
[ +3 ms] flutter_test_app\android\app\src\main\res\values\styles.xml (created)
[ +4 ms] flutter_test_app\android\gradle\wrapper\gradle-wrapper.properties (created)
[ +3 ms] flutter_test_app\android\gradle.properties (created)
[ +5 ms] flutter_test_app\android\settings.gradle (created)
[ +3 ms] flutter_test_app\ios\Runner\AppDelegate.h (created)
[ +3 ms] flutter_test_app\ios\Runner\AppDelegate.m (created)
[ +2 ms] flutter_test_app\ios\Runner\main.m (created)
[ +3 ms] flutter_test_app\ios\Runner.xcodeproj\project.pbxproj (created)
[ +15 ms] flutter_test_app\ios\.gitignore (created)
[ +3 ms] flutter_test_app\ios\Flutter\AppFrameworkInfo.plist (created)
[ +3 ms] flutter_test_app\ios\Flutter\Debug.xcconfig (created)
[ +2 ms] flutter_test_app\ios\Flutter\Release.xcconfig (created)
[ +3 ms] flutter_test_app\ios\Runner\Assets.xcassets\AppIcon.appiconset\Contents.json (created)
[ +4 ms] flutter_test_app\ios\Runner\Assets.xcassets\AppIcon.appiconset\[email protected] (created)
[ +3 ms] flutter_test_app\ios\Runner\Assets.xcassets\AppIcon.appiconset\[email protected] (created)
[ +3 ms] flutter_test_app\ios\Runner\Assets.xcassets\AppIcon.appiconset\[email protected] (created)
[ +3 ms] flutter_test_app\ios\Runner\Assets.xcassets\AppIcon.appiconset\[email protected] (created)
[ +3 ms] flutter_test_app\ios\Runner\Assets.xcassets\AppIcon.appiconset\[email protected] (created)
[ +4 ms] flutter_test_app\ios\Runner\Assets.xcassets\AppIcon.appiconset\[email protected] (created)
[ +3 ms] flutter_test_app\ios\Runner\Assets.xcassets\AppIcon.appiconset\[email protected] (created)
[ +3 ms] flutter_test_app\ios\Runner\Assets.xcassets\AppIcon.appiconset\[email protected] (created)
[ +3 ms] flutter_test_app\ios\Runner\Assets.xcassets\AppIcon.appiconset\[email protected] (created)
[ +3 ms] flutter_test_app\ios\Runner\Assets.xcassets\AppIcon.appiconset\[email protected] (created)
[ +4 ms] flutter_test_app\ios\Runner\Assets.xcassets\AppIcon.appiconset\[email protected] (created)
[ +3 ms] flutter_test_app\ios\Runner\Assets.xcassets\AppIcon.appiconset\[email protected] (created)
[ +3 ms] flutter_test_app\ios\Runner\Assets.xcassets\AppIcon.appiconset\[email protected] (created)
[ +3 ms] flutter_test_app\ios\Runner\Assets.xcassets\AppIcon.appiconset\[email protected] (created)
[ +3 ms] flutter_test_app\ios\Runner\Assets.xcassets\AppIcon.appiconset\[email protected] (created)
[ +4 ms] flutter_test_app\ios\Runner\Assets.xcassets\LaunchImage.imageset\Contents.json (created)
[ +3 ms] flutter_test_app\ios\Runner\Assets.xcassets\LaunchImage.imageset\LaunchImage.png (created)
[ +4 ms] flutter_test_app\ios\Runner\Assets.xcassets\LaunchImage.imageset\[email protected] (created)
[ +4 ms] flutter_test_app\ios\Runner\Assets.xcassets\LaunchImage.imageset\[email protected] (created)
[ +3 ms] flutter_test_app\ios\Runner\Assets.xcassets\LaunchImage.imageset\README.md (created)
[ +3 ms] flutter_test_app\ios\Runner\Base.lproj\LaunchScreen.storyboard (created)
[ +3 ms] flutter_test_app\ios\Runner\Base.lproj\Main.storyboard (created)
[ +3 ms] flutter_test_app\ios\Runner\Info.plist (created)
[ +4 ms] flutter_test_app\ios\Runner.xcodeproj\project.xcworkspace\contents.xcworkspacedata (created)
[ +3 ms] flutter_test_app\ios\Runner.xcodeproj\xcshareddata\xcschemes\Runner.xcscheme (created)
[ +4 ms] flutter_test_app\ios\Runner.xcworkspace\contents.xcworkspacedata (created)
[ +3 ms] flutter_test_app\lib\main.dart (created)
[ +7 ms] flutter_test_app\flutter_test_app.iml (created)
[ +3 ms] flutter_test_app\flutter_test_app_android.iml (created)
[ +3 ms] flutter_test_app\pubspec.yaml (created)
[ +3 ms] flutter_test_app\README.md (created)
[ +4 ms] flutter_test_app\test\widget_test.dart (created)
[ +21 ms] Wrote 65 files.
[ +5 ms] Running "flutter packages get" in flutter_test_app...
[ +4 ms] Using C:\Users\i01002704\AppData\Local\flutter\.pub-cache for the pub cache.
[ +4 ms] [C:\Users\i01002704\Documents\i01002704\Projects\Android\flutter_test_app\] C:\Users\i01002704\AppData\Local\flutter\bin\cache\dart-sdk\bin\pub.bat --verbosity=warning --verbose get --no-precompile
[+64423 ms] Got TLS error trying to find package cupertino_icons at https://pub.dartlang.org.
[ +23 ms] pub get failed (69) -- attempting retry 1 in 1 second...
</code></pre></div>
<h2 dir="auto">Flutter Doctor</h2>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="[√] Flutter (Channel beta, v0.2.8, on Microsoft Windows [Version 10.0.15063], locale de-DE)
• Flutter version 0.2.8 at C:\Users\i01002704\AppData\Local\flutter
• Framework revision b397406561 (9 days ago), 2018-04-02 13:53:20 -0700
• Engine revision c903c217a1
• Dart version 2.0.0-dev.43.0.flutter-52afcba357
[!] Android toolchain - develop for Android devices (Android SDK 27.0.3)
• Android SDK at C:\Users\i01002704\AppData\Local\Android\sdk
• Android NDK location not configured (optional; useful for native profiling support)
• Platform android-P, build-tools 27.0.3
• Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1024-b02)
X Android license status unknown.
[√] Android Studio (version 3.1)
• Android Studio at C:\Program Files\Android\Android Studio
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1024-b02)
[!] IntelliJ IDEA Community Edition (version 2017.3)
• IntelliJ at C:\Users\i01002704\AppData\Local\JetBrains\Toolbox\apps\IDEA-C\ch-0\173.4674.33
X Flutter plugin not installed; this adds Flutter specific functionality.
X Dart plugin not installed; this adds Dart specific functionality.
• For information about installing plugins, see
https://flutter.io/intellij-setup/#installing-the-plugins
[!] VS Code, 64-bit edition (version 1.22.1)
• VS Code at C:\Program Files\Microsoft VS Code
• Dart Code extension not installed; install from
https://marketplace.visualstudio.com/items?itemName=Dart-Code.dart-code
[!] Connected devices
! No devices available
! Doctor found issues in 4 categories."><pre class="notranslate"><code class="notranslate">[√] Flutter (Channel beta, v0.2.8, on Microsoft Windows [Version 10.0.15063], locale de-DE)
• Flutter version 0.2.8 at C:\Users\i01002704\AppData\Local\flutter
• Framework revision b397406561 (9 days ago), 2018-04-02 13:53:20 -0700
• Engine revision c903c217a1
• Dart version 2.0.0-dev.43.0.flutter-52afcba357
[!] Android toolchain - develop for Android devices (Android SDK 27.0.3)
• Android SDK at C:\Users\i01002704\AppData\Local\Android\sdk
• Android NDK location not configured (optional; useful for native profiling support)
• Platform android-P, build-tools 27.0.3
• Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1024-b02)
X Android license status unknown.
[√] Android Studio (version 3.1)
• Android Studio at C:\Program Files\Android\Android Studio
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1024-b02)
[!] IntelliJ IDEA Community Edition (version 2017.3)
• IntelliJ at C:\Users\i01002704\AppData\Local\JetBrains\Toolbox\apps\IDEA-C\ch-0\173.4674.33
X Flutter plugin not installed; this adds Flutter specific functionality.
X Dart plugin not installed; this adds Dart specific functionality.
• For information about installing plugins, see
https://flutter.io/intellij-setup/#installing-the-plugins
[!] VS Code, 64-bit edition (version 1.22.1)
• VS Code at C:\Program Files\Microsoft VS Code
• Dart Code extension not installed; install from
https://marketplace.visualstudio.com/items?itemName=Dart-Code.dart-code
[!] Connected devices
! No devices available
! Doctor found issues in 4 categories.
</code></pre></div> | 1 |
<p dir="auto">Choose one: is this a bug report or feature request?</p>
<p dir="auto">Seems like a bug, since it's throwing validation errors from internal code on valid(ish) input, but given <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="165209299" data-permission-text="Title is private" data-url="https://github.com/babel/babel/issues/3575" data-hovercard-type="pull_request" data-hovercard-url="/babel/babel/pull/3575/hovercard" href="https://github.com/babel/babel/pull/3575">#3575</a> my <em>preferred</em> behavior would probably be a feature request.</p>
<h3 dir="auto">Input Code</h3>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="// test.js
import React from "react";
import ReactDOM from "react-dom";
const content = ['Hello ', <b>cruel</b>, ' world'];
const target = <div>{...content}</div>;
ReactDOM.render(target, document.body);"><pre class="notranslate"><span class="pl-c">// test.js</span>
<span class="pl-k">import</span> <span class="pl-v">React</span> <span class="pl-k">from</span> <span class="pl-s">"react"</span><span class="pl-kos">;</span>
<span class="pl-k">import</span> <span class="pl-v">ReactDOM</span> <span class="pl-k">from</span> <span class="pl-s">"react-dom"</span><span class="pl-kos">;</span>
<span class="pl-k">const</span> <span class="pl-s1">content</span> <span class="pl-c1">=</span> <span class="pl-kos">[</span><span class="pl-s">'Hello '</span><span class="pl-kos">,</span> <span class="pl-c1"><</span><span class="pl-ent">b</span><span class="pl-c1">></span>cruel<span class="pl-c1"><</span><span class="pl-c1">/</span><span class="pl-ent">b</span><span class="pl-c1">></span><span class="pl-kos">,</span> <span class="pl-s">' world'</span><span class="pl-kos">]</span><span class="pl-kos">;</span>
<span class="pl-k">const</span> <span class="pl-s1">target</span> <span class="pl-c1">=</span> <span class="pl-c1"><</span><span class="pl-ent">div</span><span class="pl-c1">></span><span class="pl-kos">{</span>...<span class="pl-s1">content</span><span class="pl-kos">}</span><span class="pl-c1"><</span><span class="pl-c1">/</span><span class="pl-ent">div</span><span class="pl-c1">></span><span class="pl-kos">;</span>
<span class="pl-v">ReactDOM</span><span class="pl-kos">.</span><span class="pl-en">render</span><span class="pl-kos">(</span><span class="pl-s1">target</span><span class="pl-kos">,</span> <span class="pl-smi">document</span><span class="pl-kos">.</span><span class="pl-c1">body</span><span class="pl-kos">)</span><span class="pl-kos">;</span></pre></div>
<h3 dir="auto">Babel/Babylon Configuration (.babelrc, package.json, cli command)</h3>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="// .babelrc.js
module.exports = {
presets: ["@babel/react"]
}"><pre class="notranslate"><span class="pl-c">// .babelrc.js</span>
<span class="pl-smi">module</span><span class="pl-kos">.</span><span class="pl-c1">exports</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span>
<span class="pl-c1">presets</span>: <span class="pl-kos">[</span><span class="pl-s">"@babel/react"</span><span class="pl-kos">]</span>
<span class="pl-kos">}</span></pre></div>
<div class="highlight highlight-source-json notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="// package.json
{
"private": true,
"dependencies": {
"react": "^16.2.0",
"react-dom": "^16.2.0"
},
"devDependencies": {
"@babel/core": "7.0.0-beta.35",
"@babel/cli": "7.0.0-beta.35",
"@babel/preset-react": "7.0.0-beta.35",
"@types/react": "^16.0.31",
"@types/react-dom": "^16.0.3"
}
}"><pre class="notranslate"><span class="pl-ii">// package.json</span>
{
<span class="pl-ent">"private"</span>: <span class="pl-c1">true</span>,
<span class="pl-ent">"dependencies"</span>: {
<span class="pl-ent">"react"</span>: <span class="pl-s"><span class="pl-pds">"</span>^16.2.0<span class="pl-pds">"</span></span>,
<span class="pl-ent">"react-dom"</span>: <span class="pl-s"><span class="pl-pds">"</span>^16.2.0<span class="pl-pds">"</span></span>
},
<span class="pl-ent">"devDependencies"</span>: {
<span class="pl-ent">"@babel/core"</span>: <span class="pl-s"><span class="pl-pds">"</span>7.0.0-beta.35<span class="pl-pds">"</span></span>,
<span class="pl-ent">"@babel/cli"</span>: <span class="pl-s"><span class="pl-pds">"</span>7.0.0-beta.35<span class="pl-pds">"</span></span>,
<span class="pl-ent">"@babel/preset-react"</span>: <span class="pl-s"><span class="pl-pds">"</span>7.0.0-beta.35<span class="pl-pds">"</span></span>,
<span class="pl-ent">"@types/react"</span>: <span class="pl-s"><span class="pl-pds">"</span>^16.0.31<span class="pl-pds">"</span></span>,
<span class="pl-ent">"@types/react-dom"</span>: <span class="pl-s"><span class="pl-pds">"</span>^16.0.3<span class="pl-pds">"</span></span>
}
}</pre></div>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="$ babel test.js"><pre class="notranslate"><code class="notranslate">$ babel test.js
</code></pre></div>
<h3 dir="auto">Expected Behavior</h3>
<p dir="auto">I'd prefer output something like:</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="const content = ['Hello ', React.createElement('b', null, 'cruel'), ' world'];
const target = React.createElement('div', null, ...content);
ReactDOM.render(target, document.body);"><pre class="notranslate"><span class="pl-k">const</span> <span class="pl-s1">content</span> <span class="pl-c1">=</span> <span class="pl-kos">[</span><span class="pl-s">'Hello '</span><span class="pl-kos">,</span> <span class="pl-v">React</span><span class="pl-kos">.</span><span class="pl-en">createElement</span><span class="pl-kos">(</span><span class="pl-s">'b'</span><span class="pl-kos">,</span> <span class="pl-c1">null</span><span class="pl-kos">,</span> <span class="pl-s">'cruel'</span><span class="pl-kos">)</span><span class="pl-kos">,</span> <span class="pl-s">' world'</span><span class="pl-kos">]</span><span class="pl-kos">;</span>
<span class="pl-k">const</span> <span class="pl-s1">target</span> <span class="pl-c1">=</span> <span class="pl-v">React</span><span class="pl-kos">.</span><span class="pl-en">createElement</span><span class="pl-kos">(</span><span class="pl-s">'div'</span><span class="pl-kos">,</span> <span class="pl-c1">null</span><span class="pl-kos">,</span> ...<span class="pl-s1">content</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-v">ReactDOM</span><span class="pl-kos">.</span><span class="pl-en">render</span><span class="pl-kos">(</span><span class="pl-s1">target</span><span class="pl-kos">,</span> <span class="pl-smi">document</span><span class="pl-kos">.</span><span class="pl-c1">body</span><span class="pl-kos">)</span><span class="pl-kos">;</span></pre></div>
<p dir="auto">but <code class="notranslate">tsc --jsx react</code> emits without the <code class="notranslate">...</code>, i.e. <code class="notranslate">React.createElement('div', null, content)</code>.</p>
<p dir="auto">More likely, given the discussion in <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="165209299" data-permission-text="Title is private" data-url="https://github.com/babel/babel/issues/3575" data-hovercard-type="pull_request" data-hovercard-url="/babel/babel/pull/3575/hovercard" href="https://github.com/babel/babel/pull/3575">#3575</a>, simply giving a user-facing error message would be preferred? Something like <code class="notranslate">transform-react-jsx does not support '{...children}', use '{children}'</code>?</p>
<h3 dir="auto">Current Behavior</h3>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="C:\code\personal\babel-tsx-parsing>yarn babel src\index.js
yarn run v1.3.2
$ C:\code\personal\babel-tsx-parsing\node_modules\.bin\babel src\index.js
TypeError: Property arguments[2] of CallExpression expected node to be of a type ["Expression","SpreadElement","JSXNamespacedName"] but instead got "JSXSpreadChild"
at validate (C:\code\personal\babel-tsx-parsing\node_modules\@babel\types\lib\definitions\utils.js:88:13)
at validator (C:\code\personal\babel-tsx-parsing\node_modules\@babel\types\lib\definitions\utils.js:47:7)
at Object.validate (C:\code\personal\babel-tsx-parsing\node_modules\@babel\types\lib\definitions\utils.js:143:10)
at validate (C:\code\personal\babel-tsx-parsing\node_modules\@babel\types\lib\validators\validate.js:15:9)
at builder (C:\code\personal\babel-tsx-parsing\node_modules\@babel\types\lib\builders\builder.js:40:27)
at Object.CallExpression (C:\code\personal\babel-tsx-parsing\node_modules\@babel\types\lib\builders\generated\index.js:276:27)
at buildElementCall (C:\code\personal\babel-tsx-parsing\node_modules\@babel\helper-builder-react-jsx\lib\index.js:131:28)
at PluginPass.exit (C:\code\personal\babel-tsx-parsing\node_modules\@babel\helper-builder-react-jsx\lib\index.js:25:22)
at newFn (C:\code\personal\babel-tsx-parsing\node_modules\@babel\traverse\lib\visitors.js:223:21)
at NodePath._call (C:\code\personal\babel-tsx-parsing\node_modules\@babel\traverse\lib\path\context.js:64:19)"><pre class="notranslate"><code class="notranslate">C:\code\personal\babel-tsx-parsing>yarn babel src\index.js
yarn run v1.3.2
$ C:\code\personal\babel-tsx-parsing\node_modules\.bin\babel src\index.js
TypeError: Property arguments[2] of CallExpression expected node to be of a type ["Expression","SpreadElement","JSXNamespacedName"] but instead got "JSXSpreadChild"
at validate (C:\code\personal\babel-tsx-parsing\node_modules\@babel\types\lib\definitions\utils.js:88:13)
at validator (C:\code\personal\babel-tsx-parsing\node_modules\@babel\types\lib\definitions\utils.js:47:7)
at Object.validate (C:\code\personal\babel-tsx-parsing\node_modules\@babel\types\lib\definitions\utils.js:143:10)
at validate (C:\code\personal\babel-tsx-parsing\node_modules\@babel\types\lib\validators\validate.js:15:9)
at builder (C:\code\personal\babel-tsx-parsing\node_modules\@babel\types\lib\builders\builder.js:40:27)
at Object.CallExpression (C:\code\personal\babel-tsx-parsing\node_modules\@babel\types\lib\builders\generated\index.js:276:27)
at buildElementCall (C:\code\personal\babel-tsx-parsing\node_modules\@babel\helper-builder-react-jsx\lib\index.js:131:28)
at PluginPass.exit (C:\code\personal\babel-tsx-parsing\node_modules\@babel\helper-builder-react-jsx\lib\index.js:25:22)
at newFn (C:\code\personal\babel-tsx-parsing\node_modules\@babel\traverse\lib\visitors.js:223:21)
at NodePath._call (C:\code\personal\babel-tsx-parsing\node_modules\@babel\traverse\lib\path\context.js:64:19)
</code></pre></div>
<h3 dir="auto">Context</h3>
<p dir="auto">React seems to distinguish between dynamic array contents (e.g. <code class="notranslate">{arrayProp.map(toChild)}</code>) and direct children only in that the latter do not warn on <code class="notranslate">key</code>, so the simple workaround is remove the <code class="notranslate">...</code> and add keys, or to convert rendering a component.</p>
<p dir="auto">I ran into this while converting some <code class="notranslate">document.createElement()</code> calls that walk a JSON description, so I was trying to avoid changing structure too much, and I don't have meaningful keys in the source yet.</p>
<h3 dir="auto">Your Environment</h3>
<table role="table">
<thead>
<tr>
<th>software</th>
<th>version(s)</th>
</tr>
</thead>
<tbody>
<tr>
<td>Babel</td>
<td>7.0.0-beta.32 ... .35</td>
</tr>
<tr>
<td>node</td>
<td>v6.11.4</td>
</tr>
<tr>
<td>npm</td>
<td>yarn 1.3.2</td>
</tr>
<tr>
<td>Operating System</td>
<td>Windows 10</td>
</tr>
</tbody>
</table> | <h3 dir="auto"><g-emoji class="g-emoji" alias="computer" fallback-src="https://github.githubassets.com/images/icons/emoji/unicode/1f4bb.png">💻</g-emoji></h3>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> Would you like to work on a fix?</li>
</ul>
<h3 dir="auto">How are you using Babel?</h3>
<p dir="auto">@rollup/plugin-babel</p>
<h3 dir="auto">Input code</h3>
<p dir="auto"><a href="https://babeljs.io/repl#?browsers=defaults&build=&builtIns=false&corejs=3.6&spec=false&loose=true&code_lz=CYUwxgNghgTiAEkoGdnwILwN4F8BQeAZgK4B2YALgJYD2pG8AFAJTY5A&debug=false&forceAllTransforms=false&shippedProposals=false&circleciRepo=&evaluate=false&fileSize=false&timeTravel=false&sourceType=module&lineWrap=false&presets=typescript&prettier=false&targets=&version=7.15.5&externalPlugins=%40babel%2Fplugin-transform-typescript%407.13.0&assumptions=%7B%7D" rel="nofollow">REPL</a></p>
<div class="highlight highlight-source-ts notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="declare class A {}
function A () {}"><pre class="notranslate"><span class="pl-k">declare</span> <span class="pl-k">class</span> <span class="pl-smi">A</span> <span class="pl-kos">{</span><span class="pl-kos">}</span>
<span class="pl-k">function</span> <span class="pl-smi">A</span> <span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">{</span><span class="pl-kos">}</span></pre></div>
<h3 dir="auto">Configuration file name</h3>
<p dir="auto">.babelrc</p>
<h3 dir="auto">Configuration</h3>
<div class="highlight highlight-source-json notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="{
"presets": ["@babel/preset-typescript"]
}"><pre class="notranslate">{
<span class="pl-ent">"presets"</span>: [<span class="pl-s"><span class="pl-pds">"</span>@babel/preset-typescript<span class="pl-pds">"</span></span>]
}</pre></div>
<h3 dir="auto">Current and expected behavior</h3>
<p dir="auto">I expect this construction to be compiled correctly because <code class="notranslate">tsc</code> <a href="https://www.typescriptlang.org/play?#code/CYUwxgNghgTiAEkoGdnwILwN4F8BQeAZgK4B2YALgJYD2pG8AFAJTY5A" rel="nofollow">can</a> do it. However, currently Babel throws an error:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Duplicate declaration "A"
1 | declare class A {}
2 |
> 3 | function A () {}
| "><pre class="notranslate"><code class="notranslate">Duplicate declaration "A"
1 | declare class A {}
2 |
> 3 | function A () {}
|
</code></pre></div>
<h3 dir="auto">Environment</h3>
<ul dir="auto">
<li>Babel version(s): 7.15.5</li>
<li>Node: 16</li>
<li>npm: 7</li>
<li>OS: Windows 10</li>
<li>Monorepo: no</li>
</ul>
<h3 dir="auto">Possible solution</h3>
<p dir="auto"><em>No response</em></p>
<h3 dir="auto">Additional context</h3>
<p dir="auto"><em>No response</em></p> | 0 |
<p dir="auto">I have a service, which is a class that internally uses Http:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="@Injectable()
export class ProductService{
constructor( private http: Http){}
getProductByID(productID: string): Observable{
return this.http.get(`/products/${productID}`)
.map(res => res.json());
}
}"><pre class="notranslate"><code class="notranslate">@Injectable()
export class ProductService{
constructor( private http: Http){}
getProductByID(productID: string): Observable{
return this.http.get(`/products/${productID}`)
.map(res => res.json());
}
}
</code></pre></div>
<p dir="auto">To use this service, an external component must specify [HTTP_PROVIDERS]. This breaks encapsulation of my ProductService (a.k.a. Leaky Abstraction): now it's not a reusable black box but has strings attached. If I decide to replace Http with another service in the above code, the external component must modify its code as well. It would be nice if there was a way to allow a class (not a component) to specify its own providers.</p>
<p dir="auto">Am I asking for too much? :)</p> | <p dir="auto">In the new typings files for http the following lines</p>
<ul dir="auto">
<li><code class="notranslate">type-alias RequestOptionsArgs;</code></li>
<li><code class="notranslate">type-alias ResponseOptionsArgs;</code></li>
</ul>
<p dir="auto">are throwing this error message</p>
<p dir="auto"><code class="notranslate">typings/angular2/http.d.ts(367,16): error TS1005: ';' expected.</code><br>
<code class="notranslate">typings/angular2/http.d.ts(374,16): error TS1005: ';' expected.</code></p>
<p dir="auto">One solution is to comment/remove them.</p>
<p dir="auto">The file is the one obtained doing</p>
<p dir="auto"><code class="notranslate">npm install [email protected]</code></p>
<p dir="auto">See <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="102011506" data-permission-text="Title is private" data-url="https://github.com/angular/angular/issues/3733" data-hovercard-type="issue" data-hovercard-url="/angular/angular/issues/3733/hovercard" href="https://github.com/angular/angular/issues/3733">#3733</a><br>
and <a href="https://gitter.im/angular/angular?at=55d4b40d1ba62e4a21fa68cc" rel="nofollow">https://gitter.im/angular/angular?at=55d4b40d1ba62e4a21fa68cc</a></p> | 0 |
<h3 dir="auto">Problem description</h3>
<p dir="auto">When navigating through forms, tabbing into a <code class="notranslate">Toggle</code> element displays a rectangular translucent square imposed on top of the switch. I think we could do better than this. It could at least be the circular like the switch is.</p>
<h3 dir="auto">Steps to reproduce</h3>
<p dir="auto">Go to <a href="http://www.material-ui.com/#/components/toggle" rel="nofollow">http://www.material-ui.com/#/components/toggle</a> and <kbd>tab</kbd> through the Examples section.</p>
<h3 dir="auto">Versions</h3>
<ul dir="auto">
<li>Material-UI: 0.15.3</li>
<li>React: 15.3.0</li>
<li>Browser: Chrome</li>
</ul>
<h3 dir="auto">Images & references</h3>
<p dir="auto">Default State:</p>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://cloud.githubusercontent.com/assets/1571918/17454600/2f2a2934-5b51-11e6-9461-c547655d478b.png"><img width="423" alt="screen shot 2016-08-05 at 9 11 16 pm" src="https://cloud.githubusercontent.com/assets/1571918/17454600/2f2a2934-5b51-11e6-9461-c547655d478b.png" style="max-width: 100%;"></a></p>
<p dir="auto">Keyboard Focus State:</p>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://cloud.githubusercontent.com/assets/1571918/17454602/372fe7e0-5b51-11e6-8b9a-99ba590ae725.png"><img width="417" alt="screen shot 2016-08-05 at 9 11 10 pm" src="https://cloud.githubusercontent.com/assets/1571918/17454602/372fe7e0-5b51-11e6-8b9a-99ba590ae725.png" style="max-width: 100%;"></a></p>
<p dir="auto">My recommendation would be to make it look similar to disabled state, possibly a different shade of gray.</p>
<p dir="auto">Disabled state:</p>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://cloud.githubusercontent.com/assets/1571918/17454629/fabf50c4-5b51-11e6-8552-88a8eb33b777.png"><img width="266" alt="screen shot 2016-08-05 at 9 17 02 pm" src="https://cloud.githubusercontent.com/assets/1571918/17454629/fabf50c4-5b51-11e6-8552-88a8eb33b777.png" style="max-width: 100%;"></a></p>
<p dir="auto">I'd be happy to PR this once consensus is reached on how focus state should be rendered.</p> | <h3 dir="auto">Problem description</h3>
<p dir="auto">I have a form with multiple fields. It's easy to use the keyboard to switch between fields, however when the focus switches to the toggle field, it's impossible to tell.</p>
<h3 dir="auto">Steps to reproduce</h3>
<p dir="auto">Create a form with a textfield and a toggle. Use tab to change focus.</p>
<h3 dir="auto">Versions</h3>
<ul dir="auto">
<li>Material-UI: 0.15.0</li>
<li>React: 15.1.0</li>
<li>Browser: Chrome, 50.0.2661.102</li>
</ul> | 1 |
<h3 dir="auto">System info</h3>
<ul dir="auto">
<li>Playwright Version: [v1.35.1]</li>
<li>Operating System: [macOS 13.2]</li>
<li>Browser: [All]</li>
<li>Other info:</li>
</ul>
<h3 dir="auto">Source code</h3>
<ul dir="auto">
<li>[/] I provided exact source code that allows reproducing the issue locally.</li>
</ul>
<p dir="auto"><strong>Test file (self-contained)</strong></p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="// loginPage fixture file
async setExtraHTTPHeaders(): Promise<void> {
await this.page.setExtraHTTPHeaders({ "Client-Id": "", "Client-Secret": "" });
await this.page.route(/(https:\/\/(.*))/, (route) => {
const headers = route.request().headers();
headers["token"] = process.env.token ?? "";
headers["secret"] = process.env.secret ?? "";
route.continue({ headers });
});
}
async navigateTo(path?: string): Promise<void> {
await this.setExtraHTTPHeaders();
await this.page.goto("https://www.google.com")
}
// test file
test("@GCC-demo ABC", async ({ loginPage }) => {
test.setTimeout(10 * 1000);
await test.step("demo1", async () => {
await loginPage.navigateTo();
});
});"><pre class="notranslate"><span class="pl-c">// loginPage fixture file</span>
<span class="pl-k">async</span> <span class="pl-s1">setExtraHTTPHeaders</span><span class="pl-kos">(</span><span class="pl-kos">)</span>: <span class="pl-v">Promise</span><span class="pl-c1"><</span><span class="pl-k">void</span><span class="pl-c1">></span> <span class="pl-kos">{</span>
<span class="pl-s1">await</span> <span class="pl-s1">this</span><span class="pl-kos">.</span><span class="pl-s1">page</span><span class="pl-kos">.</span><span class="pl-en">setExtraHTTPHeaders</span><span class="pl-kos">(</span><span class="pl-kos">{</span> <span class="pl-s">"Client-Id"</span>: ""<span class="pl-kos">,</span> <span class="pl-s">"Client-Secret"</span>: "<span class="pl-s">" });</span>
<span class="pl-s"> await this.page.route(/(https:\/\/(.*))/, (route) => {</span>
<span class="pl-s"> const headers = route.request().headers();</span>
<span class="pl-s"> headers["</span><span class="pl-s1">token</span><span class="pl-s">"] = process.env.token ?? "</span><span class="pl-s">";</span>
<span class="pl-s"> headers["</span><span class="pl-s1">secret</span><span class="pl-s">"] = process.env.secret ?? "</span><span class="pl-s">";</span>
<span class="pl-s"> route.continue({ headers });</span>
<span class="pl-s"> });</span>
<span class="pl-s"> }</span>
<span class="pl-s"></span>
<span class="pl-s"> async navigateTo(path?: string): Promise<void> {</span>
<span class="pl-s"> await this.setExtraHTTPHeaders();</span>
<span class="pl-s"> await this.page.goto("</span><span class="pl-c1">https</span>:<span class="pl-c">//www.google.com")</span>
<span class="pl-kos">}</span>
<span class="pl-c">// test file</span>
<span class="pl-s1">test</span><span class="pl-kos">(</span>"@<span class="pl-c1">GCC</span><span class="pl-c1">-</span><span class="pl-s1">demo</span> <span class="pl-c1">ABC</span>"<span class="pl-kos">,</span> <span class="pl-s1">async</span> <span class="pl-kos">(</span><span class="pl-kos">{</span> loginPage <span class="pl-kos">}</span><span class="pl-kos">)</span> <span class="pl-c1">=></span> <span class="pl-kos">{</span>
<span class="pl-s1">test</span><span class="pl-kos">.</span><span class="pl-en">setTimeout</span><span class="pl-kos">(</span><span class="pl-c1">10</span> <span class="pl-c1">*</span> <span class="pl-c1">1000</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-k">await</span> <span class="pl-s1">test</span><span class="pl-kos">.</span><span class="pl-en">step</span><span class="pl-kos">(</span><span class="pl-s">"demo1"</span><span class="pl-kos">,</span> <span class="pl-k">async</span> <span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-c1">=></span> <span class="pl-kos">{</span>
<span class="pl-k">await</span> <span class="pl-s1">loginPage</span><span class="pl-kos">.</span><span class="pl-en">navigateTo</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">;</span></pre></div>
<p dir="auto"><strong>Steps</strong></p>
<ul dir="auto">
<li>[Run the test]</li>
<li>Please refer to related <a href="https://github.com/microsoft/playwright/issues/22786" data-hovercard-type="issue" data-hovercard-url="/microsoft/playwright/issues/22786/hovercard">issue</a></li>
</ul>
<p dir="auto"><strong>Expected</strong><br>
It should not display the route.continue outside of the test step<br>
<a target="_blank" rel="noopener noreferrer" href="https://user-images.githubusercontent.com/17619539/247895542-bd0a5dd5-f1f4-417c-b2e7-2ba68cfac561.png"><img width="370" alt="image" src="https://user-images.githubusercontent.com/17619539/247895542-bd0a5dd5-f1f4-417c-b2e7-2ba68cfac561.png" style="max-width: 100%;"></a></p>
<p dir="auto"><strong>Actual</strong><br>
<a target="_blank" rel="noopener noreferrer" href="https://user-images.githubusercontent.com/17619539/247895064-72783022-67c7-45fd-bc8b-a1457dab812f.png"><img width="335" alt="image" src="https://user-images.githubusercontent.com/17619539/247895064-72783022-67c7-45fd-bc8b-a1457dab812f.png" style="max-width: 100%;"></a></p> | <p dir="auto"><strong>Context:</strong></p>
<ul dir="auto">
<li>Playwright Version: 1.23.1</li>
<li>Operating System: Linux (ubuntu)</li>
<li>Node.js version: 14.19.1</li>
<li>Browser: Chromium</li>
</ul>
<p dir="auto"><strong>Code Snippet</strong><br>
Repro repo: <a href="https://github.com/thdk/playwright-headless-popup">https://github.com/thdk/playwright-headless-popup</a></p>
<p dir="auto"><strong>Describe the bug</strong><br>
I think this issue is a duplicate of closed issue <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="1149466353" data-permission-text="Title is private" data-url="https://github.com/microsoft/playwright/issues/12342" data-hovercard-type="issue" data-hovercard-url="/microsoft/playwright/issues/12342/hovercard" href="https://github.com/microsoft/playwright/issues/12342">#12342</a></p>
<p dir="auto">The problem seems to be that popups won't open in headless mode when they are not initiated from a <code class="notranslate">button</code> element.</p>
<p dir="auto">This is probably by design. So I'm mainly writing this here as documentation.</p>
<p dir="auto"><strong>If your popup is not opening in headless playwright tests:</strong><br>
Make sure the click event is on a <code class="notranslate">button</code>.</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="<button onClick={() => openPopup();}>click me</button>"><pre class="notranslate"><span class="pl-c1"><</span><span class="pl-ent">button</span> <span class="pl-c1">onClick</span><span class="pl-c1">=</span><span class="pl-kos">{</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-c1">=></span> <span class="pl-en">openPopup</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span><span class="pl-kos">}</span><span class="pl-c1">></span>click me<span class="pl-c1"><</span><span class="pl-c1">/</span><span class="pl-ent">button</span><span class="pl-c1">></span></pre></div>
<p dir="auto">Playwright seems not to open the popup in headless mode when a <code class="notranslate">div</code> element is clicked.</p> | 0 |
<p dir="auto">With PANDAS 1.5.3 (and Seaborn 0.11.2, Matplotlib 3.7.1), the following code works fine:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="import seaborn as sns
sns.jointplot(x=[1,3,2], y=[1,2,3])"><pre class="notranslate"><code class="notranslate">import seaborn as sns
sns.jointplot(x=[1,3,2], y=[1,2,3])
</code></pre></div>
<p dir="auto">But with PANDAS 2.0.0 the identical code raises an exception:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="OptionError: No such keys(s): 'mode.use_inf_as_null'"><pre class="notranslate"><code class="notranslate">OptionError: No such keys(s): 'mode.use_inf_as_null'
</code></pre></div>
<p dir="auto">Here's the full output:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="File ~/.../venv/lib/python3.10/site-packages/seaborn/_decorators.py:46, in _deprecate_positional_args.<locals>.inner_f(*args, **kwargs)
36 warnings.warn(
37 "Pass the following variable{} as {}keyword arg{}: {}. "
38 "From version 0.12, the only valid positional argument "
(...)
43 FutureWarning
44 )
45 kwargs.update({k: arg for k, arg in zip(sig.parameters, args)})
---> 46 return f(**kwargs)
File ~/.../venv/lib/python3.10/site-packages/seaborn/axisgrid.py:2254, in jointplot(x, y, data, kind, color, height, ratio, space, dropna, xlim, ylim, marginal_ticks, joint_kws, marginal_kws, hue, palette, hue_order, hue_norm, **kwargs)
2251 marginal_kws.setdefault("fill", True)
2253 marginal_kws.setdefault("color", color)
-> 2254 grid.plot_marginals(marg_func, **marginal_kws)
2256 elif kind.startswith("hist"):
2257
2258 # TODO process pair parameters for bins, etc. and pass
2259 # to both jount and marginal plots
2261 joint_kws.setdefault("color", color)
File ~/.../venv/lib/python3.10/site-packages/seaborn/axisgrid.py:1857, in JointGrid.plot_marginals(self, func, **kwargs)
1854 orient_kw_y = {"vertical": True}
1856 if seaborn_func:
-> 1857 func(x=self.x, ax=self.ax_marg_x, **kwargs)
1858 else:
1859 plt.sca(self.ax_marg_x)
File ~/.../venv/lib/python3.10/site-packages/seaborn/distributions.py:1462, in histplot(data, x, y, hue, weights, stat, bins, binwidth, binrange, discrete, cumulative, common_bins, common_norm, multiple, element, fill, shrink, kde, kde_kws, line_kws, thresh, pthresh, pmax, cbar, cbar_ax, cbar_kws, palette, hue_order, hue_norm, color, log_scale, legend, ax, **kwargs)
1451 estimate_kws = dict(
1452 stat=stat,
1453 bins=bins,
(...)
1457 cumulative=cumulative,
1458 )
1460 if p.univariate:
-> 1462 p.plot_univariate_histogram(
1463 multiple=multiple,
1464 element=element,
1465 fill=fill,
1466 shrink=shrink,
1467 common_norm=common_norm,
1468 common_bins=common_bins,
1469 kde=kde,
1470 kde_kws=kde_kws,
1471 color=color,
1472 legend=legend,
1473 estimate_kws=estimate_kws,
1474 line_kws=line_kws,
1475 **kwargs,
1476 )
1478 else:
1480 p.plot_bivariate_histogram(
1481 common_bins=common_bins,
1482 common_norm=common_norm,
(...)
1492 **kwargs,
1493 )
File ~/.../venv/lib/python3.10/site-packages/seaborn/distributions.py:428, in _DistributionPlotter.plot_univariate_histogram(self, multiple, element, fill, common_norm, common_bins, shrink, kde, kde_kws, color, legend, line_kws, estimate_kws, **plot_kws)
418 densities = self._compute_univariate_density(
419 self.data_variable,
420 common_norm,
(...)
424 warn_singular=False,
425 )
427 # First pass through the data to compute the histograms
--> 428 for sub_vars, sub_data in self.iter_data("hue", from_comp_data=True):
429
430 # Prepare the relevant data
431 key = tuple(sub_vars.items())
432 sub_data = sub_data.dropna()
File ~/.../venv/lib/python3.10/site-packages/seaborn/_core.py:983, in VectorPlotter.iter_data(self, grouping_vars, reverse, from_comp_data)
978 grouping_vars = [
979 var for var in grouping_vars if var in self.variables
980 ]
982 if from_comp_data:
--> 983 data = self.comp_data
984 else:
985 data = self.plot_data
File ~/.../venv/lib/python3.10/site-packages/seaborn/_core.py:1054, in VectorPlotter.comp_data(self)
1050 axis = getattr(ax, f"{var}axis")
1052 # Use the converter assigned to the axis to get a float representation
1053 # of the data, passing np.nan or pd.NA through (pd.NA becomes np.nan)
-> 1054 with pd.option_context('mode.use_inf_as_null', True):
1055 orig = self.plot_data[var].dropna()
1056 comp_col = pd.Series(index=orig.index, dtype=float, name=var)
File ~/.../venv/lib/python3.10/site-packages/pandas/_config/config.py:441, in option_context.__enter__(self)
440 def __enter__(self) -> None:
--> 441 self.undo = [(pat, _get_option(pat, silent=True)) for pat, val in self.ops]
443 for pat, val in self.ops:
444 _set_option(pat, val, silent=True)
File ~/.../venv/lib/python3.10/site-packages/pandas/_config/config.py:441, in <listcomp>(.0)
440 def __enter__(self) -> None:
--> 441 self.undo = [(pat, _get_option(pat, silent=True)) for pat, val in self.ops]
443 for pat, val in self.ops:
444 _set_option(pat, val, silent=True)
File ~/.../venv/lib/python3.10/site-packages/pandas/_config/config.py:135, in _get_option(pat, silent)
134 def _get_option(pat: str, silent: bool = False) -> Any:
--> 135 key = _get_single_key(pat, silent)
137 # walk the nested dict
138 root, k = _get_root(key)
File ~/.../venv/lib/python3.10/site-packages/pandas/_config/config.py:121, in _get_single_key(pat, silent)
119 if not silent:
120 _warn_if_deprecated(pat)
--> 121 raise OptionError(f"No such keys(s): {repr(pat)}")
122 if len(keys) > 1:
123 raise OptionError("Pattern matched multiple keys")
OptionError: No such keys(s): 'mode.use_inf_as_null'"><pre class="notranslate"><code class="notranslate">File ~/.../venv/lib/python3.10/site-packages/seaborn/_decorators.py:46, in _deprecate_positional_args.<locals>.inner_f(*args, **kwargs)
36 warnings.warn(
37 "Pass the following variable{} as {}keyword arg{}: {}. "
38 "From version 0.12, the only valid positional argument "
(...)
43 FutureWarning
44 )
45 kwargs.update({k: arg for k, arg in zip(sig.parameters, args)})
---> 46 return f(**kwargs)
File ~/.../venv/lib/python3.10/site-packages/seaborn/axisgrid.py:2254, in jointplot(x, y, data, kind, color, height, ratio, space, dropna, xlim, ylim, marginal_ticks, joint_kws, marginal_kws, hue, palette, hue_order, hue_norm, **kwargs)
2251 marginal_kws.setdefault("fill", True)
2253 marginal_kws.setdefault("color", color)
-> 2254 grid.plot_marginals(marg_func, **marginal_kws)
2256 elif kind.startswith("hist"):
2257
2258 # TODO process pair parameters for bins, etc. and pass
2259 # to both jount and marginal plots
2261 joint_kws.setdefault("color", color)
File ~/.../venv/lib/python3.10/site-packages/seaborn/axisgrid.py:1857, in JointGrid.plot_marginals(self, func, **kwargs)
1854 orient_kw_y = {"vertical": True}
1856 if seaborn_func:
-> 1857 func(x=self.x, ax=self.ax_marg_x, **kwargs)
1858 else:
1859 plt.sca(self.ax_marg_x)
File ~/.../venv/lib/python3.10/site-packages/seaborn/distributions.py:1462, in histplot(data, x, y, hue, weights, stat, bins, binwidth, binrange, discrete, cumulative, common_bins, common_norm, multiple, element, fill, shrink, kde, kde_kws, line_kws, thresh, pthresh, pmax, cbar, cbar_ax, cbar_kws, palette, hue_order, hue_norm, color, log_scale, legend, ax, **kwargs)
1451 estimate_kws = dict(
1452 stat=stat,
1453 bins=bins,
(...)
1457 cumulative=cumulative,
1458 )
1460 if p.univariate:
-> 1462 p.plot_univariate_histogram(
1463 multiple=multiple,
1464 element=element,
1465 fill=fill,
1466 shrink=shrink,
1467 common_norm=common_norm,
1468 common_bins=common_bins,
1469 kde=kde,
1470 kde_kws=kde_kws,
1471 color=color,
1472 legend=legend,
1473 estimate_kws=estimate_kws,
1474 line_kws=line_kws,
1475 **kwargs,
1476 )
1478 else:
1480 p.plot_bivariate_histogram(
1481 common_bins=common_bins,
1482 common_norm=common_norm,
(...)
1492 **kwargs,
1493 )
File ~/.../venv/lib/python3.10/site-packages/seaborn/distributions.py:428, in _DistributionPlotter.plot_univariate_histogram(self, multiple, element, fill, common_norm, common_bins, shrink, kde, kde_kws, color, legend, line_kws, estimate_kws, **plot_kws)
418 densities = self._compute_univariate_density(
419 self.data_variable,
420 common_norm,
(...)
424 warn_singular=False,
425 )
427 # First pass through the data to compute the histograms
--> 428 for sub_vars, sub_data in self.iter_data("hue", from_comp_data=True):
429
430 # Prepare the relevant data
431 key = tuple(sub_vars.items())
432 sub_data = sub_data.dropna()
File ~/.../venv/lib/python3.10/site-packages/seaborn/_core.py:983, in VectorPlotter.iter_data(self, grouping_vars, reverse, from_comp_data)
978 grouping_vars = [
979 var for var in grouping_vars if var in self.variables
980 ]
982 if from_comp_data:
--> 983 data = self.comp_data
984 else:
985 data = self.plot_data
File ~/.../venv/lib/python3.10/site-packages/seaborn/_core.py:1054, in VectorPlotter.comp_data(self)
1050 axis = getattr(ax, f"{var}axis")
1052 # Use the converter assigned to the axis to get a float representation
1053 # of the data, passing np.nan or pd.NA through (pd.NA becomes np.nan)
-> 1054 with pd.option_context('mode.use_inf_as_null', True):
1055 orig = self.plot_data[var].dropna()
1056 comp_col = pd.Series(index=orig.index, dtype=float, name=var)
File ~/.../venv/lib/python3.10/site-packages/pandas/_config/config.py:441, in option_context.__enter__(self)
440 def __enter__(self) -> None:
--> 441 self.undo = [(pat, _get_option(pat, silent=True)) for pat, val in self.ops]
443 for pat, val in self.ops:
444 _set_option(pat, val, silent=True)
File ~/.../venv/lib/python3.10/site-packages/pandas/_config/config.py:441, in <listcomp>(.0)
440 def __enter__(self) -> None:
--> 441 self.undo = [(pat, _get_option(pat, silent=True)) for pat, val in self.ops]
443 for pat, val in self.ops:
444 _set_option(pat, val, silent=True)
File ~/.../venv/lib/python3.10/site-packages/pandas/_config/config.py:135, in _get_option(pat, silent)
134 def _get_option(pat: str, silent: bool = False) -> Any:
--> 135 key = _get_single_key(pat, silent)
137 # walk the nested dict
138 root, k = _get_root(key)
File ~/.../venv/lib/python3.10/site-packages/pandas/_config/config.py:121, in _get_single_key(pat, silent)
119 if not silent:
120 _warn_if_deprecated(pat)
--> 121 raise OptionError(f"No such keys(s): {repr(pat)}")
122 if len(keys) > 1:
123 raise OptionError("Pattern matched multiple keys")
OptionError: No such keys(s): 'mode.use_inf_as_null'
</code></pre></div> | <p dir="auto">I am making a joint plot using command -</p>
<p dir="auto">sns.jointplot(xdata,ydata,kind='reg', order=1,color='k',ylim=[-0.62,0.22],xlim=[-16,15],annot_kws={"loc": 4})</p>
<p dir="auto">With the annot_kws, I can move around where the annotation appears, but cannot change the font size. Also, can you select what stats you want to appear?</p>
<p dir="auto">Thanks!</p> | 0 |
<p dir="auto">This seems to be a very inconsistant issue, but I think it's related to macros.</p>
<p dir="auto">Here's an example of a list of comments that don't get parsed properly:</p>
<div class="highlight highlight-source-rust notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="bitflags! {
flags Tests: Test {
/// Test
static TestA = 0x80,
// TODO: Document this.
static TestB = 0x40
}
}"><pre class="notranslate"><span class="pl-en">bitflags</span><span class="pl-en">!</span> <span class="pl-kos">{</span>
flags <span class="pl-v">Tests</span>: <span class="pl-v">Test</span> <span class="pl-kos">{</span>
<span class="pl-c">/// Test</span>
<span class="pl-k">static</span> <span class="pl-v">TestA</span> = <span class="pl-c1">0x80</span>,
<span class="pl-c">// TODO: Document this.</span>
<span class="pl-k">static</span> <span class="pl-v">TestB</span> = <span class="pl-c1">0x40</span>
<span class="pl-kos">}</span>
<span class="pl-kos">}</span></pre></div>
<p dir="auto">This code will error saying "no rules expected the token <code class="notranslate">/// Test</code>".<br>
<a href="http://is.gd/Zkpgvd" rel="nofollow">http://is.gd/Zkpgvd</a></p> | <p dir="auto">This would allow doc comments to parse them as <code class="notranslate">$_:meta</code> elements in macro invocations. This is useful for example with <code class="notranslate">bitflags!</code>:</p>
<div class="highlight highlight-source-rust notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="bitflags! {
#[doc = "Some flags"]
#[doc = ""]
#[doc = "A new line"]
#[deriving(Show)]
flags Flags: u32 {
#[doc = "Flag A"]
static FlagA = 0x00000001,
#[doc = "Flag B"]
static FlagB = 0x00000010
}
}"><pre class="notranslate"><span class="pl-en">bitflags</span><span class="pl-en">!</span> <span class="pl-kos">{</span>
#<span class="pl-kos">[</span>doc = <span class="pl-s">"Some flags"</span><span class="pl-kos">]</span>
#<span class="pl-kos">[</span>doc = <span class="pl-s">""</span><span class="pl-kos">]</span>
#<span class="pl-kos">[</span>doc = <span class="pl-s">"A new line"</span><span class="pl-kos">]</span>
#<span class="pl-kos">[</span>deriving<span class="pl-kos">(</span><span class="pl-v">Show</span><span class="pl-kos">)</span><span class="pl-kos">]</span>
flags <span class="pl-v">Flags</span>: <span class="pl-smi">u32</span> <span class="pl-kos">{</span>
#<span class="pl-kos">[</span>doc = <span class="pl-s">"Flag A"</span><span class="pl-kos">]</span>
<span class="pl-k">static</span> <span class="pl-v">FlagA</span> = <span class="pl-c1">0x00000001</span>,
#<span class="pl-kos">[</span>doc = <span class="pl-s">"Flag B"</span><span class="pl-kos">]</span>
<span class="pl-k">static</span> <span class="pl-v">FlagB</span> = <span class="pl-c1">0x00000010</span>
<span class="pl-kos">}</span>
<span class="pl-kos">}</span></pre></div>
<p dir="auto">vs:</p>
<div class="highlight highlight-source-rust notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="bitflags! {
/// Some flags
///
/// A new line
#[deriving(Show)]
flags Flags: u32 {
/// Flag A
static FlagA = 0x00000001,
/// Flag B
static FlagB = 0x00000010
}
}"><pre class="notranslate"><span class="pl-en">bitflags</span><span class="pl-en">!</span> <span class="pl-kos">{</span>
<span class="pl-c">/// Some flags</span>
///
<span class="pl-c">/// A new line</span>
#<span class="pl-kos">[</span>deriving<span class="pl-kos">(</span><span class="pl-v">Show</span><span class="pl-kos">)</span><span class="pl-kos">]</span>
flags <span class="pl-v">Flags</span>: <span class="pl-smi">u32</span> <span class="pl-kos">{</span>
<span class="pl-c">/// Flag A</span>
<span class="pl-k">static</span> <span class="pl-v">FlagA</span> = <span class="pl-c1">0x00000001</span>,
<span class="pl-c">/// Flag B</span>
<span class="pl-k">static</span> <span class="pl-v">FlagB</span> = <span class="pl-c1">0x00000010</span>
<span class="pl-kos">}</span>
<span class="pl-kos">}</span></pre></div>
<p dir="auto">Where the <code class="notranslate">bitflags!</code> <a href="https://github.com/mozilla/rust/blob/master/src/libstd/bitflags.rs#L108-L110">match rule</a> is defined as:</p>
<div class="highlight highlight-source-rust notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="($(#[$attr:meta])* flags $BitFlags:ident: $T:ty {
$($(#[$Flag_attr:meta])* static $Flag:ident = $value:expr),+
})"><pre class="notranslate"><span class="pl-kos">(</span>$<span class="pl-kos">(</span><span class="pl-c1">#<span class="pl-kos">[</span>$attr<span class="pl-kos">:</span>meta<span class="pl-kos">]</span></span><span class="pl-kos">)</span><span class="pl-c1">*</span> flags $BitFlags<span class="pl-kos">:</span>ident<span class="pl-kos">:</span> $T<span class="pl-kos">:</span>ty <span class="pl-kos">{</span>
$<span class="pl-kos">(</span>$<span class="pl-kos">(</span><span class="pl-c1">#<span class="pl-kos">[</span>$Flag_attr<span class="pl-kos">:</span>meta<span class="pl-kos">]</span></span><span class="pl-kos">)</span><span class="pl-c1">*</span> static $Flag<span class="pl-kos">:</span>ident = $value<span class="pl-kos">:</span>expr<span class="pl-kos">)</span><span class="pl-kos">,</span>+
<span class="pl-kos">}</span><span class="pl-kos">)</span></pre></div> | 1 |
<p dir="auto">I am using Python 3.8.10, seaborn 0.11.2</p>
<p dir="auto">As you can see in the code below, the color (in line_kws) did not render the KDE line. I mean the kde line should be in red instead of blue.</p>
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="import numpy as np
import seaborn as sns
x = np.random.normal(-1,1,1000)
fig, ax = plt.subplots(figsize=(10,10))
sns.histplot(x,kde=True,line_kws={"color":"red","linewidth":3})"><pre class="notranslate"><span class="pl-k">import</span> <span class="pl-s1">numpy</span> <span class="pl-k">as</span> <span class="pl-s1">np</span>
<span class="pl-k">import</span> <span class="pl-s1">seaborn</span> <span class="pl-k">as</span> <span class="pl-s1">sns</span>
<span class="pl-s1">x</span> <span class="pl-c1">=</span> <span class="pl-s1">np</span>.<span class="pl-s1">random</span>.<span class="pl-en">normal</span>(<span class="pl-c1">-</span><span class="pl-c1">1</span>,<span class="pl-c1">1</span>,<span class="pl-c1">1000</span>)
<span class="pl-s1">fig</span>, <span class="pl-s1">ax</span> <span class="pl-c1">=</span> <span class="pl-s1">plt</span>.<span class="pl-en">subplots</span>(<span class="pl-s1">figsize</span><span class="pl-c1">=</span>(<span class="pl-c1">10</span>,<span class="pl-c1">10</span>))
<span class="pl-s1">sns</span>.<span class="pl-en">histplot</span>(<span class="pl-s1">x</span>,<span class="pl-s1">kde</span><span class="pl-c1">=</span><span class="pl-c1">True</span>,<span class="pl-s1">line_kws</span><span class="pl-c1">=</span>{<span class="pl-s">"color"</span>:<span class="pl-s">"red"</span>,<span class="pl-s">"linewidth"</span>:<span class="pl-c1">3</span>})</pre></div> | <p dir="auto">I was trying to give the distribution KDE a different color when I use sns.histplot(),</p>
<p dir="auto">Was thinking kde_kws = {'color': ...} would work, but it didn't.</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="sns.histplot(data=..., kde=True, kde_kws={"color": 'r'})"><pre class="notranslate"><code class="notranslate">sns.histplot(data=..., kde=True, kde_kws={"color": 'r'})
</code></pre></div>
<p dir="auto">File ".../Python-library/seaborn/distributions.py", line 1422, in histplot<br>
p.plot_univariate_histogram(<br>
File ".../Python-library/seaborn/distributions.py", line 414, in plot_univariate_histogram<br>
densities = self._compute_univariate_density(<br>
File ".../Python-library/seaborn/distributions.py", line 283, in _compute_univariate_density<br>
estimator = KDE(**estimate_kws)<br>
TypeError: <strong>init</strong>() got an unexpected keyword argument 'color'</p> | 1 |
<p dir="auto">Hello,</p>
<p dir="auto">I will try to summarize my problem in a simpler one. Suppose an H Hermitian operator that depends on an α parameter<br>
H = H (α), ψ (x) are eigenfunctions of H, ψ = ψ (x, α). Consider the following function<br>
<a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/33531557/100629992-b9822080-3308-11eb-8e82-14c58e2a0e66.gif"><img src="https://user-images.githubusercontent.com/33531557/100629992-b9822080-3308-11eb-8e82-14c58e2a0e66.gif" alt="CodeCogsEqn" data-animated-image="" style="max-width: 100%;"></a><br>
where f(x) is a continuous function.</p>
<p dir="auto">The LinearAlgebra.eigvecs function provides ψ correctly, except that the ψ signal fluctuates randomly by + and -. Which is physically correct, because if ψ is a eigenfunction of H, then -ψ is also a eigenfunction with the same eigenvalue. So for some values of α, ψ is positive and for others negative, this happens randomly. In the end, the function J(α) is full of discontinuities. Is it possible to keep the ψ sign?</p>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/33531557/100631634-b0924e80-330a-11eb-9acd-6e17dd822e6b.gif"><img src="https://user-images.githubusercontent.com/33531557/100631634-b0924e80-330a-11eb-9acd-6e17dd822e6b.gif" alt="sample" data-animated-image="" style="max-width: 100%;"></a></p>
<p dir="auto">Thanks</p> | 1 |
|
<p dir="auto"><a href="http://facebook.github.io/react/docs/interactivity-and-dynamic-uis.html" rel="nofollow">http://facebook.github.io/react/docs/interactivity-and-dynamic-uis.html</a></p>
<p dir="auto">At the end, there is a confusing explanation about "Duplicated data from props" in the section "What Shouldn’t Go in State?":</p>
<blockquote>
<p dir="auto"><strong>Duplicated data from props:</strong> Try to use props as the source of truth where possible. Because props can change over time, it's appropriate to store props in state to be able to know its previous values.</p>
</blockquote>
<p dir="auto">Perhaps what is trying to be said is something like:</p>
<blockquote>
<p dir="auto"><strong>Duplicated data from props:</strong> Try to use props as the source of truth where possible. One valid use to store props in state is to be able to know it's previous values, because props can change over time.</p>
</blockquote> | <p dir="auto">Currently custom html attributes that start with 'x-' are not allowed.</p>
<p dir="auto">Here's a test case: <a href="http://jsbin.com/jehefo/edit?html,js,console" rel="nofollow">http://jsbin.com/jehefo/edit?html,js,console</a></p>
<p dir="auto">Allowing custom attributes would be helpful as for example things like Firefox OS use <code class="notranslate">x-inputmode="digit"</code> to provide a hint that the keyboard should only contain only digits. [1]</p>
<p dir="auto">[1] <a href="http://www.wufoo.com/html5/attributes/23-inputmode.html" rel="nofollow">http://www.wufoo.com/html5/attributes/23-inputmode.html</a></p> | 0 |
<h3 dir="auto">Describe your issue.</h3>
<p dir="auto">I've noticed an inconsistency in the behavior of <code class="notranslate">scipy.sparse</code> objects when using the built-in python operators ("<em>",` "@", "/") to multiply or divide by a vector. The "</em>" operator produces a dot product, as opposed to the expected element-wise multiplication (lines 7-9). The "/" operator, on the other hand, performs the expected element-wise operation with broadcasting (lines 11-12), which may be more confusing since it is not consistent with the "*" operator.</p>
<p dir="auto">I have not tested this behavior across all <code class="notranslate">scipy.sparse</code> matrix types, just the <code class="notranslate">diags</code> used below. I'm happy to submit a PR if this is just a feature that is not yet implemented.</p>
<h3 dir="auto">Reproducing Code Example</h3>
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="[1]>>> import numpy as np
[2]>>> from scipy.sparse import diags
[3]>>> D = diags([1, 1], [-1, 0], shape=(6, 5))
[4]>>> D.toarray()
[4]===
array([[1., 0., 0., 0., 0.],
[1., 1., 0., 0., 0.],
[0., 1., 1., 0., 0.],
[0., 0., 1., 1., 0.],
[0., 0., 0., 1., 1.],
[0., 0., 0., 0., 1.]])
[5]>>> x = 1 + np.arange(D.shape[1])
[6]>>> x
[6]=== array([1, 2, 3, 4, 5])
[7]>>> D * x
[7]=== array([1., 3., 5., 7., 9., 5.])
[8]>>> D @ x
[8]=== array([1., 3., 5., 7., 9., 5.])
[9]>>> D.toarray() * x
[9]===
array([[1., 0., 0., 0., 0.],
[1., 2., 0., 0., 0.],
[0., 2., 3., 0., 0.],
[0., 0., 3., 4., 0.],
[0., 0., 0., 4., 5.],
[0., 0., 0., 0., 5.]])
[10]>>> D.toarray() @ x
[10]=== array([1., 3., 5., 7., 9., 5.])
[11]>>> D / x
[11]===
matrix([[1. , 0. , 0. , 0. , 0. ],
[1. , 0.5 , 0. , 0. , 0. ],
[0. , 0.5 , 0.3333, 0. , 0. ],
[0. , 0. , 0.3333, 0.25 , 0. ],
[0. , 0. , 0. , 0.25 , 0.2 ],
[0. , 0. , 0. , 0. , 0.2 ]])
[12]>>> D.toarray() / x
[12]===
array([[1. , 0. , 0. , 0. , 0. ],
[1. , 0.5 , 0. , 0. , 0. ],
[0. , 0.5 , 0.3333, 0. , 0. ],
[0. , 0. , 0.3333, 0.25 , 0. ],
[0. , 0. , 0. , 0.25 , 0.2 ],
[0. , 0. , 0. , 0. , 0.2 ]])"><pre class="notranslate">[<span class="pl-c1">1</span>]<span class="pl-c1">>></span><span class="pl-c1">></span> <span class="pl-k">import</span> <span class="pl-s1">numpy</span> <span class="pl-k">as</span> <span class="pl-s1">np</span>
[<span class="pl-c1">2</span>]<span class="pl-c1">>></span><span class="pl-s1"></span><span class="pl-c1">></span> <span class="pl-s1">from</span> <span class="pl-s1">scipy</span>.<span class="pl-s1">sparse</span> <span class="pl-s1">import</span> <span class="pl-s1">diags</span>
[<span class="pl-c1">3</span>]<span class="pl-c1">>></span><span class="pl-c1">></span> <span class="pl-v">D</span> <span class="pl-c1">=</span> <span class="pl-en">diags</span>([<span class="pl-c1">1</span>, <span class="pl-c1">1</span>], [<span class="pl-c1">-</span><span class="pl-c1">1</span>, <span class="pl-c1">0</span>], <span class="pl-s1">shape</span><span class="pl-c1">=</span>(<span class="pl-c1">6</span>, <span class="pl-c1">5</span>))
[<span class="pl-c1">4</span>]<span class="pl-c1">>></span><span class="pl-c1">></span> <span class="pl-v">D</span>.<span class="pl-en">toarray</span>()
[<span class="pl-c1">4</span>]<span class="pl-c1">==</span><span class="pl-c1">=</span>
<span class="pl-en">array</span>([[<span class="pl-c1">1.</span>, <span class="pl-c1">0.</span>, <span class="pl-c1">0.</span>, <span class="pl-c1">0.</span>, <span class="pl-c1">0.</span>],
[<span class="pl-c1">1.</span>, <span class="pl-c1">1.</span>, <span class="pl-c1">0.</span>, <span class="pl-c1">0.</span>, <span class="pl-c1">0.</span>],
[<span class="pl-c1">0.</span>, <span class="pl-c1">1.</span>, <span class="pl-c1">1.</span>, <span class="pl-c1">0.</span>, <span class="pl-c1">0.</span>],
[<span class="pl-c1">0.</span>, <span class="pl-c1">0.</span>, <span class="pl-c1">1.</span>, <span class="pl-c1">1.</span>, <span class="pl-c1">0.</span>],
[<span class="pl-c1">0.</span>, <span class="pl-c1">0.</span>, <span class="pl-c1">0.</span>, <span class="pl-c1">1.</span>, <span class="pl-c1">1.</span>],
[<span class="pl-c1">0.</span>, <span class="pl-c1">0.</span>, <span class="pl-c1">0.</span>, <span class="pl-c1">0.</span>, <span class="pl-c1">1.</span>]])
[<span class="pl-c1">5</span>]<span class="pl-c1">>></span><span class="pl-c1">></span> <span class="pl-s1">x</span> <span class="pl-c1">=</span> <span class="pl-c1">1</span> <span class="pl-c1">+</span> <span class="pl-s1">np</span>.<span class="pl-en">arange</span>(<span class="pl-v">D</span>.<span class="pl-s1">shape</span>[<span class="pl-c1">1</span>])
[<span class="pl-c1">6</span>]<span class="pl-c1">>></span><span class="pl-c1">></span> <span class="pl-s1">x</span>
[<span class="pl-c1">6</span>]<span class="pl-c1">==</span><span class="pl-c1">=</span> <span class="pl-en">array</span>([<span class="pl-c1">1</span>, <span class="pl-c1">2</span>, <span class="pl-c1">3</span>, <span class="pl-c1">4</span>, <span class="pl-c1">5</span>])
[<span class="pl-c1">7</span>]<span class="pl-c1">>></span><span class="pl-c1">></span> <span class="pl-v">D</span> <span class="pl-c1">*</span> <span class="pl-s1">x</span>
[<span class="pl-c1">7</span>]<span class="pl-c1">==</span><span class="pl-c1">=</span> <span class="pl-en">array</span>([<span class="pl-c1">1.</span>, <span class="pl-c1">3.</span>, <span class="pl-c1">5.</span>, <span class="pl-c1">7.</span>, <span class="pl-c1">9.</span>, <span class="pl-c1">5.</span>])
[<span class="pl-c1">8</span>]<span class="pl-c1">>></span><span class="pl-c1">></span> <span class="pl-v">D</span> @ <span class="pl-s1">x</span>
[<span class="pl-c1">8</span>]<span class="pl-c1">==</span><span class="pl-c1">=</span> <span class="pl-en">array</span>([<span class="pl-c1">1.</span>, <span class="pl-c1">3.</span>, <span class="pl-c1">5.</span>, <span class="pl-c1">7.</span>, <span class="pl-c1">9.</span>, <span class="pl-c1">5.</span>])
[<span class="pl-c1">9</span>]<span class="pl-c1">>></span><span class="pl-c1">></span> <span class="pl-v">D</span>.<span class="pl-en">toarray</span>() <span class="pl-c1">*</span> <span class="pl-s1">x</span>
[<span class="pl-c1">9</span>]<span class="pl-c1">==</span><span class="pl-c1">=</span>
<span class="pl-en">array</span>([[<span class="pl-c1">1.</span>, <span class="pl-c1">0.</span>, <span class="pl-c1">0.</span>, <span class="pl-c1">0.</span>, <span class="pl-c1">0.</span>],
[<span class="pl-c1">1.</span>, <span class="pl-c1">2.</span>, <span class="pl-c1">0.</span>, <span class="pl-c1">0.</span>, <span class="pl-c1">0.</span>],
[<span class="pl-c1">0.</span>, <span class="pl-c1">2.</span>, <span class="pl-c1">3.</span>, <span class="pl-c1">0.</span>, <span class="pl-c1">0.</span>],
[<span class="pl-c1">0.</span>, <span class="pl-c1">0.</span>, <span class="pl-c1">3.</span>, <span class="pl-c1">4.</span>, <span class="pl-c1">0.</span>],
[<span class="pl-c1">0.</span>, <span class="pl-c1">0.</span>, <span class="pl-c1">0.</span>, <span class="pl-c1">4.</span>, <span class="pl-c1">5.</span>],
[<span class="pl-c1">0.</span>, <span class="pl-c1">0.</span>, <span class="pl-c1">0.</span>, <span class="pl-c1">0.</span>, <span class="pl-c1">5.</span>]])
[<span class="pl-c1">10</span>]<span class="pl-c1">>></span><span class="pl-c1">></span> <span class="pl-v">D</span>.<span class="pl-en">toarray</span>() @ <span class="pl-s1">x</span>
[<span class="pl-c1">10</span>]<span class="pl-c1">==</span><span class="pl-c1">=</span> <span class="pl-en">array</span>([<span class="pl-c1">1.</span>, <span class="pl-c1">3.</span>, <span class="pl-c1">5.</span>, <span class="pl-c1">7.</span>, <span class="pl-c1">9.</span>, <span class="pl-c1">5.</span>])
[<span class="pl-c1">11</span>]<span class="pl-c1">>></span><span class="pl-c1">></span> <span class="pl-v">D</span> <span class="pl-c1">/</span> <span class="pl-s1">x</span>
[<span class="pl-c1">11</span>]<span class="pl-c1">==</span><span class="pl-c1">=</span>
<span class="pl-en">matrix</span>([[<span class="pl-c1">1.</span> , <span class="pl-c1">0.</span> , <span class="pl-c1">0.</span> , <span class="pl-c1">0.</span> , <span class="pl-c1">0.</span> ],
[<span class="pl-c1">1.</span> , <span class="pl-c1">0.5</span> , <span class="pl-c1">0.</span> , <span class="pl-c1">0.</span> , <span class="pl-c1">0.</span> ],
[<span class="pl-c1">0.</span> , <span class="pl-c1">0.5</span> , <span class="pl-c1">0.3333</span>, <span class="pl-c1">0.</span> , <span class="pl-c1">0.</span> ],
[<span class="pl-c1">0.</span> , <span class="pl-c1">0.</span> , <span class="pl-c1">0.3333</span>, <span class="pl-c1">0.25</span> , <span class="pl-c1">0.</span> ],
[<span class="pl-c1">0.</span> , <span class="pl-c1">0.</span> , <span class="pl-c1">0.</span> , <span class="pl-c1">0.25</span> , <span class="pl-c1">0.2</span> ],
[<span class="pl-c1">0.</span> , <span class="pl-c1">0.</span> , <span class="pl-c1">0.</span> , <span class="pl-c1">0.</span> , <span class="pl-c1">0.2</span> ]])
[<span class="pl-c1">12</span>]<span class="pl-c1">>></span><span class="pl-c1">></span> <span class="pl-v">D</span>.<span class="pl-en">toarray</span>() <span class="pl-c1">/</span> <span class="pl-s1">x</span>
[<span class="pl-c1">12</span>]<span class="pl-c1">==</span><span class="pl-c1">=</span>
<span class="pl-en">array</span>([[<span class="pl-c1">1.</span> , <span class="pl-c1">0.</span> , <span class="pl-c1">0.</span> , <span class="pl-c1">0.</span> , <span class="pl-c1">0.</span> ],
[<span class="pl-c1">1.</span> , <span class="pl-c1">0.5</span> , <span class="pl-c1">0.</span> , <span class="pl-c1">0.</span> , <span class="pl-c1">0.</span> ],
[<span class="pl-c1">0.</span> , <span class="pl-c1">0.5</span> , <span class="pl-c1">0.3333</span>, <span class="pl-c1">0.</span> , <span class="pl-c1">0.</span> ],
[<span class="pl-c1">0.</span> , <span class="pl-c1">0.</span> , <span class="pl-c1">0.3333</span>, <span class="pl-c1">0.25</span> , <span class="pl-c1">0.</span> ],
[<span class="pl-c1">0.</span> , <span class="pl-c1">0.</span> , <span class="pl-c1">0.</span> , <span class="pl-c1">0.25</span> , <span class="pl-c1">0.2</span> ],
[<span class="pl-c1">0.</span> , <span class="pl-c1">0.</span> , <span class="pl-c1">0.</span> , <span class="pl-c1">0.</span> , <span class="pl-c1">0.2</span> ]])</pre></div>
<h3 dir="auto">Error message</h3>
<div class="highlight highlight-source-shell notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="No error message."><pre class="notranslate">No error message.</pre></div>
<h3 dir="auto">SciPy/NumPy/Python version information</h3>
<p dir="auto">[1]>>> import sys, scipy, numpy; print(scipy.<strong>version</strong>, numpy.<strong>version</strong>, sys.version_info) 1.7.1 1.20.3 sys.version_info(major=3, minor=9, micro=6, releaselevel='final', serial=0)</p> | <p dir="auto">While sitting with <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/stefanv/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/stefanv">@stefanv</a> last week we discussed (and then <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/stefanv/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/stefanv">@stefanv</a> started implementing) sparse array classes that use the same code as the existing matrix classes, but instead satisfy the ndarray interface (only up to two dimensions). For example slicing out rows would result in 1d arrays rather than 2d matrices, the <code class="notranslate">*</code> operator means elementwise multiply rather than matrix multiply, etc..</p>
<p dir="auto">This would be valuable for a number of communities and, in particular, anyone trying to use sparse arrays and numpy arrays interchangably, as happens in Pandas, Scikit-Learn, and Dask.array.</p>
<p dir="auto">I thought I'd raise this issue to track this work (and also to subtly prod <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/stefanv/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/stefanv">@stefanv</a>).</p>
<p dir="auto">Also cc <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/NelleV/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/NelleV">@NelleV</a> and <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/njsmith/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/njsmith">@njsmith</a></p> | 1 |
<p dir="auto">Challenge <a href="http://www.freecodecamp.com/challenges/waypoint-sift-through-text-with-regular-expressions" rel="nofollow">http://www.freecodecamp.com/challenges/waypoint-sift-through-text-with-regular-expressions</a> has an issue. Please describe how to reproduce it, and include links to screenshots if possible.<br>
The challenge ask to find all occurrences of the word 'and' expecting '/and+/gi' as solution, but the use of '+' is unnecessary and not clear.</p> | <p dir="auto">Challenge <a href="http://www.freecodecamp.com/challenges/waypoint-create-bootstrap-wells" rel="nofollow">http://www.freecodecamp.com/challenges/waypoint-create-bootstrap-wells</a> has an issue. Please describe how to reproduce it, and include links to screenshots if possible.</p>
<p dir="auto">The first step currently reads:</p>
<blockquote>
<p dir="auto">Add two div elements inside your <code class="notranslate">div class="well"></code> element both with the class <code class="notranslate">col-xs-6</code></p>
</blockquote>
<p dir="auto">I believe it should be</p>
<blockquote>
<p dir="auto">Add two div elements with class <code class="notranslate">well</code> inside the div with class <code class="notranslate">col-xs-6</code></p>
</blockquote>
<p dir="auto">For reference, this is the passing code:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="<div class="container-fluid">
<h3 class="text-primary text-center">jQuery Playground</h3>
<div class="row">
<div class="col-xs-6">
<div class="well">
</div>
</div>
<div class="col-xs-6">
<div class="well">
</div>
</div>
</div>
</div>"><pre class="notranslate"><code class="notranslate"><div class="container-fluid">
<h3 class="text-primary text-center">jQuery Playground</h3>
<div class="row">
<div class="col-xs-6">
<div class="well">
</div>
</div>
<div class="col-xs-6">
<div class="well">
</div>
</div>
</div>
</div>
</code></pre></div> | 0 |
<div class="highlight highlight-source-rust notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="trait TA { fn ta(&self) { println!("Default TA"); } }
trait TB: TA { fn tb(&self) { println!("Default TB"); } }
trait AutoTA: TB {}
impl<T:AutoTA> TA for T { fn ta(&self) { println!("AutoTA"); } }
struct A;
impl TB for A {}"><pre class="notranslate"><span class="pl-k">trait</span> <span class="pl-smi">TA</span> <span class="pl-kos">{</span> <span class="pl-k">fn</span> <span class="pl-en">ta</span><span class="pl-kos">(</span><span class="pl-c1">&</span><span class="pl-smi">self</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> <span class="pl-en">println</span><span class="pl-en">!</span><span class="pl-kos">(</span><span class="pl-s">"Default TA"</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-kos">}</span> <span class="pl-kos">}</span>
<span class="pl-k">trait</span> <span class="pl-smi">TB</span><span class="pl-kos">:</span> <span class="pl-smi">TA</span> <span class="pl-kos">{</span> <span class="pl-k">fn</span> <span class="pl-en">tb</span><span class="pl-kos">(</span><span class="pl-c1">&</span><span class="pl-smi">self</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> <span class="pl-en">println</span><span class="pl-en">!</span><span class="pl-kos">(</span><span class="pl-s">"Default TB"</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-kos">}</span> <span class="pl-kos">}</span>
<span class="pl-k">trait</span> <span class="pl-smi">AutoTA</span><span class="pl-kos">:</span> <span class="pl-smi">TB</span> <span class="pl-kos">{</span><span class="pl-kos">}</span>
<span class="pl-k">impl</span><span class="pl-kos"><</span><span class="pl-smi">T</span><span class="pl-kos">:</span><span class="pl-smi">AutoTA</span><span class="pl-kos">></span> <span class="pl-smi">TA</span> <span class="pl-k">for</span> <span class="pl-smi">T</span> <span class="pl-kos">{</span> <span class="pl-k">fn</span> <span class="pl-en">ta</span><span class="pl-kos">(</span><span class="pl-c1">&</span><span class="pl-smi">self</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> <span class="pl-en">println</span><span class="pl-en">!</span><span class="pl-kos">(</span><span class="pl-s">"AutoTA"</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-kos">}</span> <span class="pl-kos">}</span>
<span class="pl-k">struct</span> <span class="pl-smi">A</span><span class="pl-kos">;</span>
<span class="pl-k">impl</span> <span class="pl-smi">TB</span> <span class="pl-k">for</span> <span class="pl-smi">A</span> <span class="pl-kos">{</span><span class="pl-kos">}</span></pre></div>
<p dir="auto">The above code misses impl <code class="notranslate">TA</code> for <code class="notranslate">A</code>, but the compiler reports<br>
<code class="notranslate">error: the trait </code>AutoTA<code class="notranslate">is not implemented for the type</code>A<code class="notranslate"> [E0277]</code></p>
<p dir="auto">Even worse, when a new piece of code is added:</p>
<div class="highlight highlight-source-rust notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="trait AutoAutoTA: TB {}
impl<T: AutoAutoTA> AutoTA for T {}"><pre class="notranslate"><span class="pl-k">trait</span> <span class="pl-smi">AutoAutoTA</span><span class="pl-kos">:</span> <span class="pl-smi">TB</span> <span class="pl-kos">{</span><span class="pl-kos">}</span>
<span class="pl-k">impl</span><span class="pl-kos"><</span><span class="pl-smi">T</span><span class="pl-kos">:</span> <span class="pl-smi">AutoAutoTA</span><span class="pl-kos">></span> <span class="pl-smi">AutoTA</span> <span class="pl-k">for</span> <span class="pl-smi">T</span> <span class="pl-kos">{</span><span class="pl-kos">}</span></pre></div>
<p dir="auto">the comiler reports:<br>
<code class="notranslate">error: the trait </code>AutoAutoTA<code class="notranslate">is not implemented for the type</code>A<code class="notranslate"> [E0277]</code></p>
<p dir="auto">These error messages aren't accurate. example, the last implies that the only way to fix it is to impl the AutoAutoTA.</p>
<p dir="auto">I hope the compiler just report the direct reason. it should report:<br>
<code class="notranslate">error: the trait </code>TA<code class="notranslate">is not implemented for the type</code>A<code class="notranslate"> [E0277]</code></p> | <p dir="auto">This is a more general version of <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="58024867" data-permission-text="Title is private" data-url="https://github.com/rust-lang/rust/issues/22478" data-hovercard-type="issue" data-hovercard-url="/rust-lang/rust/issues/22478/hovercard" href="https://github.com/rust-lang/rust/issues/22478">#22478</a>. (i.e. probably should be considered to supersede it)</p>
<div class="highlight highlight-source-rust notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="trait A {
fn a(self);
}
trait B {
fn b(self);
}
impl<T: B> A for T {
fn a(self) {
B::b(self)
}
}
struct C;
fn main() {
A::a(C);
}"><pre class="notranslate"><span class="pl-k">trait</span> <span class="pl-smi">A</span> <span class="pl-kos">{</span>
<span class="pl-k">fn</span> <span class="pl-en">a</span><span class="pl-kos">(</span><span class="pl-smi">self</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span>
<span class="pl-k">trait</span> <span class="pl-smi">B</span> <span class="pl-kos">{</span>
<span class="pl-k">fn</span> <span class="pl-en">b</span><span class="pl-kos">(</span><span class="pl-smi">self</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span>
<span class="pl-k">impl</span><span class="pl-kos"><</span><span class="pl-smi">T</span><span class="pl-kos">:</span> <span class="pl-smi">B</span><span class="pl-kos">></span> <span class="pl-smi">A</span> <span class="pl-k">for</span> <span class="pl-smi">T</span> <span class="pl-kos">{</span>
<span class="pl-k">fn</span> <span class="pl-en">a</span><span class="pl-kos">(</span><span class="pl-smi">self</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
<span class="pl-smi">B</span><span class="pl-kos">::</span><span class="pl-en">b</span><span class="pl-kos">(</span><span class="pl-smi">self</span><span class="pl-kos">)</span>
<span class="pl-kos">}</span>
<span class="pl-kos">}</span>
<span class="pl-k">struct</span> <span class="pl-smi">C</span><span class="pl-kos">;</span>
<span class="pl-k">fn</span> <span class="pl-en">main</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
<span class="pl-smi">A</span><span class="pl-kos">::</span><span class="pl-en">a</span><span class="pl-kos">(</span><span class="pl-v">C</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span></pre></div>
<p dir="auto">Compiling this will result in</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="t.rs:18:5: 18:9 error: the trait `B` is not implemented for the type `C` [E0277]
t.rs:18 A::a(C);
^~~~
error: aborting due to previous error"><pre class="notranslate"><code class="notranslate">t.rs:18:5: 18:9 error: the trait `B` is not implemented for the type `C` [E0277]
t.rs:18 A::a(C);
^~~~
error: aborting due to previous error
</code></pre></div>
<p dir="auto">but <code class="notranslate">impl<T: B> A for T</code>, <code class="notranslate">T = C</code> and <code class="notranslate">C</code> does not implement <code class="notranslate">B</code> and therefore the impl in question should not even be taken into consideration, even if it is the only implementation of a trait.</p> | 1 |
<p dir="auto">After making a recent build I found that I could not create a cluster.</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="$ kubectl version
Client Version: version.Info{Major:"0", Minor:"15", GitVersion:"v0.15.0", GitCommit:"831f3e60d7cd64c61a775d6c78acce1673dd8aa9", GitTreeState:"clean"}
Server Version: version.Info{Major:"0", Minor:"16+", GitVersion:"v0.16.0-46-gee27094238dbd7-dirty", GitCommit:"ee27094238dbd797c363bac6a54bc28a2cf71225", GitTreeState:"dirty"}
...
Kubernetes cluster is running. The master is running at:
https://104.197.49.90
The user name and password to use is located in /usr/local/google/home/satnam/.config/gcloud/kubernetes/kubeconfig.
... calling validate-cluster
Starting cluster using os distro: debian
Starting cluster using os distro: debian
current-context: "kubernetes-satnam_kubernetes"
Running: cluster/../cluster/gce/../../cluster/../cluster/../cluster/gce/../../cluster/../cluster/../cluster/gce/../../cluster/../_output/dockerized/bin/linux/amd64/kubectl get nodes -o template -t {{range.items}}{{.metadata.name}}
{{end}} --api-version=v1beta3
Found 4 nodes.
1 kubernetes-minion-hhbv
2 kubernetes-minion-jy35
3 kubernetes-minion-lfcu
4 kubernetes-minion-r2ez
Starting cluster using os distro: debian
current-context: "kubernetes-satnam_kubernetes"
Running: cluster/../cluster/gce/../../cluster/../cluster/../cluster/gce/../../cluster/../cluster/../cluster/gce/../../cluster/../_output/dockerized/bin/linux/amd64/kubectl get cs
Cluster not working yet.
Starting cluster using os distro: debian
current-context: "kubernetes-satnam_kubernetes"
Running: cluster/../cluster/gce/../../cluster/../cluster/../cluster/gce/../../cluster/../cluster/../cluster/gce/../../cluster/../_output/dockerized/bin/linux/amd64/kubectl get cs
Cluster not working yet.
Starting cluster using os distro: debian
current-context: "kubernetes-satnam_kubernetes"
Running: cluster/../cluster/gce/../../cluster/../cluster/../cluster/gce/../../cluster/../cluster/../cluster/gce/../../cluster/../_output/dockerized/bin/linux/amd64/kubectl get cs
Cluster not working yet.
Starting cluster using os distro: debian
current-context: "kubernetes-satnam_kubernetes"
Running: cluster/../cluster/gce/../../cluster/../cluster/../cluster/gce/../../cluster/../cluster/../cluster/gce/../../cluster/../_output/dockerized/bin/linux/amd64/kubectl get cs
Cluster not working yet.
Starting cluster using os distro: debian
current-context: "kubernetes-satnam_kubernetes"
Running: cluster/../cluster/gce/../../cluster/../cluster/../cluster/gce/../../cluster/../cluster/../cluster/gce/../../cluster/../_output/dockerized/bin/linux/amd64/kubectl get cs
Cluster not working yet.
Starting cluster using os distro: debian
current-context: "kubernetes-satnam_kubernetes"
Running: cluster/../cluster/gce/../../cluster/../cluster/../cluster/gce/../../cluster/../cluster/../cluster/gce/../../cluster/../_output/dockerized/bin/linux/amd64/kubectl get cs
Validate output:
NAME STATUS MESSAGE ERROR
node-0 Healthy ok nil
node-1 Healthy ok nil
node-2 Unhealthy Get https://kubernetes-minion-lfcu:10250/healthz: dial tcp 10.240.7.38:10250: connection refused
node-3 Healthy ok nil
controller-manager Healthy ok nil
scheduler Healthy ok nil
etcd-0 Healthy {"action":"get","node":{"dir":true,"nodes":[{"key":"/registry","dir":true,"modifiedIndex":3,"createdIndex":3}]}}
nil
Validation returned one or more failed components. Cluster is probably broken."><pre class="notranslate"><code class="notranslate">$ kubectl version
Client Version: version.Info{Major:"0", Minor:"15", GitVersion:"v0.15.0", GitCommit:"831f3e60d7cd64c61a775d6c78acce1673dd8aa9", GitTreeState:"clean"}
Server Version: version.Info{Major:"0", Minor:"16+", GitVersion:"v0.16.0-46-gee27094238dbd7-dirty", GitCommit:"ee27094238dbd797c363bac6a54bc28a2cf71225", GitTreeState:"dirty"}
...
Kubernetes cluster is running. The master is running at:
https://104.197.49.90
The user name and password to use is located in /usr/local/google/home/satnam/.config/gcloud/kubernetes/kubeconfig.
... calling validate-cluster
Starting cluster using os distro: debian
Starting cluster using os distro: debian
current-context: "kubernetes-satnam_kubernetes"
Running: cluster/../cluster/gce/../../cluster/../cluster/../cluster/gce/../../cluster/../cluster/../cluster/gce/../../cluster/../_output/dockerized/bin/linux/amd64/kubectl get nodes -o template -t {{range.items}}{{.metadata.name}}
{{end}} --api-version=v1beta3
Found 4 nodes.
1 kubernetes-minion-hhbv
2 kubernetes-minion-jy35
3 kubernetes-minion-lfcu
4 kubernetes-minion-r2ez
Starting cluster using os distro: debian
current-context: "kubernetes-satnam_kubernetes"
Running: cluster/../cluster/gce/../../cluster/../cluster/../cluster/gce/../../cluster/../cluster/../cluster/gce/../../cluster/../_output/dockerized/bin/linux/amd64/kubectl get cs
Cluster not working yet.
Starting cluster using os distro: debian
current-context: "kubernetes-satnam_kubernetes"
Running: cluster/../cluster/gce/../../cluster/../cluster/../cluster/gce/../../cluster/../cluster/../cluster/gce/../../cluster/../_output/dockerized/bin/linux/amd64/kubectl get cs
Cluster not working yet.
Starting cluster using os distro: debian
current-context: "kubernetes-satnam_kubernetes"
Running: cluster/../cluster/gce/../../cluster/../cluster/../cluster/gce/../../cluster/../cluster/../cluster/gce/../../cluster/../_output/dockerized/bin/linux/amd64/kubectl get cs
Cluster not working yet.
Starting cluster using os distro: debian
current-context: "kubernetes-satnam_kubernetes"
Running: cluster/../cluster/gce/../../cluster/../cluster/../cluster/gce/../../cluster/../cluster/../cluster/gce/../../cluster/../_output/dockerized/bin/linux/amd64/kubectl get cs
Cluster not working yet.
Starting cluster using os distro: debian
current-context: "kubernetes-satnam_kubernetes"
Running: cluster/../cluster/gce/../../cluster/../cluster/../cluster/gce/../../cluster/../cluster/../cluster/gce/../../cluster/../_output/dockerized/bin/linux/amd64/kubectl get cs
Cluster not working yet.
Starting cluster using os distro: debian
current-context: "kubernetes-satnam_kubernetes"
Running: cluster/../cluster/gce/../../cluster/../cluster/../cluster/gce/../../cluster/../cluster/../cluster/gce/../../cluster/../_output/dockerized/bin/linux/amd64/kubectl get cs
Validate output:
NAME STATUS MESSAGE ERROR
node-0 Healthy ok nil
node-1 Healthy ok nil
node-2 Unhealthy Get https://kubernetes-minion-lfcu:10250/healthz: dial tcp 10.240.7.38:10250: connection refused
node-3 Healthy ok nil
controller-manager Healthy ok nil
scheduler Healthy ok nil
etcd-0 Healthy {"action":"get","node":{"dir":true,"nodes":[{"key":"/registry","dir":true,"modifiedIndex":3,"createdIndex":3}]}}
nil
Validation returned one or more failed components. Cluster is probably broken.
</code></pre></div> | <p dir="auto">hack/e2e.go occasionally fails (or thinks that it fails) to being up a test cluster to test against.</p>
<p dir="auto">The log below suggests that as soon as it sees an unhealthy node it fails. Seems like a few retries are in order. This is causing continuous integration tests to fail to run about 10% of the time on our CI setup.</p>
<h1 dir="auto"></h1>
<p dir="auto">Running: /jenkins-master-data/jobs/kubernetes-e2e-gce/workspace/kubernetes/hack/e2e-internal/../../cluster/../cluster/gce/../../cluster/../cluster/../cluster/gce/../../cluster/../cluster/../cluster/gce/../../cluster/../platforms/linux/amd64/kubectl get cs<br>
�[0;33mValidate output:�[0m<br>
NAME STATUS MESSAGE ERROR<br>
controller-manager Healthy ok nil<br>
scheduler Healthy ok nil<br>
etcd-0 Healthy {"action":"get","node":{"dir":true,"nodes":[{"key":"/registry","dir":true,"modifiedIndex":3,"createdIndex":3}]}}<br>
nil<br>
node-0 Healthy ok nil<br>
node-1 Unhealthy Get https://e2e-test-jenkins-minion-ww4a:10250/healthz: dial tcp 10.240.198.5:10250: connection refused<br>
�[0;31mValidation returned one or more failed components. Cluster is probably broken.�[0m<br>
2015/04/24 11:20:39 Error running up: exit status 1<br>
2015/04/24 11:20:39 Error starting e2e cluster. Aborting.<br>
exit status 1<br>
Build step 'Execute shell' marked build as failure<br>
Recording test results</p> | 1 |
<p dir="auto">I am using Internet Explorer with zoom setting at 100%. Any help would be greatly appreciated.<br>
<a target="_blank" rel="noopener noreferrer nofollow" href="https://cloud.githubusercontent.com/assets/16979105/12738671/7ecc0036-c928-11e5-8ec1-a2ffdc0dbb9f.PNG"><img src="https://cloud.githubusercontent.com/assets/16979105/12738671/7ecc0036-c928-11e5-8ec1-a2ffdc0dbb9f.PNG" alt="font size code" style="max-width: 100%;"></a></p> | <p dir="auto">Challenge <a href="http://www.freecodecamp.com/challenges/change-the-font-size-of-an-element" rel="nofollow">Change the Font Size of an Element</a> has an issue.<br>
User Agent is: <code class="notranslate">Mozilla/5.0 (Windows NT 6.1; Trident/7.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET4.0C; .NET4.0E; rv:11.0) like Gecko</code>.<br>
Please describe how to reproduce this issue, and include links to screenshots if possible.</p>
<p dir="auto">My code:</p>
<div class="highlight highlight-text-html-basic notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="<style>
.red-text {
color: red;
}
p {
font-size: 16px;
}
</style>
<h2 class="red-text">CatPhotoApp</h2>
<p class="red-text">Kitty ipsum dolor sit amet, shed everywhere shed everywhere stretching attack your ankles chase the red dot, hairball run catnip eat the grass sniff.</p>
<p>Purr jump eat the grass rip the couch scratched sunbathe, shed everywhere rip the couch sleep in the sink fluffy fur catnip scratched.</p>"><pre class="notranslate"><span class="pl-kos"><</span><span class="pl-ent">style</span><span class="pl-kos">></span>
.<span class="pl-c1">red-text</span> {
<span class="pl-c1">color</span><span class="pl-kos">:</span> red;
}
<span class="pl-ent">p</span> {
<span class="pl-c1">font-size</span><span class="pl-kos">:</span> <span class="pl-c1">16<span class="pl-smi">px</span></span>;
}
<span class="pl-kos"></</span><span class="pl-ent">style</span><span class="pl-kos">></span>
<span class="pl-kos"><</span><span class="pl-ent">h2</span> <span class="pl-c1">class</span>="<span class="pl-s">red-text</span>"<span class="pl-kos">></span>CatPhotoApp<span class="pl-kos"></</span><span class="pl-ent">h2</span><span class="pl-kos">></span>
<span class="pl-kos"><</span><span class="pl-ent">p</span> <span class="pl-c1">class</span>="<span class="pl-s">red-text</span>"<span class="pl-kos">></span>Kitty ipsum dolor sit amet, shed everywhere shed everywhere stretching attack your ankles chase the red dot, hairball run catnip eat the grass sniff.<span class="pl-kos"></</span><span class="pl-ent">p</span><span class="pl-kos">></span>
<span class="pl-kos"><</span><span class="pl-ent">p</span><span class="pl-kos">></span>Purr jump eat the grass rip the couch scratched sunbathe, shed everywhere rip the couch sleep in the sink fluffy fur catnip scratched.<span class="pl-kos"></</span><span class="pl-ent">p</span><span class="pl-kos">></span></pre></div> | 1 |
<p dir="auto">The code snippets in <a href="https://flutter.io/cookbook/" rel="nofollow">https://flutter.io/cookbook/</a> currently have 754 analyzer errors [1]. We should clean up those errors and then enforce that the code stays clean by including the cookbook in our travis check [2].</p>
<p dir="auto">This will also ensure that the code in the cookbook doesn't go stale with new Flutter/Dart releases.</p>
<p dir="auto">[1] <a href="https://travis-ci.org/flutter/website/builds/361245834#L1064" rel="nofollow">https://travis-ci.org/flutter/website/builds/361245834#L1064</a><br>
[2] <a href="https://github.com/flutter/website/blob/master/tool/extract.dart#L16">https://github.com/flutter/website/blob/master/tool/extract.dart#L16</a></p>
<p dir="auto">/cc <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/filiph/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/filiph">@filiph</a>, <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/mjohnsullivan/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/mjohnsullivan">@mjohnsullivan</a>, <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/devoncarew/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/devoncarew">@devoncarew</a></p> | <p dir="auto">Currently, we have a (small, simple) analysis options file used when analyzing the website code snippets. We should do some work to unify that with the analysis options files used when analyzing flutter code. This could be introducing an inheritance mechanism to analysis options files (a fairly invasive change), duplicate the lint list, or have some code that autogenerates the website options file one on the fly (this last option seems pretty good).</p>
<p dir="auto">See <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="256786039" data-permission-text="Title is private" data-url="https://github.com/flutter/website/issues/666" data-hovercard-type="pull_request" data-hovercard-url="/flutter/website/pull/666/hovercard" href="https://github.com/flutter/website/pull/666">flutter/website#666</a> for context.</p> | 0 |
<p dir="auto">To reproduce the issue: here <a href="http://jsfiddle.net/Q9K8L/" rel="nofollow">http://jsfiddle.net/Q9K8L/</a> click on an option twice before clicking on a submit button. Radio button option is not sent with a submit.<br>
I suspect <code class="notranslate">data-toggle="buttons"</code> data attribute causes this issue.</p>
<p dir="auto">Tested on Chrome Version 31.0.1650.57 m and FireFox 24.0</p> | <p dir="auto">The active class stays on the button, but the checked property is removed from the radio input.</p>
<p dir="auto"><a href="http://jsfiddle.net/meleyal/dafPH/" rel="nofollow">http://jsfiddle.net/meleyal/dafPH/</a></p> | 1 |
<p dir="auto">Apple may eventually require Bitcode support for iOS. It's currently required for submissions to tvOS and watchOS stores.</p>
<p dir="auto">We've seen Dart's toolchain produce Bitcode as a demo:<br>
<a href="https://medium.com/dartlang/dart-on-llvm-b82e83f99a70" rel="nofollow">https://medium.com/dartlang/dart-on-llvm-b82e83f99a70</a></p>
<p dir="auto">This bug tracks (eventually) turning that demo into a production solution.</p> | 1 |
|
<p dir="auto">test case:</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="function test(a) {
return a * 2;
}
var cb = async (...args) => await test(...args);
cb(123)
.then((result) => console.log(result))
.catch((e) => console.error(e));"><pre class="notranslate"><span class="pl-k">function</span> <span class="pl-en">test</span><span class="pl-kos">(</span><span class="pl-s1">a</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
<span class="pl-k">return</span> <span class="pl-s1">a</span> <span class="pl-c1">*</span> <span class="pl-c1">2</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span>
<span class="pl-k">var</span> <span class="pl-en">cb</span> <span class="pl-c1">=</span> <span class="pl-k">async</span> <span class="pl-kos">(</span>...<span class="pl-s1">args</span><span class="pl-kos">)</span> <span class="pl-c1">=></span> <span class="pl-k">await</span> <span class="pl-en">test</span><span class="pl-kos">(</span>...<span class="pl-s1">args</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-en">cb</span><span class="pl-kos">(</span><span class="pl-c1">123</span><span class="pl-kos">)</span>
<span class="pl-kos">.</span><span class="pl-en">then</span><span class="pl-kos">(</span><span class="pl-kos">(</span><span class="pl-s1">result</span><span class="pl-kos">)</span> <span class="pl-c1">=></span> <span class="pl-smi">console</span><span class="pl-kos">.</span><span class="pl-en">log</span><span class="pl-kos">(</span><span class="pl-s1">result</span><span class="pl-kos">)</span><span class="pl-kos">)</span>
<span class="pl-kos">.</span><span class="pl-en">catch</span><span class="pl-kos">(</span><span class="pl-kos">(</span><span class="pl-s1">e</span><span class="pl-kos">)</span> <span class="pl-c1">=></span> <span class="pl-smi">console</span><span class="pl-kos">.</span><span class="pl-en">error</span><span class="pl-kos">(</span><span class="pl-s1">e</span><span class="pl-kos">)</span><span class="pl-kos">)</span><span class="pl-kos">;</span></pre></div>
<p dir="auto">expected result: <code class="notranslate">246</code><br>
actual result: <code class="notranslate">NaN</code></p>
<p dir="auto">for example, <a href="http://babeljs.io/docs/advanced/transformers/other/bluebird-coroutines/" rel="nofollow">http://babeljs.io/docs/advanced/transformers/other/bluebird-coroutines/</a> in this case do work as expected</p> | <p dir="auto">Hi,</p>
<p dir="auto">It seems there is a bug when combining async + rest parameters syntax.<br>
Here is a simplified version that reproduces the case with a simple async of value.</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="const foo = async (...msgs) => {
let t = await msgs[0];
console.log(t);
}
foo('a'); // displays "{}" instead of "a" value"><pre class="notranslate"><span class="pl-k">const</span> <span class="pl-en">foo</span> <span class="pl-c1">=</span> <span class="pl-k">async</span> <span class="pl-kos">(</span>...<span class="pl-s1">msgs</span><span class="pl-kos">)</span> <span class="pl-c1">=></span> <span class="pl-kos">{</span>
<span class="pl-k">let</span> <span class="pl-s1">t</span> <span class="pl-c1">=</span> <span class="pl-k">await</span> <span class="pl-s1">msgs</span><span class="pl-kos">[</span><span class="pl-c1">0</span><span class="pl-kos">]</span><span class="pl-kos">;</span>
<span class="pl-smi">console</span><span class="pl-kos">.</span><span class="pl-en">log</span><span class="pl-kos">(</span><span class="pl-s1">t</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span>
<span class="pl-en">foo</span><span class="pl-kos">(</span><span class="pl-s">'a'</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-c">// displays "{}" instead of "a" value</span></pre></div>
<p dir="auto">Just by adding <code class="notranslate">console.log(msgs)</code>, it makes it work.</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="const foo = async (...msgs) => {
console.log(msgs);
let t = await msgs[0];
console.log(t);
}
foo('a'); // displays "a" "><pre class="notranslate"><span class="pl-k">const</span> <span class="pl-en">foo</span> <span class="pl-c1">=</span> <span class="pl-k">async</span> <span class="pl-kos">(</span>...<span class="pl-s1">msgs</span><span class="pl-kos">)</span> <span class="pl-c1">=></span> <span class="pl-kos">{</span>
<span class="pl-smi">console</span><span class="pl-kos">.</span><span class="pl-en">log</span><span class="pl-kos">(</span><span class="pl-s1">msgs</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-k">let</span> <span class="pl-s1">t</span> <span class="pl-c1">=</span> <span class="pl-k">await</span> <span class="pl-s1">msgs</span><span class="pl-kos">[</span><span class="pl-c1">0</span><span class="pl-kos">]</span><span class="pl-kos">;</span>
<span class="pl-smi">console</span><span class="pl-kos">.</span><span class="pl-en">log</span><span class="pl-kos">(</span><span class="pl-s1">t</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span>
<span class="pl-en">foo</span><span class="pl-kos">(</span><span class="pl-s">'a'</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-c">// displays "a" </span></pre></div>
<p dir="auto">Basically, adding <code class="notranslate">console.log(msgs)</code> moves the args to a distinct array:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="for (var _len = arguments.length, msgs = Array(_len), _key = 0; _key < _len; _key++) {
msgs[_key] = arguments[_key];
}"><pre class="notranslate"><code class="notranslate">for (var _len = arguments.length, msgs = Array(_len), _key = 0; _key < _len; _key++) {
msgs[_key] = arguments[_key];
}
</code></pre></div>
<p dir="auto">In the repl:<br>
<a href="https://babeljs.io/repl/#?experimental=true&evaluate=true&loose=false&spec=false&code=const%20asyncArg%20%3D%20async%20(msg)%20%3D%3E%20%7B%0D%0A%20%20let%20t%20%3D%20await%20msg%3B%0D%0A%20%20console.log(t)%3B%0D%0A%7D%0D%0A%0D%0Aconst%20asyncArgs%20%3D%20async%20(...msgs)%20%3D%3E%20%7B%0D%0A%20%20let%20t%20%3D%20await%20msgs%5B0%5D%3B%0D%0A%20%20console.log(t)%3B%0D%0A%7D%0D%0A%0D%0AasyncArg('1')%3B%0D%0AasyncArgs('2')%3B%0D%0A" rel="nofollow">https://babeljs.io/repl/#?experimental=true&evaluate=true&loose=false&spec=false&code=const%20asyncArg%20%3D%20async%20(msg)%20%3D%3E%20%7B%0D%0A%20%20let%20t%20%3D%20await%20msg%3B%0D%0A%20%20console.log(t)%3B%0D%0A%7D%0D%0A%0D%0Aconst%20asyncArgs%20%3D%20async%20(...msgs)%20%3D%3E%20%7B%0D%0A%20%20let%20t%20%3D%20await%20msgs%5B0%5D%3B%0D%0A%20%20console.log(t)%3B%0D%0A%7D%0D%0A%0D%0AasyncArg('1')%3B%0D%0AasyncArgs('2')%3B%0D%0A</a></p> | 1 |
<h1 dir="auto">Bug report</h1>
<p dir="auto"><strong>What is the current behavior?</strong><br>
We have a components library where we have multiple entry points setup for components. Since we had nesting of components as well, we were ending up duplicating the code.</p>
<p dir="auto">Hence we used the optimization block inside the config.</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="optimization: {
splitChunks: {
chunks: 'all',
minChunks: 1,
minSize: 1000,
maxInitialRequests: Infinity,
cacheGroups: {
vendorCss: {
test: /[\\/]node_modules[\\/](@hotstar\/isomorphic-style-loader|css-loader)[\\/]/,
name: 'vendor_css_loaders',
chunks: 'all',
},
}
},"><pre class="notranslate"><code class="notranslate">optimization: {
splitChunks: {
chunks: 'all',
minChunks: 1,
minSize: 1000,
maxInitialRequests: Infinity,
cacheGroups: {
vendorCss: {
test: /[\\/]node_modules[\\/](@hotstar\/isomorphic-style-loader|css-loader)[\\/]/,
name: 'vendor_css_loaders',
chunks: 'all',
},
}
},
</code></pre></div>
<p dir="auto">But after using this to bundle our components lib, and using this library inside the next.js app we get the error</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="TypeError: Cannot read property '__esModule' of undefined
at /Users/ajayjaggi/Desktop/Hotstar/web-website/node_modules/@hotstar/web-ui-components-lib/modern/components/Molecule/CustomError/src/index.js:328:34
at Object.<anonymous> (/Users/ajayjaggi/Desktop/Hotstar/web-website/node_modules/@hotstar/web-ui-components-lib/modern/components/Molecule/CustomError/src/index.js:330:12)
at Module._compile (internal/modules/cjs/loader.js:1085:14)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)
at Module.load (internal/modules/cjs/loader.js:950:32)
at Function.Module._load (internal/modules/cjs/loader.js:790:12)
at Module.require (internal/modules/cjs/loader.js:974:19)
at require (internal/modules/cjs/helpers.js:93:18)
at Object.@hotstar/web-ui-components-lib/modern/components/Molecule/CustomError/src (/Users/ajayjaggi/Desktop/Hotstar/web-website/packages/website/.next/server/pages/_app.js:1273:18)
at __webpack_require__ (/Users/ajayjaggi/Desktop/Hotstar/web-website/packages/website/.next/server/webpack-runtime.js:33:42)
"><pre class="notranslate"><code class="notranslate">TypeError: Cannot read property '__esModule' of undefined
at /Users/ajayjaggi/Desktop/Hotstar/web-website/node_modules/@hotstar/web-ui-components-lib/modern/components/Molecule/CustomError/src/index.js:328:34
at Object.<anonymous> (/Users/ajayjaggi/Desktop/Hotstar/web-website/node_modules/@hotstar/web-ui-components-lib/modern/components/Molecule/CustomError/src/index.js:330:12)
at Module._compile (internal/modules/cjs/loader.js:1085:14)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)
at Module.load (internal/modules/cjs/loader.js:950:32)
at Function.Module._load (internal/modules/cjs/loader.js:790:12)
at Module.require (internal/modules/cjs/loader.js:974:19)
at require (internal/modules/cjs/helpers.js:93:18)
at Object.@hotstar/web-ui-components-lib/modern/components/Molecule/CustomError/src (/Users/ajayjaggi/Desktop/Hotstar/web-website/packages/website/.next/server/pages/_app.js:1273:18)
at __webpack_require__ (/Users/ajayjaggi/Desktop/Hotstar/web-website/packages/website/.next/server/webpack-runtime.js:33:42)
</code></pre></div>
<p dir="auto">which arises from here at 192 line.<br>
<a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/85304785/182784693-1eb46b9f-6478-47e2-aeaa-b3ec4682eff6.png"><img src="https://user-images.githubusercontent.com/85304785/182784693-1eb46b9f-6478-47e2-aeaa-b3ec4682eff6.png" alt="Screenshot 2022-08-04 at 12 34 19 PM" style="max-width: 100%;"></a></p>
<p dir="auto"><strong>If the current behavior is a bug, please provide the steps to reproduce.</strong><br>
Mentioned above</p>
<p dir="auto"><strong>What is the expected behavior?</strong><br>
It should run without giving any errors</p>
<p dir="auto"><strong>Other relevant information:</strong><br>
webpack version: 5.40<br>
Node.js version: 14.0.0<br>
Operating System: mac os<br>
next.js version: 12.0.7</p> | <h1 dir="auto">Bug report</h1>
<p dir="auto"><strong>What is the current behavior?</strong></p>
<p dir="auto">Currently webpack 4.39.2 depends on loader-runner 2.4.0, which tests for and uses System.import, which is used by SystemJS.<br>
Since [email protected] tries to use System.import, any import fails since it tries to run through SystemJS instead of node's module-resolution.<br>
[email protected] no longer uses System.import, which might mean that a bump of "loader-runner" to 3.0.0 should fix this issue.</p>
<p dir="auto">It fails with</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Module build failed (from ./node_modules/babel-loader/lib/index.js):
(SystemJS) ENOENT: no such file or directory, open 'D:\documents\dev\jspm-webpack\D:\documents\dev\jspm-webpack\node_modules\babel-loader\lib\index.js'
Error: ENOENT: no such file or directory, open 'D:\documents\dev\jspm-webpack\D:\documents\dev\jspm-webpack\node_modules\babel-loader\lib\index.js'
Error loading D:/documents/dev/jspm-webpack/D:\documents\dev\jspm-webpack\node_modules\babel-loader\lib\index.js"><pre class="notranslate"><code class="notranslate">Module build failed (from ./node_modules/babel-loader/lib/index.js):
(SystemJS) ENOENT: no such file or directory, open 'D:\documents\dev\jspm-webpack\D:\documents\dev\jspm-webpack\node_modules\babel-loader\lib\index.js'
Error: ENOENT: no such file or directory, open 'D:\documents\dev\jspm-webpack\D:\documents\dev\jspm-webpack\node_modules\babel-loader\lib\index.js'
Error loading D:/documents/dev/jspm-webpack/D:\documents\dev\jspm-webpack\node_modules\babel-loader\lib\index.js
</code></pre></div>
<p dir="auto">Notice that the path is "duplicated".</p>
<p dir="auto"><strong>If the current behavior is a bug, please provide the steps to reproduce.</strong></p>
<p dir="auto">I've created what I think is a minimal setup to show the issue at <a href="https://github.com/brunomlopes/jspm-webpack-gulp-issue">https://github.com/brunomlopes/jspm-webpack-gulp-issue</a></p>
<p dir="auto">It's a gulpfile and a minimal webpack configuration. The issue can be seen by running <code class="notranslate">gulp</code> which triggers the default task.</p>
<p dir="auto"><strong>What is the expected behavior?</strong></p>
<p dir="auto">We have a large SystemJS app we want to migrate to webpack, and want to do it in small steps, using the existing gulp infrastructure and scripts.<br>
We expect to be able to use SystemJS and Webpack site-by-side.</p>
<p dir="auto"><strong>Other relevant information:</strong><br>
webpack version: "^4.39.2"<br>
Node.js version: "10.16.3"<br>
Operating System: Windows 10<br>
Additional tools: "jspm": "0.16.53", "gulp": "^3.9.0",</p> | 0 |
<p dir="auto">This is tough for me to reliably reproduce, but I've seen it a half-dozen times and think it needs an issue. Elasticsearch can still lose inserted documents when a single primary node is isolated by a simple network partition. Nothing fancy, no overlapping partitions required. Sometimes it's only a few documents, from immediately following the partition:</p>
<div class="highlight highlight-source-clojure notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="{:valid? false,
:lost "#{640 643 645 649}",
:recovered
"#{140..142 144 146 148..152 155 157 159..162 164..168 171 174..175 177 179..185 187 190..192 194 197 199..200 202 205..208 214 224 234 238 240..247 249..254 256..264 266..282 285 296 317 342 363 388 431}",
:ok
"#{0..137 140..142 144 146 148..152 155 157 159..162 164..168 171 174..175 177 179..185 187 190..192 194 197 199..200 202 205..208 210..212 214 224 234 238 240..247 249..254 256..264 266..639 641..642 644 646..648 650..654}",
:recovered-frac 96/655,
:unexpected-frac 0,
:unexpected "#{}",
:lost-frac 4/655,
:ok-frac 598/655}"><pre class="notranslate">{<span class="pl-c1">:valid?</span> <span class="pl-c1">false</span>,
<span class="pl-c1">:lost</span> <span class="pl-s"><span class="pl-pds">"</span>#{640 643 645 649}<span class="pl-pds">"</span></span>,
<span class="pl-c1">:recovered</span>
<span class="pl-s"><span class="pl-pds">"</span>#{140..142 144 146 148..152 155 157 159..162 164..168 171 174..175 177 179..185 187 190..192 194 197 199..200 202 205..208 214 224 234 238 240..247 249..254 256..264 266..282 285 296 317 342 363 388 431}<span class="pl-pds">"</span></span>,
<span class="pl-c1">:ok</span>
<span class="pl-s"><span class="pl-pds">"</span>#{0..137 140..142 144 146 148..152 155 157 159..162 164..168 171 174..175 177 179..185 187 190..192 194 197 199..200 202 205..208 210..212 214 224 234 238 240..247 249..254 256..264 266..639 641..642 644 646..648 650..654}<span class="pl-pds">"</span></span>,
<span class="pl-c1">:recovered-frac</span> <span class="pl-c1">96/655</span>,
<span class="pl-c1">:unexpected-frac</span> <span class="pl-c1">0</span>,
<span class="pl-c1">:unexpected</span> <span class="pl-s"><span class="pl-pds">"</span>#{}<span class="pl-pds">"</span></span>,
<span class="pl-c1">:lost-frac</span> <span class="pl-c1">4/655</span>,
<span class="pl-c1">:ok-frac</span> <span class="pl-c1">598/655</span>}</pre></div>
<p dir="auto">Other times, the cluster seems to get really confused, and loses over half of the acknowledged records, distributed throughout the history:</p>
<div class="highlight highlight-source-clojure notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="{:valid? false,
:lost
"#{53..55 126..129 131..142 144..167 169..189 191..212 214..235 237..260 262..281 283..305 307..327 329..352 354..367 374 376}",
:recovered
"#{46..47 49 52 60 428..430 432..435 437..440 442..445 447..450 452..455 457..473}",
:ok
"#{0..47 49 52 60 428..430 432..435 437..440 442..445 447..450 452..455 457..473}",
:recovered-frac 15/158,
:unexpected-frac 0,
:unexpected "#{}",
:lost-frac 118/237,
:ok-frac 91/474}"><pre class="notranslate">{<span class="pl-c1">:valid?</span> <span class="pl-c1">false</span>,
<span class="pl-c1">:lost</span>
<span class="pl-s"><span class="pl-pds">"</span>#{53..55 126..129 131..142 144..167 169..189 191..212 214..235 237..260 262..281 283..305 307..327 329..352 354..367 374 376}<span class="pl-pds">"</span></span>,
<span class="pl-c1">:recovered</span>
<span class="pl-s"><span class="pl-pds">"</span>#{46..47 49 52 60 428..430 432..435 437..440 442..445 447..450 452..455 457..473}<span class="pl-pds">"</span></span>,
<span class="pl-c1">:ok</span>
<span class="pl-s"><span class="pl-pds">"</span>#{0..47 49 52 60 428..430 432..435 437..440 442..445 447..450 452..455 457..473}<span class="pl-pds">"</span></span>,
<span class="pl-c1">:recovered-frac</span> <span class="pl-c1">15/158</span>,
<span class="pl-c1">:unexpected-frac</span> <span class="pl-c1">0</span>,
<span class="pl-c1">:unexpected</span> <span class="pl-s"><span class="pl-pds">"</span>#{}<span class="pl-pds">"</span></span>,
<span class="pl-c1">:lost-frac</span> <span class="pl-c1">118/237</span>,
<span class="pl-c1">:ok-frac</span> <span class="pl-c1">91/474</span>}</pre></div>
<p dir="auto">The logs aren't particularly informative here, but I have noticed some interesting messages which seem correlated with data loss: for instance:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="[2015-04-02][WARN ][index.shard] [n4] [jepsen-index][0] suspect illegal state: trying to move shard from primary mode to replica mode"><pre class="notranslate"><code class="notranslate">[2015-04-02][WARN ][index.shard] [n4] [jepsen-index][0] suspect illegal state: trying to move shard from primary mode to replica mode
</code></pre></div>
<p dir="auto">and</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="[2015-04-02 17:19:54,370][DEBUG][action.index ] [n2] observer: timeout notification from cluster service. timeout setting [1m], time since start [1m]"><pre class="notranslate"><code class="notranslate">[2015-04-02 17:19:54,370][DEBUG][action.index ] [n2] observer: timeout notification from cluster service. timeout setting [1m], time since start [1m]
</code></pre></div>
<p dir="auto">which I think is a hardcoded message.</p>
<p dir="auto">Again, these are tough to reproduce--only 1 in 10 runs or so--so I'll keep working on finding a failure schedule that reliably triggers the fault.</p> | <p dir="auto">This ticket is meant to capture an issue which was discovered as part of the work done in <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="41361093" data-permission-text="Title is private" data-url="https://github.com/elastic/elasticsearch/issues/7493" data-hovercard-type="pull_request" data-hovercard-url="/elastic/elasticsearch/pull/7493/hovercard" href="https://github.com/elastic/elasticsearch/pull/7493">#7493</a> , which contains a <a href="https://github.com/elasticsearch/elasticsearch/blob/596a4a073584c4262d574828c9caea35b5ed1de5/src/test/java/org/elasticsearch/discovery/DiscoveryWithServiceDisruptions.java#L375">failing reproduction test</a> with <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/awaitFix/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/awaitFix">@awaitFix</a>.</p>
<p dir="auto">If a network partition separates a node from the master, there is some window of time before the node detects it. The length of the window is dependent on the type of the partition. This window is extremely small if a socket is broken. More adversarial partitions, for example, silently dropping requests without breaking the socket can take longer (up to 3x30s using current defaults).</p>
<p dir="auto">If the node hosts a <em>primary</em> shard at the moment of partition, and ends up being isolated from the cluster (which could have resulted in Split Brain before), some documents that are being indexed into the primary <em>may</em> be lost if they fail to reach one of the allocated replicas (due to the partition) and that replica is later promoted to primary by the master.</p> | 1 |
<p dir="auto"><strong>I'm submitting a ...</strong> (check one with "x")</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="[x] bug report => search github for a similar issue or PR before submitting
[ ] feature request
[ ] support request => Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question"><pre class="notranslate"><code class="notranslate">[x] bug report => search github for a similar issue or PR before submitting
[ ] feature request
[ ] support request => Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question
</code></pre></div>
<p dir="auto"><strong>Current behavior</strong></p>
<p dir="auto">[routerLink] with async/observable property assignment does not re-evaluate [routerLinkActive] when the observable emits a new value.</p>
<p dir="auto"><strong>Expected behavior</strong></p>
<p dir="auto">When the value emitted to [routerLink] changes, [routerLinkActive] should re-evaluate against the newly emitted value whether or not the link is "active."</p>
<p dir="auto"><strong>Minimal reproduction of the problem with instructions</strong></p>
<p dir="auto"><a class="waves-effect" [routerLink]="observable$ | async" [routerLinkActive]="['active']" [routerLinkActiveOptions]="{ exact: true }">LINK</p>
<p dir="auto">the application of the "active" class will not be re-evaluated when a new value is emitted by observable$.<br>
e.g.<br>
obervable$ = Observable.interval(1000).map(i => ['/page/' + i])</p>
<p dir="auto">If you are on /page/0 link will be active on first emission, but will not go inactive once i > 1.</p>
<p dir="auto"><strong>What is the motivation / use case for changing the behavior?</strong></p>
<p dir="auto">Using observables with routerLink should work.</p>
<p dir="auto"><strong>Please tell us about your environment:</strong></p>
<p dir="auto">Chrome 55m, Windows 10</p>
<ul dir="auto">
<li><strong>Angular version:</strong> 2.0.X</li>
</ul>
<p dir="auto">2.4.1</p>
<ul dir="auto">
<li><strong>Browser:</strong> [all | Chrome XX | Firefox XX | IE XX | Safari XX | Mobile Chrome XX | Android X.X Web Browser | iOS XX Safari | iOS XX UIWebView | iOS XX WKWebView ]</li>
</ul>
<ul dir="auto">
<li>
<p dir="auto"><strong>Language:</strong> [all | TypeScript X.X | ES6/7 | ES5]<br>
TypeScript 2.1.4.0</p>
</li>
<li>
<p dir="auto"><strong>Node (for AoT issues):</strong> <code class="notranslate">node --version</code> =</p>
</li>
</ul> | <p dir="auto">[ x] bug report => search github for a similar issue or PR before submitting<br>
[ ] feature request<br>
[ ] support request => Please do not submit support request here, instead see</p>
<p dir="auto"><strong>Current behavior</strong><br>
Look at this <a href="http://plnkr.co/edit/8UHCnly9beVcZUQLty00?p=preview" rel="nofollow">Plunker</a>.<br>
When you choose one of four heroes HeroComponent is loaded. Inside its templete there is another <code class="notranslate"><router-outlet></code> where you can navigate beetween HeroDetailComponent and HeroNameComponent components. HeroDetailComponent is loaded by default as it has <code class="notranslate">path: ''</code> in routing configuration but link 'Details" isn't mark as active.</p>
<p dir="auto">When we navigate to 'Name' and then back to details by clicking 'Details' link - active class starts to be added.</p>
<p dir="auto">Also when we are in HeroNameComponent and then we choose again active hero from list (only curently active hero) then details button is shown as acivated correctly .</p>
<p dir="auto">Its seems to doesn't work especially when component is reused, without creating new instance.</p>
<p dir="auto"><strong>Expected behavior</strong><br>
When clicking one of heroses, details button should be marked as active.</p>
<ul dir="auto">
<li>
<p dir="auto"><strong>Angular version:</strong> 2.2.3, also ~2.1.0</p>
</li>
<li>
<p dir="auto"><strong>Browser:</strong> [all ]</p>
</li>
<li>
<p dir="auto"><strong>Language:</strong> [TypeScript]</p>
</li>
</ul> | 1 |
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> I have searched the <a href="https://github.com/apache/incubator-dubbo/issues">issues</a> of this repository and believe that this is not a duplicate.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> I have checked the <a href="https://github.com/apache/incubator-dubbo/blob/master/FAQ.md">FAQ</a> of this repository and believe that this is not a duplicate.</li>
</ul>
<h3 dir="auto">Environment</h3>
<ul dir="auto">
<li>Dubbo version: xxx</li>
<li>Operating System version: xxx</li>
<li>Java version: xxx</li>
</ul>
<h3 dir="auto">Steps to reproduce this issue</h3>
<ol dir="auto">
<li>xxx</li>
<li>xxx</li>
<li>xxx</li>
</ol>
<p dir="auto">Pls. provide [GitHub address] to reproduce this issue.</p>
<h3 dir="auto">Expected Result</h3>
<p dir="auto">What do you expected from the above steps?</p>
<h3 dir="auto">Actual Result</h3>
<p dir="auto">What actually happens?</p>
<p dir="auto">If there is an exception, please attach the exception trace:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Just put your stack trace here!"><pre class="notranslate"><code class="notranslate">Just put your stack trace here!
</code></pre></div> | <ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have searched the <a href="https://github.com/apache/dubbo/issues">issues</a> of this repository and believe that this is not a duplicate.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have checked the <a href="https://github.com/apache/dubbo/blob/master/FAQ.md">FAQ</a> of this repository and believe that this is not a duplicate.</li>
</ul>
<h3 dir="auto">Environment</h3>
<ul dir="auto">
<li>Dubbo version: 2.7.3</li>
<li>Operating System version: all</li>
<li>Java version: 1.8</li>
</ul>
<h3 dir="auto">Steps to reproduce this issue</h3>
<ol dir="auto">
<li>为什么消费端发送请求,服务端响应请求,序列化操作都是在I/O线程上?当消费端连接数很小时,压力不是很大吗?序列化操作放在业务线程上是不是更好呢</li>
</ol>
<p dir="auto">Pls. provide [GitHub address] to reproduce this issue.</p>
<h3 dir="auto">Expected Result</h3>
<p dir="auto">What do you expected from the above steps?</p>
<h3 dir="auto">Actual Result</h3>
<p dir="auto">What actually happens?</p>
<p dir="auto">If there is an exception, please attach the exception trace:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Just put your stack trace here!"><pre class="notranslate"><code class="notranslate">Just put your stack trace here!
</code></pre></div> | 0 |
<h4 dir="auto">Description</h4>
<p dir="auto">I have problems in cloning a kernel after the parameters of the kernel are set using <code class="notranslate">set_params</code><br>
I assume that this is way the kernel code has been written (logic other than the initialization in the constructor)</p>
<h4 dir="auto">Steps/Code to Reproduce</h4>
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="from sklearn.base import clone
from sklearn.gaussian_process.kernels import RBF
rbf = RBF(length_scale=[2.0, 3.0])
params = rbf.get_params()
print(params)
# {'length_scale_bounds': (1e-05, 100000.0), 'length_scale': array([ 2., 3.])}
clone(rbf) # Does not break
rbf_also = RBF(length_scale=[2.0])
print(rbf_also.get_params())
{'length_scale': 2.0, 'length_scale_bounds': (1e-05, 100000.0)}
clone(rbf_also) # Does not break
rbf = RBF(length_scale=[2.0, 3.0])
params['length_scale'] = [2.0]
rbf.set_params(**params)
clone(rbf) "><pre class="notranslate"><span class="pl-k">from</span> <span class="pl-s1">sklearn</span>.<span class="pl-s1">base</span> <span class="pl-k">import</span> <span class="pl-s1">clone</span>
<span class="pl-k">from</span> <span class="pl-s1">sklearn</span>.<span class="pl-s1">gaussian_process</span>.<span class="pl-s1">kernels</span> <span class="pl-k">import</span> <span class="pl-v">RBF</span>
<span class="pl-s1">rbf</span> <span class="pl-c1">=</span> <span class="pl-v">RBF</span>(<span class="pl-s1">length_scale</span><span class="pl-c1">=</span>[<span class="pl-c1">2.0</span>, <span class="pl-c1">3.0</span>])
<span class="pl-s1">params</span> <span class="pl-c1">=</span> <span class="pl-s1">rbf</span>.<span class="pl-en">get_params</span>()
<span class="pl-en">print</span>(<span class="pl-s1">params</span>)
<span class="pl-c"># {'length_scale_bounds': (1e-05, 100000.0), 'length_scale': array([ 2., 3.])}</span>
<span class="pl-en">clone</span>(<span class="pl-s1">rbf</span>) <span class="pl-c"># Does not break</span>
<span class="pl-s1">rbf_also</span> <span class="pl-c1">=</span> <span class="pl-v">RBF</span>(<span class="pl-s1">length_scale</span><span class="pl-c1">=</span>[<span class="pl-c1">2.0</span>])
<span class="pl-en">print</span>(<span class="pl-s1">rbf_also</span>.<span class="pl-en">get_params</span>())
{<span class="pl-s">'length_scale'</span>: <span class="pl-c1">2.0</span>, <span class="pl-s">'length_scale_bounds'</span>: (<span class="pl-c1">1e-05</span>, <span class="pl-c1">100000.0</span>)}
<span class="pl-en">clone</span>(<span class="pl-s1">rbf_also</span>) <span class="pl-c"># Does not break</span>
<span class="pl-s1">rbf</span> <span class="pl-c1">=</span> <span class="pl-v">RBF</span>(<span class="pl-s1">length_scale</span><span class="pl-c1">=</span>[<span class="pl-c1">2.0</span>, <span class="pl-c1">3.0</span>])
<span class="pl-s1">params</span>[<span class="pl-s">'length_scale'</span>] <span class="pl-c1">=</span> [<span class="pl-c1">2.0</span>]
<span class="pl-s1">rbf</span>.<span class="pl-en">set_params</span>(<span class="pl-c1">**</span><span class="pl-s1">params</span>)
<span class="pl-en">clone</span>(<span class="pl-s1">rbf</span>) </pre></div>
<h4 dir="auto">Expected Results</h4>
<p dir="auto">I would expect it to clone without breaking.</p> | <p dir="auto">Clusters can be found within a training dataset (transductive) then used to train a classifier, so as to extend the clustering model to new instances. See snippet at <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="67017319" data-permission-text="Title is private" data-url="https://github.com/scikit-learn/scikit-learn/issues/4543" data-hovercard-type="issue" data-hovercard-url="/scikit-learn/scikit-learn/issues/4543/hovercard?comment_id=91073246&comment_type=issue_comment" href="https://github.com/scikit-learn/scikit-learn/issues/4543#issuecomment-91073246">#4543 (comment)</a></p>
<p dir="auto"><a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/selwyth/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/selwyth">@selwyth</a> is <a href="https://github.com/scikit-learn/scikit-learn/issues/4543#issuecomment-91185832" data-hovercard-type="issue" data-hovercard-url="/scikit-learn/scikit-learn/issues/4543/hovercard">apparently working on this</a>.</p> | 0 |
<p dir="auto">Hey!</p>
<p dir="auto">While trying to fix <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="135071026" data-permission-text="Title is private" data-url="https://github.com/egeloen/IvoryCKEditorBundle/issues/212" data-hovercard-type="issue" data-hovercard-url="/egeloen/IvoryCKEditorBundle/issues/212/hovercard" href="https://github.com/egeloen/IvoryCKEditorBundle/issues/212">egeloen/IvoryCKEditorBundle#212</a> I have added a <code class="notranslate">form_javascript</code> Twig functions which allows to render form javascript related code where you want in the template.</p>
<p dir="auto">Doing so, allow to link javascript code to a specific form type, allow to render your javascript where you want in the page (often at the bottom of the page), allow to take benefit of the form theming inheritance (for example: form -> text -> textarea) and also define a standard way of linking javascript code to a form.</p>
<p dir="auto">I have decided to open the issue because my implementation is not new, it has been inspired by <a href="https://github.com/genemu/GenemuFormBundle">GenemuFormBundle</a> and <a href="https://github.com/stephanecollot/DatetimepickerBundle">DatetimepickerBundle</a> which both rely on the exact same concept and the exact same code is duplicated along different bundles...</p>
<p dir="auto">Now my question is does it belong to the core or to a third party library? WDYT?</p> | <p dir="auto">I have a page that looks like:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="_______________
Action block
Ignore / Reject / ....
_______________
all data
table > tr > td * N
_______________
Action block
Ignore / Reject / ....
_______________"><pre class="notranslate"><code class="notranslate">_______________
Action block
Ignore / Reject / ....
_______________
all data
table > tr > td * N
_______________
Action block
Ignore / Reject / ....
_______________
</code></pre></div>
<p dir="auto">As you can see, I have the same "action block" on my page.<br>
All buttons are symfony form. and Right now I'm not able to display the same form twice.<br>
I can use "hacky" code like that:</p>
<div class="highlight highlight-text-html-django notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="{# this is a hack, this block in not in the main stream #}
{% block actions %}
<div class="panel panel-default">
<div class="panel-heading">Actions</div>
<div class="panel-body">
{{ form(form_actions)}}
</div>
</div>
{% endblock %}
{% set actions = block('actions') %}
{% block body %}
{{ actions|raw }}
table
{{ actions|raw }}
{% endblock %}"><pre class="notranslate"><span class="pl-c">{# this is a hack, this block in not in the main stream #}</span>
<span class="pl-e">{%</span> <span class="pl-k">block</span> <span class="pl-s">actions</span> <span class="pl-e">%}</span>
<<span class="pl-ent">div</span> <span class="pl-e">class</span>=<span class="pl-s"><span class="pl-pds">"</span>panel panel-default<span class="pl-pds">"</span></span>>
<<span class="pl-ent">div</span> <span class="pl-e">class</span>=<span class="pl-s"><span class="pl-pds">"</span>panel-heading<span class="pl-pds">"</span></span>>Actions</<span class="pl-ent">div</span>>
<<span class="pl-ent">div</span> <span class="pl-e">class</span>=<span class="pl-s"><span class="pl-pds">"</span>panel-body<span class="pl-pds">"</span></span>>
{{ form(form_actions)}}
</<span class="pl-ent">div</span>>
</<span class="pl-ent">div</span>>
<span class="pl-e">{%</span> <span class="pl-k">endblock</span> <span class="pl-e">%}</span>
<span class="pl-e">{%</span> <span class="pl-s">set</span> <span class="pl-s">actions</span> = <span class="pl-k">block</span>(<span class="pl-s">'actions'</span>) <span class="pl-e">%}</span>
<span class="pl-e">{%</span> <span class="pl-k">block</span> <span class="pl-s">body</span> <span class="pl-e">%}</span>
{{ actions|raw }}
table
{{ actions|raw }}
<span class="pl-e">{%</span> <span class="pl-k">endblock</span> <span class="pl-e">%}</span></pre></div>
<p dir="auto">But I don't like it.</p>
<p dir="auto">May be I should not use SF form to handle that, But I need CSRF protection. And now, the way to handle CSRF check in a controller, is not so easy.</p>
<p dir="auto">(PS: I see this issue was rejected in the past, but I have a different use case here).</p> | 0 |
<p dir="auto">One of the common idioms in JavaScript is using a getter function that takes string of a property name of an object and returns the value of the property. For example:</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="var obj = {a: 1, b: '2'};
var model = new Backbone.Model(obj);
var a = mode.get('a'); // a is number"><pre class="notranslate"><span class="pl-k">var</span> <span class="pl-s1">obj</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span><span class="pl-c1">a</span>: <span class="pl-c1">1</span><span class="pl-kos">,</span> <span class="pl-c1">b</span>: <span class="pl-s">'2'</span><span class="pl-kos">}</span><span class="pl-kos">;</span>
<span class="pl-k">var</span> <span class="pl-s1">model</span> <span class="pl-c1">=</span> <span class="pl-k">new</span> <span class="pl-v">Backbone</span><span class="pl-kos">.</span><span class="pl-c1">Model</span><span class="pl-kos">(</span><span class="pl-s1">obj</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-k">var</span> <span class="pl-s1">a</span> <span class="pl-c1">=</span> <span class="pl-s1">mode</span><span class="pl-kos">.</span><span class="pl-en">get</span><span class="pl-kos">(</span><span class="pl-s">'a'</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-c">// a is number</span></pre></div>
<p dir="auto">Right now, the <code class="notranslate">get</code> function can only be defined as returning <code class="notranslate">any</code>, because we can't annotate it with anything better. It would be nice to be to define the return type based on the properties of an interface for example:</p>
<div class="highlight highlight-source-ts notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="declare interface Model {
a: number;
b: string;
}
declare function get<T as Model[keyArg]>(keyArg: string): T; // syntax is for conveying idea only
get('a'); // number
get('b'); // string
get('c'); // any
declare function get2<T, T2 as T[keyArg]>(keyArg: string): T2; // generic version
get2<Window>('setTimeout'); // function
get2<Window>('nonsense'); // any
declare function get3<T as Model[keyArg]>(keyArg: any): T; // compile error, only support string and maybe number.
declare function set<T as Model[keyArg]>(keyArg: string, value: T): void; // set syntax for the same thing
"><pre class="notranslate"><span class="pl-k">declare</span> <span class="pl-k">interface</span> <span class="pl-smi">Model</span> <span class="pl-kos">{</span>
<span class="pl-c1">a</span>: <span class="pl-smi">number</span><span class="pl-kos">;</span>
<span class="pl-c1">b</span>: <span class="pl-smi">string</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span>
<span class="pl-k">declare</span> <span class="pl-k">function</span> <span class="pl-s1">get</span><span class="pl-c1"><</span><span class="pl-smi">T</span> <span class="pl-s1">as</span> <span class="pl-smi">Model</span><span class="pl-kos">[</span><span class="pl-smi">keyArg</span><span class="pl-kos">]</span><span class="pl-c1">></span><span class="pl-kos">(</span><span class="pl-s1">keyArg</span>: <span class="pl-smi">string</span><span class="pl-kos">)</span>: <span class="pl-smi">T</span><span class="pl-kos">;</span> <span class="pl-c">// syntax is for conveying idea only</span>
<span class="pl-en">get</span><span class="pl-kos">(</span><span class="pl-s">'a'</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-c">// number</span>
<span class="pl-en">get</span><span class="pl-kos">(</span><span class="pl-s">'b'</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-c">// string</span>
<span class="pl-en">get</span><span class="pl-kos">(</span><span class="pl-s">'c'</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-c">// any</span>
<span class="pl-k">declare</span> <span class="pl-k">function</span> <span class="pl-s1">get2</span><span class="pl-c1"><</span><span class="pl-smi">T</span><span class="pl-kos">,</span> <span class="pl-smi">T2</span> <span class="pl-s1">as</span> <span class="pl-smi">T</span><span class="pl-kos">[</span><span class="pl-smi">keyArg</span><span class="pl-kos">]</span><span class="pl-c1">></span><span class="pl-kos">(</span><span class="pl-s1">keyArg</span>: <span class="pl-smi">string</span><span class="pl-kos">)</span>: <span class="pl-smi">T2</span><span class="pl-kos">;</span> <span class="pl-c">// generic version</span>
<span class="pl-en">get2</span><span class="pl-kos"><</span><span class="pl-smi">Window</span><span class="pl-kos">></span><span class="pl-kos">(</span><span class="pl-s">'setTimeout'</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-c">// function</span>
<span class="pl-en">get2</span><span class="pl-kos"><</span><span class="pl-smi">Window</span><span class="pl-kos">></span><span class="pl-kos">(</span><span class="pl-s">'nonsense'</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-c">// any</span>
<span class="pl-k">declare</span> <span class="pl-k">function</span> <span class="pl-s1">get3</span><span class="pl-c1"><</span><span class="pl-smi">T</span> <span class="pl-s1">as</span> <span class="pl-smi">Model</span><span class="pl-kos">[</span><span class="pl-smi">keyArg</span><span class="pl-kos">]</span><span class="pl-c1">></span><span class="pl-kos">(</span><span class="pl-s1">keyArg</span>: <span class="pl-smi">any</span><span class="pl-kos">)</span>: <span class="pl-smi">T</span><span class="pl-kos">;</span> <span class="pl-c">// compile error, only support string and maybe number.</span>
<span class="pl-k">declare</span> <span class="pl-k">function</span> <span class="pl-s1">set</span><span class="pl-c1"><</span><span class="pl-smi">T</span> <span class="pl-s1">as</span> <span class="pl-smi">Model</span><span class="pl-kos">[</span><span class="pl-smi">keyArg</span><span class="pl-kos">]</span><span class="pl-c1">></span><span class="pl-kos">(</span><span class="pl-s1">keyArg</span>: <span class="pl-smi">string</span><span class="pl-kos">,</span> <span class="pl-s1">value</span>: <span class="pl-smi">T</span><span class="pl-kos">)</span>: <span class="pl-smi"><span class="pl-k">void</span></span><span class="pl-kos">;</span> <span class="pl-c">// set syntax for the same thing</span></pre></div>
<p dir="auto">This would allow better definitions a lot of functions in common libraries like <code class="notranslate">Lodash</code>/<code class="notranslate">Underscore</code>, <code class="notranslate">Immutable.js</code>, <code class="notranslate">Backbone</code>.</p>
<hr>
<p dir="auto">Currently TypeScript supports specialized overload signature. For example</p>
<div class="highlight highlight-source-ts notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="declare function get(key: string): any;
declare function get(key: 'key'): string;"><pre class="notranslate"><span class="pl-k">declare</span> <span class="pl-k">function</span> <span class="pl-s1">get</span><span class="pl-kos">(</span><span class="pl-s1">key</span>: <span class="pl-smi">string</span><span class="pl-kos">)</span>: <span class="pl-smi">any</span><span class="pl-kos">;</span>
<span class="pl-k">declare</span> <span class="pl-k">function</span> <span class="pl-s1">get</span><span class="pl-kos">(</span><span class="pl-s1">key</span>: <span class="pl-s">'key'</span><span class="pl-kos">)</span>: <span class="pl-smi">string</span><span class="pl-kos">;</span></pre></div>
<p dir="auto">The suggestion above can already be partially implemented at application level by using specialized overload signature with code generator. The suggestion would allow this to be implemented more generally (especially for libraries).</p>
<hr>
<p dir="auto">Potential implementation may also be used to refine <code class="notranslate">{ [key: string]: someType }</code>, but that might be more complex as it requires self referencing.</p> | <p dir="auto">How do I use the compiled typescript files with systemjs? Can typescript compile in the <code class="notranslate">System.register</code> format as traceur can?</p> | 0 |
<p dir="auto">Hello,</p>
<p dir="auto">My apologies if this is a duplicate of an existing issue, but shouldn't input type="search" elements assigned to the form-control class be assigned "-webkit-appearance: none;" so that these search fields look as expected when wrapped in .input-group?</p> | <p dir="auto">When downloading the CSS (happens without making any changes in the theme), get the following error:</p>
<p dir="auto">{“type":"Parse","message":"Syntax Error on line 792","index":25132,"filename":"bootstrap.css","line":792,"column":11,"extract":[" *margin: -5px 0 5px;"," ove rflow: hidden;"," background-color: <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/top/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/top">@top</a>;"]}</p> | 0 |
<p dir="auto"><code class="notranslate">test.rs</code>:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="mod test;
fn main(){}"><pre class="notranslate"><code class="notranslate">mod test;
fn main(){}
</code></pre></div>
<p dir="auto">causes</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="rust: task 7f855ac0c250 ran out of stack
error: internal compiler error: unexpected failure
note: the compiler hit an unexpected failure path. this is a bug
note: try running with RUST_LOG=rustc=1,::rt::backtrace to get further details and report the results to github.com/mozilla/rust/issues
rust: task failed at 'explicit failure', /private/tmp/rust-GCHx/rust-0.6/src/librustc/rustc.rc:357
rust: domain main @0x7f855b009810 root task failed"><pre class="notranslate"><code class="notranslate">rust: task 7f855ac0c250 ran out of stack
error: internal compiler error: unexpected failure
note: the compiler hit an unexpected failure path. this is a bug
note: try running with RUST_LOG=rustc=1,::rt::backtrace to get further details and report the results to github.com/mozilla/rust/issues
rust: task failed at 'explicit failure', /private/tmp/rust-GCHx/rust-0.6/src/librustc/rustc.rc:357
rust: domain main @0x7f855b009810 root task failed
</code></pre></div> | <p dir="auto">While I was playing with the new rustc 0.6, I encountered an internal compiler error</p>
<div class="highlight highlight-text-shell-session notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="~/project/protobuf-rust(master) > RUST_LOG=rustc=1,::rt::backtrace rustc protobuf.rs --test -o protobuf-tests
rust: task 7fbd705018b0 ran out of stack
error: internal compiler error: unexpected failure
note: the compiler hit an unexpected failure path. this is a bug
note: try running with RUST_LOG=rustc=1,::rt::backtrace to get further details and report the results to github.com/mozilla/rust/issues
rust: task failed at 'explicit failure', /Users/kimhyunkang/usr/pkgs/rust-0.6/src/librustc/rustc.rc:357
rust: domain main @0x7fbd70819410 root task failed"><pre class="notranslate"><span class="pl-c1">~/project/protobuf-rust(master) > RUST_LOG=rustc=1,::rt::backtrace rustc protobuf.rs --test -o protobuf-tests</span>
<span class="pl-c1">rust: task 7fbd705018b0 ran out of stack</span>
<span class="pl-c1">error: internal compiler error: unexpected failure</span>
<span class="pl-c1">note: the compiler hit an unexpected failure path. this is a bug</span>
<span class="pl-c1">note: try running with RUST_LOG=rustc=1,::rt::backtrace to get further details and report the results to github.com/mozilla/rust/issues</span>
<span class="pl-c1">rust: task failed at 'explicit failure', /Users/kimhyunkang/usr/pkgs/rust-0.6/src/librustc/rustc.rc:357</span>
<span class="pl-c1">rust: domain main @0x7fbd70819410 root task failed</span></pre></div>
<p dir="auto">The source code is here: <a href="https://gist.github.com/kimhyunkang/5307274">https://gist.github.com/kimhyunkang/5307274</a></p>
<p dir="auto">Compiler version is 0.6, built with gcc, on OS X 10.7.5</p>
<div class="highlight highlight-text-shell-session notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="~/project/protobuf-rust(master) > rustc --version
rustc 0.6
host: x86_64-apple-darwin"><pre class="notranslate"><span class="pl-c1">~/project/protobuf-rust(master) > rustc --version</span>
<span class="pl-c1">rustc 0.6</span>
<span class="pl-c1">host: x86_64-apple-darwin</span></pre></div>
<div class="highlight highlight-text-shell-session notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="~/project/protobuf-rust(master) > gcc --version
i686-apple-darwin11-llvm-gcc-4.2 (GCC) 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.1.00)
Copyright (C) 2007 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."><pre class="notranslate"><span class="pl-c1">~/project/protobuf-rust(master) > gcc --version</span>
<span class="pl-c1">i686-apple-darwin11-llvm-gcc-4.2 (GCC) 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.1.00)</span>
<span class="pl-c1">Copyright (C) 2007 Free Software Foundation, Inc.</span>
<span class="pl-c1">This is free software; see the source for copying conditions. There is NO</span>
<span class="pl-c1">warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.</span></pre></div> | 1 |
<p dir="auto">Hi<br>
This is a suggestion.<br>
bootstrap is one of a wonderful project that I've seen but i think if the customize page has a little features it becomes more wonderful<br>
I don't know what colors in the fields look like in customize page in getbootstrap.com and i have to copy paste that HEX code to see what is the color of them then change it while if you put a little div box beside each field to shows the color it was very useful<br>
Or better than this is put a color picker something like this:<br>
<a href="http://twitterbootstrap3navbars.w3masters.nl/" rel="nofollow">http://twitterbootstrap3navbars.w3masters.nl/</a></p>
<p dir="auto">Then we customize the color and see what is output then compile it<br>
I think this page doesn't use more</p>
<p dir="auto">Thanks</p> | <p dir="auto">Using javascript to automatically update a small preview for colour variables on the customiser (perhaps using input groups).</p>
<p dir="auto">For example:<br>
<a target="_blank" rel="noopener noreferrer nofollow" href="https://camo.githubusercontent.com/7145ebe571af99658fbfc6f0d486e32314e250ccef48cad247f5b78f5d757784/687474703a2f2f692e696d6775722e636f6d2f496938483670622e706e67"><img src="https://camo.githubusercontent.com/7145ebe571af99658fbfc6f0d486e32314e250ccef48cad247f5b78f5d757784/687474703a2f2f692e696d6775722e636f6d2f496938483670622e706e67" alt="" data-canonical-src="http://i.imgur.com/Ii8H6pb.png" style="max-width: 100%;"></a></p> | 1 |
<h3 dir="auto">Version</h3>
<p dir="auto">2.5.16</p>
<h3 dir="auto">Reproduction link</h3>
<p dir="auto"><a href="https://codesandbox.io/s/github/weihongyu12/vue-typescript-demo" rel="nofollow">https://codesandbox.io/s/github/weihongyu12/vue-typescript-demo</a></p>
<h3 dir="auto">Steps to reproduce</h3>
<p dir="auto">Uses @vue/cli to build the project. The configuration uses TypeScript. However, in the process of using, in the <code class="notranslate">methods</code>, there is no access to the <code class="notranslate">computed</code>. The construction does not exist on type 'Vue'.</p>
<div class="highlight highlight-text-html-vue notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="<template>
<ul
v-if="show"
class="picker">
<li
v-for="(item, index) of pickerList"
:key="index">{{ item }}</li>
</ul>
</template>
<script lang="ts">
import Vue from 'vue';
export default Vue.extend({
name : 'Picker',
props: {
columns: {
type: Array,
default: [],
},
show: {
type: Boolean ,
default: false,
},
},
computed: {
pickerList(): Array<string> {
const arr = [];
const columns: any = this.columns;
for (const item of columns) {
arr.push(item.title);
}
return arr;
},
pickerMap() : Map<string, number> {
const map = new Map();
const columns: any = this.columns;
for (const item of columns) {
map.set(item.title, item.id);
}
return map;
},
},
methods: {
onConfirm(value: string): void {
const resumeId = this.pickerMap.get(value); // Property 'pickerMap' does not exist on type 'Vue'.
this.$emit('confirm', resumeId);
},
},
});
</script>"><pre class="notranslate"><<span class="pl-ent">template</span>>
<<span class="pl-ent">ul</span>
<span class="pl-e">v-if</span>=<span class="pl-s1"><span class="pl-pds">"</span>show<span class="pl-pds">"</span></span>
<span class="pl-e">class</span>=<span class="pl-s"><span class="pl-pds">"</span>picker<span class="pl-pds">"</span></span>>
<<span class="pl-ent">li</span>
<span class="pl-e">v-for</span>=<span class="pl-s1"><span class="pl-pds">"</span>(item, index) <span class="pl-k">of</span> pickerList<span class="pl-pds">"</span></span>
:<span class="pl-e">key</span>=<span class="pl-s1"><span class="pl-pds">"</span>index<span class="pl-pds">"</span></span>>{{ item }}</<span class="pl-ent">li</span>>
</<span class="pl-ent">ul</span>>
</<span class="pl-ent">template</span>>
<span class="pl-s1"><<span class="pl-ent">script</span> <span class="pl-e">lang</span>=<span class="pl-s"><span class="pl-pds">"</span>ts<span class="pl-pds">"</span></span>></span>
<span class="pl-s1"><span class="pl-k">import</span> <span class="pl-smi">Vue</span> <span class="pl-k">from</span> <span class="pl-s"><span class="pl-pds">'</span>vue<span class="pl-pds">'</span></span>;</span>
<span class="pl-s1"></span>
<span class="pl-s1"><span class="pl-k">export</span> <span class="pl-k">default</span> <span class="pl-smi">Vue</span>.<span class="pl-en">extend</span>({</span>
<span class="pl-s1"> name : <span class="pl-s"><span class="pl-pds">'</span>Picker<span class="pl-pds">'</span></span>,</span>
<span class="pl-s1"> props: {</span>
<span class="pl-s1"> columns: {</span>
<span class="pl-s1"> type: <span class="pl-c1">Array</span>,</span>
<span class="pl-s1"> default: [],</span>
<span class="pl-s1"> },</span>
<span class="pl-s1"> show: {</span>
<span class="pl-s1"> type: <span class="pl-c1">Boolean</span> ,</span>
<span class="pl-s1"> default: <span class="pl-c1">false</span>,</span>
<span class="pl-s1"> },</span>
<span class="pl-s1"> },</span>
<span class="pl-s1"> computed: {</span>
<span class="pl-s1"> pickerList()<span class="pl-k">:</span> <span class="pl-en">Array</span><<span class="pl-c1">string</span>> {</span>
<span class="pl-s1"> <span class="pl-k"><span class="pl-k">const</span></span> arr <span class="pl-k">=</span> [];</span>
<span class="pl-s1"> <span class="pl-k"><span class="pl-k">const</span></span> columns<span class="pl-k">:</span> <span class="pl-c1">any</span> <span class="pl-k">=</span> <span class="pl-c1">this</span>.<span class="pl-smi">columns</span>;</span>
<span class="pl-s1"> <span class="pl-k">for</span> (<span class="pl-k"><span class="pl-k">const</span></span> item <span class="pl-k">of</span> <span class="pl-smi">columns</span>) {</span>
<span class="pl-s1"> <span class="pl-smi">arr</span>.<span class="pl-c1">push</span>(<span class="pl-smi">item</span>.<span class="pl-c1">title</span>);</span>
<span class="pl-s1"> }</span>
<span class="pl-s1"> <span class="pl-k">return</span> <span class="pl-smi">arr</span>;</span>
<span class="pl-s1"> },</span>
<span class="pl-s1"> pickerMap() <span class="pl-k">:</span> <span class="pl-en">Map</span><<span class="pl-c1">string</span>, <span class="pl-c1">number</span>> {</span>
<span class="pl-s1"> <span class="pl-k"><span class="pl-k">const</span></span> map <span class="pl-k">=</span> <span class="pl-k">new</span> <span class="pl-c1">Map</span>();</span>
<span class="pl-s1"> <span class="pl-k"><span class="pl-k">const</span></span> columns<span class="pl-k">:</span> <span class="pl-c1">any</span> <span class="pl-k">=</span> <span class="pl-c1">this</span>.<span class="pl-smi">columns</span>;</span>
<span class="pl-s1"> <span class="pl-k">for</span> (<span class="pl-k"><span class="pl-k">const</span></span> item <span class="pl-k">of</span> <span class="pl-smi">columns</span>) {</span>
<span class="pl-s1"> <span class="pl-smi">map</span>.<span class="pl-c1">set</span>(<span class="pl-smi">item</span>.<span class="pl-c1">title</span>, <span class="pl-smi">item</span>.<span class="pl-c1">id</span>);</span>
<span class="pl-s1"> }</span>
<span class="pl-s1"> <span class="pl-k">return</span> <span class="pl-smi">map</span>;</span>
<span class="pl-s1"> },</span>
<span class="pl-s1"> },</span>
<span class="pl-s1"> methods: {</span>
<span class="pl-s1"> onConfirm(<span class="pl-v">value</span><span class="pl-k">:</span> <span class="pl-c1">string</span>)<span class="pl-k">:</span> <span class="pl-c1">void</span> {</span>
<span class="pl-s1"> <span class="pl-k"><span class="pl-k">const</span></span> resumeId <span class="pl-k">=</span> <span class="pl-c1">this</span>.<span class="pl-smi">pickerMap</span>.<span class="pl-c1">get</span>(<span class="pl-smi">value</span>); <span class="pl-c"><span class="pl-c">//</span> Property 'pickerMap' does not exist on type 'Vue'.</span></span>
<span class="pl-s1"> <span class="pl-c1">this</span>.<span class="pl-en">$emit</span>(<span class="pl-s"><span class="pl-pds">'</span>confirm<span class="pl-pds">'</span></span>, <span class="pl-smi">resumeId</span>);</span>
<span class="pl-s1"> },</span>
<span class="pl-s1"> },</span>
<span class="pl-s1">});</span>
<span class="pl-s1"></<span class="pl-ent">script</span>></span></pre></div>
<h3 dir="auto">What is expected?</h3>
<p dir="auto">I don't know if it's because of my writing, or because of the configuration that caused me this error. I wrote the code based on the official document. I believe it can be build successfully.</p>
<h3 dir="auto">What is actually happening?</h3>
<p dir="auto">When I run <code class="notranslate">npm run build</code>, an error Property 'pickerMap' does not exist on type 'Vue'. The complete prompt is as follows:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="ERROR in E:/project/demo/src/components/picker.vue
44:29 Property 'pickerMap' does not exist on type 'Vue'.
42 | methods: {
43 | onConfirm(value: string): void {
> 44 | const resumeId = this.pickerMap.get(value);
| ^
45 | this.$emit('confirm', resumeId);
46 | },
47 | },"><pre class="notranslate"><code class="notranslate">ERROR in E:/project/demo/src/components/picker.vue
44:29 Property 'pickerMap' does not exist on type 'Vue'.
42 | methods: {
43 | onConfirm(value: string): void {
> 44 | const resumeId = this.pickerMap.get(value);
| ^
45 | this.$emit('confirm', resumeId);
46 | },
47 | },
</code></pre></div>
<hr>
<p dir="auto">I do not know of any reason for this error. It is imperative that I have a friend to help me solve this error, but I hope that the official can speed up the improvement of TypeScript's documentation, because I believe TypeScript will become popular. Thank you.</p> | <h3 dir="auto">Version</h3>
<p dir="auto">2.5.2</p>
<h3 dir="auto">Reproduction link</h3>
<p dir="auto"><a href="https://github.com/wonderful-panda/vue-sandbox">https://github.com/wonderful-panda/vue-sandbox</a></p>
<h3 dir="auto">Steps to reproduce</h3>
<p dir="auto">Compile this code by tsc</p>
<div class="highlight highlight-source-ts notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="import Vue, { VNode } from "vue";
const NgComponent = Vue.extend({
name: "NgComponent",
props: {
foo: { type: String },
bar: {} // any types are accepted
},
render(h): VNode {
return h("div", this.foo);
}
});"><pre class="notranslate"><span class="pl-k">import</span> <span class="pl-smi">Vue</span><span class="pl-kos">,</span> <span class="pl-kos">{</span> <span class="pl-smi">VNode</span> <span class="pl-kos">}</span> <span class="pl-k">from</span> <span class="pl-s">"vue"</span><span class="pl-kos">;</span>
<span class="pl-k">const</span> <span class="pl-smi">NgComponent</span> <span class="pl-c1">=</span> <span class="pl-smi">Vue</span><span class="pl-kos">.</span><span class="pl-en">extend</span><span class="pl-kos">(</span><span class="pl-kos">{</span>
<span class="pl-c1">name</span>: <span class="pl-s">"NgComponent"</span><span class="pl-kos">,</span>
<span class="pl-c1">props</span>: <span class="pl-kos">{</span>
<span class="pl-c1">foo</span>: <span class="pl-kos">{</span> <span class="pl-c1">type</span>: <span class="pl-smi">String</span> <span class="pl-kos">}</span><span class="pl-kos">,</span>
<span class="pl-c1">bar</span>: <span class="pl-kos">{</span><span class="pl-kos">}</span> <span class="pl-c">// any types are accepted</span>
<span class="pl-kos">}</span><span class="pl-kos">,</span>
<span class="pl-en">render</span><span class="pl-kos">(</span><span class="pl-s1">h</span><span class="pl-kos">)</span>: <span class="pl-smi">VNode</span> <span class="pl-kos">{</span>
<span class="pl-k">return</span> <span class="pl-en">h</span><span class="pl-kos">(</span><span class="pl-s">"div"</span><span class="pl-kos">,</span> <span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">foo</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span>
<span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">;</span></pre></div>
<p dir="auto">or clone from repro link and <code class="notranslate">npm install && npm run build</code></p>
<h3 dir="auto">What is expected?</h3>
<p dir="auto">Successfully compiled.</p>
<p dir="auto">And <code class="notranslate">this.foo</code> is treated as string, <code class="notranslate">this.bar</code> is treated as any.</p>
<h3 dir="auto">What is actually happening?</h3>
<p dir="auto">Failed to compile.</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="src/index.ts(10,30): error TS2339: Property 'foo' does not exist on type 'CombinedVueInstance<Vue, {}, {}, {}, Readonly<{}>>'."><pre class="notranslate"><code class="notranslate">src/index.ts(10,30): error TS2339: Property 'foo' does not exist on type 'CombinedVueInstance<Vue, {}, {}, {}, Readonly<{}>>'.
</code></pre></div>
<hr>
<p dir="auto">Workaround:</p>
<div class="highlight highlight-source-ts notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="import Vue, { VNode } from "vue";
Vue.extend({
name: "Workaround",
props: {
foo: { type: String },
bar: {} as (() => any) // any types are accepted
},
render(h): VNode {
return h("div", this.foo);
}
});"><pre class="notranslate"><span class="pl-k">import</span> <span class="pl-smi">Vue</span><span class="pl-kos">,</span> <span class="pl-kos">{</span> <span class="pl-smi">VNode</span> <span class="pl-kos">}</span> <span class="pl-k">from</span> <span class="pl-s">"vue"</span><span class="pl-kos">;</span>
<span class="pl-smi">Vue</span><span class="pl-kos">.</span><span class="pl-en">extend</span><span class="pl-kos">(</span><span class="pl-kos">{</span>
<span class="pl-c1">name</span>: <span class="pl-s">"Workaround"</span><span class="pl-kos">,</span>
<span class="pl-c1">props</span>: <span class="pl-kos">{</span>
<span class="pl-c1">foo</span>: <span class="pl-kos">{</span> <span class="pl-c1">type</span>: <span class="pl-smi">String</span> <span class="pl-kos">}</span><span class="pl-kos">,</span>
<span class="pl-c1">bar</span>: <span class="pl-kos">{</span><span class="pl-kos">}</span> <span class="pl-k">as</span> <span class="pl-kos">(</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-c1">=></span> <span class="pl-smi">any</span><span class="pl-kos">)</span> <span class="pl-c">// any types are accepted</span>
<span class="pl-kos">}</span><span class="pl-kos">,</span>
<span class="pl-en">render</span><span class="pl-kos">(</span><span class="pl-s1">h</span><span class="pl-kos">)</span>: <span class="pl-smi">VNode</span> <span class="pl-kos">{</span>
<span class="pl-k">return</span> <span class="pl-en">h</span><span class="pl-kos">(</span><span class="pl-s">"div"</span><span class="pl-kos">,</span> <span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">foo</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span>
<span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">;</span></pre></div> | 1 |
<h5 dir="auto">ISSUE TYPE</h5>
<ul dir="auto">
<li>Bug Report</li>
</ul>
<h5 dir="auto">COMPONENT NAME</h5>
<h5 dir="auto">ANSIBLE VERSION</h5>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="ansible 2.4.2.0
config file = /Users/user/Desktop/ansible2/ansible.cfg
configured module search path = [u'/Users/user/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
ansible python module location = /Library/Python/2.7/site-packages/ansible
executable location = /usr/local/bin/ansible
python version = 2.7.10 (default, Jul 15 2017, 17:16:57) [GCC 4.2.1 Compatible Apple LLVM 9.0.0 (clang-900.0.31)]"><pre class="notranslate"><code class="notranslate">ansible 2.4.2.0
config file = /Users/user/Desktop/ansible2/ansible.cfg
configured module search path = [u'/Users/user/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
ansible python module location = /Library/Python/2.7/site-packages/ansible
executable location = /usr/local/bin/ansible
python version = 2.7.10 (default, Jul 15 2017, 17:16:57) [GCC 4.2.1 Compatible Apple LLVM 9.0.0 (clang-900.0.31)]
</code></pre></div>
<h5 dir="auto">CONFIGURATION</h5>
<p dir="auto">DEFAULT_REMOTE_TMP(/Users/user/Desktop/ansible2/ansible.cfg) = ~/.ansible/tmp<br>
HOST_KEY_CHECKING(/Users/user/Desktop/ansible2/ansible.cfg) = False</p>
<h5 dir="auto">OS / ENVIRONMENT</h5>
<p dir="auto">macOS High Sierra 10.13.3</p>
<h5 dir="auto">SUMMARY</h5>
<p dir="auto">I'm running NX-OSv7.3.0 in GNS3 2.1.3, attempting to run a simple ansible script as seen below and get hit with the error.</p>
<h5 dir="auto">STEPS TO REPRODUCE</h5>
<p dir="auto">a.yml</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="
- hosts: switch
tasks:
- name: Nexus
nxos_facts:
gather_subset: all
"><pre lang="---" class="notranslate"><code class="notranslate">
- hosts: switch
tasks:
- name: Nexus
nxos_facts:
gather_subset: all
</code></pre></div>
<p dir="auto">inventory file:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="[all:vars]
ansible_connection=ssh
ansible_ssh_user=admin
ansible_ssh_pass=admin
[switch]
172.16.0.2"><pre class="notranslate"><code class="notranslate">[all:vars]
ansible_connection=ssh
ansible_ssh_user=admin
ansible_ssh_pass=admin
[switch]
172.16.0.2
</code></pre></div>
<p dir="auto">I also have in my local hosts file:<br>
switch 172.16.0.2</p>
<h5 dir="auto">EXPECTED RESULTS</h5>
<p dir="auto">Expected ansible to connect via SSH and get some facts from NX-OSv.</p>
<h5 dir="auto">ACTUAL RESULTS</h5>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="TASK [Gathering Facts] ***********************************************************************************
Using module file /Library/Python/2.7/site-packages/ansible/modules/system/setup.py
<172.16.0.2> ESTABLISH SSH CONNECTION FOR USER: admin
<172.16.0.2> SSH: EXEC sshpass -d42 ssh -vvv -C -o ControlMaster=auto -o ControlPersist=60s -o StrictHostKeyChecking=no -o User=admin -o ConnectTimeout=10 -o ControlPath=/Users/user/.ansible/cp/bb64dc9435 172.16.0.2 '/bin/sh -c '"'"'echo ~ && sleep 0'"'"''
<172.16.0.2> (16, "Syntax error while parsing '/bin/sh -c 'echo ~ && sleep 0''\n\n\nCmd exec error.\n", 'OpenSSH_7.6p1, LibreSSL 2.6.2\r\ndebug1: Reading configuration data /etc/ssh/ssh_config\r\ndebug1: /etc/ssh/ssh_config line 48: Applying options for *\r\ndebug1: auto-mux: Trying existing master\r\ndebug1: Control socket "/Users/user/.ansible/cp/bb64dc9435" does not exist\r\ndebug2: resolving "172.16.0.2" port 22\r\ndebug2: ssh_connect_direct: needpriv 0\r\ndebug1: Connecting to 172.16.0.2 [172.16.0.2] port 22.\r\ndebug2: fd 3 setting O_NONBLOCK\r\ndebug1: fd 3 clearing O_NONBLOCK\r\ndebug1: Connection established.\r\ndebug3: timeout: 9817 ms remain after connect\r\ndebug1: identity file /Users/user/.ssh/id_rsa type 0\r\ndebug1: key_load_public: No such file or directory\r\ndebug1: identity file /Users/user/.ssh/id_rsa-cert type -1\r\ndebug1: key_load_public: No such file or directory\r\ndebug1: identity file /Users/user/.ssh/id_dsa type -1\r\ndebug1: key_load_public: No such file or directory\r\ndebug1: identity file /Users/user/.ssh/id_dsa-cert type -1\r\ndebug1: key_load_public: No such file or directory\r\ndebug1: identity file /Users/user/.ssh/id_ecdsa type -1\r\ndebug1: key_load_public: No such file or directory\r\ndebug1: identity file /Users/user/.ssh/id_ecdsa-cert type -1\r\ndebug1: key_load_public: No such file or directory\r\ndebug1: identity file /Users/user/.ssh/id_ed25519 type -1\r\ndebug1: key_load_public: No such file or directory\r\ndebug1: identity file /Users/user/.ssh/id_ed25519-cert type -1\r\ndebug1: Local version string SSH-2.0-OpenSSH_7.6\r\ndebug1: Remote protocol version 2.0, remote software version OpenSSH_6.2 FIPS\r\ndebug1: match: OpenSSH_6.2 FIPS pat OpenSSH* compat 0x04000000\r\ndebug2: fd 3 setting O_NONBLOCK\r\ndebug1: Authenticating to 172.16.0.2:22 as \'admin\'\r\ndebug3: hostkeys_foreach: reading file "/Users/user/.ssh/known_hosts"\r\ndebug3: record_hostkey: found key type RSA in file /Users/user/.ssh/known_hosts:6\r\ndebug3: load_hostkeys: loaded 1 keys from 172.16.0.2\r\ndebug3: order_hostkeyalgs: prefer hostkeyalgs: [email protected],rsa-sha2-512,rsa-sha2-256,ssh-rsa\r\ndebug3: send packet: type 20\r\ndebug1: SSH2_MSG_KEXINIT sent\r\ndebug3: receive packet: type 20\r\ndebug1: SSH2_MSG_KEXINIT received\r\ndebug2: local client KEXINIT proposal\r\ndebug2: KEX algorithms: curve25519-sha256,[email protected],ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group16-sha512,diffie-hellman-group18-sha512,diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha256,diffie-hellman-group14-sha1,ext-info-c\r\ndebug2: host key algorithms: [email protected],rsa-sha2-512,rsa-sha2-256,ssh-rsa,[email protected],[email protected],[email protected],[email protected],ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,ssh-ed25519\r\ndebug2: ciphers ctos: [email protected],aes128-ctr,aes192-ctr,aes256-ctr,[email protected],[email protected]\r\ndebug2: ciphers stoc: [email protected],aes128-ctr,aes192-ctr,aes256-ctr,[email protected],[email protected]\r\ndebug2: MACs ctos: [email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],hmac-sha2-256,hmac-sha2-512,hmac-sha1\r\ndebug2: MACs stoc: [email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],hmac-sha2-256,hmac-sha2-512,hmac-sha1\r\ndebug2: compression ctos: [email protected],zlib,none\r\ndebug2: compression stoc: [email protected],zlib,none\r\ndebug2: languages ctos: \r\ndebug2: languages stoc: \r\ndebug2: first_kex_follows 0 \r\ndebug2: reserved 0 \r\ndebug2: peer server KEXINIT proposal\r\ndebug2: KEX algorithms: ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1,diffie-hellman-group1-sha1\r\ndebug2: host key algorithms: ssh-rsa\r\ndebug2: ciphers ctos: aes128-ctr,aes192-ctr,aes256-ctr\r\ndebug2: ciphers stoc: aes128-ctr,aes192-ctr,aes256-ctr\r\ndebug2: MACs ctos: hmac-sha1\r\ndebug2: MACs stoc: hmac-sha1\r\ndebug2: compression ctos: none,[email protected]\r\ndebug2: compression stoc: none,[email protected]\r\ndebug2: languages ctos: \r\ndebug2: languages stoc: \r\ndebug2: first_kex_follows 0 \r\ndebug2: reserved 0 \r\ndebug1: kex: algorithm: ecdh-sha2-nistp256\r\ndebug1: kex: host key algorithm: ssh-rsa\r\ndebug1: kex: server->client cipher: aes128-ctr MAC: hmac-sha1 compression: [email protected]\r\ndebug1: kex: client->server cipher: aes128-ctr MAC: hmac-sha1 compression: [email protected]\r\ndebug3: send packet: type 30\r\ndebug1: sending SSH2_MSG_KEX_ECDH_INIT\r\ndebug1: expecting SSH2_MSG_KEX_ECDH_REPLY\r\ndebug3: receive packet: type 31\r\ndebug1: Server host key: ssh-rsa SHA256:oSmRIx+fcmRlvRewAQwBMA1YWG6vjlsMuwTrJwh+b88\r\ndebug3: hostkeys_foreach: reading file "/Users/user/.ssh/known_hosts"\r\ndebug3: record_hostkey: found key type RSA in file /Users/user/.ssh/known_hosts:6\r\ndebug3: load_hostkeys: loaded 1 keys from 172.16.0.2\r\ndebug1: Host \'172.16.0.2\' is known and matches the RSA host key.\r\ndebug1: Found key in /Users/user/.ssh/known_hosts:6\r\ndebug3: send packet: type 21\r\ndebug2: set_newkeys: mode 1\r\ndebug1: rekey after 4294967296 blocks\r\ndebug1: SSH2_MSG_NEWKEYS sent\r\ndebug1: expecting SSH2_MSG_NEWKEYS\r\ndebug3: receive packet: type 21\r\ndebug1: SSH2_MSG_NEWKEYS received\r\ndebug2: set_newkeys: mode 0\r\ndebug1: rekey after 4294967296 blocks\r\ndebug2: key: /Users/user/.ssh/id_rsa (0x7ffd92f00570)\r\ndebug2: key: /Users/user/.ssh/id_dsa (0x0)\r\ndebug2: key: /Users/user/.ssh/id_ecdsa (0x0)\r\ndebug2: key: /Users/user/.ssh/id_ed25519 (0x0)\r\ndebug3: send packet: type 5\r\ndebug3: receive packet: type 6\r\ndebug2: service_accept: ssh-userauth\r\ndebug1: SSH2_MSG_SERVICE_ACCEPT received\r\ndebug3: send packet: type 50\r\ndebug3: receive packet: type 53\r\ndebug3: input_userauth_banner\r\nUser Access Verification\ndebug3: receive packet: type 51\r\ndebug1: Authentications that can continue: publickey,password,keyboard-interactive\r\ndebug3: start over, passed a different list publickey,password,keyboard-interactive\r\ndebug3: preferred publickey,keyboard-interactive,password\r\ndebug3: authmethod_lookup publickey\r\ndebug3: remaining preferred: keyboard-interactive,password\r\ndebug3: authmethod_is_enabled publickey\r\ndebug1: Next authentication method: publickey\r\ndebug1: Offering public key: RSA SHA256:7ArvlnJl2z7pIaLMoi3os8c3CYG7vTlBevLlXPVkNOY /Users/user/.ssh/id_rsa\r\ndebug3: send_pubkey_test\r\ndebug3: send packet: type 50\r\ndebug2: we sent a publickey packet, wait for reply\r\ndebug3: receive packet: type 51\r\ndebug1: Authentications that can continue: publickey,password,keyboard-interactive\r\ndebug1: Trying private key: /Users/user/.ssh/id_dsa\r\ndebug3: no such identity: /Users/user/.ssh/id_dsa: No such file or directory\r\ndebug1: Trying private key: /Users/user/.ssh/id_ecdsa\r\ndebug3: no such identity: /Users/user/.ssh/id_ecdsa: No such file or directory\r\ndebug1: Trying private key: /Users/user/.ssh/id_ed25519\r\ndebug3: no such identity: /Users/user/.ssh/id_ed25519: No such file or directory\r\ndebug2: we did not send a packet, disable method\r\ndebug3: authmethod_lookup keyboard-interactive\r\ndebug3: remaining preferred: password\r\ndebug3: authmethod_is_enabled keyboard-interactive\r\ndebug1: Next authentication method: keyboard-interactive\r\ndebug2: userauth_kbdint\r\ndebug3: send packet: type 50\r\ndebug2: we sent a keyboard-interactive packet, wait for reply\r\ndebug3: receive packet: type 60\r\ndebug2: input_userauth_info_req\r\ndebug2: input_userauth_info_req: num_prompts 1\r\ndebug3: send packet: type 61\r\ndebug3: receive packet: type 60\r\ndebug2: input_userauth_info_req\r\ndebug2: input_userauth_info_req: num_prompts 0\r\ndebug3: send packet: type 61\r\ndebug3: receive packet: type 52\r\ndebug1: Enabling compression at level 6.\r\ndebug1: Authentication succeeded (keyboard-interactive).\r\nAuthenticated to 172.16.0.2 ([172.16.0.2]:22).\r\ndebug1: setting up multiplex master socket\r\ndebug3: muxserver_listen: temporary control path /Users/user/.ansible/cp/bb64dc9435.P0TkokpfkhewzqzW\r\ndebug2: fd 4 setting O_NONBLOCK\r\ndebug3: fd 4 is O_NONBLOCK\r\ndebug3: fd 4 is O_NONBLOCK\r\ndebug1: channel 0: new [/Users/user/.ansible/cp/bb64dc9435]\r\ndebug3: muxserver_listen: mux listener channel 0 fd 4\r\ndebug2: fd 3 setting TCP_NODELAY\r\ndebug3: ssh_packet_set_tos: set IP_TOS 0x08\r\ndebug1: control_persist_detach: backgrounding master process\r\ndebug2: control_persist_detach: background process is 60991\r\ndebug2: fd 4 setting O_NONBLOCK\r\ndebug1: forking to background\r\ndebug1: Entering interactive session.\r\ndebug1: pledge: id\r\ndebug2: set_control_persist_exit_time: schedule exit in 60 seconds\r\ndebug1: multiplexing control connection\r\ndebug3: fd 5 is O_NONBLOCK\r\ndebug3: fd 5 is O_NONBLOCK\r\ndebug1: channel 1: new [mux-control]\r\ndebug3: channel_post_mux_listener: new mux channel 1 fd 5\r\ndebug3: mux_master_read_cb: channel 1: hello sent\r\ndebug2: set_control_persist_exit_time: cancel scheduled exit\r\ndebug3: mux_master_read_cb: channel 1 packet type 0x00000001 len 4\r\ndebug2: process_mux_master_hello: channel 1 slave version 4\r\ndebug2: mux_client_hello_exchange: master version 4\r\ndebug3: mux_client_forwards: request forwardings: 0 local, 0 remote\r\ndebug3: mux_client_request_session: entering\r\ndebug3: mux_client_request_alive: entering\r\ndebug3: mux_master_read_cb: channel 1 packet type 0x10000004 len 4\r\ndebug2: process_mux_alive_check: channel 1: alive check\r\ndebug3: mux_client_request_alive: done pid = 60993\r\ndebug3: mux_client_request_session: session request sent\r\ndebug3: mux_master_read_cb: channel 1 packet type 0x10000002 len 98\r\ndebug2: process_mux_new_session: channel 1: request tty 0, X 0, agent 0, subsys 0, term "xterm-256color", cmd "/bin/sh -c \'echo ~ && sleep 0\'", env 1\r\ndebug3: process_mux_new_session: got fds stdin 6, stdout 7, stderr 8\r\ndebug2: fd 7 setting O_NONBLOCK\r\ndebug2: fd 8 setting O_NONBLOCK\r\ndebug1: channel 2: new [client-session]\r\ndebug2: process_mux_new_session: channel_new: 2 linked to control channel 1\r\ndebug2: channel 2: send open\r\ndebug3: send packet: type 90\r\ndebug3: receive packet: type 91\r\ndebug2: channel_input_open_confirmation: channel 2: callback start\r\ndebug2: client_session2_setup: id 2\r\ndebug1: Sending environment.\r\ndebug1: Sending env LC_CTYPE = UTF-8\r\ndebug2: channel 2: request env confirm 0\r\ndebug3: send packet: type 98\r\ndebug1: Sending command: /bin/sh -c \'echo ~ && sleep 0\'\r\ndebug2: channel 2: request exec confirm 1\r\ndebug3: send packet: type 98\r\ndebug3: mux_session_confirm: sending success reply\r\ndebug2: channel_input_open_confirmation: channel 2: callback done\r\ndebug2: channel 2: open confirm rwindow 0 rmax 32768\r\ndebug1: mux_client_request_session: master session id: 2\r\ndebug2: channel 2: rcvd adjust 2097152\r\ndebug3: receive packet: type 99\r\ndebug2: channel_input_status_confirm: type 99 id 2\r\ndebug2: exec request accepted on channel 2\r\ndebug3: receive packet: type 96\r\ndebug2: channel 2: rcvd eof\r\ndebug2: channel 2: output open -> drain\r\ndebug2: channel 2: obuf empty\r\ndebug2: channel 2: close_write\r\ndebug2: channel 2: output drain -> closed\r\ndebug3: receive packet: type 98\r\ndebug1: client_input_channel_req: channel 2 rtype exit-status reply 0\r\ndebug3: mux_exit_message: channel 2: exit message, exitval 16\r\ndebug3: receive packet: type 98\r\ndebug1: client_input_channel_req: channel 2 rtype [email protected] reply 0\r\ndebug2: channel 2: rcvd eow\r\ndebug2: channel 2: close_read\r\ndebug2: channel 2: input open -> closed\r\ndebug3: receive packet: type 97\r\ndebug2: channel 2: rcvd close\r\ndebug3: channel 2: will not send data after close\r\ndebug2: channel 2: send close\r\ndebug3: send packet: type 97\r\ndebug2: channel 2: is dead\r\ndebug2: channel 2: gc: notify user\r\ndebug3: mux_master_session_cleanup_cb: entering for channel 2\r\ndebug2: channel 1: rcvd close\r\ndebug2: channel 1: output open -> drain\r\ndebug2: channel 1: close_read\r\ndebug2: channel 1: input open -> closed\r\ndebug2: channel 2: gc: user detached\r\ndebug2: channel 2: is dead\r\ndebug2: channel 2: garbage collecting\r\ndebug1: channel 2: free: client-session, nchannels 3\r\ndebug3: channel 2: status: The following connections are open:\r\n #1 mux-control (t16 nr0 i3/0 o1/16 fd 5/5 cc -1)\r\n #2 client-session (t4 r0 i3/0 o3/0 fd -1/-1 cc -1)\r\n\r\ndebug2: channel 1: obuf empty\r\ndebug2: channel 1: close_write\r\ndebug2: channel 1: output drain -> closed\r\ndebug2: channel 1: is dead (local)\r\ndebug3: mux_client_read_packet: read header failed: Broken pipe\r\ndebug2: channel 1: gc: notify user\r\ndebug3: mux_master_control_cleanup_cb: entering for channel 1\r\ndebug2: channel 1: gc: user detached\r\ndebug2: channel 1: is dead (local)\r\ndebug2: channel 1: garbage collecting\r\ndebug1: channel 1: free: mux-control, nchannels 2\r\ndebug3: channel 1: status: The following connections are open:\r\n #1 mux-control (t16 nr0 i3/0 o3/0 fd 5/5 cc -1)\r\n\r\ndebug2: set_control_persist_exit_time: schedule exit in 60 seconds\r\ndebug2: Received exit status from master 16\r\n')
<172.16.0.2> ESTABLISH SSH CONNECTION FOR USER: admin
<172.16.0.2> SSH: EXEC sshpass -d42 ssh -vvv -C -o ControlMaster=auto -o ControlPersist=60s -o StrictHostKeyChecking=no -o User=admin -o ConnectTimeout=10 -o ControlPath=/Users/user/.ansible/cp/bb64dc9435 172.16.0.2 '/bin/sh -c '"'"'( umask 77 && mkdir -p "` echo Cmd exec error./.ansible/tmp/ansible-tmp-1517295845.92-147957596299827 `" && echo ansible-tmp-1517295845.92-147957596299827="` echo Cmd exec error./.ansible/tmp/ansible-tmp-1517295845.92-147957596299827 `" ) && sleep 0'"'"''
<172.16.0.2> (16, 'Syntax error while parsing \'/bin/sh -c \'( umask 77 && mkdir -p "` echo Cmd exec error./.ansible/tmp/ansible-tmp-1517295845.92-147957596299827 `" && echo ansible-tmp-1517295845.92-147957596299827="` echo Cmd exec error./.ansible/tmp/ansible-tmp-1517295845.92-147957596299827 `" ) && sleep 0\'\'\n\n\nCmd exec error.\n', 'OpenSSH_7.6p1, LibreSSL 2.6.2\r\ndebug1: Reading configuration data /etc/ssh/ssh_config\r\ndebug1: /etc/ssh/ssh_config line 48: Applying options for *\r\ndebug1: auto-mux: Trying existing master\r\ndebug2: fd 3 setting O_NONBLOCK\r\ndebug2: mux_client_hello_exchange: master version 4\r\ndebug3: mux_client_forwards: request forwardings: 0 local, 0 remote\r\ndebug3: mux_client_request_session: entering\r\ndebug3: mux_client_request_alive: entering\r\ndebug3: mux_client_request_alive: done pid = 60993\r\ndebug3: mux_client_request_session: session request sent\r\ndebug1: mux_client_request_session: master session id: 2\r\ndebug3: mux_client_read_packet: read header failed: Broken pipe\r\ndebug2: Received exit status from master 16\r\n')
fatal: [172.16.0.2]: UNREACHABLE! => {
"changed": false,
"msg": "Authentication or permission failure. In some cases, you may have been able to authenticate and did not have permissions on the target directory. Consider changing the remote temp path in ansible.cfg to a path rooted in \"/tmp\". Failed command was: ( umask 77 && mkdir -p \"` echo Cmd exec error./.ansible/tmp/ansible-tmp-1517295845.92-147957596299827 `\" && echo ansible-tmp-1517295845.92-147957596299827=\"` echo Cmd exec error./.ansible/tmp/ansible-tmp-1517295845.92-147957596299827 `\" ), exited with result 16, stdout output: Syntax error while parsing '/bin/sh -c '( umask 77 && mkdir -p \"` echo Cmd exec error./.ansible/tmp/ansible-tmp-1517295845.92-147957596299827 `\" && echo ansible-tmp-1517295845.92-147957596299827=\"` echo Cmd exec error./.ansible/tmp/ansible-tmp-1517295845.92-147957596299827 `\" ) && sleep 0''\n\n\nCmd exec error.\n, stderr output: OpenSSH_7.6p1, LibreSSL 2.6.2\r\ndebug1: Reading configuration data /etc/ssh/ssh_config\r\ndebug1: /etc/ssh/ssh_config line 48: Applying options for *\r\ndebug1: auto-mux: Trying existing master\r\ndebug2: fd 3 setting O_NONBLOCK\r\ndebug2: mux_client_hello_exchange: master version 4\r\ndebug3: mux_client_forwards: request forwardings: 0 local, 0 remote\r\ndebug3: mux_client_request_session: entering\r\ndebug3: mux_client_request_alive: entering\r\ndebug3: mux_client_request_alive: done pid = 60993\r\ndebug3: mux_client_request_session: session request sent\r\ndebug1: mux_client_request_session: master session id: 2\r\ndebug3: mux_client_read_packet: read header failed: Broken pipe\r\ndebug2: Received exit status from master 16\r\n",
"unreachable": true
}
to retry, use: --limit @/Users/user/Desktop/ansible2/1.retry
PLAY RECAP ***********************************************************************************************
172.16.0.2 : ok=0 changed=0 unreachable=1 failed=0 "><pre class="notranslate"><code class="notranslate">TASK [Gathering Facts] ***********************************************************************************
Using module file /Library/Python/2.7/site-packages/ansible/modules/system/setup.py
<172.16.0.2> ESTABLISH SSH CONNECTION FOR USER: admin
<172.16.0.2> SSH: EXEC sshpass -d42 ssh -vvv -C -o ControlMaster=auto -o ControlPersist=60s -o StrictHostKeyChecking=no -o User=admin -o ConnectTimeout=10 -o ControlPath=/Users/user/.ansible/cp/bb64dc9435 172.16.0.2 '/bin/sh -c '"'"'echo ~ && sleep 0'"'"''
<172.16.0.2> (16, "Syntax error while parsing '/bin/sh -c 'echo ~ && sleep 0''\n\n\nCmd exec error.\n", 'OpenSSH_7.6p1, LibreSSL 2.6.2\r\ndebug1: Reading configuration data /etc/ssh/ssh_config\r\ndebug1: /etc/ssh/ssh_config line 48: Applying options for *\r\ndebug1: auto-mux: Trying existing master\r\ndebug1: Control socket "/Users/user/.ansible/cp/bb64dc9435" does not exist\r\ndebug2: resolving "172.16.0.2" port 22\r\ndebug2: ssh_connect_direct: needpriv 0\r\ndebug1: Connecting to 172.16.0.2 [172.16.0.2] port 22.\r\ndebug2: fd 3 setting O_NONBLOCK\r\ndebug1: fd 3 clearing O_NONBLOCK\r\ndebug1: Connection established.\r\ndebug3: timeout: 9817 ms remain after connect\r\ndebug1: identity file /Users/user/.ssh/id_rsa type 0\r\ndebug1: key_load_public: No such file or directory\r\ndebug1: identity file /Users/user/.ssh/id_rsa-cert type -1\r\ndebug1: key_load_public: No such file or directory\r\ndebug1: identity file /Users/user/.ssh/id_dsa type -1\r\ndebug1: key_load_public: No such file or directory\r\ndebug1: identity file /Users/user/.ssh/id_dsa-cert type -1\r\ndebug1: key_load_public: No such file or directory\r\ndebug1: identity file /Users/user/.ssh/id_ecdsa type -1\r\ndebug1: key_load_public: No such file or directory\r\ndebug1: identity file /Users/user/.ssh/id_ecdsa-cert type -1\r\ndebug1: key_load_public: No such file or directory\r\ndebug1: identity file /Users/user/.ssh/id_ed25519 type -1\r\ndebug1: key_load_public: No such file or directory\r\ndebug1: identity file /Users/user/.ssh/id_ed25519-cert type -1\r\ndebug1: Local version string SSH-2.0-OpenSSH_7.6\r\ndebug1: Remote protocol version 2.0, remote software version OpenSSH_6.2 FIPS\r\ndebug1: match: OpenSSH_6.2 FIPS pat OpenSSH* compat 0x04000000\r\ndebug2: fd 3 setting O_NONBLOCK\r\ndebug1: Authenticating to 172.16.0.2:22 as \'admin\'\r\ndebug3: hostkeys_foreach: reading file "/Users/user/.ssh/known_hosts"\r\ndebug3: record_hostkey: found key type RSA in file /Users/user/.ssh/known_hosts:6\r\ndebug3: load_hostkeys: loaded 1 keys from 172.16.0.2\r\ndebug3: order_hostkeyalgs: prefer hostkeyalgs: [email protected],rsa-sha2-512,rsa-sha2-256,ssh-rsa\r\ndebug3: send packet: type 20\r\ndebug1: SSH2_MSG_KEXINIT sent\r\ndebug3: receive packet: type 20\r\ndebug1: SSH2_MSG_KEXINIT received\r\ndebug2: local client KEXINIT proposal\r\ndebug2: KEX algorithms: curve25519-sha256,[email protected],ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group16-sha512,diffie-hellman-group18-sha512,diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha256,diffie-hellman-group14-sha1,ext-info-c\r\ndebug2: host key algorithms: [email protected],rsa-sha2-512,rsa-sha2-256,ssh-rsa,[email protected],[email protected],[email protected],[email protected],ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,ssh-ed25519\r\ndebug2: ciphers ctos: [email protected],aes128-ctr,aes192-ctr,aes256-ctr,[email protected],[email protected]\r\ndebug2: ciphers stoc: [email protected],aes128-ctr,aes192-ctr,aes256-ctr,[email protected],[email protected]\r\ndebug2: MACs ctos: [email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],hmac-sha2-256,hmac-sha2-512,hmac-sha1\r\ndebug2: MACs stoc: [email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],hmac-sha2-256,hmac-sha2-512,hmac-sha1\r\ndebug2: compression ctos: [email protected],zlib,none\r\ndebug2: compression stoc: [email protected],zlib,none\r\ndebug2: languages ctos: \r\ndebug2: languages stoc: \r\ndebug2: first_kex_follows 0 \r\ndebug2: reserved 0 \r\ndebug2: peer server KEXINIT proposal\r\ndebug2: KEX algorithms: ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1,diffie-hellman-group1-sha1\r\ndebug2: host key algorithms: ssh-rsa\r\ndebug2: ciphers ctos: aes128-ctr,aes192-ctr,aes256-ctr\r\ndebug2: ciphers stoc: aes128-ctr,aes192-ctr,aes256-ctr\r\ndebug2: MACs ctos: hmac-sha1\r\ndebug2: MACs stoc: hmac-sha1\r\ndebug2: compression ctos: none,[email protected]\r\ndebug2: compression stoc: none,[email protected]\r\ndebug2: languages ctos: \r\ndebug2: languages stoc: \r\ndebug2: first_kex_follows 0 \r\ndebug2: reserved 0 \r\ndebug1: kex: algorithm: ecdh-sha2-nistp256\r\ndebug1: kex: host key algorithm: ssh-rsa\r\ndebug1: kex: server->client cipher: aes128-ctr MAC: hmac-sha1 compression: [email protected]\r\ndebug1: kex: client->server cipher: aes128-ctr MAC: hmac-sha1 compression: [email protected]\r\ndebug3: send packet: type 30\r\ndebug1: sending SSH2_MSG_KEX_ECDH_INIT\r\ndebug1: expecting SSH2_MSG_KEX_ECDH_REPLY\r\ndebug3: receive packet: type 31\r\ndebug1: Server host key: ssh-rsa SHA256:oSmRIx+fcmRlvRewAQwBMA1YWG6vjlsMuwTrJwh+b88\r\ndebug3: hostkeys_foreach: reading file "/Users/user/.ssh/known_hosts"\r\ndebug3: record_hostkey: found key type RSA in file /Users/user/.ssh/known_hosts:6\r\ndebug3: load_hostkeys: loaded 1 keys from 172.16.0.2\r\ndebug1: Host \'172.16.0.2\' is known and matches the RSA host key.\r\ndebug1: Found key in /Users/user/.ssh/known_hosts:6\r\ndebug3: send packet: type 21\r\ndebug2: set_newkeys: mode 1\r\ndebug1: rekey after 4294967296 blocks\r\ndebug1: SSH2_MSG_NEWKEYS sent\r\ndebug1: expecting SSH2_MSG_NEWKEYS\r\ndebug3: receive packet: type 21\r\ndebug1: SSH2_MSG_NEWKEYS received\r\ndebug2: set_newkeys: mode 0\r\ndebug1: rekey after 4294967296 blocks\r\ndebug2: key: /Users/user/.ssh/id_rsa (0x7ffd92f00570)\r\ndebug2: key: /Users/user/.ssh/id_dsa (0x0)\r\ndebug2: key: /Users/user/.ssh/id_ecdsa (0x0)\r\ndebug2: key: /Users/user/.ssh/id_ed25519 (0x0)\r\ndebug3: send packet: type 5\r\ndebug3: receive packet: type 6\r\ndebug2: service_accept: ssh-userauth\r\ndebug1: SSH2_MSG_SERVICE_ACCEPT received\r\ndebug3: send packet: type 50\r\ndebug3: receive packet: type 53\r\ndebug3: input_userauth_banner\r\nUser Access Verification\ndebug3: receive packet: type 51\r\ndebug1: Authentications that can continue: publickey,password,keyboard-interactive\r\ndebug3: start over, passed a different list publickey,password,keyboard-interactive\r\ndebug3: preferred publickey,keyboard-interactive,password\r\ndebug3: authmethod_lookup publickey\r\ndebug3: remaining preferred: keyboard-interactive,password\r\ndebug3: authmethod_is_enabled publickey\r\ndebug1: Next authentication method: publickey\r\ndebug1: Offering public key: RSA SHA256:7ArvlnJl2z7pIaLMoi3os8c3CYG7vTlBevLlXPVkNOY /Users/user/.ssh/id_rsa\r\ndebug3: send_pubkey_test\r\ndebug3: send packet: type 50\r\ndebug2: we sent a publickey packet, wait for reply\r\ndebug3: receive packet: type 51\r\ndebug1: Authentications that can continue: publickey,password,keyboard-interactive\r\ndebug1: Trying private key: /Users/user/.ssh/id_dsa\r\ndebug3: no such identity: /Users/user/.ssh/id_dsa: No such file or directory\r\ndebug1: Trying private key: /Users/user/.ssh/id_ecdsa\r\ndebug3: no such identity: /Users/user/.ssh/id_ecdsa: No such file or directory\r\ndebug1: Trying private key: /Users/user/.ssh/id_ed25519\r\ndebug3: no such identity: /Users/user/.ssh/id_ed25519: No such file or directory\r\ndebug2: we did not send a packet, disable method\r\ndebug3: authmethod_lookup keyboard-interactive\r\ndebug3: remaining preferred: password\r\ndebug3: authmethod_is_enabled keyboard-interactive\r\ndebug1: Next authentication method: keyboard-interactive\r\ndebug2: userauth_kbdint\r\ndebug3: send packet: type 50\r\ndebug2: we sent a keyboard-interactive packet, wait for reply\r\ndebug3: receive packet: type 60\r\ndebug2: input_userauth_info_req\r\ndebug2: input_userauth_info_req: num_prompts 1\r\ndebug3: send packet: type 61\r\ndebug3: receive packet: type 60\r\ndebug2: input_userauth_info_req\r\ndebug2: input_userauth_info_req: num_prompts 0\r\ndebug3: send packet: type 61\r\ndebug3: receive packet: type 52\r\ndebug1: Enabling compression at level 6.\r\ndebug1: Authentication succeeded (keyboard-interactive).\r\nAuthenticated to 172.16.0.2 ([172.16.0.2]:22).\r\ndebug1: setting up multiplex master socket\r\ndebug3: muxserver_listen: temporary control path /Users/user/.ansible/cp/bb64dc9435.P0TkokpfkhewzqzW\r\ndebug2: fd 4 setting O_NONBLOCK\r\ndebug3: fd 4 is O_NONBLOCK\r\ndebug3: fd 4 is O_NONBLOCK\r\ndebug1: channel 0: new [/Users/user/.ansible/cp/bb64dc9435]\r\ndebug3: muxserver_listen: mux listener channel 0 fd 4\r\ndebug2: fd 3 setting TCP_NODELAY\r\ndebug3: ssh_packet_set_tos: set IP_TOS 0x08\r\ndebug1: control_persist_detach: backgrounding master process\r\ndebug2: control_persist_detach: background process is 60991\r\ndebug2: fd 4 setting O_NONBLOCK\r\ndebug1: forking to background\r\ndebug1: Entering interactive session.\r\ndebug1: pledge: id\r\ndebug2: set_control_persist_exit_time: schedule exit in 60 seconds\r\ndebug1: multiplexing control connection\r\ndebug3: fd 5 is O_NONBLOCK\r\ndebug3: fd 5 is O_NONBLOCK\r\ndebug1: channel 1: new [mux-control]\r\ndebug3: channel_post_mux_listener: new mux channel 1 fd 5\r\ndebug3: mux_master_read_cb: channel 1: hello sent\r\ndebug2: set_control_persist_exit_time: cancel scheduled exit\r\ndebug3: mux_master_read_cb: channel 1 packet type 0x00000001 len 4\r\ndebug2: process_mux_master_hello: channel 1 slave version 4\r\ndebug2: mux_client_hello_exchange: master version 4\r\ndebug3: mux_client_forwards: request forwardings: 0 local, 0 remote\r\ndebug3: mux_client_request_session: entering\r\ndebug3: mux_client_request_alive: entering\r\ndebug3: mux_master_read_cb: channel 1 packet type 0x10000004 len 4\r\ndebug2: process_mux_alive_check: channel 1: alive check\r\ndebug3: mux_client_request_alive: done pid = 60993\r\ndebug3: mux_client_request_session: session request sent\r\ndebug3: mux_master_read_cb: channel 1 packet type 0x10000002 len 98\r\ndebug2: process_mux_new_session: channel 1: request tty 0, X 0, agent 0, subsys 0, term "xterm-256color", cmd "/bin/sh -c \'echo ~ && sleep 0\'", env 1\r\ndebug3: process_mux_new_session: got fds stdin 6, stdout 7, stderr 8\r\ndebug2: fd 7 setting O_NONBLOCK\r\ndebug2: fd 8 setting O_NONBLOCK\r\ndebug1: channel 2: new [client-session]\r\ndebug2: process_mux_new_session: channel_new: 2 linked to control channel 1\r\ndebug2: channel 2: send open\r\ndebug3: send packet: type 90\r\ndebug3: receive packet: type 91\r\ndebug2: channel_input_open_confirmation: channel 2: callback start\r\ndebug2: client_session2_setup: id 2\r\ndebug1: Sending environment.\r\ndebug1: Sending env LC_CTYPE = UTF-8\r\ndebug2: channel 2: request env confirm 0\r\ndebug3: send packet: type 98\r\ndebug1: Sending command: /bin/sh -c \'echo ~ && sleep 0\'\r\ndebug2: channel 2: request exec confirm 1\r\ndebug3: send packet: type 98\r\ndebug3: mux_session_confirm: sending success reply\r\ndebug2: channel_input_open_confirmation: channel 2: callback done\r\ndebug2: channel 2: open confirm rwindow 0 rmax 32768\r\ndebug1: mux_client_request_session: master session id: 2\r\ndebug2: channel 2: rcvd adjust 2097152\r\ndebug3: receive packet: type 99\r\ndebug2: channel_input_status_confirm: type 99 id 2\r\ndebug2: exec request accepted on channel 2\r\ndebug3: receive packet: type 96\r\ndebug2: channel 2: rcvd eof\r\ndebug2: channel 2: output open -> drain\r\ndebug2: channel 2: obuf empty\r\ndebug2: channel 2: close_write\r\ndebug2: channel 2: output drain -> closed\r\ndebug3: receive packet: type 98\r\ndebug1: client_input_channel_req: channel 2 rtype exit-status reply 0\r\ndebug3: mux_exit_message: channel 2: exit message, exitval 16\r\ndebug3: receive packet: type 98\r\ndebug1: client_input_channel_req: channel 2 rtype [email protected] reply 0\r\ndebug2: channel 2: rcvd eow\r\ndebug2: channel 2: close_read\r\ndebug2: channel 2: input open -> closed\r\ndebug3: receive packet: type 97\r\ndebug2: channel 2: rcvd close\r\ndebug3: channel 2: will not send data after close\r\ndebug2: channel 2: send close\r\ndebug3: send packet: type 97\r\ndebug2: channel 2: is dead\r\ndebug2: channel 2: gc: notify user\r\ndebug3: mux_master_session_cleanup_cb: entering for channel 2\r\ndebug2: channel 1: rcvd close\r\ndebug2: channel 1: output open -> drain\r\ndebug2: channel 1: close_read\r\ndebug2: channel 1: input open -> closed\r\ndebug2: channel 2: gc: user detached\r\ndebug2: channel 2: is dead\r\ndebug2: channel 2: garbage collecting\r\ndebug1: channel 2: free: client-session, nchannels 3\r\ndebug3: channel 2: status: The following connections are open:\r\n #1 mux-control (t16 nr0 i3/0 o1/16 fd 5/5 cc -1)\r\n #2 client-session (t4 r0 i3/0 o3/0 fd -1/-1 cc -1)\r\n\r\ndebug2: channel 1: obuf empty\r\ndebug2: channel 1: close_write\r\ndebug2: channel 1: output drain -> closed\r\ndebug2: channel 1: is dead (local)\r\ndebug3: mux_client_read_packet: read header failed: Broken pipe\r\ndebug2: channel 1: gc: notify user\r\ndebug3: mux_master_control_cleanup_cb: entering for channel 1\r\ndebug2: channel 1: gc: user detached\r\ndebug2: channel 1: is dead (local)\r\ndebug2: channel 1: garbage collecting\r\ndebug1: channel 1: free: mux-control, nchannels 2\r\ndebug3: channel 1: status: The following connections are open:\r\n #1 mux-control (t16 nr0 i3/0 o3/0 fd 5/5 cc -1)\r\n\r\ndebug2: set_control_persist_exit_time: schedule exit in 60 seconds\r\ndebug2: Received exit status from master 16\r\n')
<172.16.0.2> ESTABLISH SSH CONNECTION FOR USER: admin
<172.16.0.2> SSH: EXEC sshpass -d42 ssh -vvv -C -o ControlMaster=auto -o ControlPersist=60s -o StrictHostKeyChecking=no -o User=admin -o ConnectTimeout=10 -o ControlPath=/Users/user/.ansible/cp/bb64dc9435 172.16.0.2 '/bin/sh -c '"'"'( umask 77 && mkdir -p "` echo Cmd exec error./.ansible/tmp/ansible-tmp-1517295845.92-147957596299827 `" && echo ansible-tmp-1517295845.92-147957596299827="` echo Cmd exec error./.ansible/tmp/ansible-tmp-1517295845.92-147957596299827 `" ) && sleep 0'"'"''
<172.16.0.2> (16, 'Syntax error while parsing \'/bin/sh -c \'( umask 77 && mkdir -p "` echo Cmd exec error./.ansible/tmp/ansible-tmp-1517295845.92-147957596299827 `" && echo ansible-tmp-1517295845.92-147957596299827="` echo Cmd exec error./.ansible/tmp/ansible-tmp-1517295845.92-147957596299827 `" ) && sleep 0\'\'\n\n\nCmd exec error.\n', 'OpenSSH_7.6p1, LibreSSL 2.6.2\r\ndebug1: Reading configuration data /etc/ssh/ssh_config\r\ndebug1: /etc/ssh/ssh_config line 48: Applying options for *\r\ndebug1: auto-mux: Trying existing master\r\ndebug2: fd 3 setting O_NONBLOCK\r\ndebug2: mux_client_hello_exchange: master version 4\r\ndebug3: mux_client_forwards: request forwardings: 0 local, 0 remote\r\ndebug3: mux_client_request_session: entering\r\ndebug3: mux_client_request_alive: entering\r\ndebug3: mux_client_request_alive: done pid = 60993\r\ndebug3: mux_client_request_session: session request sent\r\ndebug1: mux_client_request_session: master session id: 2\r\ndebug3: mux_client_read_packet: read header failed: Broken pipe\r\ndebug2: Received exit status from master 16\r\n')
fatal: [172.16.0.2]: UNREACHABLE! => {
"changed": false,
"msg": "Authentication or permission failure. In some cases, you may have been able to authenticate and did not have permissions on the target directory. Consider changing the remote temp path in ansible.cfg to a path rooted in \"/tmp\". Failed command was: ( umask 77 && mkdir -p \"` echo Cmd exec error./.ansible/tmp/ansible-tmp-1517295845.92-147957596299827 `\" && echo ansible-tmp-1517295845.92-147957596299827=\"` echo Cmd exec error./.ansible/tmp/ansible-tmp-1517295845.92-147957596299827 `\" ), exited with result 16, stdout output: Syntax error while parsing '/bin/sh -c '( umask 77 && mkdir -p \"` echo Cmd exec error./.ansible/tmp/ansible-tmp-1517295845.92-147957596299827 `\" && echo ansible-tmp-1517295845.92-147957596299827=\"` echo Cmd exec error./.ansible/tmp/ansible-tmp-1517295845.92-147957596299827 `\" ) && sleep 0''\n\n\nCmd exec error.\n, stderr output: OpenSSH_7.6p1, LibreSSL 2.6.2\r\ndebug1: Reading configuration data /etc/ssh/ssh_config\r\ndebug1: /etc/ssh/ssh_config line 48: Applying options for *\r\ndebug1: auto-mux: Trying existing master\r\ndebug2: fd 3 setting O_NONBLOCK\r\ndebug2: mux_client_hello_exchange: master version 4\r\ndebug3: mux_client_forwards: request forwardings: 0 local, 0 remote\r\ndebug3: mux_client_request_session: entering\r\ndebug3: mux_client_request_alive: entering\r\ndebug3: mux_client_request_alive: done pid = 60993\r\ndebug3: mux_client_request_session: session request sent\r\ndebug1: mux_client_request_session: master session id: 2\r\ndebug3: mux_client_read_packet: read header failed: Broken pipe\r\ndebug2: Received exit status from master 16\r\n",
"unreachable": true
}
to retry, use: --limit @/Users/user/Desktop/ansible2/1.retry
PLAY RECAP ***********************************************************************************************
172.16.0.2 : ok=0 changed=0 unreachable=1 failed=0
</code></pre></div> | <p dir="auto">chaoslemur should return ok sometimes, failure sometimes, nothing sometimes, and invalid JSON sometimes, so that you can load up your system with lots of duplicate host aliase and check that failed hosts get filtered out and reported on correctly.</p>
<p dir="auto">we do not have ship chaoslemur but it would be very useful for testing.</p> | 0 |
<p dir="auto">It would be very useful if atom could open files from the browser like <code class="notranslate">atom://open?URL=/Users/me/myfile.txt.</code>, like sublime text's <code class="notranslate">subl://open</code></p>
<p dir="auto">This would be great for people writing/debugging web apps like me :)</p> | <p dir="auto">It should open an html handler like:<br>
The handler opens atom, but doesn't works with params.<br>
atom://open?url=file://Users/myuser/myapp/myfile.rb&line=32&column=12</p>
<p dir="auto">it would be very useful for rails_panel !</p> | 1 |
<p dir="auto">In documentation it is written:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="
Plugins run before Presets.
Plugin ordering is first to last.
Preset ordering is reversed (last to first)."><pre class="notranslate"><code class="notranslate">
Plugins run before Presets.
Plugin ordering is first to last.
Preset ordering is reversed (last to first).
</code></pre></div>
<p dir="auto">I wrote my own plugin which works with const and let. It works good, but when I use "es2015" preset, my plugin does not work because all const and let become var. Why does my plugin run after presets?<br>
Here is my babel config:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="{
"presets": [
"es2015"
],
"plugins": [
"./babel-plugin-transform-const-name"
]
}"><pre class="notranslate"><code class="notranslate">{
"presets": [
"es2015"
],
"plugins": [
"./babel-plugin-transform-const-name"
]
}
</code></pre></div>
<p dir="auto">And I use "babel-cli": "^6.18.0"</p> | <blockquote>
<p dir="auto">Issue originally made by <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/kaigth/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/kaigth">@kaigth</a></p>
</blockquote>
<h3 dir="auto">Bug information</h3>
<ul dir="auto">
<li><strong>Babel version:</strong> 6.1.18</li>
<li><strong>Node version:</strong> 5.0.0</li>
<li><strong>npm version:</strong> 3.3.9</li>
</ul>
<h3 dir="auto">Input code</h3>
<p dir="auto">npm pre-reqs "5.0.0"</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content=""babel": "^6.1.18",
"babel-core": "^6.1.21",
"babel-loader": "^6.2.0",
"babel-plugin-transform-runtime": "^6.1.18",
"babel-polyfill": "^6.1.19",
"babel-preset-es2015": "^6.1.18",
"babel-preset-stage-0": "^6.1.18",
"babel-runtime": "^6.1.21""><pre class="notranslate"><code class="notranslate">"babel": "^6.1.18",
"babel-core": "^6.1.21",
"babel-loader": "^6.2.0",
"babel-plugin-transform-runtime": "^6.1.18",
"babel-polyfill": "^6.1.19",
"babel-preset-es2015": "^6.1.18",
"babel-preset-stage-0": "^6.1.18",
"babel-runtime": "^6.1.21"
</code></pre></div>
<p dir="auto">webpack: "^1.9.7"</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="loaders: [
{
test: /\.js$/,
exclude: /node_modules|public|app\/vendor/,
loader: 'babel-loader',
query: {
presets: ['es2015', 'stage-0']
}
}
]"><pre class="notranslate"><code class="notranslate">loaders: [
{
test: /\.js$/,
exclude: /node_modules|public|app\/vendor/,
loader: 'babel-loader',
query: {
presets: ['es2015', 'stage-0']
}
}
]
</code></pre></div>
<p dir="auto">top of app:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="require('babel-polyfill');
export default class someClass {
constructor() {
}
async _loadData() {
try {
const response = await this._loadJSON('content');
console.log(response);
} catch (error) {
throw error;
}
}
}"><pre class="notranslate"><code class="notranslate">require('babel-polyfill');
export default class someClass {
constructor() {
}
async _loadData() {
try {
const response = await this._loadJSON('content');
console.log(response);
} catch (error) {
throw error;
}
}
}
</code></pre></div>
<h3 dir="auto">Description</h3>
<p dir="auto">Seems to be a dependency issue with the 2015 transform classes module when running npm 3 or greater. The error <code class="notranslate">regeneratorRuntime is not defined</code> occurs. Seems it's not loading the runtime sub dependency properly. Issue goes away when rolling back to <code class="notranslate">"babel-plugin-transform-es2015-classes": "6.1.21"</code> in npm while still using the latest babel.</p>
<p dir="auto">Sorry for the lack of clarification. The issue happens when exporting a new class and calling a new es7 feature such as async or await. Input code was updated to reflect changes.</p>
<p dir="auto">I also attempted to run the polyfill in the entry file before app and the issue still exists.</p> | 0 |
<h1 dir="auto">Environment</h1>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Windows build number: 19041.329
PowerToys version: 0.1.9.1
PowerToy module for which you are reporting the bug (if applicable): PowerToys Run"><pre class="notranslate"><code class="notranslate">Windows build number: 19041.329
PowerToys version: 0.1.9.1
PowerToy module for which you are reporting the bug (if applicable): PowerToys Run
</code></pre></div>
<h1 dir="auto">Steps to reproduce</h1>
<p dir="auto">After updating to version 0.1.9.1 press the default shortcut ALT+Space to invoke PT Run.</p>
<h1 dir="auto">Expected behavior</h1>
<p dir="auto">PT Run should be invoked.</p>
<h1 dir="auto">Actual behavior</h1>
<p dir="auto">Nothing is happening. Downgrading to 0.1.9.0 doesn't fix it either.</p>
<h1 dir="auto">Screenshots</h1> | <h1 dir="auto">Environment</h1>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Windows build number: 10.0.19041.329
PowerToys version: 0.19.1
PowerToy module for which you are reporting the bug (if applicable): PT Run"><pre class="notranslate"><code class="notranslate">Windows build number: 10.0.19041.329
PowerToys version: 0.19.1
PowerToy module for which you are reporting the bug (if applicable): PT Run
</code></pre></div>
<p dir="auto">Run at Startup and Always Run as Administrator are both on. PowerToys Runner shows up in Task Manager.</p>
<h1 dir="auto">Steps to reproduce</h1>
<ol dir="auto">
<li>Make sure your keyboard shortcut to open PT run is <code class="notranslate">Alt</code>+<code class="notranslate">Space</code></li>
<li>Press <code class="notranslate">Alt</code>+<code class="notranslate">Space</code></li>
</ol>
<h1 dir="auto">Expected behaviour</h1>
<p dir="auto">PT run opens</p>
<h1 dir="auto">Actual behaviour</h1>
<p dir="auto">Nothing</p> | 1 |
<h4 dir="auto">Code Sample, a copy-pastable example if possible</h4>
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="mi = pd.MultiIndex.from_product([['a','b','c'],[1,2]], names=['ll','nn'])
df = pd.DataFrame({'x': [i for i in range(len(mi))], 'y' : [i*10 for i in range(len(mi))]}, index=mi)
df.rename(columns={'x':'z'}) # This works to change name of one column
df.rename_axis({'x' : 'z'}, axis='columns') # This also works to change name of one column (but you get a deprecation warning)
df.rename(index={'nn':'zz'}) # This does not work to change name of one level of a MultiIndex
df.rename_axis({'nn' : 'zz'}, axis='index') # This does not work to change name of one level of a MultiIndex"><pre class="notranslate"><span class="pl-s1">mi</span> <span class="pl-c1">=</span> <span class="pl-s1">pd</span>.<span class="pl-v">MultiIndex</span>.<span class="pl-en">from_product</span>([[<span class="pl-s">'a'</span>,<span class="pl-s">'b'</span>,<span class="pl-s">'c'</span>],[<span class="pl-c1">1</span>,<span class="pl-c1">2</span>]], <span class="pl-s1">names</span><span class="pl-c1">=</span>[<span class="pl-s">'ll'</span>,<span class="pl-s">'nn'</span>])
<span class="pl-s1">df</span> <span class="pl-c1">=</span> <span class="pl-s1">pd</span>.<span class="pl-v">DataFrame</span>({<span class="pl-s">'x'</span>: [<span class="pl-s1">i</span> <span class="pl-k">for</span> <span class="pl-s1">i</span> <span class="pl-c1">in</span> <span class="pl-en">range</span>(<span class="pl-en">len</span>(<span class="pl-s1">mi</span>))], <span class="pl-s">'y'</span> : [<span class="pl-s1">i</span><span class="pl-c1">*</span><span class="pl-c1">10</span> <span class="pl-k">for</span> <span class="pl-s1">i</span> <span class="pl-c1">in</span> <span class="pl-en">range</span>(<span class="pl-en">len</span>(<span class="pl-s1">mi</span>))]}, <span class="pl-s1">index</span><span class="pl-c1">=</span><span class="pl-s1">mi</span>)
<span class="pl-s1">df</span>.<span class="pl-en">rename</span>(<span class="pl-s1">columns</span><span class="pl-c1">=</span>{<span class="pl-s">'x'</span>:<span class="pl-s">'z'</span>}) <span class="pl-c"># This works to change name of one column</span>
<span class="pl-s1">df</span>.<span class="pl-en">rename_axis</span>({<span class="pl-s">'x'</span> : <span class="pl-s">'z'</span>}, <span class="pl-s1">axis</span><span class="pl-c1">=</span><span class="pl-s">'columns'</span>) <span class="pl-c"># This also works to change name of one column (but you get a deprecation warning)</span>
<span class="pl-s1">df</span>.<span class="pl-en">rename</span>(<span class="pl-s1">index</span><span class="pl-c1">=</span>{<span class="pl-s">'nn'</span>:<span class="pl-s">'zz'</span>}) <span class="pl-c"># This does not work to change name of one level of a MultiIndex</span>
<span class="pl-s1">df</span>.<span class="pl-en">rename_axis</span>({<span class="pl-s">'nn'</span> : <span class="pl-s">'zz'</span>}, <span class="pl-s1">axis</span><span class="pl-c1">=</span><span class="pl-s">'index'</span>) <span class="pl-c"># This does not work to change name of one level of a MultiIndex</span></pre></div>
<h4 dir="auto">Problem description</h4>
<p dir="auto">Ideally, if you call <code class="notranslate">df.rename_axis(dict, axis='index')</code>, only the names specified in the dictionary would be changed in the corresponding <code class="notranslate">MultiIndex</code></p>
<h4 dir="auto">Expected Output</h4>
<p dir="auto">For the expression</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="df.rename_axis({'nn' : 'zz'}, axis='index')"><pre class="notranslate"><code class="notranslate">df.rename_axis({'nn' : 'zz'}, axis='index')
</code></pre></div>
<p dir="auto">the output should be:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content=" x y
zz ll
1 a 0 0
b 1 10
c 2 20
2 a 3 30
b 4 40
c 5 50"><pre class="notranslate"><code class="notranslate"> x y
zz ll
1 a 0 0
b 1 10
c 2 20
2 a 3 30
b 4 40
c 5 50
</code></pre></div>
<h4 dir="auto">Output of <code class="notranslate">pd.show_versions()</code></h4>
<details>
<h2 dir="auto">INSTALLED VERSIONS</h2>
<p dir="auto">commit: None<br>
python: 3.6.4.final.0<br>
python-bits: 64<br>
OS: Windows<br>
OS-release: 10<br>
machine: AMD64<br>
processor: Intel64 Family 6 Model 60 Stepping 3, GenuineIntel<br>
byteorder: little<br>
LC_ALL: None<br>
LANG: None<br>
LOCALE: None.None</p>
<p dir="auto">pandas: 0.22.0<br>
pytest: 3.3.2<br>
pip: 9.0.1<br>
setuptools: 38.4.0<br>
Cython: 0.27.3<br>
numpy: 1.14.0<br>
scipy: 1.0.0<br>
pyarrow: None<br>
xarray: None<br>
IPython: 6.2.1<br>
sphinx: 1.6.6<br>
patsy: 0.5.0<br>
dateutil: 2.6.1<br>
pytz: 2017.3<br>
blosc: None<br>
bottleneck: 1.2.1<br>
tables: 3.4.2<br>
numexpr: 2.6.4<br>
feather: None<br>
matplotlib: 2.1.2<br>
openpyxl: 2.4.10<br>
xlrd: 1.1.0<br>
xlwt: 1.3.0<br>
xlsxwriter: 1.0.2<br>
lxml: 4.1.1<br>
bs4: 4.6.0<br>
html5lib: 1.0.1<br>
sqlalchemy: 1.2.1<br>
pymysql: 0.7.11.None<br>
psycopg2: None<br>
jinja2: 2.10<br>
s3fs: None<br>
fastparquet: None<br>
pandas_gbq: None<br>
pandas_datareader: None<br>
In [ ]:</p>
<p dir="auto"></p>
</details> | <p dir="auto">xref <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="174840894" data-permission-text="Title is private" data-url="https://github.com/pandas-dev/pandas/issues/14139" data-hovercard-type="issue" data-hovercard-url="/pandas-dev/pandas/issues/14139/hovercard" href="https://github.com/pandas-dev/pandas/issues/14139">#14139</a> for empty MI</p>
<p dir="auto">Hi everybody,</p>
<p dir="auto">in the current version renaming of MultiIndex DataFrames does not work. Lets take the following example:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="import datetime as DT
import pandas as pd
df = pd.DataFrame({
'Branch' : 'A A A A A B'.split(),
'Buyer': 'Carl Mark Carl Joe Mark Carl'.split(),
'Quantity': [1,3,5,8,9,3],
'Date' : [
DT.datetime(2013,9,1,13,0),
DT.datetime(2013,9,1,13,5),
DT.datetime(2013,10,1,20,0),
DT.datetime(2013,10,3,10,0),
DT.datetime(2013,12,2,12,0),
DT.datetime(2013,12,2,14,0),
]})"><pre class="notranslate"><code class="notranslate">import datetime as DT
import pandas as pd
df = pd.DataFrame({
'Branch' : 'A A A A A B'.split(),
'Buyer': 'Carl Mark Carl Joe Mark Carl'.split(),
'Quantity': [1,3,5,8,9,3],
'Date' : [
DT.datetime(2013,9,1,13,0),
DT.datetime(2013,9,1,13,5),
DT.datetime(2013,10,1,20,0),
DT.datetime(2013,10,3,10,0),
DT.datetime(2013,12,2,12,0),
DT.datetime(2013,12,2,14,0),
]})
</code></pre></div>
<p dir="auto">and the following query:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="test_df = df[df['Buyer'].isin(['Carl', 'Mark'])].set_index('Buyer', append=True)[['Date']].unstack(['Buyer'])"><pre class="notranslate"><code class="notranslate">test_df = df[df['Buyer'].isin(['Carl', 'Mark'])].set_index('Buyer', append=True)[['Date']].unstack(['Buyer'])
</code></pre></div>
<p dir="auto">Now, the following renaming does not work</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="test_df.rename(columns={('Date', 'Carl'): 'Carl'}, inplace=True)"><pre class="notranslate"><code class="notranslate">test_df.rename(columns={('Date', 'Carl'): 'Carl'}, inplace=True)
</code></pre></div>
<p dir="auto">Thanks in advance</p>
<p dir="auto">Andy</p> | 1 |
<p dir="auto">mac system: m1 12.5.1 (21G83)<br>
Python 2.7.16<br>
opencv: 4.x<br>
opencv_contrib: 4.x</p>
<blockquote>
<p dir="auto">#import "Headers/opencv2.h"<br>
^<br>
/Users/green/Desktop/github/ios/build/build-arm64-iphoneos/lib/Release/opencv2.framework/Headers/opencv2.h:217:9: note: in file included from /Users/green/Desktop/github/ios/build/build-arm64-iphoneos/lib/Release/opencv2.framework/Headers/opencv2.h:217:<br>
#import <opencv2/TEBLID.h><br>
^<br>
/Users/green/Desktop/github/ios/build/build-arm64-iphoneos/lib/Release/opencv2.framework/Headers/TEBLID.h:21:5: error: redefinition of enumerator 'SIZE_256_BITS'<br>
SIZE_256_BITS = 102,<br>
^<br>
/Users/green/Desktop/github/ios/build/build-arm64-iphoneos/lib/Release/opencv2.framework/Headers/BEBLID.h:22:5: note: previous definition is here<br>
SIZE_256_BITS = 101<br>
^<br>
:1:9: note: in file included from :1:<br>
#import "Headers/opencv2.h"<br>
^<br>
/Users/green/Desktop/github/ios/build/build-arm64-iphoneos/lib/Release/opencv2.framework/Headers/opencv2.h:217:9: note: in file included from /Users/green/Desktop/github/ios/build/build-arm64-iphoneos/lib/Release/opencv2.framework/Headers/opencv2.h:217:<br>
#import <opencv2/TEBLID.h><br>
^<br>
/Users/green/Desktop/github/ios/build/build-arm64-iphoneos/lib/Release/opencv2.framework/Headers/TEBLID.h:22:5: error: redefinition of enumerator 'SIZE_512_BITS'<br>
SIZE_512_BITS = 103<br>
^<br>
/Users/green/Desktop/github/ios/build/build-arm64-iphoneos/lib/Release/opencv2.framework/Headers/BEBLID.h:21:5: note: previous definition is here<br>
SIZE_512_BITS = 100,<br>
^<br>
:0: error: could not build Objective-C module 'opencv2'<br>
Command EmitSwiftModule failed with a nonzero exit code</p>
<p dir="auto">error: emit-module command failed with exit code 1 (use -v to see invocation)<br>
** BUILD FAILED **</p>
<h1 dir="auto">The following build commands failed:<br>
CompileSwift normal arm64 /Users/green/Desktop/github/ios/build/build-arm64-iphoneos/modules/objc_bindings_generator/ios/gen/objc/imgcodecs/ImgcodecsExt.swift (in target 'opencv2' from project 'opencv2')<br>
CompileSwift normal arm64 /Users/green/Desktop/github/ios/build/build-arm64-iphoneos/modules/objc_bindings_generator/ios/gen/objc/imgproc/ImgprocExt.swift (in target 'opencv2' from project 'opencv2')<br>
CompileSwift normal arm64 /Users/green/Desktop/github/ios/build/build-arm64-iphoneos/modules/objc_bindings_generator/ios/gen/objc/ml/MlExt.swift (in target 'opencv2' from project 'opencv2')<br>
CompileSwift normal arm64 /Users/green/Desktop/github/ios/build/build-arm64-iphoneos/modules/objc_bindings_generator/ios/gen/objc/text/TextExt.swift (in target 'opencv2' from project 'opencv2')<br>
CompileSwift normal arm64 /Users/green/Desktop/github/ios/build/build-arm64-iphoneos/modules/objc_bindings_generator/ios/gen/objc/video/VideoExt.swift (in target 'opencv2' from project 'opencv2')<br>
CompileSwift normal arm64 /Users/green/Desktop/github/ios/build/build-arm64-iphoneos/modules/objc_bindings_generator/ios/gen/objc/videoio/VideoioExt.swift (in target 'opencv2' from project 'opencv2')<br>
CompileSwift normal arm64 /Users/green/Desktop/github/ios/build/build-arm64-iphoneos/modules/objc_bindings_generator/ios/gen/objc/wechat_qrcode/Wechat_qrcodeExt.swift (in target 'opencv2' from project 'opencv2')<br>
CompileSwift normal arm64 /Users/green/Desktop/github/ios/build/build-arm64-iphoneos/modules/objc_bindings_generator/ios/gen/objc/xfeatures2d/Xfeatures2dExt.swift (in target 'opencv2' from project 'opencv2')<br>
CompileSwift normal arm64 /Users/green/Desktop/github/ios/build/build-arm64-iphoneos/modules/objc_bindings_generator/ios/gen/objc/ximgproc/XimgprocExt.swift (in target 'opencv2' from project 'opencv2')<br>
CompileSwift normal arm64 /Users/green/Desktop/github/ios/build/build-arm64-iphoneos/modules/objc_bindings_generator/ios/gen/objc/aruco/ArucoExt.swift (in target 'opencv2' from project 'opencv2')<br>
CompileSwift normal arm64 /Users/green/Desktop/github/ios/build/build-arm64-iphoneos/modules/objc_bindings_generator/ios/gen/objc/calib3d/Calib3dExt.swift (in target 'opencv2' from project 'opencv2')<br>
CompileSwift normal arm64 /Users/green/Desktop/github/ios/build/build-arm64-iphoneos/modules/objc_bindings_generator/ios/gen/objc/core/ByteVectorExt.swift (in target 'opencv2' from project 'opencv2')<br>
CompileSwift normal arm64 /Users/green/Desktop/github/ios/build/build-arm64-iphoneos/modules/objc_bindings_generator/ios/gen/objc/core/CoreExt.swift (in target 'opencv2' from project 'opencv2')<br>
CompileSwift normal arm64 /Users/green/Desktop/github/ios/build/build-arm64-iphoneos/modules/objc_bindings_generator/ios/gen/objc/dnn/DnnExt.swift (in target 'opencv2' from project 'opencv2')<br>
CompileSwift normal arm64 /Users/green/Desktop/github/ios/build/build-arm64-iphoneos/modules/objc_bindings_generator/ios/gen/objc/face/FaceExt.swift (in target 'opencv2' from project 'opencv2')<br>
CompileSwift normal arm64 /Users/green/Desktop/github/ios/build/build-arm64-iphoneos/modules/objc_bindings_generator/ios/gen/objc/features2d/Features2dExt.swift (in target 'opencv2' from project 'opencv2')<br>
CompileSwift normal arm64 /Users/green/Desktop/github/ios/build/build-arm64-iphoneos/modules/objc_bindings_generator/ios/gen/objc/core/CvTypeExt.swift (in target 'opencv2' from project 'opencv2')<br>
CompileSwift normal arm64 /Users/green/Desktop/github/ios/build/build-arm64-iphoneos/modules/objc_bindings_generator/ios/gen/objc/core/DoubleVectorExt.swift (in target 'opencv2' from project 'opencv2')<br>
CompileSwift normal arm64 /Users/green/Desktop/github/ios/build/build-arm64-iphoneos/modules/objc_bindings_generator/ios/gen/objc/core/FloatVectorExt.swift (in target 'opencv2' from project 'opencv2')<br>
CompileSwift normal arm64 /Users/green/Desktop/github/ios/build/build-arm64-iphoneos/modules/objc_bindings_generator/ios/gen/objc/objdetect/ObjdetectExt.swift (in target 'opencv2' from project 'opencv2')<br>
CompileSwift normal arm64 /Users/green/Desktop/github/ios/build/build-arm64-iphoneos/modules/objc_bindings_generator/ios/gen/objc/photo/PhotoExt.swift (in target 'opencv2' from project 'opencv2')<br>
CompileSwift normal arm64 /Users/green/Desktop/github/ios/build/build-arm64-iphoneos/modules/objc_bindings_generator/ios/gen/objc/structured_light/Structured_lightExt.swift (in target 'opencv2' from project 'opencv2')<br>
CompileSwift normal arm64 /Users/green/Desktop/github/ios/build/build-arm64-iphoneos/modules/objc_bindings_generator/ios/gen/objc/core/IntVectorExt.swift (in target 'opencv2' from project 'opencv2')<br>
CompileSwift normal arm64 /Users/green/Desktop/github/ios/build/build-arm64-iphoneos/modules/objc_bindings_generator/ios/gen/objc/core/MatExt.swift (in target 'opencv2' from project 'opencv2')<br>
CompileSwift normal arm64 /Users/green/Desktop/github/ios/build/build-arm64-iphoneos/modules/objc_bindings_generator/ios/gen/objc/core/Typealiases.swift (in target 'opencv2' from project 'opencv2')<br>
EmitSwiftModule normal arm64 (in target 'opencv2' from project 'opencv2')<br>
CompileSwiftSources normal arm64 com.apple.xcode.tools.swift.compiler (in target 'opencv2' from project 'opencv2')<br>
(27 failures)</h1>
<h1 dir="auto">ERROR: Command '[u'xcodebuild', u'BITCODE_GENERATION_MODE=bitcode', u'IPHONEOS_DEPLOYMENT_TARGET=9.0', u'ARCHS=arm64', u'-sdk', u'iphoneos', u'-configuration', u'Release', u'-parallelizeTargets', u'-jobs', '8', u'-target', u'ALL_BUILD', u'build']' returned non-zero exit status 65</h1>
<p dir="auto">Traceback (most recent call last):<br>
File "opencv/platforms/ios/build_framework.py", line 181, in build<br>
self._build(outdir)<br>
File "opencv/platforms/ios/build_framework.py", line 139, in _build<br>
self.buildOne(target[0], target[1], main_build_dir, cmake_flags)<br>
File "opencv/platforms/ios/build_framework.py", line 329, in buildOne<br>
execute(buildcmd + ["-target", "ALL_BUILD", "build"], cwd = builddir + "/modules/objc/framework_build")<br>
File "/Users/green/Desktop/github/opencv/platforms/apple/cv_build_utils.py", line 13, in execute<br>
retcode = check_call(cmd, cwd = cwd)<br>
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 190, in check_call<br>
raise CalledProcessError(retcode, cmd)<br>
CalledProcessError: Command '[u'xcodebuild', u'BITCODE_GENERATION_MODE=bitcode', u'IPHONEOS_DEPLOYMENT_TARGET=9.0', u'ARCHS=arm64', u'-sdk', u'iphoneos', u'-configuration', u'Release', u'-parallelizeTargets', u'-jobs', '8', u'-target', u'ALL_BUILD', u'build']' returned non-zero exit status 65</p>
</blockquote> | <h5 dir="auto">System information (version)</h5>
<ul dir="auto">
<li>OpenCV => latest source code from this git repo</li>
<li>Operating System / Platform => macOS 12.4</li>
<li>Compiler => OpenCV python build_framework.py</li>
</ul>
<h5 dir="auto">Detailed description</h5>
<p dir="auto">build log:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content=" BUILD FAILED
The following build commands failed:
CompileSwift normal x86_64 /Users/andy/Workspace/OpenCV/build/build-x86_64-macosx/modules/objc_bindings_generator/osx/gen/objc/core/CvTypeExt.swift (in target 'opencv2' from project 'opencv2')
CompileSwift normal x86_64 /Users/andy/Workspace/OpenCV/build/build-x86_64-macosx/modules/objc_bindings_generator/osx/gen/objc/core/DoubleVectorExt.swift (in target 'opencv2' from project 'opencv2')
CompileSwift normal x86_64 /Users/andy/Workspace/OpenCV/build/build-x86_64-macosx/modules/objc_bindings_generator/osx/gen/objc/core/FloatVectorExt.swift (in target 'opencv2' from project 'opencv2')
CompileSwift normal x86_64 /Users/andy/Workspace/OpenCV/build/build-x86_64-macosx/modules/objc_bindings_generator/osx/gen/objc/core/IntVectorExt.swift (in target 'opencv2' from project 'opencv2')
CompileSwift normal x86_64 /Users/andy/Workspace/OpenCV/build/build-x86_64-macosx/modules/objc_bindings_generator/osx/gen/objc/core/MatExt.swift (in target 'opencv2' from project 'opencv2')
CompileSwift normal x86_64 /Users/andy/Workspace/OpenCV/build/build-x86_64-macosx/modules/objc_bindings_generator/osx/gen/objc/core/Typealiases.swift (in target 'opencv2' from project 'opencv2')
CompileSwift normal x86_64 /Users/andy/Workspace/OpenCV/build/build-x86_64-macosx/modules/objc_bindings_generator/osx/gen/objc/dnn/DnnExt.swift (in target 'opencv2' from project 'opencv2')
CompileSwift normal x86_64 /Users/andy/Workspace/OpenCV/build/build-x86_64-macosx/modules/objc_bindings_generator/osx/gen/objc/face/FaceExt.swift (in target 'opencv2' from project 'opencv2')
CompileSwift normal x86_64 /Users/andy/Workspace/OpenCV/build/build-x86_64-macosx/modules/objc_bindings_generator/osx/gen/objc/features2d/Features2dExt.swift (in target 'opencv2' from project 'opencv2')
CompileSwift normal x86_64 /Users/andy/Workspace/OpenCV/build/build-x86_64-macosx/modules/objc_bindings_generator/osx/gen/objc/objdetect/ObjdetectExt.swift (in target 'opencv2' from project 'opencv2')
CompileSwift normal x86_64 /Users/andy/Workspace/OpenCV/build/build-x86_64-macosx/modules/objc_bindings_generator/osx/gen/objc/photo/PhotoExt.swift (in target 'opencv2' from project 'opencv2')
CompileSwift normal x86_64 /Users/andy/Workspace/OpenCV/build/build-x86_64-macosx/modules/objc_bindings_generator/osx/gen/objc/structured_light/Structured_lightExt.swift (in target 'opencv2' from project 'opencv2')
CompileSwift normal x86_64 /Users/andy/Workspace/OpenCV/build/build-x86_64-macosx/modules/objc_bindings_generator/osx/gen/objc/imgcodecs/ImgcodecsExt.swift (in target 'opencv2' from project 'opencv2')
CompileSwift normal x86_64 /Users/andy/Workspace/OpenCV/build/build-x86_64-macosx/modules/objc_bindings_generator/osx/gen/objc/imgproc/ImgprocExt.swift (in target 'opencv2' from project 'opencv2')
CompileSwift normal x86_64 /Users/andy/Workspace/OpenCV/build/build-x86_64-macosx/modules/objc_bindings_generator/osx/gen/objc/ml/MlExt.swift (in target 'opencv2' from project 'opencv2')
EmitSwiftModule normal x86_64 (in target 'opencv2' from project 'opencv2')
CompileSwift normal x86_64 /Users/andy/Workspace/OpenCV/build/build-x86_64-macosx/modules/objc_bindings_generator/osx/gen/objc/aruco/ArucoExt.swift (in target 'opencv2' from project 'opencv2')
CompileSwift normal x86_64 /Users/andy/Workspace/OpenCV/build/build-x86_64-macosx/modules/objc_bindings_generator/osx/gen/objc/calib3d/Calib3dExt.swift (in target 'opencv2' from project 'opencv2')
CompileSwift normal x86_64 /Users/andy/Workspace/OpenCV/build/build-x86_64-macosx/modules/objc_bindings_generator/osx/gen/objc/core/ByteVectorExt.swift (in target 'opencv2' from project 'opencv2')
CompileSwift normal x86_64 /Users/andy/Workspace/OpenCV/build/build-x86_64-macosx/modules/objc_bindings_generator/osx/gen/objc/core/CoreExt.swift (in target 'opencv2' from project 'opencv2')
CompileSwift normal x86_64 /Users/andy/Workspace/OpenCV/build/build-x86_64-macosx/modules/objc_bindings_generator/osx/gen/objc/text/TextExt.swift (in target 'opencv2' from project 'opencv2')
CompileSwift normal x86_64 /Users/andy/Workspace/OpenCV/build/build-x86_64-macosx/modules/objc_bindings_generator/osx/gen/objc/video/VideoExt.swift (in target 'opencv2' from project 'opencv2')
CompileSwift normal x86_64 /Users/andy/Workspace/OpenCV/build/build-x86_64-macosx/modules/objc_bindings_generator/osx/gen/objc/videoio/VideoioExt.swift (in target 'opencv2' from project 'opencv2')
CompileSwift normal x86_64 /Users/andy/Workspace/OpenCV/build/build-x86_64-macosx/modules/objc_bindings_generator/osx/gen/objc/wechat_qrcode/Wechat_qrcodeExt.swift (in target 'opencv2' from project 'opencv2')
CompileSwift normal x86_64 /Users/andy/Workspace/OpenCV/build/build-x86_64-macosx/modules/objc_bindings_generator/osx/gen/objc/xfeatures2d/Xfeatures2dExt.swift (in target 'opencv2' from project 'opencv2')
CompileSwift normal x86_64 /Users/andy/Workspace/OpenCV/build/build-x86_64-macosx/modules/objc_bindings_generator/osx/gen/objc/ximgproc/XimgprocExt.swift (in target 'opencv2' from project 'opencv2')
CompileSwiftSources normal x86_64 com.apple.xcode.tools.swift.compiler (in target 'opencv2' from project 'opencv2')
Copy /Users/andy/Workspace/OpenCV/build/build-x86_64-macosx/lib/Release/opencv2.framework/Versions/A/Headers/opencv2-Swift.h /Users/andy/Workspace/OpenCV/build/build-x86_64-macosx/modules/objc/framework_build/opencv2.build/Release/opencv2.build/Objects-normal/x86_64/opencv2-Swift.h (in target 'opencv2' from project 'opencv2')
Copy /Users/andy/Workspace/OpenCV/build/build-x86_64-macosx/lib/Release/opencv2.framework/Versions/A/Modules/opencv2.swiftmodule/x86_64-apple-macos.swiftdoc /Users/andy/Workspace/OpenCV/build/build-x86_64-macosx/modules/objc/framework_build/opencv2.build/Release/opencv2.build/Objects-normal/x86_64/opencv2.swiftdoc (in target 'opencv2' from project 'opencv2')
Copy /Users/andy/Workspace/OpenCV/build/build-x86_64-macosx/lib/Release/opencv2.framework/Versions/A/Modules/opencv2.swiftmodule/x86_64-apple-macos.swiftinterface /Users/andy/Workspace/OpenCV/build/build-x86_64-macosx/modules/objc/framework_build/opencv2.build/Release/opencv2.build/Objects-normal/x86_64/opencv2.swiftinterface (in target 'opencv2' from project 'opencv2')
Copy /Users/andy/Workspace/OpenCV/build/build-x86_64-macosx/lib/Release/opencv2.framework/Versions/A/Modules/opencv2.swiftmodule/x86_64-apple-macos.swiftmodule /Users/andy/Workspace/OpenCV/build/build-x86_64-macosx/modules/objc/framework_build/opencv2.build/Release/opencv2.build/Objects-normal/x86_64/opencv2.swiftmodule (in target 'opencv2' from project 'opencv2')
Copy /Users/andy/Workspace/OpenCV/build/build-x86_64-macosx/lib/Release/opencv2.framework/Versions/A/Modules/opencv2.swiftmodule/Project/x86_64-apple-macos.swiftsourceinfo /Users/andy/Workspace/OpenCV/build/build-x86_64-macosx/modules/objc/framework_build/opencv2.build/Release/opencv2.build/Objects-normal/x86_64/opencv2.swiftsourceinfo (in target 'opencv2' from project 'opencv2')
(32 failures)
============================================================
ERROR: Command '['xcodebuild', 'MACOSX_DEPLOYMENT_TARGET=10.12', 'ARCHS=x86_64', '-sdk', 'macosx', '-configuration', 'Release', '-parallelizeTargets', '-jobs', '8', '-target', 'ALL_BUILD', 'build']' returned non-zero exit status 65.
============================================================
Traceback (most recent call last):
File "/Users/andy/Workspace/OpenCV/opencv/platforms/ios/build_framework.py", line 181, in build
self._build(outdir)
File "/Users/andy/Workspace/OpenCV/opencv/platforms/ios/build_framework.py", line 139, in _build
self.buildOne(target[0], target[1], main_build_dir, cmake_flags)
File "/Users/andy/Workspace/OpenCV/opencv/platforms/ios/build_framework.py", line 329, in buildOne
execute(buildcmd + ["-target", "ALL_BUILD", "build"], cwd = builddir + "/modules/objc/framework_build")
File "/Users/andy/Workspace/OpenCV/opencv/platforms/apple/cv_build_utils.py", line 13, in execute
retcode = check_call(cmd, cwd = cwd)
File "/Users/andy/opt/anaconda3/lib/python3.8/subprocess.py", line 364, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['xcodebuild', 'MACOSX_DEPLOYMENT_TARGET=10.12', 'ARCHS=x86_64', '-sdk', 'macosx', '-configuration', 'Release', '-parallelizeTargets', '-jobs', '8', '-target', 'ALL_BUILD', 'build']' returned non-zero exit status 65."><pre class="notranslate"><code class="notranslate"> BUILD FAILED
The following build commands failed:
CompileSwift normal x86_64 /Users/andy/Workspace/OpenCV/build/build-x86_64-macosx/modules/objc_bindings_generator/osx/gen/objc/core/CvTypeExt.swift (in target 'opencv2' from project 'opencv2')
CompileSwift normal x86_64 /Users/andy/Workspace/OpenCV/build/build-x86_64-macosx/modules/objc_bindings_generator/osx/gen/objc/core/DoubleVectorExt.swift (in target 'opencv2' from project 'opencv2')
CompileSwift normal x86_64 /Users/andy/Workspace/OpenCV/build/build-x86_64-macosx/modules/objc_bindings_generator/osx/gen/objc/core/FloatVectorExt.swift (in target 'opencv2' from project 'opencv2')
CompileSwift normal x86_64 /Users/andy/Workspace/OpenCV/build/build-x86_64-macosx/modules/objc_bindings_generator/osx/gen/objc/core/IntVectorExt.swift (in target 'opencv2' from project 'opencv2')
CompileSwift normal x86_64 /Users/andy/Workspace/OpenCV/build/build-x86_64-macosx/modules/objc_bindings_generator/osx/gen/objc/core/MatExt.swift (in target 'opencv2' from project 'opencv2')
CompileSwift normal x86_64 /Users/andy/Workspace/OpenCV/build/build-x86_64-macosx/modules/objc_bindings_generator/osx/gen/objc/core/Typealiases.swift (in target 'opencv2' from project 'opencv2')
CompileSwift normal x86_64 /Users/andy/Workspace/OpenCV/build/build-x86_64-macosx/modules/objc_bindings_generator/osx/gen/objc/dnn/DnnExt.swift (in target 'opencv2' from project 'opencv2')
CompileSwift normal x86_64 /Users/andy/Workspace/OpenCV/build/build-x86_64-macosx/modules/objc_bindings_generator/osx/gen/objc/face/FaceExt.swift (in target 'opencv2' from project 'opencv2')
CompileSwift normal x86_64 /Users/andy/Workspace/OpenCV/build/build-x86_64-macosx/modules/objc_bindings_generator/osx/gen/objc/features2d/Features2dExt.swift (in target 'opencv2' from project 'opencv2')
CompileSwift normal x86_64 /Users/andy/Workspace/OpenCV/build/build-x86_64-macosx/modules/objc_bindings_generator/osx/gen/objc/objdetect/ObjdetectExt.swift (in target 'opencv2' from project 'opencv2')
CompileSwift normal x86_64 /Users/andy/Workspace/OpenCV/build/build-x86_64-macosx/modules/objc_bindings_generator/osx/gen/objc/photo/PhotoExt.swift (in target 'opencv2' from project 'opencv2')
CompileSwift normal x86_64 /Users/andy/Workspace/OpenCV/build/build-x86_64-macosx/modules/objc_bindings_generator/osx/gen/objc/structured_light/Structured_lightExt.swift (in target 'opencv2' from project 'opencv2')
CompileSwift normal x86_64 /Users/andy/Workspace/OpenCV/build/build-x86_64-macosx/modules/objc_bindings_generator/osx/gen/objc/imgcodecs/ImgcodecsExt.swift (in target 'opencv2' from project 'opencv2')
CompileSwift normal x86_64 /Users/andy/Workspace/OpenCV/build/build-x86_64-macosx/modules/objc_bindings_generator/osx/gen/objc/imgproc/ImgprocExt.swift (in target 'opencv2' from project 'opencv2')
CompileSwift normal x86_64 /Users/andy/Workspace/OpenCV/build/build-x86_64-macosx/modules/objc_bindings_generator/osx/gen/objc/ml/MlExt.swift (in target 'opencv2' from project 'opencv2')
EmitSwiftModule normal x86_64 (in target 'opencv2' from project 'opencv2')
CompileSwift normal x86_64 /Users/andy/Workspace/OpenCV/build/build-x86_64-macosx/modules/objc_bindings_generator/osx/gen/objc/aruco/ArucoExt.swift (in target 'opencv2' from project 'opencv2')
CompileSwift normal x86_64 /Users/andy/Workspace/OpenCV/build/build-x86_64-macosx/modules/objc_bindings_generator/osx/gen/objc/calib3d/Calib3dExt.swift (in target 'opencv2' from project 'opencv2')
CompileSwift normal x86_64 /Users/andy/Workspace/OpenCV/build/build-x86_64-macosx/modules/objc_bindings_generator/osx/gen/objc/core/ByteVectorExt.swift (in target 'opencv2' from project 'opencv2')
CompileSwift normal x86_64 /Users/andy/Workspace/OpenCV/build/build-x86_64-macosx/modules/objc_bindings_generator/osx/gen/objc/core/CoreExt.swift (in target 'opencv2' from project 'opencv2')
CompileSwift normal x86_64 /Users/andy/Workspace/OpenCV/build/build-x86_64-macosx/modules/objc_bindings_generator/osx/gen/objc/text/TextExt.swift (in target 'opencv2' from project 'opencv2')
CompileSwift normal x86_64 /Users/andy/Workspace/OpenCV/build/build-x86_64-macosx/modules/objc_bindings_generator/osx/gen/objc/video/VideoExt.swift (in target 'opencv2' from project 'opencv2')
CompileSwift normal x86_64 /Users/andy/Workspace/OpenCV/build/build-x86_64-macosx/modules/objc_bindings_generator/osx/gen/objc/videoio/VideoioExt.swift (in target 'opencv2' from project 'opencv2')
CompileSwift normal x86_64 /Users/andy/Workspace/OpenCV/build/build-x86_64-macosx/modules/objc_bindings_generator/osx/gen/objc/wechat_qrcode/Wechat_qrcodeExt.swift (in target 'opencv2' from project 'opencv2')
CompileSwift normal x86_64 /Users/andy/Workspace/OpenCV/build/build-x86_64-macosx/modules/objc_bindings_generator/osx/gen/objc/xfeatures2d/Xfeatures2dExt.swift (in target 'opencv2' from project 'opencv2')
CompileSwift normal x86_64 /Users/andy/Workspace/OpenCV/build/build-x86_64-macosx/modules/objc_bindings_generator/osx/gen/objc/ximgproc/XimgprocExt.swift (in target 'opencv2' from project 'opencv2')
CompileSwiftSources normal x86_64 com.apple.xcode.tools.swift.compiler (in target 'opencv2' from project 'opencv2')
Copy /Users/andy/Workspace/OpenCV/build/build-x86_64-macosx/lib/Release/opencv2.framework/Versions/A/Headers/opencv2-Swift.h /Users/andy/Workspace/OpenCV/build/build-x86_64-macosx/modules/objc/framework_build/opencv2.build/Release/opencv2.build/Objects-normal/x86_64/opencv2-Swift.h (in target 'opencv2' from project 'opencv2')
Copy /Users/andy/Workspace/OpenCV/build/build-x86_64-macosx/lib/Release/opencv2.framework/Versions/A/Modules/opencv2.swiftmodule/x86_64-apple-macos.swiftdoc /Users/andy/Workspace/OpenCV/build/build-x86_64-macosx/modules/objc/framework_build/opencv2.build/Release/opencv2.build/Objects-normal/x86_64/opencv2.swiftdoc (in target 'opencv2' from project 'opencv2')
Copy /Users/andy/Workspace/OpenCV/build/build-x86_64-macosx/lib/Release/opencv2.framework/Versions/A/Modules/opencv2.swiftmodule/x86_64-apple-macos.swiftinterface /Users/andy/Workspace/OpenCV/build/build-x86_64-macosx/modules/objc/framework_build/opencv2.build/Release/opencv2.build/Objects-normal/x86_64/opencv2.swiftinterface (in target 'opencv2' from project 'opencv2')
Copy /Users/andy/Workspace/OpenCV/build/build-x86_64-macosx/lib/Release/opencv2.framework/Versions/A/Modules/opencv2.swiftmodule/x86_64-apple-macos.swiftmodule /Users/andy/Workspace/OpenCV/build/build-x86_64-macosx/modules/objc/framework_build/opencv2.build/Release/opencv2.build/Objects-normal/x86_64/opencv2.swiftmodule (in target 'opencv2' from project 'opencv2')
Copy /Users/andy/Workspace/OpenCV/build/build-x86_64-macosx/lib/Release/opencv2.framework/Versions/A/Modules/opencv2.swiftmodule/Project/x86_64-apple-macos.swiftsourceinfo /Users/andy/Workspace/OpenCV/build/build-x86_64-macosx/modules/objc/framework_build/opencv2.build/Release/opencv2.build/Objects-normal/x86_64/opencv2.swiftsourceinfo (in target 'opencv2' from project 'opencv2')
(32 failures)
============================================================
ERROR: Command '['xcodebuild', 'MACOSX_DEPLOYMENT_TARGET=10.12', 'ARCHS=x86_64', '-sdk', 'macosx', '-configuration', 'Release', '-parallelizeTargets', '-jobs', '8', '-target', 'ALL_BUILD', 'build']' returned non-zero exit status 65.
============================================================
Traceback (most recent call last):
File "/Users/andy/Workspace/OpenCV/opencv/platforms/ios/build_framework.py", line 181, in build
self._build(outdir)
File "/Users/andy/Workspace/OpenCV/opencv/platforms/ios/build_framework.py", line 139, in _build
self.buildOne(target[0], target[1], main_build_dir, cmake_flags)
File "/Users/andy/Workspace/OpenCV/opencv/platforms/ios/build_framework.py", line 329, in buildOne
execute(buildcmd + ["-target", "ALL_BUILD", "build"], cwd = builddir + "/modules/objc/framework_build")
File "/Users/andy/Workspace/OpenCV/opencv/platforms/apple/cv_build_utils.py", line 13, in execute
retcode = check_call(cmd, cwd = cwd)
File "/Users/andy/opt/anaconda3/lib/python3.8/subprocess.py", line 364, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['xcodebuild', 'MACOSX_DEPLOYMENT_TARGET=10.12', 'ARCHS=x86_64', '-sdk', 'macosx', '-configuration', 'Release', '-parallelizeTargets', '-jobs', '8', '-target', 'ALL_BUILD', 'build']' returned non-zero exit status 65.
</code></pre></div>
<h5 dir="auto">Steps to reproduce</h5>
<ol dir="auto">
<li>follow this guide <a href="https://docs.opencv.org/4.x/d5/da3/tutorial_ios_install.html" rel="nofollow">https://docs.opencv.org/4.x/d5/da3/tutorial_ios_install.html</a></li>
<li><code class="notranslate">python opencv/platforms/osx/build_framework.py --macos_archs x86_64,arm64 --contrib opencv_contrib ./</code></li>
</ol> | 1 |
<p dir="auto"><strong>Describe the bug</strong></p>
<p dir="auto">There is a bug when API is organized with different versions (FastAPI apps) which mounted via global <code class="notranslate">app.mount</code>.</p>
<p dir="auto">ReDoc duplicates mount's prefix. For example, <code class="notranslate">http://127.0.0.1:8000/v1/v1/test</code>.</p>
<p dir="auto">It works well in default OpenAPI Docs.</p>
<p dir="auto"><strong>Environment:</strong></p>
<ul dir="auto">
<li>OS: [e.g. Linux / Windows / macOS]</li>
<li>FastAPI Version [e.g. 0.3.0], get it with: 0.40.0</li>
</ul>
<p dir="auto"><strong>Additional context</strong></p>
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="import fastapi
from fastapi import APIRouter
app = fastapi.FastAPI(docs_url=None, redoc_url=None)
router = APIRouter()
@router.get("/users/", tags=["users"])
async def read_users():
return [{"username": "Foo"}, {"username": "Bar"}]
apiV1 = fastapi.FastAPI(openapi_prefix="/v1", version="1.0.0")
apiV1.include_router(router)
app.mount("/v1", apiV1)"><pre class="notranslate"><span class="pl-k">import</span> <span class="pl-s1">fastapi</span>
<span class="pl-k">from</span> <span class="pl-s1">fastapi</span> <span class="pl-k">import</span> <span class="pl-v">APIRouter</span>
<span class="pl-s1">app</span> <span class="pl-c1">=</span> <span class="pl-s1">fastapi</span>.<span class="pl-v">FastAPI</span>(<span class="pl-s1">docs_url</span><span class="pl-c1">=</span><span class="pl-c1">None</span>, <span class="pl-s1">redoc_url</span><span class="pl-c1">=</span><span class="pl-c1">None</span>)
<span class="pl-s1">router</span> <span class="pl-c1">=</span> <span class="pl-v">APIRouter</span>()
<span class="pl-en">@<span class="pl-s1">router</span>.<span class="pl-en">get</span>(<span class="pl-s">"/users/"</span>, <span class="pl-s1">tags</span><span class="pl-c1">=</span>[<span class="pl-s">"users"</span>])</span>
<span class="pl-k">async</span> <span class="pl-k">def</span> <span class="pl-en">read_users</span>():
<span class="pl-k">return</span> [{<span class="pl-s">"username"</span>: <span class="pl-s">"Foo"</span>}, {<span class="pl-s">"username"</span>: <span class="pl-s">"Bar"</span>}]
<span class="pl-s1">apiV1</span> <span class="pl-c1">=</span> <span class="pl-s1">fastapi</span>.<span class="pl-v">FastAPI</span>(<span class="pl-s1">openapi_prefix</span><span class="pl-c1">=</span><span class="pl-s">"/v1"</span>, <span class="pl-s1">version</span><span class="pl-c1">=</span><span class="pl-s">"1.0.0"</span>)
<span class="pl-s1">apiV1</span>.<span class="pl-en">include_router</span>(<span class="pl-s1">router</span>)
<span class="pl-s1">app</span>.<span class="pl-en">mount</span>(<span class="pl-s">"/v1"</span>, <span class="pl-s1">apiV1</span>)</pre></div>
<h1 dir="auto">Screenshot</h1>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/1760209/66273438-aa2a5300-e87c-11e9-9d14-8f3981de5c73.png"><img src="https://user-images.githubusercontent.com/1760209/66273438-aa2a5300-e87c-11e9-9d14-8f3981de5c73.png" alt="Screen Shot 2019-10-06 at 21 02 37" style="max-width: 100%;"></a></p> | <h3 dir="auto">First Check</h3>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I added a very descriptive title to this issue.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I used the GitHub search to find a similar issue and didn't find it.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I searched the FastAPI documentation, with the integrated search.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I already searched in Google "How to X in FastAPI" and didn't find any information.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I already read and followed all the tutorial in the docs and didn't find an answer.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I already checked if it is not related to FastAPI but to <a href="https://github.com/samuelcolvin/pydantic">Pydantic</a>.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I already checked if it is not related to FastAPI but to <a href="https://github.com/swagger-api/swagger-ui">Swagger UI</a>.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I already checked if it is not related to FastAPI but to <a href="https://github.com/Redocly/redoc">ReDoc</a>.</li>
</ul>
<h3 dir="auto">Commit to Help</h3>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I commit to help with one of those options <g-emoji class="g-emoji" alias="point_up_2" fallback-src="https://github.githubassets.com/images/icons/emoji/unicode/1f446.png">👆</g-emoji></li>
</ul>
<h3 dir="auto">Example Code</h3>
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="from fastapi import FastAPI, Header, Request, HTTPException
app = FastAPI()
@app.get("/greet")
def greet_version(request: Request, X_API_Version: int = Header(int(1))):
"""
This request uses X-API-Version header to determine version
- **X-API-Version**: request must have a version either 1 or 2 is accepted.
"""
version = request.headers.get('X-API-Version')
if version == '1':
return {'message': "Hello"}
if version == '2':
return {'notice': "Hello"}
else:
raise HTTPException(status_code=404, detail="Version not found")"><pre class="notranslate"><span class="pl-k">from</span> <span class="pl-s1">fastapi</span> <span class="pl-k">import</span> <span class="pl-v">FastAPI</span>, <span class="pl-v">Header</span>, <span class="pl-v">Request</span>, <span class="pl-v">HTTPException</span>
<span class="pl-s1">app</span> <span class="pl-c1">=</span> <span class="pl-v">FastAPI</span>()
<span class="pl-en">@<span class="pl-s1">app</span>.<span class="pl-en">get</span>(<span class="pl-s">"/greet"</span>)</span>
<span class="pl-k">def</span> <span class="pl-en">greet_version</span>(<span class="pl-s1">request</span>: <span class="pl-v">Request</span>, <span class="pl-v">X_API_Version</span>: <span class="pl-s1">int</span> <span class="pl-c1">=</span> <span class="pl-v">Header</span>(<span class="pl-en">int</span>(<span class="pl-c1">1</span>))):
<span class="pl-s">"""</span>
<span class="pl-s"> This request uses X-API-Version header to determine version</span>
<span class="pl-s"></span>
<span class="pl-s"> - **X-API-Version**: request must have a version either 1 or 2 is accepted.</span>
<span class="pl-s"> """</span>
<span class="pl-s1">version</span> <span class="pl-c1">=</span> <span class="pl-s1">request</span>.<span class="pl-s1">headers</span>.<span class="pl-en">get</span>(<span class="pl-s">'X-API-Version'</span>)
<span class="pl-k">if</span> <span class="pl-s1">version</span> <span class="pl-c1">==</span> <span class="pl-s">'1'</span>:
<span class="pl-k">return</span> {<span class="pl-s">'message'</span>: <span class="pl-s">"Hello"</span>}
<span class="pl-k">if</span> <span class="pl-s1">version</span> <span class="pl-c1">==</span> <span class="pl-s">'2'</span>:
<span class="pl-k">return</span> {<span class="pl-s">'notice'</span>: <span class="pl-s">"Hello"</span>}
<span class="pl-k">else</span>:
<span class="pl-k">raise</span> <span class="pl-v">HTTPException</span>(<span class="pl-s1">status_code</span><span class="pl-c1">=</span><span class="pl-c1">404</span>, <span class="pl-s1">detail</span><span class="pl-c1">=</span><span class="pl-s">"Version not found"</span>)</pre></div>
<h3 dir="auto">Description</h3>
<p dir="auto">I want to create FastAPI app with custom header versioning and the only solution I found is to add the check in the request itself what is the header value and based on that return the adjusted response. This approach is not very good in terms of code organization(nested if-else for versioning), data validation ex. what in case version two would require different query parameters, I cannot set both in the same request. Also, this will not be described properly with OpenAPI docs. I would rather have requests under the same path and define them according to version changes based on additional header parameters but I am not sure how to approach this especially since two requests cannot have the same path and I don't want to use redirects ex. with the decorator:</p>
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="@app.get("/greet")
@header_version(1)
def greet_version(request: Request, X_API_Version: int = Header(int(1))):
return {'message': "Hello"}
@app.get("/greet")
@header_version(2)
def greet_version(request: Request, X_API_Version: int = Header(int(2))):
return {'notice': "Hello"}"><pre class="notranslate"><span class="pl-en">@<span class="pl-s1">app</span>.<span class="pl-en">get</span>(<span class="pl-s">"/greet"</span>)</span>
<span class="pl-en">@<span class="pl-en">header_version</span>(<span class="pl-c1">1</span>)</span>
<span class="pl-k">def</span> <span class="pl-en">greet_version</span>(<span class="pl-s1">request</span>: <span class="pl-v">Request</span>, <span class="pl-v">X_API_Version</span>: <span class="pl-s1">int</span> <span class="pl-c1">=</span> <span class="pl-v">Header</span>(<span class="pl-en">int</span>(<span class="pl-c1">1</span>))):
<span class="pl-k">return</span> {<span class="pl-s">'message'</span>: <span class="pl-s">"Hello"</span>}
<span class="pl-en">@<span class="pl-s1">app</span>.<span class="pl-en">get</span>(<span class="pl-s">"/greet"</span>)</span>
<span class="pl-en">@<span class="pl-en">header_version</span>(<span class="pl-c1">2</span>)</span>
<span class="pl-k">def</span> <span class="pl-en">greet_version</span>(<span class="pl-s1">request</span>: <span class="pl-v">Request</span>, <span class="pl-v">X_API_Version</span>: <span class="pl-s1">int</span> <span class="pl-c1">=</span> <span class="pl-v">Header</span>(<span class="pl-en">int</span>(<span class="pl-c1">2</span>))):
<span class="pl-k">return</span> {<span class="pl-s">'notice'</span>: <span class="pl-s">"Hello"</span>}</pre></div>
<h3 dir="auto">Operating System</h3>
<p dir="auto">Linux</p>
<h3 dir="auto">Operating System Details</h3>
<p dir="auto"><em>No response</em></p>
<h3 dir="auto">FastAPI Version</h3>
<p dir="auto">0.66.0</p>
<h3 dir="auto">Python Version</h3>
<p dir="auto">3.8.10</p>
<h3 dir="auto">Additional Context</h3>
<p dir="auto"><em>No response</em></p> | 0 |
<p dir="auto">Hi, I'm not sure the exact state of deno right now. I was just introduced to it. One of the things I was wondering, was how we can handle running commands similarly to nodejs in the package.json.</p>
<p dir="auto">So previously we could define, for example:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content=""build": "webpack .""><pre class="notranslate"><code class="notranslate">"build": "webpack ."
</code></pre></div>
<p dir="auto">Is there a way to do this in deno, otherwise, how should a development environment be done?</p> | <p dir="auto">Since it is not necessary to have <strong>package.json</strong> file with <strong>deno</strong>, how can I as a developer have a similar experience just as we have with <strong>npm scripts</strong> in <strong>package.json</strong> while using <strong>node.js</strong> environment?</p> | 1 |
<p dir="auto"><strong>Description</strong></p>
<p dir="auto">Let's assume I have two routes:</p>
<ul dir="auto">
<li><code class="notranslate">/notes</code></li>
<li><code class="notranslate">/users/{user_id}/notes</code></li>
</ul>
<p dir="auto">Both will return the same format of the response but the route prefixed by <code class="notranslate">/users/{user_id}</code> will be additionally filtering notes by specific <code class="notranslate">user_id</code>.</p>
<p dir="auto">I would like to not duplicate the logic unnecessarily and have something like function below to parse parameters:</p>
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="async def params(user_id: Optional[str] = Path(None)) -> Optional[str]:
return user_id
@api.get("/notes")
async def root_get(user_id: Optional[str] = Depends(params)):
pass
@api.get("/users/{user_id}/notes")
async def user_get(user_id: Optional[str] = Depends(params)):
pass"><pre class="notranslate"><span class="pl-k">async</span> <span class="pl-k">def</span> <span class="pl-en">params</span>(<span class="pl-s1">user_id</span>: <span class="pl-v">Optional</span>[<span class="pl-s1">str</span>] <span class="pl-c1">=</span> <span class="pl-v">Path</span>(<span class="pl-c1">None</span>)) <span class="pl-c1">-></span> <span class="pl-v">Optional</span>[<span class="pl-s1">str</span>]:
<span class="pl-k">return</span> <span class="pl-s1">user_id</span>
<span class="pl-en">@<span class="pl-s1">api</span>.<span class="pl-en">get</span>(<span class="pl-s">"/notes"</span>)</span>
<span class="pl-k">async</span> <span class="pl-k">def</span> <span class="pl-en">root_get</span>(<span class="pl-s1">user_id</span>: <span class="pl-v">Optional</span>[<span class="pl-s1">str</span>] <span class="pl-c1">=</span> <span class="pl-v">Depends</span>(<span class="pl-s1">params</span>)):
<span class="pl-k">pass</span>
<span class="pl-en">@<span class="pl-s1">api</span>.<span class="pl-en">get</span>(<span class="pl-s">"/users/{user_id}/notes"</span>)</span>
<span class="pl-k">async</span> <span class="pl-k">def</span> <span class="pl-en">user_get</span>(<span class="pl-s1">user_id</span>: <span class="pl-v">Optional</span>[<span class="pl-s1">str</span>] <span class="pl-c1">=</span> <span class="pl-v">Depends</span>(<span class="pl-s1">params</span>)):
<span class="pl-k">pass</span></pre></div>
<p dir="auto">However <code class="notranslate">Path</code> only accepts defined <code class="notranslate">str</code> and doesn't allow <code class="notranslate">None</code>.</p>
<p dir="auto">Is there any way to make path parameters optional?</p> | <p dir="auto">I would like to exclude the ValidationError model from the OpenAPI Schema because I have completely overwritten it like this</p>
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="from fastapi import FastAPI, Request
from fastapi.exceptions import RequestValidationError
from fastapi.responses import ORJSONResponse
from starlette.exceptions import HTTPException
app = FastAPI(default_response_class=ORJSONResponse)
def exception_handler(req: Request, err: Exception) -> ORJSONResponse:
# ...
app.add_exception_handler(HTTPException, exception_handler)
app.add_exception_handler(RequestValidationError, exception_handler)
app.add_exception_handler(Exception, exception_handler)
# ..."><pre class="notranslate"><span class="pl-k">from</span> <span class="pl-s1">fastapi</span> <span class="pl-k">import</span> <span class="pl-v">FastAPI</span>, <span class="pl-v">Request</span>
<span class="pl-k">from</span> <span class="pl-s1">fastapi</span>.<span class="pl-s1">exceptions</span> <span class="pl-k">import</span> <span class="pl-v">RequestValidationError</span>
<span class="pl-k">from</span> <span class="pl-s1">fastapi</span>.<span class="pl-s1">responses</span> <span class="pl-k">import</span> <span class="pl-v">ORJSONResponse</span>
<span class="pl-k">from</span> <span class="pl-s1">starlette</span>.<span class="pl-s1">exceptions</span> <span class="pl-k">import</span> <span class="pl-v">HTTPException</span>
<span class="pl-s1">app</span> <span class="pl-c1">=</span> <span class="pl-v">FastAPI</span>(<span class="pl-s1">default_response_class</span><span class="pl-c1">=</span><span class="pl-v">ORJSONResponse</span>)
<span class="pl-k">def</span> <span class="pl-en">exception_handler</span>(<span class="pl-s1">req</span>: <span class="pl-v">Request</span>, <span class="pl-s1">err</span>: <span class="pl-v">Exception</span>) <span class="pl-c1">-></span> <span class="pl-v">ORJSONResponse</span>:
<span class="pl-c"># ...</span>
<span class="pl-s1">app</span>.<span class="pl-en">add_exception_handler</span>(<span class="pl-v">HTTPException</span>, <span class="pl-s1">exception_handler</span>)
<span class="pl-s1">app</span>.<span class="pl-en">add_exception_handler</span>(<span class="pl-v">RequestValidationError</span>, <span class="pl-s1">exception_handler</span>)
<span class="pl-s1">app</span>.<span class="pl-en">add_exception_handler</span>(<span class="pl-v">Exception</span>, <span class="pl-s1">exception_handler</span>)
<span class="pl-c"># ...</span></pre></div>
<p dir="auto">and I can't find any current training without directly updating the JSON schema to do so.</p>
<p dir="auto">Is there any other way to exclude it?</p> | 0 |
<h3 dir="auto">Apache Airflow version</h3>
<p dir="auto">2.5.1</p>
<h3 dir="auto">What happened</h3>
<p dir="auto">After triggering any DAG and trying to open Calendar tab I see this:<br>
<a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/13131083/217962405-d82f6058-0799-468b-84a7-b519685c626a.png"><img src="https://user-images.githubusercontent.com/13131083/217962405-d82f6058-0799-468b-84a7-b519685c626a.png" alt="image" style="max-width: 100%;"></a></p>
<p dir="auto">Here is the logs:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="[2023-02-09T23:19:27.482+0000] {app.py:1741} ERROR - Exception on /dags/dtap_dag_with_bash/calendar [GET]
Traceback (most recent call last):
File "/home/airflow/.local/lib/python3.9/site-packages/flask/app.py", line 2525, in wsgi_app
response = self.full_dispatch_request()
File "/home/airflow/.local/lib/python3.9/site-packages/flask/app.py", line 1822, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/home/airflow/.local/lib/python3.9/site-packages/flask/app.py", line 1820, in full_dispatch_request
rv = self.dispatch_request()
File "/home/airflow/.local/lib/python3.9/site-packages/flask/app.py", line 1796, in dispatch_request
return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)
File "/home/airflow/.local/lib/python3.9/site-packages/airflow/www/auth.py", line 47, in decorated
return func(*args, **kwargs)
File "/home/airflow/.local/lib/python3.9/site-packages/airflow/www/decorators.py", line 166, in view_func
return f(*args, **kwargs)
File "/home/airflow/.local/lib/python3.9/site-packages/airflow/www/decorators.py", line 125, in wrapper
return f(*args, **kwargs)
File "/home/airflow/.local/lib/python3.9/site-packages/airflow/utils/session.py", line 75, in wrapper
return func(*args, session=session, **kwargs)
File "/home/airflow/.local/lib/python3.9/site-packages/airflow/www/views.py", line 2756, in calendar
if curr_info.logical_date <= prev_logical_date:
TypeError: can't compare offset-naive and offset-aware datetimes"><pre class="notranslate"><code class="notranslate">[2023-02-09T23:19:27.482+0000] {app.py:1741} ERROR - Exception on /dags/dtap_dag_with_bash/calendar [GET]
Traceback (most recent call last):
File "/home/airflow/.local/lib/python3.9/site-packages/flask/app.py", line 2525, in wsgi_app
response = self.full_dispatch_request()
File "/home/airflow/.local/lib/python3.9/site-packages/flask/app.py", line 1822, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/home/airflow/.local/lib/python3.9/site-packages/flask/app.py", line 1820, in full_dispatch_request
rv = self.dispatch_request()
File "/home/airflow/.local/lib/python3.9/site-packages/flask/app.py", line 1796, in dispatch_request
return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)
File "/home/airflow/.local/lib/python3.9/site-packages/airflow/www/auth.py", line 47, in decorated
return func(*args, **kwargs)
File "/home/airflow/.local/lib/python3.9/site-packages/airflow/www/decorators.py", line 166, in view_func
return f(*args, **kwargs)
File "/home/airflow/.local/lib/python3.9/site-packages/airflow/www/decorators.py", line 125, in wrapper
return f(*args, **kwargs)
File "/home/airflow/.local/lib/python3.9/site-packages/airflow/utils/session.py", line 75, in wrapper
return func(*args, session=session, **kwargs)
File "/home/airflow/.local/lib/python3.9/site-packages/airflow/www/views.py", line 2756, in calendar
if curr_info.logical_date <= prev_logical_date:
TypeError: can't compare offset-naive and offset-aware datetimes
</code></pre></div>
<h3 dir="auto">What you think should happen instead</h3>
<p dir="auto"><em>No response</em></p>
<h3 dir="auto">How to reproduce</h3>
<p dir="auto"><em>No response</em></p>
<h3 dir="auto">Operating System</h3>
<p dir="auto">Ubuntu 20.04.5</p>
<h3 dir="auto">Versions of Apache Airflow Providers</h3>
<p dir="auto"><em>No response</em></p>
<h3 dir="auto">Deployment</h3>
<p dir="auto">Other Docker-based deployment</p>
<h3 dir="auto">Deployment details</h3>
<p dir="auto"><em>No response</em></p>
<h3 dir="auto">Anything else</h3>
<p dir="auto"><em>No response</em></p>
<h3 dir="auto">Are you willing to submit PR?</h3>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> Yes I am willing to submit a PR!</li>
</ul>
<h3 dir="auto">Code of Conduct</h3>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I agree to follow this project's <a href="https://github.com/apache/airflow/blob/main/CODE_OF_CONDUCT.md">Code of Conduct</a></li>
</ul> | <h3 dir="auto">Apache Airflow version</h3>
<p dir="auto">2.5.1</p>
<h3 dir="auto">What happened</h3>
<p dir="auto">/calendar page give a problem, here is the capture</p>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/19165258/215369479-9fc7de5c-f190-460c-9cf7-9ab27d8ac355.png"><img src="https://user-images.githubusercontent.com/19165258/215369479-9fc7de5c-f190-460c-9cf7-9ab27d8ac355.png" alt="屏幕截图 2023-01-30 093116" style="max-width: 100%;"></a></p>
<h3 dir="auto">What you think should happen instead</h3>
<p dir="auto"><em>No response</em></p>
<h3 dir="auto">How to reproduce</h3>
<p dir="auto"><em>No response</em></p>
<h3 dir="auto">Operating System</h3>
<p dir="auto">Ubuntu 22.04.1 LTS</p>
<h3 dir="auto">Versions of Apache Airflow Providers</h3>
<p dir="auto">Distributor ID: Ubuntu<br>
Description: Ubuntu 22.04.1 LTS<br>
Release: 22.04<br>
Codename: jammy</p>
<h3 dir="auto">Deployment</h3>
<p dir="auto">Other</p>
<h3 dir="auto">Deployment details</h3>
<p dir="auto">Distributor ID: Ubuntu<br>
Description: Ubuntu 22.04.1 LTS<br>
Release: 22.04<br>
Codename: jammy</p>
<h3 dir="auto">Anything else</h3>
<p dir="auto"><em>No response</em></p>
<h3 dir="auto">Are you willing to submit PR?</h3>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> Yes I am willing to submit a PR!</li>
</ul>
<h3 dir="auto">Code of Conduct</h3>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I agree to follow this project's <a href="https://github.com/apache/airflow/blob/main/CODE_OF_CONDUCT.md">Code of Conduct</a></li>
</ul> | 1 |
<h3 dir="auto">Apache Airflow version</h3>
<p dir="auto">main (development)</p>
<h3 dir="auto">What happened</h3>
<p dir="auto">Variables with newlines in them are not always reproduced exactly as they are pasted into the web UI. Depending on how they are rendered, Unix newlines (<code class="notranslate">\n</code>) are silently converted to Windows newlines (<code class="notranslate">\r\n</code>) when rendered.</p>
<p dir="auto">Additionally, when users try to specify <code class="notranslate">\r</code> CR/"carriage return" in Python code, that gets rendered as a <code class="notranslate">\n</code> LF/"line feed" character.</p>
<p dir="auto">Tested on both astro and Airflow with Breeze.</p>
<h3 dir="auto">What you think should happen instead</h3>
<p dir="auto"><del>Unix newlines (<code class="notranslate">\n</code>) should always be rendered as Unix newlines (<code class="notranslate">\n</code>); Windows newlines (<code class="notranslate">\r\n</code>) should always be rendered as Windows newlines.</del> Not 100% sure anymore.</p>
<h3 dir="auto">How to reproduce</h3>
<p dir="auto">Steps to reproduce:</p>
<ol dir="auto">
<li>Spin up Airflow with Breeze (<code class="notranslate">breeze start-airflow</code>) - I tested with the PostgreSQL database backend</li>
<li>Install <code class="notranslate">dos2unix</code> within the Airflow container: <code class="notranslate">apt update; apt install --yes dos2unix</code></li>
<li>Create a Variable in the Airflow UI named <code class="notranslate">newlines</code>, and ensure that its content contains newlines. Note that the non-newline content doesn't really matter. I used:
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Line 1
Line 2
Line 3"><pre class="notranslate"><code class="notranslate">Line 1
Line 2
Line 3
</code></pre></div>
</li>
<li>Run this dag:
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="from datetime import datetime
from airflow import DAG
from airflow.operators.bash import BashOperator
from airflow.operators.smooth import SmoothOperator
with DAG("test_newlines", schedule=None) as dag:
test_bash_operator_multiline_env_var = BashOperator(
dag=dag,
task_id="test_bash_operator_multiline_env_var",
start_date=datetime.now(),
env={
"MULTILINE_ENV_VAR": """Line 1
Line 2
Line 3"""
},
append_env=True,
bash_command='''
if [[ "$(echo $MULTILINE_ENV_VAR)" != "$(echo $MULTILINE_ENV_VAR | dos2unix)" ]]; then
echo >&2 "Multiline environment variable contains newlines incorrectly converted to Windows CRLF"
exit 1
fi''',
)
test_bash_operator_heredoc_contains_newlines = BashOperator(
dag=dag,
task_id="test_bash_operator_heredoc_contains_newlines",
start_date=datetime.now(),
bash_command="""
diff <(
cat <<EOF
Line 1
Line 2
Line 3
EOF
) <(
cat <<EOF | dos2unix # Hat-tip: @potiuk
Line 1
Line 2
Line 3
EOF
) || {
echo >&2 "Bash heredoc contains newlines incorrectly converted to Windows CRLF"
exit 1
}
""",
)
test_bash_operator_env_var_from_variable_jinja_interpolation = BashOperator(
dag=dag,
task_id="test_bash_operator_env_var_from_variable_jinja_interpolation",
start_date=datetime.now(),
env={
"ENV_VAR_AIRFLOW_VARIABLE_WITH_NEWLINES": "{{ var.value['newlines'] }}",
},
append_env=True,
bash_command='''
diff <(echo "$ENV_VAR_AIRFLOW_VARIABLE_WITH_NEWLINES") <(echo "$ENV_VAR_AIRFLOW_VARIABLE_WITH_NEWLINES" | dos2unix) || {
echo >&2 "Environment variable contains newlines incorrectly converted to Windows CRLF"
exit 1
}
''',
)
test_bash_operator_from_variable_jinja_interpolation = BashOperator(
dag=dag,
task_id="test_bash_operator_from_variable_jinja_interpolation",
start_date=datetime.now(),
bash_command='''
diff <(echo "{{ var.value['newlines'] }}") <(echo "{{ var.value['newlines'] }}" | dos2unix) || {
echo >&2 "Jinja interpolated string contains newlines incorrectly converted to Windows CRLF"
exit 1
}
''',
)
test_bash_operator_backslash_n_not_equals_backslash_r = BashOperator(
dag=dag,
task_id="test_bash_operator_backslash_n_not_equals_backslash_r",
start_date=datetime.now(),
bash_command='''
if [[ "\r" == "\n" ]]; then
echo >&2 "Backslash-r has been incorrectly converted into backslash-n"
exit 1
fi''',
)
passing = SmoothOperator(dag=dag, task_id="passing", start_date=datetime.now())
failing = SmoothOperator(dag=dag, task_id="failing", start_date=datetime.now())
[
test_bash_operator_multiline_env_var,
test_bash_operator_heredoc_contains_newlines,
] >> passing
[
test_bash_operator_env_var_from_variable_jinja_interpolation,
test_bash_operator_from_variable_jinja_interpolation,
test_bash_operator_backslash_n_not_equals_backslash_r,
] >> failing"><pre class="notranslate"><span class="pl-k">from</span> <span class="pl-s1">datetime</span> <span class="pl-k">import</span> <span class="pl-s1">datetime</span>
<span class="pl-k">from</span> <span class="pl-s1">airflow</span> <span class="pl-k">import</span> <span class="pl-v">DAG</span>
<span class="pl-k">from</span> <span class="pl-s1">airflow</span>.<span class="pl-s1">operators</span>.<span class="pl-s1">bash</span> <span class="pl-k">import</span> <span class="pl-v">BashOperator</span>
<span class="pl-k">from</span> <span class="pl-s1">airflow</span>.<span class="pl-s1">operators</span>.<span class="pl-s1">smooth</span> <span class="pl-k">import</span> <span class="pl-v">SmoothOperator</span>
<span class="pl-k">with</span> <span class="pl-v">DAG</span>(<span class="pl-s">"test_newlines"</span>, <span class="pl-s1">schedule</span><span class="pl-c1">=</span><span class="pl-c1">None</span>) <span class="pl-k">as</span> <span class="pl-s1">dag</span>:
<span class="pl-s1">test_bash_operator_multiline_env_var</span> <span class="pl-c1">=</span> <span class="pl-v">BashOperator</span>(
<span class="pl-s1">dag</span><span class="pl-c1">=</span><span class="pl-s1">dag</span>,
<span class="pl-s1">task_id</span><span class="pl-c1">=</span><span class="pl-s">"test_bash_operator_multiline_env_var"</span>,
<span class="pl-s1">start_date</span><span class="pl-c1">=</span><span class="pl-s1">datetime</span>.<span class="pl-en">now</span>(),
<span class="pl-s1">env</span><span class="pl-c1">=</span>{
<span class="pl-s">"MULTILINE_ENV_VAR"</span>: <span class="pl-s">"""Line 1</span>
<span class="pl-s">Line 2</span>
<span class="pl-s">Line 3"""</span>
},
<span class="pl-s1">append_env</span><span class="pl-c1">=</span><span class="pl-c1">True</span>,
<span class="pl-s1">bash_command</span><span class="pl-c1">=</span><span class="pl-s">'''</span>
<span class="pl-s">if [[ "$(echo $MULTILINE_ENV_VAR)" != "$(echo $MULTILINE_ENV_VAR | dos2unix)" ]]; then</span>
<span class="pl-s"> echo >&2 "Multiline environment variable contains newlines incorrectly converted to Windows CRLF"</span>
<span class="pl-s"> exit 1</span>
<span class="pl-s">fi'''</span>,
)
<span class="pl-s1">test_bash_operator_heredoc_contains_newlines</span> <span class="pl-c1">=</span> <span class="pl-v">BashOperator</span>(
<span class="pl-s1">dag</span><span class="pl-c1">=</span><span class="pl-s1">dag</span>,
<span class="pl-s1">task_id</span><span class="pl-c1">=</span><span class="pl-s">"test_bash_operator_heredoc_contains_newlines"</span>,
<span class="pl-s1">start_date</span><span class="pl-c1">=</span><span class="pl-s1">datetime</span>.<span class="pl-en">now</span>(),
<span class="pl-s1">bash_command</span><span class="pl-c1">=</span><span class="pl-s">"""</span>
<span class="pl-s">diff <(</span>
<span class="pl-s">cat <<EOF</span>
<span class="pl-s">Line 1</span>
<span class="pl-s">Line 2</span>
<span class="pl-s">Line 3</span>
<span class="pl-s">EOF</span>
<span class="pl-s">) <(</span>
<span class="pl-s">cat <<EOF | dos2unix # Hat-tip: @potiuk</span>
<span class="pl-s">Line 1</span>
<span class="pl-s">Line 2</span>
<span class="pl-s">Line 3</span>
<span class="pl-s">EOF</span>
<span class="pl-s">) || {</span>
<span class="pl-s"> echo >&2 "Bash heredoc contains newlines incorrectly converted to Windows CRLF"</span>
<span class="pl-s"> exit 1</span>
<span class="pl-s">}</span>
<span class="pl-s">"""</span>,
)
<span class="pl-s1">test_bash_operator_env_var_from_variable_jinja_interpolation</span> <span class="pl-c1">=</span> <span class="pl-v">BashOperator</span>(
<span class="pl-s1">dag</span><span class="pl-c1">=</span><span class="pl-s1">dag</span>,
<span class="pl-s1">task_id</span><span class="pl-c1">=</span><span class="pl-s">"test_bash_operator_env_var_from_variable_jinja_interpolation"</span>,
<span class="pl-s1">start_date</span><span class="pl-c1">=</span><span class="pl-s1">datetime</span>.<span class="pl-en">now</span>(),
<span class="pl-s1">env</span><span class="pl-c1">=</span>{
<span class="pl-s">"ENV_VAR_AIRFLOW_VARIABLE_WITH_NEWLINES"</span>: <span class="pl-s">"{{ var.value['newlines'] }}"</span>,
},
<span class="pl-s1">append_env</span><span class="pl-c1">=</span><span class="pl-c1">True</span>,
<span class="pl-s1">bash_command</span><span class="pl-c1">=</span><span class="pl-s">'''</span>
<span class="pl-s">diff <(echo "$ENV_VAR_AIRFLOW_VARIABLE_WITH_NEWLINES") <(echo "$ENV_VAR_AIRFLOW_VARIABLE_WITH_NEWLINES" | dos2unix) || {</span>
<span class="pl-s"> echo >&2 "Environment variable contains newlines incorrectly converted to Windows CRLF"</span>
<span class="pl-s"> exit 1</span>
<span class="pl-s">}</span>
<span class="pl-s">'''</span>,
)
<span class="pl-s1">test_bash_operator_from_variable_jinja_interpolation</span> <span class="pl-c1">=</span> <span class="pl-v">BashOperator</span>(
<span class="pl-s1">dag</span><span class="pl-c1">=</span><span class="pl-s1">dag</span>,
<span class="pl-s1">task_id</span><span class="pl-c1">=</span><span class="pl-s">"test_bash_operator_from_variable_jinja_interpolation"</span>,
<span class="pl-s1">start_date</span><span class="pl-c1">=</span><span class="pl-s1">datetime</span>.<span class="pl-en">now</span>(),
<span class="pl-s1">bash_command</span><span class="pl-c1">=</span><span class="pl-s">'''</span>
<span class="pl-s">diff <(echo "{{ var.value['newlines'] }}") <(echo "{{ var.value['newlines'] }}" | dos2unix) || {</span>
<span class="pl-s"> echo >&2 "Jinja interpolated string contains newlines incorrectly converted to Windows CRLF"</span>
<span class="pl-s"> exit 1</span>
<span class="pl-s">}</span>
<span class="pl-s">'''</span>,
)
<span class="pl-s1">test_bash_operator_backslash_n_not_equals_backslash_r</span> <span class="pl-c1">=</span> <span class="pl-v">BashOperator</span>(
<span class="pl-s1">dag</span><span class="pl-c1">=</span><span class="pl-s1">dag</span>,
<span class="pl-s1">task_id</span><span class="pl-c1">=</span><span class="pl-s">"test_bash_operator_backslash_n_not_equals_backslash_r"</span>,
<span class="pl-s1">start_date</span><span class="pl-c1">=</span><span class="pl-s1">datetime</span>.<span class="pl-en">now</span>(),
<span class="pl-s1">bash_command</span><span class="pl-c1">=</span><span class="pl-s">'''</span>
<span class="pl-s">if [[ "<span class="pl-cce">\r</span>" == "<span class="pl-cce">\n</span>" ]]; then</span>
<span class="pl-s"> echo >&2 "Backslash-r has been incorrectly converted into backslash-n"</span>
<span class="pl-s"> exit 1</span>
<span class="pl-s">fi'''</span>,
)
<span class="pl-s1">passing</span> <span class="pl-c1">=</span> <span class="pl-v">SmoothOperator</span>(<span class="pl-s1">dag</span><span class="pl-c1">=</span><span class="pl-s1">dag</span>, <span class="pl-s1">task_id</span><span class="pl-c1">=</span><span class="pl-s">"passing"</span>, <span class="pl-s1">start_date</span><span class="pl-c1">=</span><span class="pl-s1">datetime</span>.<span class="pl-en">now</span>())
<span class="pl-s1">failing</span> <span class="pl-c1">=</span> <span class="pl-v">SmoothOperator</span>(<span class="pl-s1">dag</span><span class="pl-c1">=</span><span class="pl-s1">dag</span>, <span class="pl-s1">task_id</span><span class="pl-c1">=</span><span class="pl-s">"failing"</span>, <span class="pl-s1">start_date</span><span class="pl-c1">=</span><span class="pl-s1">datetime</span>.<span class="pl-en">now</span>())
[
<span class="pl-s1">test_bash_operator_multiline_env_var</span>,
<span class="pl-s1">test_bash_operator_heredoc_contains_newlines</span>,
] <span class="pl-c1">>></span> <span class="pl-s1">passing</span>
[
<span class="pl-s1">test_bash_operator_env_var_from_variable_jinja_interpolation</span>,
<span class="pl-s1">test_bash_operator_from_variable_jinja_interpolation</span>,
<span class="pl-s1">test_bash_operator_backslash_n_not_equals_backslash_r</span>,
] <span class="pl-c1">>></span> <span class="pl-s1">failing</span></pre></div>
</li>
</ol>
<p dir="auto"><del>Warning: The <code class="notranslate">test_bash_operator_heredoc_contains_newlines</code> may not actually ever complete in Breeze. It does complete successfully when using <code class="notranslate">astro</code>. That might be another bug.</del> <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/potiuk/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/potiuk">@potiuk</a>'s fix may have fixed this.</p>
<h3 dir="auto">Operating System</h3>
<p dir="auto">macOS 11.6.8 "Big Sur"</p>
<h3 dir="auto">Versions of Apache Airflow Providers</h3>
<p dir="auto"><em>No response</em></p>
<h3 dir="auto">Deployment</h3>
<p dir="auto">Astronomer</p>
<h3 dir="auto">Deployment details</h3>
<p dir="auto">Local breeze environment<br>
Local <code class="notranslate">astro</code> environment</p>
<h3 dir="auto">Anything else</h3>
<h3 dir="auto">Are you willing to submit PR?</h3>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> Yes I am willing to submit a PR!</li>
</ul>
<h3 dir="auto">Code of Conduct</h3>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I agree to follow this project's <a href="https://github.com/apache/airflow/blob/main/CODE_OF_CONDUCT.md">Code of Conduct</a></li>
</ul> | <p dir="auto"><strong>Description</strong></p>
<p dir="auto">The old documentation for <a href="https://cwiki.apache.org/confluence/pages/viewpage.action?pageId=62697734" rel="nofollow">Contributor's guide</a> should be reviewed and incorporated in <a href="https://github.com/apache/airflow/blob/master/CONTRIBUTING.rst">CONTRIBUTING.rst</a></p>
<p dir="auto"><strong>Use case / motivation</strong></p>
<p dir="auto">To remove documentation duplication and clean it up.</p>
<p dir="auto"><strong>Related Issues</strong></p>
<p dir="auto"><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="673709470" data-permission-text="Title is private" data-url="https://github.com/apache/airflow/issues/10178" data-hovercard-type="issue" data-hovercard-url="/apache/airflow/issues/10178/hovercard" href="https://github.com/apache/airflow/issues/10178">#10178</a></p> | 0 |
<h2 dir="auto">Problem Description</h2>
<p dir="auto"><a href="https://github.com/ffxsam/autocomplete-bug">https://github.com/ffxsam/autocomplete-bug</a></p>
<p dir="auto">There are multiple issues:</p>
<ol dir="auto">
<li><code class="notranslate">openOnFocus</code> does not work (clicking in the field has no effect)</li>
<li>When typing 'a' and clicking on an item that is outside the dialog, the event bubbles up and causes the dialog to close</li>
</ol>
<p dir="auto">Repo install instructions: (or just copy into a webpack boilerplate)</p>
<ol dir="auto">
<li><code class="notranslate">npm install</code></li>
<li>Install Meteor if not already installed (<code class="notranslate">curl https://install.meteor.com/ | sh</code>).</li>
<li><code class="notranslate">meteor</code></li>
</ol>
<h2 dir="auto">Versions</h2>
<ul dir="auto">
<li>Material-UI: 0.15.0-alpha.1</li>
<li>React: 0.14.7</li>
<li>Browser: Chrome 49</li>
</ul> | <p dir="auto">Greetings.</p>
<p dir="auto">On my react application, im using material-ui AutoComplete.</p>
<p dir="auto">Im using "showAllItems" version, that passes the property triggerUpdateOnFocus with true value, mounted on a dialog (from material-ui too)</p>
<p dir="auto">Whene I click inside the input, it shows the menu list, but it disappears instantly on mouse click up.<br>
I can state that if i click and leave mouse button down, that it does not disappear.</p>
<p dir="auto">Im using the last version of materail-ui and my browser is chrome.</p>
<p dir="auto">Best regards awatting for a feedback,<br>
Ricardo Ferreira</p> | 1 |
<p dir="auto">Hi,<br>
I have a suite of tests that takes ~3 minutes <strong>without</strong> using the awesome video feature and ~4+ minutes (133%) <strong>with</strong> the video feature.</p>
<p dir="auto">I looked at the logs and saw that each context closing takes few more seconds than without video.</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="2021-02-08T10:52:04.726Z pw:api => browserContext.close started
2021-02-08T10:52:15.962Z pw:api <= browserContext.close succeeded
Success notification after 11 seconds"><pre class="notranslate"><code class="notranslate">2021-02-08T10:52:04.726Z pw:api => browserContext.close started
2021-02-08T10:52:15.962Z pw:api <= browserContext.close succeeded
Success notification after 11 seconds
</code></pre></div>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="2021-02-08T10:51:11.580Z pw:api => browserContext.close started
2021-02-08T10:51:20.406Z pw:api <= browserContext.close succeeded
Success notification after 9 seconds"><pre class="notranslate"><code class="notranslate">2021-02-08T10:51:11.580Z pw:api => browserContext.close started
2021-02-08T10:51:20.406Z pw:api <= browserContext.close succeeded
Success notification after 9 seconds
</code></pre></div>
<p dir="auto">Is there a way to prevent this duration increase?</p> | <p dir="auto"><strong>Context:</strong></p>
<ul dir="auto">
<li>Playwright Version: ^1.8.0-next-1611032356000</li>
<li>Operating System: MacOS 10.15.7</li>
<li>Node.js version: v12.18.3</li>
<li>Browser: Chromium</li>
</ul>
<p dir="auto"><strong>Describe the bug</strong><br>
Hi, guys! I’ve added video recording to my tests as described in the documentation. Between tests I want to close all contexts except one, because I need sometimes 2, sometimes 1 context (I use approach 1 context = 1 page, because it’s easier to maintain for my application).</p>
<p dir="auto">So, the problem is: when I’m closing context after 2-contexts test I see:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content=" pw:api => browserContext.close started +1ms
pw:api <= browserContext.close succeeded +51s"><pre class="notranslate"><code class="notranslate"> pw:api => browserContext.close started +1ms
pw:api <= browserContext.close succeeded +51s
</code></pre></div>
<p dir="auto">It takes 50-60 seconds, so it's too long. I have a lot of such "switches".<br>
I can provide additional logs if you tell me what to do. Could you please help? Maybe I'm doing something wrong.</p>
<p dir="auto">Thanks in advance!</p>
<p dir="auto"><strong>Code Snippet</strong></p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="// how I create context and page
let parameters = {};
if (config.get('recordFailedTestVideo')) {
parameters = {
recordVideo: {
dir: config.get('videosDir'),
},
};
}
const ctx = await this._instance.newContext(parameters);
this._contexts.push({
ctx: ctx,
occupied: true,
});
const page = await ctx.newPage();
page.setDefaultTimeout(Timeouts.FifteenSecondsTimeout);
this._pages.push({
page: page,
occupied: true,
});
// how I close contexts
for (let i = 1; i < this._contexts.length; i++) {
await this._contexts[i].ctx.close(); // here is the problem
this._contexts.splice(i, 1);
this._pages.splice(i, 1);
}"><pre class="notranslate"><span class="pl-c">// how I create context and page</span>
<span class="pl-k">let</span> <span class="pl-s1">parameters</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span><span class="pl-kos">}</span><span class="pl-kos">;</span>
<span class="pl-k">if</span> <span class="pl-kos">(</span><span class="pl-s1">config</span><span class="pl-kos">.</span><span class="pl-en">get</span><span class="pl-kos">(</span><span class="pl-s">'recordFailedTestVideo'</span><span class="pl-kos">)</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
<span class="pl-s1">parameters</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span>
<span class="pl-c1">recordVideo</span>: <span class="pl-kos">{</span>
<span class="pl-c1">dir</span>: <span class="pl-s1">config</span><span class="pl-kos">.</span><span class="pl-en">get</span><span class="pl-kos">(</span><span class="pl-s">'videosDir'</span><span class="pl-kos">)</span><span class="pl-kos">,</span>
<span class="pl-kos">}</span><span class="pl-kos">,</span>
<span class="pl-kos">}</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span>
<span class="pl-k">const</span> <span class="pl-s1">ctx</span> <span class="pl-c1">=</span> <span class="pl-k">await</span> <span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">_instance</span><span class="pl-kos">.</span><span class="pl-en">newContext</span><span class="pl-kos">(</span><span class="pl-s1">parameters</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">_contexts</span><span class="pl-kos">.</span><span class="pl-en">push</span><span class="pl-kos">(</span><span class="pl-kos">{</span>
<span class="pl-c1">ctx</span>: <span class="pl-s1">ctx</span><span class="pl-kos">,</span>
<span class="pl-c1">occupied</span>: <span class="pl-c1">true</span><span class="pl-kos">,</span>
<span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-k">const</span> <span class="pl-s1">page</span> <span class="pl-c1">=</span> <span class="pl-k">await</span> <span class="pl-s1">ctx</span><span class="pl-kos">.</span><span class="pl-en">newPage</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-s1">page</span><span class="pl-kos">.</span><span class="pl-en">setDefaultTimeout</span><span class="pl-kos">(</span><span class="pl-v">Timeouts</span><span class="pl-kos">.</span><span class="pl-c1">FifteenSecondsTimeout</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">_pages</span><span class="pl-kos">.</span><span class="pl-en">push</span><span class="pl-kos">(</span><span class="pl-kos">{</span>
<span class="pl-c1">page</span>: <span class="pl-s1">page</span><span class="pl-kos">,</span>
<span class="pl-c1">occupied</span>: <span class="pl-c1">true</span><span class="pl-kos">,</span>
<span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-c">// how I close contexts</span>
<span class="pl-k">for</span> <span class="pl-kos">(</span><span class="pl-k">let</span> <span class="pl-s1">i</span> <span class="pl-c1">=</span> <span class="pl-c1">1</span><span class="pl-kos">;</span> <span class="pl-s1">i</span> <span class="pl-c1"><</span> <span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">_contexts</span><span class="pl-kos">.</span><span class="pl-c1">length</span><span class="pl-kos">;</span> <span class="pl-s1">i</span><span class="pl-c1">++</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
<span class="pl-k">await</span> <span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">_contexts</span><span class="pl-kos">[</span><span class="pl-s1">i</span><span class="pl-kos">]</span><span class="pl-kos">.</span><span class="pl-c1">ctx</span><span class="pl-kos">.</span><span class="pl-en">close</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-c">// here is the problem</span>
<span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">_contexts</span><span class="pl-kos">.</span><span class="pl-en">splice</span><span class="pl-kos">(</span><span class="pl-s1">i</span><span class="pl-kos">,</span> <span class="pl-c1">1</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">_pages</span><span class="pl-kos">.</span><span class="pl-en">splice</span><span class="pl-kos">(</span><span class="pl-s1">i</span><span class="pl-kos">,</span> <span class="pl-c1">1</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span></pre></div>
<p dir="auto"><strong>Update:</strong> here is repo to reproduce: <a href="https://github.com/viraxslot/close-context-problem.git">https://github.com/viraxslot/close-context-problem.git</a><br>
Hope it'll help.</p> | 1 |
<h2 dir="auto">Bug Report</h2>
<p dir="auto"><strong>Current Behavior</strong><br>
I am trying to use Babelify to compile my react app.js file in order to minify it for better efficiency on the web.</p>
<p dir="auto">I am trying to set my preset to @babel/preset-react in my package.json and my gulp.js file but I get an error.</p>
<h2 dir="auto"><strong>1.</strong></h2>
<p dir="auto">This happens with @babel/preset-react<br>
"SyntaxError: 'import' and 'export' may appear only with 'sourceType: module'"</p>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/15719274/61896398-e6d3e880-aee2-11e9-8120-e03971b8ce4f.png"><img width="1500" alt="Screen Shot 2019-07-25 at 1 01 12 PM" src="https://user-images.githubusercontent.com/15719274/61896398-e6d3e880-aee2-11e9-8120-e03971b8ce4f.png" style="max-width: 100%;"></a></p>
<hr>
<h2 dir="auto"><strong>2.</strong></h2>
<p dir="auto">This happens with @babel/preset-env</p>
<p dir="auto">"SyntaxError: /src/app.js: Unexpected token (17:4) </p><div dir="auto"> "<p dir="auto"></p>
<a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/15719274/61896448-023ef380-aee3-11e9-98f6-20d8c55c8882.png"><img width="1505" alt="Screen Shot 2019-07-25 at 1 00 38 PM" src="https://user-images.githubusercontent.com/15719274/61896448-023ef380-aee3-11e9-98f6-20d8c55c8882.png" style="max-width: 100%;"></a>
<p dir="auto"><strong>gulp.js</strong></p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="// require searches in the node modules folder,
//the exact require string comes from the package.json file
//the convention is identical for specifying by exact same name from package.json file
var gulp = require('gulp');
var rename = require('gulp-rename');
var sass = require('gulp-sass');
var uglify = require('gulp-uglify');
var autoprefixer = require('gulp-autoprefixer');
var sourcemaps = require('gulp-sourcemaps');
var browserify = require('browserify');
var babelify = require('babelify');
var source = require('vinyl-source-stream');
var buffer = require('vinyl-buffer');
//creating an instance of browserSync is required
var browserSync = require('browser-sync').create();
var reload = browserSync.reload;
// var htmlWatch = './index.html'
// watches all .html files vs just single file before
var htmlWatch = '**/*.html';
//watch php files
// locaiton of the src file or src of the css file
// remove ./ from source to allow gulp watch to watch new added files
var styleSRC = 'src/Assets/scss/style.scss';
// styleDIST is the whole folder adding the / at the end of string into the distribution folder (dist)
var styleDIST = './public/css/';
// watch variables
// doube star means every folder in subdirectory
//*.scss every file with that extension
var styleWatch = 'src/Assets/scss/**/*.scss';
// watches over all js files for changes
var jsWatch = 'src/**/*.js';
// javascript source file
var jsSRC = 'app.js';
//javascript source folder
var jsFolder = 'src/';
//javascript distribution folder
var jsDIST = './public/js/';
//array of all the files we want to check
var jsFILES = [jsSRC];
gulp.task('browser-sync', function(){
browserSync.init({
// do not open page automatically
open: false,
// everytime there is a change inject changes to localhost
injectChanges: true,
server: {
baseDir: "./"
}
// reflects local URL
// this is used for certificate files
//
// https:{
// key:'/Users/alecaddd/.valet/certificates/gulp.dev.key'
// cert:'/Users/alecaddd/.valet/Certificates/gulp.dev.crt'
// }
});
});
// https://stackoverflow.com/questions/36897877/gulp-error-the-following-tasks-did-not-complete-did-you-forget-to-signal-async
//task functions dont work without async, gulp does not support synchronous functions
gulp.task('style',async function(){
//compile
//pipe is one command after another,
gulp.src( styleSRC )
//sourcemaps is the first function for style
//
.pipe(sourcemaps.init())
//call sass right after the styleSRC(style.css) is called; automatically takes care of converting scss into regular css
.pipe(sass({
//specifics mentioned here
//if there is an error log it to the console
errorLogToConsole:true,
outputStyle:'compressed'
}))
//on an error log it to the console
.on('error',console.error.bind(console))
.pipe(autoprefixer({
browsers: ['last 2 versions'],
cascade: false
}))
// in order for rename to work we must import 'gulp-rename'
// rename completely or we can also add suffix
.pipe( rename({suffix: '.min'}))
//writing the sourcemap before saves into dest
.pipe(sourcemaps.write('./'))
// save the file into the styleDIST directory, with the min suffix file
.pipe( gulp.dest( styleDIST))
// export data into browserSync
.pipe(browserSync.stream());
});
gulp.task('js', async function(){
// map function loops through all items in array
//every time map iterates, entry will be the indexed file
jsFILES.map(function(entry){
// 1. browserify
// handles that modules, imports modules combines them, without dependency of external files
return browserify({
// specifically add jsFolder to concatinate
//entry only has script.js
//we dont want the js src folder to get duplicated, so we only process the entry = "script.js"
entries: [jsFolder + entry]
})
//2. babilify
// turns js into regular vanilla js readible by the browswer
// lots of different versions, default enviornmental version
// transforms all entries
.transform(babelify, {presets:['@babel/preset-env']})
// 3. bundle everything inside one single files
// bundle is default of gulp
.bundle()
// 4. tap the source
// source method to see if the entry is still piped, grab the entry after the bundling
// this is to keep track of the entry
.pipe( source(entry) )
// 5. rename .min
// rename with extension
.pipe( rename({extname: '.min.js'}))
// 6. buffer the file
.pipe( buffer() )
// 7. innit sourcemap
// load existing maps all into one package together
.pipe (sourcemaps.init({loadMaps:true}))
// 8. uglify
// identical to minifying entire file
.pipe( uglify())
// 9. write sourcemaps
.pipe(sourcemaps.write('./'))
// distribute
.pipe(gulp.dest(jsDIST))
// export data into browserSync
.pipe(browserSync.stream());
});
});
// default task, array of concatinated tasks
gulp.task('default', ['style','js']);
// activate default and then browser-sync tasks
gulp.task('watch',['default', 'browser-sync'], function(){
//after the trigger of the first watch
//trigger the gulp watch method which keeps it up and running, triggers itself whenever there is an update
//whenever there is a change, trigger the task
// no reload on style task because style changes will get injected inside the style task itself with browserify stream
gulp.watch(styleWatch, ['style']);
gulp.watch(jsWatch, ['js', reload]);
gulp.watch(htmlWatch, [reload]);
gulp.watch(phpWatch, [reload]);
// sometimes u dont want to reload when u are filling out a form etc.
})
"><pre class="notranslate"><span class="pl-c">// require searches in the node modules folder,</span>
<span class="pl-c">//the exact require string comes from the package.json file</span>
<span class="pl-c">//the convention is identical for specifying by exact same name from package.json file</span>
<span class="pl-k">var</span> <span class="pl-s1">gulp</span> <span class="pl-c1">=</span> <span class="pl-en">require</span><span class="pl-kos">(</span><span class="pl-s">'gulp'</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-k">var</span> <span class="pl-s1">rename</span> <span class="pl-c1">=</span> <span class="pl-en">require</span><span class="pl-kos">(</span><span class="pl-s">'gulp-rename'</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-k">var</span> <span class="pl-s1">sass</span> <span class="pl-c1">=</span> <span class="pl-en">require</span><span class="pl-kos">(</span><span class="pl-s">'gulp-sass'</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-k">var</span> <span class="pl-s1">uglify</span> <span class="pl-c1">=</span> <span class="pl-en">require</span><span class="pl-kos">(</span><span class="pl-s">'gulp-uglify'</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-k">var</span> <span class="pl-s1">autoprefixer</span> <span class="pl-c1">=</span> <span class="pl-en">require</span><span class="pl-kos">(</span><span class="pl-s">'gulp-autoprefixer'</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-k">var</span> <span class="pl-s1">sourcemaps</span> <span class="pl-c1">=</span> <span class="pl-en">require</span><span class="pl-kos">(</span><span class="pl-s">'gulp-sourcemaps'</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-k">var</span> <span class="pl-s1">browserify</span> <span class="pl-c1">=</span> <span class="pl-en">require</span><span class="pl-kos">(</span><span class="pl-s">'browserify'</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-k">var</span> <span class="pl-s1">babelify</span> <span class="pl-c1">=</span> <span class="pl-en">require</span><span class="pl-kos">(</span><span class="pl-s">'babelify'</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-k">var</span> <span class="pl-s1">source</span> <span class="pl-c1">=</span> <span class="pl-en">require</span><span class="pl-kos">(</span><span class="pl-s">'vinyl-source-stream'</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-k">var</span> <span class="pl-s1">buffer</span> <span class="pl-c1">=</span> <span class="pl-en">require</span><span class="pl-kos">(</span><span class="pl-s">'vinyl-buffer'</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-c">//creating an instance of browserSync is required</span>
<span class="pl-k">var</span> <span class="pl-s1">browserSync</span> <span class="pl-c1">=</span> <span class="pl-en">require</span><span class="pl-kos">(</span><span class="pl-s">'browser-sync'</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-en">create</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-k">var</span> <span class="pl-s1">reload</span> <span class="pl-c1">=</span> <span class="pl-s1">browserSync</span><span class="pl-kos">.</span><span class="pl-c1">reload</span><span class="pl-kos">;</span>
<span class="pl-c">// var htmlWatch = './index.html'</span>
<span class="pl-c">// watches all .html files vs just single file before</span>
<span class="pl-k">var</span> <span class="pl-s1">htmlWatch</span> <span class="pl-c1">=</span> <span class="pl-s">'**/*.html'</span><span class="pl-kos">;</span>
<span class="pl-c">//watch php files</span>
<span class="pl-c">// locaiton of the src file or src of the css file</span>
<span class="pl-c">// remove ./ from source to allow gulp watch to watch new added files</span>
<span class="pl-k">var</span> <span class="pl-s1">styleSRC</span> <span class="pl-c1">=</span> <span class="pl-s">'src/Assets/scss/style.scss'</span><span class="pl-kos">;</span>
<span class="pl-c">// styleDIST is the whole folder adding the / at the end of string into the distribution folder (dist)</span>
<span class="pl-k">var</span> <span class="pl-s1">styleDIST</span> <span class="pl-c1">=</span> <span class="pl-s">'./public/css/'</span><span class="pl-kos">;</span>
<span class="pl-c">// watch variables</span>
<span class="pl-c">// doube star means every folder in subdirectory</span>
<span class="pl-c">//*.scss every file with that extension</span>
<span class="pl-k">var</span> <span class="pl-s1">styleWatch</span> <span class="pl-c1">=</span> <span class="pl-s">'src/Assets/scss/**/*.scss'</span><span class="pl-kos">;</span>
<span class="pl-c">// watches over all js files for changes</span>
<span class="pl-k">var</span> <span class="pl-s1">jsWatch</span> <span class="pl-c1">=</span> <span class="pl-s">'src/**/*.js'</span><span class="pl-kos">;</span>
<span class="pl-c">// javascript source file</span>
<span class="pl-k">var</span> <span class="pl-s1">jsSRC</span> <span class="pl-c1">=</span> <span class="pl-s">'app.js'</span><span class="pl-kos">;</span>
<span class="pl-c">//javascript source folder</span>
<span class="pl-k">var</span> <span class="pl-s1">jsFolder</span> <span class="pl-c1">=</span> <span class="pl-s">'src/'</span><span class="pl-kos">;</span>
<span class="pl-c">//javascript distribution folder</span>
<span class="pl-k">var</span> <span class="pl-s1">jsDIST</span> <span class="pl-c1">=</span> <span class="pl-s">'./public/js/'</span><span class="pl-kos">;</span>
<span class="pl-c">//array of all the files we want to check</span>
<span class="pl-k">var</span> <span class="pl-s1">jsFILES</span> <span class="pl-c1">=</span> <span class="pl-kos">[</span><span class="pl-s1">jsSRC</span><span class="pl-kos">]</span><span class="pl-kos">;</span>
<span class="pl-s1">gulp</span><span class="pl-kos">.</span><span class="pl-en">task</span><span class="pl-kos">(</span><span class="pl-s">'browser-sync'</span><span class="pl-kos">,</span> <span class="pl-k">function</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">{</span>
<span class="pl-s1">browserSync</span><span class="pl-kos">.</span><span class="pl-en">init</span><span class="pl-kos">(</span><span class="pl-kos">{</span>
<span class="pl-c">// do not open page automatically</span>
<span class="pl-c1">open</span>: <span class="pl-c1">false</span><span class="pl-kos">,</span>
<span class="pl-c">// everytime there is a change inject changes to localhost</span>
<span class="pl-c1">injectChanges</span>: <span class="pl-c1">true</span><span class="pl-kos">,</span>
<span class="pl-c1">server</span>: <span class="pl-kos">{</span>
<span class="pl-c1">baseDir</span>: <span class="pl-s">"./"</span>
<span class="pl-kos">}</span>
<span class="pl-c">// reflects local URL</span>
<span class="pl-c">// this is used for certificate files</span>
<span class="pl-c">//</span>
<span class="pl-c">// https:{</span>
<span class="pl-c">// key:'/Users/alecaddd/.valet/certificates/gulp.dev.key'</span>
<span class="pl-c">// cert:'/Users/alecaddd/.valet/Certificates/gulp.dev.crt'</span>
<span class="pl-c">// }</span>
<span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-c">// https://stackoverflow.com/questions/36897877/gulp-error-the-following-tasks-did-not-complete-did-you-forget-to-signal-async</span>
<span class="pl-c">//task functions dont work without async, gulp does not support synchronous functions</span>
<span class="pl-s1">gulp</span><span class="pl-kos">.</span><span class="pl-en">task</span><span class="pl-kos">(</span><span class="pl-s">'style'</span><span class="pl-kos">,</span><span class="pl-k">async</span> <span class="pl-k">function</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">{</span>
<span class="pl-c">//compile</span>
<span class="pl-c">//pipe is one command after another,</span>
<span class="pl-s1">gulp</span><span class="pl-kos">.</span><span class="pl-en">src</span><span class="pl-kos">(</span> <span class="pl-s1">styleSRC</span> <span class="pl-kos">)</span>
<span class="pl-c">//sourcemaps is the first function for style</span>
<span class="pl-c">//</span>
<span class="pl-kos">.</span><span class="pl-en">pipe</span><span class="pl-kos">(</span><span class="pl-s1">sourcemaps</span><span class="pl-kos">.</span><span class="pl-en">init</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">)</span>
<span class="pl-c">//call sass right after the styleSRC(style.css) is called; automatically takes care of converting scss into regular css</span>
<span class="pl-kos">.</span><span class="pl-en">pipe</span><span class="pl-kos">(</span><span class="pl-s1">sass</span><span class="pl-kos">(</span><span class="pl-kos">{</span>
<span class="pl-c">//specifics mentioned here</span>
<span class="pl-c">//if there is an error log it to the console</span>
<span class="pl-c1">errorLogToConsole</span>:<span class="pl-c1">true</span><span class="pl-kos">,</span>
<span class="pl-c1">outputStyle</span>:<span class="pl-s">'compressed'</span>
<span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">)</span>
<span class="pl-c">//on an error log it to the console</span>
<span class="pl-kos">.</span><span class="pl-en">on</span><span class="pl-kos">(</span><span class="pl-s">'error'</span><span class="pl-kos">,</span><span class="pl-smi">console</span><span class="pl-kos">.</span><span class="pl-c1">error</span><span class="pl-kos">.</span><span class="pl-en">bind</span><span class="pl-kos">(</span><span class="pl-smi">console</span><span class="pl-kos">)</span><span class="pl-kos">)</span>
<span class="pl-kos">.</span><span class="pl-en">pipe</span><span class="pl-kos">(</span><span class="pl-s1">autoprefixer</span><span class="pl-kos">(</span><span class="pl-kos">{</span>
<span class="pl-c1">browsers</span>: <span class="pl-kos">[</span><span class="pl-s">'last 2 versions'</span><span class="pl-kos">]</span><span class="pl-kos">,</span>
<span class="pl-c1">cascade</span>: <span class="pl-c1">false</span>
<span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">)</span>
<span class="pl-c">// in order for rename to work we must import 'gulp-rename'</span>
<span class="pl-c">// rename completely or we can also add suffix</span>
<span class="pl-kos">.</span><span class="pl-en">pipe</span><span class="pl-kos">(</span> <span class="pl-s1">rename</span><span class="pl-kos">(</span><span class="pl-kos">{</span><span class="pl-c1">suffix</span>: <span class="pl-s">'.min'</span><span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">)</span>
<span class="pl-c">//writing the sourcemap before saves into dest</span>
<span class="pl-kos">.</span><span class="pl-en">pipe</span><span class="pl-kos">(</span><span class="pl-s1">sourcemaps</span><span class="pl-kos">.</span><span class="pl-en">write</span><span class="pl-kos">(</span><span class="pl-s">'./'</span><span class="pl-kos">)</span><span class="pl-kos">)</span>
<span class="pl-c">// save the file into the styleDIST directory, with the min suffix file</span>
<span class="pl-kos">.</span><span class="pl-en">pipe</span><span class="pl-kos">(</span> <span class="pl-s1">gulp</span><span class="pl-kos">.</span><span class="pl-en">dest</span><span class="pl-kos">(</span> <span class="pl-s1">styleDIST</span><span class="pl-kos">)</span><span class="pl-kos">)</span>
<span class="pl-c">// export data into browserSync</span>
<span class="pl-kos">.</span><span class="pl-en">pipe</span><span class="pl-kos">(</span><span class="pl-s1">browserSync</span><span class="pl-kos">.</span><span class="pl-en">stream</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-s1">gulp</span><span class="pl-kos">.</span><span class="pl-en">task</span><span class="pl-kos">(</span><span class="pl-s">'js'</span><span class="pl-kos">,</span> <span class="pl-k">async</span> <span class="pl-k">function</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">{</span>
<span class="pl-c">// map function loops through all items in array</span>
<span class="pl-c">//every time map iterates, entry will be the indexed file</span>
<span class="pl-s1">jsFILES</span><span class="pl-kos">.</span><span class="pl-en">map</span><span class="pl-kos">(</span><span class="pl-k">function</span><span class="pl-kos">(</span><span class="pl-s1">entry</span><span class="pl-kos">)</span><span class="pl-kos">{</span>
<span class="pl-c">// 1. browserify</span>
<span class="pl-c">// handles that modules, imports modules combines them, without dependency of external files</span>
<span class="pl-k">return</span> <span class="pl-s1">browserify</span><span class="pl-kos">(</span><span class="pl-kos">{</span>
<span class="pl-c">// specifically add jsFolder to concatinate</span>
<span class="pl-c">//entry only has script.js</span>
<span class="pl-c">//we dont want the js src folder to get duplicated, so we only process the entry = "script.js"</span>
<span class="pl-c1">entries</span>: <span class="pl-kos">[</span><span class="pl-s1">jsFolder</span> <span class="pl-c1">+</span> <span class="pl-s1">entry</span><span class="pl-kos">]</span>
<span class="pl-kos">}</span><span class="pl-kos">)</span>
<span class="pl-c">//2. babilify</span>
<span class="pl-c">// turns js into regular vanilla js readible by the browswer</span>
<span class="pl-c">// lots of different versions, default enviornmental version</span>
<span class="pl-c">// transforms all entries</span>
<span class="pl-kos">.</span><span class="pl-en">transform</span><span class="pl-kos">(</span><span class="pl-s1">babelify</span><span class="pl-kos">,</span> <span class="pl-kos">{</span><span class="pl-c1">presets</span>:<span class="pl-kos">[</span><span class="pl-s">'@babel/preset-env'</span><span class="pl-kos">]</span><span class="pl-kos">}</span><span class="pl-kos">)</span>
<span class="pl-c">// 3. bundle everything inside one single files</span>
<span class="pl-c">// bundle is default of gulp</span>
<span class="pl-kos">.</span><span class="pl-en">bundle</span><span class="pl-kos">(</span><span class="pl-kos">)</span>
<span class="pl-c">// 4. tap the source</span>
<span class="pl-c">// source method to see if the entry is still piped, grab the entry after the bundling</span>
<span class="pl-c">// this is to keep track of the entry</span>
<span class="pl-kos">.</span><span class="pl-en">pipe</span><span class="pl-kos">(</span> <span class="pl-s1">source</span><span class="pl-kos">(</span><span class="pl-s1">entry</span><span class="pl-kos">)</span> <span class="pl-kos">)</span>
<span class="pl-c">// 5. rename .min</span>
<span class="pl-c">// rename with extension</span>
<span class="pl-kos">.</span><span class="pl-en">pipe</span><span class="pl-kos">(</span> <span class="pl-s1">rename</span><span class="pl-kos">(</span><span class="pl-kos">{</span><span class="pl-c1">extname</span>: <span class="pl-s">'.min.js'</span><span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">)</span>
<span class="pl-c">// 6. buffer the file</span>
<span class="pl-kos">.</span><span class="pl-en">pipe</span><span class="pl-kos">(</span> <span class="pl-s1">buffer</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">)</span>
<span class="pl-c">// 7. innit sourcemap</span>
<span class="pl-c">// load existing maps all into one package together</span>
<span class="pl-kos">.</span><span class="pl-en">pipe</span> <span class="pl-kos">(</span><span class="pl-s1">sourcemaps</span><span class="pl-kos">.</span><span class="pl-en">init</span><span class="pl-kos">(</span><span class="pl-kos">{</span><span class="pl-c1">loadMaps</span>:<span class="pl-c1">true</span><span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">)</span>
<span class="pl-c">// 8. uglify</span>
<span class="pl-c">// identical to minifying entire file</span>
<span class="pl-kos">.</span><span class="pl-en">pipe</span><span class="pl-kos">(</span> <span class="pl-s1">uglify</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">)</span>
<span class="pl-c">// 9. write sourcemaps</span>
<span class="pl-kos">.</span><span class="pl-en">pipe</span><span class="pl-kos">(</span><span class="pl-s1">sourcemaps</span><span class="pl-kos">.</span><span class="pl-en">write</span><span class="pl-kos">(</span><span class="pl-s">'./'</span><span class="pl-kos">)</span><span class="pl-kos">)</span>
<span class="pl-c">// distribute</span>
<span class="pl-kos">.</span><span class="pl-en">pipe</span><span class="pl-kos">(</span><span class="pl-s1">gulp</span><span class="pl-kos">.</span><span class="pl-en">dest</span><span class="pl-kos">(</span><span class="pl-s1">jsDIST</span><span class="pl-kos">)</span><span class="pl-kos">)</span>
<span class="pl-c">// export data into browserSync</span>
<span class="pl-kos">.</span><span class="pl-en">pipe</span><span class="pl-kos">(</span><span class="pl-s1">browserSync</span><span class="pl-kos">.</span><span class="pl-en">stream</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-c">// default task, array of concatinated tasks</span>
<span class="pl-s1">gulp</span><span class="pl-kos">.</span><span class="pl-en">task</span><span class="pl-kos">(</span><span class="pl-s">'default'</span><span class="pl-kos">,</span> <span class="pl-kos">[</span><span class="pl-s">'style'</span><span class="pl-kos">,</span><span class="pl-s">'js'</span><span class="pl-kos">]</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-c">// activate default and then browser-sync tasks</span>
<span class="pl-s1">gulp</span><span class="pl-kos">.</span><span class="pl-en">task</span><span class="pl-kos">(</span><span class="pl-s">'watch'</span><span class="pl-kos">,</span><span class="pl-kos">[</span><span class="pl-s">'default'</span><span class="pl-kos">,</span> <span class="pl-s">'browser-sync'</span><span class="pl-kos">]</span><span class="pl-kos">,</span> <span class="pl-k">function</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">{</span>
<span class="pl-c">//after the trigger of the first watch</span>
<span class="pl-c">//trigger the gulp watch method which keeps it up and running, triggers itself whenever there is an update</span>
<span class="pl-c">//whenever there is a change, trigger the task</span>
<span class="pl-c">// no reload on style task because style changes will get injected inside the style task itself with browserify stream</span>
<span class="pl-s1">gulp</span><span class="pl-kos">.</span><span class="pl-en">watch</span><span class="pl-kos">(</span><span class="pl-s1">styleWatch</span><span class="pl-kos">,</span> <span class="pl-kos">[</span><span class="pl-s">'style'</span><span class="pl-kos">]</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-s1">gulp</span><span class="pl-kos">.</span><span class="pl-en">watch</span><span class="pl-kos">(</span><span class="pl-s1">jsWatch</span><span class="pl-kos">,</span> <span class="pl-kos">[</span><span class="pl-s">'js'</span><span class="pl-kos">,</span> <span class="pl-s1">reload</span><span class="pl-kos">]</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-s1">gulp</span><span class="pl-kos">.</span><span class="pl-en">watch</span><span class="pl-kos">(</span><span class="pl-s1">htmlWatch</span><span class="pl-kos">,</span> <span class="pl-kos">[</span><span class="pl-s1">reload</span><span class="pl-kos">]</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-s1">gulp</span><span class="pl-kos">.</span><span class="pl-en">watch</span><span class="pl-kos">(</span><span class="pl-s1">phpWatch</span><span class="pl-kos">,</span> <span class="pl-kos">[</span><span class="pl-s1">reload</span><span class="pl-kos">]</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-c">// sometimes u dont want to reload when u are filling out a form etc.</span>
<span class="pl-kos">}</span><span class="pl-kos">)</span></pre></div>
<p dir="auto"><strong>package.json</strong></p>
<div class="highlight highlight-source-json notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="{
"name": "my-app",
"version": "0.1.0",
"private": true,
"dependencies": {
"babel-core": "^6.26.3",
"react": "^16.8.6",
"react-dom": "^16.8.6",
"react-iframe": "^1.8.0",
"react-scripts": "3.0.1",
"reactify": "^1.1.1"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
},
"eslintConfig": {
"extends": "react-app"
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
},
"devDependencies": {
"@babel/preset-env": "^7.5.5",
"@babel/preset-react": "^7.0.0",
"babelify": "^10.0.0",
"browser-sync": "^2.26.7",
"browserify": "^16.3.0",
"gulp": "^3.9.1",
"gulp-autoprefixer": "^6.1.0",
"gulp-rename": "^1.4.0",
"gulp-sass": "^4.0.2",
"gulp-sourcemaps": "^2.6.5",
"gulp-uglify": "^3.0.2",
"vinyl-buffer": "^1.0.1",
"vinyl-source-stream": "^2.0.0"
},
"babel": {
"presets": [
"@babel/preset-env"
]
}
}
"><pre class="notranslate">{
<span class="pl-ent">"name"</span>: <span class="pl-s"><span class="pl-pds">"</span>my-app<span class="pl-pds">"</span></span>,
<span class="pl-ent">"version"</span>: <span class="pl-s"><span class="pl-pds">"</span>0.1.0<span class="pl-pds">"</span></span>,
<span class="pl-ent">"private"</span>: <span class="pl-c1">true</span>,
<span class="pl-ent">"dependencies"</span>: {
<span class="pl-ent">"babel-core"</span>: <span class="pl-s"><span class="pl-pds">"</span>^6.26.3<span class="pl-pds">"</span></span>,
<span class="pl-ent">"react"</span>: <span class="pl-s"><span class="pl-pds">"</span>^16.8.6<span class="pl-pds">"</span></span>,
<span class="pl-ent">"react-dom"</span>: <span class="pl-s"><span class="pl-pds">"</span>^16.8.6<span class="pl-pds">"</span></span>,
<span class="pl-ent">"react-iframe"</span>: <span class="pl-s"><span class="pl-pds">"</span>^1.8.0<span class="pl-pds">"</span></span>,
<span class="pl-ent">"react-scripts"</span>: <span class="pl-s"><span class="pl-pds">"</span>3.0.1<span class="pl-pds">"</span></span>,
<span class="pl-ent">"reactify"</span>: <span class="pl-s"><span class="pl-pds">"</span>^1.1.1<span class="pl-pds">"</span></span>
},
<span class="pl-ent">"scripts"</span>: {
<span class="pl-ent">"start"</span>: <span class="pl-s"><span class="pl-pds">"</span>react-scripts start<span class="pl-pds">"</span></span>,
<span class="pl-ent">"build"</span>: <span class="pl-s"><span class="pl-pds">"</span>react-scripts build<span class="pl-pds">"</span></span>,
<span class="pl-ent">"test"</span>: <span class="pl-s"><span class="pl-pds">"</span>react-scripts test<span class="pl-pds">"</span></span>,
<span class="pl-ent">"eject"</span>: <span class="pl-s"><span class="pl-pds">"</span>react-scripts eject<span class="pl-pds">"</span></span>
},
<span class="pl-ent">"eslintConfig"</span>: {
<span class="pl-ent">"extends"</span>: <span class="pl-s"><span class="pl-pds">"</span>react-app<span class="pl-pds">"</span></span>
},
<span class="pl-ent">"browserslist"</span>: {
<span class="pl-ent">"production"</span>: [
<span class="pl-s"><span class="pl-pds">"</span>>0.2%<span class="pl-pds">"</span></span>,
<span class="pl-s"><span class="pl-pds">"</span>not dead<span class="pl-pds">"</span></span>,
<span class="pl-s"><span class="pl-pds">"</span>not op_mini all<span class="pl-pds">"</span></span>
],
<span class="pl-ent">"development"</span>: [
<span class="pl-s"><span class="pl-pds">"</span>last 1 chrome version<span class="pl-pds">"</span></span>,
<span class="pl-s"><span class="pl-pds">"</span>last 1 firefox version<span class="pl-pds">"</span></span>,
<span class="pl-s"><span class="pl-pds">"</span>last 1 safari version<span class="pl-pds">"</span></span>
]
},
<span class="pl-ent">"devDependencies"</span>: {
<span class="pl-ent">"@babel/preset-env"</span>: <span class="pl-s"><span class="pl-pds">"</span>^7.5.5<span class="pl-pds">"</span></span>,
<span class="pl-ent">"@babel/preset-react"</span>: <span class="pl-s"><span class="pl-pds">"</span>^7.0.0<span class="pl-pds">"</span></span>,
<span class="pl-ent">"babelify"</span>: <span class="pl-s"><span class="pl-pds">"</span>^10.0.0<span class="pl-pds">"</span></span>,
<span class="pl-ent">"browser-sync"</span>: <span class="pl-s"><span class="pl-pds">"</span>^2.26.7<span class="pl-pds">"</span></span>,
<span class="pl-ent">"browserify"</span>: <span class="pl-s"><span class="pl-pds">"</span>^16.3.0<span class="pl-pds">"</span></span>,
<span class="pl-ent">"gulp"</span>: <span class="pl-s"><span class="pl-pds">"</span>^3.9.1<span class="pl-pds">"</span></span>,
<span class="pl-ent">"gulp-autoprefixer"</span>: <span class="pl-s"><span class="pl-pds">"</span>^6.1.0<span class="pl-pds">"</span></span>,
<span class="pl-ent">"gulp-rename"</span>: <span class="pl-s"><span class="pl-pds">"</span>^1.4.0<span class="pl-pds">"</span></span>,
<span class="pl-ent">"gulp-sass"</span>: <span class="pl-s"><span class="pl-pds">"</span>^4.0.2<span class="pl-pds">"</span></span>,
<span class="pl-ent">"gulp-sourcemaps"</span>: <span class="pl-s"><span class="pl-pds">"</span>^2.6.5<span class="pl-pds">"</span></span>,
<span class="pl-ent">"gulp-uglify"</span>: <span class="pl-s"><span class="pl-pds">"</span>^3.0.2<span class="pl-pds">"</span></span>,
<span class="pl-ent">"vinyl-buffer"</span>: <span class="pl-s"><span class="pl-pds">"</span>^1.0.1<span class="pl-pds">"</span></span>,
<span class="pl-ent">"vinyl-source-stream"</span>: <span class="pl-s"><span class="pl-pds">"</span>^2.0.0<span class="pl-pds">"</span></span>
},
<span class="pl-ent">"babel"</span>: {
<span class="pl-ent">"presets"</span>: [
<span class="pl-s"><span class="pl-pds">"</span>@babel/preset-env<span class="pl-pds">"</span></span>
]
}
}
</pre></div>
<p dir="auto"><strong>app.js</strong></p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="import React from 'react';
import arrowLeft from './Assets/media/pyara_Dictionary/extr/ARROW_LEFT_SELECTED.png'
import arrowRight from './Assets/media/pyara_Dictionary/extr/ARROW_RIGHT_SELECTED.png'
import dayaSelected from './Assets/media/pyara_Dictionary/pyara_list/DAYA_selected.png'
import dharam from './Assets/media/pyara_Dictionary/pyara_list/DHARAM.png'
import himmath from './Assets/media/pyara_Dictionary/pyara_list/HIMMATH.png'
import mokham from './Assets/media/pyara_Dictionary/pyara_list/MOKHAM.png'
import sahib from './Assets/media/pyara_Dictionary/pyara_list/SAHIB.png'
import Iframe from 'react-iframe';
function App() {
return (
<div className="row page_wrapper">
{/*<!-- BASE -->*/}
<div id="pyaraVideo_slider_wrapper">
<div className="wrapper">
<div className="carousel">
<div className="video-wrapper">
<Iframe url="https://player.vimeo.com/video/343270204?background=1&autoplay=1&loop=1&autopause=0"
className="iframe"
display="initial"
position="relative"
frameborder="0"
gesture="media"
allowfullscreen
height="100vh"
width="100vw"
allow="autoplay; fullscreen"
webkitallowfullscreen
mozallowfullscreen/>
<div className="video-wrapper">
<Iframe url="https://player.vimeo.com/video/343270367?background=1&autoplay=1&loop=1&autopause=0"
className="iframe"
display="initial"
position="relative"
frameborder="0"
gesture="media"
allowfullscreen
height="100vh"
width="100vw"
allow="autoplay; fullscreen"
webkitallowfullscreen
mozallowfullscreen/>
</div>
<div className="video-wrapper">
<Iframe url="https://player.vimeo.com/video/343284907?background=1&autoplay=1&loop=1&autopause=0"
className="iframe"
display="initial"
position="relative"
frameborder="0"
gesture="media"
allowfullscreen
height="100vh"
width="100vw"
allow="autoplay; fullscreen"
webkitallowfullscreen
mozallowfullscreen/>
</div>
</div>
</div>
</div>
{/*<!-- DETAIL
<div id="pyaraVideo_DETAIL_wrapper" className="row col-xl-4 col-lg-4 col-md-10 col-sm-10 col-xs-10">
<div id="DETAIL">
<iframe src="https://player.vimeo.com/video/343285037" width="100%" frameborder="0" allow="autoplay; fullscreen" allowfullscreen></iframe>
</div>
</div>
-->*/}
<div id="pyara_nav_english" className="row col-lg-9" >
<div id="PyaraPrev" >
<img className="img-fluid" src={arrowLeft}/>
</div>
<p>GENEROSITY</p>
<p>COMPASSION</p>
<p>EMPATHY</p>
<div id="PyaraNext">
<img className="img-fluid" src={arrowRight}/>
</div>
</div>
<div id="pyara_nav" className=" col-lg-9">
<div className="pyara1_daya active pyara">
<img className="img-fluid" src={dayaSelected}/>
</div>
<div className="pyara2_dharam pyara">
<img className="img-fluid" src={dharam}/>
</div>
<div className="pyara3_himmath pyara">
<img className="img-fluid" src={himmath}/>
</div>
<div className="pyara4_mokham pyara">
<img className="img-fluid" src={mokham}/>
</div>
<div className="pyara5_sahib pyara">
<img className="img-fluid" src={sahib}/>
</div>
</div>
<div id="explanation" className=" col-lg-9">
Panj Pyare are a Sikh philosophy of positive values in the community.
</div>
</div>
</div>
);
}
export default App;
"><pre class="notranslate"><span class="pl-k">import</span> <span class="pl-v">React</span> <span class="pl-k">from</span> <span class="pl-s">'react'</span><span class="pl-kos">;</span>
<span class="pl-k">import</span> <span class="pl-s1">arrowLeft</span> <span class="pl-k">from</span> <span class="pl-s">'./Assets/media/pyara_Dictionary/extr/ARROW_LEFT_SELECTED.png'</span>
<span class="pl-k">import</span> <span class="pl-s1">arrowRight</span> <span class="pl-k">from</span> <span class="pl-s">'./Assets/media/pyara_Dictionary/extr/ARROW_RIGHT_SELECTED.png'</span>
<span class="pl-k">import</span> <span class="pl-s1">dayaSelected</span> <span class="pl-k">from</span> <span class="pl-s">'./Assets/media/pyara_Dictionary/pyara_list/DAYA_selected.png'</span>
<span class="pl-k">import</span> <span class="pl-s1">dharam</span> <span class="pl-k">from</span> <span class="pl-s">'./Assets/media/pyara_Dictionary/pyara_list/DHARAM.png'</span>
<span class="pl-k">import</span> <span class="pl-s1">himmath</span> <span class="pl-k">from</span> <span class="pl-s">'./Assets/media/pyara_Dictionary/pyara_list/HIMMATH.png'</span>
<span class="pl-k">import</span> <span class="pl-s1">mokham</span> <span class="pl-k">from</span> <span class="pl-s">'./Assets/media/pyara_Dictionary/pyara_list/MOKHAM.png'</span>
<span class="pl-k">import</span> <span class="pl-s1">sahib</span> <span class="pl-k">from</span> <span class="pl-s">'./Assets/media/pyara_Dictionary/pyara_list/SAHIB.png'</span>
<span class="pl-k">import</span> <span class="pl-v">Iframe</span> <span class="pl-k">from</span> <span class="pl-s">'react-iframe'</span><span class="pl-kos">;</span>
<span class="pl-k">function</span> <span class="pl-v">App</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
<span class="pl-k">return</span> <span class="pl-kos">(</span>
<span class="pl-c1"><</span><span class="pl-ent">div</span> <span class="pl-c1">className</span><span class="pl-c1">=</span><span class="pl-s">"row page_wrapper"</span><span class="pl-c1">></span>
<span class="pl-kos">{</span><span class="pl-c">/*<!-- BASE -->*/</span><span class="pl-kos">}</span>
<span class="pl-c1"><</span><span class="pl-ent">div</span> <span class="pl-c1">id</span><span class="pl-c1">=</span><span class="pl-s">"pyaraVideo_slider_wrapper"</span><span class="pl-c1">></span>
<span class="pl-c1"><</span><span class="pl-ent">div</span> <span class="pl-c1">className</span><span class="pl-c1">=</span><span class="pl-s">"wrapper"</span><span class="pl-c1">></span>
<span class="pl-c1"><</span><span class="pl-ent">div</span> <span class="pl-c1">className</span><span class="pl-c1">=</span><span class="pl-s">"carousel"</span><span class="pl-c1">></span>
<span class="pl-c1"><</span><span class="pl-ent">div</span> <span class="pl-c1">className</span><span class="pl-c1">=</span><span class="pl-s">"video-wrapper"</span><span class="pl-c1">></span>
<span class="pl-c1"><</span><span class="pl-ent">Iframe</span> <span class="pl-c1">url</span><span class="pl-c1">=</span><span class="pl-s">"https://player.vimeo.com/video/343270204?background=1&autoplay=1&loop=1&autopause=0"</span>
<span class="pl-c1">className</span><span class="pl-c1">=</span><span class="pl-s">"iframe"</span>
<span class="pl-c1">display</span><span class="pl-c1">=</span><span class="pl-s">"initial"</span>
<span class="pl-c1">position</span><span class="pl-c1">=</span><span class="pl-s">"relative"</span>
<span class="pl-c1">frameborder</span><span class="pl-c1">=</span><span class="pl-s">"0"</span>
<span class="pl-c1">gesture</span><span class="pl-c1">=</span><span class="pl-s">"media"</span>
<span class="pl-c1">allowfullscreen</span>
<span class="pl-c1">height</span><span class="pl-c1">=</span><span class="pl-s">"100vh"</span>
<span class="pl-c1">width</span><span class="pl-c1">=</span><span class="pl-s">"100vw"</span>
<span class="pl-c1">allow</span><span class="pl-c1">=</span><span class="pl-s">"autoplay; fullscreen"</span>
<span class="pl-c1">webkitallowfullscreen</span>
<span class="pl-c1">mozallowfullscreen</span><span class="pl-c1">/</span><span class="pl-c1">></span>
<span class="pl-c1"><</span><span class="pl-ent">div</span> <span class="pl-c1">className</span><span class="pl-c1">=</span><span class="pl-s">"video-wrapper"</span><span class="pl-c1">></span>
<span class="pl-c1"><</span><span class="pl-ent">Iframe</span> <span class="pl-c1">url</span><span class="pl-c1">=</span><span class="pl-s">"https://player.vimeo.com/video/343270367?background=1&autoplay=1&loop=1&autopause=0"</span>
<span class="pl-c1">className</span><span class="pl-c1">=</span><span class="pl-s">"iframe"</span>
<span class="pl-c1">display</span><span class="pl-c1">=</span><span class="pl-s">"initial"</span>
<span class="pl-c1">position</span><span class="pl-c1">=</span><span class="pl-s">"relative"</span>
<span class="pl-c1">frameborder</span><span class="pl-c1">=</span><span class="pl-s">"0"</span>
<span class="pl-c1">gesture</span><span class="pl-c1">=</span><span class="pl-s">"media"</span>
<span class="pl-c1">allowfullscreen</span>
<span class="pl-c1">height</span><span class="pl-c1">=</span><span class="pl-s">"100vh"</span>
<span class="pl-c1">width</span><span class="pl-c1">=</span><span class="pl-s">"100vw"</span>
<span class="pl-c1">allow</span><span class="pl-c1">=</span><span class="pl-s">"autoplay; fullscreen"</span>
<span class="pl-c1">webkitallowfullscreen</span>
<span class="pl-c1">mozallowfullscreen</span><span class="pl-c1">/</span><span class="pl-c1">></span>
<span class="pl-c1"><</span><span class="pl-c1">/</span><span class="pl-ent">div</span><span class="pl-c1">></span>
<span class="pl-c1"><</span><span class="pl-ent">div</span> <span class="pl-c1">className</span><span class="pl-c1">=</span><span class="pl-s">"video-wrapper"</span><span class="pl-c1">></span>
<span class="pl-c1"><</span><span class="pl-ent">Iframe</span> <span class="pl-c1">url</span><span class="pl-c1">=</span><span class="pl-s">"https://player.vimeo.com/video/343284907?background=1&autoplay=1&loop=1&autopause=0"</span>
<span class="pl-c1">className</span><span class="pl-c1">=</span><span class="pl-s">"iframe"</span>
<span class="pl-c1">display</span><span class="pl-c1">=</span><span class="pl-s">"initial"</span>
<span class="pl-c1">position</span><span class="pl-c1">=</span><span class="pl-s">"relative"</span>
<span class="pl-c1">frameborder</span><span class="pl-c1">=</span><span class="pl-s">"0"</span>
<span class="pl-c1">gesture</span><span class="pl-c1">=</span><span class="pl-s">"media"</span>
<span class="pl-c1">allowfullscreen</span>
<span class="pl-c1">height</span><span class="pl-c1">=</span><span class="pl-s">"100vh"</span>
<span class="pl-c1">width</span><span class="pl-c1">=</span><span class="pl-s">"100vw"</span>
<span class="pl-c1">allow</span><span class="pl-c1">=</span><span class="pl-s">"autoplay; fullscreen"</span>
<span class="pl-c1">webkitallowfullscreen</span>
<span class="pl-c1">mozallowfullscreen</span><span class="pl-c1">/</span><span class="pl-c1">></span>
<span class="pl-c1"><</span><span class="pl-c1">/</span><span class="pl-ent">div</span><span class="pl-c1">></span>
<span class="pl-c1"><</span><span class="pl-c1">/</span><span class="pl-ent">div</span><span class="pl-c1">></span>
<span class="pl-c1"><</span><span class="pl-c1">/</span><span class="pl-ent">div</span><span class="pl-c1">></span>
<span class="pl-c1"><</span><span class="pl-c1">/</span><span class="pl-ent">div</span><span class="pl-c1">></span>
<span class="pl-kos">{</span><span class="pl-c">/*<!-- DETAIL</span>
<span class="pl-c"> <div id="pyaraVideo_DETAIL_wrapper" className="row col-xl-4 col-lg-4 col-md-10 col-sm-10 col-xs-10"></span>
<span class="pl-c"> <div id="DETAIL"></span>
<span class="pl-c"></span>
<span class="pl-c"> <iframe src="https://player.vimeo.com/video/343285037" width="100%" frameborder="0" allow="autoplay; fullscreen" allowfullscreen></iframe></span>
<span class="pl-c"></span>
<span class="pl-c"> </div></span>
<span class="pl-c"> </div></span>
<span class="pl-c"> -->*/</span><span class="pl-kos">}</span>
<span class="pl-c1"><</span><span class="pl-ent">div</span> <span class="pl-c1">id</span><span class="pl-c1">=</span><span class="pl-s">"pyara_nav_english"</span> <span class="pl-c1">className</span><span class="pl-c1">=</span><span class="pl-s">"row col-lg-9"</span> <span class="pl-c1">></span>
<span class="pl-c1"><</span><span class="pl-ent">div</span> <span class="pl-c1">id</span><span class="pl-c1">=</span><span class="pl-s">"PyaraPrev"</span> <span class="pl-c1">></span>
<span class="pl-c1"><</span><span class="pl-ent">img</span> <span class="pl-c1">className</span><span class="pl-c1">=</span><span class="pl-s">"img-fluid"</span> <span class="pl-c1">src</span><span class="pl-c1">=</span><span class="pl-kos">{</span><span class="pl-s1">arrowLeft</span><span class="pl-kos">}</span><span class="pl-c1">/</span><span class="pl-c1">></span>
<span class="pl-c1"><</span><span class="pl-c1">/</span><span class="pl-ent">div</span><span class="pl-c1">></span>
<span class="pl-c1"><</span><span class="pl-ent">p</span><span class="pl-c1">></span>GENEROSITY<span class="pl-c1"><</span><span class="pl-c1">/</span><span class="pl-ent">p</span><span class="pl-c1">></span>
<span class="pl-c1"><</span><span class="pl-ent">p</span><span class="pl-c1">></span>COMPASSION<span class="pl-c1"><</span><span class="pl-c1">/</span><span class="pl-ent">p</span><span class="pl-c1">></span>
<span class="pl-c1"><</span><span class="pl-ent">p</span><span class="pl-c1">></span>EMPATHY<span class="pl-c1"><</span><span class="pl-c1">/</span><span class="pl-ent">p</span><span class="pl-c1">></span>
<span class="pl-c1"><</span><span class="pl-ent">div</span> <span class="pl-c1">id</span><span class="pl-c1">=</span><span class="pl-s">"PyaraNext"</span><span class="pl-c1">></span>
<span class="pl-c1"><</span><span class="pl-ent">img</span> <span class="pl-c1">className</span><span class="pl-c1">=</span><span class="pl-s">"img-fluid"</span> <span class="pl-c1">src</span><span class="pl-c1">=</span><span class="pl-kos">{</span><span class="pl-s1">arrowRight</span><span class="pl-kos">}</span><span class="pl-c1">/</span><span class="pl-c1">></span>
<span class="pl-c1"><</span><span class="pl-c1">/</span><span class="pl-ent">div</span><span class="pl-c1">></span>
<span class="pl-c1"><</span><span class="pl-c1">/</span><span class="pl-ent">div</span><span class="pl-c1">></span>
<span class="pl-c1"><</span><span class="pl-ent">div</span> <span class="pl-c1">id</span><span class="pl-c1">=</span><span class="pl-s">"pyara_nav"</span> <span class="pl-c1">className</span><span class="pl-c1">=</span><span class="pl-s">" col-lg-9"</span><span class="pl-c1">></span>
<span class="pl-c1"><</span><span class="pl-ent">div</span> <span class="pl-c1">className</span><span class="pl-c1">=</span><span class="pl-s">"pyara1_daya active pyara"</span><span class="pl-c1">></span>
<span class="pl-c1"><</span><span class="pl-ent">img</span> <span class="pl-c1">className</span><span class="pl-c1">=</span><span class="pl-s">"img-fluid"</span> <span class="pl-c1">src</span><span class="pl-c1">=</span><span class="pl-kos">{</span><span class="pl-s1">dayaSelected</span><span class="pl-kos">}</span><span class="pl-c1">/</span><span class="pl-c1">></span>
<span class="pl-c1"><</span><span class="pl-c1">/</span><span class="pl-ent">div</span><span class="pl-c1">></span>
<span class="pl-c1"><</span><span class="pl-ent">div</span> <span class="pl-c1">className</span><span class="pl-c1">=</span><span class="pl-s">"pyara2_dharam pyara"</span><span class="pl-c1">></span>
<span class="pl-c1"><</span><span class="pl-ent">img</span> <span class="pl-c1">className</span><span class="pl-c1">=</span><span class="pl-s">"img-fluid"</span> <span class="pl-c1">src</span><span class="pl-c1">=</span><span class="pl-kos">{</span><span class="pl-s1">dharam</span><span class="pl-kos">}</span><span class="pl-c1">/</span><span class="pl-c1">></span>
<span class="pl-c1"><</span><span class="pl-c1">/</span><span class="pl-ent">div</span><span class="pl-c1">></span>
<span class="pl-c1"><</span><span class="pl-ent">div</span> <span class="pl-c1">className</span><span class="pl-c1">=</span><span class="pl-s">"pyara3_himmath pyara"</span><span class="pl-c1">></span>
<span class="pl-c1"><</span><span class="pl-ent">img</span> <span class="pl-c1">className</span><span class="pl-c1">=</span><span class="pl-s">"img-fluid"</span> <span class="pl-c1">src</span><span class="pl-c1">=</span><span class="pl-kos">{</span><span class="pl-s1">himmath</span><span class="pl-kos">}</span><span class="pl-c1">/</span><span class="pl-c1">></span>
<span class="pl-c1"><</span><span class="pl-c1">/</span><span class="pl-ent">div</span><span class="pl-c1">></span>
<span class="pl-c1"><</span><span class="pl-ent">div</span> <span class="pl-c1">className</span><span class="pl-c1">=</span><span class="pl-s">"pyara4_mokham pyara"</span><span class="pl-c1">></span>
<span class="pl-c1"><</span><span class="pl-ent">img</span> <span class="pl-c1">className</span><span class="pl-c1">=</span><span class="pl-s">"img-fluid"</span> <span class="pl-c1">src</span><span class="pl-c1">=</span><span class="pl-kos">{</span><span class="pl-s1">mokham</span><span class="pl-kos">}</span><span class="pl-c1">/</span><span class="pl-c1">></span>
<span class="pl-c1"><</span><span class="pl-c1">/</span><span class="pl-ent">div</span><span class="pl-c1">></span>
<span class="pl-c1"><</span><span class="pl-ent">div</span> <span class="pl-c1">className</span><span class="pl-c1">=</span><span class="pl-s">"pyara5_sahib pyara"</span><span class="pl-c1">></span>
<span class="pl-c1"><</span><span class="pl-ent">img</span> <span class="pl-c1">className</span><span class="pl-c1">=</span><span class="pl-s">"img-fluid"</span> <span class="pl-c1">src</span><span class="pl-c1">=</span><span class="pl-kos">{</span><span class="pl-s1">sahib</span><span class="pl-kos">}</span><span class="pl-c1">/</span><span class="pl-c1">></span>
<span class="pl-c1"><</span><span class="pl-c1">/</span><span class="pl-ent">div</span><span class="pl-c1">></span>
<span class="pl-c1"><</span><span class="pl-c1">/</span><span class="pl-ent">div</span><span class="pl-c1">></span>
<span class="pl-c1"><</span><span class="pl-ent">div</span> <span class="pl-c1">id</span><span class="pl-c1">=</span><span class="pl-s">"explanation"</span> <span class="pl-c1">className</span><span class="pl-c1">=</span><span class="pl-s">" col-lg-9"</span><span class="pl-c1">></span>
Panj Pyare are a Sikh philosophy of positive values in the community.
<span class="pl-c1"><</span><span class="pl-c1">/</span><span class="pl-ent">div</span><span class="pl-c1">></span>
<span class="pl-c1"><</span><span class="pl-c1">/</span><span class="pl-ent">div</span><span class="pl-c1">></span>
<span class="pl-c1"><</span><span class="pl-c1">/</span><span class="pl-ent">div</span><span class="pl-c1">></span>
<span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span>
<span class="pl-k">export</span> <span class="pl-k">default</span> <span class="pl-v">App</span><span class="pl-kos">;</span></pre></div>
<p dir="auto"><strong>Expected behavior/code</strong><br>
I expected the gulp file to compile properly and export a minfied javascript file that will be imported into my index.html file. This way the index will have an easier time processing the code.</p>
<p dir="auto">The gulp file should produce it in a folder, it works perfectly for my scss task in gulp but not js task.</p>
<p dir="auto"><strong>Babel Configuration (.babelrc, package.json, cli command)</strong><br>
,<br>
"babel": {<br>
"presets": [<br>
"@babel/preset-env"<br>
]<br>
}</p>
<p dir="auto"><strong>Environment</strong></p>
<ul dir="auto">
<li>
<p dir="auto">"gulp": "^3.9.1",</p>
</li>
<li>
<p dir="auto">Babel version(s): "@babel/preset-env": "^7.5.5",<br>
"@babel/preset-react": "^7.0.0",<br>
"babelify": "^10.0.0",<br>
"babel-core": "^6.26.3"</p>
</li>
<li>
<p dir="auto">Node/npm version: [6.9.0]</p>
</li>
<li>
<p dir="auto">OS: [OSX 10.13.4]</p>
</li>
<li>
<p dir="auto">How you are using Babel: [<code class="notranslate">cli</code>](not sure)</p>
</li>
</ul>
<p dir="auto"><strong>Possible Solution</strong><br>
I know the problem has something to do with the preset I am choosing, when I run npm start, my app loads properly and everything is linked.</p>
<p dir="auto">The only issue im having is compiling the js task in my gulp file which uses Babel, it breaks at the Babel step</p>
<p dir="auto"><strong>Additional context/Screenshots</strong><br>
Please some one help me with this I have spent 1 week so far trying to fix this and its a nightmare. Its the worst. I really just want to minify my js :( this hurts.</p></div> | <blockquote>
<p dir="auto">Issue originally made by <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/krainboltgreene/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/krainboltgreene">@krainboltgreene</a></p>
</blockquote>
<h3 dir="auto">Bug information</h3>
<ul dir="auto">
<li><strong>Babel version:</strong> 6.3.17</li>
<li><strong>Node version:</strong> 5.2.0</li>
<li><strong>npm version:</strong> 3.3.12</li>
</ul>
<h3 dir="auto">Description</h3>
<p dir="auto">I'm generating my code with <code class="notranslate">babel</code> and running with <code class="notranslate">node</code> everything is transformed correctly and the server runs. When I try to use <code class="notranslate">babel-node</code> it errors out with:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="$ ./node_modules/.bin/babel-node ./source/
/Users/krainboltgreene/Code/libmythoas/mythoas.js/source/index.js:1
import http from "http";
^^^^^^
SyntaxError: Unexpected token import
at exports.runInThisContext (vm.js:54:16)
at Module._compile (module.js:375:25)
at loader (/Users/krainboltgreene/Code/libmythoas/mythoas.js/node_modules/babel-cli/node_modules/babel-register/lib/node.js:130:5)
at Object.require.extensions.(anonymous function) [as .js] (/Users/krainboltgreene/Code/libmythoas/mythoas.js/node_modules/babel-cli/node_modules/babel-register/lib/node.js:140:7)
at Module.load (module.js:345:32)
at Function.Module._load (module.js:302:12)
at Function.Module.runMain (module.js:431:10)
at /Users/krainboltgreene/Code/libmythoas/mythoas.js/node_modules/babel-cli/lib/_babel-node.js:161:27
at Object.<anonymous> (/Users/krainboltgreene/Code/libmythoas/mythoas.js/node_modules/babel-cli/lib/_babel-node.js:162:7)
at Module._compile (module.js:399:26)"><pre class="notranslate"><code class="notranslate">$ ./node_modules/.bin/babel-node ./source/
/Users/krainboltgreene/Code/libmythoas/mythoas.js/source/index.js:1
import http from "http";
^^^^^^
SyntaxError: Unexpected token import
at exports.runInThisContext (vm.js:54:16)
at Module._compile (module.js:375:25)
at loader (/Users/krainboltgreene/Code/libmythoas/mythoas.js/node_modules/babel-cli/node_modules/babel-register/lib/node.js:130:5)
at Object.require.extensions.(anonymous function) [as .js] (/Users/krainboltgreene/Code/libmythoas/mythoas.js/node_modules/babel-cli/node_modules/babel-register/lib/node.js:140:7)
at Module.load (module.js:345:32)
at Function.Module._load (module.js:302:12)
at Function.Module.runMain (module.js:431:10)
at /Users/krainboltgreene/Code/libmythoas/mythoas.js/node_modules/babel-cli/lib/_babel-node.js:161:27
at Object.<anonymous> (/Users/krainboltgreene/Code/libmythoas/mythoas.js/node_modules/babel-cli/lib/_babel-node.js:162:7)
at Module._compile (module.js:399:26)
</code></pre></div>
<p dir="auto">This only makes sense if it's not looking at my <code class="notranslate">.babelrc</code>.</p> | 0 |
<p dir="auto">We ship two sets of wrappers for the Dierckx FITPACK library: the f2py wrappers,<code class="notranslate">dfitpack</code>, and handwritten <code class="notranslate">_fitpack</code> wrappers. The origin of duplication is long lost to history, likely traces all the way back to when <code class="notranslate">multipack</code> was a thing and numpy and scipy were not (for a historic archive of multipack, see <a href="https://github.com/matthew-brett/multipack">https://github.com/matthew-brett/multipack</a>).<br>
I'd actually be interested in hearing the story behind this.</p>
<p dir="auto">Both these sets of wrappers wrap the same fortran routines, but have somewhat differing defaults and conventions. Also over time some bug fixes were applied in one set of wrappers but not the other etc. <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="13650375" data-permission-text="Title is private" data-url="https://github.com/scipy/scipy/issues/1408" data-hovercard-type="issue" data-hovercard-url="/scipy/scipy/issues/1408/hovercard" href="https://github.com/scipy/scipy/issues/1408">#1408</a> suggests to get rid of <code class="notranslate">_fitpack</code> in favor of <code class="notranslate">dfitpack</code>. I'm not sure it's really possibly to <em>get rid</em> of it, but at least some deduplication would be a nice housekeeping. This issue is mainly to keep track of this housekeeping, without much urgency and without timing guarantees.</p>
<p dir="auto">To a first approximation, <code class="notranslate">dfitpack</code> wrappers are used by the OOP interface, <code class="notranslate">*UnivariateSpline</code> and relatives;<br>
<code class="notranslate">_fitpack</code> is used by <code class="notranslate">splXXX</code> routines. But do see below for details.</p>
<p dir="auto">First, where is what. <code class="notranslate">dfitpack</code> wrappers are in generated by <a href="https://github.com/scipy/scipy/blob/main/scipy/interpolate/src/fitpack.pyf">https://github.com/scipy/scipy/blob/main/scipy/interpolate/src/fitpack.pyf</a>, python-level code which ends up in the top level namespace is in <code class="notranslate">_fitpack2.py</code>.<br>
<code class="notranslate">_fitpack</code> wrappers are in <a href="https://github.com/scipy/scipy/blob/main/scipy/interpolate/src/_fitpackmodule.c">https://github.com/scipy/scipy/blob/main/scipy/interpolate/src/_fitpackmodule.c</a>. The route to the top-level namespace is a bit convoluted: <code class="notranslate">splev</code> and related names are imported from <code class="notranslate">_fitpack_py.py</code>; this module is a thin layer which does essentially</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content=" if isinstance(tck, BSpline):
# dispatch to BSpline methods
else:
# dispatch to _fitpack_impl"><pre class="notranslate"><code class="notranslate"> if isinstance(tck, BSpline):
# dispatch to BSpline methods
else:
# dispatch to _fitpack_impl
</code></pre></div>
<p dir="auto">and <code class="notranslate">_fitpack_impl.py</code> is the python layer on top of the <code class="notranslate">_fitpack</code> extension.</p>
<p dir="auto">Now, which wrappers are used where. Grepping <code class="notranslate">_fitpack2.py</code> shows these routines:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="fitpack2
========
from dfitpack
-------------
routine used by
- dfitpack.fpcurf0 -- `UnivariateSpline.__init__`, `InterpolatedUnivariateSpline`
- dfitpack.fpcurf1 -- UnivariateSpline._reset_nest (`__init__`, `_set_smoothing_factor`)
- dfitpack.fpcurfm1 -- `LSQUnivariateSpline.__init__`
- dfitpack.splint -- `UnivariateSpline.integral`
- dfitpack.spalde -- `UnivariateSpline.derivatives`
- dfitpack.sproot -- `UnivariateSpline.roots`
- dfitpack.fpchec -- `LSQUnivariateSpline.__init__`
- dfitpack.parder -- `_BivariateSplineBase.__call__`
- dfitpack.bispev -- `_BivariateSplineBase.__call__`
- dfitpack.pardeu -- `_BivariateSplineBase.__call__`
- dfitpack.bispeu -- `_BivariateSplineBase.__call__`
- dfitpack.pardtc -- `_BivariateSplineBase.partial_derivative__`
- dfitpack.dblint -- `_BivariateSpline.integral`
- dfitpack.surfit_smth -- `SmoothBivariateSpline.__init__`
- dfitpack.surfit_lsq -- `LSQBivariateSpline.__init__`
- dfitpack.regrid_smth -- `RectBivariateSpline.__init__`
- dfitpack.spherefit_smth -- `SmoothSphereBivariateSpline.__init__`
- dfitpack.spherefit_lsq -- `LSQSphereBivariateSpline.__init__`
- dfitpack.regrid_smth_spher -- `RectSphereBivariateSpline.__init__`
from _fitpack_py
----------------
- _fitpack.splev -- `UnivariateSpline.__call__` -- via _fitpack_py.splev -- _fitpack_impl.splev
- splder -- `UnivariateSpline.derivative` --- _fitpack_impl.splder : this is pure python, *not* fitpack.splder!
- splantider -- `UnivariateSpline.antiferivative` --- _fitpack_impl.splantider : this is pure python, too"><pre class="notranslate"><code class="notranslate">fitpack2
========
from dfitpack
-------------
routine used by
- dfitpack.fpcurf0 -- `UnivariateSpline.__init__`, `InterpolatedUnivariateSpline`
- dfitpack.fpcurf1 -- UnivariateSpline._reset_nest (`__init__`, `_set_smoothing_factor`)
- dfitpack.fpcurfm1 -- `LSQUnivariateSpline.__init__`
- dfitpack.splint -- `UnivariateSpline.integral`
- dfitpack.spalde -- `UnivariateSpline.derivatives`
- dfitpack.sproot -- `UnivariateSpline.roots`
- dfitpack.fpchec -- `LSQUnivariateSpline.__init__`
- dfitpack.parder -- `_BivariateSplineBase.__call__`
- dfitpack.bispev -- `_BivariateSplineBase.__call__`
- dfitpack.pardeu -- `_BivariateSplineBase.__call__`
- dfitpack.bispeu -- `_BivariateSplineBase.__call__`
- dfitpack.pardtc -- `_BivariateSplineBase.partial_derivative__`
- dfitpack.dblint -- `_BivariateSpline.integral`
- dfitpack.surfit_smth -- `SmoothBivariateSpline.__init__`
- dfitpack.surfit_lsq -- `LSQBivariateSpline.__init__`
- dfitpack.regrid_smth -- `RectBivariateSpline.__init__`
- dfitpack.spherefit_smth -- `SmoothSphereBivariateSpline.__init__`
- dfitpack.spherefit_lsq -- `LSQSphereBivariateSpline.__init__`
- dfitpack.regrid_smth_spher -- `RectSphereBivariateSpline.__init__`
from _fitpack_py
----------------
- _fitpack.splev -- `UnivariateSpline.__call__` -- via _fitpack_py.splev -- _fitpack_impl.splev
- splder -- `UnivariateSpline.derivative` --- _fitpack_impl.splder : this is pure python, *not* fitpack.splder!
- splantider -- `UnivariateSpline.antiferivative` --- _fitpack_impl.splantider : this is pure python, too
</code></pre></div>
<p dir="auto">Note that the UnivariateSpline evaluation goes through <code class="notranslate">_fitpack</code> not <code class="notranslate">dfitpack</code>!</p>
<p dir="auto">Grepping <code class="notranslate">_fitpack_impl.py</code> shows these:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="_fitpack_impl
=============
from dftipack
-------------
- dfitpack.curfit -- `splrep` # do note that curfit.f calls fpcurf, which is wrapped separately for UnivariateSpline
- dfitpack.percur -- `splrep`
- dfitpack.dblint -- `dblint`
from _fitpack
-------------
- _fitpack.parcur -- `splPrep`
- _fitpack._spl_ -- `splev`
- _fitpack._splint -- `splint`
- _fitpack._sproot -- `sproot`
- _fitpack._spalde -- `spalde`
- _fitpack._surfit -- `bisplrep`
- _fitpack._bispev -- `bisplev`
- _fitpack._insert -- `insert`"><pre class="notranslate"><code class="notranslate">_fitpack_impl
=============
from dftipack
-------------
- dfitpack.curfit -- `splrep` # do note that curfit.f calls fpcurf, which is wrapped separately for UnivariateSpline
- dfitpack.percur -- `splrep`
- dfitpack.dblint -- `dblint`
from _fitpack
-------------
- _fitpack.parcur -- `splPrep`
- _fitpack._spl_ -- `splev`
- _fitpack._splint -- `splint`
- _fitpack._sproot -- `sproot`
- _fitpack._spalde -- `spalde`
- _fitpack._surfit -- `bisplrep`
- _fitpack._bispev -- `bisplev`
- _fitpack._insert -- `insert`
</code></pre></div>
<p dir="auto">So, what can be deduplicated. First candidates are <code class="notranslate">splint</code>, <code class="notranslate">sproot</code> and <code class="notranslate">spalde</code>. <code class="notranslate">_fitpack._spl_</code> is used in both OOP and functional interfaces (which means that <code class="notranslate">dfitpack.splev</code> and <code class="notranslate">dfitpack.splder</code> are not used and not tested --- the swich between splder and splev can be done on the python side I think). Spline construction <code class="notranslate">_fitpack.parcur</code> can probably be replaced by <code class="notranslate">dftipack.parcur</code> but the latter is untested. <code class="notranslate">_fitpack.insert</code> is a curious beast which contains a non-trivial dance with a temporary storage, not sure how to replcate that with f2py.</p>
<p dir="auto">Things to watch out for when/if deduplicating:</p>
<ul dir="auto">
<li>f2py interface insists that <code class="notranslate">len(c) == len(t)</code> : this is not always guaranteed I think, <code class="notranslate">_fitpack</code> allows <code class="notranslate">len(c) == len(t) - k - 1</code> and ignores trailing elements in <code class="notranslate">c</code>. This restriction should probably be relaxed to <code class="notranslate">len(c) >= len(t) - k - 1</code>.</li>
<li>does f2py allow/undestand non-contiguous arrays, does it copy if not contiguous or it needs to be checked on the python side?</li>
<li>need to carefully check for default values (e.g. the default for <code class="notranslate">s</code> is different IIRC).</li>
</ul> | <p dir="auto">Is it on purpose that these lines are duplicates? If so, a comment to explain why would be welcome.</p>
<ul dir="auto">
<li><a href="https://github.com/scipy/scipy/blob/v0.14.0/scipy/stats/stats.py#L3873">https://github.com/scipy/scipy/blob/v0.14.0/scipy/stats/stats.py#L3873</a></li>
<li><a href="https://github.com/scipy/scipy/blob/v0.14.0/scipy/stats/stats.py#L3875">https://github.com/scipy/scipy/blob/v0.14.0/scipy/stats/stats.py#L3875</a></li>
</ul> | 0 |
<p dir="auto">I have a simple Angular2 Application, which contains <code class="notranslate">App</code>, <code class="notranslate">P1</code>, <code class="notranslate">P2</code>, <code class="notranslate">Child</code> in total 4 components, where <code class="notranslate">App</code> uses <code class="notranslate">P1</code> and <code class="notranslate">P2</code>, and both <code class="notranslate">P1</code> and <code class="notranslate">P2</code> uses <code class="notranslate">Child</code>.</p>
<p dir="auto">Here is the code:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="@Component({
selector: 'child',
template: '<div> child <div>',
})
export class ChildCmp {}
@Component({
selector: 'p1',
template: '<div> P1: <child></child></div>',
directives:[ChildCmp],
})
export class P1Cmp {}
@Component({
selector: 'p2',
template: '<div> P2: <child></child><child></child></div>',
directives:[ChildCmp],
})
export class P2Cmp {}
@Component({
selector: 'my-test',
template: '<p1></p1><p2></p2>',
directives:[P1Cmp, P2Cmp],
})
export class TestApp {}
bootstrap(TestApp);"><pre class="notranslate"><code class="notranslate">@Component({
selector: 'child',
template: '<div> child <div>',
})
export class ChildCmp {}
@Component({
selector: 'p1',
template: '<div> P1: <child></child></div>',
directives:[ChildCmp],
})
export class P1Cmp {}
@Component({
selector: 'p2',
template: '<div> P2: <child></child><child></child></div>',
directives:[ChildCmp],
})
export class P2Cmp {}
@Component({
selector: 'my-test',
template: '<p1></p1><p2></p2>',
directives:[P1Cmp, P2Cmp],
})
export class TestApp {}
bootstrap(TestApp);
</code></pre></div>
<p dir="auto">The <strong>index.html</strong> to trigger the app is plain <code class="notranslate"><my-test></my-test></code> with all required libs of Angular2.</p>
<p dir="auto">You can check the demo in <a href="http://plnkr.co/edit/Kir7QmwhSsIuAU5IrnMh?p=info" rel="nofollow">Plunker</a>, console log shows</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="EXCEPTION: TypeError: viewFactory_ChildCmp0 is not a function"><pre class="notranslate"><code class="notranslate">EXCEPTION: TypeError: viewFactory_ChildCmp0 is not a function
</code></pre></div>
<p dir="auto">Why it breaks?</p>
<p dir="auto">This only happen when I put the <code class="notranslate">Child</code> into the both <code class="notranslate">P1</code> and <code class="notranslate">P2</code>, where they are in the same parent component.</p>
<p dir="auto">I think it is normal for developer to buildup some reusable component like <code class="notranslate">child</code> then use it all around?</p>
<p dir="auto">The Angular version is beta.01 and I tried this in Chrome and Firefox in both Ubuntu and Mac.</p> | <p dir="auto">While updating to beta.1, I encountered an error with nested components. Depending on the order I use the components, it fails unexpectedly with the following error:</p>
<p dir="auto">EXCEPTION: TypeError: viewFactory_BlueBox0 is not a function.</p>
<p dir="auto">This may be related to the change in <a class="commit-link" data-hovercard-type="commit" data-hovercard-url="https://github.com/angular/angular/commit/7ae23ad/hovercard" href="https://github.com/angular/angular/commit/7ae23ad"><tt>7ae23ad</tt></a></p>
<p dir="auto">I reproduced the error in this plunkr:<br>
<a href="http://plnkr.co/edit/8Zl0JdbV5fuBMxDqcg1L?p=preview" rel="nofollow">http://plnkr.co/edit/8Zl0JdbV5fuBMxDqcg1L?p=preview</a></p> | 1 |
<p dir="auto">while running the code in examples/webpack-example at 0ae4d7f</p>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://cloud.githubusercontent.com/assets/105653/12114556/c322ed38-b3e5-11e5-90f0-da7ca3856b8f.png"><img src="https://cloud.githubusercontent.com/assets/105653/12114556/c322ed38-b3e5-11e5-90f0-da7ca3856b8f.png" alt="screen shot 2016-01-05 at 7 51 18 pm" style="max-width: 100%;"></a></p> | <p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://cloud.githubusercontent.com/assets/590985/12066654/6944ba18-affc-11e5-9463-bd6b0168c7e2.png"><img src="https://cloud.githubusercontent.com/assets/590985/12066654/6944ba18-affc-11e5-9463-bd6b0168c7e2.png" alt="image" style="max-width: 100%;"></a></p>
<p dir="auto">webpack-example has bug</p> | 1 |
<p dir="auto">I'm using Symfony 3.0.2 with:<br>
nginx version: nginx/1.4.6 (Ubuntu)<br>
php version: 7.0.3-4+deb.sury.org~trusty+1</p>
<p dir="auto">Everything works fine except when I try to enter the Symfony profiler where I get the following message:</p>
<blockquote>
<p dir="auto">Warning: session_write_close(): Failed to write session data (user). Please verify that the current setting of session.save_path is correct (/var/www/Symfony/app/../var/sessions/dev)</p>
</blockquote>
<p dir="auto">After that I get this error on every page. To be able to see regular pages again I just need to delete session cookie from my browser. But again, it works fine till I try to enter the Symfony profiler.</p>
<p dir="auto">This error occurs only when I add to nginx config file this line:</p>
<blockquote>
<p dir="auto">fastcgi_pass unix:/var/run/php/php7.0-fpm.sock;</p>
</blockquote>
<p dir="auto">However, when using php5 by adding the following line everything works fine:</p>
<blockquote>
<p dir="auto">fastcgi_pass unix:/var/run/php5-fpm.sock;</p>
</blockquote>
<p dir="auto">BTW. I have another project which is build on Symfony 3.0.1, and there is no such a problem.</p> | <p dir="auto">Hi,</p>
<p dir="auto">I'm using the new symfony3 distribution with PHP7 on Vagrant.</p>
<p dir="auto">If I run the app, I get a strange error message:</p>
<p dir="auto">Warning: session_write_close(): Failed to write session data (user). Please verify that the current setting of session.save_path is correct (/var/www/api/app/../var/sessions/dev)</p>
<p dir="auto">What could this be?</p>
<p dir="auto">Greetings</p> | 1 |
<p dir="auto">I'm not certain if this is a regression in matplotlib or a bug in seaborn, but a user reported this difference with seaborn between matplotlib 3.0 and 3.1 (<a href="https://github.com/googlecolab/colabtools/issues/828" data-hovercard-type="issue" data-hovercard-url="/googlecolab/colabtools/issues/828/hovercard">original issue</a>):</p>
<p dir="auto">Example code:</p>
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="import numpy as np
import pandas as pd
import seaborn as sns
np.random.seed(0)
data = pd.DataFrame(np.random.randint(0, 10, (10, 10)))
sns.heatmap(data, annot=True);"><pre class="notranslate"><span class="pl-k">import</span> <span class="pl-s1">numpy</span> <span class="pl-k">as</span> <span class="pl-s1">np</span>
<span class="pl-k">import</span> <span class="pl-s1">pandas</span> <span class="pl-k">as</span> <span class="pl-s1">pd</span>
<span class="pl-k">import</span> <span class="pl-s1">seaborn</span> <span class="pl-k">as</span> <span class="pl-s1">sns</span>
<span class="pl-s1">np</span>.<span class="pl-s1">random</span>.<span class="pl-en">seed</span>(<span class="pl-c1">0</span>)
<span class="pl-s1">data</span> <span class="pl-c1">=</span> <span class="pl-s1">pd</span>.<span class="pl-v">DataFrame</span>(<span class="pl-s1">np</span>.<span class="pl-s1">random</span>.<span class="pl-en">randint</span>(<span class="pl-c1">0</span>, <span class="pl-c1">10</span>, (<span class="pl-c1">10</span>, <span class="pl-c1">10</span>)))
<span class="pl-s1">sns</span>.<span class="pl-en">heatmap</span>(<span class="pl-s1">data</span>, <span class="pl-s1">annot</span><span class="pl-c1">=</span><span class="pl-c1">True</span>);</pre></div>
<p dir="auto">Output in matplotlib 3.0:<br>
<a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/781659/68062974-f5dcea80-fcca-11e9-87ce-afdf24151e79.png"><img src="https://user-images.githubusercontent.com/781659/68062974-f5dcea80-fcca-11e9-87ce-afdf24151e79.png" alt="seaborn-2" style="max-width: 100%;"></a></p>
<p dir="auto">Output in matplotlib 3.1:<br>
<a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/781659/68062976-f8d7db00-fcca-11e9-9aa4-dca8800f38b8.png"><img src="https://user-images.githubusercontent.com/781659/68062976-f8d7db00-fcca-11e9-9aa4-dca8800f38b8.png" alt="seaborn-1" style="max-width: 100%;"></a></p> | <p dir="auto">With <code class="notranslate">seaborn 0.9.0</code> and <code class="notranslate">matplotlib 3.1.1</code>, the topmost and bottommost row of boxes in a <code class="notranslate">seaborn</code> plot are partially cut off:</p>
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="import seaborn as sns
import numpy as np
np.random.seed(42)
sns.heatmap(np.random.random((10, 10)))"><pre class="notranslate"><span class="pl-k">import</span> <span class="pl-s1">seaborn</span> <span class="pl-k">as</span> <span class="pl-s1">sns</span>
<span class="pl-k">import</span> <span class="pl-s1">numpy</span> <span class="pl-k">as</span> <span class="pl-s1">np</span>
<span class="pl-s1">np</span>.<span class="pl-s1">random</span>.<span class="pl-en">seed</span>(<span class="pl-c1">42</span>)
<span class="pl-s1">sns</span>.<span class="pl-en">heatmap</span>(<span class="pl-s1">np</span>.<span class="pl-s1">random</span>.<span class="pl-en">random</span>((<span class="pl-c1">10</span>, <span class="pl-c1">10</span>)))</pre></div>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/3466341/60834654-24204280-a18f-11e9-9212-b792c4f1a7a4.png"><img src="https://user-images.githubusercontent.com/3466341/60834654-24204280-a18f-11e9-9212-b792c4f1a7a4.png" alt="heatmap" style="max-width: 100%;"></a></p>
<p dir="auto">As another example, consider this <a href="https://seaborn.pydata.org/examples/heatmap_annotation.html" rel="nofollow">demo from the gallery</a>:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="import matplotlib.pyplot as plt
import seaborn as sns
sns.set()
# Load the example flights dataset and conver to long-form
flights_long = sns.load_dataset("flights")
flights = flights_long.pivot("month", "year", "passengers")
# Draw a heatmap with the numeric values in each cell
f, ax = plt.subplots(figsize=(9, 6))
sns.heatmap(flights, annot=True, fmt="d", linewidths=.5, ax=ax)"><pre class="notranslate"><code class="notranslate">import matplotlib.pyplot as plt
import seaborn as sns
sns.set()
# Load the example flights dataset and conver to long-form
flights_long = sns.load_dataset("flights")
flights = flights_long.pivot("month", "year", "passengers")
# Draw a heatmap with the numeric values in each cell
f, ax = plt.subplots(figsize=(9, 6))
sns.heatmap(flights, annot=True, fmt="d", linewidths=.5, ax=ax)
</code></pre></div>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/3466341/60834759-6a75a180-a18f-11e9-81fc-8dc659e4f0e6.png"><img src="https://user-images.githubusercontent.com/3466341/60834759-6a75a180-a18f-11e9-81fc-8dc659e4f0e6.png" alt="heatmap" style="max-width: 100%;"></a></p>
<p dir="auto">This is a pretty major visual issue. Apologies if this has been reported before, but I couldn't find a record of such in the GH issues.</p> | 1 |
<p dir="auto">by <strong>bolin.huang</strong>:</p>
<pre class="notranslate">I notice (maybe a bug) in $GOROOT/src/pkg/net/smtp/smtp.go. When smtp authentication
failed, an error of type textproto.Error will not return to the caller. Just see the
following code:
169 func (c *Client) Auth(a Auth) error {
170 if err := c.hello(); err != nil {
171 return err
172 }
173 encoding := base64.StdEncoding
174 mech, resp, err := a.Start(&ServerInfo{c.serverName, c.tls, c.auth})
175 if err != nil {
176 c.Quit()
177 return err
178 }
179 resp64 := make([]byte, encoding.EncodedLen(len(resp)))
180 encoding.Encode(resp64, resp)
181 code, msg64, err := c.cmd(0, "AUTH %s %s", mech, resp64)
182 for err == nil {
183 var msg []byte
184 switch code {
185 case 334:
186 msg, err = encoding.DecodeString(msg64)
187 case 235:
188 // the last message isn't base64 because it isn't a challenge
189 msg = []byte(msg64)
--------------------------- Here ------------------------
190 default:
191 err = &textproto.Error{Code: code, Msg: msg64}
192 }
193 resp, err = a.Next(msg, code == 334)
---------------------------------------------------------
194 if err != nil {
195 // abort the AUTH
196 c.cmd(501, "*")
197 c.Quit()
198 break
199 }
200 if resp == nil {
201 break
202 }
203 resp64 = make([]byte, encoding.EncodedLen(len(resp)))
204 encoding.Encode(resp64, resp)
205 code, msg64, err = c.cmd(0, string(resp64))
206 }
207 return err
208 }
On line 191, when authentication unsuccessful(in this case the reply code is 535),
textproto.Error will generate but the following code will replace the err, and the error
message will not transfer to a.Next(). So I spent a lot time to debug but found no error
message return, but the error just happen.
I notice this problem because I use smtp to send email with wrong password, but I just
get another error(unable to relay). So I suppose it will return back
"Authentication unsuccessful" instead of "unable to relay".
Which version are you using? (run 'go version')
go version go1.1.2 darwin/amd64</pre> | <p dir="auto">Go is broken on HardenedBSD currently. It appears to be from the hand-written assembly code in <code class="notranslate">src/runtime/sys_freebsd_amd64.s</code>. The bug can be triggered simply by attempting to compile go on HardenedBSD 11-CURRENT/amd64.</p>
<p dir="auto">uname -a:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="laptop-dev-01[shawn]:/home/shawn/tmp/go (1) $ uname -a
FreeBSD laptop-dev-01 11.0-CURRENT-HBSD FreeBSD 11.0-CURRENT-HBSD #44 264a80e(hardened/current/master): Wed Aug 12 16:42:41 EDT 2015 shawn@laptop-dev-01:/usr/obj/usr/src/sys/LATT-SEC amd64"><pre class="notranslate"><code class="notranslate">laptop-dev-01[shawn]:/home/shawn/tmp/go (1) $ uname -a
FreeBSD laptop-dev-01 11.0-CURRENT-HBSD FreeBSD 11.0-CURRENT-HBSD #44 264a80e(hardened/current/master): Wed Aug 12 16:42:41 EDT 2015 shawn@laptop-dev-01:/usr/obj/usr/src/sys/LATT-SEC amd64
</code></pre></div>
<p dir="auto">gdb backtrace:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="laptop-dev-01[shawn]:/usr/ports/lang/go $ sudo gdb ./work/go/pkg/tool/freebsd_amd64/go_bootstrap
GNU gdb 6.1.1 [FreeBSD]
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "amd64-marcel-freebsd"...
(gdb) run
Starting program: /usr/ports/lang/go/work/go/pkg/tool/freebsd_amd64/go_bootstrap
Program received signal SIGBUS, Bus error.
0x00000000004a4da0 in runtime.settls () at /usr/local/go/src/runtime/sys_freebsd_amd64.s:286
286 /usr/local/go/src/runtime/sys_freebsd_amd64.s: No such file or directory.
in /usr/local/go/src/runtime/sys_freebsd_amd64.s
Current language: auto; currently minimal
(gdb) bt
#0 0x00000000004a4da0 in runtime.settls () at /usr/local/go/src/runtime/sys_freebsd_amd64.s:286
#1 0x00000000008020b0 in runtime.tls0 ()
#2 0x000000000048ce3c in runtime.rt0_go () at /usr/local/go/src/runtime/asm_amd64.s:65
#3 0x0000000000000000 in ?? ()"><pre class="notranslate"><code class="notranslate">laptop-dev-01[shawn]:/usr/ports/lang/go $ sudo gdb ./work/go/pkg/tool/freebsd_amd64/go_bootstrap
GNU gdb 6.1.1 [FreeBSD]
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "amd64-marcel-freebsd"...
(gdb) run
Starting program: /usr/ports/lang/go/work/go/pkg/tool/freebsd_amd64/go_bootstrap
Program received signal SIGBUS, Bus error.
0x00000000004a4da0 in runtime.settls () at /usr/local/go/src/runtime/sys_freebsd_amd64.s:286
286 /usr/local/go/src/runtime/sys_freebsd_amd64.s: No such file or directory.
in /usr/local/go/src/runtime/sys_freebsd_amd64.s
Current language: auto; currently minimal
(gdb) bt
#0 0x00000000004a4da0 in runtime.settls () at /usr/local/go/src/runtime/sys_freebsd_amd64.s:286
#1 0x00000000008020b0 in runtime.tls0 ()
#2 0x000000000048ce3c in runtime.rt0_go () at /usr/local/go/src/runtime/asm_amd64.s:65
#3 0x0000000000000000 in ?? ()
</code></pre></div> | 0 |
<p dir="auto">FWIK, Deno currently fetch dependencies only support download ts/js file(s) individually, it's not a good idea for middle or even large project dependencies fetch(hundreds of or even thounds of dependencies).<br>
So I think it's a good idea to support gzipped file through <code class="notranslate">deno fetch https://foo.gz</code> which contains the mod.ts file in the root and (or) git repo through <code class="notranslate">deno fetch https://foo.git</code> just like golang <code class="notranslate">go get</code></p> | <h3 dir="auto">test</h3>
<p dir="auto"><strong>Describe the bug</strong></p>
<p dir="auto">When using <strong>Go to references</strong>, the extension doesn't find references in files that are not opened in the editor.</p>
<p dir="auto"><strong>To Reproduce</strong></p>
<div class="highlight highlight-source-ts notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="// a.ts
export const a = 0;"><pre class="notranslate"><span class="pl-c">// a.ts</span>
<span class="pl-k">export</span> <span class="pl-k">const</span> <span class="pl-s1">a</span> <span class="pl-c1">=</span> <span class="pl-c1">0</span><span class="pl-kos">;</span></pre></div>
<div class="highlight highlight-source-ts notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="// b.ts
import { a } from "./a.ts";"><pre class="notranslate"><span class="pl-c">// b.ts</span>
<span class="pl-k">import</span> <span class="pl-kos">{</span> <span class="pl-s1">a</span> <span class="pl-kos">}</span> <span class="pl-k">from</span> <span class="pl-s">"./a.ts"</span><span class="pl-kos">;</span></pre></div>
<div class="highlight highlight-source-ts notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="// c.ts
import { a } from "./a.ts";"><pre class="notranslate"><span class="pl-c">// c.ts</span>
<span class="pl-k">import</span> <span class="pl-kos">{</span> <span class="pl-s1">a</span> <span class="pl-kos">}</span> <span class="pl-k">from</span> <span class="pl-s">"./a.ts"</span><span class="pl-kos">;</span></pre></div>
<p dir="auto">Open <code class="notranslate">a.ts</code> and <code class="notranslate">b.ts</code>, go to references of <code class="notranslate">a</code>. No references in <code class="notranslate">c.ts</code>.</p>
<p dir="auto"><strong>Expected behavior</strong></p>
<p dir="auto"><code class="notranslate">c.ts</code> should appear in the panel.<br>
This makes this feature useless if you have to open every file in your project to find references</p>
<p dir="auto"><strong>Screenshots</strong></p>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/52361520/123939794-d236df80-d998-11eb-9aa9-28149f6619cf.gif"><img src="https://user-images.githubusercontent.com/52361520/123939794-d236df80-d998-11eb-9aa9-28149f6619cf.gif" alt="reference" data-animated-image="" style="max-width: 100%;"></a></p>
<p dir="auto"><strong>Versions</strong></p>
<p dir="auto">vscode: 1.57.1 deno: 1.11.3 extension: 3.6.1</p> | 0 |
<p dir="auto">I deployed my app on heroku and it returns a 404 error if I disable file system routing and use a custom route file. I also use express server.</p>
<p dir="auto">I use <code class="notranslate">next-routes</code> library and here is my source files.</p>
<h3 dir="auto">routes.js</h3>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="const routes = module.exports = require('next-routes')();
routes
.add({name: 'community', pattern: '/community', page: 'profiles'})
.add({name: 'locations', pattern: '/community/locations', page: 'locations'})
.add({name: 'categories', pattern: '/community/categories', page: 'categories'})
.add({name: 'talents', pattern: '/community/talents', page: 'talents'})
.add({name:'dashboard', pattern: '/dashboard', page: 'dashboard'})
.add({name:'pricing', pattern: '/pricing', page: 'pricing'})
.add({name: 'blog', pattern: '/blog', page: 'blog'})
.add({name: 'blog_item', pattern: '/blog/:slug', page:'blog_item'})
.add({name: 'login', pattern: '/login', page:'login'})
.add({name: 'signup', pattern: '/signup', page:'signup'})
.add({name: 'reset', pattern: '/reset', page: 'reset'})
.add({name: 'auth', pattern: '/auth', page: 'auth'})
.add({name: 'equipments', pattern: '/profile/equipments', page: 'equipments'})
.add({name: 'connections', pattern: '/profile/connections', page: 'connections'})
.add({name: 'passwordreset', pattern: '/password/reset', page: 'passwordreset'})
.add({name: 'about', pattern: '/profile/about', page: 'about'})"><pre class="notranslate"><span class="pl-k">const</span> <span class="pl-s1">routes</span> <span class="pl-c1">=</span> <span class="pl-smi">module</span><span class="pl-kos">.</span><span class="pl-c1">exports</span> <span class="pl-c1">=</span> <span class="pl-en">require</span><span class="pl-kos">(</span><span class="pl-s">'next-routes'</span><span class="pl-kos">)</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-s1">routes</span>
<span class="pl-kos">.</span><span class="pl-en">add</span><span class="pl-kos">(</span><span class="pl-kos">{</span><span class="pl-c1">name</span>: <span class="pl-s">'community'</span><span class="pl-kos">,</span> <span class="pl-c1">pattern</span>: <span class="pl-s">'/community'</span><span class="pl-kos">,</span> <span class="pl-c1">page</span>: <span class="pl-s">'profiles'</span><span class="pl-kos">}</span><span class="pl-kos">)</span>
<span class="pl-kos">.</span><span class="pl-en">add</span><span class="pl-kos">(</span><span class="pl-kos">{</span><span class="pl-c1">name</span>: <span class="pl-s">'locations'</span><span class="pl-kos">,</span> <span class="pl-c1">pattern</span>: <span class="pl-s">'/community/locations'</span><span class="pl-kos">,</span> <span class="pl-c1">page</span>: <span class="pl-s">'locations'</span><span class="pl-kos">}</span><span class="pl-kos">)</span>
<span class="pl-kos">.</span><span class="pl-en">add</span><span class="pl-kos">(</span><span class="pl-kos">{</span><span class="pl-c1">name</span>: <span class="pl-s">'categories'</span><span class="pl-kos">,</span> <span class="pl-c1">pattern</span>: <span class="pl-s">'/community/categories'</span><span class="pl-kos">,</span> <span class="pl-c1">page</span>: <span class="pl-s">'categories'</span><span class="pl-kos">}</span><span class="pl-kos">)</span>
<span class="pl-kos">.</span><span class="pl-en">add</span><span class="pl-kos">(</span><span class="pl-kos">{</span><span class="pl-c1">name</span>: <span class="pl-s">'talents'</span><span class="pl-kos">,</span> <span class="pl-c1">pattern</span>: <span class="pl-s">'/community/talents'</span><span class="pl-kos">,</span> <span class="pl-c1">page</span>: <span class="pl-s">'talents'</span><span class="pl-kos">}</span><span class="pl-kos">)</span>
<span class="pl-kos">.</span><span class="pl-en">add</span><span class="pl-kos">(</span><span class="pl-kos">{</span><span class="pl-c1">name</span>:<span class="pl-s">'dashboard'</span><span class="pl-kos">,</span> <span class="pl-c1">pattern</span>: <span class="pl-s">'/dashboard'</span><span class="pl-kos">,</span> <span class="pl-c1">page</span>: <span class="pl-s">'dashboard'</span><span class="pl-kos">}</span><span class="pl-kos">)</span>
<span class="pl-kos">.</span><span class="pl-en">add</span><span class="pl-kos">(</span><span class="pl-kos">{</span><span class="pl-c1">name</span>:<span class="pl-s">'pricing'</span><span class="pl-kos">,</span> <span class="pl-c1">pattern</span>: <span class="pl-s">'/pricing'</span><span class="pl-kos">,</span> <span class="pl-c1">page</span>: <span class="pl-s">'pricing'</span><span class="pl-kos">}</span><span class="pl-kos">)</span>
<span class="pl-kos">.</span><span class="pl-en">add</span><span class="pl-kos">(</span><span class="pl-kos">{</span><span class="pl-c1">name</span>: <span class="pl-s">'blog'</span><span class="pl-kos">,</span> <span class="pl-c1">pattern</span>: <span class="pl-s">'/blog'</span><span class="pl-kos">,</span> <span class="pl-c1">page</span>: <span class="pl-s">'blog'</span><span class="pl-kos">}</span><span class="pl-kos">)</span>
<span class="pl-kos">.</span><span class="pl-en">add</span><span class="pl-kos">(</span><span class="pl-kos">{</span><span class="pl-c1">name</span>: <span class="pl-s">'blog_item'</span><span class="pl-kos">,</span> <span class="pl-c1">pattern</span>: <span class="pl-s">'/blog/:slug'</span><span class="pl-kos">,</span> <span class="pl-c1">page</span>:<span class="pl-s">'blog_item'</span><span class="pl-kos">}</span><span class="pl-kos">)</span>
<span class="pl-kos">.</span><span class="pl-en">add</span><span class="pl-kos">(</span><span class="pl-kos">{</span><span class="pl-c1">name</span>: <span class="pl-s">'login'</span><span class="pl-kos">,</span> <span class="pl-c1">pattern</span>: <span class="pl-s">'/login'</span><span class="pl-kos">,</span> <span class="pl-c1">page</span>:<span class="pl-s">'login'</span><span class="pl-kos">}</span><span class="pl-kos">)</span>
<span class="pl-kos">.</span><span class="pl-en">add</span><span class="pl-kos">(</span><span class="pl-kos">{</span><span class="pl-c1">name</span>: <span class="pl-s">'signup'</span><span class="pl-kos">,</span> <span class="pl-c1">pattern</span>: <span class="pl-s">'/signup'</span><span class="pl-kos">,</span> <span class="pl-c1">page</span>:<span class="pl-s">'signup'</span><span class="pl-kos">}</span><span class="pl-kos">)</span>
<span class="pl-kos">.</span><span class="pl-en">add</span><span class="pl-kos">(</span><span class="pl-kos">{</span><span class="pl-c1">name</span>: <span class="pl-s">'reset'</span><span class="pl-kos">,</span> <span class="pl-c1">pattern</span>: <span class="pl-s">'/reset'</span><span class="pl-kos">,</span> <span class="pl-c1">page</span>: <span class="pl-s">'reset'</span><span class="pl-kos">}</span><span class="pl-kos">)</span>
<span class="pl-kos">.</span><span class="pl-en">add</span><span class="pl-kos">(</span><span class="pl-kos">{</span><span class="pl-c1">name</span>: <span class="pl-s">'auth'</span><span class="pl-kos">,</span> <span class="pl-c1">pattern</span>: <span class="pl-s">'/auth'</span><span class="pl-kos">,</span> <span class="pl-c1">page</span>: <span class="pl-s">'auth'</span><span class="pl-kos">}</span><span class="pl-kos">)</span>
<span class="pl-kos">.</span><span class="pl-en">add</span><span class="pl-kos">(</span><span class="pl-kos">{</span><span class="pl-c1">name</span>: <span class="pl-s">'equipments'</span><span class="pl-kos">,</span> <span class="pl-c1">pattern</span>: <span class="pl-s">'/profile/equipments'</span><span class="pl-kos">,</span> <span class="pl-c1">page</span>: <span class="pl-s">'equipments'</span><span class="pl-kos">}</span><span class="pl-kos">)</span>
<span class="pl-kos">.</span><span class="pl-en">add</span><span class="pl-kos">(</span><span class="pl-kos">{</span><span class="pl-c1">name</span>: <span class="pl-s">'connections'</span><span class="pl-kos">,</span> <span class="pl-c1">pattern</span>: <span class="pl-s">'/profile/connections'</span><span class="pl-kos">,</span> <span class="pl-c1">page</span>: <span class="pl-s">'connections'</span><span class="pl-kos">}</span><span class="pl-kos">)</span>
<span class="pl-kos">.</span><span class="pl-en">add</span><span class="pl-kos">(</span><span class="pl-kos">{</span><span class="pl-c1">name</span>: <span class="pl-s">'passwordreset'</span><span class="pl-kos">,</span> <span class="pl-c1">pattern</span>: <span class="pl-s">'/password/reset'</span><span class="pl-kos">,</span> <span class="pl-c1">page</span>: <span class="pl-s">'passwordreset'</span><span class="pl-kos">}</span><span class="pl-kos">)</span>
<span class="pl-kos">.</span><span class="pl-en">add</span><span class="pl-kos">(</span><span class="pl-kos">{</span><span class="pl-c1">name</span>: <span class="pl-s">'about'</span><span class="pl-kos">,</span> <span class="pl-c1">pattern</span>: <span class="pl-s">'/profile/about'</span><span class="pl-kos">,</span> <span class="pl-c1">page</span>: <span class="pl-s">'about'</span><span class="pl-kos">}</span><span class="pl-kos">)</span></pre></div>
<h3 dir="auto">server.js</h3>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="const express = require('express');
const compression = require('compression');
const next = require('next');
const http = require('http');
const dev = process.env.NODE_ENV !== 'production';
const PORT = process.env.PORT || 3000;
const app = next({dev });
const routes = require('./routes')
const handler = routes.getRequestHandler(app, ({req, res, route, query}) => {
app.render(req, res, route.page, query)
})
app.prepare().then(() => {
const server = express()
if (process.env.NODE_ENV === "production") {
//server.use( compression() );
}
server.use( handler )
var httpServer = http.createServer(server);
httpServer.listen(PORT, (err) => {
if (err) throw err;
console.log(`> Ready on http://localhost:${PORT}`);
});
});"><pre class="notranslate"><span class="pl-k">const</span> <span class="pl-s1">express</span> <span class="pl-c1">=</span> <span class="pl-en">require</span><span class="pl-kos">(</span><span class="pl-s">'express'</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-k">const</span> <span class="pl-s1">compression</span> <span class="pl-c1">=</span> <span class="pl-en">require</span><span class="pl-kos">(</span><span class="pl-s">'compression'</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-k">const</span> <span class="pl-s1">next</span> <span class="pl-c1">=</span> <span class="pl-en">require</span><span class="pl-kos">(</span><span class="pl-s">'next'</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-k">const</span> <span class="pl-s1">http</span> <span class="pl-c1">=</span> <span class="pl-en">require</span><span class="pl-kos">(</span><span class="pl-s">'http'</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-k">const</span> <span class="pl-s1">dev</span> <span class="pl-c1">=</span> <span class="pl-s1">process</span><span class="pl-kos">.</span><span class="pl-c1">env</span><span class="pl-kos">.</span><span class="pl-c1">NODE_ENV</span> <span class="pl-c1">!==</span> <span class="pl-s">'production'</span><span class="pl-kos">;</span>
<span class="pl-k">const</span> <span class="pl-c1">PORT</span> <span class="pl-c1">=</span> <span class="pl-s1">process</span><span class="pl-kos">.</span><span class="pl-c1">env</span><span class="pl-kos">.</span><span class="pl-c1">PORT</span> <span class="pl-c1">||</span> <span class="pl-c1">3000</span><span class="pl-kos">;</span>
<span class="pl-k">const</span> <span class="pl-s1">app</span> <span class="pl-c1">=</span> <span class="pl-s1">next</span><span class="pl-kos">(</span><span class="pl-kos">{</span>dev <span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-k">const</span> <span class="pl-s1">routes</span> <span class="pl-c1">=</span> <span class="pl-en">require</span><span class="pl-kos">(</span><span class="pl-s">'./routes'</span><span class="pl-kos">)</span>
<span class="pl-k">const</span> <span class="pl-s1">handler</span> <span class="pl-c1">=</span> <span class="pl-s1">routes</span><span class="pl-kos">.</span><span class="pl-en">getRequestHandler</span><span class="pl-kos">(</span><span class="pl-s1">app</span><span class="pl-kos">,</span> <span class="pl-kos">(</span><span class="pl-kos">{</span>req<span class="pl-kos">,</span> res<span class="pl-kos">,</span> route<span class="pl-kos">,</span> query<span class="pl-kos">}</span><span class="pl-kos">)</span> <span class="pl-c1">=></span> <span class="pl-kos">{</span>
<span class="pl-s1">app</span><span class="pl-kos">.</span><span class="pl-en">render</span><span class="pl-kos">(</span><span class="pl-s1">req</span><span class="pl-kos">,</span> <span class="pl-s1">res</span><span class="pl-kos">,</span> <span class="pl-s1">route</span><span class="pl-kos">.</span><span class="pl-c1">page</span><span class="pl-kos">,</span> <span class="pl-s1">query</span><span class="pl-kos">)</span>
<span class="pl-kos">}</span><span class="pl-kos">)</span>
<span class="pl-s1">app</span><span class="pl-kos">.</span><span class="pl-en">prepare</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-en">then</span><span class="pl-kos">(</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-c1">=></span> <span class="pl-kos">{</span>
<span class="pl-k">const</span> <span class="pl-s1">server</span> <span class="pl-c1">=</span> <span class="pl-s1">express</span><span class="pl-kos">(</span><span class="pl-kos">)</span>
<span class="pl-k">if</span> <span class="pl-kos">(</span><span class="pl-s1">process</span><span class="pl-kos">.</span><span class="pl-c1">env</span><span class="pl-kos">.</span><span class="pl-c1">NODE_ENV</span> <span class="pl-c1">===</span> <span class="pl-s">"production"</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
<span class="pl-c">//server.use( compression() );</span>
<span class="pl-kos">}</span>
<span class="pl-s1">server</span><span class="pl-kos">.</span><span class="pl-en">use</span><span class="pl-kos">(</span> <span class="pl-s1">handler</span> <span class="pl-kos">)</span>
<span class="pl-k">var</span> <span class="pl-s1">httpServer</span> <span class="pl-c1">=</span> <span class="pl-s1">http</span><span class="pl-kos">.</span><span class="pl-en">createServer</span><span class="pl-kos">(</span><span class="pl-s1">server</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-s1">httpServer</span><span class="pl-kos">.</span><span class="pl-en">listen</span><span class="pl-kos">(</span><span class="pl-c1">PORT</span><span class="pl-kos">,</span> <span class="pl-kos">(</span><span class="pl-s1">err</span><span class="pl-kos">)</span> <span class="pl-c1">=></span> <span class="pl-kos">{</span>
<span class="pl-k">if</span> <span class="pl-kos">(</span><span class="pl-s1">err</span><span class="pl-kos">)</span> <span class="pl-k">throw</span> <span class="pl-s1">err</span><span class="pl-kos">;</span>
<span class="pl-smi">console</span><span class="pl-kos">.</span><span class="pl-en">log</span><span class="pl-kos">(</span><span class="pl-s">`> Ready on http://localhost:<span class="pl-s1"><span class="pl-kos">${</span><span class="pl-c1">PORT</span><span class="pl-kos">}</span></span>`</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">;</span></pre></div>
<h3 dir="auto">next.config.js</h3>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="const withSass = require('@zeit/next-sass')
const getRoutes = require('./src/routes')
module.exports = withSass({
cssModules: false,
exportPathMap: getRoutes,
useFileSystemPublicRoutes: false
})"><pre class="notranslate"><span class="pl-k">const</span> <span class="pl-s1">withSass</span> <span class="pl-c1">=</span> <span class="pl-en">require</span><span class="pl-kos">(</span><span class="pl-s">'@zeit/next-sass'</span><span class="pl-kos">)</span>
<span class="pl-k">const</span> <span class="pl-s1">getRoutes</span> <span class="pl-c1">=</span> <span class="pl-en">require</span><span class="pl-kos">(</span><span class="pl-s">'./src/routes'</span><span class="pl-kos">)</span>
<span class="pl-smi">module</span><span class="pl-kos">.</span><span class="pl-c1">exports</span> <span class="pl-c1">=</span> <span class="pl-s1">withSass</span><span class="pl-kos">(</span><span class="pl-kos">{</span>
<span class="pl-c1">cssModules</span>: <span class="pl-c1">false</span><span class="pl-kos">,</span>
<span class="pl-c1">exportPathMap</span>: <span class="pl-s1">getRoutes</span><span class="pl-kos">,</span>
<span class="pl-c1">useFileSystemPublicRoutes</span>: <span class="pl-c1">false</span>
<span class="pl-kos">}</span><span class="pl-kos">)</span></pre></div>
<h3 dir="auto">package.json</h3>
<div class="highlight highlight-source-json notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content=""scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"dev": "node ./src/server.js",
"build": "next build",
"start": "node ./src/server.js -p $PORT",
"heroku-postbuild": "next build"
},"><pre class="notranslate"><span class="pl-ent">"scripts"</span>: {
<span class="pl-ent">"test"</span>: <span class="pl-s"><span class="pl-pds">"</span>echo <span class="pl-cce">\"</span>Error: no test specified<span class="pl-cce">\"</span> && exit 1<span class="pl-pds">"</span></span>,
<span class="pl-ent">"dev"</span>: <span class="pl-s"><span class="pl-pds">"</span>node ./src/server.js<span class="pl-pds">"</span></span>,
<span class="pl-ent">"build"</span>: <span class="pl-s"><span class="pl-pds">"</span>next build<span class="pl-pds">"</span></span>,
<span class="pl-ent">"start"</span>: <span class="pl-s"><span class="pl-pds">"</span>node ./src/server.js -p $PORT<span class="pl-pds">"</span></span>,
<span class="pl-ent">"heroku-postbuild"</span>: <span class="pl-s"><span class="pl-pds">"</span>next build<span class="pl-pds">"</span></span>
},</pre></div>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have searched the <a href="https://github.com/zeit/next.js/issues?q=is%3Aissue">issues</a> of this repository and believe that this is not a duplicate.</li>
</ul>
<h2 dir="auto">Expected Behavior</h2>
<p dir="auto">I expect the app to run flawlessly because it works on development.</p>
<h2 dir="auto">Environment</h2>
<table role="table">
<thead>
<tr>
<th>Tech</th>
<th>Version</th>
</tr>
</thead>
<tbody>
<tr>
<td>next</td>
<td>6.0.0</td>
</tr>
<tr>
<td>node</td>
<td>v8.9.1</td>
</tr>
<tr>
<td>OS</td>
<td>Mac OS X Sierra</td>
</tr>
<tr>
<td>browser</td>
<td>All</td>
</tr>
<tr>
<td>deployed</td>
<td>heroku</td>
</tr>
</tbody>
</table> | <p dir="auto"><code class="notranslate">npm install next</code> fails with error:<br>
<code class="notranslate">npm ERR! 404 Not Found: @zeit/[email protected]</code></p>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have searched the <a href="https://github.com/zeit/next.js/issues">issues</a> of this repository and believe that this is not a duplicate.</li>
</ul>
<h2 dir="auto">Expected Behavior</h2>
<h2 dir="auto">Current Behavior</h2>
<h2 dir="auto">Steps to Reproduce (for bugs)</h2>
<ol dir="auto">
<li>Following instructions here: <a href="https://learnnextjs.com/basics/getting-started/setup" rel="nofollow">https://learnnextjs.com/basics/getting-started/setup</a></li>
<li><code class="notranslate">npm install next</code> should succeed</li>
<li></li>
<li></li>
</ol>
<h2 dir="auto">Context</h2>
<h2 dir="auto">Your Environment</h2>
<table role="table">
<thead>
<tr>
<th>Tech</th>
<th>Version</th>
</tr>
</thead>
<tbody>
<tr>
<td>next</td>
<td>5.6.0</td>
</tr>
<tr>
<td>node</td>
<td>9.5.0</td>
</tr>
<tr>
<td>OS</td>
<td>OSX 10.12.6</td>
</tr>
<tr>
<td>browser</td>
<td></td>
</tr>
<tr>
<td>etc</td>
<td></td>
</tr>
</tbody>
</table> | 0 |
<h3 dir="auto">Preflight Checklist</h3>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have read the <a href="https://github.com/electron/electron/blob/master/CONTRIBUTING.md">Contributing Guidelines</a> for this project.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I agree to follow the <a href="https://github.com/electron/electron/blob/master/CODE_OF_CONDUCT.md">Code of Conduct</a> that this project adheres to.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have searched the <a href="https://www.github.com/electron/electron/issues">issue tracker</a> for a feature request that matches the one I want to file, without success.</li>
</ul>
<h3 dir="auto">Electron Version</h3>
<p dir="auto">12.0.1</p>
<h3 dir="auto">What operating system are you using?</h3>
<p dir="auto">Windows</p>
<h3 dir="auto">Operating System Version</h3>
<p dir="auto">Windows 10 version 20H2</p>
<h3 dir="auto">What arch are you using?</h3>
<p dir="auto">x64</p>
<h3 dir="auto">Last Known Working Electron version</h3>
<p dir="auto"><em>No response</em></p>
<h3 dir="auto">Expected Behavior</h3>
<p dir="auto">Run "window.open" to display the three levels of browsers in the Electron browser.</p>
<h3 dir="auto">Actual Behavior</h3>
<p dir="auto">The parent screen -> child screen is displayed, but the child screen -> grandchild screen is not displayed correctly.</p>
<h3 dir="auto">Testcase Gist URL</h3>
<p dir="auto"><em>No response</em></p>
<h3 dir="auto">Test github.io repository</h3>
<ul dir="auto">
<li><a href="https://github.com/takman00/electron-test">https://github.com/takman00/electron-test</a></li>
</ul>
<h3 dir="auto">Test github.io pages</h3>
<ul dir="auto">
<li><a href="https://takman00.github.io/electron-test/" rel="nofollow">https://takman00.github.io/electron-test/</a></li>
</ul>
<h3 dir="auto">Operation image</h3>
<h4 dir="auto">Electron oparation</h4>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/1650903/111288148-4322e780-8687-11eb-90dc-50e2021b5d34.jpg"><img src="https://user-images.githubusercontent.com/1650903/111288148-4322e780-8687-11eb-90dc-50e2021b5d34.jpg" alt="electron1" style="max-width: 100%;"></a></p>
<h4 dir="auto">Chrome oparation</h4>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/1650903/111288158-461dd800-8687-11eb-9b4a-716bca282907.jpg"><img src="https://user-images.githubusercontent.com/1650903/111288158-461dd800-8687-11eb-9b4a-716bca282907.jpg" alt="electron2" style="max-width: 100%;"></a></p> | <h3 dir="auto">Preflight Checklist</h3>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have read the <a href="https://github.com/electron/electron/blob/master/CONTRIBUTING.md">Contributing Guidelines</a> for this project.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I agree to follow the <a href="https://github.com/electron/electron/blob/master/CODE_OF_CONDUCT.md">Code of Conduct</a> that this project adheres to.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have searched the <a href="https://www.github.com/electron/electron/issues">issue tracker</a> for a feature request that matches the one I want to file, without success.</li>
</ul>
<h3 dir="auto">Electron Version</h3>
<p dir="auto">12.0.4</p>
<h3 dir="auto">What operating system are you using?</h3>
<p dir="auto">macOS</p>
<h3 dir="auto">Operating System Version</h3>
<p dir="auto">macOS Catalina 10.15.7</p>
<h3 dir="auto">What arch are you using?</h3>
<p dir="auto">x64</p>
<h3 dir="auto">Last Known Working Electron version</h3>
<p dir="auto">11.4.5</p>
<h3 dir="auto">Expected Behavior</h3>
<p dir="auto">With either the <code class="notranslate">sandbox</code> option or the <code class="notranslate">nativeWindowOpen</code> option enabled:</p>
<p dir="auto">When you open a new window using <code class="notranslate">window.open</code> from a window that is created using <code class="notranslate">window.open</code>, I expect to see 3 windows rendering their own html.</p>
<h3 dir="auto">Actual Behavior</h3>
<p dir="auto">When you open a new window using <code class="notranslate">window.open</code> from a window that is created using <code class="notranslate">window.open</code>, the second window goes blank (white screen). Closing either of these two windows closes the other window.</p>
<p dir="auto">Step to reproduce:</p>
<ul dir="auto">
<li>Run the attached sample:</li>
<li>Click open window to create a new window</li>
<li>Click open window from the new window to create third window</li>
<li>Observe second window is blank</li>
</ul>
<h3 dir="auto">Testcase Gist URL</h3>
<p dir="auto"><a href="https://gist.github.com/naineshsolanki-lmi/587f79ad7a4f0c794f9561f9ec85b389">https://gist.github.com/naineshsolanki-lmi/587f79ad7a4f0c794f9561f9ec85b389</a></p>
<h3 dir="auto">Additional Information</h3>
<p dir="auto"><em>No response</em></p> | 1 |
<h1 dir="auto">Bug report</h1>
<p dir="auto">I have posted question regarding to it on stackowerflow here:<br>
<a href="https://stackoverflow.com/questions/70140202/webpack-defineplugin-process-env-node-env-is-undefined" rel="nofollow">https://stackoverflow.com/questions/70140202/webpack-defineplugin-process-env-node-env-is-undefined</a><br>
I am not too good with front-end technologies... So if I have wrong expectations - please correct me or my code. I have created a repository with code that allows to reproduce issue. Here is the link: <a href="https://github.com/ffatheranderson/webpack-issue-reproduction">https://github.com/ffatheranderson/webpack-issue-reproduction</a></p>
<p dir="auto"><strong>What is the current behavior?</strong></p>
<p dir="auto">After I execute npm run watch command - the generated result/bundle.js file contains such lines:</p>
<p dir="auto">...<br>
var _environment = undefined;<br>
var _ANOTHER_VARIABLE = "another variable value";<br>
...</p>
<p dir="auto"><strong>If the current behavior is a bug, please provide the steps to reproduce.</strong></p>
<p dir="auto"><strong>What is the expected behavior?</strong></p>
<p dir="auto">I expect that after I execute npm run watch command - the generated result/bundle.js file to have such lines:</p>
<p dir="auto">...<br>
var _environment = 'development';<br>
var _ANOTHER_VARIABLE = "another variable value";<br>
...</p>
<p dir="auto">I have such expectation because of these lines in in webpack.config.js file:</p>
<p dir="auto">plugins: [<br>
new webpack.DefinePlugin({<br>
ENVIRONMENT: JSON.stringify(process.env.NODE_ENV),<br>
ANOTHER_VARIABLE: JSON.stringify("another variable value"),<br>
})<br>
]<br>
...</p>
<p dir="auto"><strong>Other relevant information:</strong><br>
webpack version: 5.64.4<br>
Node.js version: 14.16.0<br>
Operating System: WIndows 10<br>
Additional tools:</p> | <p dir="auto">I'd like to use <code class="notranslate">require.ensure</code>, but I have special requirements for loading chunks and I can't use the built-in jsonp loader (for offline support and to work around browser bugs I need to load JS from <code class="notranslate">localStorage</code>).</p>
<p dir="auto">I "only" need to replace the few lines that create a new script and insert it to DOM, but replacing that bit seems like a rather a complex thing to implement (please correct me if there's a better way):</p>
<ul dir="auto">
<li>I've written a custom function for <code class="notranslate">options.target</code> that invokes all usual webpack plugins (same as <code class="notranslate">WebpackOptionsApply</code>) except the <code class="notranslate">JsonpTemplatePlugin</code>.</li>
<li>I've had to copy&paste&edit code of <code class="notranslate">JsonpTemplatePlugin</code> and <code class="notranslate">JsonpMainTemplatePlugin</code> plugin to modify the script loader part.</li>
</ul>
<p dir="auto">That already seems like a fragile hack — I'm duplicating webpack's built-in functionality and probably relying too much on implementation details.</p>
<p dir="auto">There's another thing that has bitten me hard: <code class="notranslate">options.target == "web"</code> is magically special due to <code class="notranslate">defaultByTarget</code> in <code class="notranslate">WebpackOptionsDefaulter</code> and affects several other configuration options. This change in defaults was unexpected and has broken my build in subtle ways that were hard to debug.</p>
<p dir="auto">Could you:</p>
<ul dir="auto">
<li>
<p dir="auto">add configuration option or a more direct plugin API for replacing the jsonp loader code?</p>
</li>
<li>
<p dir="auto">and/or make it easier to use custom <code class="notranslate">target</code> that extends behavior of <code class="notranslate">"web"</code>?</p>
<p dir="auto">For example you could make <code class="notranslate">target</code> an instance of a class that has properties/getters for the defaults, so then instead of:</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="options.resolve.modulesDirectories = defaultByTarget(options.resolve.modulesDirectories,
["web_modules", "node_modules"],
…"><pre class="notranslate"><span class="pl-s1">options</span><span class="pl-kos">.</span><span class="pl-c1">resolve</span><span class="pl-kos">.</span><span class="pl-c1">modulesDirectories</span> <span class="pl-c1">=</span> <span class="pl-s1">defaultByTarget</span><span class="pl-kos">(</span><span class="pl-s1">options</span><span class="pl-kos">.</span><span class="pl-c1">resolve</span><span class="pl-kos">.</span><span class="pl-c1">modulesDirectories</span><span class="pl-kos">,</span>
<span class="pl-kos">[</span><span class="pl-s">"web_modules"</span><span class="pl-kos">,</span> <span class="pl-s">"node_modules"</span><span class="pl-kos">]</span><span class="pl-kos">,</span>
<span class="pl-s1">…</span></pre></div>
<p dir="auto">it'd be something like:</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="options.resolve.modulesDirectories = options.resolve.modulesDirectories || options.target.getDefaultModulesDirectories();"><pre class="notranslate"><span class="pl-s1">options</span><span class="pl-kos">.</span><span class="pl-c1">resolve</span><span class="pl-kos">.</span><span class="pl-c1">modulesDirectories</span> <span class="pl-c1">=</span> <span class="pl-s1">options</span><span class="pl-kos">.</span><span class="pl-c1">resolve</span><span class="pl-kos">.</span><span class="pl-c1">modulesDirectories</span> <span class="pl-c1">||</span> <span class="pl-s1">options</span><span class="pl-kos">.</span><span class="pl-c1">target</span><span class="pl-kos">.</span><span class="pl-en">getDefaultModulesDirectories</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span></pre></div>
</li>
</ul> | 0 |
<h4 dir="auto">Description</h4>
<p dir="auto">Error in call of Scikit-Learn</p>
<h4 dir="auto">Steps/Code to Reproduce</h4>
<p dir="auto">Simple call of "import sklearn"</p>
<h4 dir="auto">Expected Results</h4>
<p dir="auto">Normal run</p>
<h4 dir="auto">Actual Results</h4>
<p dir="auto">Traceback (most recent call last):<br>
File "D:/code/python/hybrid3/borrar.py", line 5, in <br>
import sklearn; print("Scikit-Learn", sklearn.<strong>version</strong>)<br>
File "C:\Users\braun00r\AppData\Local\Programs\Python\Python36\lib\site-packages\sklearn_<em>init</em>_.py", line 57, in <br>
from .base import clone<br>
File "C:\Users\braun00r\AppData\Local\Programs\Python\Python36\lib\site-packages\sklearn\base.py", line 12, in <br>
from .utils.fixes import signature<br>
File "C:\Users\braun00r\AppData\Local\Programs\Python\Python36\lib\site-packages\sklearn\utils_<em>init</em>_.py", line 11, in <br>
from .validation import (as_float_array,<br>
File "C:\Users\braun00r\AppData\Local\Programs\Python\Python36\lib\site-packages\sklearn\utils\validation.py", line 18, in <br>
from ..utils.fixes import signature<br>
File "C:\Users\braun00r\AppData\Local\Programs\Python\Python36\lib\site-packages\sklearn\utils\fixes.py", line 406, in <br>
if np_version < (1, 12, 0):<br>
TypeError: '<' not supported between instances of 'str' and 'int'</p>
<h4 dir="auto">Versions</h4>
<p dir="auto">Windows-7-6.1.7601-SP1<br>
Python 3.6.0 (v3.6.0:41df79263a11, Dec 23 2016, 08:06:12) [MSC v.1900 64 bit (AMD64)]<br>
NumPy 1.12.1rc1<br>
SciPy 0.19.0</p> | <p dir="auto">There is a new bug in master brunch, <code class="notranslate">scikit-learn/sklearn/utils/fixes.py</code><br>
in line 406: <code class="notranslate">if np_version < (1, 12, 0):</code> , an error occured, <code class="notranslate">TypeError: unorderable types: str() < int()</code>.<br>
It's because in the function :</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="def _parse_version(version_string):
version = []
for x in version_string.split('.'):
try:
version.append(int(x))
except ValueError:
# x may be of the form dev-1ea1592
version.append(x)
return tuple(version)"><pre class="notranslate"><code class="notranslate">def _parse_version(version_string):
version = []
for x in version_string.split('.'):
try:
version.append(int(x))
except ValueError:
# x may be of the form dev-1ea1592
version.append(x)
return tuple(version)
</code></pre></div>
<p dir="auto">However, my numpy version is:<code class="notranslate">1.12.0b1</code>, this funciotn return a tuple(1,12,'0b1') , but in line 406, It is compared with integer type, so the error occured.<br>
I just in a simple way to solve it. I change the code to <code class="notranslate">if np_version < (1, 12, '0'):</code> in line 406, just change the third tuple index to string type.<br>
Of course, this is not a common method.</p> | 1 |
<p dir="auto">This is a follow-up issue of <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="318148150" data-permission-text="Title is private" data-url="https://github.com/DefinitelyTyped/DefinitelyTyped/issues/25342" data-hovercard-type="issue" data-hovercard-url="/DefinitelyTyped/DefinitelyTyped/issues/25342/hovercard" href="https://github.com/DefinitelyTyped/DefinitelyTyped/issues/25342">#25342</a> and <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="258248230" data-permission-text="Title is private" data-url="https://github.com/DefinitelyTyped/DefinitelyTyped/issues/19799" data-hovercard-type="issue" data-hovercard-url="/DefinitelyTyped/DefinitelyTyped/issues/19799/hovercard" href="https://github.com/DefinitelyTyped/DefinitelyTyped/issues/19799">#19799</a>.</p>
<p dir="auto">In <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="317398689" data-permission-text="Title is private" data-url="https://github.com/DefinitelyTyped/DefinitelyTyped/issues/25269" data-hovercard-type="pull_request" data-hovercard-url="/DefinitelyTyped/DefinitelyTyped/pull/25269/hovercard" href="https://github.com/DefinitelyTyped/DefinitelyTyped/pull/25269">#25269</a> the <code class="notranslate">URL</code> and <code class="notranslate">URLSearchParams</code> classes have been added as globals because since Node.js 10.0 they are <a href="https://nodejs.org/api/url.html#url_class_url" rel="nofollow">exposed as globals</a>.</p>
<p dir="auto">Because <code class="notranslate">lib.dom.d.ts</code> also exposes them as globals, projects <em>which referenced both</em>, <code class="notranslate">node</code> and <code class="notranslate">lib.dom</code>, got "Duplicate identifier 'URL'" errors (see <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="318148150" data-permission-text="Title is private" data-url="https://github.com/DefinitelyTyped/DefinitelyTyped/issues/25342" data-hovercard-type="issue" data-hovercard-url="/DefinitelyTyped/DefinitelyTyped/issues/25342/hovercard" href="https://github.com/DefinitelyTyped/DefinitelyTyped/issues/25342">#25342</a>). Therefore the global <code class="notranslate">URL</code> and <code class="notranslate">URLSearchParams</code> has been removed again.</p>
<p dir="auto">This fix (actually a workaround for a missing declaration merging feature of TypeScript) now has the drawback that we cannot use the global <code class="notranslate">URL</code> class in Node.js-code (instead we need to import it from the <code class="notranslate">url</code> module). This is especially bad for universal modules which are supposed to work in the browser + node by just using the global <code class="notranslate">URL</code> (which works since Node.js 10).</p>
<p dir="auto">So I want to discuss solutions for this atm. unsupported scenario here. (Without having local declarations in consuming projects.)</p>
<hr>
<p dir="auto">One solution would be to support this scenario in TypeScript (allow - exactly same? - global class definitions in multiple declaration files). <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/weswigham/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/weswigham">@weswigham</a> Would this be possible?</p>
<p dir="auto">A more straight-foward solution would be to create a new DT package (e.g. <code class="notranslate">node-global-url</code> or maybe better <code class="notranslate">whatwg-global-url</code>) which can be installed additionally and selected by using e.g. <code class="notranslate">"types": ["node", "node-global-url"]</code> in a <code class="notranslate">tsconfig.json</code> for projects which face the mentioned scenario above.</p>
<p dir="auto">Any other ideas?</p> | <ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I tried using the <code class="notranslate">@types/react-redux</code> package and had problems.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I tried using the latest stable version of tsc. <a href="https://www.npmjs.com/package/typescript" rel="nofollow">https://www.npmjs.com/package/typescript</a></li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have a question that is inappropriate for <a href="https://stackoverflow.com/" rel="nofollow">StackOverflow</a>. (Please ask any appropriate questions there).</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> <a href="https://github.com/blog/821-mention-somebody-they-re-notified">Mention</a> the authors (see <code class="notranslate">Definitions by:</code> in <code class="notranslate">index.d.ts</code>) so they can respond.</li>
</ul>
<p dir="auto"><a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/jamesreggio/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/jamesreggio">@jamesreggio</a> <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/JounQin/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/JounQin">@JounQin</a></p>
<p dir="auto">updating from <code class="notranslate">@types/react-redux 7.0.1</code> to <code class="notranslate">@types/react-redux 7.0.2</code> gives the following error:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="'/node_modules/hoist-non-react-statics' has no exported member 'NonReactStatics'.
47 import { NonReactStatics } from 'hoist-non-react-statics';"><pre class="notranslate"><code class="notranslate">'/node_modules/hoist-non-react-statics' has no exported member 'NonReactStatics'.
47 import { NonReactStatics } from 'hoist-non-react-statics';
</code></pre></div>
<p dir="auto">seems like it was introduced here: <a class="commit-link" data-hovercard-type="commit" data-hovercard-url="https://github.com/DefinitelyTyped/DefinitelyTyped/commit/8b1beff944f6c7bf913b6fcee31fb5f7129064a7/hovercard" href="https://github.com/DefinitelyTyped/DefinitelyTyped/commit/8b1beff944f6c7bf913b6fcee31fb5f7129064a7"><tt>8b1beff</tt></a></p> | 0 |
<p dir="auto">Hovering over X for a file tab causes a JS error (console pops up) indicating "jQuery is not defined".</p>
<p dir="auto">Atom Version: 1<br>
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_1) AppleWebKit/537.36 (KHTML, like Gecko) Atom/0.45.0 Atom-Shell/0.7.6 Safari/537.36<br>
User: <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/mtodd/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/mtodd">@mtodd</a><br>
Screenshot:<br>
<a target="_blank" rel="noopener noreferrer nofollow" href="https://camo.githubusercontent.com/a13899116a584fb5fc374b6298202a6651a0f51c6946c980b709154b73496636/68747470733a2f2f662e636c6f75642e6769746875622e636f6d2f6173736574732f3138322f313934353635392f64353831343564302d376664332d313165332d396438342d3064333733316264646437342e706e67"><img src="https://camo.githubusercontent.com/a13899116a584fb5fc374b6298202a6651a0f51c6946c980b709154b73496636/68747470733a2f2f662e636c6f75642e6769746875622e636f6d2f6173736574732f3138322f313934353635392f64353831343564302d376664332d313165332d396438342d3064333733316264646437342e706e67" alt="screenshot of console" data-canonical-src="https://f.cloud.github.com/assets/182/1945659/d58145d0-7fd3-11e3-9d84-0d3731bddd74.png" style="max-width: 100%;"></a></p> | <p dir="auto">Since I updated to 0.45.0 today, I'm getting the following error in the console after using Atom for a few minutes:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Uncaught ReferenceError: jQuery is not defined
/Applications/Atom.app/Contents/Resources/app/node_modules/bootstrap/js/tooltip.js:213"><pre class="notranslate"><code class="notranslate">Uncaught ReferenceError: jQuery is not defined
/Applications/Atom.app/Contents/Resources/app/node_modules/bootstrap/js/tooltip.js:213
</code></pre></div>
<p dir="auto">Atom version: 0.45.0<br>
User agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_5) AppleWebKit/537.36 (KHTML, like Gecko) Atom/0.45.0 Atom-Shell/0.7.6 Safari/537.36</p> | 1 |
<h5 dir="auto">System information (version)</h5>
<ul dir="auto">
<li>OpenCV => 3.4.0</li>
<li>Operating System / Platform => windows 7</li>
<li>Compiler => vs 2015</li>
</ul>
<h5 dir="auto">Detailed description</h5>
<p dir="auto">I am trying to open my webcam using cvCreateCameraCapture (0); or cvCaptureFromCAM (0) but it just opens Video Source window with my camera in it when I press ok nothing happens, it returns null.<br>
Anyone know what to do ?</p> | <h5 dir="auto">System information (version)</h5>
<ul dir="auto">
<li>OpenCV => : 4.2.0</li>
<li>Operating System / Platform => : Linux Ubuntu 18.04</li>
<li>CUDA => : 10.2</li>
</ul>
<h5 dir="auto">Detailed description</h5>
<p dir="auto">I am trying to compile (with cmake) a C++ object detection code that includes OpenCV and CUDA , however when I do that I receive an unsuitable CUDA version error. Here are the outputs of my nvidia compiler driver and nvcc version, which are different.</p>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/42215081/72248506-65931e00-3608-11ea-942f-135fc0e1a53b.jpg"><img src="https://user-images.githubusercontent.com/42215081/72248506-65931e00-3608-11ea-942f-135fc0e1a53b.jpg" alt="1" style="max-width: 100%;"></a><br>
<a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/42215081/72248649-b60a7b80-3608-11ea-84e4-0ecd6dc6a3bf.jpg"><img src="https://user-images.githubusercontent.com/42215081/72248649-b60a7b80-3608-11ea-84e4-0ecd6dc6a3bf.jpg" alt="2" style="max-width: 100%;"></a></p>
<p dir="auto">And above is the error I get. Any suggestions on how to resolve this?</p> | 0 |
<p dir="auto">When I use importMap, my code does not work as executable (<code class="notranslate">deno install</code>).</p>
<p dir="auto"><strong>Tested with Deno v1.30.3</strong>.</p>
<h2 dir="auto">Minimal reproducible example:</h2>
<p dir="auto"><strong>deno.json:</strong></p>
<div class="highlight highlight-source-json notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="{
...
"imports": {
"std/": "https://deno.land/[email protected]/"
},
...
}"><pre class="notranslate">{
<span class="pl-ii">...</span>
<span class="pl-ent">"imports"</span>: {
<span class="pl-ent">"std/"</span>: <span class="pl-s"><span class="pl-pds">"</span>https://deno.land/[email protected]/<span class="pl-pds">"</span></span>
},
<span class="pl-ii">...</span>
}</pre></div>
<p dir="auto"><strong>my-cli.ts</strong></p>
<div class="highlight highlight-source-ts notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="import * as log from 'std/log/mod.ts';
log.info('Hello world!')"><pre class="notranslate"><span class="pl-k">import</span> <span class="pl-c1">*</span> <span class="pl-k">as</span> <span class="pl-s1">log</span> <span class="pl-k">from</span> <span class="pl-s">'std/log/mod.ts'</span><span class="pl-kos">;</span>
<span class="pl-s1">log</span><span class="pl-kos">.</span><span class="pl-en">info</span><span class="pl-kos">(</span><span class="pl-s">'Hello world!'</span><span class="pl-kos">)</span></pre></div>
<p dir="auto"><strong>Install & run:</strong></p>
<div class="highlight highlight-source-shell notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="deno install -A ./my-cli.ts
my-cli <--- This throws the error"><pre class="notranslate">deno install -A ./my-cli.ts
my-cli <span class="pl-k"><</span>--- This throws the error</pre></div>
<p dir="auto"><strong>Error output:</strong></p>
<div class="highlight highlight-source-shell notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="error: Relative import path "std/log/mod.ts" not prefixed with / or ./ or ../
at file:///C:/temp/app.ts:1:22"><pre class="notranslate">error: Relative import path <span class="pl-s"><span class="pl-pds">"</span>std/log/mod.ts<span class="pl-pds">"</span></span> not prefixed with / or ./ or ../
at file:///C:/temp/app.ts:1:22</pre></div>
<p dir="auto">The same problem when I use an import map file (import_map.json). Only if I use absolute paths, it also works with <code class="notranslate">deno install</code>.</p> | <p dir="auto">It seems <code class="notranslate">deno install</code> currently doesn't auto-discover a <code class="notranslate">deno.json</code> or <code class="notranslate">deno.jsonc</code> config file.</p>
<p dir="auto">This is suggested in the help entry for <code class="notranslate">deno install -help</code>.</p>
<div class="highlight highlight-text-adblock notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content=" -c, --config <FILE>
The configuration file can be used to configure different aspects of
deno including TypeScript, linting, and code formatting. **Typically
the configuration file will be called `deno.json` or `deno.jsonc`
and automatically detected; in that case this flag is not necessary.**
See
https://deno.land/[email protected]/getting_started/configuration_file"><pre class="notranslate"> -c, --config <FILE>
The configuration file can be used to configure different aspects of
deno including TypeScript, linting, and code formatting. <span class="pl-k">**</span>Typically
the configuration file will be called `deno.json` or `deno.jsonc`
and automatically detected; in that case this flag is not necessary.<span class="pl-k">**</span>
See
https://deno.land/[email protected]/getting_started/configuration_file</pre></div>
<h2 dir="auto">Steps To Reproduce</h2>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="deno install -n my-module main.ts"><pre class="notranslate"><code class="notranslate">deno install -n my-module main.ts
</code></pre></div>
<h2 dir="auto">Expected Result</h2>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="#!/bin/sh
# generated by deno install
exec deno run --config /Users/foo/.deno/bin/.my-module.deno.json 'file:///Users/foo/my-module/main.ts' "$@""><pre class="notranslate"><code class="notranslate">#!/bin/sh
# generated by deno install
exec deno run --config /Users/foo/.deno/bin/.my-module.deno.json 'file:///Users/foo/my-module/main.ts' "$@"
</code></pre></div>
<h2 dir="auto">Actual Result</h2>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="#!/bin/sh
# generated by deno install
exec deno run --no-config 'file:///Users/foo/my-module/main.ts' "$@""><pre class="notranslate"><code class="notranslate">#!/bin/sh
# generated by deno install
exec deno run --no-config 'file:///Users/foo/my-module/main.ts' "$@"
</code></pre></div> | 1 |
<p dir="auto">While all other protocols are working, I can't access an URL using an HTTPS-proxy (<a href="https://stackoverflow.com/questions/71150284/python-request-https-proxy-errno-111-connection-refused" rel="nofollow">StackOverflow</a>)</p>
<h2 dir="auto">Expected Result</h2>
<p dir="auto">Open an HTTPS-URL using HTTPS-proxy.</p>
<h2 dir="auto">Actual Result</h2>
<p dir="auto">[Errno 111] Connection refused</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="---------------------------------------------------------------------------
ConnectionRefusedError Traceback (most recent call last)
[/usr/local/lib/python3.7/dist-packages/urllib3/connection.py](https://localhost:8080/#) in _new_conn(self)
158 conn = connection.create_connection(
--> 159 (self._dns_host, self.port), self.timeout, **extra_kw)
160
14 frames
[/usr/local/lib/python3.7/dist-packages/urllib3/util/connection.py](https://localhost:8080/#) in create_connection(address, timeout, source_address, socket_options)
79 if err is not None:
---> 80 raise err
81
[/usr/local/lib/python3.7/dist-packages/urllib3/util/connection.py](https://localhost:8080/#) in create_connection(address, timeout, source_address, socket_options)
69 sock.bind(source_address)
---> 70 sock.connect(sa)
71 return sock
ConnectionRefusedError: [Errno 111] Connection refused
During handling of the above exception, another exception occurred:
NewConnectionError Traceback (most recent call last)
[/usr/local/lib/python3.7/dist-packages/urllib3/connectionpool.py](https://localhost:8080/#) in urlopen(self, method, url, body, headers, retries, redirect, assert_same_host, timeout, pool_timeout, release_conn, chunked, body_pos, **response_kw)
593 if is_new_proxy_conn:
--> 594 self._prepare_proxy(conn)
595
[/usr/local/lib/python3.7/dist-packages/urllib3/connectionpool.py](https://localhost:8080/#) in _prepare_proxy(self, conn)
804 conn.set_tunnel(self._proxy_host, self.port, self.proxy_headers)
--> 805 conn.connect()
806
[/usr/local/lib/python3.7/dist-packages/urllib3/connection.py](https://localhost:8080/#) in connect(self)
300 # Add certificate verification
--> 301 conn = self._new_conn()
302 hostname = self.host
[/usr/local/lib/python3.7/dist-packages/urllib3/connection.py](https://localhost:8080/#) in _new_conn(self)
167 raise NewConnectionError(
--> 168 self, "Failed to establish a new connection: %s" % e)
169
NewConnectionError: <urllib3.connection.VerifiedHTTPSConnection object at 0x7fc4f55256d0>: Failed to establish a new connection: [Errno 111] Connection refused
During handling of the above exception, another exception occurred:
MaxRetryError Traceback (most recent call last)
[/usr/local/lib/python3.7/dist-packages/requests/adapters.py](https://localhost:8080/#) in send(self, request, stream, timeout, verify, cert, proxies)
449 retries=self.max_retries,
--> 450 timeout=timeout
451 )
[/usr/local/lib/python3.7/dist-packages/urllib3/connectionpool.py](https://localhost:8080/#) in urlopen(self, method, url, body, headers, retries, redirect, assert_same_host, timeout, pool_timeout, release_conn, chunked, body_pos, **response_kw)
637 retries = retries.increment(method, url, error=e, _pool=self,
--> 638 _stacktrace=sys.exc_info()[2])
639 retries.sleep()
[/usr/local/lib/python3.7/dist-packages/urllib3/util/retry.py](https://localhost:8080/#) in increment(self, method, url, response, error, _pool, _stacktrace)
398 if new_retry.is_exhausted():
--> 399 raise MaxRetryError(_pool, url, error or ResponseError(cause))
400
MaxRetryError: HTTPSConnectionPool(host='google.com', port=443): Max retries exceeded with url: / (Caused by ProxyError('Cannot connect to proxy.', NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x7fc4f55256d0>: Failed to establish a new connection: [Errno 111] Connection refused')))
During handling of the above exception, another exception occurred:
ProxyError Traceback (most recent call last)
[<ipython-input-5-0042a445fda6>](https://localhost:8080/#) in <module>()
5 print(proxy_url)
6
----> 7 r = requests.get('https://google.com/', proxies = {protocol: proxy_url})
8 r.status_code
[/usr/local/lib/python3.7/dist-packages/requests/api.py](https://localhost:8080/#) in get(url, params, **kwargs)
73 """
74
---> 75 return request('get', url, params=params, **kwargs)
76
77
[/usr/local/lib/python3.7/dist-packages/requests/api.py](https://localhost:8080/#) in request(method, url, **kwargs)
59 # cases, and look like a memory leak in others.
60 with sessions.Session() as session:
---> 61 return session.request(method=method, url=url, **kwargs)
62
63
[/usr/local/lib/python3.7/dist-packages/requests/sessions.py](https://localhost:8080/#) in request(self, method, url, params, data, headers, cookies, files, auth, timeout, allow_redirects, proxies, hooks, stream, verify, cert, json)
527 }
528 send_kwargs.update(settings)
--> 529 resp = self.send(prep, **send_kwargs)
530
531 return resp
[/usr/local/lib/python3.7/dist-packages/requests/sessions.py](https://localhost:8080/#) in send(self, request, **kwargs)
643
644 # Send the request
--> 645 r = adapter.send(request, **kwargs)
646
647 # Total elapsed time of the request (approximately)
[/usr/local/lib/python3.7/dist-packages/requests/adapters.py](https://localhost:8080/#) in send(self, request, stream, timeout, verify, cert, proxies)
511
512 if isinstance(e.reason, _ProxyError):
--> 513 raise ProxyError(e, request=request)
514
515 if isinstance(e.reason, _SSLError):
ProxyError: HTTPSConnectionPool(host='google.com', port=443): Max retries exceeded with url: / (Caused by ProxyError('Cannot connect to proxy.', NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x7fc4f55256d0>: Failed to establish a new connection: [Errno 111] Connection refused')))"><pre class="notranslate"><code class="notranslate">---------------------------------------------------------------------------
ConnectionRefusedError Traceback (most recent call last)
[/usr/local/lib/python3.7/dist-packages/urllib3/connection.py](https://localhost:8080/#) in _new_conn(self)
158 conn = connection.create_connection(
--> 159 (self._dns_host, self.port), self.timeout, **extra_kw)
160
14 frames
[/usr/local/lib/python3.7/dist-packages/urllib3/util/connection.py](https://localhost:8080/#) in create_connection(address, timeout, source_address, socket_options)
79 if err is not None:
---> 80 raise err
81
[/usr/local/lib/python3.7/dist-packages/urllib3/util/connection.py](https://localhost:8080/#) in create_connection(address, timeout, source_address, socket_options)
69 sock.bind(source_address)
---> 70 sock.connect(sa)
71 return sock
ConnectionRefusedError: [Errno 111] Connection refused
During handling of the above exception, another exception occurred:
NewConnectionError Traceback (most recent call last)
[/usr/local/lib/python3.7/dist-packages/urllib3/connectionpool.py](https://localhost:8080/#) in urlopen(self, method, url, body, headers, retries, redirect, assert_same_host, timeout, pool_timeout, release_conn, chunked, body_pos, **response_kw)
593 if is_new_proxy_conn:
--> 594 self._prepare_proxy(conn)
595
[/usr/local/lib/python3.7/dist-packages/urllib3/connectionpool.py](https://localhost:8080/#) in _prepare_proxy(self, conn)
804 conn.set_tunnel(self._proxy_host, self.port, self.proxy_headers)
--> 805 conn.connect()
806
[/usr/local/lib/python3.7/dist-packages/urllib3/connection.py](https://localhost:8080/#) in connect(self)
300 # Add certificate verification
--> 301 conn = self._new_conn()
302 hostname = self.host
[/usr/local/lib/python3.7/dist-packages/urllib3/connection.py](https://localhost:8080/#) in _new_conn(self)
167 raise NewConnectionError(
--> 168 self, "Failed to establish a new connection: %s" % e)
169
NewConnectionError: <urllib3.connection.VerifiedHTTPSConnection object at 0x7fc4f55256d0>: Failed to establish a new connection: [Errno 111] Connection refused
During handling of the above exception, another exception occurred:
MaxRetryError Traceback (most recent call last)
[/usr/local/lib/python3.7/dist-packages/requests/adapters.py](https://localhost:8080/#) in send(self, request, stream, timeout, verify, cert, proxies)
449 retries=self.max_retries,
--> 450 timeout=timeout
451 )
[/usr/local/lib/python3.7/dist-packages/urllib3/connectionpool.py](https://localhost:8080/#) in urlopen(self, method, url, body, headers, retries, redirect, assert_same_host, timeout, pool_timeout, release_conn, chunked, body_pos, **response_kw)
637 retries = retries.increment(method, url, error=e, _pool=self,
--> 638 _stacktrace=sys.exc_info()[2])
639 retries.sleep()
[/usr/local/lib/python3.7/dist-packages/urllib3/util/retry.py](https://localhost:8080/#) in increment(self, method, url, response, error, _pool, _stacktrace)
398 if new_retry.is_exhausted():
--> 399 raise MaxRetryError(_pool, url, error or ResponseError(cause))
400
MaxRetryError: HTTPSConnectionPool(host='google.com', port=443): Max retries exceeded with url: / (Caused by ProxyError('Cannot connect to proxy.', NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x7fc4f55256d0>: Failed to establish a new connection: [Errno 111] Connection refused')))
During handling of the above exception, another exception occurred:
ProxyError Traceback (most recent call last)
[<ipython-input-5-0042a445fda6>](https://localhost:8080/#) in <module>()
5 print(proxy_url)
6
----> 7 r = requests.get('https://google.com/', proxies = {protocol: proxy_url})
8 r.status_code
[/usr/local/lib/python3.7/dist-packages/requests/api.py](https://localhost:8080/#) in get(url, params, **kwargs)
73 """
74
---> 75 return request('get', url, params=params, **kwargs)
76
77
[/usr/local/lib/python3.7/dist-packages/requests/api.py](https://localhost:8080/#) in request(method, url, **kwargs)
59 # cases, and look like a memory leak in others.
60 with sessions.Session() as session:
---> 61 return session.request(method=method, url=url, **kwargs)
62
63
[/usr/local/lib/python3.7/dist-packages/requests/sessions.py](https://localhost:8080/#) in request(self, method, url, params, data, headers, cookies, files, auth, timeout, allow_redirects, proxies, hooks, stream, verify, cert, json)
527 }
528 send_kwargs.update(settings)
--> 529 resp = self.send(prep, **send_kwargs)
530
531 return resp
[/usr/local/lib/python3.7/dist-packages/requests/sessions.py](https://localhost:8080/#) in send(self, request, **kwargs)
643
644 # Send the request
--> 645 r = adapter.send(request, **kwargs)
646
647 # Total elapsed time of the request (approximately)
[/usr/local/lib/python3.7/dist-packages/requests/adapters.py](https://localhost:8080/#) in send(self, request, stream, timeout, verify, cert, proxies)
511
512 if isinstance(e.reason, _ProxyError):
--> 513 raise ProxyError(e, request=request)
514
515 if isinstance(e.reason, _SSLError):
ProxyError: HTTPSConnectionPool(host='google.com', port=443): Max retries exceeded with url: / (Caused by ProxyError('Cannot connect to proxy.', NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x7fc4f55256d0>: Failed to establish a new connection: [Errno 111] Connection refused')))
</code></pre></div>
<h2 dir="auto">Reproduction Steps</h2>
<p dir="auto">Here is also a google <a href="https://colab.research.google.com/drive/1mlRyfHna4jH1R27SYJoRO9udoQYu5UsB?usp=sharing" rel="nofollow">colab</a> that reproduces this issue.</p>
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="import requests
import random
PROXY_LIST_URL = 'https://proxylist.geonode.com/api/proxy-list?limit=50&page=1&sort_by=lastChecked&sort_type=desc&protocols=https'
proxies = requests.get(PROXY_LIST_URL).json()['data']
proxy = random.choice(proxies)
protocol = proxy['protocols'][0]
proxy_url = f"{protocol}://{proxy['ip']}:{proxy['port']}"
print(proxy_url)
r = requests.get('https://google.com', proxies = {protocol: proxy_url})
print(r.status_code)"><pre class="notranslate"><span class="pl-k">import</span> <span class="pl-s1">requests</span>
<span class="pl-k">import</span> <span class="pl-s1">random</span>
<span class="pl-v">PROXY_LIST_URL</span> <span class="pl-c1">=</span> <span class="pl-s">'https://proxylist.geonode.com/api/proxy-list?limit=50&page=1&sort_by=lastChecked&sort_type=desc&protocols=https'</span>
<span class="pl-s1">proxies</span> <span class="pl-c1">=</span> <span class="pl-s1">requests</span>.<span class="pl-en">get</span>(<span class="pl-v">PROXY_LIST_URL</span>).<span class="pl-en">json</span>()[<span class="pl-s">'data'</span>]
<span class="pl-s1">proxy</span> <span class="pl-c1">=</span> <span class="pl-s1">random</span>.<span class="pl-en">choice</span>(<span class="pl-s1">proxies</span>)
<span class="pl-s1">protocol</span> <span class="pl-c1">=</span> <span class="pl-s1">proxy</span>[<span class="pl-s">'protocols'</span>][<span class="pl-c1">0</span>]
<span class="pl-s1">proxy_url</span> <span class="pl-c1">=</span> <span class="pl-s">f"<span class="pl-s1"><span class="pl-kos">{</span><span class="pl-s1">protocol</span><span class="pl-kos">}</span></span>://<span class="pl-s1"><span class="pl-kos">{</span><span class="pl-s1">proxy</span>[<span class="pl-s">'ip'</span>]<span class="pl-kos">}</span></span>:<span class="pl-s1"><span class="pl-kos">{</span><span class="pl-s1">proxy</span>[<span class="pl-s">'port'</span>]<span class="pl-kos">}</span></span>"</span>
<span class="pl-en">print</span>(<span class="pl-s1">proxy_url</span>)
<span class="pl-s1">r</span> <span class="pl-c1">=</span> <span class="pl-s1">requests</span>.<span class="pl-en">get</span>(<span class="pl-s">'https://google.com'</span>, <span class="pl-s1">proxies</span> <span class="pl-c1">=</span> {<span class="pl-s1">protocol</span>: <span class="pl-s1">proxy_url</span>})
<span class="pl-en">print</span>(<span class="pl-s1">r</span>.<span class="pl-s1">status_code</span>)</pre></div>
<h2 dir="auto">System Information</h2>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="$ python -m requests.help"><pre class="notranslate"><code class="notranslate">$ python -m requests.help
</code></pre></div>
<div class="highlight highlight-source-json notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="{
"chardet": {
"version": "3.0.4"
},
"charset_normalizer": {
"version": "2.0.12"
},
"cryptography": {
"version": ""
},
"idna": {
"version": "2.10"
},
"implementation": {
"name": "CPython",
"version": "3.7.12"
},
"platform": {
"release": "5.4.144+",
"system": "Linux"
},
"pyOpenSSL": {
"openssl_version": "",
"version": null
},
"requests": {
"version": "2.27.1"
},
"system_ssl": {
"version": "1010100f"
},
"urllib3": {
"version": "1.24.3"
},
"using_charset_normalizer": false,
"using_pyopenssl": false
}"><pre class="notranslate">{
<span class="pl-ent">"chardet"</span>: {
<span class="pl-ent">"version"</span>: <span class="pl-s"><span class="pl-pds">"</span>3.0.4<span class="pl-pds">"</span></span>
},
<span class="pl-ent">"charset_normalizer"</span>: {
<span class="pl-ent">"version"</span>: <span class="pl-s"><span class="pl-pds">"</span>2.0.12<span class="pl-pds">"</span></span>
},
<span class="pl-ent">"cryptography"</span>: {
<span class="pl-ent">"version"</span>: <span class="pl-s"><span class="pl-pds">"</span><span class="pl-pds">"</span></span>
},
<span class="pl-ent">"idna"</span>: {
<span class="pl-ent">"version"</span>: <span class="pl-s"><span class="pl-pds">"</span>2.10<span class="pl-pds">"</span></span>
},
<span class="pl-ent">"implementation"</span>: {
<span class="pl-ent">"name"</span>: <span class="pl-s"><span class="pl-pds">"</span>CPython<span class="pl-pds">"</span></span>,
<span class="pl-ent">"version"</span>: <span class="pl-s"><span class="pl-pds">"</span>3.7.12<span class="pl-pds">"</span></span>
},
<span class="pl-ent">"platform"</span>: {
<span class="pl-ent">"release"</span>: <span class="pl-s"><span class="pl-pds">"</span>5.4.144+<span class="pl-pds">"</span></span>,
<span class="pl-ent">"system"</span>: <span class="pl-s"><span class="pl-pds">"</span>Linux<span class="pl-pds">"</span></span>
},
<span class="pl-ent">"pyOpenSSL"</span>: {
<span class="pl-ent">"openssl_version"</span>: <span class="pl-s"><span class="pl-pds">"</span><span class="pl-pds">"</span></span>,
<span class="pl-ent">"version"</span>: <span class="pl-c1">null</span>
},
<span class="pl-ent">"requests"</span>: {
<span class="pl-ent">"version"</span>: <span class="pl-s"><span class="pl-pds">"</span>2.27.1<span class="pl-pds">"</span></span>
},
<span class="pl-ent">"system_ssl"</span>: {
<span class="pl-ent">"version"</span>: <span class="pl-s"><span class="pl-pds">"</span>1010100f<span class="pl-pds">"</span></span>
},
<span class="pl-ent">"urllib3"</span>: {
<span class="pl-ent">"version"</span>: <span class="pl-s"><span class="pl-pds">"</span>1.24.3<span class="pl-pds">"</span></span>
},
<span class="pl-ent">"using_charset_normalizer"</span>: <span class="pl-c1">false</span>,
<span class="pl-ent">"using_pyopenssl"</span>: <span class="pl-c1">false</span>
}</pre></div> | <p dir="auto"><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="1446150654" data-permission-text="Title is private" data-url="https://github.com/foyoux/aligo/issues/55" data-hovercard-type="issue" data-hovercard-url="/foyoux/aligo/issues/55/hovercard" href="https://github.com/foyoux/aligo/issues/55">foyoux/aligo#55</a></p>
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="from dataclasses import dataclass
import requests
@dataclass
class ShareToken(str):
"""
>>> assert isinstance(ShareToken('xxx'), str)
"""
share_token: str = None
expire_time: str = None
expires_in: int = None
def __new__(cls, *args, **kwargs):
share_token = kwargs.get('share_token')
if share_token is None:
share_token = args[0]
return super().__new__(cls, share_token)
def __str__(self):
return self.share_token
def main():
share_token = ShareToken('xxx')
resp = requests.get('https://github.com/', headers={
# Why am I doing this?
# Because the share_token has a short validity period,
# but the program may need it for a long time,
# the object used is convenient for updating in place when it fails.
# Maybe I didn't express clearly,
# but as far as my own application scenario is concerned,
# this is the best way. Of course, these are not the point,
# the point is that I think headers should allow subclasses of str or bytes. thanks
'x-share-token': share_token
})
print(resp.status_code)
if __name__ == '__main__':
main()"><pre class="notranslate"><span class="pl-k">from</span> <span class="pl-s1">dataclasses</span> <span class="pl-k">import</span> <span class="pl-s1">dataclass</span>
<span class="pl-k">import</span> <span class="pl-s1">requests</span>
<span class="pl-en">@<span class="pl-s1">dataclass</span></span>
<span class="pl-k">class</span> <span class="pl-v">ShareToken</span>(<span class="pl-s1">str</span>):
<span class="pl-s">"""</span>
<span class="pl-s"> >>> assert isinstance(ShareToken('xxx'), str)</span>
<span class="pl-s"> """</span>
<span class="pl-s1">share_token</span>: <span class="pl-s1">str</span> <span class="pl-c1">=</span> <span class="pl-c1">None</span>
<span class="pl-s1">expire_time</span>: <span class="pl-s1">str</span> <span class="pl-c1">=</span> <span class="pl-c1">None</span>
<span class="pl-s1">expires_in</span>: <span class="pl-s1">int</span> <span class="pl-c1">=</span> <span class="pl-c1">None</span>
<span class="pl-k">def</span> <span class="pl-en">__new__</span>(<span class="pl-s1">cls</span>, <span class="pl-c1">*</span><span class="pl-s1">args</span>, <span class="pl-c1">**</span><span class="pl-s1">kwargs</span>):
<span class="pl-s1">share_token</span> <span class="pl-c1">=</span> <span class="pl-s1">kwargs</span>.<span class="pl-en">get</span>(<span class="pl-s">'share_token'</span>)
<span class="pl-k">if</span> <span class="pl-s1">share_token</span> <span class="pl-c1">is</span> <span class="pl-c1">None</span>:
<span class="pl-s1">share_token</span> <span class="pl-c1">=</span> <span class="pl-s1">args</span>[<span class="pl-c1">0</span>]
<span class="pl-k">return</span> <span class="pl-en">super</span>().<span class="pl-en">__new__</span>(<span class="pl-s1">cls</span>, <span class="pl-s1">share_token</span>)
<span class="pl-k">def</span> <span class="pl-en">__str__</span>(<span class="pl-s1">self</span>):
<span class="pl-k">return</span> <span class="pl-s1">self</span>.<span class="pl-s1">share_token</span>
<span class="pl-k">def</span> <span class="pl-en">main</span>():
<span class="pl-s1">share_token</span> <span class="pl-c1">=</span> <span class="pl-v">ShareToken</span>(<span class="pl-s">'xxx'</span>)
<span class="pl-s1">resp</span> <span class="pl-c1">=</span> <span class="pl-s1">requests</span>.<span class="pl-en">get</span>(<span class="pl-s">'https://github.com/'</span>, <span class="pl-s1">headers</span><span class="pl-c1">=</span>{
<span class="pl-c"># Why am I doing this?</span>
<span class="pl-c"># Because the share_token has a short validity period,</span>
<span class="pl-c"># but the program may need it for a long time,</span>
<span class="pl-c"># the object used is convenient for updating in place when it fails.</span>
<span class="pl-c"># Maybe I didn't express clearly,</span>
<span class="pl-c"># but as far as my own application scenario is concerned,</span>
<span class="pl-c"># this is the best way. Of course, these are not the point,</span>
<span class="pl-c"># the point is that I think headers should allow subclasses of str or bytes. thanks</span>
<span class="pl-s">'x-share-token'</span>: <span class="pl-s1">share_token</span>
})
<span class="pl-en">print</span>(<span class="pl-s1">resp</span>.<span class="pl-s1">status_code</span>)
<span class="pl-k">if</span> <span class="pl-s1">__name__</span> <span class="pl-c1">==</span> <span class="pl-s">'__main__'</span>:
<span class="pl-en">main</span>()</pre></div>
<h2 dir="auto">Expected Result</h2>
<p dir="auto">The operation is successful, no error is reported, and 200 is printed out.</p>
<h2 dir="auto">Actual Result</h2>
<p dir="auto">It is OK under requests==2.27.1, but the latest 2.28.0 & 2.28.1 reports an error "requests.exceptions.InvalidHeader: Header part (...."</p>
<div class="highlight highlight-source-shell notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="Traceback (most recent call last):
File "/home/foyou/Desktop/projects/foyoux/aligo/main.py", line 42, in <module>
main()
File "/home/foyou/Desktop/projects/foyoux/aligo/main.py", line 27, in main
resp = requests.get('https://github.com/', headers={
File "/home/foyou/Desktop/projects/foyoux/aligo/venv/lib/python3.10/site-packages/requests/api.py", line 73, in get
return request("get", url, params=params, **kwargs)
File "/home/foyou/Desktop/projects/foyoux/aligo/venv/lib/python3.10/site-packages/requests/api.py", line 59, in request
return session.request(method=method, url=url, **kwargs)
File "/home/foyou/Desktop/projects/foyoux/aligo/venv/lib/python3.10/site-packages/requests/sessions.py", line 573, in request
prep = self.prepare_request(req)
File "/home/foyou/Desktop/projects/foyoux/aligo/venv/lib/python3.10/site-packages/requests/sessions.py", line 484, in prepare_request
p.prepare(
File "/home/foyou/Desktop/projects/foyoux/aligo/venv/lib/python3.10/site-packages/requests/models.py", line 369, in prepare
self.prepare_headers(headers)
File "/home/foyou/Desktop/projects/foyoux/aligo/venv/lib/python3.10/site-packages/requests/models.py", line 491, in prepare_headers
check_header_validity(header)
File "/home/foyou/Desktop/projects/foyoux/aligo/venv/lib/python3.10/site-packages/requests/utils.py", line 1037, in check_header_validity
raise InvalidHeader(
requests.exceptions.InvalidHeader: Header part (ShareToken(share_token='xxx', expire_time=None, expires_in=None)) from {'x-share-token': ShareToken(share_token='xxx', expire_time=None, expires_in=None)} must be of type str or bytes, not <class '__main__.ShareToken'>"><pre class="notranslate">Traceback (most recent call last):
File <span class="pl-s"><span class="pl-pds">"</span>/home/foyou/Desktop/projects/foyoux/aligo/main.py<span class="pl-pds">"</span></span>, line 42, <span class="pl-k">in</span> <span class="pl-k"><</span>module<span class="pl-k">></span>
<span class="pl-en">main</span>()
File <span class="pl-s"><span class="pl-pds">"</span>/home/foyou/Desktop/projects/foyoux/aligo/main.py<span class="pl-pds">"</span></span>, line 27, <span class="pl-k">in</span> main
resp = requests.get(<span class="pl-s"><span class="pl-pds">'</span>https://github.com/<span class="pl-pds">'</span></span>, headers={
File <span class="pl-s"><span class="pl-pds">"</span>/home/foyou/Desktop/projects/foyoux/aligo/venv/lib/python3.10/site-packages/requests/api.py<span class="pl-pds">"</span></span>, line 73, <span class="pl-k">in</span> get
<span class="pl-k">return</span> request(<span class="pl-s"><span class="pl-pds">"</span>get<span class="pl-pds">"</span></span>, url, params=params, <span class="pl-k">**</span>kwargs)
File <span class="pl-s"><span class="pl-pds">"</span>/home/foyou/Desktop/projects/foyoux/aligo/venv/lib/python3.10/site-packages/requests/api.py<span class="pl-pds">"</span></span>, line 59, <span class="pl-k">in</span> request
<span class="pl-k">return</span> session.request(method=method, url=url, <span class="pl-k">**</span>kwargs)
File <span class="pl-s"><span class="pl-pds">"</span>/home/foyou/Desktop/projects/foyoux/aligo/venv/lib/python3.10/site-packages/requests/sessions.py<span class="pl-pds">"</span></span>, line 573, <span class="pl-k">in</span> request
prep = self.prepare_request(req)
File <span class="pl-s"><span class="pl-pds">"</span>/home/foyou/Desktop/projects/foyoux/aligo/venv/lib/python3.10/site-packages/requests/sessions.py<span class="pl-pds">"</span></span>, line 484, <span class="pl-k">in</span> prepare_request
p.prepare(
File <span class="pl-s"><span class="pl-pds">"</span>/home/foyou/Desktop/projects/foyoux/aligo/venv/lib/python3.10/site-packages/requests/models.py<span class="pl-pds">"</span></span>, line 369, <span class="pl-k">in</span> prepare
self.prepare_headers(headers)
File <span class="pl-s"><span class="pl-pds">"</span>/home/foyou/Desktop/projects/foyoux/aligo/venv/lib/python3.10/site-packages/requests/models.py<span class="pl-pds">"</span></span>, line 491, <span class="pl-k">in</span> prepare_headers
check_header_validity(header)
File <span class="pl-s"><span class="pl-pds">"</span>/home/foyou/Desktop/projects/foyoux/aligo/venv/lib/python3.10/site-packages/requests/utils.py<span class="pl-pds">"</span></span>, line 1037, <span class="pl-k">in</span> check_header_validity
raise InvalidHeader(
requests.exceptions.InvalidHeader: Header part (ShareToken(share_token=<span class="pl-s"><span class="pl-pds">'</span>xxx<span class="pl-pds">'</span></span>, expire_time=None, expires_in=None)) from {<span class="pl-s"><span class="pl-pds">'</span>x-share-token<span class="pl-pds">'</span></span>: ShareToken(share_token=<span class="pl-s"><span class="pl-pds">'</span>xxx<span class="pl-pds">'</span></span>, expire_time=None, expires_in=None)} must be of <span class="pl-c1">type</span> str or bytes, not <span class="pl-k"><</span>class <span class="pl-s"><span class="pl-pds">'</span>__main__.ShareToken<span class="pl-pds">'</span></span><span class="pl-k">></span></pre></div>
<h2 dir="auto">Reproduction Steps</h2>
<p dir="auto">run this code</p>
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="
from dataclasses import dataclass
import requests
@dataclass
class ShareToken(str):
"""
>>> assert isinstance(ShareToken('xxx'), str)
"""
share_token: str = None
expire_time: str = None
expires_in: int = None
def __new__(cls, *args, **kwargs):
share_token = kwargs.get('share_token')
if share_token is None:
share_token = args[0]
return super().__new__(cls, share_token)
def __str__(self):
return self.share_token
def main():
share_token = ShareToken('xxx')
resp = requests.get('https://github.com/', headers={
# Why am I doing this?
# Because the share_token has a short validity period,
# but the program may need it for a long time,
# the object used is convenient for updating in place when it fails.
# Maybe I didn't express clearly,
# but as far as my own application scenario is concerned,
# this is the best way. Of course, these are not the point,
# the point is that I think headers should allow subclasses of str or bytes. thanks
'x-share-token': share_token
})
print(resp.status_code)
if __name__ == '__main__':
main()"><pre class="notranslate"><span class="pl-k">from</span> <span class="pl-s1">dataclasses</span> <span class="pl-k">import</span> <span class="pl-s1">dataclass</span>
<span class="pl-k">import</span> <span class="pl-s1">requests</span>
<span class="pl-en">@<span class="pl-s1">dataclass</span></span>
<span class="pl-k">class</span> <span class="pl-v">ShareToken</span>(<span class="pl-s1">str</span>):
<span class="pl-s">"""</span>
<span class="pl-s"> >>> assert isinstance(ShareToken('xxx'), str)</span>
<span class="pl-s"> """</span>
<span class="pl-s1">share_token</span>: <span class="pl-s1">str</span> <span class="pl-c1">=</span> <span class="pl-c1">None</span>
<span class="pl-s1">expire_time</span>: <span class="pl-s1">str</span> <span class="pl-c1">=</span> <span class="pl-c1">None</span>
<span class="pl-s1">expires_in</span>: <span class="pl-s1">int</span> <span class="pl-c1">=</span> <span class="pl-c1">None</span>
<span class="pl-k">def</span> <span class="pl-en">__new__</span>(<span class="pl-s1">cls</span>, <span class="pl-c1">*</span><span class="pl-s1">args</span>, <span class="pl-c1">**</span><span class="pl-s1">kwargs</span>):
<span class="pl-s1">share_token</span> <span class="pl-c1">=</span> <span class="pl-s1">kwargs</span>.<span class="pl-en">get</span>(<span class="pl-s">'share_token'</span>)
<span class="pl-k">if</span> <span class="pl-s1">share_token</span> <span class="pl-c1">is</span> <span class="pl-c1">None</span>:
<span class="pl-s1">share_token</span> <span class="pl-c1">=</span> <span class="pl-s1">args</span>[<span class="pl-c1">0</span>]
<span class="pl-k">return</span> <span class="pl-en">super</span>().<span class="pl-en">__new__</span>(<span class="pl-s1">cls</span>, <span class="pl-s1">share_token</span>)
<span class="pl-k">def</span> <span class="pl-en">__str__</span>(<span class="pl-s1">self</span>):
<span class="pl-k">return</span> <span class="pl-s1">self</span>.<span class="pl-s1">share_token</span>
<span class="pl-k">def</span> <span class="pl-en">main</span>():
<span class="pl-s1">share_token</span> <span class="pl-c1">=</span> <span class="pl-v">ShareToken</span>(<span class="pl-s">'xxx'</span>)
<span class="pl-s1">resp</span> <span class="pl-c1">=</span> <span class="pl-s1">requests</span>.<span class="pl-en">get</span>(<span class="pl-s">'https://github.com/'</span>, <span class="pl-s1">headers</span><span class="pl-c1">=</span>{
<span class="pl-c"># Why am I doing this?</span>
<span class="pl-c"># Because the share_token has a short validity period,</span>
<span class="pl-c"># but the program may need it for a long time,</span>
<span class="pl-c"># the object used is convenient for updating in place when it fails.</span>
<span class="pl-c"># Maybe I didn't express clearly,</span>
<span class="pl-c"># but as far as my own application scenario is concerned,</span>
<span class="pl-c"># this is the best way. Of course, these are not the point,</span>
<span class="pl-c"># the point is that I think headers should allow subclasses of str or bytes. thanks</span>
<span class="pl-s">'x-share-token'</span>: <span class="pl-s1">share_token</span>
})
<span class="pl-en">print</span>(<span class="pl-s1">resp</span>.<span class="pl-s1">status_code</span>)
<span class="pl-k">if</span> <span class="pl-s1">__name__</span> <span class="pl-c1">==</span> <span class="pl-s">'__main__'</span>:
<span class="pl-en">main</span>()</pre></div>
<h2 dir="auto">System Information</h2>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="$ python -m requests.help"><pre class="notranslate"><code class="notranslate">$ python -m requests.help
</code></pre></div>
<div class="highlight highlight-source-json notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="{
"chardet": {
"version": null
},
"charset_normalizer": {
"version": "2.0.12"
},
"cryptography": {
"version": ""
},
"idna": {
"version": "3.3"
},
"implementation": {
"name": "CPython",
"version": "3.10.5"
},
"platform": {
"release": "5.14.0-1051-oem",
"system": "Linux"
},
"pyOpenSSL": {
"openssl_version": "",
"version": null
},
"requests": {
"version": "2.28.1"
},
"system_ssl": {
"version": "1010106f"
},
"urllib3": {
"version": "1.26.12"
},
"using_charset_normalizer": true,
"using_pyopenssl": false
}"><pre class="notranslate">{
<span class="pl-ent">"chardet"</span>: {
<span class="pl-ent">"version"</span>: <span class="pl-c1">null</span>
},
<span class="pl-ent">"charset_normalizer"</span>: {
<span class="pl-ent">"version"</span>: <span class="pl-s"><span class="pl-pds">"</span>2.0.12<span class="pl-pds">"</span></span>
},
<span class="pl-ent">"cryptography"</span>: {
<span class="pl-ent">"version"</span>: <span class="pl-s"><span class="pl-pds">"</span><span class="pl-pds">"</span></span>
},
<span class="pl-ent">"idna"</span>: {
<span class="pl-ent">"version"</span>: <span class="pl-s"><span class="pl-pds">"</span>3.3<span class="pl-pds">"</span></span>
},
<span class="pl-ent">"implementation"</span>: {
<span class="pl-ent">"name"</span>: <span class="pl-s"><span class="pl-pds">"</span>CPython<span class="pl-pds">"</span></span>,
<span class="pl-ent">"version"</span>: <span class="pl-s"><span class="pl-pds">"</span>3.10.5<span class="pl-pds">"</span></span>
},
<span class="pl-ent">"platform"</span>: {
<span class="pl-ent">"release"</span>: <span class="pl-s"><span class="pl-pds">"</span>5.14.0-1051-oem<span class="pl-pds">"</span></span>,
<span class="pl-ent">"system"</span>: <span class="pl-s"><span class="pl-pds">"</span>Linux<span class="pl-pds">"</span></span>
},
<span class="pl-ent">"pyOpenSSL"</span>: {
<span class="pl-ent">"openssl_version"</span>: <span class="pl-s"><span class="pl-pds">"</span><span class="pl-pds">"</span></span>,
<span class="pl-ent">"version"</span>: <span class="pl-c1">null</span>
},
<span class="pl-ent">"requests"</span>: {
<span class="pl-ent">"version"</span>: <span class="pl-s"><span class="pl-pds">"</span>2.28.1<span class="pl-pds">"</span></span>
},
<span class="pl-ent">"system_ssl"</span>: {
<span class="pl-ent">"version"</span>: <span class="pl-s"><span class="pl-pds">"</span>1010106f<span class="pl-pds">"</span></span>
},
<span class="pl-ent">"urllib3"</span>: {
<span class="pl-ent">"version"</span>: <span class="pl-s"><span class="pl-pds">"</span>1.26.12<span class="pl-pds">"</span></span>
},
<span class="pl-ent">"using_charset_normalizer"</span>: <span class="pl-c1">true</span>,
<span class="pl-ent">"using_pyopenssl"</span>: <span class="pl-c1">false</span>
}</pre></div> | 0 |
<ul dir="auto">
<li>The same code produces different outputs depending on whether it is run with a <code class="notranslate">lax.while_loop</code> or a native python <code class="notranslate">while</code> loop.</li>
<li>The output of the <code class="notranslate">lax.while_loop</code> is the incorrect one. We know this because this is part of a physics simulation tool (JAX-MD), and the <code class="notranslate">lax.while_loop</code> version of the code deletes some particles and duplicates others, while the python <code class="notranslate">while</code> loop version correctly preserves all particles.</li>
<li>This behavior is sensitive to the specific values in the multi-dimensional <code class="notranslate">grid</code> array that is being passed into the while loop. If <code class="notranslate">grid</code> is initialized randomly, the output of the two while loops becomes identical.</li>
<li>The <code class="notranslate">lax.while_loop</code> code does correctly preserve particles for other system configurations -- e.g. for a system which is 3d instead of 2d, or when the function is pmap-ed across multiple TPU cores.</li>
<li>We've verified this bug on both TPU and CPU.</li>
<li>This difference is output is present even when the while loop is run for only one step.</li>
</ul>
<p dir="auto">The code pasted below throws an assertion when the result of the two while loops are different. This repro is partially minimized, but we were unable to fully minimize it, since it seems brittle to specific aspects of the test case.</p>
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="
import jax.numpy as np
import jax
jax.config.update('jax_numpy_rank_promotion', 'raise')
from jax import lax, vmap
import math
import numpy as onp
import einops
# # Grid Packing / Unpacking
def get_grid_centers(box_size, cell_size, num_dims):
cells_count_per_side = int(onp.ceil(box_size / cell_size))
grid_centers = onp.zeros(tuple(
[cells_count_per_side]*num_dims + [num_dims]
))
for i in range(num_dims):
grid_centers[...,i] = (onp.reshape(onp.arange(cells_count_per_side),
tuple([1]*i + [cells_count_per_side] + [1]*(num_dims-i-1)))
+ 0.5)*cell_size
return np.array(grid_centers)
def positions_to_grid(position, box_size, cell_size, num_dims, particle_id, aux=None):
cells = int(math.ceil(box_size / cell_size))
N = position.shape[0]
cell_contents = np.concatenate([position, particle_id[:, None]], axis=-1)
if aux is not None:
cell_contents, *_ = set_aux(cell_contents, aux)
grid = np.zeros((cells ** num_dims, cell_contents.shape[-1]))
grid = grid.at[:N, :].set(cell_contents)
centers = get_grid_centers(box_size, cell_size, num_dims).reshape((-1, num_dims))
grid = grid.at[:N, :num_dims].add(-centers[:N])
grid = np.reshape(grid, (cells,) * num_dims + (-1,))
return grid
def pad_axis_channel_last(X, factors, axis_ind, max_grid_distance = 1):
num_dims = len(factors)
axes_s = ' '.join([chr(ord('x') + i) for i in range(num_dims)])
factors_s = ' '.join(['f'+chr(ord('x') + i) for i in range(num_dims)])
fact_d = {}
for i in range(num_dims):
fact_d['f' + chr(ord('x') + i)] = factors[i]
# all entries for all dimensions before the target axis
all_slice = tuple(slice(X.shape[j]) for j in range(axis_ind + 1))
# the end halo along the target axis
idx = all_slice + (slice(-max_grid_distance, X.shape[axis_ind + 1]),)
p = X[idx]
p = einops.rearrange(p, f'({factors_s}) {axes_s} c -> {factors_s} {axes_s} c', **fact_d)
p = np.roll(p, (0,) * axis_ind + (1,) + (0,) * (X.ndim - axis_ind - 1), axis=range(X.ndim))
p1 = einops.rearrange(p, f'{factors_s} {axes_s} c -> ({factors_s}) {axes_s} c')
# the start halo along the target axis
idx = all_slice + (slice(0, max_grid_distance),)
p = X[idx]
p = einops.rearrange(p, f'({factors_s}) {axes_s} c -> {factors_s} {axes_s} c', **fact_d)
p = np.roll(p, (0,) * axis_ind + (-1,) + (0,) * (X.ndim - axis_ind - 1), axis=range(X.ndim))
p2 = einops.rearrange(p, f'{factors_s} {axes_s} c -> ({factors_s}) {axes_s} c')
X = np.concatenate([p1, X, p2], axis=1 + axis_ind)
return X
def fold_factors(batch_size, grid_shape, max_grid_distance):
num_dims = len(grid_shape)
max_folds = onp.log(batch_size) / onp.log(2)
folds = onp.zeros((num_dims,), onp.int32)
for i in range(int(max_folds)*num_dims):
dim = i % num_dims
# folds[dim]+2, rather than +1, since we need an even number of cells for pairwise exchange in update_grid_locations
width, remain = divmod(grid_shape[dim], 2**(folds[dim]+2))
# width, remain = divmod(grid_shape[dim], 2**(folds[dim]+1))
# TODO is 2*max_grid_distance the right cutoff?
if remain == 0 and width >= max_grid_distance:
folds[dim] += 1
if onp.sum(folds) == max_folds:
break
factors = 2 ** folds
if onp.sum(folds) < max_folds:
print(f"Folds {folds} have sum smaller than target of {max_folds}. This corresponds to a batch size of {onp.prod(factors)} rather than the target of {batch_size}.")
return factors
def order_grid_by_factors(num_dims):
front_order = ()
back_order = ()
for i in range(num_dims):
front_order += (2 * i,)
back_order += (2 * i + 1,)
return front_order + back_order + (2 * num_dims,)
def fold_grid(X, max_grid_distance, batch_size=None, factors=None, inner_fold=True):
num_dims = X.ndim - 1
if factors is None:
factors = fold_factors(batch_size, X.shape[:-1], max_grid_distance)
X_shape = []
for i in range(num_dims):
_, ragged = divmod(X.shape[i], factors[i])
assert ragged == 0
X_shape += [factors[i], X.shape[i] // factors[i]]
X_shape += [X.shape[-1]]
if onp.min(onp.array(X.shape[:-1]) / onp.array(factors)) < max_grid_distance:
print(f"Folded grid may be too small. This failure is happening when splitting across devices. factors {factors} X.shape {X.shape} new X_shape {X_shape}.")
ordering = order_grid_by_factors(num_dims)
X = np.reshape(X, X_shape)
X = np.transpose(X, ordering)
if inner_fold:
X = X.reshape((-1,) + X.shape[num_dims:])
else:
X = folded_pad(X, max_grid_distance, factors)
return X, factors
# Dynamics
def pairwise_exchange(X, cell_size, axis, num_dims):
particle_data_size = X.shape[-1] - num_dims
axes_pre = ' '.join(['(' + chr(ord('x') + i) + ' q)' if i == axis else chr(ord('x') + i) for i in range(num_dims)])
axes_post = ' '.join([chr(ord('x') + i) for i in range(num_dims)])
X = einops.rearrange(X, f'{axes_pre} c -> q {axes_post} c', q=2)
shift = onp.zeros((2, num_dims+particle_data_size))
shift[0,axis] = cell_size
shift[1,axis] = -cell_size
shift = shift.reshape((2,) + (1,)*num_dims + (num_dims+particle_data_size,))
_Xrev = X[::-1]
X_swapped = _Xrev + shift*(_Xrev[..., [-1]]>0) # only add offset to occupied cells
square_displacement = lambda _X: np.sum(np.sum(_X[...,:num_dims]**2 * (_X[...,[-1]]>0), axis=-1, keepdims=True), axis=0, keepdims=True)
keep_mask = (square_displacement(X) < square_displacement(X_swapped))
X_new = X*keep_mask + X_swapped*(~keep_mask)
X_new = einops.rearrange(X_new, f'q {axes_post} c -> {axes_pre} c')
return X_new
pairwise_exchange = vmap(pairwise_exchange, in_axes=(0, None, None, None))
def update_grid_locations(X, cell_size, num_dims, factors):
"""
Move particles to new grid cells if any coordinate entries in X are larger
magnitude than cell_size/2 (ie, if particle has left current grid cell)
(this could also be phrased as a conv, but I expect it would be less efficient + more confusing)
"""
axis = 1
X = pad_axis_channel_last(X, factors, axis)
X = pairwise_exchange(X, cell_size, axis, num_dims)
body_slice = tuple(slice(X.shape[j]) for j in range(axis+1)) + (slice(1,-1),)
X = X[body_slice]
return X, None
def test_grid(grid_topology=(), num_dims=2):
cell_size = 1./4.
max_grid_distance = 5
box_size = 512.
points = onp.linspace(0., 50, num=66)
X, Y = onp.meshgrid(points, points)
R = onp.stack((X.ravel(), Y.ravel()), axis=1) + 0.1
R = onp.array(R, onp.float64)
grid = positions_to_grid(R, box_size, cell_size, num_dims, np.arange(R.shape[0]) + 1)
grid, factors = fold_grid(grid, max_grid_distance,
batch_size=128)
def cond_fn(grid_old_grid):
grid, i = grid_old_grid
return (i < 1)
def body_fn(grid_old_grid):
grid, i = grid_old_grid
_grid, overflow_count = update_grid_locations(grid, cell_size, num_dims, factors)
return _grid, i+1
grid_old_grid = (grid, 0)
### BUG IS HERE. Compute a while loop two different ways. Result should be the
### same. Instead it's different.
new_tuple_lax = lax.while_loop(cond_fn, body_fn, grid_old_grid)
new_tuple_while = grid_old_grid
while cond_fn(new_tuple_while):
new_tuple_while = body_fn(new_tuple_while)
max_dev = onp.max(onp.abs(new_tuple_lax[0] - new_tuple_while[0]))
print(max_dev)
assert max_dev == 0
test_grid()"><pre class="notranslate"><span class="pl-k">import</span> <span class="pl-s1">jax</span>.<span class="pl-s1">numpy</span> <span class="pl-k">as</span> <span class="pl-s1">np</span>
<span class="pl-k">import</span> <span class="pl-s1">jax</span>
<span class="pl-s1">jax</span>.<span class="pl-s1">config</span>.<span class="pl-en">update</span>(<span class="pl-s">'jax_numpy_rank_promotion'</span>, <span class="pl-s">'raise'</span>)
<span class="pl-k">from</span> <span class="pl-s1">jax</span> <span class="pl-k">import</span> <span class="pl-s1">lax</span>, <span class="pl-s1">vmap</span>
<span class="pl-k">import</span> <span class="pl-s1">math</span>
<span class="pl-k">import</span> <span class="pl-s1">numpy</span> <span class="pl-k">as</span> <span class="pl-s1">onp</span>
<span class="pl-k">import</span> <span class="pl-s1">einops</span>
<span class="pl-c"># # Grid Packing / Unpacking</span>
<span class="pl-k">def</span> <span class="pl-en">get_grid_centers</span>(<span class="pl-s1">box_size</span>, <span class="pl-s1">cell_size</span>, <span class="pl-s1">num_dims</span>):
<span class="pl-s1">cells_count_per_side</span> <span class="pl-c1">=</span> <span class="pl-en">int</span>(<span class="pl-s1">onp</span>.<span class="pl-en">ceil</span>(<span class="pl-s1">box_size</span> <span class="pl-c1">/</span> <span class="pl-s1">cell_size</span>))
<span class="pl-s1">grid_centers</span> <span class="pl-c1">=</span> <span class="pl-s1">onp</span>.<span class="pl-en">zeros</span>(<span class="pl-en">tuple</span>(
[<span class="pl-s1">cells_count_per_side</span>]<span class="pl-c1">*</span><span class="pl-s1">num_dims</span> <span class="pl-c1">+</span> [<span class="pl-s1">num_dims</span>]
))
<span class="pl-k">for</span> <span class="pl-s1">i</span> <span class="pl-c1">in</span> <span class="pl-en">range</span>(<span class="pl-s1">num_dims</span>):
<span class="pl-s1">grid_centers</span>[...,<span class="pl-s1">i</span>] <span class="pl-c1">=</span> (<span class="pl-s1">onp</span>.<span class="pl-en">reshape</span>(<span class="pl-s1">onp</span>.<span class="pl-en">arange</span>(<span class="pl-s1">cells_count_per_side</span>),
<span class="pl-en">tuple</span>([<span class="pl-c1">1</span>]<span class="pl-c1">*</span><span class="pl-s1">i</span> <span class="pl-c1">+</span> [<span class="pl-s1">cells_count_per_side</span>] <span class="pl-c1">+</span> [<span class="pl-c1">1</span>]<span class="pl-c1">*</span>(<span class="pl-s1">num_dims</span><span class="pl-c1">-</span><span class="pl-s1">i</span><span class="pl-c1">-</span><span class="pl-c1">1</span>)))
<span class="pl-c1">+</span> <span class="pl-c1">0.5</span>)<span class="pl-c1">*</span><span class="pl-s1">cell_size</span>
<span class="pl-k">return</span> <span class="pl-s1">np</span>.<span class="pl-en">array</span>(<span class="pl-s1">grid_centers</span>)
<span class="pl-k">def</span> <span class="pl-en">positions_to_grid</span>(<span class="pl-s1">position</span>, <span class="pl-s1">box_size</span>, <span class="pl-s1">cell_size</span>, <span class="pl-s1">num_dims</span>, <span class="pl-s1">particle_id</span>, <span class="pl-s1">aux</span><span class="pl-c1">=</span><span class="pl-c1">None</span>):
<span class="pl-s1">cells</span> <span class="pl-c1">=</span> <span class="pl-en">int</span>(<span class="pl-s1">math</span>.<span class="pl-en">ceil</span>(<span class="pl-s1">box_size</span> <span class="pl-c1">/</span> <span class="pl-s1">cell_size</span>))
<span class="pl-v">N</span> <span class="pl-c1">=</span> <span class="pl-s1">position</span>.<span class="pl-s1">shape</span>[<span class="pl-c1">0</span>]
<span class="pl-s1">cell_contents</span> <span class="pl-c1">=</span> <span class="pl-s1">np</span>.<span class="pl-en">concatenate</span>([<span class="pl-s1">position</span>, <span class="pl-s1">particle_id</span>[:, <span class="pl-c1">None</span>]], <span class="pl-s1">axis</span><span class="pl-c1">=</span><span class="pl-c1">-</span><span class="pl-c1">1</span>)
<span class="pl-k">if</span> <span class="pl-s1">aux</span> <span class="pl-c1">is</span> <span class="pl-c1">not</span> <span class="pl-c1">None</span>:
<span class="pl-s1">cell_contents</span>, <span class="pl-c1">*</span><span class="pl-s1">_</span> <span class="pl-c1">=</span> <span class="pl-en">set_aux</span>(<span class="pl-s1">cell_contents</span>, <span class="pl-s1">aux</span>)
<span class="pl-s1">grid</span> <span class="pl-c1">=</span> <span class="pl-s1">np</span>.<span class="pl-en">zeros</span>((<span class="pl-s1">cells</span> <span class="pl-c1">**</span> <span class="pl-s1">num_dims</span>, <span class="pl-s1">cell_contents</span>.<span class="pl-s1">shape</span>[<span class="pl-c1">-</span><span class="pl-c1">1</span>]))
<span class="pl-s1">grid</span> <span class="pl-c1">=</span> <span class="pl-s1">grid</span>.<span class="pl-s1">at</span>[:<span class="pl-v">N</span>, :].<span class="pl-en">set</span>(<span class="pl-s1">cell_contents</span>)
<span class="pl-s1">centers</span> <span class="pl-c1">=</span> <span class="pl-en">get_grid_centers</span>(<span class="pl-s1">box_size</span>, <span class="pl-s1">cell_size</span>, <span class="pl-s1">num_dims</span>).<span class="pl-en">reshape</span>((<span class="pl-c1">-</span><span class="pl-c1">1</span>, <span class="pl-s1">num_dims</span>))
<span class="pl-s1">grid</span> <span class="pl-c1">=</span> <span class="pl-s1">grid</span>.<span class="pl-s1">at</span>[:<span class="pl-v">N</span>, :<span class="pl-s1">num_dims</span>].<span class="pl-en">add</span>(<span class="pl-c1">-</span><span class="pl-s1">centers</span>[:<span class="pl-v">N</span>])
<span class="pl-s1">grid</span> <span class="pl-c1">=</span> <span class="pl-s1">np</span>.<span class="pl-en">reshape</span>(<span class="pl-s1">grid</span>, (<span class="pl-s1">cells</span>,) <span class="pl-c1">*</span> <span class="pl-s1">num_dims</span> <span class="pl-c1">+</span> (<span class="pl-c1">-</span><span class="pl-c1">1</span>,))
<span class="pl-k">return</span> <span class="pl-s1">grid</span>
<span class="pl-k">def</span> <span class="pl-en">pad_axis_channel_last</span>(<span class="pl-v">X</span>, <span class="pl-s1">factors</span>, <span class="pl-s1">axis_ind</span>, <span class="pl-s1">max_grid_distance</span> <span class="pl-c1">=</span> <span class="pl-c1">1</span>):
<span class="pl-s1">num_dims</span> <span class="pl-c1">=</span> <span class="pl-en">len</span>(<span class="pl-s1">factors</span>)
<span class="pl-s1">axes_s</span> <span class="pl-c1">=</span> <span class="pl-s">' '</span>.<span class="pl-en">join</span>([<span class="pl-en">chr</span>(<span class="pl-en">ord</span>(<span class="pl-s">'x'</span>) <span class="pl-c1">+</span> <span class="pl-s1">i</span>) <span class="pl-k">for</span> <span class="pl-s1">i</span> <span class="pl-c1">in</span> <span class="pl-en">range</span>(<span class="pl-s1">num_dims</span>)])
<span class="pl-s1">factors_s</span> <span class="pl-c1">=</span> <span class="pl-s">' '</span>.<span class="pl-en">join</span>([<span class="pl-s">'f'</span><span class="pl-c1">+</span><span class="pl-en">chr</span>(<span class="pl-en">ord</span>(<span class="pl-s">'x'</span>) <span class="pl-c1">+</span> <span class="pl-s1">i</span>) <span class="pl-k">for</span> <span class="pl-s1">i</span> <span class="pl-c1">in</span> <span class="pl-en">range</span>(<span class="pl-s1">num_dims</span>)])
<span class="pl-s1">fact_d</span> <span class="pl-c1">=</span> {}
<span class="pl-k">for</span> <span class="pl-s1">i</span> <span class="pl-c1">in</span> <span class="pl-en">range</span>(<span class="pl-s1">num_dims</span>):
<span class="pl-s1">fact_d</span>[<span class="pl-s">'f'</span> <span class="pl-c1">+</span> <span class="pl-en">chr</span>(<span class="pl-en">ord</span>(<span class="pl-s">'x'</span>) <span class="pl-c1">+</span> <span class="pl-s1">i</span>)] <span class="pl-c1">=</span> <span class="pl-s1">factors</span>[<span class="pl-s1">i</span>]
<span class="pl-c"># all entries for all dimensions before the target axis</span>
<span class="pl-s1">all_slice</span> <span class="pl-c1">=</span> <span class="pl-en">tuple</span>(<span class="pl-en">slice</span>(<span class="pl-v">X</span>.<span class="pl-s1">shape</span>[<span class="pl-s1">j</span>]) <span class="pl-k">for</span> <span class="pl-s1">j</span> <span class="pl-c1">in</span> <span class="pl-en">range</span>(<span class="pl-s1">axis_ind</span> <span class="pl-c1">+</span> <span class="pl-c1">1</span>))
<span class="pl-c"># the end halo along the target axis</span>
<span class="pl-s1">idx</span> <span class="pl-c1">=</span> <span class="pl-s1">all_slice</span> <span class="pl-c1">+</span> (<span class="pl-en">slice</span>(<span class="pl-c1">-</span><span class="pl-s1">max_grid_distance</span>, <span class="pl-v">X</span>.<span class="pl-s1">shape</span>[<span class="pl-s1">axis_ind</span> <span class="pl-c1">+</span> <span class="pl-c1">1</span>]),)
<span class="pl-s1">p</span> <span class="pl-c1">=</span> <span class="pl-v">X</span>[<span class="pl-s1">idx</span>]
<span class="pl-s1">p</span> <span class="pl-c1">=</span> <span class="pl-s1">einops</span>.<span class="pl-en">rearrange</span>(<span class="pl-s1">p</span>, <span class="pl-s">f'(<span class="pl-s1"><span class="pl-kos">{</span><span class="pl-s1">factors_s</span><span class="pl-kos">}</span></span>) <span class="pl-s1"><span class="pl-kos">{</span><span class="pl-s1">axes_s</span><span class="pl-kos">}</span></span> c -> <span class="pl-s1"><span class="pl-kos">{</span><span class="pl-s1">factors_s</span><span class="pl-kos">}</span></span> <span class="pl-s1"><span class="pl-kos">{</span><span class="pl-s1">axes_s</span><span class="pl-kos">}</span></span> c'</span>, <span class="pl-c1">**</span><span class="pl-s1">fact_d</span>)
<span class="pl-s1">p</span> <span class="pl-c1">=</span> <span class="pl-s1">np</span>.<span class="pl-en">roll</span>(<span class="pl-s1">p</span>, (<span class="pl-c1">0</span>,) <span class="pl-c1">*</span> <span class="pl-s1">axis_ind</span> <span class="pl-c1">+</span> (<span class="pl-c1">1</span>,) <span class="pl-c1">+</span> (<span class="pl-c1">0</span>,) <span class="pl-c1">*</span> (<span class="pl-v">X</span>.<span class="pl-s1">ndim</span> <span class="pl-c1">-</span> <span class="pl-s1">axis_ind</span> <span class="pl-c1">-</span> <span class="pl-c1">1</span>), <span class="pl-s1">axis</span><span class="pl-c1">=</span><span class="pl-en">range</span>(<span class="pl-v">X</span>.<span class="pl-s1">ndim</span>))
<span class="pl-s1">p1</span> <span class="pl-c1">=</span> <span class="pl-s1">einops</span>.<span class="pl-en">rearrange</span>(<span class="pl-s1">p</span>, <span class="pl-s">f'<span class="pl-s1"><span class="pl-kos">{</span><span class="pl-s1">factors_s</span><span class="pl-kos">}</span></span> <span class="pl-s1"><span class="pl-kos">{</span><span class="pl-s1">axes_s</span><span class="pl-kos">}</span></span> c -> (<span class="pl-s1"><span class="pl-kos">{</span><span class="pl-s1">factors_s</span><span class="pl-kos">}</span></span>) <span class="pl-s1"><span class="pl-kos">{</span><span class="pl-s1">axes_s</span><span class="pl-kos">}</span></span> c'</span>)
<span class="pl-c"># the start halo along the target axis</span>
<span class="pl-s1">idx</span> <span class="pl-c1">=</span> <span class="pl-s1">all_slice</span> <span class="pl-c1">+</span> (<span class="pl-en">slice</span>(<span class="pl-c1">0</span>, <span class="pl-s1">max_grid_distance</span>),)
<span class="pl-s1">p</span> <span class="pl-c1">=</span> <span class="pl-v">X</span>[<span class="pl-s1">idx</span>]
<span class="pl-s1">p</span> <span class="pl-c1">=</span> <span class="pl-s1">einops</span>.<span class="pl-en">rearrange</span>(<span class="pl-s1">p</span>, <span class="pl-s">f'(<span class="pl-s1"><span class="pl-kos">{</span><span class="pl-s1">factors_s</span><span class="pl-kos">}</span></span>) <span class="pl-s1"><span class="pl-kos">{</span><span class="pl-s1">axes_s</span><span class="pl-kos">}</span></span> c -> <span class="pl-s1"><span class="pl-kos">{</span><span class="pl-s1">factors_s</span><span class="pl-kos">}</span></span> <span class="pl-s1"><span class="pl-kos">{</span><span class="pl-s1">axes_s</span><span class="pl-kos">}</span></span> c'</span>, <span class="pl-c1">**</span><span class="pl-s1">fact_d</span>)
<span class="pl-s1">p</span> <span class="pl-c1">=</span> <span class="pl-s1">np</span>.<span class="pl-en">roll</span>(<span class="pl-s1">p</span>, (<span class="pl-c1">0</span>,) <span class="pl-c1">*</span> <span class="pl-s1">axis_ind</span> <span class="pl-c1">+</span> (<span class="pl-c1">-</span><span class="pl-c1">1</span>,) <span class="pl-c1">+</span> (<span class="pl-c1">0</span>,) <span class="pl-c1">*</span> (<span class="pl-v">X</span>.<span class="pl-s1">ndim</span> <span class="pl-c1">-</span> <span class="pl-s1">axis_ind</span> <span class="pl-c1">-</span> <span class="pl-c1">1</span>), <span class="pl-s1">axis</span><span class="pl-c1">=</span><span class="pl-en">range</span>(<span class="pl-v">X</span>.<span class="pl-s1">ndim</span>))
<span class="pl-s1">p2</span> <span class="pl-c1">=</span> <span class="pl-s1">einops</span>.<span class="pl-en">rearrange</span>(<span class="pl-s1">p</span>, <span class="pl-s">f'<span class="pl-s1"><span class="pl-kos">{</span><span class="pl-s1">factors_s</span><span class="pl-kos">}</span></span> <span class="pl-s1"><span class="pl-kos">{</span><span class="pl-s1">axes_s</span><span class="pl-kos">}</span></span> c -> (<span class="pl-s1"><span class="pl-kos">{</span><span class="pl-s1">factors_s</span><span class="pl-kos">}</span></span>) <span class="pl-s1"><span class="pl-kos">{</span><span class="pl-s1">axes_s</span><span class="pl-kos">}</span></span> c'</span>)
<span class="pl-v">X</span> <span class="pl-c1">=</span> <span class="pl-s1">np</span>.<span class="pl-en">concatenate</span>([<span class="pl-s1">p1</span>, <span class="pl-v">X</span>, <span class="pl-s1">p2</span>], <span class="pl-s1">axis</span><span class="pl-c1">=</span><span class="pl-c1">1</span> <span class="pl-c1">+</span> <span class="pl-s1">axis_ind</span>)
<span class="pl-k">return</span> <span class="pl-v">X</span>
<span class="pl-k">def</span> <span class="pl-en">fold_factors</span>(<span class="pl-s1">batch_size</span>, <span class="pl-s1">grid_shape</span>, <span class="pl-s1">max_grid_distance</span>):
<span class="pl-s1">num_dims</span> <span class="pl-c1">=</span> <span class="pl-en">len</span>(<span class="pl-s1">grid_shape</span>)
<span class="pl-s1">max_folds</span> <span class="pl-c1">=</span> <span class="pl-s1">onp</span>.<span class="pl-en">log</span>(<span class="pl-s1">batch_size</span>) <span class="pl-c1">/</span> <span class="pl-s1">onp</span>.<span class="pl-en">log</span>(<span class="pl-c1">2</span>)
<span class="pl-s1">folds</span> <span class="pl-c1">=</span> <span class="pl-s1">onp</span>.<span class="pl-en">zeros</span>((<span class="pl-s1">num_dims</span>,), <span class="pl-s1">onp</span>.<span class="pl-s1">int32</span>)
<span class="pl-k">for</span> <span class="pl-s1">i</span> <span class="pl-c1">in</span> <span class="pl-en">range</span>(<span class="pl-en">int</span>(<span class="pl-s1">max_folds</span>)<span class="pl-c1">*</span><span class="pl-s1">num_dims</span>):
<span class="pl-s1">dim</span> <span class="pl-c1">=</span> <span class="pl-s1">i</span> <span class="pl-c1">%</span> <span class="pl-s1">num_dims</span>
<span class="pl-c"># folds[dim]+2, rather than +1, since we need an even number of cells for pairwise exchange in update_grid_locations</span>
<span class="pl-s1">width</span>, <span class="pl-s1">remain</span> <span class="pl-c1">=</span> <span class="pl-en">divmod</span>(<span class="pl-s1">grid_shape</span>[<span class="pl-s1">dim</span>], <span class="pl-c1">2</span><span class="pl-c1">**</span>(<span class="pl-s1">folds</span>[<span class="pl-s1">dim</span>]<span class="pl-c1">+</span><span class="pl-c1">2</span>))
<span class="pl-c"># width, remain = divmod(grid_shape[dim], 2**(folds[dim]+1))</span>
<span class="pl-c"># TODO is 2*max_grid_distance the right cutoff?</span>
<span class="pl-k">if</span> <span class="pl-s1">remain</span> <span class="pl-c1">==</span> <span class="pl-c1">0</span> <span class="pl-c1">and</span> <span class="pl-s1">width</span> <span class="pl-c1">>=</span> <span class="pl-s1">max_grid_distance</span>:
<span class="pl-s1">folds</span>[<span class="pl-s1">dim</span>] <span class="pl-c1">+=</span> <span class="pl-c1">1</span>
<span class="pl-k">if</span> <span class="pl-s1">onp</span>.<span class="pl-en">sum</span>(<span class="pl-s1">folds</span>) <span class="pl-c1">==</span> <span class="pl-s1">max_folds</span>:
<span class="pl-k">break</span>
<span class="pl-s1">factors</span> <span class="pl-c1">=</span> <span class="pl-c1">2</span> <span class="pl-c1">**</span> <span class="pl-s1">folds</span>
<span class="pl-k">if</span> <span class="pl-s1">onp</span>.<span class="pl-en">sum</span>(<span class="pl-s1">folds</span>) <span class="pl-c1"><</span> <span class="pl-s1">max_folds</span>:
<span class="pl-en">print</span>(<span class="pl-s">f"Folds <span class="pl-s1"><span class="pl-kos">{</span><span class="pl-s1">folds</span><span class="pl-kos">}</span></span> have sum smaller than target of <span class="pl-s1"><span class="pl-kos">{</span><span class="pl-s1">max_folds</span><span class="pl-kos">}</span></span>. This corresponds to a batch size of <span class="pl-s1"><span class="pl-kos">{</span><span class="pl-s1">onp</span>.<span class="pl-en">prod</span>(<span class="pl-s1">factors</span>)<span class="pl-kos">}</span></span> rather than the target of <span class="pl-s1"><span class="pl-kos">{</span><span class="pl-s1">batch_size</span><span class="pl-kos">}</span></span>."</span>)
<span class="pl-k">return</span> <span class="pl-s1">factors</span>
<span class="pl-k">def</span> <span class="pl-en">order_grid_by_factors</span>(<span class="pl-s1">num_dims</span>):
<span class="pl-s1">front_order</span> <span class="pl-c1">=</span> ()
<span class="pl-s1">back_order</span> <span class="pl-c1">=</span> ()
<span class="pl-k">for</span> <span class="pl-s1">i</span> <span class="pl-c1">in</span> <span class="pl-en">range</span>(<span class="pl-s1">num_dims</span>):
<span class="pl-s1">front_order</span> <span class="pl-c1">+=</span> (<span class="pl-c1">2</span> <span class="pl-c1">*</span> <span class="pl-s1">i</span>,)
<span class="pl-s1">back_order</span> <span class="pl-c1">+=</span> (<span class="pl-c1">2</span> <span class="pl-c1">*</span> <span class="pl-s1">i</span> <span class="pl-c1">+</span> <span class="pl-c1">1</span>,)
<span class="pl-k">return</span> <span class="pl-s1">front_order</span> <span class="pl-c1">+</span> <span class="pl-s1">back_order</span> <span class="pl-c1">+</span> (<span class="pl-c1">2</span> <span class="pl-c1">*</span> <span class="pl-s1">num_dims</span>,)
<span class="pl-k">def</span> <span class="pl-en">fold_grid</span>(<span class="pl-v">X</span>, <span class="pl-s1">max_grid_distance</span>, <span class="pl-s1">batch_size</span><span class="pl-c1">=</span><span class="pl-c1">None</span>, <span class="pl-s1">factors</span><span class="pl-c1">=</span><span class="pl-c1">None</span>, <span class="pl-s1">inner_fold</span><span class="pl-c1">=</span><span class="pl-c1">True</span>):
<span class="pl-s1">num_dims</span> <span class="pl-c1">=</span> <span class="pl-v">X</span>.<span class="pl-s1">ndim</span> <span class="pl-c1">-</span> <span class="pl-c1">1</span>
<span class="pl-k">if</span> <span class="pl-s1">factors</span> <span class="pl-c1">is</span> <span class="pl-c1">None</span>:
<span class="pl-s1">factors</span> <span class="pl-c1">=</span> <span class="pl-en">fold_factors</span>(<span class="pl-s1">batch_size</span>, <span class="pl-v">X</span>.<span class="pl-s1">shape</span>[:<span class="pl-c1">-</span><span class="pl-c1">1</span>], <span class="pl-s1">max_grid_distance</span>)
<span class="pl-v">X_shape</span> <span class="pl-c1">=</span> []
<span class="pl-k">for</span> <span class="pl-s1">i</span> <span class="pl-c1">in</span> <span class="pl-en">range</span>(<span class="pl-s1">num_dims</span>):
<span class="pl-s1">_</span>, <span class="pl-s1">ragged</span> <span class="pl-c1">=</span> <span class="pl-en">divmod</span>(<span class="pl-v">X</span>.<span class="pl-s1">shape</span>[<span class="pl-s1">i</span>], <span class="pl-s1">factors</span>[<span class="pl-s1">i</span>])
<span class="pl-k">assert</span> <span class="pl-s1">ragged</span> <span class="pl-c1">==</span> <span class="pl-c1">0</span>
<span class="pl-v">X_shape</span> <span class="pl-c1">+=</span> [<span class="pl-s1">factors</span>[<span class="pl-s1">i</span>], <span class="pl-v">X</span>.<span class="pl-s1">shape</span>[<span class="pl-s1">i</span>] <span class="pl-c1">//</span> <span class="pl-s1">factors</span>[<span class="pl-s1">i</span>]]
<span class="pl-v">X_shape</span> <span class="pl-c1">+=</span> [<span class="pl-v">X</span>.<span class="pl-s1">shape</span>[<span class="pl-c1">-</span><span class="pl-c1">1</span>]]
<span class="pl-k">if</span> <span class="pl-s1">onp</span>.<span class="pl-en">min</span>(<span class="pl-s1">onp</span>.<span class="pl-en">array</span>(<span class="pl-v">X</span>.<span class="pl-s1">shape</span>[:<span class="pl-c1">-</span><span class="pl-c1">1</span>]) <span class="pl-c1">/</span> <span class="pl-s1">onp</span>.<span class="pl-en">array</span>(<span class="pl-s1">factors</span>)) <span class="pl-c1"><</span> <span class="pl-s1">max_grid_distance</span>:
<span class="pl-en">print</span>(<span class="pl-s">f"Folded grid may be too small. This failure is happening when splitting across devices. factors <span class="pl-s1"><span class="pl-kos">{</span><span class="pl-s1">factors</span><span class="pl-kos">}</span></span> X.shape <span class="pl-s1"><span class="pl-kos">{</span><span class="pl-v">X</span>.<span class="pl-s1">shape</span><span class="pl-kos">}</span></span> new X_shape <span class="pl-s1"><span class="pl-kos">{</span><span class="pl-v">X_shape</span><span class="pl-kos">}</span></span>."</span>)
<span class="pl-s1">ordering</span> <span class="pl-c1">=</span> <span class="pl-en">order_grid_by_factors</span>(<span class="pl-s1">num_dims</span>)
<span class="pl-v">X</span> <span class="pl-c1">=</span> <span class="pl-s1">np</span>.<span class="pl-en">reshape</span>(<span class="pl-v">X</span>, <span class="pl-v">X_shape</span>)
<span class="pl-v">X</span> <span class="pl-c1">=</span> <span class="pl-s1">np</span>.<span class="pl-en">transpose</span>(<span class="pl-v">X</span>, <span class="pl-s1">ordering</span>)
<span class="pl-k">if</span> <span class="pl-s1">inner_fold</span>:
<span class="pl-v">X</span> <span class="pl-c1">=</span> <span class="pl-v">X</span>.<span class="pl-en">reshape</span>((<span class="pl-c1">-</span><span class="pl-c1">1</span>,) <span class="pl-c1">+</span> <span class="pl-v">X</span>.<span class="pl-s1">shape</span>[<span class="pl-s1">num_dims</span>:])
<span class="pl-k">else</span>:
<span class="pl-v">X</span> <span class="pl-c1">=</span> <span class="pl-en">folded_pad</span>(<span class="pl-v">X</span>, <span class="pl-s1">max_grid_distance</span>, <span class="pl-s1">factors</span>)
<span class="pl-k">return</span> <span class="pl-v">X</span>, <span class="pl-s1">factors</span>
<span class="pl-c"># Dynamics</span>
<span class="pl-k">def</span> <span class="pl-en">pairwise_exchange</span>(<span class="pl-v">X</span>, <span class="pl-s1">cell_size</span>, <span class="pl-s1">axis</span>, <span class="pl-s1">num_dims</span>):
<span class="pl-s1">particle_data_size</span> <span class="pl-c1">=</span> <span class="pl-v">X</span>.<span class="pl-s1">shape</span>[<span class="pl-c1">-</span><span class="pl-c1">1</span>] <span class="pl-c1">-</span> <span class="pl-s1">num_dims</span>
<span class="pl-s1">axes_pre</span> <span class="pl-c1">=</span> <span class="pl-s">' '</span>.<span class="pl-en">join</span>([<span class="pl-s">'('</span> <span class="pl-c1">+</span> <span class="pl-en">chr</span>(<span class="pl-en">ord</span>(<span class="pl-s">'x'</span>) <span class="pl-c1">+</span> <span class="pl-s1">i</span>) <span class="pl-c1">+</span> <span class="pl-s">' q)'</span> <span class="pl-k">if</span> <span class="pl-s1">i</span> <span class="pl-c1">==</span> <span class="pl-s1">axis</span> <span class="pl-k">else</span> <span class="pl-en">chr</span>(<span class="pl-en">ord</span>(<span class="pl-s">'x'</span>) <span class="pl-c1">+</span> <span class="pl-s1">i</span>) <span class="pl-k">for</span> <span class="pl-s1">i</span> <span class="pl-c1">in</span> <span class="pl-en">range</span>(<span class="pl-s1">num_dims</span>)])
<span class="pl-s1">axes_post</span> <span class="pl-c1">=</span> <span class="pl-s">' '</span>.<span class="pl-en">join</span>([<span class="pl-en">chr</span>(<span class="pl-en">ord</span>(<span class="pl-s">'x'</span>) <span class="pl-c1">+</span> <span class="pl-s1">i</span>) <span class="pl-k">for</span> <span class="pl-s1">i</span> <span class="pl-c1">in</span> <span class="pl-en">range</span>(<span class="pl-s1">num_dims</span>)])
<span class="pl-v">X</span> <span class="pl-c1">=</span> <span class="pl-s1">einops</span>.<span class="pl-en">rearrange</span>(<span class="pl-v">X</span>, <span class="pl-s">f'<span class="pl-s1"><span class="pl-kos">{</span><span class="pl-s1">axes_pre</span><span class="pl-kos">}</span></span> c -> q <span class="pl-s1"><span class="pl-kos">{</span><span class="pl-s1">axes_post</span><span class="pl-kos">}</span></span> c'</span>, <span class="pl-s1">q</span><span class="pl-c1">=</span><span class="pl-c1">2</span>)
<span class="pl-s1">shift</span> <span class="pl-c1">=</span> <span class="pl-s1">onp</span>.<span class="pl-en">zeros</span>((<span class="pl-c1">2</span>, <span class="pl-s1">num_dims</span><span class="pl-c1">+</span><span class="pl-s1">particle_data_size</span>))
<span class="pl-s1">shift</span>[<span class="pl-c1">0</span>,<span class="pl-s1">axis</span>] <span class="pl-c1">=</span> <span class="pl-s1">cell_size</span>
<span class="pl-s1">shift</span>[<span class="pl-c1">1</span>,<span class="pl-s1">axis</span>] <span class="pl-c1">=</span> <span class="pl-c1">-</span><span class="pl-s1">cell_size</span>
<span class="pl-s1">shift</span> <span class="pl-c1">=</span> <span class="pl-s1">shift</span>.<span class="pl-en">reshape</span>((<span class="pl-c1">2</span>,) <span class="pl-c1">+</span> (<span class="pl-c1">1</span>,)<span class="pl-c1">*</span><span class="pl-s1">num_dims</span> <span class="pl-c1">+</span> (<span class="pl-s1">num_dims</span><span class="pl-c1">+</span><span class="pl-s1">particle_data_size</span>,))
<span class="pl-s1">_Xrev</span> <span class="pl-c1">=</span> <span class="pl-v">X</span>[::<span class="pl-c1">-</span><span class="pl-c1">1</span>]
<span class="pl-v">X_swapped</span> <span class="pl-c1">=</span> <span class="pl-s1">_Xrev</span> <span class="pl-c1">+</span> <span class="pl-s1">shift</span><span class="pl-c1">*</span>(<span class="pl-s1">_Xrev</span>[..., [<span class="pl-c1">-</span><span class="pl-c1">1</span>]]<span class="pl-c1">></span><span class="pl-c1">0</span>) <span class="pl-c"># only add offset to occupied cells</span>
<span class="pl-s1">square_displacement</span> <span class="pl-c1">=</span> <span class="pl-k">lambda</span> <span class="pl-s1">_X</span>: <span class="pl-s1">np</span>.<span class="pl-en">sum</span>(<span class="pl-s1">np</span>.<span class="pl-en">sum</span>(<span class="pl-s1">_X</span>[...,:<span class="pl-s1">num_dims</span>]<span class="pl-c1">**</span><span class="pl-c1">2</span> <span class="pl-c1">*</span> (<span class="pl-s1">_X</span>[...,[<span class="pl-c1">-</span><span class="pl-c1">1</span>]]<span class="pl-c1">></span><span class="pl-c1">0</span>), <span class="pl-s1">axis</span><span class="pl-c1">=</span><span class="pl-c1">-</span><span class="pl-c1">1</span>, <span class="pl-s1">keepdims</span><span class="pl-c1">=</span><span class="pl-c1">True</span>), <span class="pl-s1">axis</span><span class="pl-c1">=</span><span class="pl-c1">0</span>, <span class="pl-s1">keepdims</span><span class="pl-c1">=</span><span class="pl-c1">True</span>)
<span class="pl-s1">keep_mask</span> <span class="pl-c1">=</span> (<span class="pl-en">square_displacement</span>(<span class="pl-v">X</span>) <span class="pl-c1"><</span> <span class="pl-en">square_displacement</span>(<span class="pl-v">X_swapped</span>))
<span class="pl-v">X_new</span> <span class="pl-c1">=</span> <span class="pl-v">X</span><span class="pl-c1">*</span><span class="pl-s1">keep_mask</span> <span class="pl-c1">+</span> <span class="pl-v">X_swapped</span><span class="pl-c1">*</span>(<span class="pl-c1">~</span><span class="pl-s1">keep_mask</span>)
<span class="pl-v">X_new</span> <span class="pl-c1">=</span> <span class="pl-s1">einops</span>.<span class="pl-en">rearrange</span>(<span class="pl-v">X_new</span>, <span class="pl-s">f'q <span class="pl-s1"><span class="pl-kos">{</span><span class="pl-s1">axes_post</span><span class="pl-kos">}</span></span> c -> <span class="pl-s1"><span class="pl-kos">{</span><span class="pl-s1">axes_pre</span><span class="pl-kos">}</span></span> c'</span>)
<span class="pl-k">return</span> <span class="pl-v">X_new</span>
<span class="pl-s1">pairwise_exchange</span> <span class="pl-c1">=</span> <span class="pl-en">vmap</span>(<span class="pl-s1">pairwise_exchange</span>, <span class="pl-s1">in_axes</span><span class="pl-c1">=</span>(<span class="pl-c1">0</span>, <span class="pl-c1">None</span>, <span class="pl-c1">None</span>, <span class="pl-c1">None</span>))
<span class="pl-k">def</span> <span class="pl-en">update_grid_locations</span>(<span class="pl-v">X</span>, <span class="pl-s1">cell_size</span>, <span class="pl-s1">num_dims</span>, <span class="pl-s1">factors</span>):
<span class="pl-s">"""</span>
<span class="pl-s"> Move particles to new grid cells if any coordinate entries in X are larger</span>
<span class="pl-s"> magnitude than cell_size/2 (ie, if particle has left current grid cell)</span>
<span class="pl-s"> (this could also be phrased as a conv, but I expect it would be less efficient + more confusing)</span>
<span class="pl-s"> """</span>
<span class="pl-s1">axis</span> <span class="pl-c1">=</span> <span class="pl-c1">1</span>
<span class="pl-v">X</span> <span class="pl-c1">=</span> <span class="pl-en">pad_axis_channel_last</span>(<span class="pl-v">X</span>, <span class="pl-s1">factors</span>, <span class="pl-s1">axis</span>)
<span class="pl-v">X</span> <span class="pl-c1">=</span> <span class="pl-en">pairwise_exchange</span>(<span class="pl-v">X</span>, <span class="pl-s1">cell_size</span>, <span class="pl-s1">axis</span>, <span class="pl-s1">num_dims</span>)
<span class="pl-s1">body_slice</span> <span class="pl-c1">=</span> <span class="pl-en">tuple</span>(<span class="pl-en">slice</span>(<span class="pl-v">X</span>.<span class="pl-s1">shape</span>[<span class="pl-s1">j</span>]) <span class="pl-k">for</span> <span class="pl-s1">j</span> <span class="pl-c1">in</span> <span class="pl-en">range</span>(<span class="pl-s1">axis</span><span class="pl-c1">+</span><span class="pl-c1">1</span>)) <span class="pl-c1">+</span> (<span class="pl-en">slice</span>(<span class="pl-c1">1</span>,<span class="pl-c1">-</span><span class="pl-c1">1</span>),)
<span class="pl-v">X</span> <span class="pl-c1">=</span> <span class="pl-v">X</span>[<span class="pl-s1">body_slice</span>]
<span class="pl-k">return</span> <span class="pl-v">X</span>, <span class="pl-c1">None</span>
<span class="pl-k">def</span> <span class="pl-en">test_grid</span>(<span class="pl-s1">grid_topology</span><span class="pl-c1">=</span>(), <span class="pl-s1">num_dims</span><span class="pl-c1">=</span><span class="pl-c1">2</span>):
<span class="pl-s1">cell_size</span> <span class="pl-c1">=</span> <span class="pl-c1">1.</span><span class="pl-c1">/</span><span class="pl-c1">4.</span>
<span class="pl-s1">max_grid_distance</span> <span class="pl-c1">=</span> <span class="pl-c1">5</span>
<span class="pl-s1">box_size</span> <span class="pl-c1">=</span> <span class="pl-c1">512.</span>
<span class="pl-s1">points</span> <span class="pl-c1">=</span> <span class="pl-s1">onp</span>.<span class="pl-en">linspace</span>(<span class="pl-c1">0.</span>, <span class="pl-c1">50</span>, <span class="pl-s1">num</span><span class="pl-c1">=</span><span class="pl-c1">66</span>)
<span class="pl-v">X</span>, <span class="pl-v">Y</span> <span class="pl-c1">=</span> <span class="pl-s1">onp</span>.<span class="pl-en">meshgrid</span>(<span class="pl-s1">points</span>, <span class="pl-s1">points</span>)
<span class="pl-v">R</span> <span class="pl-c1">=</span> <span class="pl-s1">onp</span>.<span class="pl-en">stack</span>((<span class="pl-v">X</span>.<span class="pl-en">ravel</span>(), <span class="pl-v">Y</span>.<span class="pl-en">ravel</span>()), <span class="pl-s1">axis</span><span class="pl-c1">=</span><span class="pl-c1">1</span>) <span class="pl-c1">+</span> <span class="pl-c1">0.1</span>
<span class="pl-v">R</span> <span class="pl-c1">=</span> <span class="pl-s1">onp</span>.<span class="pl-en">array</span>(<span class="pl-v">R</span>, <span class="pl-s1">onp</span>.<span class="pl-s1">float64</span>)
<span class="pl-s1">grid</span> <span class="pl-c1">=</span> <span class="pl-en">positions_to_grid</span>(<span class="pl-v">R</span>, <span class="pl-s1">box_size</span>, <span class="pl-s1">cell_size</span>, <span class="pl-s1">num_dims</span>, <span class="pl-s1">np</span>.<span class="pl-en">arange</span>(<span class="pl-v">R</span>.<span class="pl-s1">shape</span>[<span class="pl-c1">0</span>]) <span class="pl-c1">+</span> <span class="pl-c1">1</span>)
<span class="pl-s1">grid</span>, <span class="pl-s1">factors</span> <span class="pl-c1">=</span> <span class="pl-en">fold_grid</span>(<span class="pl-s1">grid</span>, <span class="pl-s1">max_grid_distance</span>,
<span class="pl-s1">batch_size</span><span class="pl-c1">=</span><span class="pl-c1">128</span>)
<span class="pl-k">def</span> <span class="pl-en">cond_fn</span>(<span class="pl-s1">grid_old_grid</span>):
<span class="pl-s1">grid</span>, <span class="pl-s1">i</span> <span class="pl-c1">=</span> <span class="pl-s1">grid_old_grid</span>
<span class="pl-k">return</span> (<span class="pl-s1">i</span> <span class="pl-c1"><</span> <span class="pl-c1">1</span>)
<span class="pl-k">def</span> <span class="pl-en">body_fn</span>(<span class="pl-s1">grid_old_grid</span>):
<span class="pl-s1">grid</span>, <span class="pl-s1">i</span> <span class="pl-c1">=</span> <span class="pl-s1">grid_old_grid</span>
<span class="pl-s1">_grid</span>, <span class="pl-s1">overflow_count</span> <span class="pl-c1">=</span> <span class="pl-en">update_grid_locations</span>(<span class="pl-s1">grid</span>, <span class="pl-s1">cell_size</span>, <span class="pl-s1">num_dims</span>, <span class="pl-s1">factors</span>)
<span class="pl-k">return</span> <span class="pl-s1">_grid</span>, <span class="pl-s1">i</span><span class="pl-c1">+</span><span class="pl-c1">1</span>
<span class="pl-s1">grid_old_grid</span> <span class="pl-c1">=</span> (<span class="pl-s1">grid</span>, <span class="pl-c1">0</span>)
<span class="pl-c">### BUG IS HERE. Compute a while loop two different ways. Result should be the</span>
<span class="pl-c">### same. Instead it's different.</span>
<span class="pl-s1">new_tuple_lax</span> <span class="pl-c1">=</span> <span class="pl-s1">lax</span>.<span class="pl-en">while_loop</span>(<span class="pl-s1">cond_fn</span>, <span class="pl-s1">body_fn</span>, <span class="pl-s1">grid_old_grid</span>)
<span class="pl-s1">new_tuple_while</span> <span class="pl-c1">=</span> <span class="pl-s1">grid_old_grid</span>
<span class="pl-k">while</span> <span class="pl-en">cond_fn</span>(<span class="pl-s1">new_tuple_while</span>):
<span class="pl-s1">new_tuple_while</span> <span class="pl-c1">=</span> <span class="pl-en">body_fn</span>(<span class="pl-s1">new_tuple_while</span>)
<span class="pl-s1">max_dev</span> <span class="pl-c1">=</span> <span class="pl-s1">onp</span>.<span class="pl-en">max</span>(<span class="pl-s1">onp</span>.<span class="pl-en">abs</span>(<span class="pl-s1">new_tuple_lax</span>[<span class="pl-c1">0</span>] <span class="pl-c1">-</span> <span class="pl-s1">new_tuple_while</span>[<span class="pl-c1">0</span>]))
<span class="pl-en">print</span>(<span class="pl-s1">max_dev</span>)
<span class="pl-k">assert</span> <span class="pl-s1">max_dev</span> <span class="pl-c1">==</span> <span class="pl-c1">0</span>
<span class="pl-en">test_grid</span>()</pre></div> | <p dir="auto">Hi all,</p>
<p dir="auto">I was discussing with <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/jakevdp/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/jakevdp">@jakevdp</a> in <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="859207960" data-permission-text="Title is private" data-url="https://github.com/google/jax/issues/6466" data-hovercard-type="pull_request" data-hovercard-url="/google/jax/pull/6466/hovercard" href="https://github.com/google/jax/pull/6466">#6466</a> about adding support for sparse matrices in Jax. He already did quite some groundwork, but there's a lot of open questions on the what and how. Quoting Jake here:</p>
<blockquote>
<ul dir="auto">
<li>2D CSC/CSR/COO may not be the abstraction we want in the end... pydata-sparse has N-dimensional sparse arrays implemented using COO or a multi-dimensional generalization of CSR. Similarly taco has routines for general N-dimensional sparse computation. That route may be better, particularly for some deep learning workflows that e.g. have 4D batched arrays of sparse image sequences.</li>
<li>XLA scatter/gather implementations only go so far... any operations we implement should have efficient lowerings on as many backends as possible - I've started with cusparse on GPU because the low-level routines are already available in our GPU build process. This means that every non-trivial operation should be either implemented as a primitive or composed of other primitives</li>
<li>JAX is about composability, and in particular pmap/vmap, jit, and grad are central to the API. I want to spend some time exploring how we can best implement gradients of sparse operations or batched sparse operations, and also think about how ongoing work on dynamic shapes can be utilized to make jit of sparse operations more efficient and usable. With all that up in the air I want to keep the design minimal for now in case we need to re-think our approach based on what we find</li>
<li>all of the above should be motivated by real-world workflows that people have. I'm starting to gather a few example workflows so we can have that in mind.</li>
</ul>
</blockquote>
<p dir="auto">So I set out to compare the implementations in pytorch and tensorflow to get a feel for what's out there, and considering the points above. Specifically, we're interested in how they implement it low-level: do they secretly turn everything dense under the surface, or are they given the full treatment with specific ops?</p>
<p dir="auto">I'm summarizing what I found in the table below - TL;DR Pytorch offers better support. Since documentation and support are all over the place, in this <a href="https://colab.research.google.com/drive/1dyfhD4SaSAfKPhx-aG7lF8BY88WlsWWx?usp=sharing" rel="nofollow">notebook</a> you can find a bunch of common operations with sparse tensor to see if they are supported. It's been a while since I did tensorflow, so let me know if I made a mistake!</p>
<table role="table">
<thead>
<tr>
<th align="left">Feature</th>
<th>Pytorch</th>
<th>Tensorflow</th>
</tr>
</thead>
<tbody>
<tr>
<td align="left">Documentation</td>
<td><a href="https://pytorch.org/docs/stable/sparse.html#" rel="nofollow">here</a></td>
<td><a href="https://www.tensorflow.org/guide/sparse_tensor" rel="nofollow">here</a></td>
</tr>
<tr>
<td align="left">Formats</td>
<td>COO</td>
<td>COO</td>
</tr>
<tr>
<td align="left">Supported ops</td>
<td>variations of matmul</td>
<td>sums, min, matmul, element-wise ops through <code class="notranslate">tf.sparse.map_values</code></td>
</tr>
<tr>
<td align="left">Specialized ops</td>
<td>Probably<sup><a href="#user-content-fn-5-dc92f6f795e789591e336bd2748f0620" id="user-content-fnref-5-dc92f6f795e789591e336bd2748f0620" data-footnote-ref="" aria-describedby="footnote-label">1</a></sup></td>
<td>Seems so <sup><a href="#user-content-fn-4-dc92f6f795e789591e336bd2748f0620" id="user-content-fnref-4-dc92f6f795e789591e336bd2748f0620" data-footnote-ref="" aria-describedby="footnote-label">2</a></sup></td>
</tr>
<tr>
<td align="left">Grad of sparse<sup><a href="#user-content-fn-1-dc92f6f795e789591e336bd2748f0620" id="user-content-fnref-1-dc92f6f795e789591e336bd2748f0620" data-footnote-ref="" aria-describedby="footnote-label">3</a></sup></td>
<td>Limited to specific matmul</td>
<td>No.</td>
</tr>
<tr>
<td align="left">Sparse grad<sup><a href="#user-content-fn-2-dc92f6f795e789591e336bd2748f0620" id="user-content-fnref-2-dc92f6f795e789591e336bd2748f0620" data-footnote-ref="" aria-describedby="footnote-label">4</a></sup></td>
<td>Yes</td>
<td>No.</td>
</tr>
<tr>
<td align="left">Dimensions</td>
<td>2D, Hybrid</td>
<td>2D - tensor supports higher-D, but operations not</td>
</tr>
<tr>
<td align="left">Uncoalesced<sup><a href="#user-content-fn-3-dc92f6f795e789591e336bd2748f0620" id="user-content-fnref-3-dc92f6f795e789591e336bd2748f0620" data-footnote-ref="" aria-describedby="footnote-label">5</a></sup>allowed</td>
<td>Yes</td>
<td>No mention</td>
</tr>
<tr>
<td align="left">Sparse - sparse matmul</td>
<td>No</td>
<td>No</td>
</tr>
<tr>
<td align="left">Extra goodies</td>
<td>Has an adam optimizer for sparse tensor</td>
<td>Nope</td>
</tr>
</tbody>
</table>
<p dir="auto">To do</p>
<ul dir="auto">
<li>Dig in the source code a little further (although if someone who actually is familiar with the code could chime in, that'd be great.)</li>
<li>Check how pydata-sparse implement n-D sparse arrays.</li>
</ul>
<p dir="auto">Proposal:</p>
<ul dir="auto">
<li>Get a very minimal differentiable sparse matmul working for COO format using XLA ops and one GPU-specific backend in cusparse (some help and guidance here would be nice)</li>
</ul>
<p dir="auto">I figured we can use this issue to track progress and discuss, so ... thoughts?</p>
<section data-footnotes="" class="footnotes"><h2 id="footnote-label" class="sr-only" dir="auto">Footnotes</h2>
<ol dir="auto">
<li id="user-content-fn-5-dc92f6f795e789591e336bd2748f0620">
<p dir="auto">They mention Torchcudasparse is now defunct <a href="https://github.com/pytorch/pytorch/tree/master/aten/src">here</a> but I can't find any other mention in the source code. <a href="#user-content-fnref-5-dc92f6f795e789591e336bd2748f0620" data-footnote-backref="" aria-label="Back to reference 1" class="data-footnote-backref"><g-emoji class="g-emoji" alias="leftwards_arrow_with_hook" fallback-src="https://github.githubassets.com/images/icons/emoji/unicode/21a9.png">↩</g-emoji></a></p>
</li>
<li id="user-content-fn-4-dc92f6f795e789591e336bd2748f0620">
<p dir="auto">Sparse ops are imported from gen_sparse_ops.py, which doesnt exist in the repo? <a href="#user-content-fnref-4-dc92f6f795e789591e336bd2748f0620" data-footnote-backref="" aria-label="Back to reference 2" class="data-footnote-backref"><g-emoji class="g-emoji" alias="leftwards_arrow_with_hook" fallback-src="https://github.githubassets.com/images/icons/emoji/unicode/21a9.png">↩</g-emoji></a></p>
</li>
<li id="user-content-fn-1-dc92f6f795e789591e336bd2748f0620">
<p dir="auto">Meaning gradient w.r.t to the sparse tensor <a href="#user-content-fnref-1-dc92f6f795e789591e336bd2748f0620" data-footnote-backref="" aria-label="Back to reference 3" class="data-footnote-backref"><g-emoji class="g-emoji" alias="leftwards_arrow_with_hook" fallback-src="https://github.githubassets.com/images/icons/emoji/unicode/21a9.png">↩</g-emoji></a></p>
</li>
<li id="user-content-fn-2-dc92f6f795e789591e336bd2748f0620">
<p dir="auto">Meaning calculating the gradient without turning it into a dense tensor <a href="#user-content-fnref-2-dc92f6f795e789591e336bd2748f0620" data-footnote-backref="" aria-label="Back to reference 4" class="data-footnote-backref"><g-emoji class="g-emoji" alias="leftwards_arrow_with_hook" fallback-src="https://github.githubassets.com/images/icons/emoji/unicode/21a9.png">↩</g-emoji></a></p>
</li>
<li id="user-content-fn-3-dc92f6f795e789591e336bd2748f0620">
<p dir="auto">Uncoalesced means duplicate entries in the coordinates - total value of the element is then sum of duplicate elements. <a href="#user-content-fnref-3-dc92f6f795e789591e336bd2748f0620" data-footnote-backref="" aria-label="Back to reference 5" class="data-footnote-backref"><g-emoji class="g-emoji" alias="leftwards_arrow_with_hook" fallback-src="https://github.githubassets.com/images/icons/emoji/unicode/21a9.png">↩</g-emoji></a></p>
</li>
</ol>
</section> | 0 |
<p dir="auto">Challenge <a href="http://freecodecamp.com/challenges/waypoint-manipulate-javascript-objects" rel="nofollow">http://freecodecamp.com/challenges/waypoint-manipulate-javascript-objects</a> has an issue. Please describe how to reproduce it, and include links to screenshots if possible.</p>
<p dir="auto">// ourDog.bark(“arf!");</p>
<p dir="auto">should be</p>
<p dir="auto">// ourDog.bark = “arf!”;</p> | <p dir="auto">Challenge <a href="http://www.freecodecamp.com/challenges/waypoint-bring-your-javascript-slot-machine-to-life" rel="nofollow">http://www.freecodecamp.com/challenges/waypoint-bring-your-javascript-slot-machine-to-life</a> has an issue. Please describe how to reproduce it, and include links to screenshots if possible.</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content=" slotOne = Math.floor(Math.random() * (3 - 1 + 1)) + 1;
slotTwo = Math.floor(Math.random() * (3 - 1 + 1)) + 1;
slotThree = Math.floor(Math.random() * (3 - 1 + 1)) + 1;
$($('.slot')[0]).html(slotOne);
$($('.slot')[1]).html(slotTwo);
$($('.slot')[2]).html(slotThree);"><pre class="notranslate"><code class="notranslate"> slotOne = Math.floor(Math.random() * (3 - 1 + 1)) + 1;
slotTwo = Math.floor(Math.random() * (3 - 1 + 1)) + 1;
slotThree = Math.floor(Math.random() * (3 - 1 + 1)) + 1;
$($('.slot')[0]).html(slotOne);
$($('.slot')[1]).html(slotTwo);
$($('.slot')[2]).html(slotThree);
</code></pre></div>
<p dir="auto">This is exactly how the description says to do it. Yet I get the error: You should have used the the selector given in the description to select each slot and assign it the value of slotOne, slotTwo and slotThree respectively.</p> | 0 |
<p dir="auto">Please see <a href="http://jsfiddle.net/5sH6A/174/" rel="nofollow">http://jsfiddle.net/5sH6A/174/</a> and press "Click me"</p> | <h3 dir="auto">What problem does this feature solve?</h3>
<p dir="auto">I would like to use the same methodoligy as vue, for custom error-messages: show them in dev, hide them on prod (except if there is a error-handler in place).</p>
<p dir="auto">For that it would be useful if I could just use vues built-in warn-function instead of duplicating that logic.</p>
<h3 dir="auto">What does the proposed API look like?</h3>
<p dir="auto">import Vue from 'vue'</p>
<p dir="auto">Vue.warn('My message')</p> | 0 |
<h2 dir="auto">Environment info</h2>
<ul dir="auto">
<li>transformers version: 3.5.1</li>
<li>Platform: Linux version 3.10.107-1-tlinux2-0050</li>
<li>Python version: 3.7.6</li>
<li>PyTorch version (GPU?): 1.6.0+cu101</li>
<li>Tensorflow version (GPU?): no</li>
<li>Using GPU in script?: yes</li>
<li>Using distributed or parallel set-up in script?: yes</li>
</ul>
<h2 dir="auto">Who can help</h2>
<p dir="auto"><a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/sgugger/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/sgugger">@sgugger</a></p>
<h2 dir="auto">To reproduce</h2>
<div class="highlight highlight-source-shell notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="CUDA_VISIBLE_DEVICES=1,2 python run_glue.py \
--model_name_or_path xlnet-base-cased \
--task_name stsb \
--do_eval \
--max_seq_length 128 \
--per_device_train_batch_size 32 \
--per_device_eval_batch_size 8 \
--max_steps 1200 \
--learning_rate 2e-5 \
--num_train_epochs 3.0 \
--output_dir ./output/tranformer/xlnet \
--cache_dir ./pretained_model/xlnet \
--overwrite_output_dir \
--overwrite_cache \
--eval_accumulation_steps 2 \
--gradient_accumulation_steps 1 \
--disable_tqdm True\
--dataloader_drop_last \
--past_index 2"><pre class="notranslate">CUDA_VISIBLE_DEVICES=1,2 python run_glue.py \
--model_name_or_path xlnet-base-cased \
--task_name stsb \
--do_eval \
--max_seq_length 128 \
--per_device_train_batch_size 32 \
--per_device_eval_batch_size 8 \
--max_steps 1200 \
--learning_rate 2e-5 \
--num_train_epochs 3.0 \
--output_dir ./output/tranformer/xlnet \
--cache_dir ./pretained_model/xlnet \
--overwrite_output_dir \
--overwrite_cache \
--eval_accumulation_steps 2 \
--gradient_accumulation_steps 1 \
--disable_tqdm True\
--dataloader_drop_last \
--past_index 2</pre></div>
<h2 dir="auto">error</h2>
<div class="highlight highlight-source-shell notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="[INFO|trainer.py:1387] 2020-11-18 15:21:21,084 >> ***** Running Evaluation *****
[INFO|trainer.py:1388] 2020-11-18 15:21:21,084 >> Num examples = 4000
[INFO|trainer.py:1389] 2020-11-18 15:21:21,085 >> Batch size = 16
./sim/lib/python3.7/site-packages/transformers/modeling_xlnet.py:297: UserWarning: Mixed memory format inputs detected while calling the operator. The operator will output contiguous tensor even if some of the inputs are in channels_last format. (Triggered internally at /pytorch/aten/src/ATen/native/TensorIterator.cpp:918.)
attn_score = (ac + bd + ef) * self.scale
./sim/lib/python3.7/site-packages/torch/nn/parallel/_functions.py:61: UserWarning: Was asked to gather along dimension 0, but all input tensors were scalars; will instead unsqueeze and return a vector.
warnings.warn('Was asked to gather along dimension 0, but all '
Traceback (most recent call last):
File "run_glue.py", line 414, in <module>
main()
File "run_glue.py", line 366, in main
eval_result = trainer.evaluate(eval_dataset=eval_dataset)
File "./sim/lib/python3.7/site-packages/transformers/trainer.py", line 1313, in evaluate
prediction_loss_only=True if self.compute_metrics is None else None,
File "./sim/lib/python3.7/site-packages/transformers/trainer.py", line 1431, in prediction_loop
preds_gatherer.add_arrays(self._gather_and_numpify(preds_host, "eval_preds"))
File "./sim/lib/python3.7/site-packages/transformers/trainer_pt_utils.py", line 330, in add_arrays
slice_len = self._nested_set_tensors(self._storage, arrays)
File "./sim/lib/python3.7/site-packages/transformers/trainer_pt_utils.py", line 337, in _nested_set_tensors
slice_len = self._nested_set_tensors(x, y)
File "./sim/lib/python3.7/site-packages/transformers/trainer_pt_utils.py", line 337, in _nested_set_tensors
slice_len = self._nested_set_tensors(x, y)
File "./sim/lib/python3.7/site-packages/transformers/trainer_pt_utils.py", line 349, in _nested_set_tensors
i * slice_len : (i + 1) * slice_len
ValueError: could not broadcast input array from shape (512,8,768) into shape (416,8,768)
```shell
Could you please help me? Thanks a lot !"><pre class="notranslate">[INFO<span class="pl-k">|</span>trainer.py:1387] 2020-11-18 15:21:21,084 <span class="pl-k">>></span> <span class="pl-k">*****</span> Running Evaluation <span class="pl-k">*****</span>
[INFO<span class="pl-k">|</span>trainer.py:1388] 2020-11-18 15:21:21,084 <span class="pl-k">>></span> Num examples = 4000
[INFO<span class="pl-k">|</span>trainer.py:1389] 2020-11-18 15:21:21,085 <span class="pl-k">>></span> Batch size = 16
./sim/lib/python3.7/site-packages/transformers/modeling_xlnet.py:297: UserWarning: Mixed memory format inputs detected <span class="pl-k">while</span> calling the operator. The operator will output contiguous tensor even <span class="pl-k">if</span> some of the inputs are <span class="pl-k">in</span> channels_last format. (Triggered internally at /pytorch/aten/src/ATen/native/TensorIterator.cpp:918.)
attn_score = (ac + bd + ef) <span class="pl-k">*</span> self.scale
./sim/lib/python3.7/site-packages/torch/nn/parallel/_functions.py:61: UserWarning: Was asked to gather along dimension 0, but all input tensors were scalars<span class="pl-k">;</span> will instead unsqueeze and <span class="pl-k">return</span> a vector.
warnings.warn(<span class="pl-s"><span class="pl-pds">'</span>Was asked to gather along dimension 0, but all <span class="pl-pds">'</span></span>
Traceback (most recent call last):
File <span class="pl-s"><span class="pl-pds">"</span>run_glue.py<span class="pl-pds">"</span></span>, line 414, <span class="pl-k">in</span> <span class="pl-k"><</span>module<span class="pl-k">></span>
<span class="pl-en">main</span>()
File <span class="pl-s"><span class="pl-pds">"</span>run_glue.py<span class="pl-pds">"</span></span>, line 366, <span class="pl-k">in</span> main
eval_result = trainer.evaluate(eval_dataset=eval_dataset)
File <span class="pl-s"><span class="pl-pds">"</span>./sim/lib/python3.7/site-packages/transformers/trainer.py<span class="pl-pds">"</span></span>, line 1313, <span class="pl-k">in</span> evaluate
prediction_loss_only=True <span class="pl-k">if</span> self.compute_metrics is None <span class="pl-k">else</span> None,
File <span class="pl-s"><span class="pl-pds">"</span>./sim/lib/python3.7/site-packages/transformers/trainer.py<span class="pl-pds">"</span></span>, line 1431, <span class="pl-k">in</span> prediction_loop
preds_gatherer.add_arrays(self._gather_and_numpify(preds_host, <span class="pl-s"><span class="pl-pds">"</span>eval_preds<span class="pl-pds">"</span></span>))
File <span class="pl-s"><span class="pl-pds">"</span>./sim/lib/python3.7/site-packages/transformers/trainer_pt_utils.py<span class="pl-pds">"</span></span>, line 330, <span class="pl-k">in</span> add_arrays
slice_len = self._nested_set_tensors(self._storage, arrays)
File <span class="pl-s"><span class="pl-pds">"</span>./sim/lib/python3.7/site-packages/transformers/trainer_pt_utils.py<span class="pl-pds">"</span></span>, line 337, <span class="pl-k">in</span> _nested_set_tensors
slice_len = self._nested_set_tensors(x, y)
File <span class="pl-s"><span class="pl-pds">"</span>./sim/lib/python3.7/site-packages/transformers/trainer_pt_utils.py<span class="pl-pds">"</span></span>, line 337, <span class="pl-k">in</span> _nested_set_tensors
slice_len = self._nested_set_tensors(x, y)
File <span class="pl-s"><span class="pl-pds">"</span>./sim/lib/python3.7/site-packages/transformers/trainer_pt_utils.py<span class="pl-pds">"</span></span>, line 349, <span class="pl-k">in</span> _nested_set_tensors
i <span class="pl-k">*</span> slice_len <span class="pl-c1">:</span> (i + 1) <span class="pl-k">*</span> slice_len
ValueError: could not broadcast input array from shape (512,8,768) into shape (416,8,768)
<span class="pl-s"><span class="pl-pds">`</span><span class="pl-pds">`</span><span class="pl-pds">`</span>shell</span>
<span class="pl-s"></span>
<span class="pl-s">Could you please <span class="pl-c1">help</span> me<span class="pl-k">?</span> Thanks a lot <span class="pl-k">!</span></span></pre></div> | <h2 dir="auto">Environment info</h2>
<ul dir="auto">
<li><code class="notranslate">transformers</code> version: 3.3.1</li>
<li>Platform: Linux-4.15.0-117-generic-x86_64-with-glibc2.10</li>
<li>Python version: 3.8.5</li>
<li>PyTorch version (GPU?): 1.4.0 (True)</li>
<li>Tensorflow version (GPU?): 2.2.0 (False)</li>
<li>Using GPU in script?: Yes</li>
<li>Using distributed or parallel set-up in script?: No</li>
</ul>
<h3 dir="auto">Who can help</h3>
<p dir="auto"><a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/sgugger/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/sgugger">@sgugger</a></p>
<h2 dir="auto">Information</h2>
<p dir="auto">Model I am using (Bert, XLNet ...): XLNet-base-cased</p>
<p dir="auto">The problem arises when using:</p>
<ul dir="auto">
<li>the official example scripts: run_glue.py</li>
</ul>
<p dir="auto">The tasks I am working on is:</p>
<ul dir="auto">
<li>an official GLUE/SQUaD task: SST-2</li>
</ul>
<h2 dir="auto">To reproduce</h2>
<p dir="auto">Steps to reproduce the behavior:</p>
<ol dir="auto">
<li>
<p dir="auto">Install transformers from master and download SST-2 data using <code class="notranslate">download_glue_data.py</code></p>
</li>
<li>
<p dir="auto">Create the following scripts</p>
</li>
</ol>
<div class="highlight highlight-source-shell notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="GLUE_DIR=~/glue
CUDA_VISIBLE_DEVICES=0
TASK_NAME=SST-2
python3 ~/applications/transformers/examples/text-classification/run_glue.py \
--model_name_or_path ~/xlnet \
--task_name $TASK_NAME \
--do_eval \
--data_dir $GLUE_DIR/$TASK_NAME \
--max_seq_length 64 \
--per_device_train_batch_size 32 \
--per_device_eval_batch_size 64 \
--learning_rate 2e-5 \
--num_train_epochs 3.0 \
--output_dir ~/result/$TASK_NAME/ \
--overwrite_output_dir \
--eval_steps 100
"><pre class="notranslate">GLUE_DIR=<span class="pl-k">~</span>/glue
CUDA_VISIBLE_DEVICES=0
TASK_NAME=SST-2
python3 <span class="pl-k">~</span>/applications/transformers/examples/text-classification/run_glue.py \
--model_name_or_path <span class="pl-k">~</span>/xlnet \
--task_name <span class="pl-smi">$TASK_NAME</span> \
--do_eval \
--data_dir <span class="pl-smi">$GLUE_DIR</span>/<span class="pl-smi">$TASK_NAME</span> \
--max_seq_length 64 \
--per_device_train_batch_size 32 \
--per_device_eval_batch_size 64 \
--learning_rate 2e-5 \
--num_train_epochs 3.0 \
--output_dir <span class="pl-k">~</span>/result/<span class="pl-smi">$TASK_NAME</span>/ \
--overwrite_output_dir \
--eval_steps 100
</pre></div>
<ol start="3" dir="auto">
<li>run this script</li>
</ol>
<h2 dir="auto">Expected behavior</h2>
<p dir="auto">Trainer should return appropriate evaluation results. Here are logs when evaluating bert-base with above-given hyperparameters.</p>
<div class="highlight highlight-source-shell notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="10/05/2020 22:28:47 - INFO - filelock - Lock 140392033291808 acquired on /data/home/liusishun/glue/SST-2/cached_dev_BertTokenizer_64_sst-2.lock
10/05/2020 22:28:47 - INFO - filelock - Lock 140392033291808 released on /data/home/liusishun/glue/SST-2/cached_dev_BertTokenizer_64_sst-2.lock
10/05/2020 22:28:50 - INFO - __main__ - *** Evaluate ***
Evaluation: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 14/14 [00:01<00:00, 7.22it/s]
{'eval_loss': 0.6916399122378148, 'eval_acc': 0.49770642201834864, 'step': 0}
/data/home/liusishun/.conda/envs/myenv/lib/python3.8/site-packages/transformers/trainer.py:1168: FutureWarning: This method is deprecated, use `Trainer.is_world_process_zero()` instead.
warnings.warn("This method is deprecated, use `Trainer.is_world_process_zero()` instead.", FutureWarning)
10/05/2020 22:28:52 - INFO - __main__ - ***** Eval results sst-2 *****
10/05/2020 22:28:52 - INFO - __main__ - eval_loss = 0.6916399122378148
10/05/2020 22:28:52 - INFO - __main__ - eval_acc = 0.49770642201834864
"><pre class="notranslate">10/05/2020 22:28:47 - INFO - filelock - Lock 140392033291808 acquired on /data/home/liusishun/glue/SST-2/cached_dev_BertTokenizer_64_sst-2.lock
10/05/2020 22:28:47 - INFO - filelock - Lock 140392033291808 released on /data/home/liusishun/glue/SST-2/cached_dev_BertTokenizer_64_sst-2.lock
10/05/2020 22:28:50 - INFO - __main__ - <span class="pl-k">***</span> Evaluate <span class="pl-k">***</span>
Evaluation: 100%<span class="pl-k">|</span>███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████<span class="pl-k">|</span> 14/14 [00:<span class="pl-k">01<</span>00:00, 7.22it/s]
{<span class="pl-s"><span class="pl-pds">'</span>eval_loss<span class="pl-pds">'</span></span>: 0.6916399122378148, <span class="pl-s"><span class="pl-pds">'</span>eval_acc<span class="pl-pds">'</span></span>: 0.49770642201834864, <span class="pl-s"><span class="pl-pds">'</span>step<span class="pl-pds">'</span></span>: 0}
/data/home/liusishun/.conda/envs/myenv/lib/python3.8/site-packages/transformers/trainer.py:1168: FutureWarning: This method is deprecated, use <span class="pl-en">`Trainer.is_world_process_zero</span>()<span class="pl-s"><span class="pl-pds">`</span> instead.</span>
<span class="pl-s"> warnings.warn(<span class="pl-s"><span class="pl-pds">"</span>This method is deprecated, use <span class="pl-s"><span class="pl-pds">`</span>Trainer.is_world_process_zero()<span class="pl-pds">`</span></span> instead.<span class="pl-pds">"</span></span>, FutureWarning)</span>
<span class="pl-s">10/05/2020 22:28:52 - INFO - __main__ - <span class="pl-k">*****</span> Eval results sst-2 <span class="pl-k">*****</span></span>
<span class="pl-s">10/05/2020 22:28:52 - INFO - __main__ - eval_loss = 0.6916399122378148</span>
<span class="pl-s">10/05/2020 22:28:52 - INFO - __main__ - eval_acc = 0.49770642201834864</span>
<span class="pl-s"></span></pre></div>
<h2 dir="auto">Observed behavior</h2>
<div class="highlight highlight-source-shell notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="10/05/2020 22:30:05 - INFO - filelock - Lock 139928226197216 acquired on /data/home/liusishun/glue/SST-2/cached_dev_XLNetTokenizer_64_sst-2.lock
10/05/2020 22:30:05 - INFO - filelock - Lock 139928226197216 released on /data/home/liusishun/glue/SST-2/cached_dev_XLNetTokenizer_64_sst-2.lock
10/05/2020 22:30:09 - INFO - __main__ - *** Evaluate ***
Evaluation: 93%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▉ | 13/14 [00:02<00:00, 4.44it/s]
Traceback (most recent call last):
File "/data/home/liusishun/applications/transformers/examples/text-classification/run_glue.py", line 247, in <module>
main()
File "/data/home/liusishun/applications/transformers/examples/text-classification/run_glue.py", line 197, in main
eval_result = trainer.evaluate(eval_dataset=eval_dataset)
File "/data/home/liusishun/.conda/envs/myenv/lib/python3.8/site-packages/transformers/trainer.py", line 1297, in evaluate
output = self.prediction_loop(eval_dataloader, description="Evaluation")
File "/data/home/liusishun/.conda/envs/myenv/lib/python3.8/site-packages/transformers/trainer.py", line 1382, in prediction_loop
preds = logits if preds is None else nested_concat(preds, logits, dim=0)
File "/data/home/liusishun/.conda/envs/myenv/lib/python3.8/site-packages/transformers/trainer_utils.py", line 151, in nested_concat
return type(tensors)(nested_concat(t, n, dim) for t, n in zip(tensors, new_tensors))
File "/data/home/liusishun/.conda/envs/myenv/lib/python3.8/site-packages/transformers/trainer_utils.py", line 151, in <genexpr>
return type(tensors)(nested_concat(t, n, dim) for t, n in zip(tensors, new_tensors))
File "/data/home/liusishun/.conda/envs/myenv/lib/python3.8/site-packages/transformers/trainer_utils.py", line 151, in nested_concat
return type(tensors)(nested_concat(t, n, dim) for t, n in zip(tensors, new_tensors))
File "/data/home/liusishun/.conda/envs/myenv/lib/python3.8/site-packages/transformers/trainer_utils.py", line 151, in <genexpr>
return type(tensors)(nested_concat(t, n, dim) for t, n in zip(tensors, new_tensors))
File "/data/home/liusishun/.conda/envs/myenv/lib/python3.8/site-packages/transformers/trainer_utils.py", line 152, in nested_concat
return torch.cat((tensors, new_tensors), dim=dim)
RuntimeError: invalid argument 0: Sizes of tensors must match except in dimension 0. Got 40 and 64 in dimension 1 at /opt/conda/conda-bld/pytorch_1579061855666/work/aten/src/THC/generic/THCTensorMath.cu:71"><pre class="notranslate">10/05/2020 22:30:05 - INFO - filelock - Lock 139928226197216 acquired on /data/home/liusishun/glue/SST-2/cached_dev_XLNetTokenizer_64_sst-2.lock
10/05/2020 22:30:05 - INFO - filelock - Lock 139928226197216 released on /data/home/liusishun/glue/SST-2/cached_dev_XLNetTokenizer_64_sst-2.lock
10/05/2020 22:30:09 - INFO - __main__ - <span class="pl-k">***</span> Evaluate <span class="pl-k">***</span>
Evaluation: 93%<span class="pl-k">|</span>███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▉ <span class="pl-k">|</span> 13/14 [00:<span class="pl-k">02<</span>00:00, 4.44it/s]
Traceback (most recent call last):
File <span class="pl-s"><span class="pl-pds">"</span>/data/home/liusishun/applications/transformers/examples/text-classification/run_glue.py<span class="pl-pds">"</span></span>, line 247, <span class="pl-k">in</span> <span class="pl-k"><</span>module<span class="pl-k">></span>
<span class="pl-en">main</span>()
File <span class="pl-s"><span class="pl-pds">"</span>/data/home/liusishun/applications/transformers/examples/text-classification/run_glue.py<span class="pl-pds">"</span></span>, line 197, <span class="pl-k">in</span> main
eval_result = trainer.evaluate(eval_dataset=eval_dataset)
File <span class="pl-s"><span class="pl-pds">"</span>/data/home/liusishun/.conda/envs/myenv/lib/python3.8/site-packages/transformers/trainer.py<span class="pl-pds">"</span></span>, line 1297, <span class="pl-k">in</span> evaluate
output = self.prediction_loop(eval_dataloader, description=<span class="pl-s"><span class="pl-pds">"</span>Evaluation<span class="pl-pds">"</span></span>)
File <span class="pl-s"><span class="pl-pds">"</span>/data/home/liusishun/.conda/envs/myenv/lib/python3.8/site-packages/transformers/trainer.py<span class="pl-pds">"</span></span>, line 1382, <span class="pl-k">in</span> prediction_loop
preds = logits <span class="pl-k">if</span> preds is None <span class="pl-k">else</span> nested_concat(preds, logits, dim=0)
File <span class="pl-s"><span class="pl-pds">"</span>/data/home/liusishun/.conda/envs/myenv/lib/python3.8/site-packages/transformers/trainer_utils.py<span class="pl-pds">"</span></span>, line 151, <span class="pl-k">in</span> nested_concat
<span class="pl-k">return</span> type(tensors)(nested_concat(t, n, dim) <span class="pl-k">for</span> <span class="pl-smi">t, n</span> <span class="pl-k">in</span> zip(tensors, new_tensors))
File <span class="pl-s"><span class="pl-pds">"</span>/data/home/liusishun/.conda/envs/myenv/lib/python3.8/site-packages/transformers/trainer_utils.py<span class="pl-pds">"</span></span>, line 151, <span class="pl-k">in</span> <span class="pl-k"><</span>genexpr<span class="pl-k">></span>
<span class="pl-k">return</span> type(tensors)(nested_concat(t, n, dim) <span class="pl-k">for</span> <span class="pl-smi">t, n</span> <span class="pl-k">in</span> zip(tensors, new_tensors))
File <span class="pl-s"><span class="pl-pds">"</span>/data/home/liusishun/.conda/envs/myenv/lib/python3.8/site-packages/transformers/trainer_utils.py<span class="pl-pds">"</span></span>, line 151, <span class="pl-k">in</span> nested_concat
<span class="pl-k">return</span> type(tensors)(nested_concat(t, n, dim) <span class="pl-k">for</span> <span class="pl-smi">t, n</span> <span class="pl-k">in</span> zip(tensors, new_tensors))
File <span class="pl-s"><span class="pl-pds">"</span>/data/home/liusishun/.conda/envs/myenv/lib/python3.8/site-packages/transformers/trainer_utils.py<span class="pl-pds">"</span></span>, line 151, <span class="pl-k">in</span> <span class="pl-k"><</span>genexpr<span class="pl-k">></span>
<span class="pl-k">return</span> type(tensors)(nested_concat(t, n, dim) <span class="pl-k">for</span> <span class="pl-smi">t, n</span> <span class="pl-k">in</span> zip(tensors, new_tensors))
File <span class="pl-s"><span class="pl-pds">"</span>/data/home/liusishun/.conda/envs/myenv/lib/python3.8/site-packages/transformers/trainer_utils.py<span class="pl-pds">"</span></span>, line 152, <span class="pl-k">in</span> nested_concat
<span class="pl-k">return</span> torch.cat<span class="pl-s"><span class="pl-pds">((</span>tensors<span class="pl-k">,</span> new_tensors)<span class="pl-k">,</span> dim<span class="pl-k">=</span>dim)</span>
<span class="pl-s">RuntimeError: invalid argument <span class="pl-c1">0</span>: Sizes of tensors must match except in dimension <span class="pl-c1">0</span>. Got <span class="pl-c1">40</span> and <span class="pl-c1">64</span> in dimension <span class="pl-c1">1</span> at /opt/conda/conda-bld/pytorch_<span class="pl-c1">1579061855666</span>/work/aten/src/THC/generic/THCTensorMath.cu:<span class="pl-c1">71</span></span></pre></div> | 1 |
<h4 dir="auto">Description</h4>
<p dir="auto">Until recently I was using RandomForestClassifier from scikit version 0.17. I was using a cross-validation procedure based on different groups of my dataset, so I had created a function similar to that of LeaveOneGroupOut from version 0.18. That function creates around 300 different data splits (as I have 300 different groups, so each time all instances of a particular group are used as test set and the rest are used for training) and then I apply RandomForestClassifier to each one of these data splits (see code below).</p>
<p dir="auto">As I wanted to use some functions from the next version, I upgraded scikit-learn to version 0.18.1. I realised that using exactly the same script and dataset, the overall process takes almost triple time running the RandomForestClassifier among these 300 cross-validation iterations for the set. This time I utilise the LeaveOneGroupOut function present in version 0.18.1, but by alternatively using my previous in-house made function to do the same thing, I have exactly the same problem after upgrading.</p>
<p dir="auto">By examining a little bit what is going on, I saw that the problem was during the initialisation of the random forest predictor and not while creating the sets. As I have 100 different datasets where I apply this procedure, it takes a lot more time to finish my analysis.</p>
<p dir="auto">Did someone else experience this problem? Otherwise, I will check again in case something else messes up with the running time.</p>
<p dir="auto">Thank you!</p>
<h4 dir="auto">Steps/Code to Reproduce</h4>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content=" #create data split (I save them first in one matrix, because I want to edit them later)
logo=LeaveOneGroupOut()
data_split=[]
for train_index,test_index in logo.split(instance_set,label_set,groups=instance_groups):
data_split+=[[train_index,test_index]]
#iterate over the data splits and create random forest for each
for train_index,test_index in data_split:
train_set=[instance_set[i] for i in train_index]
test_set=[instance_set[i] for i in test_index]
train_label=[label_set[i] for i in train_index]
test_label=[label_set[i] for i in test_index]
#create Random Forest instance
clf=RandomForestClassifier(n_estimators=100,max_depth=10)
new_clf=clf.fit(train_set,train_label)"><pre class="notranslate"><code class="notranslate"> #create data split (I save them first in one matrix, because I want to edit them later)
logo=LeaveOneGroupOut()
data_split=[]
for train_index,test_index in logo.split(instance_set,label_set,groups=instance_groups):
data_split+=[[train_index,test_index]]
#iterate over the data splits and create random forest for each
for train_index,test_index in data_split:
train_set=[instance_set[i] for i in train_index]
test_set=[instance_set[i] for i in test_index]
train_label=[label_set[i] for i in train_index]
test_label=[label_set[i] for i in test_index]
#create Random Forest instance
clf=RandomForestClassifier(n_estimators=100,max_depth=10)
new_clf=clf.fit(train_set,train_label)
</code></pre></div>
<h4 dir="auto">Expected Results</h4>
<p dir="auto">Running time for one dataset with 300 cross-validation iterations using LeaveOneGroupOut (before upgrading): 1m</p>
<h4 dir="auto">Actual Results</h4>
<p dir="auto">Running time for one dataset with 300 cross-validation iterations using LeaveOneGroupOut (after upgrading): 3m</p>
<h4 dir="auto">Versions</h4>
<p dir="auto">Linux-3.13.0-85-generic-x86_64-with-Ubuntu-14.04-trusty<br>
('Python', '2.7.6 (default, Jun 22 2015, 17:58:13) \n[GCC 4.8.2]')<br>
('NumPy', '1.8.2')<br>
('SciPy', '0.13.3')<br>
('Scikit-Learn', '0.18.1')</p> | <h4 dir="auto">Description</h4>
<p dir="auto">After upgrading to 0.18.1 predict of ExtraTreesRegressor is about 10 times slower.</p>
<p dir="auto">Version 0.17</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Linux-4.4.0-57-generic-x86_64-with-Ubuntu-16.04-xenial
('Python', '2.7.12 (default, Nov 19 2016, 06:48:10) \n[GCC 5.4.0 20160609]')
('NumPy', '1.11.3')
('SciPy', '0.18.1')
('Scikit-Learn', '0.17')
fit: 1.26665902138
predict: 0.00265598297119"><pre class="notranslate"><code class="notranslate">Linux-4.4.0-57-generic-x86_64-with-Ubuntu-16.04-xenial
('Python', '2.7.12 (default, Nov 19 2016, 06:48:10) \n[GCC 5.4.0 20160609]')
('NumPy', '1.11.3')
('SciPy', '0.18.1')
('Scikit-Learn', '0.17')
fit: 1.26665902138
predict: 0.00265598297119
</code></pre></div>
<p dir="auto">Version 0.18.1</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Linux-4.4.0-57-generic-x86_64-with-Ubuntu-16.04-xenial
('Python', '2.7.12 (default, Nov 19 2016, 06:48:10) \n[GCC 5.4.0 20160609]')
('NumPy', '1.11.3')
('SciPy', '0.18.1')
('Scikit-Learn', '0.18.1')
fit: 1.34347200394
predict: 0.0433509349823"><pre class="notranslate"><code class="notranslate">Linux-4.4.0-57-generic-x86_64-with-Ubuntu-16.04-xenial
('Python', '2.7.12 (default, Nov 19 2016, 06:48:10) \n[GCC 5.4.0 20160609]')
('NumPy', '1.11.3')
('SciPy', '0.18.1')
('Scikit-Learn', '0.18.1')
fit: 1.34347200394
predict: 0.0433509349823
</code></pre></div>
<h4 dir="auto">Steps/Code to Reproduce</h4>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="import platform; print(platform.platform())
import sys; print("Python", sys.version)
import numpy; print("NumPy", numpy.__version__)
import scipy; print("SciPy", scipy.__version__)
import sklearn; print("Scikit-Learn", sklearn.__version__)
from sklearn.datasets import make_friedman3
from sklearn.ensemble import ExtraTreesRegressor
from time import time
numpy.random.seed(6652)
X, Y = make_friedman3(10000)
forest = ExtraTreesRegressor(n_estimators=100)
start = time()
forest = forest.fit(X, Y)
print 'fit: {}'.format(time() - start)
start = time()
output = forest.predict(numpy.array([[1, 2., 5, 32.]]))
print 'predict: {}'.format(time() - start)"><pre class="notranslate"><code class="notranslate">import platform; print(platform.platform())
import sys; print("Python", sys.version)
import numpy; print("NumPy", numpy.__version__)
import scipy; print("SciPy", scipy.__version__)
import sklearn; print("Scikit-Learn", sklearn.__version__)
from sklearn.datasets import make_friedman3
from sklearn.ensemble import ExtraTreesRegressor
from time import time
numpy.random.seed(6652)
X, Y = make_friedman3(10000)
forest = ExtraTreesRegressor(n_estimators=100)
start = time()
forest = forest.fit(X, Y)
print 'fit: {}'.format(time() - start)
start = time()
output = forest.predict(numpy.array([[1, 2., 5, 32.]]))
print 'predict: {}'.format(time() - start)
</code></pre></div>
<p dir="auto">I installed/uninstalled through pip</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="pip install scikit-learn==0.17 --no-cache-dir
pip uninstall scikit-learn
pip install scikit-learn==0.18.1 --no-cache-dir"><pre class="notranslate"><code class="notranslate">pip install scikit-learn==0.17 --no-cache-dir
pip uninstall scikit-learn
pip install scikit-learn==0.18.1 --no-cache-dir
</code></pre></div>
<p dir="auto">Cython version 0.23.4</p> | 1 |
<p dir="auto"><strong><a href="https://jira.spring.io/secure/ViewProfile.jspa?name=denis.zhdanov" rel="nofollow">Denis Zhdanov</a></strong> opened <strong><a href="https://jira.spring.io/browse/SPR-6253?redirect=false" rel="nofollow">SPR-6253</a></strong> and commented</p>
<p dir="auto">Spring defines a contract for autowiring arrays and type collections (<a href="http://static.springsource.org/spring/docs/3.0.x/spring-framework-reference/html/ch03s04.html#beans-factory-autowire" rel="nofollow">3.4.5 Autowiring collaborators</a>, <a href="http://static.springsource.org/spring/docs/3.0.x/spring-framework-reference/html/ch03s09.html#beans-autowired-annotation" rel="nofollow">3.9.2 @Autowired and @Inject</a>).</p>
<p dir="auto">However, there is a possible use-case that a user wants to define particular order for autowired collection/array. It looks obvious in the case of autowiring typed lists (the client may want to preserve particular order for the list elements) but the same idea may be spread easily to sets/maps/arrays.</p>
<p dir="auto">I suggest the following rules to be used during examining the order for two elements:</p>
<ul dir="auto">
<li>if both classes of compared object are marked by <a href="http://static.springsource.org/spring/docs/3.0.x/javadoc-api/org/springframework/core/annotation/Order.html" rel="nofollow">Ordered</a> the one with lower value is considered to be less than another;</li>
<li>if class of one element is marked by <a href="http://static.springsource.org/spring/docs/3.0.x/javadoc-api/org/springframework/core/annotation/Order.html" rel="nofollow">Ordered</a> and class of another is not marked by <a href="http://static.springsource.org/spring/docs/3.0.x/javadoc-api/org/springframework/core/annotation/Order.html" rel="nofollow">Ordered</a> the former is considered to be less than the later;</li>
<li>if both classes of compared elements are not marked by <a href="http://static.springsource.org/spring/docs/3.0.x/javadoc-api/org/springframework/core/annotation/Order.html" rel="nofollow">Ordered</a> but implement <a href="http://java.sun.com/javase/6/docs/api/java/lang/Comparable.html" rel="nofollow">Comparable</a> with consisting type parameter they are compared via <a href="http://java.sun.com/javase/6/docs/api/java/lang/Comparable.html#compareTo(T)" rel="nofollow">Comparable#compareTo(Object)</a>;</li>
</ul>
<p dir="auto">Please note that the rules above may be applied to all elements of autowired collection/array in order to define particular for them.</p>
<p dir="auto"><strong>Implementation</strong></p>
<p dir="auto">That feature may be optional and defaults to perform ordering. It seems that most natural to allow to define it via additional method of <a href="http://static.springsource.org/spring/docs/3.0.x/javadoc-api/org/springframework/beans/factory/annotation/Autowired.html" rel="nofollow">@Autowired</a> annotation.</p>
<p dir="auto">So, it can be implemented easily via minor <a href="http://static.springsource.org/spring/docs/3.0.x/javadoc-api/org/springframework/beans/factory/annotation/AutowiredAnnotationBeanPostProcessor.html" rel="nofollow">AutowiredAnnotationBeanPostProcessor</a> modification - the argument to be injected is just sorted if necessary.</p>
<p dir="auto">Attached archive contains either feature implementation (classes from <em>'org.springframework.beans.factory.annotation'</em> package) or usage example (classes from <em>'com.spring.example'</em> package and its subpackages).</p>
<hr>
<p dir="auto"><strong>Affects:</strong> 3.0 RC1</p>
<p dir="auto"><strong>Attachments:</strong></p>
<ul dir="auto">
<li><a href="https://jira.spring.io/secure/attachment/15824/ordered-autowired-collection.tar.gz" rel="nofollow">ordered-autowired-collection.tar.gz</a> (<em>9.63 kB</em>)</li>
</ul>
<p dir="auto"><strong>Issue Links:</strong></p>
<ul dir="auto">
<li><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="398093786" data-permission-text="Title is private" data-url="https://github.com/spring-projects/spring-framework/issues/10245" data-hovercard-type="issue" data-hovercard-url="/spring-projects/spring-framework/issues/10245/hovercard" href="https://github.com/spring-projects/spring-framework/issues/10245">#10245</a> Autowiring should support ordered collection driven by Order annotation or Ordered interface (<em><strong>"duplicates"</strong></em>)</li>
</ul>
<p dir="auto">8 votes, 6 watchers</p> | <p dir="auto"><strong><a href="https://jira.spring.io/secure/[email protected]" rel="nofollow">Jörg Heinicke</a></strong> opened <strong><a href="https://jira.spring.io/browse/SPR-3461?redirect=false" rel="nofollow">SPR-3461</a></strong> and commented</p>
<p dir="auto">Didn't find a better summary ...</p>
<p dir="auto">My problem occurs when using spring:bind inside spring:nestedPath and form:form:</p>
<p dir="auto"><form:form command="command"><br>
<spring:nestedPath path="nestedPath"></p>
<p dir="auto"><!-- ends in path nestedPath.test1 --></p>
<p dir="auto"><spring:bind path="test1"/></p>
<p dir="auto"><!-- ends in path command.nestedPath.test2 --></p>
<p dir="auto"><form:input path="test2"/><br>
</spring:nestedPath><br>
</form:form></p>
<p dir="auto">As you see you get two different paths for spring:bind and form:input while I would expect to get the same for both. This is because form:input (actually AbstractDataBoundFormElementTag) has special handling for command while spring:bind is of course not aware of it. This could be made consistent by making form:form behave like spring:nestedPath with setting the command name as nestedPath.</p>
<hr>
<p dir="auto"><strong>Affects:</strong> 2.0.4</p>
<p dir="auto"><strong>Issue Links:</strong></p>
<ul dir="auto">
<li><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="398068395" data-permission-text="Title is private" data-url="https://github.com/spring-projects/spring-framework/issues/6988" data-hovercard-type="issue" data-hovercard-url="/spring-projects/spring-framework/issues/6988/hovercard" href="https://github.com/spring-projects/spring-framework/issues/6988">#6988</a> provide form:transform tag</li>
</ul>
<p dir="auto">1 votes, 0 watchers</p> | 0 |
<p dir="auto">There are pitfalls when using the watch + list pattern. Many of our controllers use this pattern, and we expect many future pieces of code to use this pattern. Therefore, we'd like to provide a framework/example which lets you fill out three functions (list, watch, and process) to get a shiny new bug-free (at least the list+watch part) controller.</p>
<p dir="auto">This can be modeled after/mostly copied from the scheduler.</p> | <p dir="auto">Filing this so we can revisit.<br>
<a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/satnam6502/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/satnam6502">@satnam6502</a></p>
<p dir="auto">Service names (and apparently Namespace names in the client, but not the server) are restricted to DNS 952 labels (24 characters). Most other API Objects have names that are DNS 1123 subdomains (much longer).</p>
<p dir="auto">In doing tests it is useful to generate random names, and this is a bit annoying for services.</p>
<p dir="auto">Can we expand service names?</p>
<ol dir="auto">
<li>DNS 1035 labels (longer)</li>
<li>DNS 1035 subdomains (longer and allow dots)</li>
<li>DNS 1123 labels (longer, allow leading digit)</li>
<li>DNS 1123 subdomains (longer, allow leading digit and dots)</li>
</ol>
<p dir="auto">(4) would be most consistent with other objects.</p>
<p dir="auto">If we do (2) or (4) we need to convert dots to underscores in env-var names, which could cause a collision (e.g. foo-bar and foo.bar). Maybe double underscore for dots?</p>
<p dir="auto">If we do (3) or (4) we need to handle leading digits in env-vars. Maybe a prefixed underscore?</p>
<p dir="auto">(1) seems least controversial, but is still different than everything else.</p> | 0 |
<p dir="auto">If I git clone the quick start tutorial and npm install, it pulls in [email protected] which doesn't work with the latest default installation of Windows 10.</p>
<p dir="auto">If I downgrade to 1.0.1, things starts working.</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="npm install [email protected] -g
electron app"><pre class="notranslate"><code class="notranslate">npm install [email protected] -g
electron app
</code></pre></div> | <ul dir="auto">
<li>Electron version: 1.1.0</li>
<li>Operating system: Windows 7</li>
</ul>
<p dir="auto">The system does not have visual studio 2015 installed</p> | 1 |
<p dir="auto"><strong>Foreword:</strong> None of this is really set in stone. Feel free to argue and discuss. This is kinda a long issue so I added some gifs, I hear developers love that kind of stuff. This post is also a bit rough, figured it's better to get it out there ASAP, I'll improve it as more feedback is collected. Thanks everyone for your (potential) participation!</p>
<h2 dir="auto">What is 6.0 going to look like?</h2>
<p dir="auto"><strong>No internal transformers. None. Zero. Zilch.</strong></p>
<p dir="auto">This will be coupled with the <strong>removal</strong> of the following options:</p>
<ul dir="auto">
<li><code class="notranslate">whitelist</code></li>
<li><code class="notranslate">blacklist</code></li>
<li><code class="notranslate">optional</code></li>
<li><code class="notranslate">loose</code></li>
<li><code class="notranslate">stage</code></li>
</ul>
<p dir="auto">All of these options are redundant when you're manually specifying transformers.</p>
<p dir="auto">This dramatically reduces complexity in the transformer options. Right now there's way too many ways to change the state of a transformer. This will reduce friction and make it easier to reason about what's actually enabled.</p>
<p dir="auto">There's also a <strong>major</strong> problem with including very experimental syntax/transformers in core. If a big change was made to their semantics it would be a breaking change and would require a major version bump of Babel. In the interest of stability and being reactive to changes in the standardisation process, it makes sense to version them independently.</p>
<h2 dir="auto">When?</h2>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://camo.githubusercontent.com/311c8833e81f1d76130150c18862b7ff69be2d652f0309042ce3eaf1e4be1bd4/687474703a2f2f7777772e73686172656769662e636f6d2f77702d636f6e74656e742f75706c6f6164732f323031342f30342f626162792d676966636f6e66757365642d67696669646b676f6f642d6c75636b2d636861726c69652e676966"><img src="https://camo.githubusercontent.com/311c8833e81f1d76130150c18862b7ff69be2d652f0309042ce3eaf1e4be1bd4/687474703a2f2f7777772e73686172656769662e636f6d2f77702d636f6e74656e742f75706c6f6164732f323031342f30342f626162792d676966636f6e66757365642d67696669646b676f6f642d6c75636b2d636861726c69652e676966" alt="idk" data-animated-image="" data-canonical-src="http://www.sharegif.com/wp-content/uploads/2014/04/baby-gifconfused-gifidkgood-luck-charlie.gif" style="max-width: 100%;"></a></p>
<p dir="auto">idk whenever</p>
<h2 dir="auto">Where will all the current builtin transformers go?</h2>
<p dir="auto">Into userland plugins.</p>
<h2 dir="auto">Wont this make it harder to use 6.x like we use 5.x?</h2>
<p dir="auto">Nope! 6.0 will also introduce the concept of <strong>presets</strong>. These are modules distributed via npm that specify a set of options (plugins etc) that will be merged into your main configuration.</p>
<h3 dir="auto">Recommended</h3>
<p dir="auto">This means that the current ES6 to ES5 configuration would be distributed on npm via the <code class="notranslate">babel-preset-es2015</code> package. It would have the <code class="notranslate">index.js</code> of:</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="module.exports = {
plugins: [
require("babel-plugin-arrow-functions"),
require("babel-plugin-classes"),
...
]
};"><pre class="notranslate"><span class="pl-smi">module</span><span class="pl-kos">.</span><span class="pl-c1">exports</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span>
<span class="pl-c1">plugins</span>: <span class="pl-kos">[</span>
<span class="pl-en">require</span><span class="pl-kos">(</span><span class="pl-s">"babel-plugin-arrow-functions"</span><span class="pl-kos">)</span><span class="pl-kos">,</span>
<span class="pl-en">require</span><span class="pl-kos">(</span><span class="pl-s">"babel-plugin-classes"</span><span class="pl-kos">)</span><span class="pl-kos">,</span>
...
<span class="pl-kos">]</span>
<span class="pl-kos">}</span><span class="pl-kos">;</span></pre></div>
<p dir="auto">To use this you'd just specify the following in your <code class="notranslate">.babelrc</code>:</p>
<div class="highlight highlight-source-json notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="{
"plugins": ["preset-es2015"]
}"><pre class="notranslate">{
<span class="pl-ent">"plugins"</span>: [<span class="pl-s"><span class="pl-pds">"</span>preset-es2015<span class="pl-pds">"</span></span>]
}</pre></div>
<h3 dir="auto">Community-specific</h3>
<p dir="auto">These can be even more specific. For example, the React community may have an official preset called <code class="notranslate">babel-preset-react</code> that will have the following <code class="notranslate">index.js</code>:</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="module.exports = {
plugins: [
require("babel-plugin-jsx"), // enables jsx syntax
require("babel-plugin-flow"), // enables flow syntax
require("babel-plugin-react-jsx"), // transforms jsx to flow
require("babel-plugin-flow-comments"), // transforms type annotations to flow
]
};"><pre class="notranslate"><span class="pl-smi">module</span><span class="pl-kos">.</span><span class="pl-c1">exports</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span>
<span class="pl-c1">plugins</span>: <span class="pl-kos">[</span>
<span class="pl-en">require</span><span class="pl-kos">(</span><span class="pl-s">"babel-plugin-jsx"</span><span class="pl-kos">)</span><span class="pl-kos">,</span> <span class="pl-c">// enables jsx syntax</span>
<span class="pl-en">require</span><span class="pl-kos">(</span><span class="pl-s">"babel-plugin-flow"</span><span class="pl-kos">)</span><span class="pl-kos">,</span> <span class="pl-c">// enables flow syntax</span>
<span class="pl-en">require</span><span class="pl-kos">(</span><span class="pl-s">"babel-plugin-react-jsx"</span><span class="pl-kos">)</span><span class="pl-kos">,</span> <span class="pl-c">// transforms jsx to flow</span>
<span class="pl-en">require</span><span class="pl-kos">(</span><span class="pl-s">"babel-plugin-flow-comments"</span><span class="pl-kos">)</span><span class="pl-kos">,</span> <span class="pl-c">// transforms type annotations to flow</span>
<span class="pl-kos">]</span>
<span class="pl-kos">}</span><span class="pl-kos">;</span></pre></div>
<p dir="auto">Just like the <code class="notranslate">es2015</code> preset, this could be enabled with the following <code class="notranslate">.babelrc</code>:</p>
<div class="highlight highlight-source-json notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="{
"plugins": ["preset-es2015", "preset-react"]
}"><pre class="notranslate">{
<span class="pl-ent">"plugins"</span>: [<span class="pl-s"><span class="pl-pds">"</span>preset-es2015<span class="pl-pds">"</span></span>, <span class="pl-s"><span class="pl-pds">"</span>preset-react<span class="pl-pds">"</span></span>]
}</pre></div>
<h2 dir="auto">Isn't this a dramatic shift in focus?</h2>
<p dir="auto">Nope, this is a part of the long term vision for Babel and everything has been leading up to this (cue dramatic music). I bought this up in <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="55108963" data-permission-text="Title is private" data-url="https://github.com/babel/babel/issues/568" data-hovercard-type="issue" data-hovercard-url="/babel/babel/issues/568/hovercard" href="https://github.com/babel/babel/issues/568">#568</a> back in January where I said:</p>
<blockquote>
<p dir="auto">Ideally I'd like for 6to5 to be a more general JavaScript of the future transpiler. 6to5 already supports Flow/JSX as well as experimental ES7 features so the name isn't even representative of the project in it's current state although it is in how it's widely used.</p>
<p dir="auto">A JavaScript transpiler based on future standards and specifications, whether ECMAScript or not, I think is an extremely noble goal. I think there's a large use case for 6to5 beyond just ES6. Having an interopable platform to base code transformations on I think is a very powerful idea. This may mean exposing a very feature-rich core that contains transforms or even exposing a public API.</p>
</blockquote>
<h2 dir="auto">What about syntax extensions?</h2>
<p dir="auto">I'll be holding out on allowing arbitrary syntax extensions for the timebeing. If we're going to do them at all, we're going to do them right. No point half assing a very critical and fragile piece such as syntax extension.</p>
<h3 dir="auto">But if there's no syntax extensions then how would existing transformer that enable special syntax work?</h3>
<p dir="auto">So, the syntax would be implemented in the Babel parser <a href="https://github.com/babel/babel/tree/master/packages/babylon">Babylon</a>, the "syntax plugins" would just toggle some parser options via an API. So the actual parser code would still live in Babylon. It's a neat solution until we support syntax extensions properly.</p>
<h2 dir="auto">What else is coming?</h2>
<h3 dir="auto">Plugin options (<a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="91060156" data-permission-text="Title is private" data-url="https://github.com/babel/babel/issues/1833" data-hovercard-type="issue" data-hovercard-url="/babel/babel/issues/1833/hovercard" href="https://github.com/babel/babel/issues/1833">#1833</a>)</h3>
<p dir="auto">Plugin options are something that sorely needed.</p>
<h4 dir="auto">Specifying options</h4>
<p dir="auto">These can be specified via a multidimensional array. For example, say you have a <code class="notranslate">babel-plugin-pancakes</code> plugin, you could specify options to it like so:</p>
<p dir="auto"><strong>.babelrc</strong></p>
<div class="highlight highlight-source-json notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="{
"plugins": [["pancakes", { "syrup": "maple" }]]
}"><pre class="notranslate">{
<span class="pl-ent">"plugins"</span>: [[<span class="pl-s"><span class="pl-pds">"</span>pancakes<span class="pl-pds">"</span></span>, { <span class="pl-ent">"syrup"</span>: <span class="pl-s"><span class="pl-pds">"</span>maple<span class="pl-pds">"</span></span> }]]
}</pre></div>
<p dir="auto">But how would you specify options for plugins defined in a preset? One possible way is to specify them in the options to a preset, so if you had a preset like:</p>
<p dir="auto"><strong>node_modules/babel-preset-breakfast/index.js</strong></p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="module.exports = {
plugins: [require("babel-plugin-pancakes")]
};"><pre class="notranslate"><span class="pl-smi">module</span><span class="pl-kos">.</span><span class="pl-c1">exports</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span>
<span class="pl-c1">plugins</span>: <span class="pl-kos">[</span><span class="pl-en">require</span><span class="pl-kos">(</span><span class="pl-s">"babel-plugin-pancakes"</span><span class="pl-kos">)</span><span class="pl-kos">]</span>
<span class="pl-kos">}</span><span class="pl-kos">;</span></pre></div>
<p dir="auto">Then you could specify the options for <code class="notranslate">babel-plugin-pancakes</code> like so:</p>
<p dir="auto"><strong>.babelrc</strong></p>
<div class="highlight highlight-source-json notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="{
"plugins": [["preset-breakfast", {
"pancakes": { "syrup": true }
}]]
}"><pre class="notranslate">{
<span class="pl-ent">"plugins"</span>: [[<span class="pl-s"><span class="pl-pds">"</span>preset-breakfast<span class="pl-pds">"</span></span>, {
<span class="pl-ent">"pancakes"</span>: { <span class="pl-ent">"syrup"</span>: <span class="pl-c1">true</span> }
}]]
}</pre></div>
<h4 dir="auto">Accessing them from a plugin</h4>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="export default function ({ Plugin }) {
return new Plugin("pancakes", {
visitor: {
ObjectExpression(node, parent, scope, state) {
if (state.options.syrup !== "maple") {
throw this.errorWithNode("No objects allowed unless I get maple syrup >:(");
}
}
}
});
}"><pre class="notranslate"><span class="pl-k">export</span> <span class="pl-k">default</span> <span class="pl-k">function</span> <span class="pl-kos">(</span><span class="pl-kos">{</span> Plugin <span class="pl-kos">}</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
<span class="pl-k">return</span> <span class="pl-k">new</span> <span class="pl-v">Plugin</span><span class="pl-kos">(</span><span class="pl-s">"pancakes"</span><span class="pl-kos">,</span> <span class="pl-kos">{</span>
<span class="pl-c1">visitor</span>: <span class="pl-kos">{</span>
<span class="pl-en">ObjectExpression</span><span class="pl-kos">(</span><span class="pl-s1">node</span><span class="pl-kos">,</span> <span class="pl-s1">parent</span><span class="pl-kos">,</span> <span class="pl-s1">scope</span><span class="pl-kos">,</span> <span class="pl-s1">state</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
<span class="pl-k">if</span> <span class="pl-kos">(</span><span class="pl-s1">state</span><span class="pl-kos">.</span><span class="pl-c1">options</span><span class="pl-kos">.</span><span class="pl-c1">syrup</span> <span class="pl-c1">!==</span> <span class="pl-s">"maple"</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
<span class="pl-k">throw</span> <span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-en">errorWithNode</span><span class="pl-kos">(</span><span class="pl-s">"No objects allowed unless I get maple syrup >:("</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span>
<span class="pl-kos">}</span>
<span class="pl-kos">}</span>
<span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span></pre></div>
<h3 dir="auto">Swappable parser</h3>
<p dir="auto">Add a <code class="notranslate">parser</code> option to allow use of another Babel AST compatible parser.</p>
<h3 dir="auto">Plugin hooks (<a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="74539625" data-permission-text="Title is private" data-url="https://github.com/babel/babel/issues/1485" data-hovercard-type="issue" data-hovercard-url="/babel/babel/issues/1485/hovercard" href="https://github.com/babel/babel/issues/1485">#1485</a>)</h3>
<p dir="auto">There's currently no good way to perform initialisation of a plugin. Currently you can use the <code class="notranslate">Program</code> visitor to kinda simulate this, but those callbacks are only called once the traversal has already started. The introduce of a <code class="notranslate">init</code> and <code class="notranslate">post</code> method to a Plugin will make this make nicer:</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="export default function ({ Plugin }) {
return new Plugin("pancakes", {
init(state) {
// initialise
},
post(state) {
// teardown
}
});
}"><pre class="notranslate"><span class="pl-k">export</span> <span class="pl-k">default</span> <span class="pl-k">function</span> <span class="pl-kos">(</span><span class="pl-kos">{</span> Plugin <span class="pl-kos">}</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
<span class="pl-k">return</span> <span class="pl-k">new</span> <span class="pl-v">Plugin</span><span class="pl-kos">(</span><span class="pl-s">"pancakes"</span><span class="pl-kos">,</span> <span class="pl-kos">{</span>
<span class="pl-en">init</span><span class="pl-kos">(</span><span class="pl-s1">state</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
<span class="pl-c">// initialise</span>
<span class="pl-kos">}</span><span class="pl-kos">,</span>
<span class="pl-en">post</span><span class="pl-kos">(</span><span class="pl-s1">state</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
<span class="pl-c">// teardown</span>
<span class="pl-kos">}</span>
<span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span></pre></div>
<h3 dir="auto">Way to provide the entire dependency graph to Babel</h3>
<p dir="auto">Another thing that I want to provide is a way to give Babel your entire dependency graph. This will allow cross file transformations. It'll allow us to catch more bugs (such as importing something from another module that wasn't exported).</p>
<p dir="auto">This also allows us to simplify code (thus making it more performant) with access to other files. For example, we can drop the module interop output if we know that a file imported is ES6.</p>
<h3 dir="auto">Minification plugins</h3>
<p dir="auto">I believe we can do minification better (if not equivalent) as <a href="https://github.com/mishoo/UglifyJS2">UglifyJS</a>. With the potential type information available this has the potential to lead to huge wins. I've already written <a href="https://github.com/babel-plugins/babel-plugin-merge-sibling-variables">quite</a> <a href="https://github.com/babel-plugins/babel-plugin-simplify-comparison-operators">a</a> <a href="https://github.com/babel-plugins/babel-plugin-dead-code-elimination">few</a> <a href="https://github.com/babel-plugins/babel-plugin-minify-booleans">plugins</a> <a href="https://github.com/babel-plugins/babel-plugin-constant-folding">already</a> and I believe with some time investment and the help of community plugins we can have a kickass minification pipeline.</p>
<h3 dir="auto">Optimisation plugins</h3>
<p dir="auto">Babel plugins put a lot of potential for optimisations on the table. These optimisations fall into two categories:</p>
<h4 dir="auto">Unreliable transformations</h4>
<p dir="auto">These transformations modify JavaScript semantics, they're pretty dangerous and fairly irresponsible. If you're a small devshop or independent developer it's probably way too risky to do this but if you're a largish tech company then you can weigh the risks and it may come out in favor of doing these sorts of transforms. The engine can't infer these kind of changes, you have to tell it that you don't care.</p>
<p dir="auto">Want to assume all function expressions are constant value types and hoist them? Do it via a plugin.</p>
<p dir="auto">Want to turn all function expressions that don't use <code class="notranslate">this</code> or <code class="notranslate">arguments</code> into arrow functions? Do it via a plugin. (Arrow functions are currently faster than normal functions in <a href="http://www.jandemooij.nl/blog/2014/04/11/fast-arrow-functions-in-firefox-31/" rel="nofollow">Firefox</a> and likely all other browsers in the future)</p>
<p dir="auto">Want to manually inline functions, removing the overhead of adding a frame to the call stack, potentially improving perf even if the function has been JIT inlined? Do it via a plugin.</p>
<p dir="auto">Want to lazy load modules, assuming that the order they're imported doesn't matter as they're side effect free? Do it via a plugin.</p>
<p dir="auto">You can kinda see how these assumptions can lead to fairly large wins. You just have to decide whether or not it's a good idea to do them.</p>
<h4 dir="auto">Reliable transformations</h4>
<p dir="auto">These are transformations that can be done with 100% confidence. These can be performed without possibly breaking any code. With Flow integration and access to the dependency graph a lot of code can be statically inferrable.</p>
<p dir="auto">But don't engines already do these? Different engines do different things. Some optimisations are too heavy for JITs to do but we have a bit more leeway since we're preprocessing offline. We also potentially have access to more information than engines (type annotations) and so can do some smarter things.</p>
<h3 dir="auto">Debugging</h3>
<p dir="auto">Better debugging information will be absolutley necessary as Babel grows in complexity. A particular useful feature for userland would the ability to tell exactly what transforms are breaking or slowing down your build will be critical in this modulrisation.</p>
<h3 dir="auto">Performance</h3>
<p dir="auto">5.x performance has improved <strong>drastically</strong> since 4.x. It could be better though. Performance will never stop being an issue.</p>
<p dir="auto">If there's one part of Babel that is quite slow due to the overhead of JavaScript, there's the potential to provide two implementations of it. A fast version implemented via a native module that's used in Node and a pure JavaScript one that can be used in the browser. If parts of Babel get implemented as native modules there will <strong>always</strong> be a pure JavaScript version available.</p>
<p dir="auto">See issue <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="74541975" data-permission-text="Title is private" data-url="https://github.com/babel/babel/issues/1486" data-hovercard-type="issue" data-hovercard-url="/babel/babel/issues/1486/hovercard" href="https://github.com/babel/babel/issues/1486">#1486</a> for related performance discussion.</p>
<h3 dir="auto">Async API</h3>
<h4 dir="auto">Why?</h4>
<p dir="auto">This will allow an RPC with a long running server such as Flow. This will allow access to a large amount of type info. This will also allow IO to be done.</p>
<h4 dir="auto">What about integrations that only allow a synchronous API?</h4>
<p dir="auto">A synchronous API will still be available for those limited integrations. If you attempt to use the synchronous API with plugins that have async visitors then an error will be thrown. Most of the systems that Babel has to integrate with are already async so this shouldn't be a concern for 90% of developers.</p>
<h2 dir="auto">Anything else?</h2>
<p dir="auto">Probably forgetting something, I'll add more to this issue as I remember and feedback is collected.</p>
<hr>
<p dir="auto">cc everyone</p> | <p dir="auto">My ES6 code:</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="import Ember from 'ember';
import $ from 'jquery';
Ember.MODEL_FACTORY_INJECTIONS = true;
const App = Ember.Application.extend({});"><pre class="notranslate"><span class="pl-k">import</span> <span class="pl-v">Ember</span> <span class="pl-k">from</span> <span class="pl-s">'ember'</span><span class="pl-kos">;</span>
<span class="pl-k">import</span> <span class="pl-s1">$</span> <span class="pl-k">from</span> <span class="pl-s">'jquery'</span><span class="pl-kos">;</span>
<span class="pl-v">Ember</span><span class="pl-kos">.</span><span class="pl-c1">MODEL_FACTORY_INJECTIONS</span> <span class="pl-c1">=</span> <span class="pl-c1">true</span><span class="pl-kos">;</span>
<span class="pl-k">const</span> <span class="pl-v">App</span> <span class="pl-c1">=</span> <span class="pl-v">Ember</span><span class="pl-kos">.</span><span class="pl-c1">Application</span><span class="pl-kos">.</span><span class="pl-en">extend</span><span class="pl-kos">(</span><span class="pl-kos">{</span><span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">;</span></pre></div>
<p dir="auto">I transformed it via gulp-babel, got this file:</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="define('app', ['exports', 'module', 'ember'], function (exports, module, _ember) {
'use strict';
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
var _Ember = _interopRequireDefault(_ember);
_Ember['default'].MODEL_FACTORY_INJECTIONS = true;
var App = _Ember['default'].Application.extend();
// previous line will cause an error, because actual structure is _Ember['default']['default'].Application, why?
module.exports = App;
});"><pre class="notranslate"><span class="pl-en">define</span><span class="pl-kos">(</span><span class="pl-s">'app'</span><span class="pl-kos">,</span> <span class="pl-kos">[</span><span class="pl-s">'exports'</span><span class="pl-kos">,</span> <span class="pl-s">'module'</span><span class="pl-kos">,</span> <span class="pl-s">'ember'</span><span class="pl-kos">]</span><span class="pl-kos">,</span> <span class="pl-k">function</span> <span class="pl-kos">(</span><span class="pl-s1">exports</span><span class="pl-kos">,</span> <span class="pl-s1">module</span><span class="pl-kos">,</span> <span class="pl-s1">_ember</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
<span class="pl-s">'use strict'</span><span class="pl-kos">;</span>
<span class="pl-k">function</span> <span class="pl-en">_interopRequireDefault</span><span class="pl-kos">(</span><span class="pl-s1">obj</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> <span class="pl-k">return</span> <span class="pl-s1">obj</span> <span class="pl-c1">&&</span> <span class="pl-s1">obj</span><span class="pl-kos">.</span><span class="pl-c1">__esModule</span> ? <span class="pl-s1">obj</span> : <span class="pl-kos">{</span> <span class="pl-s">'default'</span>: <span class="pl-s1">obj</span> <span class="pl-kos">}</span><span class="pl-kos">;</span> <span class="pl-kos">}</span>
<span class="pl-k">var</span> <span class="pl-s1">_Ember</span> <span class="pl-c1">=</span> <span class="pl-en">_interopRequireDefault</span><span class="pl-kos">(</span><span class="pl-s1">_ember</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-s1">_Ember</span><span class="pl-kos">[</span><span class="pl-s">'default'</span><span class="pl-kos">]</span><span class="pl-kos">.</span><span class="pl-c1">MODEL_FACTORY_INJECTIONS</span> <span class="pl-c1">=</span> <span class="pl-c1">true</span><span class="pl-kos">;</span>
<span class="pl-k">var</span> <span class="pl-v">App</span> <span class="pl-c1">=</span> <span class="pl-s1">_Ember</span><span class="pl-kos">[</span><span class="pl-s">'default'</span><span class="pl-kos">]</span><span class="pl-kos">.</span><span class="pl-c1">Application</span><span class="pl-kos">.</span><span class="pl-en">extend</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-c">// previous line will cause an error, because actual structure is _Ember['default']['default'].Application, why?</span>
<span class="pl-s1">module</span><span class="pl-kos">.</span><span class="pl-c1">exports</span> <span class="pl-c1">=</span> <span class="pl-v">App</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">;</span></pre></div>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://cloud.githubusercontent.com/assets/1468041/10546661/e73f33de-7461-11e5-95db-e515a7b44106.png"><img src="https://cloud.githubusercontent.com/assets/1468041/10546661/e73f33de-7461-11e5-95db-e515a7b44106.png" alt="image" style="max-width: 100%;"></a></p>
<p dir="auto">And I tried change</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="import Ember from 'ember'"><pre class="notranslate"><span class="pl-k">import</span> <span class="pl-v">Ember</span> <span class="pl-k">from</span> <span class="pl-s">'ember'</span></pre></div>
<p dir="auto">to</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="import * as Ember from 'ember'
// and this
import {Ember} from 'ember'"><pre class="notranslate"><span class="pl-k">import</span> <span class="pl-c1">*</span> <span class="pl-k">as</span> <span class="pl-v">Ember</span> <span class="pl-k">from</span> <span class="pl-s">'ember'</span>
<span class="pl-c">// and this </span>
<span class="pl-k">import</span> <span class="pl-kos">{</span><span class="pl-v">Ember</span><span class="pl-kos">}</span> <span class="pl-k">from</span> <span class="pl-s">'ember'</span></pre></div>
<p dir="auto">but got same issue, could anyone can help give a tip how to resolve this problem?</p> | 0 |
<p dir="auto"><strong>Current Situation</strong><br>
When a user is initiating multiple file copying/moving operations at the same time or in a short time frame, Windows Explorer adds all those operations to the copying/moving queue and works on them at the same time, i.e. all those copying/moving operations run parallel. This slows down the process and Windows a lot because the source and target drives and the CPU are stressed more.</p>
<p dir="auto"><strong>Feature request</strong><br>
When adding multiple file copying/moving operations to the copying/moving queue, only one operation (i.e. the first in the queue) should run, all the additional operations should be put on hold and started automatically when they move into the first position in the queue.<br>
There should also be a user customizable size threshold setting so that copying/moving operations with small(er) amounts of data can still run parallel, even though they are not first in queue.</p>
<p dir="auto"><strong>Benefits</strong></p>
<ul dir="auto">
<li>faster file transfer speed</li>
<li>Windows operating system and Explorer run more responsive during file copy/move operations</li>
<li>less heat development of the drives</li>
<li>less noise development of the drives</li>
<li>possibly longer battery life (when on a laptop)</li>
</ul> | <h1 dir="auto">Environment</h1>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Windows build number: 1803
PowerToys version: 0.11.0
PowerToy module for which you are reporting the bug (if applicable): FancyZones"><pre class="notranslate"><code class="notranslate">Windows build number: 1803
PowerToys version: 0.11.0
PowerToy module for which you are reporting the bug (if applicable): FancyZones
</code></pre></div>
<h1 dir="auto">Steps to reproduce</h1>
<p dir="auto">Enable Fancy Zones and pick a zone configuration.</p>
<h1 dir="auto">Expected behavior</h1>
<p dir="auto">The zones layout should be replicated on each monitor. So dragging a window with shift enabled should give me the same behavior on each monitor regardless of the monitor.</p>
<h1 dir="auto">Actual behavior</h1>
<p dir="auto">The zones only works on the primary screen. With dual monitor, the secondary screen can only maximize the windows. I don't know if this is by design but from my point of view, it makes sense to replicate the zones layout on each screen or add an option to do so.</p> | 0 |
<p dir="auto">Hello!</p>
<p dir="auto">Today I've returned to my computer (aarch64 macOS 13.1) and now if I run <code class="notranslate">deno</code> in the terminal it hangs for about 40 seconds before the shell starts. Once the shell it present it works and feels normal, but then the program entirely crashes with an OOM error 5 to 10 seconds later.</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Deno 1.32.2
exit using ctrl+d, ctrl+c, or close()
REPL is running with all permissions allowed.
To specify permissions, run `deno repl` with allow flags.
> 1
1
> 2
2
<--- Last few GCs --->
[626:0x110040000] 57466 ms: Scavenge 1373.0 (1423.1) -> 1372.2 (1433.1) MB, 3.12 / 0.00 ms (average mu = 0.831, current mu = 0.711) allocation failure;
[626:0x110040000] 57487 ms: Scavenge 1378.1 (1433.1) -> 1376.2 (1434.4) MB, 4.08 / 0.00 ms (average mu = 0.831, current mu = 0.711) allocation failure;
[626:0x110040000] 57622 ms: Scavenge 1379.7 (1434.4) -> 1378.2 (1453.4) MB, 123.38 / 0.00 ms (average mu = 0.831, current mu = 0.711) allocation failure;
<--- JS stacktrace --->
#
# Fatal javascript OOM in Reached heap limit
#
fish: Job 1, 'deno' terminated by signal SIGTRAP (Trace or breakpoint trap)"><pre class="notranslate"><code class="notranslate">Deno 1.32.2
exit using ctrl+d, ctrl+c, or close()
REPL is running with all permissions allowed.
To specify permissions, run `deno repl` with allow flags.
> 1
1
> 2
2
<--- Last few GCs --->
[626:0x110040000] 57466 ms: Scavenge 1373.0 (1423.1) -> 1372.2 (1433.1) MB, 3.12 / 0.00 ms (average mu = 0.831, current mu = 0.711) allocation failure;
[626:0x110040000] 57487 ms: Scavenge 1378.1 (1433.1) -> 1376.2 (1434.4) MB, 4.08 / 0.00 ms (average mu = 0.831, current mu = 0.711) allocation failure;
[626:0x110040000] 57622 ms: Scavenge 1379.7 (1434.4) -> 1378.2 (1453.4) MB, 123.38 / 0.00 ms (average mu = 0.831, current mu = 0.711) allocation failure;
<--- JS stacktrace --->
#
# Fatal javascript OOM in Reached heap limit
#
fish: Job 1, 'deno' terminated by signal SIGTRAP (Trace or breakpoint trap)
</code></pre></div>
<p dir="auto">I have not knowningly changed my computer at all since when I last used Deno on this machine a few days ago.</p>
<p dir="auto">If I run <code class="notranslate">deno --log-level=debug</code> it prints many many lines like this before it crashes:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="DEBUG RS - deno::npm::resolvers:144 - Resolved package folder of file:///Users/louis/Library/Caches/deno/npm/registry.npmjs.org/fp-ts/2.13.1/es6/Pointed.d.ts to /Users/louis/Library/Caches/deno/npm/registry.npmjs.org/fp-ts/2.13.1
DEBUG RS - deno::npm::resolvers:144 - Resolved package folder of file:///Users/louis/Library/Caches/deno/npm/registry.npmjs.org/fp-ts/2.13.1/es6/Predicate.d.ts to /Users/louis/Library/Caches/deno/npm/registry.npmjs.org/fp-ts/2.13.1
DEBUG RS - deno::npm::resolvers:144 - Resolved package folder of file:///Users/louis/Library/Caches/deno/npm/registry.npmjs.org/fp-ts/2.13.1/es6/Refinement.d.ts to /Users/louis/Library/Caches/deno/npm/registry.npmjs.org/fp-ts/2.13.1"><pre class="notranslate"><code class="notranslate">DEBUG RS - deno::npm::resolvers:144 - Resolved package folder of file:///Users/louis/Library/Caches/deno/npm/registry.npmjs.org/fp-ts/2.13.1/es6/Pointed.d.ts to /Users/louis/Library/Caches/deno/npm/registry.npmjs.org/fp-ts/2.13.1
DEBUG RS - deno::npm::resolvers:144 - Resolved package folder of file:///Users/louis/Library/Caches/deno/npm/registry.npmjs.org/fp-ts/2.13.1/es6/Predicate.d.ts to /Users/louis/Library/Caches/deno/npm/registry.npmjs.org/fp-ts/2.13.1
DEBUG RS - deno::npm::resolvers:144 - Resolved package folder of file:///Users/louis/Library/Caches/deno/npm/registry.npmjs.org/fp-ts/2.13.1/es6/Refinement.d.ts to /Users/louis/Library/Caches/deno/npm/registry.npmjs.org/fp-ts/2.13.1
</code></pre></div>
<p dir="auto">Here is the full log: <a href="https://github.com/denoland/deno/files/11186372/deno-log.txt">deno-log.txt</a></p>
<p dir="auto">If I move <code class="notranslate">~/Library/Caches/deno/npm</code> to a new location it no longer crashes, but it still takes 6 seconds to start the shell.</p>
<p dir="auto">Here is the logs for when that happens:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="$ time deno --log-level=debug
DEBUG RS - deno::args::package_json:147 - No package.json file found
DEBUG RS - deno::cache::cache_db:129 - Opening cache /Users/louis/Library/Caches/deno/dep_analysis_cache_v1...
DEBUG RS - deno::cache::cache_db:129 - Opening cache /Users/louis/Library/Caches/deno/node_analysis_cache_v1...
DEBUG RS - deno::js:10 - Deno isolate init with snapshots.
DEBUG JS - args []
DEBUG RS - deno::args::package_json:147 - No package.json file found
DEBUG RS - deno_runtime::permissions:58 - ⚠️️ Granted net access to "deno.land"
DEBUG RS - deno::file_fetcher:342 - FileFetcher::fetch_remote() - specifier: https://deno.land/.well-known/deno-import-intellisense.json
DEBUG RS - deno_runtime::permissions:58 - ⚠️️ Granted net access to "deno.land"
DEBUG RS - deno::file_fetcher:245 - FileFetcher::fetch_cached - specifier: https://deno.land/.well-known/deno-import-intellisense.json
Deno 1.32.2
exit using ctrl+d, ctrl+c, or close()
REPL is running with all permissions allowed.
To specify permissions, run `deno repl` with allow flags.
>
________________________________________________________
Executed in 6.07 secs fish external
usr time 6.66 secs 0.08 millis 6.66 secs
sys time 0.29 secs 1.72 millis 0.29 secs"><pre class="notranslate"><code class="notranslate">$ time deno --log-level=debug
DEBUG RS - deno::args::package_json:147 - No package.json file found
DEBUG RS - deno::cache::cache_db:129 - Opening cache /Users/louis/Library/Caches/deno/dep_analysis_cache_v1...
DEBUG RS - deno::cache::cache_db:129 - Opening cache /Users/louis/Library/Caches/deno/node_analysis_cache_v1...
DEBUG RS - deno::js:10 - Deno isolate init with snapshots.
DEBUG JS - args []
DEBUG RS - deno::args::package_json:147 - No package.json file found
DEBUG RS - deno_runtime::permissions:58 - ⚠️️ Granted net access to "deno.land"
DEBUG RS - deno::file_fetcher:342 - FileFetcher::fetch_remote() - specifier: https://deno.land/.well-known/deno-import-intellisense.json
DEBUG RS - deno_runtime::permissions:58 - ⚠️️ Granted net access to "deno.land"
DEBUG RS - deno::file_fetcher:245 - FileFetcher::fetch_cached - specifier: https://deno.land/.well-known/deno-import-intellisense.json
Deno 1.32.2
exit using ctrl+d, ctrl+c, or close()
REPL is running with all permissions allowed.
To specify permissions, run `deno repl` with allow flags.
>
________________________________________________________
Executed in 6.07 secs fish external
usr time 6.66 secs 0.08 millis 6.66 secs
sys time 0.29 secs 1.72 millis 0.29 secs
</code></pre></div>
<p dir="auto">Do let me know what else I can do to help debug!</p>
<p dir="auto">Thanks,<br>
Louis</p>
<p dir="auto">edit: I mistaken when I said removing the npm cache directory fixed it, it seems to instead be based upon what my working directory is. If I'm in my home directory it crashes, but if I'm in the <code class="notranslate">~/Library/Caches/deno</code> it starts the shell in 6 seconds and uses 2.52GB of memory at start. If I run it in a new directory it starts near instantly and uses 54MB.</p>
<p dir="auto">edit 2: 1.32.3 does not have this problem, but I had to manually upgrade. <code class="notranslate">brew</code> doesn't have this for some reason.</p> | <p dir="auto">OS: Windows 10 Version 10.0.19045.2728</p>
<p dir="auto">From <code class="notranslate">deno 1.32.1+7722014</code> and up, running <code class="notranslate">deno repl</code> or just <code class="notranslate">deno</code> from certain directories causes the deno process to hang with no repl prompt and with excessive memory usage.</p>
<p dir="auto">The bug is reproducible if running deno from <code class="notranslate">C:\</code>, <code class="notranslate">C:\Windows</code>, <code class="notranslate">C:\Users</code>, <code class="notranslate">C:\Users\<current_user></code>, <code class="notranslate">C:\Windows\System32</code>, <code class="notranslate">C:\Windows\SysWow64</code>. At the same time runinng <code class="notranslate">deno repl</code> from <code class="notranslate">C:\Users\<current_user>\Desktop</code> or <code class="notranslate">C:\Windows\System32\wbem</code> proceeds as normal. These are the directories that I've tested which reproduced the bug 100% of the times. Other directories and drives seems unaffected.</p>
<p dir="auto">The last unaffected canary version with available binaries to download is <code class="notranslate">deno 1.32.1+e888c3f</code></p>
<p dir="auto">Edit:<br>
Just checked with the 1.32.2 release. It's still affected.</p>
<p dir="auto">Edit2:<br>
Checked 1.32.2 Linux under Windows WSL, it hangs when executing with the root dir (<code class="notranslate">/</code>) as the current directory.</p> | 1 |
<p dir="auto">I am trying to compile tensorflow for Macbook, but every time I am getting same error.</p>
<p dir="auto">When I Run this command</p>
<p dir="auto"><code class="notranslate">bazel build --config=opt //tensorflow/tools/pip_package:build_pip_package</code></p>
<p dir="auto">I get this error</p>
<p dir="auto"><code class="notranslate">/private/var/tmp/_bazel_cagrigider/2c548436011ab6b7308cd0cc70a91ed3/external/bazel_tools/tools/cpp/BUILD:3:1: invalid license type: 'notice'</code></p>
<p dir="auto"><a href="https://i.stack.imgur.com/S9MtY.png" rel="nofollow">Full Output Of Terminal</a></p>
<p dir="auto">Mac OS 10.13.3</p>
<p dir="auto">Xcode version = 9.2</p>
<p dir="auto">Tensorflow version = 1.8</p>
<p dir="auto">Bazel version = 0.13.0</p>
<p dir="auto">Thanks.</p> | <p dir="auto">I am trying to compile tensorflow for Macbook, but every time when I use bazel build, I am getting same error.</p>
<p dir="auto">When I Run this command</p>
<p dir="auto"><code class="notranslate">bazel build --config=opt //tensorflow/tools/pip_package:build_pip_package</code></p>
<p dir="auto">I get this error</p>
<p dir="auto"><code class="notranslate">/private/var/tmp/_bazel_cagrigider/2c548436011ab6b7308cd0cc70a91ed3/external/bazel_tools/tools/cpp/BUILD:3:1: invalid license type: 'notice'</code></p>
<p dir="auto"><a href="https://i.stack.imgur.com/S9MtY.png" rel="nofollow">Full Output Of Terminal</a></p>
<p dir="auto">Mac OS 10.13.3</p>
<p dir="auto">Xcode version = 9.2</p>
<p dir="auto">Tensorflow version = 1.8</p>
<p dir="auto">Bazel version = 0.13.0</p>
<p dir="auto">Thanks.</p> | 1 |
<p dir="auto">The second link, in the highlights session of the webpage</p>
<p dir="auto"><a href="https://www.tensorflow.org/tutorials/word2vec" rel="nofollow">Vector Representations</a></p>
<p dir="auto">is broken or outdated.</p>
<p dir="auto">This is the link that's not working (404 from github)</p>
<p dir="auto"><a href="https://www.github.com/tensorflow/tensorflow/blob/r1.1/tensorflow_models/tutorials/embedding/word2vec.py">https://www.github.com/tensorflow/tensorflow/blob/r1.1/tensorflow_models/tutorials/embedding/word2vec.py</a></p> | <p dir="auto">There is a wrong html link in text in the tutorial "Vector Representations of Words" at address <a href="https://www.tensorflow.org/tutorials/word2vec" rel="nofollow">https://www.tensorflow.org/tutorials/word2vec</a></p>
<p dir="auto">The text is in the first paragraph after the bullet points in the Highlights section at the top of the page.</p>
<p dir="auto">The link for:</p>
<p dir="auto"><strong>tensorflow_models/tutorials/embedding/word2vec.py</strong><br>
<a href="https://www.github.com/tensorflow/tensorflow/blob/r1.1/tensorflow_models/tutorials/embedding/word2vec.py">https://www.github.com/tensorflow/tensorflow/blob/r1.1/tensorflow_models/tutorials/embedding/word2vec.py</a></p>
<p dir="auto">is wrong, it should point to the following address:</p>
<p dir="auto"><a href="https://github.com/tensorflow/models/blob/master/tutorials/embedding/word2vec.py">https://github.com/tensorflow/models/blob/master/tutorials/embedding/word2vec.py</a></p>
<p dir="auto">I hope that this is helpful.</p> | 1 |
<p dir="auto">Trying to use hostname_pattern as per <a href="http://symfony.com/doc/master/components/routing/hostname_pattern.html" rel="nofollow">http://symfony.com/doc/master/components/routing/hostname_pattern.html</a></p>
<p dir="auto">like this:<br>
routing.yml</p>
<div class="highlight highlight-source-yaml notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="#Bike
bike:
prefix: /
pattern: /
hostname_pattern: *.cykelverkstad.nu
defaults: { _controller: EmpireBikeBundle:Homepage:index }"><pre class="notranslate"><span class="pl-c"><span class="pl-c">#</span>Bike</span>
<span class="pl-ent">bike</span>:
<span class="pl-ent">prefix</span>: <span class="pl-s">/</span>
<span class="pl-ent">pattern</span>: <span class="pl-s">/</span>
<span class="pl-ent">hostname_pattern</span>: <span class="pl-s">*.cykelverkstad.nu</span>
<span class="pl-ent">defaults</span>: <span class="pl-s">{ _controller: EmpireBikeBundle:Homepage:index }</span></pre></div>
<p dir="auto">using this composer.json require:</p>
<div class="highlight highlight-source-json notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="{
"require": {
"php": ">=5.3.3",
"symfony/symfony": "2.2.*",
"doctrine/orm": ">=2.2.3,<2.4-dev",
"doctrine/doctrine-bundle": "1.2.*",
"twig/extensions": "1.0.*",
"symfony/assetic-bundle": "2.2.*",
"symfony/swiftmailer-bundle": "2.2.*",
"symfony/monolog-bundle": "2.2.*",
"sensio/distribution-bundle": "2.2.*",
"sensio/framework-extra-bundle": "2.2.*",
"sensio/generator-bundle": "2.2.*",
"jms/security-extra-bundle": "1.4.*",
"jms/di-extra-bundle": "1.3.*",
"jms/serializer-bundle": "0.9",
"friendsofsymfony/rest-bundle": "0.10.0"
},
}"><pre class="notranslate">{
<span class="pl-ent">"require"</span>: {
<span class="pl-ent">"php"</span>: <span class="pl-s"><span class="pl-pds">"</span>>=5.3.3<span class="pl-pds">"</span></span>,
<span class="pl-ent">"symfony/symfony"</span>: <span class="pl-s"><span class="pl-pds">"</span>2.2.*<span class="pl-pds">"</span></span>,
<span class="pl-ent">"doctrine/orm"</span>: <span class="pl-s"><span class="pl-pds">"</span>>=2.2.3,<2.4-dev<span class="pl-pds">"</span></span>,
<span class="pl-ent">"doctrine/doctrine-bundle"</span>: <span class="pl-s"><span class="pl-pds">"</span>1.2.*<span class="pl-pds">"</span></span>,
<span class="pl-ent">"twig/extensions"</span>: <span class="pl-s"><span class="pl-pds">"</span>1.0.*<span class="pl-pds">"</span></span>,
<span class="pl-ent">"symfony/assetic-bundle"</span>: <span class="pl-s"><span class="pl-pds">"</span>2.2.*<span class="pl-pds">"</span></span>,
<span class="pl-ent">"symfony/swiftmailer-bundle"</span>: <span class="pl-s"><span class="pl-pds">"</span>2.2.*<span class="pl-pds">"</span></span>,
<span class="pl-ent">"symfony/monolog-bundle"</span>: <span class="pl-s"><span class="pl-pds">"</span>2.2.*<span class="pl-pds">"</span></span>,
<span class="pl-ent">"sensio/distribution-bundle"</span>: <span class="pl-s"><span class="pl-pds">"</span>2.2.*<span class="pl-pds">"</span></span>,
<span class="pl-ent">"sensio/framework-extra-bundle"</span>: <span class="pl-s"><span class="pl-pds">"</span>2.2.*<span class="pl-pds">"</span></span>,
<span class="pl-ent">"sensio/generator-bundle"</span>: <span class="pl-s"><span class="pl-pds">"</span>2.2.*<span class="pl-pds">"</span></span>,
<span class="pl-ent">"jms/security-extra-bundle"</span>: <span class="pl-s"><span class="pl-pds">"</span>1.4.*<span class="pl-pds">"</span></span>,
<span class="pl-ent">"jms/di-extra-bundle"</span>: <span class="pl-s"><span class="pl-pds">"</span>1.3.*<span class="pl-pds">"</span></span>,
<span class="pl-ent">"jms/serializer-bundle"</span>: <span class="pl-s"><span class="pl-pds">"</span>0.9<span class="pl-pds">"</span></span>,
<span class="pl-ent">"friendsofsymfony/rest-bundle"</span>: <span class="pl-s"><span class="pl-pds">"</span>0.10.0<span class="pl-pds">"</span></span>
},
}</pre></div>
<p dir="auto">Debug-bar shows symfony as 2.2.</p>
<p dir="auto">Getting this error:<br>
[InvalidArgumentException]<br>
The routing file "D:/Dev/wamp/www/empire/app/config\routing.yml" contains u<br>
nsupported keys for "bike": "hostname_pattern". Expected one of: "resource"<br>
, "type", "prefix", "pattern", "path", "hostname", "schemes", "methods", "d<br>
efaults", "requirements", "options".</p>
<p dir="auto">It says "hostname_pattern" is a unsupported key, even though Symfony is on 2.2.</p> | <p dir="auto">Currently running into an issue with the new host matching when I'm trying to generate urls that requires me to pass in a host parameter.</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="InternalUserController:
resource: "@ApiBundle/Controller/Internal/UserController.php"
type: annotation
host: "api.{domain}"
DashboardController:
resource: "@DashboardBundle/Controller/DashboardController.php"
type: annotation
host: "{domain}""><pre lang="ymal" class="notranslate"><code class="notranslate">InternalUserController:
resource: "@ApiBundle/Controller/Internal/UserController.php"
type: annotation
host: "api.{domain}"
DashboardController:
resource: "@DashboardBundle/Controller/DashboardController.php"
type: annotation
host: "{domain}"
</code></pre></div>
<p dir="auto">The examples above work perfectly with the url matcher, but when needing to generate the url, it will require me to provide the domain parameter each time. I know this is how it's suppose to function, but it seems a bit annoying to require putting in the domain each time.</p> | 1 |
<div class="highlight highlight-text-shell-session notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="% RUST_BACKTRACE=1 deno
Deno 1.18.0
exit using ctrl+d or close()
> console.log("😂"[0])
�
============================================================
Deno has panicked. This is a bug in Deno. Please report this
at https://github.com/denoland/deno/issues/new.
If you can reliably reproduce this panic, include the
reproduction steps and re-run with the RUST_BACKTRACE=1 env
var set and include the backtrace in your report.
Platform: macos x86_64
Version: 1.18.0
Args: ["deno"]
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Error("unexpected end of hex escape", line: 1, column: 101)', /Users/runner/work/deno/deno/core/inspector.rs:724:66
stack backtrace:
0: _rust_begin_unwind
1: core::panicking::panic_fmt
2: core::result::unwrap_failed
3: core::result::Result<T,E>::unwrap
4: <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll
5: <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll
6: <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll
7: <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll
8: <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll
9: <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll
10: <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll
11: deno::tools::repl::run::{{closure}}
12: <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll
13: <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll
14: deno::main
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace."><pre class="notranslate">% <span class="pl-s1">RUST_BACKTRACE=1 deno</span>
<span class="pl-c1">Deno 1.18.0</span>
<span class="pl-c1">exit using ctrl+d or close()</span>
> <span class="pl-s1">console.log(<span class="pl-s"><span class="pl-pds">"</span>😂<span class="pl-pds">"</span></span>[0])</span>
<span class="pl-c1">�</span>
<span class="pl-c1">============================================================</span>
<span class="pl-c1">Deno has panicked. This is a bug in Deno. Please report this</span>
<span class="pl-c1">at https://github.com/denoland/deno/issues/new.</span>
<span class="pl-c1">If you can reliably reproduce this panic, include the</span>
<span class="pl-c1">reproduction steps and re-run with the RUST_BACKTRACE=1 env</span>
<span class="pl-c1">var set and include the backtrace in your report.</span>
<span class="pl-c1">Platform: macos x86_64</span>
<span class="pl-c1">Version: 1.18.0</span>
<span class="pl-c1">Args: ["deno"]</span>
<span class="pl-c1">thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Error("unexpected end of hex escape", line: 1, column: 101)', /Users/runner/work/deno/deno/core/inspector.rs:724:66</span>
<span class="pl-c1">stack backtrace:</span>
<span class="pl-c1"> 0: _rust_begin_unwind</span>
<span class="pl-c1"> 1: core::panicking::panic_fmt</span>
<span class="pl-c1"> 2: core::result::unwrap_failed</span>
<span class="pl-c1"> 3: core::result::Result<T,E>::unwrap</span>
<span class="pl-c1"> 4: <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll</span>
<span class="pl-c1"> 5: <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll</span>
<span class="pl-c1"> 6: <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll</span>
<span class="pl-c1"> 7: <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll</span>
<span class="pl-c1"> 8: <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll</span>
<span class="pl-c1"> 9: <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll</span>
<span class="pl-c1"> 10: <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll</span>
<span class="pl-c1"> 11: deno::tools::repl::run::{{closure}}</span>
<span class="pl-c1"> 12: <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll</span>
<span class="pl-c1"> 13: <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll</span>
<span class="pl-c1"> 14: deno::main</span>
<span class="pl-c1">note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.</span></pre></div> | <p dir="auto">So please, remove this feature. It is unnecessary.</p>
<p dir="auto">P.S. just think what could be a leftpad case without a centralized source of trust.</p> | 0 |
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> I have searched the <a href="https://github.com/apache/dubbo/issues">issues</a> of this repository and believe that this is not a duplicate.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> I have checked the <a href="https://github.com/apache/dubbo/blob/master/FAQ.md">FAQ</a> of this repository and believe that this is not a duplicate.</li>
</ul>
<h3 dir="auto">Environment</h3>
<ul dir="auto">
<li>Dubbo version: 2.7.6/2.7.7</li>
<li>Operating System version: Windows 10</li>
<li>Java version: 1.8</li>
</ul>
<h3 dir="auto">Steps to reproduce this issue</h3>
<ol dir="auto">
<li>从2.7.4.1升级到2.7.6或者2.7.7</li>
<li>启动服务提供者</li>
<li>提示无法启动,DubboBootstrapApplicationListener重复注册</li>
</ol>
<p dir="auto">Pls. provide [GitHub address] to reproduce this issue.</p>
<h3 dir="auto">Expected Result</h3>
<p dir="auto">正常启动</p>
<h3 dir="auto">Actual Result</h3>
<p dir="auto">无法启动,抛出异常,DubboBootstrapApplicationListener重复注册</p>
<p dir="auto">If there is an exception, please attach the exception trace:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="2020-05-30 23:30:40.991 [main] WARN [AbstractApplicationContext:558] - Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.support.BeanDefinitionOverrideException: Invalid bean definition with name 'dubboBootstrapApplicationListener' defined in null: Cannot register bean definition [Generic bean: class [org.apache.dubbo.config.spring.context.DubboBootstrapApplicationListener]; scope=singleton; abstract=false; lazyInit=null; autowireMode=0; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=null] for bean 'dubboBootstrapApplicationListener': There is already [Root bean: class [org.apache.dubbo.config.spring.context.DubboBootstrapApplicationListener]; scope=; abstract=false; lazyInit=null; autowireMode=0; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=null] bound.
2020-05-30 23:30:41.005 [main] INFO [ConditionEvaluationReportLoggingListener:136] -
Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2020-05-30 23:30:41.009 [main] ERROR [LoggingFailureAnalysisReporter:40] -
APPLICATION FAILED TO START
Description:
The bean 'dubboBootstrapApplicationListener' could not be registered. A bean with that name has already been defined and overriding is disabled.
Action:
Consider renaming one of the beans or enabling overriding by setting spring.main.allow-bean-definition-overriding=true"><pre class="notranslate"><code class="notranslate">2020-05-30 23:30:40.991 [main] WARN [AbstractApplicationContext:558] - Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.support.BeanDefinitionOverrideException: Invalid bean definition with name 'dubboBootstrapApplicationListener' defined in null: Cannot register bean definition [Generic bean: class [org.apache.dubbo.config.spring.context.DubboBootstrapApplicationListener]; scope=singleton; abstract=false; lazyInit=null; autowireMode=0; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=null] for bean 'dubboBootstrapApplicationListener': There is already [Root bean: class [org.apache.dubbo.config.spring.context.DubboBootstrapApplicationListener]; scope=; abstract=false; lazyInit=null; autowireMode=0; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=null] bound.
2020-05-30 23:30:41.005 [main] INFO [ConditionEvaluationReportLoggingListener:136] -
Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2020-05-30 23:30:41.009 [main] ERROR [LoggingFailureAnalysisReporter:40] -
APPLICATION FAILED TO START
Description:
The bean 'dubboBootstrapApplicationListener' could not be registered. A bean with that name has already been defined and overriding is disabled.
Action:
Consider renaming one of the beans or enabling overriding by setting spring.main.allow-bean-definition-overriding=true
</code></pre></div> | <p dir="auto">I have checked the <a href="https://github.com/apache/incubator-dubbo/blob/master/FAQ.md">FAQ</a> of this repository and believe that this is not a duplicate.</p>
<h3 dir="auto">Environment</h3>
<p dir="auto">nacos-spring-boot-starter:0.2.1<br>
spring-boot-starter:2.1.x<br>
dubbo:2.6.5</p>
<h3 dir="auto">Expected Result</h3>
<p dir="auto">This problem is that spring-boot-2.1.x use tomcat-embed 9.x.And in that version has no Connector.setProtocol in it.</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="this is the error message:
An attempt was made to call the method org.apache.catalina.connector.Connector.setProtocol(Ljava/lang/String;)V but it does not exist. Its class, org.apache.catalina.connector.Connector, is available from the following locations:"><pre class="notranslate"><code class="notranslate">this is the error message:
An attempt was made to call the method org.apache.catalina.connector.Connector.setProtocol(Ljava/lang/String;)V but it does not exist. Its class, org.apache.catalina.connector.Connector, is available from the following locations:
</code></pre></div> | 0 |
<p dir="auto"><strong>I'm submitting a ...</strong> (check one with "x")</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="[x] bug report => search github for a similar issue or PR before submitting
[ ] feature request
[ ] support request => Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question"><pre class="notranslate"><code class="notranslate">[x] bug report => search github for a similar issue or PR before submitting
[ ] feature request
[ ] support request => Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question
</code></pre></div>
<p dir="auto"><strong>Current behavior</strong><br>
If a <em>dependency</em> (e.g. <code class="notranslate">ServiceA</code>) is injected into a <em>guard</em> (e.g. <code class="notranslate">GuardA</code>; service, that implements <code class="notranslate">CanActivate</code> interface), in a <em>feature module</em> (e.g. <code class="notranslate">FeatureModule</code>), that is lazy loaded, and both <code class="notranslate">ServiceA</code> and <code class="notranslate">GuardA</code> are defined in that <code class="notranslate">FeatureModule</code>, than <code class="notranslate">GuardA</code> gets it's own dedicated version of the <code class="notranslate">ServiceA</code>, whereas other <em>components</em> and <em>services</em>, defined at the <em>feature module</em> get their own version of the <code class="notranslate">ServiceA</code>, that is shared among them. Basically <em>injected service</em> isn't a singleton anymore. I think it's related to how the <code class="notranslate">RouterModule</code> works with <em>DI</em>.</p>
<p dir="auto"><strong>Expected behavior</strong><br>
All <em>guards</em>, <em>services</em> and <em>components</em> of a <em>feature module</em>, get the same service instance, that is injected into them. So in the provided plunker the<code class="notranslate">FeatureService</code> should be created only once.</p>
<p dir="auto"><strong>Minimal reproduction of the problem with instructions</strong><br>
Here is a plunker <a href="https://plnkr.co/cYjMbvgJEciKg00GSNfb" rel="nofollow">https://plnkr.co/cYjMbvgJEciKg00GSNfb</a><br>
When the <code class="notranslate">Feature</code> link is clicked, then <code class="notranslate">FeatureModule</code> is lazy loaded. <code class="notranslate">FeatureComponent</code> is displayed and it contains a template with a random number, that is provided by an injected <code class="notranslate">FeatureService</code>. When <code class="notranslate">Feature child</code> link is clicked, <code class="notranslate">FeatureChildGuard</code> gets activated and a alert box with a value, that is provided by the <code class="notranslate">FeatureService</code> is provided and it differs from the one, that is displayed in the <code class="notranslate">FeatureComponent</code>, because dedicated <code class="notranslate">FeatureService</code> is created for that guard (you can also see it in <code class="notranslate">console.log</code> calls).</p>
<p dir="auto"><strong>What is the motivation / use case for changing the behavior?</strong><br>
Each feature module is assumed to be an isolated and self-contained piece of program logic, so everything, that is defined in this module, that is intended to be singleton should be it. And <code class="notranslate">CanActivate</code> logic can be related to a current state of a feature module service and not only the ones, that are defined at the top-most level of angular app.</p>
<p dir="auto"><strong>Please tell us about your environment:</strong> OS X Sierra 10.12.1, WebStorm 2016.3.3, node 6.9.1, angular-cli 1.0.0-beta.25.5 (but I guess this information is not important, as it's reproducible in browser)</p>
<ul dir="auto">
<li>
<p dir="auto"><strong>Angular version:</strong> 2.4.5</p>
</li>
<li>
<p dir="auto"><strong>Browser:</strong> all</p>
</li>
<li>
<p dir="auto"><strong>Language:</strong> TypeScript 2.0</p>
</li>
</ul> | <p dir="auto"><strong>I'm submitting a ...</strong> (check one with "x")</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="[x] bug report => search github for a similar issue or PR before submitting
[ ] feature request
[ ] support request => Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question"><pre class="notranslate"><code class="notranslate">[x] bug report => search github for a similar issue or PR before submitting
[ ] feature request
[ ] support request => Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question
</code></pre></div>
<p dir="auto"><strong>Current behavior</strong><br>
After upgrading to router 3.2.0, services being provided by component module are being instantiated twice. Once while resolver is being run (last place in router is PreActivation.prototype.getToken) and then again later during activation (last place in router is RouterOutlet.prototype.activate).<br>
Upgrading rest of Angular to 2.2.0 and leaving router at 3.1.1 it works as it used to (and looking in debugger I see service is only instantiated from PreActivation.prototype.getToken)</p>
<p dir="auto"><strong>Expected behavior</strong></p>
<p dir="auto">Providers should only be instantiated once - as they are when using router version 3.1.1</p>
<p dir="auto"><strong>Minimal reproduction of the problem with instructions</strong></p>
<p dir="auto">Haven't yet reproduced in a plnkr but my use case has a lazy loaded component that itself has sub components (not lazy loaded). The sub component has a resolver that uses a service, and the sub component itself uses the service. The service is included in the lazy loaded components module providers list and is being instantiated twice. Once apparently while router is working on resolve and once when component is being activated.</p>
<p dir="auto"><strong>What is the motivation / use case for changing the behavior?</strong></p>
<p dir="auto">Its just wrong, and my service fetches data on initialization so extra instance causes extra fetch. This does not happen with router 3.1.1 (never tried 3.1.2 as deactivate guards don't work correctly in that version)</p>
<p dir="auto"><strong>Please tell us about your environment:</strong></p>
<p dir="auto">Windows 10, Visual Studio Code, angular-cli: 1.0.0-beta.19-3 ng serve</p>
<ul dir="auto">
<li><strong>Angular version:</strong> 2.0.X</li>
</ul>
<p dir="auto">2.2.0</p>
<ul dir="auto">
<li><strong>Browser:</strong> [all | Chrome XX | Firefox XX | IE XX | Safari XX | Mobile Chrome XX | Android X.X Web Browser | iOS XX Safari | iOS XX UIWebView | iOS XX WKWebView ]</li>
</ul>
<p dir="auto">Only tried in Chrome</p>
<ul dir="auto">
<li>
<p dir="auto"><strong>Language:</strong> [all | TypeScript X.X | ES6/7 | ES5]<br>
Typescript 2.0.9</p>
</li>
<li>
<p dir="auto"><strong>Node (for AoT issues):</strong> <code class="notranslate">node --version</code> =</p>
</li>
</ul> | 1 |
<p dir="auto"><strong><a href="https://jira.spring.io/secure/ViewProfile.jspa?name=ramseylubbat" rel="nofollow">Ramsey Lubbat</a></strong> opened <strong><a href="https://jira.spring.io/browse/SPR-3427?redirect=false" rel="nofollow">SPR-3427</a></strong> and commented</p>
<p dir="auto">When using FreeMarker's capability to use JSP taglibs in FreeMarker templates, two of the Spring form tags, errors and option, do not render their output.</p>
<p dir="auto">To reproduce, configure your SpringMVC application for FreeMarker views. The standard documentation should help with this.</p>
<p dir="auto">Then, in one of your FreeMarker templates, assign the Spring form taglibs and try to use the errors or option tag:</p>
<p dir="auto"><#assign form=JspTaglibs["http://www.springframework.org/tags/form"]/><br>
<<code class="notranslate">@form</code>:form><br>
<<code class="notranslate">@form</code>.errors path="name" /><br>
<<code class="notranslate">@form</code>.input path="name" /><br>
<br/><input type="submit" /><br>
</<code class="notranslate">@form</code>:form></p>
<p dir="auto">Make sure a form validation error occurs for the value you submit. When the page is displayed again, with the form errors, no error message is rendered at all. By using the debugger, we see that the tag is doing the correct thing (looking up the error message and outputting a span element with the resolved message), but the output never makes it to the response. You see no error message on the page.</p>
<p dir="auto">We think that these two tags do not render because they extend AbstractHtmlElementBodyTag and the TagWriter usage interacts poorly with FreeMarker's TagTransformModel and Environment classes. Sorry for the lack of a more explicit explanation, but essentially, the output writer that TagWriter is constructed with gets swapped around by FreeMarker, so the output from the tags never gets written to the response.</p>
<p dir="auto">To solve this problem, one of our engineers came up with the solution to extend ErrorsTag and OptionTag, overloading the renderDefaultContent() method to call the base class method with a new TagWriter constructed with pageContext.getOut(). I'll attach our fix.</p>
<hr>
<p dir="auto"><strong>Affects:</strong> 2.0.3, 2.0.4</p>
<p dir="auto"><strong>Attachments:</strong></p>
<ul dir="auto">
<li><a href="https://jira.spring.io/secure/attachment/12573/ErrorsTag.java" rel="nofollow">ErrorsTag.java</a> (<em>756 bytes</em>)</li>
</ul>
<p dir="auto"><strong>Issue Links:</strong></p>
<ul dir="auto">
<li><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="398075799" data-permission-text="Title is private" data-url="https://github.com/spring-projects/spring-framework/issues/7888" data-hovercard-type="issue" data-hovercard-url="/spring-projects/spring-framework/issues/7888/hovercard" href="https://github.com/spring-projects/spring-framework/issues/7888">#7888</a> form:errors tag does not render in freemarker view (<em><strong>"is duplicated by"</strong></em>)</li>
<li><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="398081451" data-permission-text="Title is private" data-url="https://github.com/spring-projects/spring-framework/issues/8634" data-hovercard-type="issue" data-hovercard-url="/spring-projects/spring-framework/issues/8634/hovercard" href="https://github.com/spring-projects/spring-framework/issues/8634">#8634</a> JSP taglib with FreeMarker doesn't print errors (<em><strong>"is duplicated by"</strong></em>)</li>
</ul> | <p dir="auto"><strong><a href="https://jira.spring.io/secure/ViewProfile.jspa?name=novoj" rel="nofollow">Jan Novotný</a></strong> opened <strong><a href="https://jira.spring.io/browse/SPR-5177?redirect=false" rel="nofollow">SPR-5177</a></strong> and commented</p>
<p dir="auto">Using ConfigurableMimeFileTypeMap I found out, that for any file with extension "css" - ie. HTML stylesheets method getContentType(...) returns "application/x-pointplus" instead of expected "text/css". Firefox gets confused and refuses such stylesheets.</p>
<p dir="auto">Problem is in double definition of mimetype for extension "css" in mime.types file included in spring.jar in package org/springframework/mail/javamail/</p>
<p dir="auto">Exactly:</p>
<ol dir="auto">
<li>TEXT TYPES</li>
</ol>
<p dir="auto">text/x-speech talk<br>
text/css css</p>
<p dir="auto">and then:</p>
<ol dir="auto">
<li>
<p dir="auto">PRESENTATION</p>
</li>
<li>
<p dir="auto">PowerPoint presentation (Microsoft)<br>
application/mspowerpoint ppz</p>
</li>
<li>
<p dir="auto">PointPlus presentation data (Net Scene)<br>
application/x-pointplus css</p>
</li>
<li>
<p dir="auto">ASAP WordPower (Software Publishing Corp.)<br>
application/x-asap asp</p>
</li>
<li>
<p dir="auto">Astound Web Player multimedia data (GoldDisk)<br>
application/astound asn</p>
</li>
</ol>
<p dir="auto">Next definition overwrites the previous one, which IMHO is more important.</p>
<hr>
<p dir="auto"><strong>Affects:</strong> 2.5.5</p>
<p dir="auto"><strong>Issue Links:</strong></p>
<ul dir="auto">
<li><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="398089086" data-permission-text="Title is private" data-url="https://github.com/spring-projects/spring-framework/issues/9587" data-hovercard-type="issue" data-hovercard-url="/spring-projects/spring-framework/issues/9587/hovercard" href="https://github.com/spring-projects/spring-framework/issues/9587">#9587</a> Duplicate mappings in org/springframework/mail/mime.types (<em><strong>"duplicates"</strong></em>)</li>
</ul> | 0 |
<p dir="auto">I've put together a very simple preset for Node 5.0. I'm using this in production and will keep it closely tracked to Babel 6 releases. So far, it seems to be working well, and is chipped a few ms off my response times and in some cases, knocked a few seconds of gulp times by avoiding unnecessary transpilation / using Node 5 native features.</p>
<p dir="auto"><a href="https://www.npmjs.com/package/babel-preset-node5" rel="nofollow">https://www.npmjs.com/package/babel-preset-node5</a></p>
<p dir="auto">Have I missed anything obvious in "key features"? I've used <a href="https://kangax.github.io/compat-table/es6/#node5" rel="nofollow">this compatibility table</a></p> | <p dir="auto">Please, can anyone help me?</p>
<p dir="auto">I have this package: <a href="https://github.com/xbrain-dev/xbrain-validate">https://github.com/xbrain-dev/xbrain-validate</a></p>
<p dir="auto">When I install it in a react-native project the following error happens:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="/Users/diegovieira/Sites/ConexaoClaroBrasilMobile/node_modules/xbrain-validate/dist/xbrain-validate.min.js: Couldn't find preset "@babel/preset-env" relative to directory "/Users/diegovieira/Sites/ConexaoClaroBrasilMobile/node_modules/xbrain-validate""><pre class="notranslate"><code class="notranslate">/Users/diegovieira/Sites/ConexaoClaroBrasilMobile/node_modules/xbrain-validate/dist/xbrain-validate.min.js: Couldn't find preset "@babel/preset-env" relative to directory "/Users/diegovieira/Sites/ConexaoClaroBrasilMobile/node_modules/xbrain-validate"
</code></pre></div> | 0 |
<h5 dir="auto">Issue Type:</h5>
<p dir="auto">Bug Report</p>
<h5 dir="auto">Ansible Version:</h5>
<p dir="auto">1.7.2</p>
<h5 dir="auto">Environment:</h5>
<p dir="auto">Debian Sid</p>
<h5 dir="auto">Summary:</h5>
<p dir="auto">Using the gist at <a href="https://gist.github.com/anonymous/dc1de03995dc9ae147af">https://gist.github.com/anonymous/dc1de03995dc9ae147af</a> in ansible 1.7.1 correctly forces a line with <code class="notranslate">synchronous_standby_names=''</code> in it.</p>
<p dir="auto">With 1.7.2, it enforces a line with <code class="notranslate">synchronous_standby_names=</code>.</p>
<p dir="auto">I have confirmed it is definitely a difference between 1.7.1 & 1.7.2 by swapping between:<br>
sudo dpkg -i /var/cache/apt/archives/ansible_1.7.1+dfsg-1_all.deb<br>
sudo dpkg -i /var/cache/apt/archives/ansible_1.7.2+dfsg-1_all.deb</p>
<p dir="auto">Looking at the patches debian applies, that shouldn't be related. Time for a git bisect!</p>
<h5 dir="auto">Steps To Reproduce:</h5>
<p dir="auto">Use the task in the linked gist.</p>
<h5 dir="auto">Expected Results:</h5>
<p dir="auto">A line with <code class="notranslate">synchronous_standby_names=''</code> should appear in the file.</p>
<h5 dir="auto">Actual Results:</h5>
<p dir="auto"><code class="notranslate">synchronous_standby_names=</code> appears in the file.</p> | <h5 dir="auto">Issue Type: Bug Report</h5>
<h5 dir="auto">Ansible Version:</h5>
<p dir="auto">$ ansible --version<br>
ansible 1.8 (devel <a class="commit-link" data-hovercard-type="commit" data-hovercard-url="https://github.com/ansible/ansible/commit/b7082677de3ac85e166ad0780cf7a2adc75fcff1/hovercard" href="https://github.com/ansible/ansible/commit/b7082677de3ac85e166ad0780cf7a2adc75fcff1"><tt>b708267</tt></a>) last updated 2014/08/28 11:27:43 (GMT -700)</p>
<h5 dir="auto">Environment:</h5>
<p dir="auto">OS X Mavericks 10.9.4</p>
<h5 dir="auto">Summary:</h5>
<p dir="auto">using the word import and a single quote within the lineinfile module places single quotes within double quotes<br>
lineinfile: dest=/tmp/myline.txt line="import g'" create=yes<br>
produces:<br>
import g'"'"'</p>
<h5 dir="auto">Steps To Reproduce:</h5>
<p dir="auto">$ cat playtest.yml</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="
---
- hosts: 127.0.0.1
connection: local
tasks:
- name: append line with single quotes and double quotes
lineinfile: dest=/tmp/myline.txt line="import g'" create=yes"><pre class="notranslate"><code class="notranslate">
---
- hosts: 127.0.0.1
connection: local
tasks:
- name: append line with single quotes and double quotes
lineinfile: dest=/tmp/myline.txt line="import g'" create=yes
</code></pre></div>
<p dir="auto">run it like this: ansible-playbook playtest.yml<br>
$ ansible-playbook playtest.yml && cat /tmp/myline.txt && rm -f /tmp/myline.txt</p>
<h5 dir="auto">Expected Results:</h5>
<p dir="auto">file /tmp/myline.txt should contain this line<br>
import g'</p>
<h5 dir="auto">Actual Results:</h5>
<p dir="auto">file /tmp/myline.txt contains this line<br>
import g'"'"'</p> | 1 |
<ul dir="auto">
<li>VSCode Version: 1.1.1-Insider</li>
<li>OS Version: Win 10</li>
</ul>
<p dir="auto">Steps to Reproduce:</p>
<ol dir="auto">
<li>Copy HTML code and try ALT+SHIFT+F</li>
<li>Does not work properly.</li>
</ol>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="<h2 class="project_header section_header">
<a class="project_link" href="#"><span>Shopping</span>
</a>
<div class="right_task_actions">
<a href="#"><img class="cmp_share_project" src="/app/app/assets/76084e29cb2cf72b320e888edc583dfb.gif" height="16" width="26">
</a>
<a href="#">
<img class="cmp_task_actions icon" src="/app/app/assets/76084e29cb2cf72b320e888edc583dfb.gif" height="16" width="26">
</a>
</div>
</h2>"><pre class="notranslate"><code class="notranslate"><h2 class="project_header section_header">
<a class="project_link" href="#"><span>Shopping</span>
</a>
<div class="right_task_actions">
<a href="#"><img class="cmp_share_project" src="/app/app/assets/76084e29cb2cf72b320e888edc583dfb.gif" height="16" width="26">
</a>
<a href="#">
<img class="cmp_task_actions icon" src="/app/app/assets/76084e29cb2cf72b320e888edc583dfb.gif" height="16" width="26">
</a>
</div>
</h2>
</code></pre></div>
<p dir="auto">Copy/Paste above code and try to press, Format Code shortcut, nothing happens.</p>
<p dir="auto">Expected behavior is that span would indent below in "a" tag. also that div's and a's ending tags will align but nothing happens.</p>
<p dir="auto">What would I expect is following:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="<h2 class="project_header section_header">
<a class="project_link" href="#">
<span>Shopping</span>
</a>
<div class="right_task_actions">
<a href="#">
<img class="cmp_share_project" src="/app/app/assets/76084e29cb2cf72b320e888edc583dfb.gif" height="16" width="26">
</a>
<a href="#">
<img class="cmp_task_actions icon" src="/app/app/assets/76084e29cb2cf72b320e888edc583dfb.gif" height="16" width="26">
</a>
</div>
</h2>"><pre class="notranslate"><code class="notranslate"><h2 class="project_header section_header">
<a class="project_link" href="#">
<span>Shopping</span>
</a>
<div class="right_task_actions">
<a href="#">
<img class="cmp_share_project" src="/app/app/assets/76084e29cb2cf72b320e888edc583dfb.gif" height="16" width="26">
</a>
<a href="#">
<img class="cmp_task_actions icon" src="/app/app/assets/76084e29cb2cf72b320e888edc583dfb.gif" height="16" width="26">
</a>
</div>
</h2>
</code></pre></div>
<p dir="auto">I have tried also CTRL+SHIFT+X to delete spaces and then do a format again but nothing happened.</p>
<p dir="auto">Format will not work on following code as well:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="<h2 class="project_header section_header">
<a class="project_link" href="#"><span>Shopping</span>
</a>
<div class="right_task_actions">
<a href="#"><img class="cmp_share_project" src="/app/app/assets/76084e29cb2cf72b320e888edc583dfb.gif" height="16" width="26">
</a>
<a href="#">
<img class="cmp_task_actions icon" src="/app/app/assets/76084e29cb2cf72b320e888edc583dfb.gif" height="16" width="26">
</a>
</div>
</h2>"><pre class="notranslate"><code class="notranslate"><h2 class="project_header section_header">
<a class="project_link" href="#"><span>Shopping</span>
</a>
<div class="right_task_actions">
<a href="#"><img class="cmp_share_project" src="/app/app/assets/76084e29cb2cf72b320e888edc583dfb.gif" height="16" width="26">
</a>
<a href="#">
<img class="cmp_task_actions icon" src="/app/app/assets/76084e29cb2cf72b320e888edc583dfb.gif" height="16" width="26">
</a>
</div>
</h2>
</code></pre></div>
<p dir="auto">What is the logic behind code formatting, is there anything we can do by config?</p> | <ul dir="auto">
<li>VSCode Version: 1.0.0</li>
<li>OS Version: OSX 10.11.4</li>
</ul>
<p dir="auto">Steps to Reproduce:</p>
<ol dir="auto">
<li>Try to auto format the following HTML<br>
<code class="notranslate"><template><div>Hello</div><div>World</div></template></code></li>
</ol>
<p dir="auto">I expect to get something like this</p>
<p dir="auto"><code class="notranslate"><template></code><br>
<code class="notranslate">____<div>Hello</div></code><br>
<code class="notranslate">____<div>World</div></code><br>
<code class="notranslate"></template></code></p>
<p dir="auto">But it does not work. If I replace the <code class="notranslate"><template></code> tag with <code class="notranslate"><div></code> then the auto format works correctly. This issue was not present in the previous version.</p>
<p dir="auto">Thanks,</p> | 1 |
<h1 dir="auto">Environment</h1>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Windows build number: Microsoft Windows [Version 10.0.19041.264]
PowerToys version: v0.18.1
PowerToy module for which you are reporting the bug (if applicable): FancyZones"><pre class="notranslate"><code class="notranslate">Windows build number: Microsoft Windows [Version 10.0.19041.264]
PowerToys version: v0.18.1
PowerToy module for which you are reporting the bug (if applicable): FancyZones
</code></pre></div>
<h1 dir="auto">Steps to reproduce / Actual behavior</h1>
<ul dir="auto">
<li>deselect "Override Windows Snap hotkeys"</li>
<li>"snap" a window from maximized to left/right to max again, end in "maxed"</li>
</ul>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/5815808/84186612-a3746100-aa45-11ea-9373-a518de8ba76d.png"><img src="https://user-images.githubusercontent.com/5815808/84186612-a3746100-aa45-11ea-9373-a518de8ba76d.png" alt="image" style="max-width: 100%;"></a></p>
<ul dir="auto">
<li>select "Override Windows Snap hotkeys"</li>
<li>"snap" the same window from max, one cannot go left/right in the same way, one must first <code class="notranslate">Win-Down</code> to unmaximize it, <em>then</em> one can shift between zones</li>
</ul>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/5815808/84186336-3d87d980-aa45-11ea-83aa-0984791fc34f.png"><img src="https://user-images.githubusercontent.com/5815808/84186336-3d87d980-aa45-11ea-83aa-0984791fc34f.png" alt="image" style="max-width: 100%;"></a></p>
<p dir="auto">(top row keypresses are effectively no-ops)</p>
<h1 dir="auto">Expected behavior</h1>
<p dir="auto">To more closely mimic the behavior of normal (non-FancyZones) windows snap hotkeys, I expect them to be able to cycle out of maximized explicitly. When the FancyZones snap hotkey <code class="notranslate">Win-Left</code> is called on a maximized window, there is no ambiguity on what the user is trying to do.</p>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/5815808/84186393-52fd0380-aa45-11ea-8b73-f5620d8747cb.png"><img src="https://user-images.githubusercontent.com/5815808/84186393-52fd0380-aa45-11ea-8b73-f5620d8747cb.png" alt="image" style="max-width: 100%;"></a></p>
<p dir="auto">(This is a 'tweener between bug and feature-request: while it isn't crashing, its behavior to mimic basic windows hotkey snap behavior is incomplete/different, seemingly unnecessarily.)</p> | <h1 dir="auto">Environment</h1>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Windows build number: Version 10.0.19587.1000
PowerToys version: v0.16.1
PowerToy module for which you are reporting the bug (if applicable): FancyZones"><pre class="notranslate"><code class="notranslate">Windows build number: Version 10.0.19587.1000
PowerToys version: v0.16.1
PowerToy module for which you are reporting the bug (if applicable): FancyZones
</code></pre></div>
<h1 dir="auto">Steps to reproduce</h1>
<ol dir="auto">
<li>
<p dir="auto">Configure FancyZones to "Override Windows Snap hotkeys"</p>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/1366654/78994553-aaafe900-7b40-11ea-9d49-6dc8386da26e.png"><img src="https://user-images.githubusercontent.com/1366654/78994553-aaafe900-7b40-11ea-9d49-6dc8386da26e.png" alt="grafik" style="max-width: 100%;"></a></p>
</li>
<li>
<p dir="auto">Choose "Grid" as Zone layout</p>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/1366654/78994632-dc28b480-7b40-11ea-95e8-2e08a8b343fe.png"><img src="https://user-images.githubusercontent.com/1366654/78994632-dc28b480-7b40-11ea-95e8-2e08a8b343fe.png" alt="grafik" style="max-width: 100%;"></a></p>
</li>
<li>
<p dir="auto">Maximize a Window using <kbd>Win</kbd>+<kbd>Up</kbd>. Window is then maximized.</p>
</li>
<li>
<p dir="auto">Try to move the Window to the left zone using <kbd>Win</kbd>+<kbd>Left</kbd></p>
</li>
</ol>
<h1 dir="auto">Expected behavior</h1>
<p dir="auto">Window is moved to the left zone.</p>
<h1 dir="auto">Actual behavior</h1>
<p dir="auto">Nothing happens.</p>
<p dir="auto">This issue refs <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="494053852" data-permission-text="Title is private" data-url="https://github.com/microsoft/PowerToys/issues/387" data-hovercard-type="issue" data-hovercard-url="/microsoft/PowerToys/issues/387/hovercard" href="https://github.com/microsoft/PowerToys/issues/387">#387</a></p>
<h1 dir="auto">Screenshots</h1>
<p dir="auto">(Any maximized window - so not attaching a screenshot)</p> | 1 |
<h3 dir="auto">Current Behavior:</h3>
<p dir="auto">I am attempting to configure a project to install dependencies from NPM. I will be publishing the project to GitHub Packages as a private package. If I use this syntax in my project's <code class="notranslate">.npmrc</code>:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="@my-org:registry=https://npm.pkg.github.com/"><pre class="notranslate"><code class="notranslate">@my-org:registry=https://npm.pkg.github.com/
</code></pre></div>
<p dir="auto">I can install dependencies from NPM using <code class="notranslate">npm install</code> on my local machine. However, I cannot publish to GitHub Packages using <code class="notranslate">npm publish</code>. NPM informs me that I'm not authenticated. If I use this syntax in my project's <code class="notranslate">.npmrc</code>:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="registry=https://npm.pkg.github.com/my-org/"><pre class="notranslate"><code class="notranslate">registry=https://npm.pkg.github.com/my-org/
</code></pre></div>
<p dir="auto">I can publish using <code class="notranslate">npm publish</code>, but I cannot install dependencies with <code class="notranslate">npm install</code>. NPM informs me that it's trying to install dependencies from GitHub Packages, rather than NPM.</p>
<h3 dir="auto">Expected Behavior:</h3>
<p dir="auto">Based on my reading, both syntaxes should be compatible with <code class="notranslate">npm install</code> and <code class="notranslate">npm publish</code>. However, it appears I can only use one or the other, based on my intended use.</p>
<h3 dir="auto">Steps To Reproduce:</h3>
<ol dir="auto">
<li>
<p dir="auto">Install Node <code class="notranslate">v15.7.0</code> and NPM <code class="notranslate">7.4.3</code> via <a href="https://github.com/nvm-sh/nvm">nvm</a>.</p>
</li>
<li>
<p dir="auto">Log in to GitHub Packages with the command:</p>
<div class="highlight highlight-source-shell notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="npm login --scope=@my-org --registry=https://npm.pkg.github.com"><pre class="notranslate">npm login --scope=@my-org --registry=https://npm.pkg.github.com</pre></div>
</li>
<li>
<p dir="auto">Check our <code class="notranslate">~/.npmrc</code> file in our home folder. It should read:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="@my-org:registry=https://npm.pkg.github.com/
//npm.pkg.github.com/:_authToken=<auth-token-used-for-login>"><pre class="notranslate"><code class="notranslate">@my-org:registry=https://npm.pkg.github.com/
//npm.pkg.github.com/:_authToken=<auth-token-used-for-login>
</code></pre></div>
</li>
<li>
<p dir="auto">Create project with the following <code class="notranslate">package.json</code>:</p>
<div class="highlight highlight-source-json notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="{
"name": "@my-org/my-package",
"description": "A test.",
"version": "1.0.0",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
"type": "git",
"url": "https://github.com/my-org/my-package.git"
},
"keywords": ["example"],
"author": "Me",
"license": "ISC",
"bugs": {
"url": "https://github.com/my-org/my-package/issues"
},
"homepage": "https://github.com/my-org/my-package",
"dependencies": {
"bootstrap": "^4.5.2"
}
}"><pre class="notranslate">{
<span class="pl-ent">"name"</span>: <span class="pl-s"><span class="pl-pds">"</span>@my-org/my-package<span class="pl-pds">"</span></span>,
<span class="pl-ent">"description"</span>: <span class="pl-s"><span class="pl-pds">"</span>A test.<span class="pl-pds">"</span></span>,
<span class="pl-ent">"version"</span>: <span class="pl-s"><span class="pl-pds">"</span>1.0.0<span class="pl-pds">"</span></span>,
<span class="pl-ent">"scripts"</span>: {
<span class="pl-ent">"test"</span>: <span class="pl-s"><span class="pl-pds">"</span>echo <span class="pl-cce">\"</span>Error: no test specified<span class="pl-cce">\"</span> && exit 1<span class="pl-pds">"</span></span>
},
<span class="pl-ent">"repository"</span>: {
<span class="pl-ent">"type"</span>: <span class="pl-s"><span class="pl-pds">"</span>git<span class="pl-pds">"</span></span>,
<span class="pl-ent">"url"</span>: <span class="pl-s"><span class="pl-pds">"</span>https://github.com/my-org/my-package.git<span class="pl-pds">"</span></span>
},
<span class="pl-ent">"keywords"</span>: [<span class="pl-s"><span class="pl-pds">"</span>example<span class="pl-pds">"</span></span>],
<span class="pl-ent">"author"</span>: <span class="pl-s"><span class="pl-pds">"</span>Me<span class="pl-pds">"</span></span>,
<span class="pl-ent">"license"</span>: <span class="pl-s"><span class="pl-pds">"</span>ISC<span class="pl-pds">"</span></span>,
<span class="pl-ent">"bugs"</span>: {
<span class="pl-ent">"url"</span>: <span class="pl-s"><span class="pl-pds">"</span>https://github.com/my-org/my-package/issues<span class="pl-pds">"</span></span>
},
<span class="pl-ent">"homepage"</span>: <span class="pl-s"><span class="pl-pds">"</span>https://github.com/my-org/my-package<span class="pl-pds">"</span></span>,
<span class="pl-ent">"dependencies"</span>: {
<span class="pl-ent">"bootstrap"</span>: <span class="pl-s"><span class="pl-pds">"</span>^4.5.2<span class="pl-pds">"</span></span>
}
}</pre></div>
</li>
<li>
<p dir="auto">Add the following <code class="notranslate">.npmrc</code> to our project:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="@my-org:registry=https://npm.pkg.github.com/"><pre class="notranslate"><code class="notranslate">@my-org:registry=https://npm.pkg.github.com/
</code></pre></div>
</li>
<li>
<p dir="auto">Run <code class="notranslate">npm install</code>. Installation should succeed.</p>
</li>
<li>
<p dir="auto">Run <code class="notranslate">npm publish</code>. Receive the following error:</p>
<div class="highlight highlight-source-shell notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="npm ERR! code ENEEDAUTH
npm ERR! need auth This command requires you to be logged in.
npm ERR! need auth You need to authorize this machine using `npm adduser`
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/my-user/.npm/_logs/2021-01-28T20_19_55_974Z-debug.log"><pre class="notranslate">npm ERR<span class="pl-k">!</span> code ENEEDAUTH
npm ERR<span class="pl-k">!</span> need auth This <span class="pl-c1">command</span> requires you to be logged in.
npm ERR<span class="pl-k">!</span> need auth You need to authorize this machine using <span class="pl-s"><span class="pl-pds">`</span>npm adduser<span class="pl-pds">`</span></span>
npm ERR<span class="pl-k">!</span> A <span class="pl-c1">complete</span> log of this run can be found in:
npm ERR<span class="pl-k">!</span> /Users/my-user/.npm/_logs/2021-01-28T20_19_55_974Z-debug.log</pre></div>
</li>
<li>
<p dir="auto">Change the project <code class="notranslate">.npmrc</code> to:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="registry=https://npm.pkg.github.com/my-org/"><pre class="notranslate"><code class="notranslate">registry=https://npm.pkg.github.com/my-org/
</code></pre></div>
</li>
<li>
<p dir="auto">Run <code class="notranslate">npm publish</code>. Publishing should succeed.</p>
</li>
<li>
<p dir="auto"><code class="notranslate">rm -rf node_modules/ package-lock.json</code> in project.</p>
</li>
<li>
<p dir="auto">Run <code class="notranslate">npm install</code>. Receive following error:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="npm ERR! code E401
npm ERR! Incorrect or missing password.
npm ERR! If you were trying to login, change your password, create an
npm ERR! authentication token or enable two-factor authentication then
npm ERR! that means you likely typed your password in incorrectly.
npm ERR! Please try again, or recover your password at:
npm ERR! https://www.npmjs.com/forgot
npm ERR!
npm ERR! If you were doing some other operation then your saved credentials are
npm ERR! probably out of date. To correct this please try logging in again with:
npm ERR! npm login
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/my-user/.npm/_logs/2021-01-28T20_38_20_711Z-debug.log"><pre class="notranslate"><code class="notranslate">npm ERR! code E401
npm ERR! Incorrect or missing password.
npm ERR! If you were trying to login, change your password, create an
npm ERR! authentication token or enable two-factor authentication then
npm ERR! that means you likely typed your password in incorrectly.
npm ERR! Please try again, or recover your password at:
npm ERR! https://www.npmjs.com/forgot
npm ERR!
npm ERR! If you were doing some other operation then your saved credentials are
npm ERR! probably out of date. To correct this please try logging in again with:
npm ERR! npm login
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/my-user/.npm/_logs/2021-01-28T20_38_20_711Z-debug.log
</code></pre></div>
</li>
</ol>
<h3 dir="auto">Environment:</h3>
<ul dir="auto">
<li>OS:
<ul dir="auto">
<li>MacOS Catalina 10.15.7 (Intel Mac Mini)</li>
<li>MacOS Big Sur 11.1 (Apple Silicon MacBook AIr)</li>
</ul>
</li>
<li>Node: 15.7.0</li>
<li>npm:
<ul dir="auto">
<li>7.4.3</li>
<li>7.5.2</li>
</ul>
</li>
</ul> | <h1 dir="auto">What / Why</h1>
<p dir="auto">Firstly please forgive any assertions I make that are completely wrong - I'm doing my best to understand something that is completely alien to me.</p>
<p dir="auto">I had been trying to work out why my new package was not having its man page installed despite following all of the documentation I can find and trying several different iterations of configuration. I have been tracking this down through npm, into Arborist - and I believe that the fault lies in Arborist - and as per <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="837065574" data-permission-text="Title is private" data-url="https://github.com/npm/cli/issues/2914" data-hovercard-type="issue" data-hovercard-url="/npm/cli/issues/2914/hovercard?comment_id=904696686&comment_type=issue_comment" href="https://github.com/npm/cli/issues/2914#issuecomment-904696686">#2914 (comment)</a> I am beginning to believe that actually Arborist completely lacks support for creating - only deleting - man pages.</p>
<p dir="auto">What I <em>think</em> I know - but correct me where I'm totally off base:</p>
<ul dir="auto">
<li>The Node object constructed in Arborist gets given bin paths, but not man paths, from the raw package.json. I still haven't quite worked out where the raw package.json becomes the package object that is passed into the Node class constructor.</li>
<li>Nowhere in Arborist is there any defined reference or support for a man path meaning that it expects it to be either provided in the package object that is used to first populate the node object in the constructor, or it's expecting it to be populated dynamically by a subsequent call to bin-links/get-paths.getPaths()</li>
<li>The Arborist Node object is granted a getter called binPaths that calls bin-links/get-paths.getPaths() (aliased as getBinPaths)</li>
<li>However, Node.binPaths is only ever used twice in Arborist
<ul dir="auto">
<li>once in lib/diff.js to confirm all the paths exist</li>
<li>once in lib/arborist/reify.js under _addNodeToTrashList to make sure the binPaths are deleted on removal</li>
</ul>
</li>
</ul>
<p dir="auto">I believe that somewhere there is supposed to be a call to Node.binPaths that doesn't seem to exist. This call would return both the bin and man paths into the Node.package property that would be used later in bin-links/index.binLinks() to link both bins and man pages - but instead of calling Node.binPaths, it is just relying on the Node object having been instantiated with the bin property in the constructor's source data, rather than getting it through Node.binPaths.</p>
<p dir="auto">It should be noted that if Arborist was doing what I think it is supposed to be doing to get the paths and link them using bin-links; bin-links does not follow the NPM documentation which states that man paths can be a string or an Array, as there is a hard-check in bin-links/get-paths.getPaths() for an Array: (manTarg && pkg.man && Array.isArray(pkg.man) && pkg.man.length)</p>
<p dir="auto">Additionally, I have seen documentation stating that you can also use package.json sugar to include a man directory in the directories property, which should include all man pages in the directory - but I see no support for that in Arborist or in bin-links.</p>
<h2 dir="auto">When</h2>
<p dir="auto">Performing any npm install of a package with man pages (though I am only testing with --global installs at the moment - I'm not sure what the linking logic is supposed to be in local mode).</p>
<h2 dir="auto">Where</h2>
<ul dir="auto">
<li>npm install npm</li>
<li>npm install orgtomate</li>
</ul>
<h3 dir="auto">Current Behavior</h3>
<p dir="auto">No man page links created. No errors.</p>
<h3 dir="auto">Steps to Reproduce</h3>
<p dir="auto">Install a package with man pages configured either:</p>
<ul dir="auto">
<li>As an man Array property in package.json</li>
<li>As an man string property in package.json</li>
<li>As a man string property in the directories property in package.json</li>
</ul>
<h3 dir="auto">Expected Behavior</h3>
<p dir="auto">man pages installed into ${base}/share/man/ via symlinks - as successfully achieved with <code class="notranslate">npm link</code>, although <code class="notranslate">npm link</code> only works with a man Array property due to that being the only supported approach in <code class="notranslate">bin-links</code>.</p>
<h2 dir="auto">References</h2>
<ul dir="auto">
<li>Related to <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="837065574" data-permission-text="Title is private" data-url="https://github.com/npm/cli/issues/2914" data-hovercard-type="issue" data-hovercard-url="/npm/cli/issues/2914/hovercard" href="https://github.com/npm/cli/issues/2914">#2914</a></li>
</ul> | 0 |
<h3 dir="auto">Current Behavior:</h3>
<h3 dir="auto">Expected Behavior:</h3>
<h3 dir="auto">Steps To Reproduce:</h3>
<h3 dir="auto">Environment:</h3> | <h3 dir="auto">*Updated* as of 01/15/2021</h3>
<p dir="auto"><strong>Note: Please read <a href="https://github.com/npm/cli/wiki/%22cb()-never-called%3F-Exit-handler-never-called%3F-I'm-having-the-same-problem!%22">this doc</a> before filing a new issue.</strong></p> | 1 |
<h2 dir="auto"><g-emoji class="g-emoji" alias="information_source" fallback-src="https://github.githubassets.com/images/icons/emoji/unicode/2139.png">ℹ</g-emoji> Computer information</h2>
<ul dir="auto">
<li>Windows build number: [run "winver"]</li>
<li>PowerToys version:</li>
<li>PowerToy module:</li>
</ul>
<h2 dir="auto"><g-emoji class="g-emoji" alias="memo" fallback-src="https://github.githubassets.com/images/icons/emoji/unicode/1f4dd.png">📝</g-emoji> Provide detailed reproduction steps (if any)</h2>
<ol dir="auto">
<li>…</li>
<li>…</li>
<li>…</li>
</ol>
<h3 dir="auto">✔️ Expected result</h3>
<p dir="auto"><em>What is the expected result of the above steps?</em></p>
<h3 dir="auto"><g-emoji class="g-emoji" alias="x" fallback-src="https://github.githubassets.com/images/icons/emoji/unicode/274c.png">❌</g-emoji> Actual result</h3>
<p dir="auto"><em>What is the actual result of the above steps?</em></p>
<h2 dir="auto">📷 Screenshots</h2>
<p dir="auto"><em>Are there any useful screenshots? WinKey+Shift+S and then just paste them directly into the form</em></p> | <h1 dir="auto">Environment</h1>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Windows build number: 10.0.18363.836
PowerToys version: 0.18.2
PowerToy module for which you are reporting the bug (if applicable): PowerToys Run"><pre class="notranslate"><code class="notranslate">Windows build number: 10.0.18363.836
PowerToys version: 0.18.2
PowerToy module for which you are reporting the bug (if applicable): PowerToys Run
</code></pre></div>
<h1 dir="auto">Steps to reproduce</h1>
<p dir="auto">Open the PowerToys Run dialog and then enter the name of a running application.</p>
<h1 dir="auto">Expected behavior</h1>
<p dir="auto">I expect the running program to be listed higher than the option to launch the app again.</p>
<h1 dir="auto">Actual behavior</h1>
<p dir="auto">The top option is to launch the app again, rather than switching to the existing window. I understand that this could be the preferred mode in some cases, so maybe this could be an option?</p>
<h1 dir="auto">Screenshots</h1>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/12093476/83960711-57071500-a8cf-11ea-887e-d521c978b557.png"><img src="https://user-images.githubusercontent.com/12093476/83960711-57071500-a8cf-11ea-887e-d521c978b557.png" alt="image" style="max-width: 100%;"></a></p>
<p dir="auto">(running word instance is shown in 5th place rather than 1st or 2nd)</p> | 0 |
<p dir="auto"><code class="notranslate">createTestInjector</code> uses bindings that are missing <code class="notranslate">PLATFORM_DIRECTIVES</code>.</p>
<p dir="auto">This means that if a user defines a component that uses <code class="notranslate">NgIf</code> for example but doesn't specify an explicit dependency via <code class="notranslate">@Component({directives})</code>, it will work in the app but fail in tests.</p> | <p dir="auto">Spotted by <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/teropa/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/teropa">@teropa</a> and confirmed on my side in the ng2 directives for Bootstrap project (see: <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="118373937" data-permission-text="Title is private" data-url="https://github.com/ng-bootstrap/ng-bootstrap/issues/115" data-hovercard-type="pull_request" data-hovercard-url="/ng-bootstrap/ng-bootstrap/pull/115/hovercard" href="https://github.com/ng-bootstrap/ng-bootstrap/pull/115">ng-bootstrap/ng-bootstrap#115</a>):</p>
<blockquote>
<p dir="auto">I'm getting errors about platform directives like ng-for when using TestComponentBuilder. Seems like they're not "ambient" in the unit tests like they are during normal execution. I can fix it by including CORE_DIRECTIVES in the component, but that seems backward. Any ideas how to make them available?</p>
</blockquote> | 1 |
<pre class="notranslate">reported via private email
g% cat >/tmp/x.go
package main
import (
"time"
)
// fatal error: unexpected signal during runtime execution
func main() {
ch := make(chan struct{})
go func() {
t := time.Timer{}
t.Reset(1)
<-ch
}()
ch <- struct{}{}
}
g% go run /tmp/x.go
panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xb code=0x1 addr=0x0 pc=0x13f46]
goroutine 5 [running]:
runtime.gopanic(0x5b6c0, 0x2080d2060)
/Users/rsc/g/go/src/runtime/panic.go:426 +0x2a3
runtime.panicmem()
/Users/rsc/g/go/src/runtime/panic.go:42 +0x4e
runtime.sigpanic()
/Users/rsc/g/go/src/runtime/sigpanic_unix.go:26 +0x270
runtime.timerproc()
/Users/rsc/g/go/src/runtime/time.go:194 +0x216
runtime.goexit()
/Users/rsc/g/go/src/runtime/proc.c:1651
goroutine 1 [runnable]:
main.main()
/tmp/x.go:17 +0xe3
exit status 2
g%</pre> | <p dir="auto">by <strong>raheelgup</strong>:</p>
<pre class="notranslate">Hi,
This is in reference to the crypto/tls package which is very slow and CPU intensive than
it should be.
I had been discussing this here :
<a href="https://groups.google.com/forum/?fromgroups=#" rel="nofollow">https://groups.google.com/forum/?fromgroups=#</a>!topic/golang-nuts/QTDzrcDQmmw
I am using the following example as on the main go docs :
<a href="http://golang.org/pkg/net/http/#ListenAndServeTLS" rel="nofollow">http://golang.org/pkg/net/http/#ListenAndServeTLS</a>
I did a performance check on Windows 7 64 Bit for HTTPS connections and it is surprising
that it really performs badly.
My test methodology is simple, press F5 continously in chrome.
The CPU shot to 25-50% and the RAM also kept on increasing.
During the constant refresh, there are many "Connection was reset" messages.
As against this the normal ListenAndServe example is very stable. I did an ab.exe -n
10000 -c 1000 <a href="http://127.0.0.1:PORT/index.html" rel="nofollow">http://127.0.0.1:PORT/index.html</a> and it completes it in 60-70 seconds. The
MAX CPU touches 9-10% and RAM usage increases a little BIT and after the requests are
complete, it reaches near the previous RAM usage.
Adam from Golang also did a profiling :
(pprof) top10 -cum
Total: 1075 samples
0 0.0% 0.0% 827 76.9% schedunlock
0 0.0% 0.0% 822 76.5% net/http.(*conn).serve
0 0.0% 0.0% 813 75.6% crypto/tls.(*Conn).Handshake
0 0.0% 0.0% 813 75.6% crypto/tls.(*Conn).serverHandshake
2 0.2% 0.2% 578 53.8% crypto/elliptic.(*CurveParams).ScalarMult
0 0.0% 0.2% 495 46.0% crypto/tls.(*ecdheRSAKeyAgreement).generateServerKeyExchange
9 0.8% 1.0% 449 41.8% math/big.nat.div
135 12.6% 13.6% 431 40.1% math/big.nat.divLarge
8 0.7% 14.3% 347 32.3% math/big.(*Int).Mod
2 0.2% 14.5% 343 31.9% math/big.(*Int).QuoRem
So 75% of the time is being taken in handshaking and the rest is probably taken in
dealing with the garbage from that.
SO I am wondering if this can be fixed in the next GO Version.
Regards,
R</pre> | 0 |
<h3 dir="auto">Preflight Checklist</h3>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have read the <a href="https://github.com/electron/electron/blob/master/CONTRIBUTING.md">Contributing Guidelines</a> for this project.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I agree to follow the <a href="https://github.com/electron/electron/blob/master/CODE_OF_CONDUCT.md">Code of Conduct</a> that this project adheres to.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have searched the issue tracker for an issue that matches the one I want to file, without success.</li>
</ul>
<h3 dir="auto">Issue Details</h3>
<ul dir="auto">
<li><strong>Electron Version:</strong>
<ul dir="auto">
<li>10.1.3</li>
</ul>
</li>
<li><strong>Operating System:</strong>
<ul dir="auto">
<li>macOS 10.15.7</li>
</ul>
</li>
<li><strong>Last Known Working Electron version:</strong>
<ul dir="auto">
<li>8.5.2</li>
</ul>
</li>
</ul>
<h3 dir="auto">Expected Behavior</h3>
<p dir="auto">In my project I am loading ReactDevTool.</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="app.whenReady().then(async () => {
await createWindow();
await session.defaultSession.loadExtension(path.join(os.homedir(), extPath));
});"><pre class="notranslate"><span class="pl-s1">app</span><span class="pl-kos">.</span><span class="pl-en">whenReady</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-en">then</span><span class="pl-kos">(</span><span class="pl-k">async</span> <span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-c1">=></span> <span class="pl-kos">{</span>
<span class="pl-k">await</span> <span class="pl-en">createWindow</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-k">await</span> <span class="pl-s1">session</span><span class="pl-kos">.</span><span class="pl-c1">defaultSession</span><span class="pl-kos">.</span><span class="pl-en">loadExtension</span><span class="pl-kos">(</span><span class="pl-s1">path</span><span class="pl-kos">.</span><span class="pl-en">join</span><span class="pl-kos">(</span><span class="pl-s1">os</span><span class="pl-kos">.</span><span class="pl-en">homedir</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">,</span> <span class="pl-s1">extPath</span><span class="pl-kos">)</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">;</span></pre></div>
<p dir="auto">In the terminal for version 10.1.3 we see warnings:</p>
<div class="highlight highlight-source-shell notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="(node:6207) ExtensionLoadWarning: Warnings loading extension at /Users/foobar/Library/Application Support/Google/Chrome/Default/Extensions/fmkadmapgofadopljbjfkapdkoienihi/4.8.2_0:
Unrecognized manifest key 'browser_action'.
Unrecognized manifest key 'minimum_chrome_version'.
Unrecognized manifest key 'update_url'.
Manifest contains a differential_fingerprint key that will be overridden on extension update.
Cannot load extension with file or directory name _metadata.
Filenames starting with "_" are reserved for use by the system."><pre class="notranslate">(node:6207) ExtensionLoadWarning: Warnings loading extension at /Users/foobar/Library/Application Support/Google/Chrome/Default/Extensions/fmkadmapgofadopljbjfkapdkoienihi/4.8.2_0:
Unrecognized manifest key <span class="pl-s"><span class="pl-pds">'</span>browser_action<span class="pl-pds">'</span></span>.
Unrecognized manifest key <span class="pl-s"><span class="pl-pds">'</span>minimum_chrome_version<span class="pl-pds">'</span></span>.
Unrecognized manifest key <span class="pl-s"><span class="pl-pds">'</span>update_url<span class="pl-pds">'</span></span>.
Manifest contains a differential_fingerprint key that will be overridden on extension update.
Cannot load extension with file or directory name _metadata.
Filenames starting with <span class="pl-s"><span class="pl-pds">"</span>_<span class="pl-pds">"</span></span> are reserved <span class="pl-k">for</span> use by the system.</pre></div>
<p dir="auto">And the extension doesn't work.</p>
<h3 dir="auto">Actual Behavior</h3>
<p dir="auto">With warnings: <code class="notranslate">ExtensionLoadWarning</code>, no extension working.</p>
<h3 dir="auto">To Reproduce</h3>
<div class="highlight highlight-source-shell notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="$ git clone [email protected]:electron/electron-quick-start.git
$ cd electron-quick-start
$ npm install"><pre class="notranslate">$ git clone [email protected]:electron/electron-quick-start.git
$ <span class="pl-c1">cd</span> electron-quick-start
$ npm install</pre></div>
<p dir="auto">and edit <code class="notranslate">main.js</code></p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="// Modules to control application life and create native browser window
const { app, BrowserWindow, session } = require('electron');
const os = require('os');
const path = require('path');
const extPath =
'/Library/Application Support/Google/Chrome/Default/Extensions/fmkadmapgofadopljbjfkapdkoienihi/4.8.2_0';
async function createWindow() {
// Create the browser window.
const mainWindow = new BrowserWindow({
width: 800,
height: 600,
webPreferences: {
preload: path.join(__dirname, 'preload.js'),
},
});
// and load the index.html of the app.
await mainWindow.loadFile('index.html');
// Open the DevTools.
mainWindow.webContents.openDevTools({ mode: 'detach' });
}
// This method will be called when Electron has finished
// initialization and is ready to create browser windows.
// Some APIs can only be used after this event occurs.
app.whenReady().then(async () => {
await createWindow();
await session.defaultSession.loadExtension(path.join(os.homedir(), extPath));
});
// Quit when all windows are closed, except on macOS. There, it's common
// for applications and their menu bar to stay active until the user quits
// explicitly with Cmd + Q.
app.on('window-all-closed', function () {
app.quit();
});"><pre class="notranslate"><span class="pl-c">// Modules to control application life and create native browser window</span>
<span class="pl-k">const</span> <span class="pl-kos">{</span> app<span class="pl-kos">,</span> BrowserWindow<span class="pl-kos">,</span> session <span class="pl-kos">}</span> <span class="pl-c1">=</span> <span class="pl-en">require</span><span class="pl-kos">(</span><span class="pl-s">'electron'</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-k">const</span> <span class="pl-s1">os</span> <span class="pl-c1">=</span> <span class="pl-en">require</span><span class="pl-kos">(</span><span class="pl-s">'os'</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-k">const</span> <span class="pl-s1">path</span> <span class="pl-c1">=</span> <span class="pl-en">require</span><span class="pl-kos">(</span><span class="pl-s">'path'</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-k">const</span> <span class="pl-s1">extPath</span> <span class="pl-c1">=</span>
<span class="pl-s">'/Library/Application Support/Google/Chrome/Default/Extensions/fmkadmapgofadopljbjfkapdkoienihi/4.8.2_0'</span><span class="pl-kos">;</span>
<span class="pl-k">async</span> <span class="pl-k">function</span> <span class="pl-en">createWindow</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
<span class="pl-c">// Create the browser window.</span>
<span class="pl-k">const</span> <span class="pl-s1">mainWindow</span> <span class="pl-c1">=</span> <span class="pl-k">new</span> <span class="pl-v">BrowserWindow</span><span class="pl-kos">(</span><span class="pl-kos">{</span>
<span class="pl-c1">width</span>: <span class="pl-c1">800</span><span class="pl-kos">,</span>
<span class="pl-c1">height</span>: <span class="pl-c1">600</span><span class="pl-kos">,</span>
<span class="pl-c1">webPreferences</span>: <span class="pl-kos">{</span>
<span class="pl-c1">preload</span>: <span class="pl-s1">path</span><span class="pl-kos">.</span><span class="pl-en">join</span><span class="pl-kos">(</span><span class="pl-s1">__dirname</span><span class="pl-kos">,</span> <span class="pl-s">'preload.js'</span><span class="pl-kos">)</span><span class="pl-kos">,</span>
<span class="pl-kos">}</span><span class="pl-kos">,</span>
<span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-c">// and load the index.html of the app.</span>
<span class="pl-k">await</span> <span class="pl-s1">mainWindow</span><span class="pl-kos">.</span><span class="pl-en">loadFile</span><span class="pl-kos">(</span><span class="pl-s">'index.html'</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-c">// Open the DevTools.</span>
<span class="pl-s1">mainWindow</span><span class="pl-kos">.</span><span class="pl-c1">webContents</span><span class="pl-kos">.</span><span class="pl-en">openDevTools</span><span class="pl-kos">(</span><span class="pl-kos">{</span> <span class="pl-c1">mode</span>: <span class="pl-s">'detach'</span> <span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span>
<span class="pl-c">// This method will be called when Electron has finished</span>
<span class="pl-c">// initialization and is ready to create browser windows.</span>
<span class="pl-c">// Some APIs can only be used after this event occurs.</span>
<span class="pl-s1">app</span><span class="pl-kos">.</span><span class="pl-en">whenReady</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-en">then</span><span class="pl-kos">(</span><span class="pl-k">async</span> <span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-c1">=></span> <span class="pl-kos">{</span>
<span class="pl-k">await</span> <span class="pl-en">createWindow</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-k">await</span> <span class="pl-s1">session</span><span class="pl-kos">.</span><span class="pl-c1">defaultSession</span><span class="pl-kos">.</span><span class="pl-en">loadExtension</span><span class="pl-kos">(</span><span class="pl-s1">path</span><span class="pl-kos">.</span><span class="pl-en">join</span><span class="pl-kos">(</span><span class="pl-s1">os</span><span class="pl-kos">.</span><span class="pl-en">homedir</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">,</span> <span class="pl-s1">extPath</span><span class="pl-kos">)</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-c">// Quit when all windows are closed, except on macOS. There, it's common</span>
<span class="pl-c">// for applications and their menu bar to stay active until the user quits</span>
<span class="pl-c">// explicitly with Cmd + Q.</span>
<span class="pl-s1">app</span><span class="pl-kos">.</span><span class="pl-en">on</span><span class="pl-kos">(</span><span class="pl-s">'window-all-closed'</span><span class="pl-kos">,</span> <span class="pl-k">function</span> <span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
<span class="pl-s1">app</span><span class="pl-kos">.</span><span class="pl-en">quit</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">;</span></pre></div> | <h3 dir="auto">Preflight Checklist</h3>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have read the <a href="https://github.com/electron/electron/blob/master/CONTRIBUTING.md">Contributing Guidelines</a> for this project.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I agree to follow the <a href="https://github.com/electron/electron/blob/master/CODE_OF_CONDUCT.md">Code of Conduct</a> that this project adheres to.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have searched the issue tracker for an issue that matches the one I want to file, without success.</li>
</ul>
<h3 dir="auto">Issue Details</h3>
<ul dir="auto">
<li><strong>Electron Version:</strong>
<ul dir="auto">
<li>v9.0.0</li>
</ul>
</li>
<li><strong>Operating System:</strong>
<ul dir="auto">
<li>macOS 10.15.4</li>
</ul>
</li>
<li><strong>Last Known Working Electron version:</strong>
<ul dir="auto">
<li>8.2.0</li>
</ul>
</li>
</ul>
<h3 dir="auto">Expected Behavior</h3>
<p dir="auto">In our project we are loading ReactDevTool and ReduxDevTools.</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="app.on('ready', async () => {
await session.defaultSession.loadExtension(
path_to_devtools
);
});"><pre class="notranslate"><span class="pl-s1">app</span><span class="pl-kos">.</span><span class="pl-en">on</span><span class="pl-kos">(</span><span class="pl-s">'ready'</span><span class="pl-kos">,</span> <span class="pl-k">async</span> <span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-c1">=></span> <span class="pl-kos">{</span>
<span class="pl-k">await</span> <span class="pl-s1">session</span><span class="pl-kos">.</span><span class="pl-c1">defaultSession</span><span class="pl-kos">.</span><span class="pl-en">loadExtension</span><span class="pl-kos">(</span>
<span class="pl-s1">path_to_devtools</span>
<span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">;</span></pre></div>
<p dir="auto">In the terminal for version 9.0.0 we see warnings:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="(node:59148) ExtensionLoadWarning: Warnings loading extension at path_to_ext: Unrecognized manifest key 'browser_action'. Unrecognized manifest key 'minimum_chrome_version'. Unrecognized manifest key 'update_url'. Cannot load extension with file or directory name _metadata. Filenames starting with "_" are reserved for use by the system.
(node:59148) ExtensionLoadWarning: Warnings loading extension at path_to_ext: Unrecognized manifest key 'browser_action'. Unrecognized manifest key 'minimum_chrome_version'. Unrecognized manifest key 'update_url'. Cannot load extension with file or directory name _metadata. Filenames starting with "_" are reserved for use by the system.
(node:59148) ExtensionLoadWarning: Warnings loading extension at path_to_ext: Unrecognized manifest key 'commands'. Unrecognized manifest key 'homepage_url'. Unrecognized manifest key 'page_action'. Unrecognized manifest key 'short_name'. Unrecognized manifest key 'update_url'. Permission 'notifications' is unknown or URL pattern is malformed. Permission 'contextMenus' is unknown or URL pattern is malformed. Permission 'tabs' is unknown or URL pattern is malformed. Cannot load extension with file or directory name _metadata. Filenames starting with "_" are reserved for use by the system.
(node:59148) ExtensionLoadWarning: Warnings loading extension at path_to_ext: Unrecognized manifest key 'commands'. Unrecognized manifest key 'homepage_url'. Unrecognized manifest key 'page_action'. Unrecognized manifest key 'short_name'. Unrecognized manifest key 'update_url'. Permission 'notifications' is unknown or URL pattern is malformed. Permission 'contextMenus' is unknown or URL pattern is malformed. Permission 'tabs' is unknown or URL pattern is malformed. Cannot load extension with file or directory name _metadata. Filenames starting with "_" are reserved for use by the system."><pre class="notranslate"><code class="notranslate">(node:59148) ExtensionLoadWarning: Warnings loading extension at path_to_ext: Unrecognized manifest key 'browser_action'. Unrecognized manifest key 'minimum_chrome_version'. Unrecognized manifest key 'update_url'. Cannot load extension with file or directory name _metadata. Filenames starting with "_" are reserved for use by the system.
(node:59148) ExtensionLoadWarning: Warnings loading extension at path_to_ext: Unrecognized manifest key 'browser_action'. Unrecognized manifest key 'minimum_chrome_version'. Unrecognized manifest key 'update_url'. Cannot load extension with file or directory name _metadata. Filenames starting with "_" are reserved for use by the system.
(node:59148) ExtensionLoadWarning: Warnings loading extension at path_to_ext: Unrecognized manifest key 'commands'. Unrecognized manifest key 'homepage_url'. Unrecognized manifest key 'page_action'. Unrecognized manifest key 'short_name'. Unrecognized manifest key 'update_url'. Permission 'notifications' is unknown or URL pattern is malformed. Permission 'contextMenus' is unknown or URL pattern is malformed. Permission 'tabs' is unknown or URL pattern is malformed. Cannot load extension with file or directory name _metadata. Filenames starting with "_" are reserved for use by the system.
(node:59148) ExtensionLoadWarning: Warnings loading extension at path_to_ext: Unrecognized manifest key 'commands'. Unrecognized manifest key 'homepage_url'. Unrecognized manifest key 'page_action'. Unrecognized manifest key 'short_name'. Unrecognized manifest key 'update_url'. Permission 'notifications' is unknown or URL pattern is malformed. Permission 'contextMenus' is unknown or URL pattern is malformed. Permission 'tabs' is unknown or URL pattern is malformed. Cannot load extension with file or directory name _metadata. Filenames starting with "_" are reserved for use by the system.
</code></pre></div>
<p dir="auto">And both extensions don't work.</p>
<h3 dir="auto">Actual Behavior</h3>
<p dir="auto">No warnings in the terminal and working extensions.</p> | 1 |
<p dir="auto">Currently the tabs on SQL Lab queries show green circle when a query is running as well as when a query has successfully finished.</p>
<p dir="auto">The green circles for "query running" and "query completed" could be made more distinct - different color, or having the "query running" circle be hollow, and the "query completed" one filled in. This would enable users, who might go to SQL Lab and trigger few queries and then want to view results, visually see which of their queries are still running vs. finished.</p>
<p dir="auto">Screenshot current state:<br>
One query is running one has finished. User sees both as just a green circle.<br>
<a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/61221714/111344909-08df2900-863a-11eb-943f-4928154c4aa4.png"><img src="https://user-images.githubusercontent.com/61221714/111344909-08df2900-863a-11eb-943f-4928154c4aa4.png" alt="image" style="max-width: 100%;"></a></p> | <h4 dir="auto">Screenshots</h4>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/335541/104391321-8086bf80-54f4-11eb-8fdb-e2b3fa1c18b2.png"><img src="https://user-images.githubusercontent.com/335541/104391321-8086bf80-54f4-11eb-8fdb-e2b3fa1c18b2.png" alt="image" style="max-width: 100%;"></a></p>
<p dir="auto">Adding the new sample charts from the <code class="notranslate">video_game_sales</code> dataset to a new dashboard in the Edit mode will render the chart with an <code class="notranslate">unexpected error</code>, which seems to come from trying to getting datasource:</p>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/335541/104391375-a01de800-54f4-11eb-9937-cecd35d9926f.png"><img src="https://user-images.githubusercontent.com/335541/104391375-a01de800-54f4-11eb-9937-cecd35d9926f.png" width="400" style="max-width: 100%;"></a></p>
<p dir="auto">The error message says "Cannot find viz object"</p>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/335541/104391454-bdeb4d00-54f4-11eb-9536-5f3bd36cb1ee.png"><img src="https://user-images.githubusercontent.com/335541/104391454-bdeb4d00-54f4-11eb-9536-5f3bd36cb1ee.png" width="600" style="max-width: 100%;"></a></p>
<p dir="auto">Saving the dashboard and refresh the whole page, the charts can correctly render.</p>
<h4 dir="auto">How to reproduce the bug</h4>
<ol dir="auto">
<li>Duplicate a sample dashboard (e.g. "Sales Dashboard" and "FCC New Coder Survey 2018") and check "Also duplicate chart":<br>
<a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/335541/104405152-25af9100-5511-11eb-8672-abb7fb94d4cc.png"><img src="https://user-images.githubusercontent.com/335541/104405152-25af9100-5511-11eb-8672-abb7fb94d4cc.png" alt="image" style="max-width: 100%;"></a></li>
<li>Go to dashboard edit mode</li>
<li>Add the chart from the sample dataset</li>
</ol>
<h3 dir="auto">Environment</h3>
<p dir="auto">Latest master</p>
<h3 dir="auto">Checklist</h3>
<p dir="auto">Make sure to follow these steps before submitting your issue - thank you!</p>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> I have checked the superset logs for python stacktraces and included it here as text if there are any.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> I have reproduced the issue with at least the latest released version of superset.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> I have checked the issue tracker for the same issue and I haven't found one similar.</li>
</ul>
<h3 dir="auto">Additional context</h3>
<p dir="auto">Add any other context about the problem here.</p> | 0 |
<h2 dir="auto">Bug Report</h2>
<p dir="auto"><strong>Current Behavior</strong><br>
as of 7.5.0 the output of my distributed code has become more verbose. I'm not sure if it's a bug or intended side-effect of another change. If it's intended, I haven't worked out how to reduce the output again.</p>
<p dir="auto">Basically a single-line babel-helper has been replaced at the top of the file with multi in-line functions</p>
<p dir="auto"><strong>Input Code</strong></p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="const test = { t: 'test' };
const { t } = test;
const foo = (...args) => args;
const a = ['a', 'b', 'c'];
const b = [...a, 'foo'];
const c = foo(...a);
export const es6a = foo;
export const es6b = { ...test, t, a, b, c };"><pre class="notranslate"><span class="pl-k">const</span> <span class="pl-s1">test</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span> <span class="pl-c1">t</span>: <span class="pl-s">'test'</span> <span class="pl-kos">}</span><span class="pl-kos">;</span>
<span class="pl-k">const</span> <span class="pl-kos">{</span> t <span class="pl-kos">}</span> <span class="pl-c1">=</span> <span class="pl-s1">test</span><span class="pl-kos">;</span>
<span class="pl-k">const</span> <span class="pl-en">foo</span> <span class="pl-c1">=</span> <span class="pl-kos">(</span>...<span class="pl-s1">args</span><span class="pl-kos">)</span> <span class="pl-c1">=></span> <span class="pl-s1">args</span><span class="pl-kos">;</span>
<span class="pl-k">const</span> <span class="pl-s1">a</span> <span class="pl-c1">=</span> <span class="pl-kos">[</span><span class="pl-s">'a'</span><span class="pl-kos">,</span> <span class="pl-s">'b'</span><span class="pl-kos">,</span> <span class="pl-s">'c'</span><span class="pl-kos">]</span><span class="pl-kos">;</span>
<span class="pl-k">const</span> <span class="pl-s1">b</span> <span class="pl-c1">=</span> <span class="pl-kos">[</span>...<span class="pl-s1">a</span><span class="pl-kos">,</span> <span class="pl-s">'foo'</span><span class="pl-kos">]</span><span class="pl-kos">;</span>
<span class="pl-k">const</span> <span class="pl-s1">c</span> <span class="pl-c1">=</span> <span class="pl-en">foo</span><span class="pl-kos">(</span>...<span class="pl-s1">a</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-k">export</span> <span class="pl-k">const</span> <span class="pl-s1">es6a</span> <span class="pl-c1">=</span> <span class="pl-en">foo</span><span class="pl-kos">;</span>
<span class="pl-k">export</span> <span class="pl-k">const</span> <span class="pl-s1">es6b</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span> ...<span class="pl-s1">test</span><span class="pl-kos">,</span> t<span class="pl-kos">,</span> a<span class="pl-kos">,</span> b<span class="pl-kos">,</span> c <span class="pl-kos">}</span><span class="pl-kos">;</span></pre></div>
<p dir="auto"><strong>output</strong></p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="import _defineProperty from "@babel/runtime/helpers/defineProperty";
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(source, true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(source).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
var test = {
t: 'test'
};
var t = test.t;
var foo = function foo() {
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
return args;
};
var a = ['a', 'b', 'c'];
var b = [].concat(a, ['foo']);
var c = foo.apply(void 0, a);
export var es6a = foo;
export var es6b = _objectSpread({}, test, {
t: t,
a: a,
b: b,
c: c
});
"><pre class="notranslate"><span class="pl-k">import</span> <span class="pl-s1">_defineProperty</span> <span class="pl-k">from</span> <span class="pl-s">"@babel/runtime/helpers/defineProperty"</span><span class="pl-kos">;</span>
<span class="pl-k">function</span> <span class="pl-en">ownKeys</span><span class="pl-kos">(</span><span class="pl-s1">object</span><span class="pl-kos">,</span> <span class="pl-s1">enumerableOnly</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> <span class="pl-k">var</span> <span class="pl-s1">keys</span> <span class="pl-c1">=</span> <span class="pl-v">Object</span><span class="pl-kos">.</span><span class="pl-en">keys</span><span class="pl-kos">(</span><span class="pl-s1">object</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-k">if</span> <span class="pl-kos">(</span><span class="pl-v">Object</span><span class="pl-kos">.</span><span class="pl-c1">getOwnPropertySymbols</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> <span class="pl-k">var</span> <span class="pl-s1">symbols</span> <span class="pl-c1">=</span> <span class="pl-v">Object</span><span class="pl-kos">.</span><span class="pl-en">getOwnPropertySymbols</span><span class="pl-kos">(</span><span class="pl-s1">object</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-k">if</span> <span class="pl-kos">(</span><span class="pl-s1">enumerableOnly</span><span class="pl-kos">)</span> <span class="pl-s1">symbols</span> <span class="pl-c1">=</span> <span class="pl-s1">symbols</span><span class="pl-kos">.</span><span class="pl-en">filter</span><span class="pl-kos">(</span><span class="pl-k">function</span> <span class="pl-kos">(</span><span class="pl-s1">sym</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> <span class="pl-k">return</span> <span class="pl-v">Object</span><span class="pl-kos">.</span><span class="pl-en">getOwnPropertyDescriptor</span><span class="pl-kos">(</span><span class="pl-s1">object</span><span class="pl-kos">,</span> <span class="pl-s1">sym</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-c1">enumerable</span><span class="pl-kos">;</span> <span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-s1">keys</span><span class="pl-kos">.</span><span class="pl-c1">push</span><span class="pl-kos">.</span><span class="pl-en">apply</span><span class="pl-kos">(</span><span class="pl-s1">keys</span><span class="pl-kos">,</span> <span class="pl-s1">symbols</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-kos">}</span> <span class="pl-k">return</span> <span class="pl-s1">keys</span><span class="pl-kos">;</span> <span class="pl-kos">}</span>
<span class="pl-k">function</span> <span class="pl-en">_objectSpread</span><span class="pl-kos">(</span><span class="pl-s1">target</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> <span class="pl-k">for</span> <span class="pl-kos">(</span><span class="pl-k">var</span> <span class="pl-s1">i</span> <span class="pl-c1">=</span> <span class="pl-c1">1</span><span class="pl-kos">;</span> <span class="pl-s1">i</span> <span class="pl-c1"><</span> <span class="pl-smi">arguments</span><span class="pl-kos">.</span><span class="pl-c1">length</span><span class="pl-kos">;</span> <span class="pl-s1">i</span><span class="pl-c1">++</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> <span class="pl-k">var</span> <span class="pl-s1">source</span> <span class="pl-c1">=</span> <span class="pl-smi">arguments</span><span class="pl-kos">[</span><span class="pl-s1">i</span><span class="pl-kos">]</span> <span class="pl-c1">!=</span> <span class="pl-c1">null</span> ? <span class="pl-smi">arguments</span><span class="pl-kos">[</span><span class="pl-s1">i</span><span class="pl-kos">]</span> : <span class="pl-kos">{</span><span class="pl-kos">}</span><span class="pl-kos">;</span> <span class="pl-k">if</span> <span class="pl-kos">(</span><span class="pl-s1">i</span> <span class="pl-c1">%</span> <span class="pl-c1">2</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> <span class="pl-en">ownKeys</span><span class="pl-kos">(</span><span class="pl-s1">source</span><span class="pl-kos">,</span> <span class="pl-c1">true</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-en">forEach</span><span class="pl-kos">(</span><span class="pl-k">function</span> <span class="pl-kos">(</span><span class="pl-s1">key</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> <span class="pl-en">_defineProperty</span><span class="pl-kos">(</span><span class="pl-s1">target</span><span class="pl-kos">,</span> <span class="pl-s1">key</span><span class="pl-kos">,</span> <span class="pl-s1">source</span><span class="pl-kos">[</span><span class="pl-s1">key</span><span class="pl-kos">]</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-kos">}</span> <span class="pl-k">else</span> <span class="pl-k">if</span> <span class="pl-kos">(</span><span class="pl-v">Object</span><span class="pl-kos">.</span><span class="pl-c1">getOwnPropertyDescriptors</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> <span class="pl-v">Object</span><span class="pl-kos">.</span><span class="pl-en">defineProperties</span><span class="pl-kos">(</span><span class="pl-s1">target</span><span class="pl-kos">,</span> <span class="pl-v">Object</span><span class="pl-kos">.</span><span class="pl-en">getOwnPropertyDescriptors</span><span class="pl-kos">(</span><span class="pl-s1">source</span><span class="pl-kos">)</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-kos">}</span> <span class="pl-k">else</span> <span class="pl-kos">{</span> <span class="pl-en">ownKeys</span><span class="pl-kos">(</span><span class="pl-s1">source</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-en">forEach</span><span class="pl-kos">(</span><span class="pl-k">function</span> <span class="pl-kos">(</span><span class="pl-s1">key</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> <span class="pl-v">Object</span><span class="pl-kos">.</span><span class="pl-en">defineProperty</span><span class="pl-kos">(</span><span class="pl-s1">target</span><span class="pl-kos">,</span> <span class="pl-s1">key</span><span class="pl-kos">,</span> <span class="pl-v">Object</span><span class="pl-kos">.</span><span class="pl-en">getOwnPropertyDescriptor</span><span class="pl-kos">(</span><span class="pl-s1">source</span><span class="pl-kos">,</span> <span class="pl-s1">key</span><span class="pl-kos">)</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-kos">}</span> <span class="pl-kos">}</span> <span class="pl-k">return</span> <span class="pl-s1">target</span><span class="pl-kos">;</span> <span class="pl-kos">}</span>
<span class="pl-k">var</span> <span class="pl-s1">test</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span>
<span class="pl-c1">t</span>: <span class="pl-s">'test'</span>
<span class="pl-kos">}</span><span class="pl-kos">;</span>
<span class="pl-k">var</span> <span class="pl-s1">t</span> <span class="pl-c1">=</span> <span class="pl-s1">test</span><span class="pl-kos">.</span><span class="pl-c1">t</span><span class="pl-kos">;</span>
<span class="pl-k">var</span> <span class="pl-en">foo</span> <span class="pl-c1">=</span> <span class="pl-k">function</span> <span class="pl-en">foo</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
<span class="pl-k">for</span> <span class="pl-kos">(</span><span class="pl-k">var</span> <span class="pl-s1">_len</span> <span class="pl-c1">=</span> <span class="pl-smi">arguments</span><span class="pl-kos">.</span><span class="pl-c1">length</span><span class="pl-kos">,</span> <span class="pl-s1">args</span> <span class="pl-c1">=</span> <span class="pl-k">new</span> <span class="pl-v">Array</span><span class="pl-kos">(</span><span class="pl-s1">_len</span><span class="pl-kos">)</span><span class="pl-kos">,</span> <span class="pl-s1">_key</span> <span class="pl-c1">=</span> <span class="pl-c1">0</span><span class="pl-kos">;</span> <span class="pl-s1">_key</span> <span class="pl-c1"><</span> <span class="pl-s1">_len</span><span class="pl-kos">;</span> <span class="pl-s1">_key</span><span class="pl-c1">++</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
<span class="pl-s1">args</span><span class="pl-kos">[</span><span class="pl-s1">_key</span><span class="pl-kos">]</span> <span class="pl-c1">=</span> <span class="pl-smi">arguments</span><span class="pl-kos">[</span><span class="pl-s1">_key</span><span class="pl-kos">]</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span>
<span class="pl-k">return</span> <span class="pl-s1">args</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span><span class="pl-kos">;</span>
<span class="pl-k">var</span> <span class="pl-s1">a</span> <span class="pl-c1">=</span> <span class="pl-kos">[</span><span class="pl-s">'a'</span><span class="pl-kos">,</span> <span class="pl-s">'b'</span><span class="pl-kos">,</span> <span class="pl-s">'c'</span><span class="pl-kos">]</span><span class="pl-kos">;</span>
<span class="pl-k">var</span> <span class="pl-s1">b</span> <span class="pl-c1">=</span> <span class="pl-kos">[</span><span class="pl-kos">]</span><span class="pl-kos">.</span><span class="pl-en">concat</span><span class="pl-kos">(</span><span class="pl-s1">a</span><span class="pl-kos">,</span> <span class="pl-kos">[</span><span class="pl-s">'foo'</span><span class="pl-kos">]</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-k">var</span> <span class="pl-s1">c</span> <span class="pl-c1">=</span> <span class="pl-en">foo</span><span class="pl-kos">.</span><span class="pl-en">apply</span><span class="pl-kos">(</span><span class="pl-k">void</span> <span class="pl-c1">0</span><span class="pl-kos">,</span> <span class="pl-s1">a</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-k">export</span> <span class="pl-k">var</span> <span class="pl-s1">es6a</span> <span class="pl-c1">=</span> <span class="pl-en">foo</span><span class="pl-kos">;</span>
<span class="pl-k">export</span> <span class="pl-k">var</span> <span class="pl-s1">es6b</span> <span class="pl-c1">=</span> <span class="pl-en">_objectSpread</span><span class="pl-kos">(</span><span class="pl-kos">{</span><span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-s1">test</span><span class="pl-kos">,</span> <span class="pl-kos">{</span>
<span class="pl-c1">t</span>: <span class="pl-s1">t</span><span class="pl-kos">,</span>
<span class="pl-c1">a</span>: <span class="pl-s1">a</span><span class="pl-kos">,</span>
<span class="pl-c1">b</span>: <span class="pl-s1">b</span><span class="pl-kos">,</span>
<span class="pl-c1">c</span>: <span class="pl-s1">c</span>
<span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
</pre></div>
<p dir="auto"><strong>Expected behavior/code</strong><br>
previously, 7.4.4, output included a helper and much less code.</p>
<p dir="auto"><strong>output</strong></p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="import _objectSpread from "@babel/runtime/helpers/objectSpread";
var test = {
t: 'test'
};
var t = test.t;
var foo = function foo() {
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
return args;
};
var a = ['a', 'b', 'c'];
var b = [].concat(a, ['foo']);
var c = foo.apply(void 0, a);
export var es6a = foo;
export var es6b = _objectSpread({}, test, {
t: t,
a: a,
b: b,
c: c
});
"><pre class="notranslate"><span class="pl-k">import</span> <span class="pl-s1">_objectSpread</span> <span class="pl-k">from</span> <span class="pl-s">"@babel/runtime/helpers/objectSpread"</span><span class="pl-kos">;</span>
<span class="pl-k">var</span> <span class="pl-s1">test</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span>
<span class="pl-c1">t</span>: <span class="pl-s">'test'</span>
<span class="pl-kos">}</span><span class="pl-kos">;</span>
<span class="pl-k">var</span> <span class="pl-s1">t</span> <span class="pl-c1">=</span> <span class="pl-s1">test</span><span class="pl-kos">.</span><span class="pl-c1">t</span><span class="pl-kos">;</span>
<span class="pl-k">var</span> <span class="pl-en">foo</span> <span class="pl-c1">=</span> <span class="pl-k">function</span> <span class="pl-en">foo</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
<span class="pl-k">for</span> <span class="pl-kos">(</span><span class="pl-k">var</span> <span class="pl-s1">_len</span> <span class="pl-c1">=</span> <span class="pl-smi">arguments</span><span class="pl-kos">.</span><span class="pl-c1">length</span><span class="pl-kos">,</span> <span class="pl-s1">args</span> <span class="pl-c1">=</span> <span class="pl-k">new</span> <span class="pl-v">Array</span><span class="pl-kos">(</span><span class="pl-s1">_len</span><span class="pl-kos">)</span><span class="pl-kos">,</span> <span class="pl-s1">_key</span> <span class="pl-c1">=</span> <span class="pl-c1">0</span><span class="pl-kos">;</span> <span class="pl-s1">_key</span> <span class="pl-c1"><</span> <span class="pl-s1">_len</span><span class="pl-kos">;</span> <span class="pl-s1">_key</span><span class="pl-c1">++</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
<span class="pl-s1">args</span><span class="pl-kos">[</span><span class="pl-s1">_key</span><span class="pl-kos">]</span> <span class="pl-c1">=</span> <span class="pl-smi">arguments</span><span class="pl-kos">[</span><span class="pl-s1">_key</span><span class="pl-kos">]</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span>
<span class="pl-k">return</span> <span class="pl-s1">args</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span><span class="pl-kos">;</span>
<span class="pl-k">var</span> <span class="pl-s1">a</span> <span class="pl-c1">=</span> <span class="pl-kos">[</span><span class="pl-s">'a'</span><span class="pl-kos">,</span> <span class="pl-s">'b'</span><span class="pl-kos">,</span> <span class="pl-s">'c'</span><span class="pl-kos">]</span><span class="pl-kos">;</span>
<span class="pl-k">var</span> <span class="pl-s1">b</span> <span class="pl-c1">=</span> <span class="pl-kos">[</span><span class="pl-kos">]</span><span class="pl-kos">.</span><span class="pl-en">concat</span><span class="pl-kos">(</span><span class="pl-s1">a</span><span class="pl-kos">,</span> <span class="pl-kos">[</span><span class="pl-s">'foo'</span><span class="pl-kos">]</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-k">var</span> <span class="pl-s1">c</span> <span class="pl-c1">=</span> <span class="pl-en">foo</span><span class="pl-kos">.</span><span class="pl-en">apply</span><span class="pl-kos">(</span><span class="pl-k">void</span> <span class="pl-c1">0</span><span class="pl-kos">,</span> <span class="pl-s1">a</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-k">export</span> <span class="pl-k">var</span> <span class="pl-s1">es6a</span> <span class="pl-c1">=</span> <span class="pl-en">foo</span><span class="pl-kos">;</span>
<span class="pl-k">export</span> <span class="pl-k">var</span> <span class="pl-s1">es6b</span> <span class="pl-c1">=</span> <span class="pl-en">_objectSpread</span><span class="pl-kos">(</span><span class="pl-kos">{</span><span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-s1">test</span><span class="pl-kos">,</span> <span class="pl-kos">{</span>
<span class="pl-c1">t</span>: <span class="pl-s1">t</span><span class="pl-kos">,</span>
<span class="pl-c1">a</span>: <span class="pl-s1">a</span><span class="pl-kos">,</span>
<span class="pl-c1">b</span>: <span class="pl-s1">b</span><span class="pl-kos">,</span>
<span class="pl-c1">c</span>: <span class="pl-s1">c</span>
<span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
</pre></div>
<p dir="auto"><strong>Babel Configuration (.babelrc, package.json, cli command)</strong></p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="module.exports = function babelConfig(api) {
api.cache(true);
return {
presets: [
[
require('@babel/preset-env'),
{
modules: false,
},
],
],
plugins: [
require('@babel/plugin-transform-runtime'),
require('@babel/plugin-proposal-object-rest-spread'),
],
};
};
"><pre class="notranslate"><span class="pl-smi">module</span><span class="pl-kos">.</span><span class="pl-en">exports</span> <span class="pl-c1">=</span> <span class="pl-k">function</span> <span class="pl-en">babelConfig</span><span class="pl-kos">(</span><span class="pl-s1">api</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
<span class="pl-s1">api</span><span class="pl-kos">.</span><span class="pl-en">cache</span><span class="pl-kos">(</span><span class="pl-c1">true</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-k">return</span> <span class="pl-kos">{</span>
<span class="pl-c1">presets</span>: <span class="pl-kos">[</span>
<span class="pl-kos">[</span>
<span class="pl-en">require</span><span class="pl-kos">(</span><span class="pl-s">'@babel/preset-env'</span><span class="pl-kos">)</span><span class="pl-kos">,</span>
<span class="pl-kos">{</span>
<span class="pl-c1">modules</span>: <span class="pl-c1">false</span><span class="pl-kos">,</span>
<span class="pl-kos">}</span><span class="pl-kos">,</span>
<span class="pl-kos">]</span><span class="pl-kos">,</span>
<span class="pl-kos">]</span><span class="pl-kos">,</span>
<span class="pl-c1">plugins</span>: <span class="pl-kos">[</span>
<span class="pl-en">require</span><span class="pl-kos">(</span><span class="pl-s">'@babel/plugin-transform-runtime'</span><span class="pl-kos">)</span><span class="pl-kos">,</span>
<span class="pl-en">require</span><span class="pl-kos">(</span><span class="pl-s">'@babel/plugin-proposal-object-rest-spread'</span><span class="pl-kos">)</span><span class="pl-kos">,</span>
<span class="pl-kos">]</span><span class="pl-kos">,</span>
<span class="pl-kos">}</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span><span class="pl-kos">;</span></pre></div>
<p dir="auto"><strong>Environment</strong></p>
<ul dir="auto">
<li>Babel version(s): <code class="notranslate">7.6.0</code></li>
<li>Node/npm version: <code class="notranslate">v10.16.0</code></li>
<li>OS: <code class="notranslate">OSX 10.14.6</code></li>
<li>Monorepo: yes, but reproduce-able in 2 files (js + config)</li>
<li>How you are using Babel: cli for reproducable example (but found change via node api)</li>
</ul>
<p dir="auto"><strong>Possible Solution</strong><br>
<g-emoji class="g-emoji" alias="thinking" fallback-src="https://github.githubassets.com/images/icons/emoji/unicode/1f914.png">🤔</g-emoji></p>
<p dir="auto">playing with the browser targets gives a desired output.</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="targets: {
browsers: [ 'Chrome >= 61', 'Firefox >= 60', 'Opera >= 48' ],
},"><pre class="notranslate"><code class="notranslate">targets: {
browsers: [ 'Chrome >= 61', 'Firefox >= 60', 'Opera >= 48' ],
},
</code></pre></div>
<p dir="auto">has there been an update to the spec which these browsers no longer support?<br>
is there another plugin or way that i can fill this gap rather than adding this code at the top of the file?</p>
<p dir="auto"><strong>Additional context/Screenshots</strong><br>
none</p> | <h2 dir="auto">Bug report</h2>
<h3 dir="auto">Input Code</h3>
<p dir="auto">I have the next code:</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="class ThrottleError extends Error {
constructor() {
super();
this.name = 'ThrottleError';
this.message = 'Too many function call';
if (Error.captureStackTrace) {
Error.captureStackTrace(this, ThrottleError);
} else {
this.stack = new Error().stack;
}
}
}
try {
const e = new ThrottleError();
throw e;
} catch (error) {
console.log('error instanceof ThrottleError = ', error instanceof ThrottleError);
}"><pre class="notranslate"><span class="pl-k">class</span> <span class="pl-v">ThrottleError</span> <span class="pl-k">extends</span> <span class="pl-v">Error</span> <span class="pl-kos">{</span>
<span class="pl-en">constructor</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
<span class="pl-smi">super</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">name</span> <span class="pl-c1">=</span> <span class="pl-s">'ThrottleError'</span><span class="pl-kos">;</span>
<span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">message</span> <span class="pl-c1">=</span> <span class="pl-s">'Too many function call'</span><span class="pl-kos">;</span>
<span class="pl-k">if</span> <span class="pl-kos">(</span><span class="pl-v">Error</span><span class="pl-kos">.</span><span class="pl-c1">captureStackTrace</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
<span class="pl-v">Error</span><span class="pl-kos">.</span><span class="pl-en">captureStackTrace</span><span class="pl-kos">(</span><span class="pl-smi">this</span><span class="pl-kos">,</span> <span class="pl-v">ThrottleError</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span> <span class="pl-k">else</span> <span class="pl-kos">{</span>
<span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">stack</span> <span class="pl-c1">=</span> <span class="pl-k">new</span> <span class="pl-v">Error</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-c1">stack</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span>
<span class="pl-kos">}</span>
<span class="pl-kos">}</span>
<span class="pl-k">try</span> <span class="pl-kos">{</span>
<span class="pl-k">const</span> <span class="pl-s1">e</span> <span class="pl-c1">=</span> <span class="pl-k">new</span> <span class="pl-v">ThrottleError</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-k">throw</span> <span class="pl-s1">e</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span> <span class="pl-k">catch</span> <span class="pl-kos">(</span><span class="pl-s1">error</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
<span class="pl-smi">console</span><span class="pl-kos">.</span><span class="pl-en">log</span><span class="pl-kos">(</span><span class="pl-s">'error instanceof ThrottleError = '</span><span class="pl-kos">,</span> <span class="pl-s1">error</span> <span class="pl-k">instanceof</span> <span class="pl-v">ThrottleError</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span></pre></div>
<h3 dir="auto">Expected Behavior</h3>
<p dir="auto">When I run the above code in the console of Google Chrome v58 or node.js v8.5 I get the next output, which is expected behavior:<br>
<code class="notranslate">error instanceof ThrottleError = true</code></p>
<h3 dir="auto">Current Behavior</h3>
<p dir="auto">After transpilation the above code becomes the next:</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
let ThrottleError = function (_Error) {
_inherits(ThrottleError, _Error);
function ThrottleError() {
_classCallCheck(this, ThrottleError);
var _this = _possibleConstructorReturn(this, (ThrottleError.__proto__ || Object.getPrototypeOf(ThrottleError)).call(this));
_this.name = 'ThrottleError';
_this.message = 'Too many function call';
if (Error.captureStackTrace) {
Error.captureStackTrace(_this, ThrottleError);
} else {
_this.stack = new Error().stack;
}
return _this;
}
return ThrottleError;
}(Error);
try {
const e = new ThrottleError();
throw e;
} catch (error) {
console.log('error instanceof ThrottleError = ', error instanceof ThrottleError);
}"><pre class="notranslate"><span class="pl-k">function</span> <span class="pl-en">_classCallCheck</span><span class="pl-kos">(</span><span class="pl-s1">instance</span><span class="pl-kos">,</span> <span class="pl-v">Constructor</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> <span class="pl-k">if</span> <span class="pl-kos">(</span><span class="pl-c1">!</span><span class="pl-kos">(</span><span class="pl-s1">instance</span> <span class="pl-k">instanceof</span> <span class="pl-v">Constructor</span><span class="pl-kos">)</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> <span class="pl-k">throw</span> <span class="pl-k">new</span> <span class="pl-v">TypeError</span><span class="pl-kos">(</span><span class="pl-s">"Cannot call a class as a function"</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-kos">}</span> <span class="pl-kos">}</span>
<span class="pl-k">function</span> <span class="pl-en">_possibleConstructorReturn</span><span class="pl-kos">(</span><span class="pl-s1">self</span><span class="pl-kos">,</span> <span class="pl-s1">call</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> <span class="pl-k">if</span> <span class="pl-kos">(</span><span class="pl-c1">!</span><span class="pl-s1">self</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> <span class="pl-k">throw</span> <span class="pl-k">new</span> <span class="pl-v">ReferenceError</span><span class="pl-kos">(</span><span class="pl-s">"this hasn't been initialised - super() hasn't been called"</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-kos">}</span> <span class="pl-k">return</span> <span class="pl-s1">call</span> <span class="pl-c1">&&</span> <span class="pl-kos">(</span><span class="pl-k">typeof</span> <span class="pl-s1">call</span> <span class="pl-c1">===</span> <span class="pl-s">"object"</span> <span class="pl-c1">||</span> <span class="pl-k">typeof</span> <span class="pl-s1">call</span> <span class="pl-c1">===</span> <span class="pl-s">"function"</span><span class="pl-kos">)</span> ? <span class="pl-s1">call</span> : <span class="pl-s1">self</span><span class="pl-kos">;</span> <span class="pl-kos">}</span>
<span class="pl-k">function</span> <span class="pl-en">_inherits</span><span class="pl-kos">(</span><span class="pl-s1">subClass</span><span class="pl-kos">,</span> <span class="pl-s1">superClass</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> <span class="pl-k">if</span> <span class="pl-kos">(</span><span class="pl-k">typeof</span> <span class="pl-s1">superClass</span> <span class="pl-c1">!==</span> <span class="pl-s">"function"</span> <span class="pl-c1">&&</span> <span class="pl-s1">superClass</span> <span class="pl-c1">!==</span> <span class="pl-c1">null</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> <span class="pl-k">throw</span> <span class="pl-k">new</span> <span class="pl-v">TypeError</span><span class="pl-kos">(</span><span class="pl-s">"Super expression must either be null or a function, not "</span> <span class="pl-c1">+</span> <span class="pl-k">typeof</span> <span class="pl-s1">superClass</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-kos">}</span> <span class="pl-s1">subClass</span><span class="pl-kos">.</span><span class="pl-c1">prototype</span> <span class="pl-c1">=</span> <span class="pl-v">Object</span><span class="pl-kos">.</span><span class="pl-en">create</span><span class="pl-kos">(</span><span class="pl-s1">superClass</span> <span class="pl-c1">&&</span> <span class="pl-s1">superClass</span><span class="pl-kos">.</span><span class="pl-c1">prototype</span><span class="pl-kos">,</span> <span class="pl-kos">{</span> <span class="pl-c1">constructor</span>: <span class="pl-kos">{</span> <span class="pl-c1">value</span>: <span class="pl-s1">subClass</span><span class="pl-kos">,</span> <span class="pl-c1">enumerable</span>: <span class="pl-c1">false</span><span class="pl-kos">,</span> <span class="pl-c1">writable</span>: <span class="pl-c1">true</span><span class="pl-kos">,</span> <span class="pl-c1">configurable</span>: <span class="pl-c1">true</span> <span class="pl-kos">}</span> <span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-k">if</span> <span class="pl-kos">(</span><span class="pl-s1">superClass</span><span class="pl-kos">)</span> <span class="pl-v">Object</span><span class="pl-kos">.</span><span class="pl-c1">setPrototypeOf</span> ? <span class="pl-v">Object</span><span class="pl-kos">.</span><span class="pl-en">setPrototypeOf</span><span class="pl-kos">(</span><span class="pl-s1">subClass</span><span class="pl-kos">,</span> <span class="pl-s1">superClass</span><span class="pl-kos">)</span> : <span class="pl-s1">subClass</span><span class="pl-kos">.</span><span class="pl-c1">__proto__</span> <span class="pl-c1">=</span> <span class="pl-s1">superClass</span><span class="pl-kos">;</span> <span class="pl-kos">}</span>
<span class="pl-k">let</span> <span class="pl-v">ThrottleError</span> <span class="pl-c1">=</span> <span class="pl-k">function</span> <span class="pl-kos">(</span><span class="pl-s1">_Error</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
<span class="pl-en">_inherits</span><span class="pl-kos">(</span><span class="pl-v">ThrottleError</span><span class="pl-kos">,</span> <span class="pl-s1">_Error</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-k">function</span> <span class="pl-v">ThrottleError</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
<span class="pl-en">_classCallCheck</span><span class="pl-kos">(</span><span class="pl-smi">this</span><span class="pl-kos">,</span> <span class="pl-v">ThrottleError</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-k">var</span> <span class="pl-s1">_this</span> <span class="pl-c1">=</span> <span class="pl-en">_possibleConstructorReturn</span><span class="pl-kos">(</span><span class="pl-smi">this</span><span class="pl-kos">,</span> <span class="pl-kos">(</span><span class="pl-v">ThrottleError</span><span class="pl-kos">.</span><span class="pl-c1">__proto__</span> <span class="pl-c1">||</span> <span class="pl-v">Object</span><span class="pl-kos">.</span><span class="pl-en">getPrototypeOf</span><span class="pl-kos">(</span><span class="pl-v">ThrottleError</span><span class="pl-kos">)</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-en">call</span><span class="pl-kos">(</span><span class="pl-smi">this</span><span class="pl-kos">)</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-s1">_this</span><span class="pl-kos">.</span><span class="pl-c1">name</span> <span class="pl-c1">=</span> <span class="pl-s">'ThrottleError'</span><span class="pl-kos">;</span>
<span class="pl-s1">_this</span><span class="pl-kos">.</span><span class="pl-c1">message</span> <span class="pl-c1">=</span> <span class="pl-s">'Too many function call'</span><span class="pl-kos">;</span>
<span class="pl-k">if</span> <span class="pl-kos">(</span><span class="pl-v">Error</span><span class="pl-kos">.</span><span class="pl-c1">captureStackTrace</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
<span class="pl-v">Error</span><span class="pl-kos">.</span><span class="pl-en">captureStackTrace</span><span class="pl-kos">(</span><span class="pl-s1">_this</span><span class="pl-kos">,</span> <span class="pl-v">ThrottleError</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span> <span class="pl-k">else</span> <span class="pl-kos">{</span>
<span class="pl-s1">_this</span><span class="pl-kos">.</span><span class="pl-c1">stack</span> <span class="pl-c1">=</span> <span class="pl-k">new</span> <span class="pl-v">Error</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-c1">stack</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span>
<span class="pl-k">return</span> <span class="pl-s1">_this</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span>
<span class="pl-k">return</span> <span class="pl-v">ThrottleError</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span><span class="pl-kos">(</span><span class="pl-v">Error</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-k">try</span> <span class="pl-kos">{</span>
<span class="pl-k">const</span> <span class="pl-s1">e</span> <span class="pl-c1">=</span> <span class="pl-k">new</span> <span class="pl-v">ThrottleError</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-k">throw</span> <span class="pl-s1">e</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span> <span class="pl-k">catch</span> <span class="pl-kos">(</span><span class="pl-s1">error</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
<span class="pl-smi">console</span><span class="pl-kos">.</span><span class="pl-en">log</span><span class="pl-kos">(</span><span class="pl-s">'error instanceof ThrottleError = '</span><span class="pl-kos">,</span> <span class="pl-s1">error</span> <span class="pl-k">instanceof</span> <span class="pl-v">ThrottleError</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span></pre></div>
<p dir="auto">When I run the transpiled code it in the console of Google Chrome v58 or node.js v8.5 I get the next output:<br>
<code class="notranslate">error instanceof ThrottleError = false</code></p>
<p dir="auto">So it seems that <strong>transpilation of ES2015 Classes in this case works wrong</strong>!</p>
<h3 dir="auto">Possible Solution</h3>
<p dir="auto">After the transpilation, the code should be consistent with smth like the next (1):</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="function ThrottleError() {
Error.call(this);
this.name = 'ThrottleError';
this.message = 'Too many function call';
if (Error.captureStackTrace) {
Error.captureStackTrace(this, ThrottleError);
} else {
this.stack = new Error().stack;
}
}
ThrottleError.prototype = Object.create(Error.prototype);
ThrottleError.prototype.constructor = ThrottleError;"><pre class="notranslate"><span class="pl-k">function</span> <span class="pl-v">ThrottleError</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
<span class="pl-v">Error</span><span class="pl-kos">.</span><span class="pl-en">call</span><span class="pl-kos">(</span><span class="pl-smi">this</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">name</span> <span class="pl-c1">=</span> <span class="pl-s">'ThrottleError'</span><span class="pl-kos">;</span>
<span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">message</span> <span class="pl-c1">=</span> <span class="pl-s">'Too many function call'</span><span class="pl-kos">;</span>
<span class="pl-k">if</span> <span class="pl-kos">(</span><span class="pl-v">Error</span><span class="pl-kos">.</span><span class="pl-c1">captureStackTrace</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
<span class="pl-v">Error</span><span class="pl-kos">.</span><span class="pl-en">captureStackTrace</span><span class="pl-kos">(</span><span class="pl-smi">this</span><span class="pl-kos">,</span> <span class="pl-v">ThrottleError</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span> <span class="pl-k">else</span> <span class="pl-kos">{</span>
<span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">stack</span> <span class="pl-c1">=</span> <span class="pl-k">new</span> <span class="pl-v">Error</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-c1">stack</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span>
<span class="pl-kos">}</span>
<span class="pl-v">ThrottleError</span><span class="pl-kos">.</span><span class="pl-c1">prototype</span> <span class="pl-c1">=</span> <span class="pl-v">Object</span><span class="pl-kos">.</span><span class="pl-en">create</span><span class="pl-kos">(</span><span class="pl-v">Error</span><span class="pl-kos">.</span><span class="pl-c1">prototype</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-v">ThrottleError</span><span class="pl-kos">.</span><span class="pl-c1">prototype</span><span class="pl-kos">.</span><span class="pl-c1">constructor</span> <span class="pl-c1">=</span> <span class="pl-v">ThrottleError</span><span class="pl-kos">;</span></pre></div>
<h3 dir="auto">Babel Configuration</h3>
<p dir="auto">At the moment the bug is reproduced in the browser at <a href="http://babeljs.io/repl/" rel="nofollow">http://babeljs.io/repl/</a></p>
<p dir="auto">Also, my configuration for running in node.js is:<br>
<strong>.babelrc</strong>:</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="{
"plugins": ["transform-es2015-classes"]
}"><pre class="notranslate"><span class="pl-kos">{</span>
<span class="pl-s">"plugins"</span>: <span class="pl-kos">[</span><span class="pl-s">"transform-es2015-classes"</span><span class="pl-kos">]</span>
<span class="pl-kos">}</span></pre></div>
<p dir="auto"><strong>package.json</strong>:</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="{
"name": "test",
"version": "0.0.1",
"devDependencies": {
"babel-cli": "^6.26.0",
"babel-core": "^6.26.0",
"babel-plugin-transform-es2015-classes": "^6.24.1"
}
}"><pre class="notranslate"><span class="pl-kos">{</span>
<span class="pl-s">"name"</span>: <span class="pl-s">"test"</span><span class="pl-kos">,</span>
<span class="pl-s">"version"</span>: <span class="pl-s">"0.0.1"</span><span class="pl-kos">,</span>
<span class="pl-s">"devDependencies"</span>: <span class="pl-kos">{</span>
<span class="pl-s">"babel-cli"</span>: <span class="pl-s">"^6.26.0"</span><span class="pl-kos">,</span>
<span class="pl-s">"babel-core"</span>: <span class="pl-s">"^6.26.0"</span><span class="pl-kos">,</span>
<span class="pl-s">"babel-plugin-transform-es2015-classes"</span>: <span class="pl-s">"^6.24.1"</span>
<span class="pl-kos">}</span>
<span class="pl-kos">}</span></pre></div>
<hr>
<p dir="auto">Fix it plz cuz due to the bug I have to explicitly use the old syntax (1) in my src code in this case. <g-emoji class="g-emoji" alias="blush" fallback-src="https://github.githubassets.com/images/icons/emoji/unicode/1f60a.png">😊</g-emoji></p> | 0 |
<p dir="auto">I have this use case right now:</p>
<ul dir="auto">
<li>with flutter command -> can't run app in debug cause of multidex</li>
<li>with Android studio -> run without problem because for debug version it enable multidex by default</li>
</ul>
<p dir="auto">So I'm basically force to enable multidex just to be able to run the app in debug from a Flutter project. Flutter should be able to have the same behavior to avoid enabling multidex for nothing.</p> | <h2 dir="auto">Steps to Reproduce</h2>
<p dir="auto">Build app with more than 64K methods.</p>
<h2 dir="auto">Logs</h2>
<blockquote>
<p dir="auto">The number of method references in a .dex file cannot exceed 64K.<br>
Learn how to resolve this issue at <a href="https://developer.android.com/tools/building/multidex.html" rel="nofollow">https://developer.android.com/tools/building/multidex.html</a></p>
</blockquote>
<h2 dir="auto">Recommended Changes</h2>
<ol dir="auto">
<li>
<p dir="auto">Project template or <code class="notranslate">flutter.gradle</code> script should set the <code class="notranslate">multiDexEnabled</code> property to true, and add the <code class="notranslate">multiDexKeepFile file('multidex-flutter.txt')</code> config file. Example: <a href="https://github.com/flutter/flutter/files/2320127/multidex-flutter.txt">multidex-flutter.txt</a></p>
<div class="highlight highlight-text-adblock notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="io/flutter/app/FlutterApplication.class
io/flutter/view/FlutterMain.class
io/flutter/util/PathUtils.class"><pre class="notranslate">io/flutter/app/FlutterApplication.class
io/flutter/view/FlutterMain.class
io/flutter/util/PathUtils.class</pre></div>
</li>
<li>
<p dir="auto">Project template or <code class="notranslate">flutter.gradle</code> script should add the multidex dependency.<br>
<code class="notranslate">implementation 'com.android.support:multidex:1.0.3'</code></p>
</li>
<li>
<p dir="auto">FlutterApplication should have the following addition.</p>
<div class="highlight highlight-source-java notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="@Override
protected void attachBaseContext(Context base)
{
super.attachBaseContext(base);
MultiDex.install(this);
}"><pre class="notranslate"><span class="pl-c1">@</span><span class="pl-c1">Override</span>
<span class="pl-k">protected</span> <span class="pl-smi">void</span> <span class="pl-s1">attachBaseContext</span>(<span class="pl-smi">Context</span> <span class="pl-s1">base</span>)
{
<span class="pl-en">super</span>.<span class="pl-en">attachBaseContext</span>(<span class="pl-s1">base</span>);
<span class="pl-smi">MultiDex</span>.<span class="pl-en">install</span>(<span class="pl-smi">this</span>);
}</pre></div>
</li>
</ol>
<p dir="auto"><strong>Adding the <code class="notranslate">multiDexKeepFile</code> is important as the <code class="notranslate">FlutterApplication</code> class and its dependencies are required to me in the primary dex file or the Application class may its onCreate lifecycle event.</strong></p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Flutter 0.5.7 • channel v0.5.7 • https://github.com/slightfoot/flutter
Framework • revision 66091f9696 (7 weeks ago) • 2018-07-09 12:52:41 -0700
Engine • revision 6fe748490d
Tools • Dart 2.0.0-dev.63.0.flutter-4c9689c1d2"><pre class="notranslate"><code class="notranslate">Flutter 0.5.7 • channel v0.5.7 • https://github.com/slightfoot/flutter
Framework • revision 66091f9696 (7 weeks ago) • 2018-07-09 12:52:41 -0700
Engine • revision 6fe748490d
Tools • Dart 2.0.0-dev.63.0.flutter-4c9689c1d2
</code></pre></div> | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.